diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..788149656b8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,185 @@ + +# EditorConfig is awesome:http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Don't use tabs for indentation. +[*] +indent_style = space +# (Please don't specify an indent_size here; that has too many unintended consequences.) + +[*.yml] +indent_style = space +indent_size = 2 + +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 +insert_final_newline = true +charset = utf-8-bom + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# Xml config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + +# JSON files +[*.json] +indent_size = 2 + +[*.{sh}] +end_of_line = lf +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Use language keywords instead of framework type names for type references +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Suggest more modern language features when available +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion + +# Non-private static fields are PascalCase +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields +dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style + +dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field +dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected +dotnet_naming_symbols.non_private_static_fields.required_modifiers = static + +dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case + +# Constants are PascalCase +dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants +dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style + +dotnet_naming_symbols.constants.applicable_kinds = field, local +dotnet_naming_symbols.constants.required_modifiers = const + +dotnet_naming_style.constant_style.capitalization = pascal_case + +# Static fields are camelCase and start with s_ +dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion +dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields +dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style + +dotnet_naming_symbols.static_fields.applicable_kinds = field +dotnet_naming_symbols.static_fields.required_modifiers = static + +dotnet_naming_style.static_field_style.capitalization = camel_case +dotnet_naming_style.static_field_style.required_prefix = s_ + +# Instance fields are camelCase and start with _ +dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion +dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields +dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style + +dotnet_naming_symbols.instance_fields.applicable_kinds = field + +dotnet_naming_style.instance_field_style.capitalization = camel_case +dotnet_naming_style.instance_field_style.required_prefix = _ + +# Locals and parameters are camelCase +dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion +dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters +dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style + +dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local + +dotnet_naming_style.camel_case_style.capitalization = camel_case + +# Local functions are PascalCase +dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions +dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style + +dotnet_naming_symbols.local_functions.applicable_kinds = local_function + +dotnet_naming_style.local_function_style.capitalization = pascal_case + +# By default, name items with PascalCase +dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members +dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style + +dotnet_naming_symbols.all_members.applicable_kinds = * + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +# CSharp code style settings: +[*.cs] +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = true +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left + +# Prefer "var" everywhere +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion + +# Prefer method-like constructs to have a block body +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none + +# Prefer property-like constructs to have an expression-body +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Suggest more modern language features when available +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Newline settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +# Spacing +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_around_binary_operators = before_and_after +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false + +# Blocks are allowed +csharp_prefer_braces = true:silent +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj index 945f6a17b04..8390da30279 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/Dnn.Modules.Console.csproj @@ -1,176 +1,184 @@ - - - - - Debug - AnyCPU - - - 2.0 - {946F0EA1-6187-4878-A32F-B7BF70E13CE5} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Dnn.Modules.Console - Dnn.Modules.Console - v4.7.2 - true - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\Dnn.Modules.Console.XML - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\Dnn.Modules.Console.XML - 1591,1573 - 7 - - - - False - ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll - - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - - - - - - - - - - - - - - - - - - - SolutionInfo.cs - - - - - - Settings.ascx - ASPXCodeBehind - - - Settings.ascx - - - ViewConsole.ascx - ASPXCodeBehind - - - ViewConsole.ascx - - - - - - - - - - - - - - - - - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {03e3afa5-ddc9-48fb-a839-ad4282ce237e} - DotNetNuke.Web.Client - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - Designer - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - True - True - 56695 - / - http://localhost:56695/ - False - False - - - False - - - - - + + + + + Debug + AnyCPU + + + 2.0 + {946F0EA1-6187-4878-A32F-B7BF70E13CE5} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Dnn.Modules.Console + Dnn.Modules.Console + v4.7.2 + true + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + bin\Dnn.Modules.Console.XML + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\Dnn.Modules.Console.XML + 1591,1573 + 7 + + + + False + ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll + + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + + + + + + + + + + + + + + + + + + + SolutionInfo.cs + + + + + + Settings.ascx + ASPXCodeBehind + + + Settings.ascx + + + ViewConsole.ascx + ASPXCodeBehind + + + ViewConsole.ascx + + + + + + + + + + + + + + + + + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {03e3afa5-ddc9-48fb-a839-ad4282ce237e} + DotNetNuke.Web.Client + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + Designer + + + + + + + + + + + stylecop.json + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 56695 + / + http://localhost:56695/ + False + False + + + False + + + + + \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/Settings.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.Console/Settings.ascx.cs index a6cf80d8068..f3a954e4ff4 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/Settings.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/Settings.ascx.cs @@ -32,7 +32,7 @@ public partial class Settings : ModuleSettingsBase private void BindTabs(int tabId, bool includeParent) { - List tempTabs = TabController.GetTabsBySortOrder(PortalId).OrderBy(t => t.Level).ThenBy(t => t.HasChildren).ToList(); + List tempTabs = TabController.GetTabsBySortOrder(this.PortalId).OrderBy(t => t.Level).ThenBy(t => t.HasChildren).ToList(); IList tabList = new List(); @@ -41,7 +41,7 @@ private void BindTabs(int tabId, bool includeParent) if (includeParent) { - TabInfo consoleTab = TabController.Instance.GetTab(tabId, PortalId); + TabInfo consoleTab = TabController.Instance.GetTab(tabId, this.PortalId); if (consoleTab != null) { tabList.Add(consoleTab); @@ -69,98 +69,98 @@ private void BindTabs(int tabId, bool includeParent) } } - tabs.DataSource = tabList; - tabs.DataBind(); + this.tabs.DataSource = tabList; + this.tabs.DataBind(); } private void SwitchMode() { int parentTabId = -1; - if (Settings.ContainsKey("ParentTabID") && !string.IsNullOrEmpty(Convert.ToString(Settings["ParentTabID"]))) + if (this.Settings.ContainsKey("ParentTabID") && !string.IsNullOrEmpty(Convert.ToString(this.Settings["ParentTabID"]))) { - parentTabId = Convert.ToInt32(Settings["ParentTabID"]); + parentTabId = Convert.ToInt32(this.Settings["ParentTabID"]); } - switch (modeList.SelectedValue) + switch (this.modeList.SelectedValue) { case "Normal": - parentTabRow.Visible = true; - includeParentRow.Visible = true; - tabVisibilityRow.Visible = false; + this.parentTabRow.Visible = true; + this.includeParentRow.Visible = true; + this.tabVisibilityRow.Visible = false; break; case "Profile": - parentTabRow.Visible = false; - includeParentRow.Visible = false; - tabVisibilityRow.Visible = true; - parentTabId = PortalSettings.UserTabId; + this.parentTabRow.Visible = false; + this.includeParentRow.Visible = false; + this.tabVisibilityRow.Visible = true; + parentTabId = this.PortalSettings.UserTabId; break; case "Group": - parentTabRow.Visible = true; - includeParentRow.Visible = true; - tabVisibilityRow.Visible = true; + this.parentTabRow.Visible = true; + this.includeParentRow.Visible = true; + this.tabVisibilityRow.Visible = true; break; } - ParentTab.SelectedPage = TabController.Instance.GetTab(parentTabId, PortalId); - BindTabs(parentTabId, IncludeParent.Checked); + this.ParentTab.SelectedPage = TabController.Instance.GetTab(parentTabId, this.PortalId); + this.BindTabs(parentTabId, this.IncludeParent.Checked); } public override void LoadSettings() { try { - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - if (Settings.ContainsKey("ParentTabId") && !string.IsNullOrEmpty(Convert.ToString(Settings["ParentTabId"]))) + if (this.Settings.ContainsKey("ParentTabId") && !string.IsNullOrEmpty(Convert.ToString(this.Settings["ParentTabId"]))) { - var tabId = Convert.ToInt32(Settings["ParentTabId"]); - ParentTab.SelectedPage = TabController.Instance.GetTab(tabId, PortalId); + var tabId = Convert.ToInt32(this.Settings["ParentTabId"]); + this.ParentTab.SelectedPage = TabController.Instance.GetTab(tabId, this.PortalId); } foreach (string val in ConsoleController.GetSizeValues()) { //DefaultSize.Items.Add(new ListItem(Localization.GetString(val, LocalResourceFile), val)); - DefaultSize.AddItem(Localization.GetString(val, LocalResourceFile), val); + this.DefaultSize.AddItem(Localization.GetString(val, this.LocalResourceFile), val); } - SelectDropDownListItem(ref DefaultSize, "DefaultSize"); + this.SelectDropDownListItem(ref this.DefaultSize, "DefaultSize"); - SelectDropDownListItem(ref modeList, "Mode"); + this.SelectDropDownListItem(ref this.modeList, "Mode"); - if (Settings.ContainsKey("AllowSizeChange")) + if (this.Settings.ContainsKey("AllowSizeChange")) { - AllowResize.Checked = Convert.ToBoolean(Settings["AllowSizeChange"]); + this.AllowResize.Checked = Convert.ToBoolean(this.Settings["AllowSizeChange"]); } foreach (var val in ConsoleController.GetViewValues()) { //DefaultView.Items.Add(new ListItem(Localization.GetString(val, LocalResourceFile), val)); - DefaultView.AddItem(Localization.GetString(val, LocalResourceFile), val); + this.DefaultView.AddItem(Localization.GetString(val, this.LocalResourceFile), val); } - SelectDropDownListItem(ref DefaultView, "DefaultView"); - if (Settings.ContainsKey("IncludeParent")) + this.SelectDropDownListItem(ref this.DefaultView, "DefaultView"); + if (this.Settings.ContainsKey("IncludeParent")) { - IncludeParent.Checked = Convert.ToBoolean(Settings["IncludeParent"]); + this.IncludeParent.Checked = Convert.ToBoolean(this.Settings["IncludeParent"]); } - if (Settings.ContainsKey("AllowViewChange")) + if (this.Settings.ContainsKey("AllowViewChange")) { - AllowViewChange.Checked = Convert.ToBoolean(Settings["AllowViewChange"]); + this.AllowViewChange.Checked = Convert.ToBoolean(this.Settings["AllowViewChange"]); } - if (Settings.ContainsKey("ShowTooltip")) + if (this.Settings.ContainsKey("ShowTooltip")) { - ShowTooltip.Checked = Convert.ToBoolean(Settings["ShowTooltip"]); + this.ShowTooltip.Checked = Convert.ToBoolean(this.Settings["ShowTooltip"]); } - if (Settings.ContainsKey("OrderTabsByHierarchy")) + if (this.Settings.ContainsKey("OrderTabsByHierarchy")) { - OrderTabsByHierarchy.Checked = Convert.ToBoolean(Settings["OrderTabsByHierarchy"]); + this.OrderTabsByHierarchy.Checked = Convert.ToBoolean(this.Settings["OrderTabsByHierarchy"]); } - if (Settings.ContainsKey("IncludeHiddenPages")) + if (this.Settings.ContainsKey("IncludeHiddenPages")) { - IncludeHiddenPages.Checked = Convert.ToBoolean(Settings["IncludeHiddenPages"]); + this.IncludeHiddenPages.Checked = Convert.ToBoolean(this.Settings["IncludeHiddenPages"]); } - if (Settings.ContainsKey("ConsoleWidth")) + if (this.Settings.ContainsKey("ConsoleWidth")) { - ConsoleWidth.Text = Convert.ToString(Settings["ConsoleWidth"]); + this.ConsoleWidth.Text = Convert.ToString(this.Settings["ConsoleWidth"]); } - SwitchMode(); + this.SwitchMode(); } } @@ -176,11 +176,11 @@ public override void UpdateSettings() { //validate console width value var wdth = string.Empty; - if ((ConsoleWidth.Text.Trim().Length > 0)) + if ((this.ConsoleWidth.Text.Trim().Length > 0)) { try { - wdth = Unit.Parse(ConsoleWidth.Text.Trim()).ToString(); + wdth = Unit.Parse(this.ConsoleWidth.Text.Trim()).ToString(); } catch (Exception exc) { @@ -189,27 +189,27 @@ public override void UpdateSettings() throw new Exception("ConsoleWidth value is invalid. Value must be numeric."); } } - if (ParentTab.SelectedItemValueAsInt == Null.NullInteger) + if (this.ParentTab.SelectedItemValueAsInt == Null.NullInteger) { - ModuleController.Instance.DeleteModuleSetting(ModuleId, "ParentTabID"); + ModuleController.Instance.DeleteModuleSetting(this.ModuleId, "ParentTabID"); } else { - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ParentTabID", ParentTab.SelectedItem.Value); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ParentTabID", this.ParentTab.SelectedItem.Value); } - ModuleController.Instance.UpdateModuleSetting(ModuleId, "Mode", modeList.SelectedValue); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "DefaultSize", DefaultSize.SelectedValue); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "AllowSizeChange", AllowResize.Checked.ToString(CultureInfo.InvariantCulture)); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "DefaultView", DefaultView.SelectedValue); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "AllowViewChange", AllowViewChange.Checked.ToString(CultureInfo.InvariantCulture)); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowTooltip", ShowTooltip.Checked.ToString(CultureInfo.InvariantCulture)); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "OrderTabsByHierarchy", OrderTabsByHierarchy.Checked.ToString(CultureInfo.InvariantCulture)); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "IncludeHiddenPages", IncludeHiddenPages.Checked.ToString(CultureInfo.InvariantCulture)); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "IncludeParent", IncludeParent.Checked.ToString(CultureInfo.InvariantCulture)); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ConsoleWidth", wdth); - - foreach (RepeaterItem item in tabs.Items) + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "Mode", this.modeList.SelectedValue); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "DefaultSize", this.DefaultSize.SelectedValue); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "AllowSizeChange", this.AllowResize.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "DefaultView", this.DefaultView.SelectedValue); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "AllowViewChange", this.AllowViewChange.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowTooltip", this.ShowTooltip.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "OrderTabsByHierarchy", this.OrderTabsByHierarchy.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "IncludeHiddenPages", this.IncludeHiddenPages.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "IncludeParent", this.IncludeParent.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ConsoleWidth", wdth); + + foreach (RepeaterItem item in this.tabs.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { @@ -217,7 +217,7 @@ public override void UpdateSettings() var visibility = (item.FindControl("tabVisibility") as DnnComboBox).SelectedValue; var key = String.Format("TabVisibility{0}", tabPath.Replace("//","-")); - ModuleController.Instance.UpdateModuleSetting(ModuleId, key, visibility); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, key, visibility); } } } @@ -231,21 +231,21 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - tabs.ItemDataBound += tabs_ItemDataBound; - modeList.SelectedIndexChanged += modeList_SelectedIndexChanged; + this.tabs.ItemDataBound += this.tabs_ItemDataBound; + this.modeList.SelectedIndexChanged += this.modeList_SelectedIndexChanged; - ParentTab.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty); + this.ParentTab.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty); } private void modeList_SelectedIndexChanged(object sender, EventArgs e) { - SwitchMode(); + this.SwitchMode(); } protected void parentTab_SelectedIndexChanged(object sender, EventArgs e) { - BindTabs(ParentTab.SelectedItemValueAsInt, IncludeParent.Checked); + this.BindTabs(this.ParentTab.SelectedItemValueAsInt, this.IncludeParent.Checked); } void tabs_ItemDataBound(Object Sender, RepeaterItemEventArgs e) @@ -261,38 +261,38 @@ void tabs_ItemDataBound(Object Sender, RepeaterItemEventArgs e) visibilityDropDown.Items.Clear(); //visibilityDropDown.Items.Add(new ListItem(LocalizeString("AllUsers"), "AllUsers")); - visibilityDropDown.AddItem(LocalizeString("AllUsers"), "AllUsers"); - if (modeList.SelectedValue == "Profile") + visibilityDropDown.AddItem(this.LocalizeString("AllUsers"), "AllUsers"); + if (this.modeList.SelectedValue == "Profile") { //visibilityDropDown.Items.Add(new ListItem(LocalizeString("Friends"), "Friends")); //visibilityDropDown.Items.Add(new ListItem(LocalizeString("User"), "User")); - visibilityDropDown.AddItem(LocalizeString("Friends"), "Friends"); - visibilityDropDown.AddItem(LocalizeString("User"), "User"); + visibilityDropDown.AddItem(this.LocalizeString("Friends"), "Friends"); + visibilityDropDown.AddItem(this.LocalizeString("User"), "User"); } else { //visibilityDropDown.Items.Add(new ListItem(LocalizeString("Owner"), "Owner")); //visibilityDropDown.Items.Add(new ListItem(LocalizeString("Members"), "Members")); - visibilityDropDown.AddItem(LocalizeString("Owner"), "Owner"); - visibilityDropDown.AddItem(LocalizeString("Members"), "Members"); + visibilityDropDown.AddItem(this.LocalizeString("Owner"), "Owner"); + visibilityDropDown.AddItem(this.LocalizeString("Members"), "Members"); } tabLabel.Text = tab.TabName; tabPathField.Value = tab.TabPath; var key = String.Format("TabVisibility{0}", tab.TabPath.Replace("//", "-")); - SelectDropDownListItem(ref visibilityDropDown, key); + this.SelectDropDownListItem(ref visibilityDropDown, key); } } private void SelectDropDownListItem(ref DnnComboBox ddl, string key) { - if (Settings.ContainsKey(key)) + if (this.Settings.ContainsKey(key)) { ddl.ClearSelection(); - var selItem = ddl.FindItemByValue(Convert.ToString(Settings[key])); + var selItem = ddl.FindItemByValue(Convert.ToString(this.Settings[key])); if (selItem != null) { selItem.Selected = true; diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs index 06d87196ae5..1548eff72f4 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/ViewConsole.ascx.cs @@ -43,35 +43,35 @@ public partial class ViewConsole : PortalModuleBase public ViewConsole() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Public Properties public bool AllowSizeChange { - get { return !Settings.ContainsKey("AllowSizeChange") || bool.Parse(Settings["AllowSizeChange"].ToString()); } + get { return !this.Settings.ContainsKey("AllowSizeChange") || bool.Parse(this.Settings["AllowSizeChange"].ToString()); } } public bool AllowViewChange { - get { return !Settings.ContainsKey("AllowViewChange") || bool.Parse(Settings["AllowViewChange"].ToString()); } + get { return !this.Settings.ContainsKey("AllowViewChange") || bool.Parse(this.Settings["AllowViewChange"].ToString()); } } public bool IncludeHiddenPages { - get { return Settings.ContainsKey("IncludeHiddenPages") && bool.Parse(Settings["IncludeHiddenPages"].ToString()); } + get { return this.Settings.ContainsKey("IncludeHiddenPages") && bool.Parse(this.Settings["IncludeHiddenPages"].ToString()); } } public ConsoleController ConsoleCtrl { get { - if ((_consoleCtrl == null)) + if ((this._consoleCtrl == null)) { - _consoleCtrl = new ConsoleController(); + this._consoleCtrl = new ConsoleController(); } - return _consoleCtrl; + return this._consoleCtrl; } } @@ -79,11 +79,11 @@ public int ConsoleTabID { get { - return (Mode == "Profile") - ? PortalSettings.UserTabId - : (Settings.ContainsKey("ParentTabID") - ? int.Parse(Settings["ParentTabID"].ToString()) - : TabId); + return (this.Mode == "Profile") + ? this.PortalSettings.UserTabId + : (this.Settings.ContainsKey("ParentTabID") + ? int.Parse(this.Settings["ParentTabID"].ToString()) + : this.TabId); } } @@ -91,7 +91,7 @@ public string ConsoleWidth { get { - return Settings.ContainsKey("ConsoleWidth") ? Settings["ConsoleWidth"].ToString() : String.Empty; + return this.Settings.ContainsKey("ConsoleWidth") ? this.Settings["ConsoleWidth"].ToString() : String.Empty; } } @@ -99,19 +99,19 @@ public string DefaultSize { get { - if ((_defaultSize == string.Empty && AllowSizeChange && UserId > Null.NullInteger)) + if ((this._defaultSize == string.Empty && this.AllowSizeChange && this.UserId > Null.NullInteger)) { - object personalizedValue = GetUserSetting("DefaultSize"); + object personalizedValue = this.GetUserSetting("DefaultSize"); if ((personalizedValue != null)) { - _defaultSize = Convert.ToString(personalizedValue); + this._defaultSize = Convert.ToString(personalizedValue); } } - if ((_defaultSize == string.Empty)) + if ((this._defaultSize == string.Empty)) { - _defaultSize = Settings.ContainsKey("DefaultSize") ? Convert.ToString(Settings["DefaultSize"]) : "IconFile"; + this._defaultSize = this.Settings.ContainsKey("DefaultSize") ? Convert.ToString(this.Settings["DefaultSize"]) : "IconFile"; } - return _defaultSize; + return this._defaultSize; } } @@ -119,19 +119,19 @@ public string DefaultView { get { - if ((_defaultView == string.Empty && AllowViewChange && UserId > Null.NullInteger)) + if ((this._defaultView == string.Empty && this.AllowViewChange && this.UserId > Null.NullInteger)) { - object personalizedValue = GetUserSetting("DefaultView"); + object personalizedValue = this.GetUserSetting("DefaultView"); if ((personalizedValue != null)) { - _defaultView = Convert.ToString(personalizedValue); + this._defaultView = Convert.ToString(personalizedValue); } } - if ((_defaultView == string.Empty)) + if ((this._defaultView == string.Empty)) { - _defaultView = Settings.ContainsKey("DefaultView") ? Convert.ToString(Settings["DefaultView"]) : "Hide"; + this._defaultView = this.Settings.ContainsKey("DefaultView") ? Convert.ToString(this.Settings["DefaultView"]) : "Hide"; } - return _defaultView; + return this._defaultView; } } @@ -140,9 +140,9 @@ public int GroupId get { var groupId = Null.NullInteger; - if (!string.IsNullOrEmpty(Request.Params["GroupId"])) + if (!string.IsNullOrEmpty(this.Request.Params["GroupId"])) { - groupId = Int32.Parse(Request.Params["GroupId"]); + groupId = Int32.Parse(this.Request.Params["GroupId"]); } return groupId; } @@ -152,7 +152,7 @@ public bool IncludeParent { get { - return (Mode == "Profile") || (Settings.ContainsKey("IncludeParent") && bool.Parse(Settings["IncludeParent"].ToString())); + return (this.Mode == "Profile") || (this.Settings.ContainsKey("IncludeParent") && bool.Parse(this.Settings["IncludeParent"].ToString())); } } @@ -160,7 +160,7 @@ public string Mode { get { - return Settings.ContainsKey("Mode") ? Settings["Mode"].ToString() : "Normal"; + return this.Settings.ContainsKey("Mode") ? this.Settings["Mode"].ToString() : "Normal"; } } @@ -169,9 +169,9 @@ public int ProfileUserId get { var userId = Null.NullInteger; - if (!string.IsNullOrEmpty(Request.Params["UserId"])) + if (!string.IsNullOrEmpty(this.Request.Params["UserId"])) { - userId = Int32.Parse(Request.Params["UserId"]); + userId = Int32.Parse(this.Request.Params["UserId"]); } return userId; } @@ -179,14 +179,14 @@ public int ProfileUserId public bool ShowTooltip { - get { return !Settings.ContainsKey("ShowTooltip") || bool.Parse(Settings["ShowTooltip"].ToString()); } + get { return !this.Settings.ContainsKey("ShowTooltip") || bool.Parse(this.Settings["ShowTooltip"].ToString()); } } public bool OrderTabsByHierarchy { get { - return Settings.ContainsKey("OrderTabsByHierarchy") && bool.Parse(Settings["OrderTabsByHierarchy"].ToString()); + return this.Settings.ContainsKey("OrderTabsByHierarchy") && bool.Parse(this.Settings["OrderTabsByHierarchy"].ToString()); } } @@ -198,29 +198,29 @@ private bool CanShowTab(TabInfo tab) { bool canShowTab = TabPermissionController.CanViewPage(tab) && !tab.IsDeleted && - (IncludeHiddenPages || tab.IsVisible) && + (this.IncludeHiddenPages || tab.IsVisible) && (tab.StartDate < DateTime.Now || tab.StartDate == Null.NullDate); if (canShowTab) { var key = String.Format("TabVisibility{0}", tab.TabPath.Replace("//", "-")); - var visibility = Settings.ContainsKey(key) ? Settings[key].ToString() : "AllUsers"; + var visibility = this.Settings.ContainsKey(key) ? this.Settings[key].ToString() : "AllUsers"; switch (visibility) { case "Owner": - canShowTab = (UserInfo.Social.Roles.SingleOrDefault(ur => ur.RoleID == GroupId && ur.IsOwner) != null); + canShowTab = (this.UserInfo.Social.Roles.SingleOrDefault(ur => ur.RoleID == this.GroupId && ur.IsOwner) != null); break; case "Members": - var group = RoleController.Instance.GetRole(PortalId, (r) => r.RoleID == GroupId); - canShowTab = (group != null) && UserInfo.IsInRole(group.RoleName); + var group = RoleController.Instance.GetRole(this.PortalId, (r) => r.RoleID == this.GroupId); + canShowTab = (group != null) && this.UserInfo.IsInRole(group.RoleName); break; case "Friends": - var profileUser = UserController.GetUserById(PortalId, ProfileUserId); - canShowTab = (profileUser != null) && (profileUser.Social.Friend != null) || (UserId == ProfileUserId); + var profileUser = UserController.GetUserById(this.PortalId, this.ProfileUserId); + canShowTab = (profileUser != null) && (profileUser.Social.Friend != null) || (this.UserId == this.ProfileUserId); break; case "User": - canShowTab = (UserId == ProfileUserId); + canShowTab = (this.UserId == this.ProfileUserId); break; case "AllUsers": break; @@ -239,25 +239,25 @@ private string GetIconUrl(string iconURL, string size) } if (iconURL.Contains("~") == false) { - iconURL = Path.Combine(PortalSettings.HomeDirectory, iconURL); + iconURL = Path.Combine(this.PortalSettings.HomeDirectory, iconURL); } - return ResolveUrl(iconURL); + return this.ResolveUrl(iconURL); } private object GetUserSetting(string key) { - return Personalization.GetProfile(ModuleConfiguration.ModuleDefinition.FriendlyName, PersonalizationKey(key)); + return Personalization.GetProfile(this.ModuleConfiguration.ModuleDefinition.FriendlyName, this.PersonalizationKey(key)); } private bool IsHostTab() { var returnValue = false; - if (ConsoleTabID != TabId) + if (this.ConsoleTabID != this.TabId) { - if (UserInfo != null && UserInfo.IsSuperUser) + if (this.UserInfo != null && this.UserInfo.IsSuperUser) { var hostTabs = TabController.Instance.GetTabsByPortal(Null.NullInteger); - if (hostTabs.Keys.Any(key => key == ConsoleTabID)) + if (hostTabs.Keys.Any(key => key == this.ConsoleTabID)) { returnValue = true; } @@ -265,26 +265,26 @@ private bool IsHostTab() } else { - returnValue = PortalSettings.ActiveTab.IsSuperTab; + returnValue = this.PortalSettings.ActiveTab.IsSuperTab; } return returnValue; } private string PersonalizationKey(string key) { - return string.Format("{0}_{1}_{2}", PortalId, TabModuleId, key); + return string.Format("{0}_{1}_{2}", this.PortalId, this.TabModuleId, key); } private void SavePersonalizedSettings() { - if ((UserId > -1)) + if ((this.UserId > -1)) { int consoleModuleID = -1; try { - if (Request.QueryString["CTMID"] != null) + if (this.Request.QueryString["CTMID"] != null) { - consoleModuleID = Convert.ToInt32(Request.QueryString["CTMID"]); + consoleModuleID = Convert.ToInt32(this.Request.QueryString["CTMID"]); } } catch (Exception exc) @@ -293,25 +293,25 @@ private void SavePersonalizedSettings() consoleModuleID = -1; } - if ((consoleModuleID == TabModuleId)) + if ((consoleModuleID == this.TabModuleId)) { string consoleSize = string.Empty; - if (Request.QueryString["CS"] != null) + if (this.Request.QueryString["CS"] != null) { - consoleSize = Request.QueryString["CS"]; + consoleSize = this.Request.QueryString["CS"]; } string consoleView = string.Empty; - if (Request.QueryString["CV"] != null) + if (this.Request.QueryString["CV"] != null) { - consoleView = Request.QueryString["CV"]; + consoleView = this.Request.QueryString["CV"]; } if ((consoleSize != string.Empty && ConsoleController.GetSizeValues().Contains(consoleSize))) { - SaveUserSetting("DefaultSize", consoleSize); + this.SaveUserSetting("DefaultSize", consoleSize); } if ((consoleView != string.Empty && ConsoleController.GetViewValues().Contains(consoleView))) { - SaveUserSetting("DefaultView", consoleView); + this.SaveUserSetting("DefaultView", consoleView); } } } @@ -319,7 +319,7 @@ private void SavePersonalizedSettings() private void SaveUserSetting(string key, object val) { - Personalization.SetProfile(ModuleConfiguration.ModuleDefinition.FriendlyName, PersonalizationKey(key), val); + Personalization.SetProfile(this.ModuleConfiguration.ModuleDefinition.FriendlyName, this.PersonalizationKey(key), val); } #endregion @@ -332,12 +332,12 @@ protected override void OnInit(EventArgs e) { JavaScript.RequestRegistration(CommonJs.jQuery); - ClientResourceManager.RegisterScript(Page, "~/desktopmodules/admin/console/scripts/jquery.console.js"); + ClientResourceManager.RegisterScript(this.Page, "~/desktopmodules/admin/console/scripts/jquery.console.js"); - DetailView.ItemDataBound += RepeaterItemDataBound; + this.DetailView.ItemDataBound += this.RepeaterItemDataBound; //Save User Preferences - SavePersonalizedSettings(); + this.SavePersonalizedSettings(); } catch (Exception exc) { @@ -350,47 +350,47 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - IconSize.Visible = AllowSizeChange; - View.Visible = AllowViewChange; + this.IconSize.Visible = this.AllowSizeChange; + this.View.Visible = this.AllowViewChange; foreach (string val in ConsoleController.GetSizeValues()) { - IconSize.Items.Add(new ListItem(Localization.GetString(val + ".Text", LocalResourceFile), val)); + this.IconSize.Items.Add(new ListItem(Localization.GetString(val + ".Text", this.LocalResourceFile), val)); } foreach (string val in ConsoleController.GetViewValues()) { - View.Items.Add(new ListItem(Localization.GetString(val + ".Text", LocalResourceFile), val)); + this.View.Items.Add(new ListItem(Localization.GetString(val + ".Text", this.LocalResourceFile), val)); } - IconSize.SelectedValue = DefaultSize; - View.SelectedValue = DefaultView; + this.IconSize.SelectedValue = this.DefaultSize; + this.View.SelectedValue = this.DefaultView; - if ((!IsPostBack)) + if ((!this.IsPostBack)) { - Console.Attributes["class"] = Console.Attributes["class"] + " " + Mode.ToLower(CultureInfo.InvariantCulture); + this.Console.Attributes["class"] = this.Console.Attributes["class"] + " " + this.Mode.ToLower(CultureInfo.InvariantCulture); - SettingsBreak.Visible = (AllowSizeChange && AllowViewChange); + this.SettingsBreak.Visible = (this.AllowSizeChange && this.AllowViewChange); - List tempTabs = (IsHostTab()) + List tempTabs = (this.IsHostTab()) ? TabController.GetTabsBySortOrder(Null.NullInteger).OrderBy(t => t.Level).ThenBy(t => t.LocalizedTabName).ToList() - : TabController.GetTabsBySortOrder(PortalId).OrderBy(t => t.Level).ThenBy(t => t.LocalizedTabName).ToList(); + : TabController.GetTabsBySortOrder(this.PortalId).OrderBy(t => t.Level).ThenBy(t => t.LocalizedTabName).ToList(); - _tabs = new List(); + this._tabs = new List(); IList tabIdList = new List(); - tabIdList.Add(ConsoleTabID); + tabIdList.Add(this.ConsoleTabID); - if(IncludeParent) + if(this.IncludeParent) { - TabInfo consoleTab = TabController.Instance.GetTab(ConsoleTabID, PortalId); + TabInfo consoleTab = TabController.Instance.GetTab(this.ConsoleTabID, this.PortalId); if (consoleTab != null) { - _tabs.Add(consoleTab); + this._tabs.Add(consoleTab); } } foreach (TabInfo tab in tempTabs) { - if ((!CanShowTab(tab))) + if ((!this.CanShowTab(tab))) { continue; } @@ -400,28 +400,28 @@ protected override void OnLoad(EventArgs e) { tabIdList.Add(tab.TabID); } - _tabs.Add(tab); + this._tabs.Add(tab); } } //if OrderTabsByHierarchy set to true, we need reorder the tab list to move tabs which have child tabs to the end of list. //so that the list display in UI can show tabs in same level in same area, and not break by child tabs. - if (OrderTabsByHierarchy) + if (this.OrderTabsByHierarchy) { - _tabs = _tabs.OrderBy(t => t.HasChildren).ToList(); + this._tabs = this._tabs.OrderBy(t => t.HasChildren).ToList(); } int minLevel = -1; - if (_tabs.Count > 0) + if (this._tabs.Count > 0) { - minLevel = _tabs.Min(t => t.Level); + minLevel = this._tabs.Min(t => t.Level); } - DetailView.DataSource = (minLevel > -1) ? _tabs.Where(t => t.Level == minLevel) : _tabs; - DetailView.DataBind(); + this.DetailView.DataSource = (minLevel > -1) ? this._tabs.Where(t => t.Level == minLevel) : this._tabs; + this.DetailView.DataBind(); } - if ((ConsoleWidth != string.Empty)) + if ((this.ConsoleWidth != string.Empty)) { - Console.Attributes.Add("style", "width:" + ConsoleWidth); + this.Console.Attributes.Add("style", "width:" + this.ConsoleWidth); } } catch (Exception exc) @@ -433,13 +433,13 @@ protected override void OnLoad(EventArgs e) private void RepeaterItemDataBound(object sender, RepeaterItemEventArgs e) { var tab = e.Item.DataItem as TabInfo; - e.Item.Controls.Add(new Literal() { Text = GetHtml(tab) }); - if (_tabs.Any(t => t.ParentId == tab.TabID)) + e.Item.Controls.Add(new Literal() { Text = this.GetHtml(tab) }); + if (this._tabs.Any(t => t.ParentId == tab.TabID)) { var repeater = new Repeater(); - repeater.ItemDataBound += RepeaterItemDataBound; + repeater.ItemDataBound += this.RepeaterItemDataBound; e.Item.Controls.Add(repeater); - repeater.DataSource = _tabs.Where(t => t.ParentId == tab.TabID); + repeater.DataSource = this._tabs.Where(t => t.ParentId == tab.TabID); repeater.DataBind(); } } @@ -447,9 +447,9 @@ private void RepeaterItemDataBound(object sender, RepeaterItemEventArgs e) protected string GetHtml(TabInfo tab) { string returnValue = string.Empty; - if ((_groupTabID > -1 && _groupTabID != tab.ParentId)) + if ((this._groupTabID > -1 && this._groupTabID != tab.ParentId)) { - _groupTabID = -1; + this._groupTabID = -1; if ((!tab.DisableLink)) { returnValue = "

"; @@ -459,12 +459,12 @@ protected string GetHtml(TabInfo tab) { const string headerHtml = "

{0}


"; returnValue += string.Format(headerHtml, tab.TabName); - _groupTabID = tab.TabID; + this._groupTabID = tab.TabID; } else { var sb = new StringBuilder(); - if(tab.TabID == PortalSettings.ActiveTab.TabID) + if(tab.TabID == this.PortalSettings.ActiveTab.TabID) { sb.Append("
"); } @@ -474,7 +474,7 @@ protected string GetHtml(TabInfo tab) } sb.Append(""); - if (DefaultSize != "IconNone" || (AllowSizeChange || AllowViewChange)) + if (this.DefaultSize != "IconNone" || (this.AllowSizeChange || this.AllowViewChange)) { sb.Append("\"{3}\""); sb.Append("\"{3}\""); @@ -487,20 +487,20 @@ protected string GetHtml(TabInfo tab) //const string contentHtml = "
" + "\"{3}\"\"{3}\"" + "

{3}

" + "
{4}
" + "
"; var tabUrl = tab.FullUrl; - if (ProfileUserId > -1) + if (this.ProfileUserId > -1) { - tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); + tabUrl = this._navigationManager.NavigateURL(tab.TabID, "", "UserId=" + this.ProfileUserId.ToString(CultureInfo.InvariantCulture)); } - if (GroupId > -1) + if (this.GroupId > -1) { - tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); + tabUrl = this._navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + this.GroupId.ToString(CultureInfo.InvariantCulture)); } returnValue += string.Format(sb.ToString(), tabUrl, - GetIconUrl(tab.IconFile, "IconFile"), - GetIconUrl(tab.IconFileLarge, "IconFileLarge"), + this.GetIconUrl(tab.IconFile, "IconFile"), + this.GetIconUrl(tab.IconFileLarge, "IconFileLarge"), tab.LocalizedTabName, tab.Description); } @@ -510,17 +510,17 @@ protected string GetHtml(TabInfo tab) protected string GetClientSideSettings() { string tmid = "-1"; - if ((UserId > -1)) + if ((this.UserId > -1)) { - tmid = TabModuleId.ToString(CultureInfo.InvariantCulture); + tmid = this.TabModuleId.ToString(CultureInfo.InvariantCulture); } return string.Format("allowIconSizeChange: {0}, allowDetailChange: {1}, selectedSize: '{2}', showDetails: '{3}', tabModuleID: {4}, showTooltip: {5}", - AllowSizeChange.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), - AllowViewChange.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), - DefaultSize, - DefaultView, + this.AllowSizeChange.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), + this.AllowViewChange.ToString(CultureInfo.InvariantCulture).ToLowerInvariant(), + this.DefaultSize, + this.DefaultView, tmid, - ShowTooltip.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); + this.ShowTooltip.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); } } diff --git a/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config b/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config index 015e7e36813..4fca05e5f8c 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config +++ b/DNN Platform/Admin Modules/Dnn.Modules.Console/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs index f7d38a0dbd9..3485fe3f45c 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/CreateModule.ascx.cs @@ -33,14 +33,14 @@ public partial class CreateModule : PortalModuleBase private readonly INavigationManager _navigationManager; public CreateModule() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Methods private void LoadReadMe() { - var readMePath = Server.MapPath(ControlPath) + "Templates\\" + optLanguage.SelectedValue + "\\" + cboTemplate.SelectedItem.Value + "\\readme.txt"; + var readMePath = this.Server.MapPath(this.ControlPath) + "Templates\\" + this.optLanguage.SelectedValue + "\\" + this.cboTemplate.SelectedItem.Value + "\\readme.txt"; if (File.Exists(readMePath)) { var readMe = Null.NullString; @@ -48,54 +48,54 @@ private void LoadReadMe() { readMe = tr.ReadToEnd(); tr.Close(); - lblDescription.Text = readMe.Replace("\n", "
"); + this.lblDescription.Text = readMe.Replace("\n", "
"); } } else { - lblDescription.Text = ""; + this.lblDescription.Text = ""; } } private void LoadLanguages() { - optLanguage.Items.Clear(); - var moduleTemplatePath = Server.MapPath(ControlPath) + "Templates"; + this.optLanguage.Items.Clear(); + var moduleTemplatePath = this.Server.MapPath(this.ControlPath) + "Templates"; string[] folderList = Directory.GetDirectories(moduleTemplatePath); foreach (string folderPath in folderList) { - optLanguage.Items.Add(new ListItem(Path.GetFileName(folderPath))); + this.optLanguage.Items.Add(new ListItem(Path.GetFileName(folderPath))); } - optLanguage.SelectedIndex = 0; + this.optLanguage.SelectedIndex = 0; } private void LoadModuleTemplates() { - cboTemplate.Items.Clear(); - var moduleTemplatePath = Server.MapPath(ControlPath) + "Templates\\" + optLanguage.SelectedValue; + this.cboTemplate.Items.Clear(); + var moduleTemplatePath = this.Server.MapPath(this.ControlPath) + "Templates\\" + this.optLanguage.SelectedValue; string[] folderList = Directory.GetDirectories(moduleTemplatePath); foreach (string folderPath in folderList) { if (Path.GetFileName(folderPath).ToLowerInvariant().StartsWith("module")) { - cboTemplate.Items.Add(new ListItem(Path.GetFileName(folderPath))); + this.cboTemplate.Items.Add(new ListItem(Path.GetFileName(folderPath))); } } - cboTemplate.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); - if (cboTemplate.Items.FindByText("Module - User Control") != null) + this.cboTemplate.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); + if (this.cboTemplate.Items.FindByText("Module - User Control") != null) { - cboTemplate.Items.FindByText("Module - User Control").Selected = true; + this.cboTemplate.Items.FindByText("Module - User Control").Selected = true; } else { - cboTemplate.SelectedIndex = 0; + this.cboTemplate.SelectedIndex = 0; } - LoadReadMe(); + this.LoadReadMe(); } private void CreateModuleFolder() { - var moduleFolderPath = Globals.ApplicationMapPath + "\\DesktopModules\\" + GetFolderName().Replace("/", "\\"); + var moduleFolderPath = Globals.ApplicationMapPath + "\\DesktopModules\\" + this.GetFolderName().Replace("/", "\\"); if (!Directory.Exists(moduleFolderPath)) { @@ -105,9 +105,9 @@ private void CreateModuleFolder() private string CreateModuleControl() { - var moduleTemplatePath = Server.MapPath(ControlPath) + "Templates\\" + optLanguage.SelectedValue + "\\" + cboTemplate.SelectedValue + "\\"; + var moduleTemplatePath = this.Server.MapPath(this.ControlPath) + "Templates\\" + this.optLanguage.SelectedValue + "\\" + this.cboTemplate.SelectedValue + "\\"; - EventLogController.Instance.AddLog("Processing Template Folder", moduleTemplatePath, PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); + EventLogController.Instance.AddLog("Processing Template Folder", moduleTemplatePath, this.PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); var controlName = Null.NullString; @@ -119,7 +119,7 @@ private string CreateModuleControl() string[] fileList = Directory.GetFiles(moduleTemplatePath); foreach (string filePath in fileList) { - modulePath = Server.MapPath("DesktopModules/" + GetFolderName() + "/"); + modulePath = this.Server.MapPath("DesktopModules/" + this.GetFolderName() + "/"); //open file using (TextReader tr = new StreamReader(filePath)) @@ -129,17 +129,17 @@ private string CreateModuleControl() } //replace tokens - sourceCode = sourceCode.Replace("_OWNER_", GetOwner()); - sourceCode = sourceCode.Replace("_MODULE_", GetModule()); - sourceCode = sourceCode.Replace("_CONTROL_", GetControl()); + sourceCode = sourceCode.Replace("_OWNER_", this.GetOwner()); + sourceCode = sourceCode.Replace("_MODULE_", this.GetModule()); + sourceCode = sourceCode.Replace("_CONTROL_", this.GetControl()); sourceCode = sourceCode.Replace("_YEAR_", DateTime.Now.Year.ToString()); //get filename fileName = Path.GetFileName(filePath); - fileName = fileName.Replace("template", GetControl()); - fileName = fileName.Replace("_OWNER_", GetOwner()); - fileName = fileName.Replace("_MODULE_", GetModule()); - fileName = fileName.Replace("_CONTROL_", GetControl()); + fileName = fileName.Replace("template", this.GetControl()); + fileName = fileName.Replace("_OWNER_", this.GetOwner()); + fileName = fileName.Replace("_MODULE_", this.GetModule()); + fileName = fileName.Replace("_CONTROL_", this.GetControl()); switch (Path.GetExtension(filePath).ToLowerInvariant()) { @@ -188,7 +188,7 @@ private string CreateModuleControl() tw.Close(); } - EventLogController.Instance.AddLog("Created File", modulePath + fileName, PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); + EventLogController.Instance.AddLog("Created File", modulePath + fileName, this.PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); } @@ -199,23 +199,23 @@ private string CreateModuleControl() private string GetOwner() { - return txtOwner.Text.Replace(" ", ""); + return this.txtOwner.Text.Replace(" ", ""); } private string GetModule() { - return txtModule.Text.Replace(" ", ""); + return this.txtModule.Text.Replace(" ", ""); } private string GetControl() { - return txtControl.Text.Replace(" ", ""); + return this.txtControl.Text.Replace(" ", ""); } private string GetFolderName() { var strFolder = Null.NullString; - strFolder += txtOwner.Text + "/" + txtModule.Text; + strFolder += this.txtOwner.Text + "/" + this.txtModule.Text; //return folder and remove any spaces that might appear in folder structure return strFolder.Replace(" ", ""); } @@ -223,7 +223,7 @@ private string GetFolderName() private string GetClassName() { var strClass = Null.NullString; - strClass += txtOwner.Text + "." + txtModule.Text; + strClass += this.txtOwner.Text + "." + this.txtModule.Text; //return class and remove any spaces that might appear in class name return strClass.Replace(" ", ""); } @@ -237,28 +237,28 @@ private bool CreateModuleDefinition() { try { - if (PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.Name == GetClassName()) == null) + if (PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.Name == this.GetClassName()) == null) { var controlName = Null.NullString; //Create module folder - CreateModuleFolder(); + this.CreateModuleFolder(); //Create module control - controlName = CreateModuleControl(); + controlName = this.CreateModuleControl(); if (controlName != "") { //Create package var objPackage = new PackageInfo(); - objPackage.Name = GetClassName(); - objPackage.FriendlyName = txtModule.Text; - objPackage.Description = txtDescription.Text; + objPackage.Name = this.GetClassName(); + objPackage.FriendlyName = this.txtModule.Text; + objPackage.Description = this.txtDescription.Text; objPackage.Version = new Version(1, 0, 0); objPackage.PackageType = "Module"; objPackage.License = ""; - objPackage.Owner = txtOwner.Text; - objPackage.Organization = txtOwner.Text; - objPackage.FolderName = "DesktopModules/" + GetFolderName(); + objPackage.Owner = this.txtOwner.Text; + objPackage.Organization = this.txtOwner.Text; + objPackage.FolderName = "DesktopModules/" + this.GetFolderName(); objPackage.License = "The license for this package is not currently included within the installation file, please check with the vendor for full license details."; objPackage.ReleaseNotes = "This package has no Release Notes."; PackageController.Instance.SaveExtensionPackage(objPackage); @@ -266,10 +266,10 @@ private bool CreateModuleDefinition() //Create desktopmodule var objDesktopModule = new DesktopModuleInfo(); objDesktopModule.DesktopModuleID = Null.NullInteger; - objDesktopModule.ModuleName = GetClassName(); - objDesktopModule.FolderName = GetFolderName(); - objDesktopModule.FriendlyName = txtModule.Text; - objDesktopModule.Description = txtDescription.Text; + objDesktopModule.ModuleName = this.GetClassName(); + objDesktopModule.FolderName = this.GetFolderName(); + objDesktopModule.FriendlyName = this.txtModule.Text; + objDesktopModule.Description = this.txtDescription.Text; objDesktopModule.IsPremium = false; objDesktopModule.IsAdmin = false; objDesktopModule.Version = "01.00.00"; @@ -291,14 +291,14 @@ private bool CreateModuleDefinition() foreach (Term term in objTerms) { vocabularyId = term.VocabularyId; - if (term.Name == txtOwner.Text) + if (term.Name == this.txtOwner.Text) { termId = term.TermId; } } if (termId == -1) { - termId = objTermController.AddTerm(new Term(vocabularyId) { Name = txtOwner.Text }); + termId = objTermController.AddTerm(new Term(vocabularyId) { Name = this.txtOwner.Text }); } var objTerm = objTermController.GetTerm(termId); var objContentController = DotNetNuke.Entities.Content.Common.Util.GetContentController(); @@ -313,7 +313,7 @@ private bool CreateModuleDefinition() objModuleDefinition.ModuleDefID = Null.NullInteger; objModuleDefinition.DesktopModuleID = objDesktopModule.DesktopModuleID; // need core enhancement to have a unique DefinitionName - objModuleDefinition.FriendlyName = GetClassName(); + objModuleDefinition.FriendlyName = this.GetClassName(); //objModuleDefinition.FriendlyName = txtModule.Text; //objModuleDefinition.DefinitionName = GetClassName(); objModuleDefinition.DefaultCacheTime = 0; @@ -324,7 +324,7 @@ private bool CreateModuleDefinition() objModuleControl.ModuleControlID = Null.NullInteger; objModuleControl.ModuleDefID = objModuleDefinition.ModuleDefID; objModuleControl.ControlKey = ""; - objModuleControl.ControlSrc = "DesktopModules/" + GetFolderName() + "/" + controlName; + objModuleControl.ControlSrc = "DesktopModules/" + this.GetFolderName() + "/" + controlName; objModuleControl.ControlTitle = ""; objModuleControl.ControlType = SecurityAccessLevel.View; objModuleControl.HelpURL = ""; @@ -335,13 +335,13 @@ private bool CreateModuleDefinition() ModuleControlController.AddModuleControl(objModuleControl); //Update current module to reference new moduledefinition - var objModule = ModuleController.Instance.GetModule(ModuleId, TabId, false); + var objModule = ModuleController.Instance.GetModule(this.ModuleId, this.TabId, false); objModule.ModuleDefID = objModuleDefinition.ModuleDefID; - objModule.ModuleTitle = txtModule.Text; + objModule.ModuleTitle = this.txtModule.Text; //HACK - need core enhancement to be able to update ModuleDefID using (DotNetNuke.Data.DataProvider.Instance().ExecuteSQL( - "UPDATE {databaseOwner}{objectQualifier}Modules SET ModuleDefID=" + objModule.ModuleDefID + " WHERE ModuleID=" + ModuleId)) + "UPDATE {databaseOwner}{objectQualifier}Modules SET ModuleDefID=" + objModule.ModuleDefID + " WHERE ModuleID=" + this.ModuleId)) { } @@ -351,13 +351,13 @@ private bool CreateModuleDefinition() } else { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TemplateProblem.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TemplateProblem.ErrorMessage", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); return false; } } else { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("AlreadyExists.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("AlreadyExists.ErrorMessage", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); return false; } } @@ -377,60 +377,60 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - optLanguage.SelectedIndexChanged += optLanguage_SelectedIndexChanged; - cboTemplate.SelectedIndexChanged += cboTemplate_SelectedIndexChanged; - cmdCreate.Click += cmdCreate_Click; + this.optLanguage.SelectedIndexChanged += this.optLanguage_SelectedIndexChanged; + this.cboTemplate.SelectedIndexChanged += this.cboTemplate_SelectedIndexChanged; + this.cmdCreate.Click += this.cmdCreate_Click; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (UserInfo.IsSuperUser) + if (this.UserInfo.IsSuperUser) { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { Dictionary HostSettings = HostController.Instance.GetSettingsDictionary(); if (HostSettings.ContainsKey("Owner")) { - txtOwner.Text = HostSettings["Owner"]; + this.txtOwner.Text = HostSettings["Owner"]; } - LoadLanguages(); - LoadModuleTemplates(); - txtControl.Text = "View"; + this.LoadLanguages(); + this.LoadModuleTemplates(); + this.txtControl.Text = "View"; } } else { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("SuperUser.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); - createForm.Visible = false; + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("SuperUser.ErrorMessage", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + this.createForm.Visible = false; } } protected void optLanguage_SelectedIndexChanged(object sender, EventArgs e) { - LoadModuleTemplates(); + this.LoadModuleTemplates(); } protected void cboTemplate_SelectedIndexChanged(object sender, EventArgs e) { - LoadReadMe(); + this.LoadReadMe(); } protected void cmdCreate_Click(object sender, EventArgs e) { - if (UserInfo.IsSuperUser) + if (this.UserInfo.IsSuperUser) { - if (!String.IsNullOrEmpty(txtOwner.Text) && !String.IsNullOrEmpty(txtModule.Text) && cboTemplate.SelectedIndex > 0 && !String.IsNullOrEmpty(txtControl.Text)) + if (!String.IsNullOrEmpty(this.txtOwner.Text) && !String.IsNullOrEmpty(this.txtModule.Text) && this.cboTemplate.SelectedIndex > 0 && !String.IsNullOrEmpty(this.txtControl.Text)) { - HostController.Instance.Update("Owner", txtOwner.Text, false); - if (CreateModuleDefinition()) + HostController.Instance.Update("Owner", this.txtOwner.Text, false); + if (this.CreateModuleDefinition()) { - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } else { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InputValidation.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InputValidation.ErrorMessage", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } } } diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj index 9d22fa01297..e91f53017e1 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/Dnn.Modules.ModuleCreator.csproj @@ -1,259 +1,268 @@ - - - - - Debug - AnyCPU - - - 2.0 - {BD519B8A-169C-4328-BF67-62CD278435BC} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Dnn.Modules.ModuleCreator - Dnn.Modules.ModuleCreator - v4.7.2 - true - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\Dnn.Modules.ModuleCreator.XML - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\Dnn.Modules.ModuleCreator.XML - 1591,1573 - 7 - - - - False - ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll - - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - - - - - - - - - - - - - - - - - ..\..\Components\Telerik\bin\Telerik.Web.UI.dll - - - - - SolutionInfo.cs - - - - - CreateModule.ascx - ASPXCodeBehind - - - CreateModule.ascx - - - - - - ASPXCodeBehind - - - - Settings.ascx - - - - - viewsource.ascx - ASPXCodeBehind - - - viewsource.ascx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ASPXCodeBehind - - - - - - - ASPXCodeBehind - - - - - - - - - - - - - - - - - - - - - - - - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - - - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} - DotNetNuke.DependencyInjection - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {03e3afa5-ddc9-48fb-a839-ad4282ce237e} - DotNetNuke.Web.Client - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - Designer - - - - - - - - - - Settings.ascx.cs - - - Designer - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - True - True - 56695 - / - http://localhost:56695/ - False - False - - - False - - - - - + + + + + Debug + AnyCPU + + + 2.0 + {BD519B8A-169C-4328-BF67-62CD278435BC} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Dnn.Modules.ModuleCreator + Dnn.Modules.ModuleCreator + v4.7.2 + true + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + bin\Dnn.Modules.ModuleCreator.XML + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\Dnn.Modules.ModuleCreator.XML + 1591,1573 + 7 + + + + False + ..\..\DotNetNuke.WebUtility\bin\DotNetNuke.WebUtility.dll + + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + + + + + + + + + + + + + + + + + ..\..\Components\Telerik\bin\Telerik.Web.UI.dll + + + + + SolutionInfo.cs + + + + + CreateModule.ascx + ASPXCodeBehind + + + CreateModule.ascx + + + + + + ASPXCodeBehind + + + + Settings.ascx + + + + + viewsource.ascx + ASPXCodeBehind + + + viewsource.ascx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ASPXCodeBehind + + + + + + + ASPXCodeBehind + + + + + + + + + + + + + + + + + + + + + + + + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + + + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} + DotNetNuke.DependencyInjection + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {03e3afa5-ddc9-48fb-a839-ad4282ce237e} + DotNetNuke.Web.Client + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + Designer + + + + + + + + + + Settings.ascx.cs + + + Designer + + + + + + + + + + + + + + stylecop.json + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 56695 + / + http://localhost:56695/ + False + False + + + False + + + + + \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config index 015e7e36813..4fca05e5f8c 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs index 3387d119884..38e61ff49e0 100644 --- a/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs +++ b/DNN Platform/Admin Modules/Dnn.Modules.ModuleCreator/viewsource.ascx.cs @@ -32,7 +32,7 @@ public partial class ViewSource : PortalModuleBase private readonly INavigationManager _navigationManager; public ViewSource() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } @@ -43,9 +43,9 @@ protected int ModuleControlId get { var moduleControlId = Null.NullInteger; - if ((Request.QueryString["ctlid"] != null)) + if ((this.Request.QueryString["ctlid"] != null)) { - moduleControlId = Int32.Parse(Request.QueryString["ctlid"]); + moduleControlId = Int32.Parse(this.Request.QueryString["ctlid"]); } return moduleControlId; } @@ -55,7 +55,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(this.Request.Params["ReturnURL"]) ?? this._navigationManager.NavigateURL(); } } @@ -66,14 +66,14 @@ private string ReturnURL private void BindFiles(string controlSrc) { string[] fileList; - cboFile.Items.Clear(); + this.cboFile.Items.Clear(); - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); - var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); + var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, this.PortalId); var relativePath = $"DesktopModules/{(objModuleControl.ControlSrc.EndsWith(".mvc") ? "MVC/" : string.Empty)}{objDesktopModule.FolderName}/"; - var modulePath = Server.MapPath(relativePath); + var modulePath = this.Server.MapPath(relativePath); if (Directory.Exists(modulePath)) { @@ -84,11 +84,11 @@ private void BindFiles(string controlSrc) switch (Path.GetExtension(filePath).ToLowerInvariant()) { case ".ascx": - cboFile.Items.Add(new ListItem(filePath.Substring(modulePath.Length), filePath)); + this.cboFile.Items.Add(new ListItem(filePath.Substring(modulePath.Length), filePath)); var resxPath = filePath.Replace(Path.GetFileName(filePath), "App_LocalResources\\" + Path.GetFileName(filePath)) + ".resx"; if (File.Exists(resxPath)) { - cboFile.Items.Add(new ListItem(filePath.Substring(modulePath.Length), resxPath)); + this.cboFile.Items.Add(new ListItem(filePath.Substring(modulePath.Length), resxPath)); } break; case ".vb": @@ -103,14 +103,14 @@ private void BindFiles(string controlSrc) case ".xslt": case ".sql": case ".sqldataprovider": - cboFile.Items.Add(new ListItem(filePath.Substring(modulePath.Length), filePath)); + this.cboFile.Items.Add(new ListItem(filePath.Substring(modulePath.Length), filePath)); break; } } } else { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("FolderNameInvalid", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("FolderNameInvalid", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } @@ -124,31 +124,31 @@ private void BindFiles(string controlSrc) switch (Path.GetExtension(filePath).ToLowerInvariant()) { case ".vb": - cboFile.Items.Add(new ListItem(Path.GetFileName(filePath), filePath)); + this.cboFile.Items.Add(new ListItem(Path.GetFileName(filePath), filePath)); break; case ".cs": - cboFile.Items.Add(new ListItem(Path.GetFileName(filePath), filePath)); + this.cboFile.Items.Add(new ListItem(Path.GetFileName(filePath), filePath)); break; } } } // select file - if (cboFile.Items.FindByValue(Globals.ApplicationMapPath + "\\" + controlSrc.Replace("/", "\\")) != null) + if (this.cboFile.Items.FindByValue(Globals.ApplicationMapPath + "\\" + controlSrc.Replace("/", "\\")) != null) { - cboFile.Items.FindByValue(Globals.ApplicationMapPath + "\\" + controlSrc.Replace("/", "\\")).Selected = true; + this.cboFile.Items.FindByValue(Globals.ApplicationMapPath + "\\" + controlSrc.Replace("/", "\\")).Selected = true; } } private void LoadFile() { - lblPath.Text = cboFile.SelectedValue; - var objStreamReader = File.OpenText(lblPath.Text); - txtSource.Text = objStreamReader.ReadToEnd(); + this.lblPath.Text = this.cboFile.SelectedValue; + var objStreamReader = File.OpenText(this.lblPath.Text); + this.txtSource.Text = objStreamReader.ReadToEnd(); objStreamReader.Close(); - SetFileType(lblPath.Text); + this.SetFileType(this.lblPath.Text); } private void SetFileType(string filePath) @@ -180,18 +180,18 @@ private void SetFileType(string filePath) mimeType = "text/html"; break; } - DotNetNuke.UI.Utilities.ClientAPI.RegisterClientVariable(Page, "mimeType", mimeType, true); + DotNetNuke.UI.Utilities.ClientAPI.RegisterClientVariable(this.Page, "mimeType", mimeType, true); } private void SaveFile() { try { - File.SetAttributes(cboFile.SelectedValue, FileAttributes.Normal); - var objStream = File.CreateText(cboFile.SelectedValue); - objStream.WriteLine(txtSource.Text); + File.SetAttributes(this.cboFile.SelectedValue, FileAttributes.Normal); + var objStream = File.CreateText(this.cboFile.SelectedValue); + objStream.WriteLine(this.txtSource.Text); objStream.Close(); - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ControlUpdated", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ControlUpdated", this.LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); } catch (Exception exc) { @@ -201,16 +201,16 @@ private void SaveFile() private void LoadLanguages() { - optLanguage.Items.Clear(); - var moduleTemplatePath = Server.MapPath(ControlPath) + "Templates"; + this.optLanguage.Items.Clear(); + var moduleTemplatePath = this.Server.MapPath(this.ControlPath) + "Templates"; string[] folderList = Directory.GetDirectories(moduleTemplatePath); foreach (string folderPath in folderList) { - optLanguage.Items.Add(new ListItem(Path.GetFileName(folderPath))); + this.optLanguage.Items.Add(new ListItem(Path.GetFileName(folderPath))); } var language = ""; - foreach (ListItem objFile in cboFile.Items) + foreach (ListItem objFile in this.cboFile.Items) { if (objFile.Text.EndsWith(".vb")) { @@ -223,29 +223,29 @@ private void LoadLanguages() } if (language == "") { - optLanguage.SelectedIndex = 0; + this.optLanguage.SelectedIndex = 0; } else { - optLanguage.Items.FindByValue(language).Selected = true; + this.optLanguage.Items.FindByValue(language).Selected = true; } } private void LoadModuleTemplates() { - cboTemplate.Items.Clear(); - var moduleTemplatePath = Server.MapPath(ControlPath) + "Templates\\" + optLanguage.SelectedValue; + this.cboTemplate.Items.Clear(); + var moduleTemplatePath = this.Server.MapPath(this.ControlPath) + "Templates\\" + this.optLanguage.SelectedValue; string[] folderList = Directory.GetDirectories(moduleTemplatePath); foreach (string folderPath in folderList) { - cboTemplate.Items.Add(new ListItem(Path.GetFileName(folderPath))); + this.cboTemplate.Items.Add(new ListItem(Path.GetFileName(folderPath))); } - cboTemplate.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); + this.cboTemplate.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); } private void LoadReadMe() { - var templatePath = Server.MapPath(ControlPath) + "Templates\\" + optLanguage.SelectedValue + "\\" + cboTemplate.SelectedItem.Value; + var templatePath = this.Server.MapPath(this.ControlPath) + "Templates\\" + this.optLanguage.SelectedValue + "\\" + this.cboTemplate.SelectedItem.Value; if (File.Exists(templatePath + "\\readme.txt")) { var readMe = Null.NullString; @@ -254,11 +254,11 @@ private void LoadReadMe() readMe = tr.ReadToEnd(); tr.Close(); } - lblDescription.Text = readMe.Replace("\n", "
"); + this.lblDescription.Text = readMe.Replace("\n", "
"); } else { - lblDescription.Text = ""; + this.lblDescription.Text = ""; } //Determine if Control Name is required @@ -280,31 +280,31 @@ private void LoadReadMe() } } } - txtControl.Text = controlName; - txtControl.Enabled = controlNameRequired; - if (txtControl.Enabled) + this.txtControl.Text = controlName; + this.txtControl.Enabled = controlNameRequired; + if (this.txtControl.Enabled) { - if (!cboTemplate.SelectedItem.Value.ToLowerInvariant().StartsWith("module")) + if (!this.cboTemplate.SelectedItem.Value.ToLowerInvariant().StartsWith("module")) { - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); - var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); - txtControl.Text = objDesktopModule.FriendlyName; + var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, this.PortalId); + this.txtControl.Text = objDesktopModule.FriendlyName; } } } private string CreateModuleControl() { - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); - var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); + var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, this.PortalId); var objPackage = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID ==objDesktopModule.PackageID); - var moduleTemplatePath = Server.MapPath(ControlPath) + "Templates\\" + optLanguage.SelectedValue + "\\" + cboTemplate.SelectedValue + "\\"; + var moduleTemplatePath = this.Server.MapPath(this.ControlPath) + "Templates\\" + this.optLanguage.SelectedValue + "\\" + this.cboTemplate.SelectedValue + "\\"; - EventLogController.Instance.AddLog("Processing Template Folder", moduleTemplatePath, PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); + EventLogController.Instance.AddLog("Processing Template Folder", moduleTemplatePath, this.PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); var controlName = Null.NullString; @@ -316,7 +316,7 @@ private string CreateModuleControl() string[] fileList = Directory.GetFiles(moduleTemplatePath); foreach (string filePath in fileList) { - modulePath = Server.MapPath("DesktopModules/" + objDesktopModule.FolderName + "/"); + modulePath = this.Server.MapPath("DesktopModules/" + objDesktopModule.FolderName + "/"); //open file using (TextReader tr = new StreamReader(filePath)) @@ -333,15 +333,15 @@ private string CreateModuleControl() } sourceCode = sourceCode.Replace("_OWNER_", owner); sourceCode = sourceCode.Replace("_MODULE_", objDesktopModule.FriendlyName.Replace(" ", "")); - sourceCode = sourceCode.Replace("_CONTROL_", GetControl()); + sourceCode = sourceCode.Replace("_CONTROL_", this.GetControl()); sourceCode = sourceCode.Replace("_YEAR_", DateTime.Now.Year.ToString()); //get filename fileName = Path.GetFileName(filePath); - fileName = fileName.Replace("template", GetControl()); + fileName = fileName.Replace("template", this.GetControl()); fileName = fileName.Replace("_OWNER_", objPackage.Owner.Replace(" ", "")); fileName = fileName.Replace("_MODULE_", objDesktopModule.FriendlyName.Replace(" ", "")); - fileName = fileName.Replace("_CONTROL_", GetControl()); + fileName = fileName.Replace("_CONTROL_", this.GetControl()); switch (Path.GetExtension(filePath).ToLowerInvariant()) { @@ -390,7 +390,7 @@ private string CreateModuleControl() tw.Close(); } - EventLogController.Instance.AddLog("Created File", modulePath + fileName, PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); + EventLogController.Instance.AddLog("Created File", modulePath + fileName, this.PortalSettings, -1, EventLogController.EventLogType.HOST_ALERT); } } @@ -403,10 +403,10 @@ private string CreateModuleControl() objModuleControl = new ModuleControlInfo(); objModuleControl.ModuleControlID = Null.NullInteger; objModuleControl.ModuleDefID = objModuleDefinition.ModuleDefID; - objModuleControl.ControlKey = GetControl(); + objModuleControl.ControlKey = this.GetControl(); objModuleControl.ControlSrc = "DesktopModules/" + objDesktopModule.FolderName + "/" + controlName; - objModuleControl.ControlTitle = txtControl.Text; - objModuleControl.ControlType = (SecurityAccessLevel)Enum.Parse(typeof(SecurityAccessLevel), cboType.SelectedItem.Value); + objModuleControl.ControlTitle = this.txtControl.Text; + objModuleControl.ControlType = (SecurityAccessLevel)Enum.Parse(typeof(SecurityAccessLevel), this.cboType.SelectedItem.Value); objModuleControl.HelpURL = ""; objModuleControl.IconFile = ""; objModuleControl.ViewOrder = 0; @@ -421,14 +421,14 @@ private string CreateModuleControl() } } - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ControlCreated", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ControlCreated", this.LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); return controlName; } private string GetControl() { - return txtControl.Text.Replace(" ", ""); + return this.txtControl.Text.Replace(" ", ""); } @@ -441,95 +441,95 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - cboFile.SelectedIndexChanged += OnFileIndexChanged; - optLanguage.SelectedIndexChanged += OnLanguageSelectedIndexChanged; - cboTemplate.SelectedIndexChanged += cboTemplate_SelectedIndexChanged; - cmdUpdate.Click += OnUpdateClick; - cmdPackage.Click += OnPackageClick; - cmdConfigure.Click += OnConfigureClick; - cmdCreate.Click += OnCreateClick; + this.cboFile.SelectedIndexChanged += this.OnFileIndexChanged; + this.optLanguage.SelectedIndexChanged += this.OnLanguageSelectedIndexChanged; + this.cboTemplate.SelectedIndexChanged += this.cboTemplate_SelectedIndexChanged; + this.cmdUpdate.Click += this.OnUpdateClick; + this.cmdPackage.Click += this.OnPackageClick; + this.cmdConfigure.Click += this.OnConfigureClick; + this.cmdCreate.Click += this.OnCreateClick; - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - cmdCancel1.NavigateUrl = ReturnURL; - cmdCancel2.NavigateUrl = ReturnURL; + this.cmdCancel1.NavigateUrl = this.ReturnURL; + this.cmdCancel2.NavigateUrl = this.ReturnURL; - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); if (objModuleControl != null) { - BindFiles(objModuleControl.ControlSrc); - LoadFile(); + this.BindFiles(objModuleControl.ControlSrc); + this.LoadFile(); } - if (Request.UrlReferrer != null) + if (this.Request.UrlReferrer != null) { - ViewState["UrlReferrer"] = Convert.ToString(Request.UrlReferrer); + this.ViewState["UrlReferrer"] = Convert.ToString(this.Request.UrlReferrer); } else { - ViewState["UrlReferrer"] = ""; + this.ViewState["UrlReferrer"] = ""; } - LoadLanguages(); - LoadModuleTemplates(); - if (cboTemplate.Items.FindByText("Module - User Control") != null) + this.LoadLanguages(); + this.LoadModuleTemplates(); + if (this.cboTemplate.Items.FindByText("Module - User Control") != null) { - cboTemplate.Items.FindByText("Module - User Control").Selected = true; + this.cboTemplate.Items.FindByText("Module - User Control").Selected = true; } - LoadReadMe(); + this.LoadReadMe(); } } protected void OnFileIndexChanged(object sender, EventArgs e) { - LoadFile(); + this.LoadFile(); } protected void OnLanguageSelectedIndexChanged(object sender, EventArgs e) { - LoadModuleTemplates(); + this.LoadModuleTemplates(); } protected void cboTemplate_SelectedIndexChanged(object sender, EventArgs e) { - LoadReadMe(); + this.LoadReadMe(); } private void OnUpdateClick(object sender, EventArgs e) { - SaveFile(); + this.SaveFile(); } private void OnPackageClick(object sender, EventArgs e) { - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); - var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); + var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, this.PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(_navigationManager.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); + this.Response.Redirect(this._navigationManager.NavigateURL(objModule.TabID, "PackageWriter", "rtab=" + this.TabId.ToString(), "packageId=" + objDesktopModule.PackageID.ToString(), "mid=" + objModule.ModuleID.ToString()) + "?popUp=true", true); } private void OnConfigureClick(object sender, EventArgs e) { - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); var objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); - var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); + var objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, this.PortalId); ModuleInfo objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); - Response.Redirect(_navigationManager.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); + this.Response.Redirect(this._navigationManager.NavigateURL(objModule.TabID, "Edit", "mid=" + objModule.ModuleID.ToString(), "PackageID=" + objDesktopModule.PackageID.ToString()) + "?popUp=true", true); } private void OnCreateClick(object sender, EventArgs e) { - if (cboTemplate.SelectedIndex > 0 && txtControl.Text != "") + if (this.cboTemplate.SelectedIndex > 0 && this.txtControl.Text != "") { - var controlSrc = CreateModuleControl(); - BindFiles(controlSrc); - LoadFile(); + var controlSrc = this.CreateModuleControl(); + this.BindFiles(controlSrc); + this.LoadFile(); } else { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("AddControlError", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("AddControlError", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } } diff --git a/DNN Platform/Connectors/Azure/Components/AzureConnector.cs b/DNN Platform/Connectors/Azure/Components/AzureConnector.cs index e89ad51df95..bdb71f50377 100644 --- a/DNN Platform/Connectors/Azure/Components/AzureConnector.cs +++ b/DNN Platform/Connectors/Azure/Components/AzureConnector.cs @@ -36,9 +36,9 @@ public string DisplayName get { return - string.IsNullOrEmpty(_displayName) ? DefaultDisplayName : _displayName; + string.IsNullOrEmpty(this._displayName) ? DefaultDisplayName : this._displayName; } - set { _displayName = value; } + set { this._displayName = value; } } public string IconUrl @@ -71,11 +71,11 @@ public bool IsEngageConnector #region Public Methods public IEnumerable GetConnectors(int portalId) { - var connectors = FindAzureFolderMappings(portalId); + var connectors = this.FindAzureFolderMappings(portalId); if (connectors != null && connectors.Any()) { - connectors.ForEach(x => { Id = x.FolderMappingID.ToString(); }); - var finalCon = connectors.Select(x => (IConnector)Activator.CreateInstance(GetType())).ToList(); + connectors.ForEach(x => { this.Id = x.FolderMappingID.ToString(); }); + var finalCon = connectors.Select(x => (IConnector)Activator.CreateInstance(this.GetType())).ToList(); finalCon.ForEach(x => { x.Id = connectors[finalCon.IndexOf(x)].FolderMappingID.ToString(); @@ -88,10 +88,10 @@ public IEnumerable GetConnectors(int portalId) public void DeleteConnector(int portalId) { - if (!string.IsNullOrEmpty(Id)) + if (!string.IsNullOrEmpty(this.Id)) { int mappingId; - if (int.TryParse(Id, out mappingId)) + if (int.TryParse(this.Id, out mappingId)) { DeleteAzureFolders(portalId, mappingId); DeleteAzureFolderMapping(portalId, mappingId); @@ -101,24 +101,24 @@ public void DeleteConnector(int portalId) public bool HasConfig(int portalId) { - var folderMapping = FindAzureFolderMapping(portalId, false, true); - Id = Convert.ToString(folderMapping?.FolderMappingID); - return GetConfig(portalId)["Connected"] == "true"; + var folderMapping = this.FindAzureFolderMapping(portalId, false, true); + this.Id = Convert.ToString(folderMapping?.FolderMappingID); + return this.GetConfig(portalId)["Connected"] == "true"; } public IDictionary GetConfig(int portalId) { var configs = new Dictionary(); - var folderMapping = FindAzureFolderMapping(portalId, false); + var folderMapping = this.FindAzureFolderMapping(portalId, false); var settings = folderMapping != null ? folderMapping.FolderMappingSettings : new Hashtable(); - configs.Add("AccountName", GetSetting(settings, Constants.AzureAccountName, true)); - configs.Add("AccountKey", GetSetting(settings, Constants.AzureAccountKey, true)); - configs.Add("Container", GetSetting(settings, Constants.AzureContainerName)); - configs.Add("Connected", !string.IsNullOrEmpty(GetSetting(settings, Constants.AzureAccountName)) && !string.IsNullOrEmpty(GetSetting(settings, Constants.AzureContainerName)) ? "true" : "false"); + configs.Add("AccountName", this.GetSetting(settings, Constants.AzureAccountName, true)); + configs.Add("AccountKey", this.GetSetting(settings, Constants.AzureAccountKey, true)); + configs.Add("Container", this.GetSetting(settings, Constants.AzureContainerName)); + configs.Add("Connected", !string.IsNullOrEmpty(this.GetSetting(settings, Constants.AzureAccountName)) && !string.IsNullOrEmpty(this.GetSetting(settings, Constants.AzureContainerName)) ? "true" : "false"); //This setting will improve the UI to set password-type inputs on secure settings configs.Add("SecureSettings", "AccountKey"); @@ -138,47 +138,47 @@ public bool SaveConfig(int portalId, IDictionary values, ref boo validated = true; if (emptyFields) { - if (SupportsMultiple) + if (this.SupportsMultiple) throw new Exception(Localization.GetString("ErrorRequiredFields", Constants.LocalResourceFile)); DeleteAzureFolderMapping(portalId); return true; } - if (!Validation(azureAccountName, azureAccountKey, azureContainerName)) + if (!this.Validation(azureAccountName, azureAccountKey, azureContainerName)) { validated = false; return true; } - if (FolderMappingNameExists(portalId, DisplayName, - Convert.ToInt32(!string.IsNullOrEmpty(Id) ? Id : null))) + if (this.FolderMappingNameExists(portalId, this.DisplayName, + Convert.ToInt32(!string.IsNullOrEmpty(this.Id) ? this.Id : null))) { throw new Exception(Localization.GetString("ErrorMappingNameExists", Constants.LocalResourceFile)); } try { - var folderMappings = FindAzureFolderMappings(portalId); + var folderMappings = this.FindAzureFolderMappings(portalId); FolderMappingInfo folderMapping; - if (SupportsMultiple && !string.IsNullOrEmpty(Id)) + if (this.SupportsMultiple && !string.IsNullOrEmpty(this.Id)) { - folderMapping = folderMappings.FirstOrDefault(x => x.FolderMappingID.ToString() == Id); + folderMapping = folderMappings.FirstOrDefault(x => x.FolderMappingID.ToString() == this.Id); } else { - folderMapping = FindAzureFolderMapping(portalId); + folderMapping = this.FindAzureFolderMapping(portalId); } var settings = folderMapping.FolderMappingSettings; - var savedAccount = GetSetting(settings, Constants.AzureAccountName, true); - var savedKey = GetSetting(settings, Constants.AzureAccountKey, true); - var savedContainer = GetSetting(settings, Constants.AzureContainerName); + var savedAccount = this.GetSetting(settings, Constants.AzureAccountName, true); + var savedKey = this.GetSetting(settings, Constants.AzureAccountKey, true); + var savedContainer = this.GetSetting(settings, Constants.AzureContainerName); var accountChanged = savedAccount != azureAccountName || savedKey != azureAccountKey; if (accountChanged) { DeleteAzureFolderMapping(portalId, folderMapping.FolderMappingID); - folderMapping = FindAzureFolderMapping(portalId); + folderMapping = this.FindAzureFolderMapping(portalId); settings = folderMapping.FolderMappingSettings; } else if (savedContainer != azureContainerName) @@ -208,10 +208,10 @@ public bool SaveConfig(int portalId, IDictionary values, ref boo { folderMapping.FolderMappingSettings[Constants.UseHttps] = "True"; } - if (folderMapping.MappingName != DisplayName && !string.IsNullOrEmpty(DisplayName) && - DisplayName != DefaultDisplayName) + if (folderMapping.MappingName != this.DisplayName && !string.IsNullOrEmpty(this.DisplayName) && + this.DisplayName != DefaultDisplayName) { - folderMapping.MappingName = DisplayName; + folderMapping.MappingName = this.DisplayName; } if (!folderMapping.FolderMappingSettings.ContainsKey(Constants.SyncBatchSize)) { @@ -353,17 +353,17 @@ private FolderMappingInfo FindAzureFolderMapping(int portalId, bool autoCreate = //Create new mapping if none is found. if (!folderMappings.Any() && autoCreate) { - return CreateAzureFolderMapping(portalId, DefaultDisplayName); + return this.CreateAzureFolderMapping(portalId, DefaultDisplayName); } - if ((checkId && string.IsNullOrEmpty(Id)) || !SupportsMultiple) + if ((checkId && string.IsNullOrEmpty(this.Id)) || !this.SupportsMultiple) return folderMappings.FirstOrDefault(); - var folderMapping = folderMappings.FirstOrDefault(x => x.FolderMappingID.ToString() == Id); + var folderMapping = folderMappings.FirstOrDefault(x => x.FolderMappingID.ToString() == this.Id); if (folderMapping == null && autoCreate) { - folderMapping = CreateAzureFolderMapping(portalId); + folderMapping = this.CreateAzureFolderMapping(portalId); } return folderMapping; } @@ -386,7 +386,7 @@ private bool FolderMappingNameExists(int portalId, string mappingName, int? exce private FolderMappingInfo CreateAzureFolderMapping(int portalId, string mappingName = "") { var folderMapping = CreateAzureFolderMappingStatic(portalId, mappingName); - Id = folderMapping.FolderMappingID.ToString(); + this.Id = folderMapping.FolderMappingID.ToString(); return folderMapping; } diff --git a/DNN Platform/Connectors/Azure/Dnn.AzureConnector.csproj b/DNN Platform/Connectors/Azure/Dnn.AzureConnector.csproj index a5faede3662..5901ef84d8c 100644 --- a/DNN Platform/Connectors/Azure/Dnn.AzureConnector.csproj +++ b/DNN Platform/Connectors/Azure/Dnn.AzureConnector.csproj @@ -1,136 +1,143 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {13F62719-88BE-4EAD-9740-F0787A9B0A94} - Library - Properties - Dnn.AzureConnector - Dnn.AzureConnector - v4.7.2 - 512 - - - - true - full - false - bin - DEBUG;TRACE - prompt - 4 - bin\Dnn.AzureConnector.xml - 7 - 1591 - - - pdbonly - true - bin - TRACE - prompt - 4 - bin\Dnn.AzureConnector.xml - 1591 - 7 - - - true - full - false - bin - DEBUG;TRACE;CLOUD;CLOUD_DEBUG - prompt - 4 - bin\Dnn.AzureConnector.xml - 7 - 1591 - - - pdbonly - true - bin - TRACE;CLOUD;CLOUD_RELEASE - prompt - 4 - bin\Dnn.AzureConnector.xml - 1591 - 7 - - - - False - ..\..\Components\WindowsAzure\Microsoft.WindowsAzure.Storage.dll - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\..\..\Packages\RestSharp.104.1\lib\net4\RestSharp.dll - - - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - - - - - - - SolutionInfo.cs - - - - - - - - - - - - - - - - - - - Designer - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {b267ce88-dffc-4bd8-9962-319e79c52526} - DotNetNuke.Providers.FolderProviders - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {13F62719-88BE-4EAD-9740-F0787A9B0A94} + Library + Properties + Dnn.AzureConnector + Dnn.AzureConnector + v4.7.2 + 512 + + + + true + full + false + bin + DEBUG;TRACE + prompt + 4 + bin\Dnn.AzureConnector.xml + 7 + 1591 + + + pdbonly + true + bin + TRACE + prompt + 4 + bin\Dnn.AzureConnector.xml + 1591 + 7 + + + true + full + false + bin + DEBUG;TRACE;CLOUD;CLOUD_DEBUG + prompt + 4 + bin\Dnn.AzureConnector.xml + 7 + 1591 + + + pdbonly + true + bin + TRACE;CLOUD;CLOUD_RELEASE + prompt + 4 + bin\Dnn.AzureConnector.xml + 1591 + 7 + + + + False + ..\..\Components\WindowsAzure\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\..\..\Packages\RestSharp.104.1\lib\net4\RestSharp.dll + + + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + + + + + + + SolutionInfo.cs + + + + + + + stylecop.json + + + + + + + + + + + + + + + Designer + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {b267ce88-dffc-4bd8-9962-319e79c52526} + DotNetNuke.Providers.FolderProviders + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Connectors/Azure/Services/ServicesController.cs b/DNN Platform/Connectors/Azure/Services/ServicesController.cs index 6e5ffaa7ae5..13ebd9f0cbe 100644 --- a/DNN Platform/Connectors/Azure/Services/ServicesController.cs +++ b/DNN Platform/Connectors/Azure/Services/ServicesController.cs @@ -26,32 +26,32 @@ public HttpResponseMessage GetAllContainers(int id) { var containers = new List(); var folderProvider = new AzureFolderProvider(); - var folderMapping = Components.AzureConnector.FindAzureFolderMappingStatic(PortalSettings.PortalId, id, false); + var folderMapping = Components.AzureConnector.FindAzureFolderMappingStatic(this.PortalSettings.PortalId, id, false); if (folderMapping != null) { containers = folderProvider.GetAllContainers(folderMapping); } - return Request.CreateResponse(HttpStatusCode.OK, containers); + return this.Request.CreateResponse(HttpStatusCode.OK, containers); } catch (StorageException ex) { Exceptions.LogException(ex); var message = ex.RequestInformation.HttpStatusMessage ?? ex.Message; - return Request.CreateResponse(HttpStatusCode.InternalServerError, new { Message = message }); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError, new { Message = message }); } catch (Exception ex) { Exceptions.LogException(ex); const string message = "An error has occurred connecting to the Azure account."; - return Request.CreateResponse(HttpStatusCode.InternalServerError, new { Message = message }); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError, new { Message = message }); } } [HttpGet] public HttpResponseMessage GetFolderMappingId() { - return Request.CreateResponse(HttpStatusCode.OK, Components.AzureConnector.FindAzureFolderMappingStatic(PortalSettings.PortalId).FolderMappingID); + return this.Request.CreateResponse(HttpStatusCode.OK, Components.AzureConnector.FindAzureFolderMappingStatic(this.PortalSettings.PortalId).FolderMappingID); } #endregion diff --git a/DNN Platform/Connectors/Azure/packages.config b/DNN Platform/Connectors/Azure/packages.config index a07ab7f74fd..aec57a8c9d8 100644 --- a/DNN Platform/Connectors/Azure/packages.config +++ b/DNN Platform/Connectors/Azure/packages.config @@ -1,9 +1,10 @@ - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Connectors/GoogleAnalytics/Dnn.GoogleAnalyticsConnector.csproj b/DNN Platform/Connectors/GoogleAnalytics/Dnn.GoogleAnalyticsConnector.csproj index 33ad3d45004..df1d4d9e85a 100644 --- a/DNN Platform/Connectors/GoogleAnalytics/Dnn.GoogleAnalyticsConnector.csproj +++ b/DNN Platform/Connectors/GoogleAnalytics/Dnn.GoogleAnalyticsConnector.csproj @@ -1,125 +1,132 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {ADB57FFD-677C-4C30-9723-6EE0A475315B} - Library - Properties - DNN.Connectors.GoogleAnalytics - DNN.Connectors.GoogleAnalytics - v4.7.2 - 512 - - - - true - full - false - bin - DEBUG;TRACE - prompt - 4 - bin\DNN.Connectors.GoogleAnalytics.xml - 7 - 1591 - - - pdbonly - true - bin - TRACE - prompt - 4 - bin\DNN.Connectors.GoogleAnalytics.xml - 1591 - 7 - - - true - full - false - bin - DEBUG;TRACE;CLOUD;CLOUD_DEBUG - prompt - 4 - bin\DNN.Connectors.GoogleAnalytics.xml - 7 - 1591 - - - pdbonly - true - bin - TRACE;CLOUD;CLOUD_RELEASE - prompt - 4 - bin\DNN.Connectors.GoogleAnalytics.xml - 1591 - 7 - - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - - - - - - - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {b267ce88-dffc-4bd8-9962-319e79c52526} - DotNetNuke.Providers.FolderProviders - - - - - - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {ADB57FFD-677C-4C30-9723-6EE0A475315B} + Library + Properties + DNN.Connectors.GoogleAnalytics + DNN.Connectors.GoogleAnalytics + v4.7.2 + 512 + + + + true + full + false + bin + DEBUG;TRACE + prompt + 4 + bin\DNN.Connectors.GoogleAnalytics.xml + 7 + 1591 + + + pdbonly + true + bin + TRACE + prompt + 4 + bin\DNN.Connectors.GoogleAnalytics.xml + 1591 + 7 + + + true + full + false + bin + DEBUG;TRACE;CLOUD;CLOUD_DEBUG + prompt + 4 + bin\DNN.Connectors.GoogleAnalytics.xml + 7 + 1591 + + + pdbonly + true + bin + TRACE;CLOUD;CLOUD_RELEASE + prompt + 4 + bin\DNN.Connectors.GoogleAnalytics.xml + 1591 + 7 + + + + ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + + + + + + + stylecop.json + + + + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {b267ce88-dffc-4bd8-9962-319e79c52526} + DotNetNuke.Providers.FolderProviders + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Connectors/GoogleAnalytics/GoogleAnalyticsConnector.cs b/DNN Platform/Connectors/GoogleAnalytics/GoogleAnalyticsConnector.cs index dd0174da1d4..20d55b4d165 100644 --- a/DNN Platform/Connectors/GoogleAnalytics/GoogleAnalyticsConnector.cs +++ b/DNN Platform/Connectors/GoogleAnalytics/GoogleAnalyticsConnector.cs @@ -30,10 +30,10 @@ public string DisplayName get { return - string.IsNullOrEmpty(_displayName) ? DefaultDisplayName : _displayName; + string.IsNullOrEmpty(this._displayName) ? DefaultDisplayName : this._displayName; } - set { _displayName = value; } + set { this._displayName = value; } } public string IconUrl @@ -79,7 +79,7 @@ public void DeleteConnector(int portalId) public bool HasConfig(int portalId) { - IDictionary config = GetConfig(portalId); + IDictionary config = this.GetConfig(portalId); return (config.ContainsKey("TrackingID") && !String.IsNullOrEmpty(config["TrackingID"])); @@ -114,13 +114,13 @@ public IDictionary GetConfig(int portalId) urlParameter = setting.SettingValue; break; case "trackforadmin": - trackForAdmin = HandleCustomBoolean(setting.SettingValue); + trackForAdmin = this.HandleCustomBoolean(setting.SettingValue); break; case "anonymizeip": - anonymizeIp = HandleCustomBoolean(setting.SettingValue); + anonymizeIp = this.HandleCustomBoolean(setting.SettingValue); break; case "trackuserid": - trackUserId = HandleCustomBoolean(setting.SettingValue); + trackUserId = this.HandleCustomBoolean(setting.SettingValue); break; } } @@ -138,8 +138,8 @@ public IDictionary GetConfig(int portalId) { "TrackAdministrators", trackForAdmin}, { "AnonymizeIp", anonymizeIp}, { "TrackUserId", trackUserId}, - { "DataConsent", HandleCustomBoolean(portalSettings.DataConsentActive.ToString()) }, - { "isDeactivating", HandleCustomBoolean("false") } + { "DataConsent", this.HandleCustomBoolean(portalSettings.DataConsentActive.ToString()) }, + { "isDeactivating", this.HandleCustomBoolean("false") } }; return configItems; diff --git a/DNN Platform/Connectors/GoogleAnalytics/packages.config b/DNN Platform/Connectors/GoogleAnalytics/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Connectors/GoogleAnalytics/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Controls/CountryListBox/CountryListBox.cs b/DNN Platform/Controls/CountryListBox/CountryListBox.cs index 5651e110b19..3969553ce63 100644 --- a/DNN Platform/Controls/CountryListBox/CountryListBox.cs +++ b/DNN Platform/Controls/CountryListBox/CountryListBox.cs @@ -28,14 +28,14 @@ public bool CacheGeoIPData { get { - return _CacheGeoIPData; + return this._CacheGeoIPData; } set { - _CacheGeoIPData = value; + this._CacheGeoIPData = value; if (value == false) { - Context.Cache.Remove("GeoIPData"); + this.Context.Cache.Remove("GeoIPData"); } } } @@ -45,11 +45,11 @@ public string GeoIPFile { get { - return _GeoIPFile; + return this._GeoIPFile; } set { - _GeoIPFile = value; + this._GeoIPFile = value; } } @@ -58,11 +58,11 @@ public string TestIP { get { - return _TestIP; + return this._TestIP; } set { - _TestIP = value; + this._TestIP = value; } } @@ -71,11 +71,11 @@ public string LocalhostCountryCode { get { - return _LocalhostCountryCode; + return this._LocalhostCountryCode; } set { - _LocalhostCountryCode = value; + this._LocalhostCountryCode = value; } } @@ -83,51 +83,51 @@ protected override void OnDataBinding(EventArgs e) { bool IsLocal = false; string IP; - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { //If GeoIPFile is not provided, assume they put it in BIN. - if (String.IsNullOrEmpty(_GeoIPFile)) + if (String.IsNullOrEmpty(this._GeoIPFile)) { - _GeoIPFile = "controls/CountryListBox/Data/GeoIP.dat"; + this._GeoIPFile = "controls/CountryListBox/Data/GeoIP.dat"; } - EnsureChildControls(); + this.EnsureChildControls(); //Check to see if a TestIP is specified - if (!String.IsNullOrEmpty(_TestIP)) + if (!String.IsNullOrEmpty(this._TestIP)) { //TestIP is specified, let's use it - IP = _TestIP; + IP = this._TestIP; } - else if (Page.Request.UserHostAddress == "127.0.0.1") + else if (this.Page.Request.UserHostAddress == "127.0.0.1") { //The country cannot be detected because the user is local. IsLocal = true; //Set the IP address in case they didn't specify LocalhostCountryCode - IP = Page.Request.UserHostAddress; + IP = this.Page.Request.UserHostAddress; } else { //Set the IP address so we can find the country - IP = Page.Request.UserHostAddress; + IP = this.Page.Request.UserHostAddress; } //Check to see if we need to generate the Cache for the GeoIPData file - if (Context.Cache.Get("GeoIPData") == null && _CacheGeoIPData) + if (this.Context.Cache.Get("GeoIPData") == null && this._CacheGeoIPData) { //Store it as well as setting a dependency on the file - Context.Cache.Insert("GeoIPData", CountryLookup.FileToMemory(Context.Server.MapPath(_GeoIPFile)), new CacheDependency(Context.Server.MapPath(_GeoIPFile))); + this.Context.Cache.Insert("GeoIPData", CountryLookup.FileToMemory(this.Context.Server.MapPath(this._GeoIPFile)), new CacheDependency(this.Context.Server.MapPath(this._GeoIPFile))); } //Check to see if the request is a localhost request //and see if the LocalhostCountryCode is specified - if (IsLocal && !String.IsNullOrEmpty(_LocalhostCountryCode)) + if (IsLocal && !String.IsNullOrEmpty(this._LocalhostCountryCode)) { //Bing the data base.OnDataBinding(e); //Pre-Select the value in the drop-down based //on the LocalhostCountryCode specified. - if (Items.FindByValue(_LocalhostCountryCode) != null) + if (this.Items.FindByValue(this._LocalhostCountryCode) != null) { - Items.FindByValue(_LocalhostCountryCode).Selected = true; + this.Items.FindByValue(this._LocalhostCountryCode).Selected = true; } } else @@ -138,15 +138,15 @@ protected override void OnDataBinding(EventArgs e) //Check to see if we are using the Cached //version of the GeoIPData file - if (_CacheGeoIPData) + if (this._CacheGeoIPData) { //Yes, get it from cache - _CountryLookup = new CountryLookup((MemoryStream) Context.Cache.Get("GeoIPData")); + _CountryLookup = new CountryLookup((MemoryStream) this.Context.Cache.Get("GeoIPData")); } else { //No, get it from file - _CountryLookup = new CountryLookup(Context.Server.MapPath(_GeoIPFile)); + _CountryLookup = new CountryLookup(this.Context.Server.MapPath(this._GeoIPFile)); } //Get the country code based on the IP address string _UserCountryCode = _CountryLookup.LookupCountryCode(IP); @@ -156,10 +156,10 @@ protected override void OnDataBinding(EventArgs e) //Make sure the value returned is actually //in the drop-down list. - if (Items.FindByValue(_UserCountryCode) != null) + if (this.Items.FindByValue(_UserCountryCode) != null) { //Yes, it's there, select it based on its value - Items.FindByValue(_UserCountryCode).Selected = true; + this.Items.FindByValue(_UserCountryCode).Selected = true; } else { @@ -171,9 +171,9 @@ protected override void OnDataBinding(EventArgs e) var newItem = new ListItem(); newItem.Value = _UserCountryCode; newItem.Text = _UserCountry; - Items.Insert(0, newItem); + this.Items.Insert(0, newItem); //Now let's Pre-Select it - Items.FindByValue(_UserCountryCode).Selected = true; + this.Items.FindByValue(_UserCountryCode).Selected = true; } } } diff --git a/DNN Platform/Controls/CountryListBox/CountryListBox.csproj b/DNN Platform/Controls/CountryListBox/CountryListBox.csproj index 7f2ccb0c406..a068734d796 100644 --- a/DNN Platform/Controls/CountryListBox/CountryListBox.csproj +++ b/DNN Platform/Controls/CountryListBox/CountryListBox.csproj @@ -1,91 +1,103 @@ - - - - 9.0.30729 - 2.0 - {CA056730-5759-41F8-A6C1-420F9C0C63E7} - Debug - AnyCPU - CountryListBox - None - Library - v4.7.2 - CountryListBox - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - bin\ - bin\CountryListBox.xml - true - true - 4 - full - AllRules.ruleset - 1591 - 7 - - - bin\ - bin\CountryListBox.xml - true - true - 4 - pdbonly - AllRules.ruleset - 1591 - true - 7 - - - - - - - - System.Web - - - - - - SolutionInfo.cs - - - Code - - - Code - - - Code - - - - - - - - - - - - + + + + 9.0.30729 + 2.0 + {CA056730-5759-41F8-A6C1-420F9C0C63E7} + Debug + AnyCPU + CountryListBox + None + Library + v4.7.2 + CountryListBox + + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + bin\ + bin\CountryListBox.xml + true + true + 4 + full + AllRules.ruleset + 1591 + 7 + + + bin\ + bin\CountryListBox.xml + true + true + 4 + pdbonly + AllRules.ruleset + 1591 + true + 7 + + + + + + + + System.Web + + + + + + SolutionInfo.cs + + + Code + + + Code + + + Code + + + + + + + + stylecop.json + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Controls/CountryListBox/CountryLookup.cs b/DNN Platform/Controls/CountryListBox/CountryLookup.cs index e4cba4f4e61..8f1825e4deb 100644 --- a/DNN Platform/Controls/CountryListBox/CountryLookup.cs +++ b/DNN Platform/Controls/CountryListBox/CountryLookup.cs @@ -68,7 +68,7 @@ public class CountryLookup public CountryLookup(MemoryStream ms) { - m_MemoryStream = ms; + this.m_MemoryStream = ms; } public CountryLookup(string FileLocation) @@ -78,11 +78,11 @@ public CountryLookup(string FileLocation) //------------------------------------------------------------------------------------------------ using (var _FileStream = new FileStream(FileLocation, FileMode.Open, FileAccess.Read)) { - m_MemoryStream = new MemoryStream(); + this.m_MemoryStream = new MemoryStream(); var _Byte = new byte[256]; while (_FileStream.Read(_Byte, 0, _Byte.Length) != 0) { - m_MemoryStream.Write(_Byte, 0, _Byte.Length); + this.m_MemoryStream.Write(_Byte, 0, _Byte.Length); } _FileStream.Close(); @@ -141,7 +141,7 @@ public static MemoryStream FileToMemory(string FileLocation) public string LookupCountryCode(IPAddress _IPAddress) { //Look up the country code, e.g. US, for the passed in IP Address - return CountryCode[Convert.ToInt32(SeekCountry(0, ConvertIPAddressToNumber(_IPAddress), 31))]; + return CountryCode[Convert.ToInt32(this.SeekCountry(0, this.ConvertIPAddressToNumber(_IPAddress), 31))]; } public string LookupCountryCode(string _IPAddress) @@ -156,13 +156,13 @@ public string LookupCountryCode(string _IPAddress) { return "--"; } - return LookupCountryCode(_Address); + return this.LookupCountryCode(_Address); } public string LookupCountryName(IPAddress addr) { //Look up the country name, e.g. United States, for the IP Address - return CountryName[Convert.ToInt32(SeekCountry(0, ConvertIPAddressToNumber(addr), 31))]; + return CountryName[Convert.ToInt32(this.SeekCountry(0, this.ConvertIPAddressToNumber(addr), 31))]; } public string LookupCountryName(string _IPAddress) @@ -177,7 +177,7 @@ public string LookupCountryName(string _IPAddress) { return "N/A"; } - return LookupCountryName(_Address); + return this.LookupCountryName(_Address); } public int SeekCountry(int Offset, long Ipnum, short Depth) @@ -193,8 +193,8 @@ public int SeekCountry(int Offset, long Ipnum, short Depth) { throw new Exception(); } - m_MemoryStream.Seek(6*Offset, 0); - var len = m_MemoryStream.Read(Buffer, 0, 6); + this.m_MemoryStream.Seek(6*Offset, 0); + var len = this.m_MemoryStream.Read(Buffer, 0, 6); if (len == 6) { for (I = 0; I <= 1; I++) @@ -225,7 +225,7 @@ public int SeekCountry(int Offset, long Ipnum, short Depth) { return Convert.ToInt32(X[1] - CountryBegin); } - return SeekCountry(X[1], Ipnum, Convert.ToInt16(Depth - 1)); + return this.SeekCountry(X[1], Ipnum, Convert.ToInt16(Depth - 1)); } else { @@ -233,7 +233,7 @@ public int SeekCountry(int Offset, long Ipnum, short Depth) { return Convert.ToInt32(X[0] - CountryBegin); } - return SeekCountry(X[0], Ipnum, Convert.ToInt16(Depth - 1)); + return this.SeekCountry(X[0], Ipnum, Convert.ToInt16(Depth - 1)); } } catch (Exception exc) diff --git a/DNN Platform/Controls/CountryListBox/packages.config b/DNN Platform/Controls/CountryListBox/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Controls/CountryListBox/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Auth/JwtAuthMessageHandler.cs b/DNN Platform/Dnn.AuthServices.Jwt/Auth/JwtAuthMessageHandler.cs index b66321e0136..57241d36c9d 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Auth/JwtAuthMessageHandler.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Auth/JwtAuthMessageHandler.cs @@ -25,7 +25,7 @@ public class JwtAuthMessageHandler : AuthMessageHandlerBase private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(JwtAuthMessageHandler)); - public override string AuthScheme => _jwtController.SchemeType; + public override string AuthScheme => this._jwtController.SchemeType; public override bool BypassAntiForgeryToken => true; internal static bool IsEnabled { get; set; } @@ -50,9 +50,9 @@ public JwtAuthMessageHandler(bool includeByDefault, bool forceSsl) public override HttpResponseMessage OnInboundRequest(HttpRequestMessage request, CancellationToken cancellationToken) { - if (NeedsAuthentication(request)) + if (this.NeedsAuthentication(request)) { - TryToAuthenticate(request); + this.TryToAuthenticate(request); } return base.OnInboundRequest(request, cancellationToken); @@ -62,11 +62,11 @@ private void TryToAuthenticate(HttpRequestMessage request) { try { - var username = _jwtController.ValidateToken(request); + var username = this._jwtController.ValidateToken(request); if (!string.IsNullOrEmpty(username)) { if (Logger.IsTraceEnabled) Logger.Trace($"Authenticated user '{username}'"); - SetCurrentPrincipal(new GenericPrincipal(new GenericIdentity(username, AuthScheme), null), request); + SetCurrentPrincipal(new GenericPrincipal(new GenericIdentity(username, this.AuthScheme), null), request); } } catch (Exception ex) diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs b/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs index 5c94ed26b0c..1d13d0827f8 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Components/Common/Controllers/JwtController.cs @@ -62,23 +62,23 @@ public string ValidateToken(HttpRequestMessage request) { if (!JwtAuthMessageHandler.IsEnabled) { - Logger.Trace(SchemeType + " is not registered/enabled in web.config file"); + Logger.Trace(this.SchemeType + " is not registered/enabled in web.config file"); return null; } - var authorization = ValidateAuthHeader(request?.Headers.Authorization); - return string.IsNullOrEmpty(authorization) ? null : ValidateAuthorizationValue(authorization); + var authorization = this.ValidateAuthHeader(request?.Headers.Authorization); + return string.IsNullOrEmpty(authorization) ? null : this.ValidateAuthorizationValue(authorization); } public bool LogoutUser(HttpRequestMessage request) { if (!JwtAuthMessageHandler.IsEnabled) { - Logger.Trace(SchemeType + " is not registered/enabled in web.config file"); + Logger.Trace(this.SchemeType + " is not registered/enabled in web.config file"); return false; } - var rawToken = ValidateAuthHeader(request?.Headers.Authorization); + var rawToken = this.ValidateAuthHeader(request?.Headers.Authorization); if (string.IsNullOrEmpty(rawToken)) { return false; @@ -92,7 +92,7 @@ public bool LogoutUser(HttpRequestMessage request) return false; } - DataProvider.DeleteToken(sessionId); + this.DataProvider.DeleteToken(sessionId); return true; } @@ -103,7 +103,7 @@ public LoginResultData LoginUser(HttpRequestMessage request, LoginData loginData { if (!JwtAuthMessageHandler.IsEnabled) { - Logger.Trace(SchemeType + " is not registered/enabled in web.config file"); + Logger.Trace(this.SchemeType + " is not registered/enabled in web.config file"); return EmptyWithError("disabled"); } @@ -155,7 +155,7 @@ public LoginResultData LoginUser(HttpRequestMessage request, LoginData loginData var accessToken = jwt.RawData; ptoken.TokenHash = GetHashedStr(accessToken); - DataProvider.AddToken(ptoken); + this.DataProvider.AddToken(ptoken); return new LoginResultData { @@ -170,11 +170,11 @@ public LoginResultData RenewToken(HttpRequestMessage request, string renewalToke { if (!JwtAuthMessageHandler.IsEnabled) { - Logger.Trace(SchemeType + " is not registered/enabled in web.config file"); + Logger.Trace(this.SchemeType + " is not registered/enabled in web.config file"); return EmptyWithError("disabled"); } - var rawToken = ValidateAuthHeader(request?.Headers.Authorization); + var rawToken = this.ValidateAuthHeader(request?.Headers.Authorization); if (string.IsNullOrEmpty(rawToken)) { return EmptyWithError("bad-credentials"); @@ -193,7 +193,7 @@ public LoginResultData RenewToken(HttpRequestMessage request, string renewalToke return EmptyWithError("bad-claims"); } - var ptoken = DataProvider.GetTokenById(sessionId); + var ptoken = this.DataProvider.GetTokenById(sessionId); if (ptoken == null) { if (Logger.IsTraceEnabled) Logger.Trace("Token not found in DB"); @@ -218,7 +218,7 @@ public LoginResultData RenewToken(HttpRequestMessage request, string renewalToke return EmptyWithError("bad-token"); } - var userInfo = TryGetUser(jwt, false); + var userInfo = this.TryGetUser(jwt, false); if (userInfo == null) { if (Logger.IsTraceEnabled) Logger.Trace("User not found in DB"); @@ -231,7 +231,7 @@ public LoginResultData RenewToken(HttpRequestMessage request, string renewalToke return EmptyWithError("bad-token"); } - return UpdateToken(renewalToken, ptoken, userInfo); + return this.UpdateToken(renewalToken, ptoken, userInfo); } private LoginResultData UpdateToken(string renewalToken, PersistedToken ptoken, UserInfo userInfo) @@ -251,7 +251,7 @@ private LoginResultData UpdateToken(string renewalToken, PersistedToken ptoken, // save hash values in DB so no one with access can create JWT header from existing data ptoken.TokenHash = GetHashedStr(accessToken); - DataProvider.UpdateToken(ptoken); + this.DataProvider.UpdateToken(ptoken); return new LoginResultData { @@ -307,7 +307,7 @@ private string ValidateAuthHeader(AuthenticationHeaderValue authHdr) if (!string.Equals(authHdr.Scheme, AuthScheme, StringComparison.CurrentCultureIgnoreCase)) { - if (Logger.IsTraceEnabled) Logger.Trace("Authorization header scheme in the request is not equal to " + SchemeType); + if (Logger.IsTraceEnabled) Logger.Trace("Authorization header scheme in the request is not equal to " + this.SchemeType); return null; } @@ -331,27 +331,27 @@ private string ValidateAuthorizationValue(string authorization) } var decoded = DecodeBase64(parts[0]); - if (decoded.IndexOf("\"" + SchemeType + "\"", StringComparison.InvariantCultureIgnoreCase) < 0) + if (decoded.IndexOf("\"" + this.SchemeType + "\"", StringComparison.InvariantCultureIgnoreCase) < 0) { - if (Logger.IsTraceEnabled) Logger.Trace($"This is not a {SchemeType} autentication scheme."); + if (Logger.IsTraceEnabled) Logger.Trace($"This is not a {this.SchemeType} autentication scheme."); return null; } var header = JsonConvert.DeserializeObject(decoded); - if (!IsValidSchemeType(header)) + if (!this.IsValidSchemeType(header)) return null; var jwt = GetAndValidateJwt(authorization, true); if (jwt == null) return null; - var userInfo = TryGetUser(jwt, true); + var userInfo = this.TryGetUser(jwt, true); return userInfo?.Username; } private bool IsValidSchemeType(JwtHeader header) { - if (!SchemeType.Equals(header["typ"] as string, StringComparison.OrdinalIgnoreCase)) + if (!this.SchemeType.Equals(header["typ"] as string, StringComparison.OrdinalIgnoreCase)) { if (Logger.IsTraceEnabled) Logger.Trace("Unsupported authentication scheme type " + header.Typ); return false; @@ -397,7 +397,7 @@ private UserInfo TryGetUser(JwtSecurityToken jwt, bool checkExpiry) { // validate against DB saved data var sessionId = GetJwtSessionValue(jwt); - var ptoken = DataProvider.GetTokenById(sessionId); + var ptoken = this.DataProvider.GetTokenById(sessionId); if (ptoken == null) { if (Logger.IsTraceEnabled) Logger.Trace("Token not found in DB"); diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Data/DataService.cs b/DNN Platform/Dnn.AuthServices.Jwt/Data/DataService.cs index 211d2dff007..f61bab7c6fa 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Data/DataService.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Data/DataService.cs @@ -28,7 +28,7 @@ public virtual PersistedToken GetTokenById(string tokenId) { return CBO.GetCachedObject( new CacheItemArgs(GetCacheKey(tokenId), 60, CacheItemPriority.Default), - _ => CBO.FillObject(_dataProvider.ExecuteReader("JsonWebTokens_GetById", tokenId))); + _ => CBO.FillObject(this._dataProvider.ExecuteReader("JsonWebTokens_GetById", tokenId))); } catch (InvalidCastException) { @@ -39,33 +39,33 @@ public virtual PersistedToken GetTokenById(string tokenId) public virtual IList GetUserTokens(int userId) { - return CBO.FillCollection(_dataProvider.ExecuteReader("JsonWebTokens_GetByUserId", userId)); + return CBO.FillCollection(this._dataProvider.ExecuteReader("JsonWebTokens_GetByUserId", userId)); } public virtual void AddToken(PersistedToken token) { - _dataProvider.ExecuteNonQuery("JsonWebTokens_Add", token.TokenId, token.UserId, + this._dataProvider.ExecuteNonQuery("JsonWebTokens_Add", token.TokenId, token.UserId, token.TokenExpiry, token.RenewalExpiry, token.TokenHash, token.RenewalHash); DataCache.SetCache(GetCacheKey(token.TokenId), token, token.TokenExpiry.ToLocalTime()); } public virtual void UpdateToken(PersistedToken token) { - _dataProvider.ExecuteNonQuery("JsonWebTokens_Update", token.TokenId, token.TokenExpiry, token.TokenHash); + this._dataProvider.ExecuteNonQuery("JsonWebTokens_Update", token.TokenId, token.TokenExpiry, token.TokenHash); token.RenewCount += 1; DataCache.SetCache(GetCacheKey(token.TokenId), token, token.TokenExpiry.ToLocalTime()); } public virtual void DeleteToken(string tokenId) { - _dataProvider.ExecuteNonQuery("JsonWebTokens_DeleteById", tokenId); + this._dataProvider.ExecuteNonQuery("JsonWebTokens_DeleteById", tokenId); DataCache.RemoveCache(GetCacheKey(tokenId)); } public virtual void DeleteUserTokens(int userId) { - _dataProvider.ExecuteNonQuery("JsonWebTokens_DeleteByUser", userId); - foreach (var token in GetUserTokens(userId)) + this._dataProvider.ExecuteNonQuery("JsonWebTokens_DeleteByUser", userId); + foreach (var token in this.GetUserTokens(userId)) { DataCache.RemoveCache(GetCacheKey(token.TokenId)); } @@ -74,7 +74,7 @@ public virtual void DeleteUserTokens(int userId) public virtual void DeleteExpiredTokens() { // don't worry aabout caching; these will already be invalidated by cache manager - _dataProvider.ExecuteNonQuery("JsonWebTokens_DeleteExpired"); + this._dataProvider.ExecuteNonQuery("JsonWebTokens_DeleteExpired"); } #endregion diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Dnn.AuthServices.Jwt.csproj b/DNN Platform/Dnn.AuthServices.Jwt/Dnn.AuthServices.Jwt.csproj index 56506eb273e..f048833cd07 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Dnn.AuthServices.Jwt.csproj +++ b/DNN Platform/Dnn.AuthServices.Jwt/Dnn.AuthServices.Jwt.csproj @@ -1,120 +1,126 @@ - - - - - Debug - AnyCPU - {3B2FA1D9-EC7D-4CEC-8FF5-A7700CF5CB40} - Library - Properties - Dnn.AuthServices.Jwt - Dnn.AuthServices.Jwt - v4.7.2 - 512 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - 1591 - bin\Dnn.AuthServices.Jwt.XML - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\Dnn.AuthServices.Jwt.XML - 1591 - 7 - - - - ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - False - True - - - - - - - ..\..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll - True - - - ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - ..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - - ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - True - - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {3B2FA1D9-EC7D-4CEC-8FF5-A7700CF5CB40} + Library + Properties + Dnn.AuthServices.Jwt + Dnn.AuthServices.Jwt + v4.7.2 + 512 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + 1591 + bin\Dnn.AuthServices.Jwt.XML + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\Dnn.AuthServices.Jwt.XML + 1591 + 7 + + + + ..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + False + True + + + + + + + ..\..\packages\System.IdentityModel.Tokens.Jwt.4.0.2.206221351\lib\net45\System.IdentityModel.Tokens.Jwt.dll + True + + + ..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + ..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + + ..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + True + + + + + + + + + + + + + + + + + + + + stylecop.json + + + Designer + + + + + + + + + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Services/MobileController.cs b/DNN Platform/Dnn.AuthServices.Jwt/Services/MobileController.cs index f56b5d24a77..be8e26b6c84 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Services/MobileController.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Services/MobileController.cs @@ -22,7 +22,7 @@ public class MobileController : DnnApiController [HttpGet] public IHttpActionResult Logout() { - return JwtController.Instance.LogoutUser(Request) ? (IHttpActionResult)Ok(new { success = true}) : Unauthorized(); + return JwtController.Instance.LogoutUser(this.Request) ? (IHttpActionResult)this.Ok(new { success = true}) : this.Unauthorized(); } /// @@ -36,8 +36,8 @@ public IHttpActionResult Logout() [AllowAnonymous] public IHttpActionResult Login(LoginData loginData) { - var result = JwtController.Instance.LoginUser(Request, loginData); - return ReplyWith(result); + var result = JwtController.Instance.LoginUser(this.Request, loginData); + return this.ReplyWith(result); } /// @@ -53,8 +53,8 @@ public IHttpActionResult Login(LoginData loginData) [AllowAnonymous] public IHttpActionResult ExtendToken(RenewalDto rtoken) { - var result = JwtController.Instance.RenewToken(Request, rtoken.RenewalToken); - return ReplyWith(result); + var result = JwtController.Instance.RenewToken(this.Request, rtoken.RenewalToken); + return this.ReplyWith(result); } #endregion @@ -65,16 +65,16 @@ private IHttpActionResult ReplyWith(LoginResultData result) { if (result == null) { - return Unauthorized(); + return this.Unauthorized(); } if (!string.IsNullOrEmpty(result.Error)) { //HACK: this will return the scheme with the error message as a challenge; non-standard method - return Unauthorized(new AuthenticationHeaderValue(JwtController.AuthScheme, result.Error)); + return this.Unauthorized(new AuthenticationHeaderValue(JwtController.AuthScheme, result.Error)); } - return Ok(result); + return this.Ok(result); } #endregion @@ -87,7 +87,7 @@ public IHttpActionResult TestGet() { var identity = System.Threading.Thread.CurrentPrincipal.Identity; var reply = $"Hello {identity.Name}! You are authenticated through {identity.AuthenticationType}."; - return Ok(new { reply }); + return this.Ok(new { reply }); } // Test API Method 2 @@ -98,7 +98,7 @@ public IHttpActionResult TestPost(TestPostData something) var identity = System.Threading.Thread.CurrentPrincipal.Identity; var reply = $"Hello {identity.Name}! You are authenticated through {identity.AuthenticationType}." + $" You said: ({something.Text})"; - return Ok(new { reply }); + return this.Ok(new { reply }); } [JsonObject] diff --git a/DNN Platform/Dnn.AuthServices.Jwt/Services/ServiceRouteMapper.cs b/DNN Platform/Dnn.AuthServices.Jwt/Services/ServiceRouteMapper.cs index eadd80fb56c..de33aa84375 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/Services/ServiceRouteMapper.cs +++ b/DNN Platform/Dnn.AuthServices.Jwt/Services/ServiceRouteMapper.cs @@ -11,7 +11,7 @@ public class ServiceRouteMapper : IServiceRouteMapper public void RegisterRoutes(IMapRoute mapRouteManager) { mapRouteManager.MapHttpRoute( - "JwtAuth", "default", "{controller}/{action}", new[] { GetType().Namespace }); + "JwtAuth", "default", "{controller}/{action}", new[] { this.GetType().Namespace }); } } } diff --git a/DNN Platform/Dnn.AuthServices.Jwt/packages.config b/DNN Platform/Dnn.AuthServices.Jwt/packages.config index 70d9e5c98ed..e6f1739309a 100644 --- a/DNN Platform/Dnn.AuthServices.Jwt/packages.config +++ b/DNN Platform/Dnn.AuthServices.Jwt/packages.config @@ -1,9 +1,10 @@ - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj b/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj index 07ba3df175e..3c115fff4c4 100644 --- a/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj +++ b/DNN Platform/DotNetNuke.Abstractions/DotNetNuke.Abstractions.csproj @@ -10,12 +10,23 @@ false + + + + SolutionInfo.cs + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/DNN Platform/DotNetNuke.DependencyInjection/DotNetNuke.DependencyInjection.csproj b/DNN Platform/DotNetNuke.DependencyInjection/DotNetNuke.DependencyInjection.csproj index 7e5695c2d9d..d9680cd4a57 100644 --- a/DNN Platform/DotNetNuke.DependencyInjection/DotNetNuke.DependencyInjection.csproj +++ b/DNN Platform/DotNetNuke.DependencyInjection/DotNetNuke.DependencyInjection.csproj @@ -10,8 +10,16 @@ false + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/DNN Platform/DotNetNuke.Instrumentation/DnnLogger.cs b/DNN Platform/DotNetNuke.Instrumentation/DnnLogger.cs index 512b67e337f..3f565b2653d 100644 --- a/DNN Platform/DotNetNuke.Instrumentation/DnnLogger.cs +++ b/DNN Platform/DotNetNuke.Instrumentation/DnnLogger.cs @@ -55,18 +55,18 @@ private DnnLogger(ILogger logger) int frameDepth = 0; Type methodType = stack[frameDepth].GetMethod().ReflectedType; #pragma warning disable 612,618 - while (methodType == _dnnExceptionType || methodType == typeof(DnnLogger) || methodType == typeof(DnnLog) || methodType == typeof(Control)) + while (methodType == this._dnnExceptionType || methodType == typeof(DnnLogger) || methodType == typeof(DnnLog) || methodType == typeof(Control)) #pragma warning restore 612,618 { frameDepth++; methodType = stack[frameDepth].GetMethod().ReflectedType; } - _stackBoundary = new StackTrace().GetFrame(frameDepth - 1).GetMethod().DeclaringType; + this._stackBoundary = new StackTrace().GetFrame(frameDepth - 1).GetMethod().DeclaringType; } else { - _stackBoundary = typeof(DnnLogger); + this._stackBoundary = typeof(DnnLogger); } ReloadLevels(logger.Repository); @@ -138,7 +138,7 @@ public static DnnLogger GetLogger(string name) /// public void Debug(object message) { - Logger.Log(_stackBoundary, LevelDebug, message, null); + this.Logger.Log(this._stackBoundary, LevelDebug, message, null); } @@ -166,7 +166,7 @@ public void Debug(object message) /// public void DebugFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } /// @@ -189,7 +189,7 @@ public void DebugFormat(string format, params object[] args) /// public void DebugFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelDebug, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelDebug, new SystemStringFormat(provider, format, args), null); } /// @@ -217,7 +217,7 @@ public void DebugFormat(IFormatProvider provider, string format, params object[] /// public void Info(object message) { - Logger.Log(_stackBoundary, LevelInfo, message, null); + this.Logger.Log(this._stackBoundary, LevelInfo, message, null); } @@ -245,7 +245,7 @@ public void Info(object message) /// public void InfoFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } @@ -269,22 +269,22 @@ public void InfoFormat(string format, params object[] args) /// public void InfoFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelInfo, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelInfo, new SystemStringFormat(provider, format, args), null); } internal void TraceFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelTrace, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelTrace, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } internal void Trace(string message) { - Logger.Log(_stackBoundary, LevelTrace, message, null); + this.Logger.Log(this._stackBoundary, LevelTrace, message, null); } internal void TraceFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelTrace, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelTrace, new SystemStringFormat(provider, format, args), null); } @@ -313,7 +313,7 @@ internal void TraceFormat(IFormatProvider provider, string format, params object /// public void Warn(object message) { - Logger.Log(_stackBoundary, LevelWarn, message, null); + this.Logger.Log(this._stackBoundary, LevelWarn, message, null); } /// @@ -334,7 +334,7 @@ public void Warn(object message) /// public void Warn(object message, Exception exception) { - Logger.Log(_stackBoundary, LevelWarn, message, exception); + this.Logger.Log(this._stackBoundary, LevelWarn, message, exception); } /// @@ -361,7 +361,7 @@ public void Warn(object message, Exception exception) /// public void WarnFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } /// @@ -384,7 +384,7 @@ public void WarnFormat(string format, params object[] args) /// public void WarnFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelWarn, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelWarn, new SystemStringFormat(provider, format, args), null); } /// @@ -412,7 +412,7 @@ public void WarnFormat(IFormatProvider provider, string format, params object[] /// public void Error(object message) { - Logger.Log(_stackBoundary, LevelError, message, null); + this.Logger.Log(this._stackBoundary, LevelError, message, null); } /// @@ -433,7 +433,7 @@ public void Error(object message) /// public void Error(object message, Exception exception) { - Logger.Log(_stackBoundary, LevelError, message, exception); + this.Logger.Log(this._stackBoundary, LevelError, message, exception); } /// @@ -460,7 +460,7 @@ public void Error(object message, Exception exception) /// public void ErrorFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } /// @@ -483,7 +483,7 @@ public void ErrorFormat(string format, params object[] args) /// public void ErrorFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelError, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelError, new SystemStringFormat(provider, format, args), null); } /// @@ -511,7 +511,7 @@ public void ErrorFormat(IFormatProvider provider, string format, params object[] /// public void Fatal(object message) { - Logger.Log(_stackBoundary, LevelFatal, message, null); + this.Logger.Log(this._stackBoundary, LevelFatal, message, null); } /// @@ -532,7 +532,7 @@ public void Fatal(object message) /// public void Fatal(object message, Exception exception) { - Logger.Log(_stackBoundary, LevelFatal, message, exception); + this.Logger.Log(this._stackBoundary, LevelFatal, message, exception); } /// @@ -559,7 +559,7 @@ public void Fatal(object message, Exception exception) /// public void FatalFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } /// @@ -582,43 +582,43 @@ public void FatalFormat(string format, params object[] args) /// public void FatalFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelFatal, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelFatal, new SystemStringFormat(provider, format, args), null); } #region Install log levels public void InstallLogError(object message) { - Logger.Log(_stackBoundary, LevelLogError, message, null); + this.Logger.Log(this._stackBoundary, LevelLogError, message, null); } public void InstallLogError(string message, Exception exception) { - Logger.Log(_stackBoundary, LevelLogError, message, exception); + this.Logger.Log(this._stackBoundary, LevelLogError, message, exception); } public void InstallLogErrorFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelLogError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelLogError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } public void InstallLogErrorFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelLogError, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelLogError, new SystemStringFormat(provider, format, args), null); } public void InstallLogInfo(object message) { - Logger.Log(_stackBoundary, LevelLogInfo, message, null); + this.Logger.Log(this._stackBoundary, LevelLogInfo, message, null); } public void InstallLogInfoFormat(string format, params object[] args) { - Logger.Log(_stackBoundary, LevelLogInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(this._stackBoundary, LevelLogInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } public void InstallLogInfoFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, LevelLogInfo, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, LevelLogInfo, new SystemStringFormat(provider, format, args), null); } #endregion diff --git a/DNN Platform/DotNetNuke.Instrumentation/DotNetNuke.Instrumentation.csproj b/DNN Platform/DotNetNuke.Instrumentation/DotNetNuke.Instrumentation.csproj index cb6d23bfdb4..73c1e532b9f 100644 --- a/DNN Platform/DotNetNuke.Instrumentation/DotNetNuke.Instrumentation.csproj +++ b/DNN Platform/DotNetNuke.Instrumentation/DotNetNuke.Instrumentation.csproj @@ -1,75 +1,87 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {3CD5F6B8-8360-4862-80B6-F402892DB7DD} - Library - Properties - DotNetNuke.Instrumentation - DotNetNuke.Instrumentation - v4.7.2 - 512 - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\DotNetNuke.Instrumentation.xml - 1591, 0649 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\DotNetNuke.Instrumentation.xml - 1591, 0649 - 7 - - - - False - ..\DotNetNuke.Log4net\bin\dotnetnuke.log4net.dll - - - - - - - - - SolutionInfo.cs - - - - - - - - - - - - $(MSBuildProjectDirectory)\..\.. - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {3CD5F6B8-8360-4862-80B6-F402892DB7DD} + Library + Properties + DotNetNuke.Instrumentation + DotNetNuke.Instrumentation + v4.7.2 + 512 + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + bin\DotNetNuke.Instrumentation.xml + 1591, 0649 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\DotNetNuke.Instrumentation.xml + 1591, 0649 + 7 + + + + False + ..\DotNetNuke.Log4net\bin\dotnetnuke.log4net.dll + + + + + + + + + SolutionInfo.cs + + + + + + + + + + + + stylecop.json + + + + + + + + + + + + $(MSBuildProjectDirectory)\..\.. + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Instrumentation/LoggerSourceImpl.cs b/DNN Platform/DotNetNuke.Instrumentation/LoggerSourceImpl.cs index 3748f1bf6c2..54908dd490b 100644 --- a/DNN Platform/DotNetNuke.Instrumentation/LoggerSourceImpl.cs +++ b/DNN Platform/DotNetNuke.Instrumentation/LoggerSourceImpl.cs @@ -48,7 +48,7 @@ class Logger : LoggerWrapperImpl, ILog internal Logger(ILogger logger, Type type) : base(logger) { - _stackBoundary = type ?? typeof(Logger); + this._stackBoundary = type ?? typeof(Logger); EnsureConfig(); ReloadLevels(logger.Repository); } @@ -129,131 +129,131 @@ private static void AddGlobalContext() } } - public bool IsDebugEnabled { get { return Logger.IsEnabledFor(_levelDebug); } } - public bool IsInfoEnabled { get { return Logger.IsEnabledFor(_levelInfo); } } - public bool IsTraceEnabled { get { return Logger.IsEnabledFor(_levelTrace); } } - public bool IsWarnEnabled { get { return Logger.IsEnabledFor(_levelWarn); } } - public bool IsErrorEnabled { get { return Logger.IsEnabledFor(_levelError); } } - public bool IsFatalEnabled { get { return Logger.IsEnabledFor(_levelFatal); } } + public bool IsDebugEnabled { get { return this.Logger.IsEnabledFor(_levelDebug); } } + public bool IsInfoEnabled { get { return this.Logger.IsEnabledFor(_levelInfo); } } + public bool IsTraceEnabled { get { return this.Logger.IsEnabledFor(_levelTrace); } } + public bool IsWarnEnabled { get { return this.Logger.IsEnabledFor(_levelWarn); } } + public bool IsErrorEnabled { get { return this.Logger.IsEnabledFor(_levelError); } } + public bool IsFatalEnabled { get { return this.Logger.IsEnabledFor(_levelFatal); } } public void Debug(object message) { - Debug(message, null); + this.Debug(message, null); } public void Debug(object message, Exception exception) { - Logger.Log(_stackBoundary, _levelDebug, message, exception); + this.Logger.Log(this._stackBoundary, _levelDebug, message, exception); } public void DebugFormat(string format, params object[] args) { - DebugFormat(CultureInfo.InvariantCulture, format, args); + this.DebugFormat(CultureInfo.InvariantCulture, format, args); } public void DebugFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, _levelDebug, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, _levelDebug, new SystemStringFormat(provider, format, args), null); } public void Info(object message) { - Info(message, null); + this.Info(message, null); } public void Info(object message, Exception exception) { - Logger.Log(_stackBoundary, _levelInfo, message, exception); + this.Logger.Log(this._stackBoundary, _levelInfo, message, exception); } public void InfoFormat(string format, params object[] args) { - InfoFormat(CultureInfo.InvariantCulture, format, args); + this.InfoFormat(CultureInfo.InvariantCulture, format, args); } public void InfoFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, _levelInfo, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, _levelInfo, new SystemStringFormat(provider, format, args), null); } public void Trace(object message) { - Trace(message, null); + this.Trace(message, null); } public void Trace(object message, Exception exception) { - Logger.Log(_stackBoundary, _levelTrace, message, exception); + this.Logger.Log(this._stackBoundary, _levelTrace, message, exception); } public void TraceFormat(string format, params object[] args) { - TraceFormat(CultureInfo.InvariantCulture, format, args); + this.TraceFormat(CultureInfo.InvariantCulture, format, args); } public void TraceFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, _levelTrace, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, _levelTrace, new SystemStringFormat(provider, format, args), null); } public void Warn(object message) { - Warn(message, null); + this.Warn(message, null); } public void Warn(object message, Exception exception) { - Logger.Log(_stackBoundary, _levelWarn, message, exception); + this.Logger.Log(this._stackBoundary, _levelWarn, message, exception); } public void WarnFormat(string format, params object[] args) { - WarnFormat(CultureInfo.InvariantCulture, format, args); + this.WarnFormat(CultureInfo.InvariantCulture, format, args); } public void WarnFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, _levelWarn, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, _levelWarn, new SystemStringFormat(provider, format, args), null); } public void Error(object message) { - Error(message, null); + this.Error(message, null); } public void Error(object message, Exception exception) { - Logger.Log(_stackBoundary, _levelError, message, exception); + this.Logger.Log(this._stackBoundary, _levelError, message, exception); } public void ErrorFormat(string format, params object[] args) { - ErrorFormat(CultureInfo.InvariantCulture, format, args); + this.ErrorFormat(CultureInfo.InvariantCulture, format, args); } public void ErrorFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, _levelError, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, _levelError, new SystemStringFormat(provider, format, args), null); } public void Fatal(object message) { - Fatal(message, null); + this.Fatal(message, null); } public void Fatal(object message, Exception exception) { - Logger.Log(_stackBoundary, _levelFatal, message, exception); + this.Logger.Log(this._stackBoundary, _levelFatal, message, exception); } public void FatalFormat(string format, params object[] args) { - FatalFormat(CultureInfo.InvariantCulture, format, args); + this.FatalFormat(CultureInfo.InvariantCulture, format, args); } public void FatalFormat(IFormatProvider provider, string format, params object[] args) { - Logger.Log(_stackBoundary, _levelFatal, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(this._stackBoundary, _levelFatal, new SystemStringFormat(provider, format, args), null); } } } diff --git a/DNN Platform/DotNetNuke.Instrumentation/packages.config b/DNN Platform/DotNetNuke.Instrumentation/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/DotNetNuke.Instrumentation/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Log4net/DotNetNuke.Log4Net.csproj b/DNN Platform/DotNetNuke.Log4net/DotNetNuke.Log4Net.csproj index 306e9a3a6d6..16862a45a93 100644 --- a/DNN Platform/DotNetNuke.Log4net/DotNetNuke.Log4Net.csproj +++ b/DNN Platform/DotNetNuke.Log4net/DotNetNuke.Log4Net.csproj @@ -1,4 +1,4 @@ - + - - - {04F77171-0634-46E0-A95E-D7477C88712E} - 2 - Debug - AnyCPU - DotNetNuke.log4net - Library - v4.7.2 - - - - bin\ - true - TRACE;DEBUG;NET;NET_2_0;NET_4_0;NET_4_5 - false - 4 - full - prompt - AnyCPU - false - 7 - bin\DotNetNuke.log4net.xml - - - bin\ - false - TRACE;STRONG;NET;NET_2_0;NET_4_0;NET_4_5 - true - 4 - pdbonly - prompt - AnyCPU - false - 7 - bin\DotNetNuke.log4net.xml - - - - - - - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - $(MSBuildProjectDirectory)\..\.. - - - - - - - - +--> + + + {04F77171-0634-46E0-A95E-D7477C88712E} + 2 + Debug + AnyCPU + DotNetNuke.log4net + Library + v4.7.2 + + + + bin\ + true + TRACE;DEBUG;NET;NET_2_0;NET_4_0;NET_4_5 + false + 4 + full + prompt + AnyCPU + false + 7 + bin\DotNetNuke.log4net.xml + + + bin\ + false + TRACE;STRONG;NET;NET_2_0;NET_4_0;NET_4_5 + true + 4 + pdbonly + prompt + AnyCPU + false + 7 + bin\DotNetNuke.log4net.xml + + + + + + + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + + + + + + stylecop.json + + + + + + + + + + + + $(MSBuildProjectDirectory)\..\.. + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AdoNetAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AdoNetAppender.cs index 3f119cfa6b4..38a4b2d7fad 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AdoNetAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AdoNetAppender.cs @@ -138,11 +138,11 @@ public class AdoNetAppender : BufferingAppenderSkeleton /// public AdoNetAppender() { - ConnectionType = "System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; - UseTransactions = true; - CommandType = System.Data.CommandType.Text; - m_parameters = new ArrayList(); - ReconnectOnError = false; + this.ConnectionType = "System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + this.UseTransactions = true; + this.CommandType = System.Data.CommandType.Text; + this.m_parameters = new ArrayList(); + this.ReconnectOnError = false; } #endregion // Public Instance Constructors @@ -173,8 +173,8 @@ public AdoNetAppender() /// public string ConnectionString { - get { return m_connectionString; } - set { m_connectionString = value; } + get { return this.m_connectionString; } + set { this.m_connectionString = value; } } /// @@ -182,8 +182,8 @@ public string ConnectionString /// public string AppSettingsKey { - get { return m_appSettingsKey; } - set { m_appSettingsKey = value; } + get { return this.m_appSettingsKey; } + set { this.m_appSettingsKey = value; } } #if NET_2_0 @@ -195,8 +195,8 @@ public string AppSettingsKey /// public string ConnectionStringName { - get { return m_connectionStringName; } - set { m_connectionStringName = value; } + get { return this.m_connectionStringName; } + set { this.m_connectionStringName = value; } } #endif @@ -235,8 +235,8 @@ public string ConnectionStringName /// public string ConnectionType { - get { return m_connectionType; } - set { m_connectionType = value; } + get { return this.m_connectionType; } + set { this.m_connectionType = value; } } /// @@ -263,8 +263,8 @@ public string ConnectionType /// public string CommandText { - get { return m_commandText; } - set { m_commandText = value; } + get { return this.m_commandText; } + set { this.m_commandText = value; } } /// @@ -287,8 +287,8 @@ public string CommandText /// public CommandType CommandType { - get { return m_commandType; } - set { m_commandType = value; } + get { return this.m_commandType; } + set { this.m_commandType = value; } } /// @@ -311,8 +311,8 @@ public CommandType CommandType /// public bool UseTransactions { - get { return m_useTransactions; } - set { m_useTransactions = value; } + get { return this.m_useTransactions; } + set { this.m_useTransactions = value; } } /// @@ -331,8 +331,8 @@ public bool UseTransactions /// public SecurityContext SecurityContext { - get { return m_securityContext; } - set { m_securityContext = value; } + get { return this.m_securityContext; } + set { this.m_securityContext = value; } } /// @@ -361,8 +361,8 @@ public SecurityContext SecurityContext /// public bool ReconnectOnError { - get { return m_reconnectOnError; } - set { m_reconnectOnError = value; } + get { return this.m_reconnectOnError; } + set { this.m_reconnectOnError = value; } } #endregion // Public Instance Properties @@ -384,8 +384,8 @@ public bool ReconnectOnError /// protected IDbConnection Connection { - get { return m_dbConnection; } - set { m_dbConnection = value; } + get { return this.m_dbConnection; } + set { this.m_dbConnection = value; } } #endregion // Protected Instance Properties @@ -412,12 +412,12 @@ override public void ActivateOptions() { base.ActivateOptions(); - if (SecurityContext == null) + if (this.SecurityContext == null) { - SecurityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); + this.SecurityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); } - InitializeDatabaseConnection(); + this.InitializeDatabaseConnection(); } #endregion @@ -435,7 +435,7 @@ override public void ActivateOptions() override protected void OnClose() { base.OnClose(); - DiposeConnection(); + this.DiposeConnection(); } #endregion @@ -454,25 +454,25 @@ override protected void OnClose() /// override protected void SendBuffer(LoggingEvent[] events) { - if (ReconnectOnError && (Connection == null || Connection.State != ConnectionState.Open)) + if (this.ReconnectOnError && (this.Connection == null || this.Connection.State != ConnectionState.Open)) { - LogLog.Debug(declaringType, "Attempting to reconnect to database. Current Connection State: " + ((Connection == null) ? SystemInfo.NullText : Connection.State.ToString())); + LogLog.Debug(declaringType, "Attempting to reconnect to database. Current Connection State: " + ((this.Connection == null) ? SystemInfo.NullText : this.Connection.State.ToString())); - InitializeDatabaseConnection(); + this.InitializeDatabaseConnection(); } // Check that the connection exists and is open - if (Connection != null && Connection.State == ConnectionState.Open) + if (this.Connection != null && this.Connection.State == ConnectionState.Open) { - if (UseTransactions) + if (this.UseTransactions) { // Create transaction // NJC - Do this on 2 lines because it can confuse the debugger - using (IDbTransaction dbTran = Connection.BeginTransaction()) + using (IDbTransaction dbTran = this.Connection.BeginTransaction()) { try { - SendBuffer(dbTran, events); + this.SendBuffer(dbTran, events); // commit transaction dbTran.Commit(); @@ -490,14 +490,14 @@ override protected void SendBuffer(LoggingEvent[] events) } // Can't insert into the database. That's a bad thing - ErrorHandler.Error("Exception while writing to database", ex); + this.ErrorHandler.Error("Exception while writing to database", ex); } } } else { // Send without transaction - SendBuffer(null, events); + this.SendBuffer(null, events); } } } @@ -517,7 +517,7 @@ override protected void SendBuffer(LoggingEvent[] events) /// public void AddParameter(AdoNetAppenderParameter parameter) { - m_parameters.Add(parameter); + this.m_parameters.Add(parameter); } @@ -540,15 +540,15 @@ public void AddParameter(AdoNetAppenderParameter parameter) virtual protected void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events) { // string.IsNotNullOrWhiteSpace() does not exist in ancient .NET frameworks - if (CommandText != null && CommandText.Trim() != "") + if (this.CommandText != null && this.CommandText.Trim() != "") { - using (IDbCommand dbCmd = Connection.CreateCommand()) + using (IDbCommand dbCmd = this.Connection.CreateCommand()) { // Set the command string - dbCmd.CommandText = CommandText; + dbCmd.CommandText = this.CommandText; // Set the command type - dbCmd.CommandType = CommandType; + dbCmd.CommandType = this.CommandType; // Send buffer using the prepared command object if (dbTran != null) { @@ -563,7 +563,7 @@ virtual protected void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events) dbCmd.Parameters.Clear(); // Set the parameter values - foreach (AdoNetAppenderParameter param in m_parameters) + foreach (AdoNetAppenderParameter param in this.m_parameters) { param.Prepare(dbCmd); param.FormatValue(dbCmd, e); @@ -577,7 +577,7 @@ virtual protected void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events) else { // create a new command - using (IDbCommand dbCmd = Connection.CreateCommand()) + using (IDbCommand dbCmd = this.Connection.CreateCommand()) { if (dbTran != null) { @@ -587,7 +587,7 @@ virtual protected void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events) foreach (LoggingEvent e in events) { // Get the command text from the Layout - string logStatement = GetLogStatement(e); + string logStatement = this.GetLogStatement(e); LogLog.Debug(declaringType, "LogStatement [" + logStatement + "]"); @@ -611,15 +611,15 @@ virtual protected void SendBuffer(IDbTransaction dbTran, LoggingEvent[] events) /// virtual protected string GetLogStatement(LoggingEvent logEvent) { - if (Layout == null) + if (this.Layout == null) { - ErrorHandler.Error("AdoNetAppender: No Layout specified."); + this.ErrorHandler.Error("AdoNetAppender: No Layout specified."); return ""; } else { StringWriter writer = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - Layout.Format(writer, logEvent); + this.Layout.Format(writer, logEvent); return writer.ToString(); } } @@ -651,16 +651,16 @@ virtual protected IDbConnection CreateConnection(Type connectionType, string con /// A connection string used to connect to the database. virtual protected string ResolveConnectionString(out string connectionStringContext) { - if (ConnectionString != null && ConnectionString.Length > 0) + if (this.ConnectionString != null && this.ConnectionString.Length > 0) { connectionStringContext = "ConnectionString"; - return ConnectionString; + return this.ConnectionString; } #if NET_2_0 - if (!String.IsNullOrEmpty(ConnectionStringName)) + if (!String.IsNullOrEmpty(this.ConnectionStringName)) { - ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings[ConnectionStringName]; + ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings[this.ConnectionStringName]; if (settings != null) { connectionStringContext = "ConnectionStringName"; @@ -668,18 +668,18 @@ virtual protected string ResolveConnectionString(out string connectionStringCont } else { - throw new LogException("Unable to find [" + ConnectionStringName + "] ConfigurationManager.ConnectionStrings item"); + throw new LogException("Unable to find [" + this.ConnectionStringName + "] ConfigurationManager.ConnectionStrings item"); } } #endif - if (AppSettingsKey != null && AppSettingsKey.Length > 0) + if (this.AppSettingsKey != null && this.AppSettingsKey.Length > 0) { connectionStringContext = "AppSettingsKey"; - string appSettingsConnectionString = SystemInfo.GetAppSetting(AppSettingsKey); + string appSettingsConnectionString = SystemInfo.GetAppSetting(this.AppSettingsKey); if (appSettingsConnectionString == null || appSettingsConnectionString.Length == 0) { - throw new LogException("Unable to find [" + AppSettingsKey + "] AppSettings key."); + throw new LogException("Unable to find [" + this.AppSettingsKey + "] AppSettings key."); } return appSettingsConnectionString; } @@ -707,11 +707,11 @@ virtual protected Type ResolveConnectionType() { try { - return SystemInfo.GetTypeFromString(ConnectionType, true, false); + return SystemInfo.GetTypeFromString(this.ConnectionType, true, false); } catch (Exception ex) { - ErrorHandler.Error("Failed to load connection type [" + ConnectionType + "]", ex); + this.ErrorHandler.Error("Failed to load connection type [" + this.ConnectionType + "]", ex); throw; } } @@ -730,25 +730,25 @@ private void InitializeDatabaseConnection() try { - DiposeConnection(); + this.DiposeConnection(); // Set the connection string - resolvedConnectionString = ResolveConnectionString(out connectionStringContext); + resolvedConnectionString = this.ResolveConnectionString(out connectionStringContext); - Connection = CreateConnection(ResolveConnectionType(), resolvedConnectionString); + this.Connection = this.CreateConnection(this.ResolveConnectionType(), resolvedConnectionString); - using (SecurityContext.Impersonate(this)) + using (this.SecurityContext.Impersonate(this)) { // Open the database connection - Connection.Open(); + this.Connection.Open(); } } catch (Exception e) { // Sadly, your connection string is bad. - ErrorHandler.Error("Could not open database connection [" + resolvedConnectionString + "]. Connection string context [" + connectionStringContext + "].", e); + this.ErrorHandler.Error("Could not open database connection [" + resolvedConnectionString + "]. Connection string context [" + connectionStringContext + "].", e); - Connection = null; + this.Connection = null; } } @@ -760,17 +760,17 @@ private void InitializeDatabaseConnection() /// private void DiposeConnection() { - if (Connection != null) + if (this.Connection != null) { try { - Connection.Close(); + this.Connection.Close(); } catch (Exception ex) { LogLog.Warn(declaringType, "Exception while disposing cached connection object", ex); } - Connection = null; + this.Connection = null; } } @@ -886,9 +886,9 @@ public class AdoNetAppenderParameter /// public AdoNetAppenderParameter() { - Precision = 0; - Scale = 0; - Size = 0; + this.Precision = 0; + this.Scale = 0; + this.Size = 0; } #endregion // Public Instance Constructors @@ -910,8 +910,8 @@ public AdoNetAppenderParameter() /// public string ParameterName { - get { return m_parameterName; } - set { m_parameterName = value; } + get { return this.m_parameterName; } + set { this.m_parameterName = value; } } /// @@ -934,11 +934,11 @@ public string ParameterName /// public DbType DbType { - get { return m_dbType; } + get { return this.m_dbType; } set { - m_dbType = value; - m_inferType = false; + this.m_dbType = value; + this.m_inferType = false; } } @@ -960,8 +960,8 @@ public DbType DbType /// public byte Precision { - get { return m_precision; } - set { m_precision = value; } + get { return this.m_precision; } + set { this.m_precision = value; } } /// @@ -982,8 +982,8 @@ public byte Precision /// public byte Scale { - get { return m_scale; } - set { m_scale = value; } + get { return this.m_scale; } + set { this.m_scale = value; } } /// @@ -1007,8 +1007,8 @@ public byte Scale /// public int Size { - get { return m_size; } - set { m_size = value; } + get { return this.m_size; } + set { this.m_size = value; } } /// @@ -1033,8 +1033,8 @@ public int Size /// public IRawLayout Layout { - get { return m_layout; } - set { m_layout = value; } + get { return this.m_layout; } + set { this.m_layout = value; } } #endregion // Public Instance Properties @@ -1057,23 +1057,23 @@ virtual public void Prepare(IDbCommand command) IDbDataParameter param = command.CreateParameter(); // Set the parameter properties - param.ParameterName = ParameterName; + param.ParameterName = this.ParameterName; - if (!m_inferType) + if (!this.m_inferType) { - param.DbType = DbType; + param.DbType = this.DbType; } - if (Precision != 0) + if (this.Precision != 0) { - param.Precision = Precision; + param.Precision = this.Precision; } - if (Scale != 0) + if (this.Scale != 0) { - param.Scale = Scale; + param.Scale = this.Scale; } - if (Size != 0) + if (this.Size != 0) { - param.Size = Size; + param.Size = this.Size; } // Add the parameter to the collection of params @@ -1094,10 +1094,10 @@ virtual public void Prepare(IDbCommand command) virtual public void FormatValue(IDbCommand command, LoggingEvent loggingEvent) { // Lookup the parameter - IDbDataParameter param = (IDbDataParameter)command.Parameters[ParameterName]; + IDbDataParameter param = (IDbDataParameter)command.Parameters[this.ParameterName]; // Format the value - object formattedValue = Layout.Format(loggingEvent); + object formattedValue = this.Layout.Format(loggingEvent); // If the value is null then convert to a DBNull if (formattedValue == null) diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AnsiColorTerminalAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AnsiColorTerminalAppender.cs index 097a3cfb9f4..640f2673904 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AnsiColorTerminalAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AnsiColorTerminalAppender.cs @@ -252,18 +252,18 @@ public AnsiColorTerminalAppender() /// virtual public string Target { - get { return m_writeToErrorStream ? ConsoleError : ConsoleOut; } + get { return this.m_writeToErrorStream ? ConsoleError : ConsoleOut; } set { string trimmedTargetName = value.Trim(); if (SystemInfo.EqualsIgnoringCase(ConsoleError, trimmedTargetName)) { - m_writeToErrorStream = true; + this.m_writeToErrorStream = true; } else { - m_writeToErrorStream = false; + this.m_writeToErrorStream = false; } } } @@ -281,7 +281,7 @@ virtual public string Target /// public void AddMapping(LevelColors mapping) { - m_levelMapping.Add(mapping); + this.m_levelMapping.Add(mapping); } #endregion Public Instance Properties @@ -302,10 +302,10 @@ public void AddMapping(LevelColors mapping) /// override protected void Append(log4net.Core.LoggingEvent loggingEvent) { - string loggingMessage = RenderLoggingEvent(loggingEvent); + string loggingMessage = this.RenderLoggingEvent(loggingEvent); // see if there is a specified lookup. - LevelColors levelColors = m_levelMapping.Lookup(loggingEvent.Level) as LevelColors; + LevelColors levelColors = this.m_levelMapping.Lookup(loggingEvent.Level) as LevelColors; if (levelColors != null) { // Prepend the Ansi Color code @@ -347,7 +347,7 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) // Write to the output stream Console.Write(loggingMessage); #else - if (m_writeToErrorStream) + if (this.m_writeToErrorStream) { // Write to the error stream Console.Error.Write(loggingMessage); @@ -386,7 +386,7 @@ override protected bool RequiresLayout public override void ActivateOptions() { base.ActivateOptions(); - m_levelMapping.ActivateOptions(); + this.m_levelMapping.ActivateOptions(); } #endregion Override implementation of AppenderSkeleton @@ -467,8 +467,8 @@ public class LevelColors : LevelMappingEntry /// public AnsiColor ForeColor { - get { return m_foreColor; } - set { m_foreColor = value; } + get { return this.m_foreColor; } + set { this.m_foreColor = value; } } /// @@ -482,8 +482,8 @@ public AnsiColor ForeColor /// public AnsiColor BackColor { - get { return m_backColor; } - set { m_backColor = value; } + get { return this.m_backColor; } + set { this.m_backColor = value; } } /// @@ -497,8 +497,8 @@ public AnsiColor BackColor /// public AnsiAttributes Attributes { - get { return m_attributes; } - set { m_attributes = value; } + get { return this.m_attributes; } + set { this.m_attributes = value; } } /// @@ -519,48 +519,48 @@ public override void ActivateOptions() // Reset any existing codes buf.Append("\x1b[0;"); - int lightAdjustment = ((m_attributes & AnsiAttributes.Light) > 0) ? 60 : 0; + int lightAdjustment = ((this.m_attributes & AnsiAttributes.Light) > 0) ? 60 : 0; // set the foreground color - buf.Append(30 + lightAdjustment + (int)m_foreColor); + buf.Append(30 + lightAdjustment + (int)this.m_foreColor); buf.Append(';'); // set the background color - buf.Append(40 + lightAdjustment + (int)m_backColor); + buf.Append(40 + lightAdjustment + (int)this.m_backColor); // set the attributes - if ((m_attributes & AnsiAttributes.Bright) > 0) + if ((this.m_attributes & AnsiAttributes.Bright) > 0) { buf.Append(";1"); } - if ((m_attributes & AnsiAttributes.Dim) > 0) + if ((this.m_attributes & AnsiAttributes.Dim) > 0) { buf.Append(";2"); } - if ((m_attributes & AnsiAttributes.Underscore) > 0) + if ((this.m_attributes & AnsiAttributes.Underscore) > 0) { buf.Append(";4"); } - if ((m_attributes & AnsiAttributes.Blink) > 0) + if ((this.m_attributes & AnsiAttributes.Blink) > 0) { buf.Append(";5"); } - if ((m_attributes & AnsiAttributes.Reverse) > 0) + if ((this.m_attributes & AnsiAttributes.Reverse) > 0) { buf.Append(";7"); } - if ((m_attributes & AnsiAttributes.Hidden) > 0) + if ((this.m_attributes & AnsiAttributes.Hidden) > 0) { buf.Append(";8"); } - if ((m_attributes & AnsiAttributes.Strikethrough) > 0) + if ((this.m_attributes & AnsiAttributes.Strikethrough) > 0) { buf.Append(";9"); } buf.Append('m'); - m_combinedColor = buf.ToString(); + this.m_combinedColor = buf.ToString(); } /// @@ -569,7 +569,7 @@ public override void ActivateOptions() /// internal string CombinedColor { - get { return m_combinedColor; } + get { return this.m_combinedColor; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderCollection.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderCollection.cs index 5fdec4922de..72152b3f520 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderCollection.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderCollection.cs @@ -111,7 +111,7 @@ public static AppenderCollection ReadOnly(AppenderCollection list) /// public AppenderCollection() { - m_array = new IAppender[DEFAULT_CAPACITY]; + this.m_array = new IAppender[DEFAULT_CAPACITY]; } /// @@ -123,7 +123,7 @@ public AppenderCollection() /// public AppenderCollection(int capacity) { - m_array = new IAppender[capacity]; + this.m_array = new IAppender[capacity]; } /// @@ -133,8 +133,8 @@ public AppenderCollection(int capacity) /// The AppenderCollection whose elements are copied to the new collection. public AppenderCollection(AppenderCollection c) { - m_array = new IAppender[c.Count]; - AddRange(c); + this.m_array = new IAppender[c.Count]; + this.AddRange(c); } /// @@ -144,8 +144,8 @@ public AppenderCollection(AppenderCollection c) /// The array whose elements are copied to the new list. public AppenderCollection(IAppender[] a) { - m_array = new IAppender[a.Length]; - AddRange(a); + this.m_array = new IAppender[a.Length]; + this.AddRange(a); } /// @@ -155,8 +155,8 @@ public AppenderCollection(IAppender[] a) /// The collection whose elements are copied to the new list. public AppenderCollection(ICollection col) { - m_array = new IAppender[col.Count]; - AddRange(col); + this.m_array = new IAppender[col.Count]; + this.AddRange(col); } /// @@ -179,7 +179,7 @@ internal protected enum Tag /// internal protected AppenderCollection(Tag tag) { - m_array = null; + this.m_array = null; } #endregion @@ -191,7 +191,7 @@ internal protected AppenderCollection(Tag tag) /// public virtual int Count { - get { return m_count; } + get { return this.m_count; } } /// @@ -212,12 +212,12 @@ public virtual void CopyTo(IAppender[] array) /// The zero-based index in at which copying begins. public virtual void CopyTo(IAppender[] array, int start) { - if (m_count > array.GetUpperBound(0) + 1 - start) + if (this.m_count > array.GetUpperBound(0) + 1 - start) { throw new System.ArgumentException("Destination array was not long enough."); } - Array.Copy(m_array, 0, array, start, m_count); + Array.Copy(this.m_array, 0, array, start, this.m_count); } /// @@ -234,7 +234,7 @@ public virtual bool IsSynchronized /// public virtual object SyncRoot { - get { return m_array; } + get { return this.m_array; } } #endregion @@ -254,14 +254,14 @@ public virtual IAppender this[int index] { get { - ValidateIndex(index); // throws - return m_array[index]; + this.ValidateIndex(index); // throws + return this.m_array[index]; } set { - ValidateIndex(index); // throws - ++m_version; - m_array[index] = value; + this.ValidateIndex(index); // throws + ++this.m_version; + this.m_array[index] = value; } } @@ -272,15 +272,15 @@ public virtual IAppender this[int index] /// The index at which the value has been added. public virtual int Add(IAppender item) { - if (m_count == m_array.Length) + if (this.m_count == this.m_array.Length) { - EnsureCapacity(m_count + 1); + this.EnsureCapacity(this.m_count + 1); } - m_array[m_count] = item; - m_version++; + this.m_array[this.m_count] = item; + this.m_version++; - return m_count++; + return this.m_count++; } /// @@ -288,9 +288,9 @@ public virtual int Add(IAppender item) /// public virtual void Clear() { - ++m_version; - m_array = new IAppender[DEFAULT_CAPACITY]; - m_count = 0; + ++this.m_version; + this.m_array = new IAppender[DEFAULT_CAPACITY]; + this.m_count = 0; } /// @@ -299,10 +299,10 @@ public virtual void Clear() /// A new with a shallow copy of the collection data. public virtual object Clone() { - AppenderCollection newCol = new AppenderCollection(m_count); - Array.Copy(m_array, 0, newCol.m_array, 0, m_count); - newCol.m_count = m_count; - newCol.m_version = m_version; + AppenderCollection newCol = new AppenderCollection(this.m_count); + Array.Copy(this.m_array, 0, newCol.m_array, 0, this.m_count); + newCol.m_count = this.m_count; + newCol.m_version = this.m_version; return newCol; } @@ -314,9 +314,9 @@ public virtual object Clone() /// true if is found in the AppenderCollection; otherwise, false. public virtual bool Contains(IAppender item) { - for (int i=0; i != m_count; ++i) + for (int i=0; i != this.m_count; ++i) { - if (m_array[i].Equals(item)) + if (this.m_array[i].Equals(item)) { return true; } @@ -335,9 +335,9 @@ public virtual bool Contains(IAppender item) /// public virtual int IndexOf(IAppender item) { - for (int i=0; i != m_count; ++i) + for (int i=0; i != this.m_count; ++i) { - if (m_array[i].Equals(item)) + if (this.m_array[i].Equals(item)) { return i; } @@ -357,21 +357,21 @@ public virtual int IndexOf(IAppender item) /// public virtual void Insert(int index, IAppender item) { - ValidateIndex(index, true); // throws + this.ValidateIndex(index, true); // throws - if (m_count == m_array.Length) + if (this.m_count == this.m_array.Length) { - EnsureCapacity(m_count + 1); + this.EnsureCapacity(this.m_count + 1); } - if (index < m_count) + if (index < this.m_count) { - Array.Copy(m_array, index, m_array, index + 1, m_count - index); + Array.Copy(this.m_array, index, this.m_array, index + 1, this.m_count - index); } - m_array[index] = item; - m_count++; - m_version++; + this.m_array[index] = item; + this.m_count++; + this.m_version++; } /// @@ -383,14 +383,14 @@ public virtual void Insert(int index, IAppender item) /// public virtual void Remove(IAppender item) { - int i = IndexOf(item); + int i = this.IndexOf(item); if (i < 0) { throw new System.ArgumentException("Cannot remove the specified item because it was not found in the specified Collection."); } - ++m_version; - RemoveAt(i); + ++this.m_version; + this.RemoveAt(i); } /// @@ -404,21 +404,21 @@ public virtual void Remove(IAppender item) /// public virtual void RemoveAt(int index) { - ValidateIndex(index); // throws + this.ValidateIndex(index); // throws - m_count--; + this.m_count--; - if (index < m_count) + if (index < this.m_count) { - Array.Copy(m_array, index + 1, m_array, index, m_count - index); + Array.Copy(this.m_array, index + 1, this.m_array, index, this.m_count - index); } // We can't set the deleted entry equal to null, because it might be a value type. // Instead, we'll create an empty single-element array of the right type and copy it // over the entry we want to erase. IAppender[] temp = new IAppender[1]; - Array.Copy(temp, 0, m_array, m_count, 1); - m_version++; + Array.Copy(temp, 0, this.m_array, this.m_count, 1); + this.m_version++; } /// @@ -463,26 +463,26 @@ public virtual int Capacity { get { - return m_array.Length; + return this.m_array.Length; } set { - if (value < m_count) + if (value < this.m_count) { - value = m_count; + value = this.m_count; } - if (value != m_array.Length) + if (value != this.m_array.Length) { if (value > 0) { IAppender[] temp = new IAppender[value]; - Array.Copy(m_array, 0, temp, 0, m_count); - m_array = temp; + Array.Copy(this.m_array, 0, temp, 0, this.m_count); + this.m_array = temp; } else { - m_array = new IAppender[DEFAULT_CAPACITY]; + this.m_array = new IAppender[DEFAULT_CAPACITY]; } } } @@ -495,16 +495,16 @@ public virtual int Capacity /// The new of the AppenderCollection. public virtual int AddRange(AppenderCollection x) { - if (m_count + x.Count >= m_array.Length) + if (this.m_count + x.Count >= this.m_array.Length) { - EnsureCapacity(m_count + x.Count); + this.EnsureCapacity(this.m_count + x.Count); } - Array.Copy(x.m_array, 0, m_array, m_count, x.Count); - m_count += x.Count; - m_version++; + Array.Copy(x.m_array, 0, this.m_array, this.m_count, x.Count); + this.m_count += x.Count; + this.m_version++; - return m_count; + return this.m_count; } /// @@ -514,16 +514,16 @@ public virtual int AddRange(AppenderCollection x) /// The new of the AppenderCollection. public virtual int AddRange(IAppender[] x) { - if (m_count + x.Length >= m_array.Length) + if (this.m_count + x.Length >= this.m_array.Length) { - EnsureCapacity(m_count + x.Length); + this.EnsureCapacity(this.m_count + x.Length); } - Array.Copy(x, 0, m_array, m_count, x.Length); - m_count += x.Length; - m_version++; + Array.Copy(x, 0, this.m_array, this.m_count, x.Length); + this.m_count += x.Length; + this.m_version++; - return m_count; + return this.m_count; } /// @@ -533,17 +533,17 @@ public virtual int AddRange(IAppender[] x) /// The new of the AppenderCollection. public virtual int AddRange(ICollection col) { - if (m_count + col.Count >= m_array.Length) + if (this.m_count + col.Count >= this.m_array.Length) { - EnsureCapacity(m_count + col.Count); + this.EnsureCapacity(this.m_count + col.Count); } foreach(object item in col) { - Add((IAppender)item); + this.Add((IAppender)item); } - return m_count; + return this.m_count; } /// @@ -551,7 +551,7 @@ public virtual int AddRange(ICollection col) /// public virtual void TrimToSize() { - this.Capacity = m_count; + this.Capacity = this.m_count; } /// @@ -560,10 +560,10 @@ public virtual void TrimToSize() /// the array public virtual IAppender[] ToArray() { - IAppender[] resultArray = new IAppender[m_count]; - if (m_count > 0) + IAppender[] resultArray = new IAppender[this.m_count]; + if (this.m_count > 0) { - Array.Copy(m_array, 0, resultArray, 0, m_count); + Array.Copy(this.m_array, 0, resultArray, 0, this.m_count); } return resultArray; } @@ -579,7 +579,7 @@ public virtual IAppender[] ToArray() /// private void ValidateIndex(int i) { - ValidateIndex(i, false); + this.ValidateIndex(i, false); } /// @@ -589,7 +589,7 @@ private void ValidateIndex(int i) /// private void ValidateIndex(int i, bool allowEqualEnd) { - int max = (allowEqualEnd) ? (m_count) : (m_count-1); + int max = (allowEqualEnd) ? (this.m_count) : (this.m_count-1); if (i < 0 || i > max) { throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("i", (object)i, "Index was out of range. Must be non-negative and less than the size of the collection. [" + (object)i + "] Specified argument was out of the range of valid values."); @@ -598,7 +598,7 @@ private void ValidateIndex(int i, bool allowEqualEnd) private void EnsureCapacity(int min) { - int newCapacity = ((m_array.Length == 0) ? DEFAULT_CAPACITY : m_array.Length * 2); + int newCapacity = ((this.m_array.Length == 0) ? DEFAULT_CAPACITY : this.m_array.Length * 2); if (newCapacity < min) { newCapacity = min; @@ -613,9 +613,9 @@ private void EnsureCapacity(int min) void ICollection.CopyTo(Array array, int start) { - if (m_count > 0) + if (this.m_count > 0) { - Array.Copy(m_array, 0, array, start, m_count); + Array.Copy(this.m_array, 0, array, start, this.m_count); } } @@ -694,9 +694,9 @@ private sealed class Enumerator : IEnumerator, IAppenderCollectionEnumerator /// internal Enumerator(AppenderCollection tc) { - m_collection = tc; - m_index = -1; - m_version = tc.m_version; + this.m_collection = tc; + this.m_index = -1; + this.m_version = tc.m_version; } #endregion @@ -708,7 +708,7 @@ internal Enumerator(AppenderCollection tc) /// public IAppender Current { - get { return m_collection[m_index]; } + get { return this.m_collection[this.m_index]; } } /// @@ -723,13 +723,13 @@ public IAppender Current /// public bool MoveNext() { - if (m_version != m_collection.m_version) + if (this.m_version != this.m_collection.m_version) { throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute."); } - ++m_index; - return (m_index < m_collection.Count); + ++this.m_index; + return (this.m_index < this.m_collection.Count); } /// @@ -737,7 +737,7 @@ public bool MoveNext() /// public void Reset() { - m_index = -1; + this.m_index = -1; } #endregion @@ -768,7 +768,7 @@ private sealed class ReadOnlyAppenderCollection : AppenderCollection, ICollectio internal ReadOnlyAppenderCollection(AppenderCollection list) : base(Tag.Default) { - m_collection = list; + this.m_collection = list; } #endregion @@ -777,27 +777,27 @@ internal ReadOnlyAppenderCollection(AppenderCollection list) : base(Tag.Default) public override void CopyTo(IAppender[] array) { - m_collection.CopyTo(array); + this.m_collection.CopyTo(array); } public override void CopyTo(IAppender[] array, int start) { - m_collection.CopyTo(array,start); + this.m_collection.CopyTo(array,start); } void ICollection.CopyTo(Array array, int start) { - ((ICollection)m_collection).CopyTo(array, start); + ((ICollection)this.m_collection).CopyTo(array, start); } public override int Count { - get { return m_collection.Count; } + get { return this.m_collection.Count; } } public override bool IsSynchronized { - get { return m_collection.IsSynchronized; } + get { return this.m_collection.IsSynchronized; } } public override object SyncRoot @@ -811,7 +811,7 @@ public override object SyncRoot public override IAppender this[int i] { - get { return m_collection[i]; } + get { return this.m_collection[i]; } set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); } } @@ -827,12 +827,12 @@ public override void Clear() public override bool Contains(IAppender x) { - return m_collection.Contains(x); + return this.m_collection.Contains(x); } public override int IndexOf(IAppender x) { - return m_collection.IndexOf(x); + return this.m_collection.IndexOf(x); } public override void Insert(int pos, IAppender x) @@ -866,7 +866,7 @@ public override bool IsReadOnly public override IAppenderCollectionEnumerator GetEnumerator() { - return m_collection.GetEnumerator(); + return this.m_collection.GetEnumerator(); } #endregion @@ -876,7 +876,7 @@ public override IAppenderCollectionEnumerator GetEnumerator() // (just to mimic some nice features of ArrayList) public override int Capacity { - get { return m_collection.Capacity; } + get { return this.m_collection.Capacity; } set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); } } @@ -892,7 +892,7 @@ public override int AddRange(IAppender[] x) public override IAppender[] ToArray() { - return m_collection.ToArray(); + return this.m_collection.ToArray(); } public override void TrimToSize() diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderSkeleton.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderSkeleton.cs index 87669fef889..ca5827da6f2 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderSkeleton.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AppenderSkeleton.cs @@ -60,7 +60,7 @@ public abstract class AppenderSkeleton : IAppender, IBulkAppender, IOptionHandle /// protected AppenderSkeleton() { - m_errorHandler = new OnlyOnceErrorHandler(this.GetType().Name); + this.m_errorHandler = new OnlyOnceErrorHandler(this.GetType().Name); } #endregion Protected Instance Constructors @@ -81,10 +81,10 @@ protected AppenderSkeleton() { // An appender might be closed then garbage collected. // There is no point in closing twice. - if (!m_closed) + if (!this.m_closed) { - LogLog.Debug(declaringType, "Finalizing appender named ["+m_name+"]."); - Close(); + LogLog.Debug(declaringType, "Finalizing appender named ["+this.m_name+"]."); + this.Close(); } } @@ -111,8 +111,8 @@ protected AppenderSkeleton() /// public Level Threshold { - get { return m_threshold; } - set { m_threshold = value; } + get { return this.m_threshold; } + set { this.m_threshold = value; } } /// @@ -140,7 +140,7 @@ virtual public IErrorHandler ErrorHandler } else { - m_errorHandler = value; + this.m_errorHandler = value; } } } @@ -158,7 +158,7 @@ virtual public IErrorHandler ErrorHandler /// virtual public IFilter FilterHead { - get { return m_headFilter; } + get { return this.m_headFilter; } } /// @@ -173,8 +173,8 @@ virtual public IFilter FilterHead /// virtual public ILayout Layout { - get { return m_layout; } - set { m_layout = value; } + get { return this.m_layout; } + set { this.m_layout = value; } } #endregion @@ -216,8 +216,8 @@ virtual public void ActivateOptions() /// public string Name { - get { return m_name; } - set { m_name = value; } + get { return this.m_name; } + set { this.m_name = value; } } /// @@ -242,10 +242,10 @@ public void Close() // This lock prevents the appender being closed while it is still appending lock(this) { - if (!m_closed) + if (!this.m_closed) { - OnClose(); - m_closed = true; + this.OnClose(); + this.m_closed = true; } } } @@ -300,30 +300,30 @@ public void DoAppend(LoggingEvent loggingEvent) lock(this) { - if (m_closed) + if (this.m_closed) { - ErrorHandler.Error("Attempted to append to closed appender named ["+m_name+"]."); + this.ErrorHandler.Error("Attempted to append to closed appender named ["+this.m_name+"]."); return; } // prevent re-entry - if (m_recursiveGuard) + if (this.m_recursiveGuard) { return; } try { - m_recursiveGuard = true; + this.m_recursiveGuard = true; - if (FilterEvent(loggingEvent) && PreAppendCheck()) + if (this.FilterEvent(loggingEvent) && this.PreAppendCheck()) { this.Append(loggingEvent); } } catch(Exception ex) { - ErrorHandler.Error("Failed in DoAppend", ex); + this.ErrorHandler.Error("Failed in DoAppend", ex); } #if !MONO && !NET_2_0 && !NETSTANDARD1_3 // on .NET 2.0 (and higher) and Mono (all profiles), @@ -338,7 +338,7 @@ public void DoAppend(LoggingEvent loggingEvent) #endif finally { - m_recursiveGuard = false; + this.m_recursiveGuard = false; } } } @@ -397,40 +397,40 @@ public void DoAppend(LoggingEvent[] loggingEvents) lock(this) { - if (m_closed) + if (this.m_closed) { - ErrorHandler.Error("Attempted to append to closed appender named ["+m_name+"]."); + this.ErrorHandler.Error("Attempted to append to closed appender named ["+this.m_name+"]."); return; } // prevent re-entry - if (m_recursiveGuard) + if (this.m_recursiveGuard) { return; } try { - m_recursiveGuard = true; + this.m_recursiveGuard = true; ArrayList filteredEvents = new ArrayList(loggingEvents.Length); foreach(LoggingEvent loggingEvent in loggingEvents) { - if (FilterEvent(loggingEvent)) + if (this.FilterEvent(loggingEvent)) { filteredEvents.Add(loggingEvent); } } - if (filteredEvents.Count > 0 && PreAppendCheck()) + if (filteredEvents.Count > 0 && this.PreAppendCheck()) { this.Append((LoggingEvent[])filteredEvents.ToArray(typeof(LoggingEvent))); } } catch(Exception ex) { - ErrorHandler.Error("Failed in Bulk DoAppend", ex); + this.ErrorHandler.Error("Failed in Bulk DoAppend", ex); } #if !MONO && !NET_2_0 && !NETSTANDARD1_3 // on .NET 2.0 (and higher) and Mono (all profiles), @@ -445,7 +445,7 @@ public void DoAppend(LoggingEvent[] loggingEvents) #endif finally { - m_recursiveGuard = false; + this.m_recursiveGuard = false; } } } @@ -485,7 +485,7 @@ public void DoAppend(LoggingEvent[] loggingEvents) /// virtual protected bool FilterEvent(LoggingEvent loggingEvent) { - if (!IsAsSevereAsThreshold(loggingEvent.Level)) + if (!this.IsAsSevereAsThreshold(loggingEvent.Level)) { return false; } @@ -534,14 +534,14 @@ virtual public void AddFilter(IFilter filter) throw new ArgumentNullException("filter param must not be null"); } - if (m_headFilter == null) + if (this.m_headFilter == null) { - m_headFilter = m_tailFilter = filter; + this.m_headFilter = this.m_tailFilter = filter; } else { - m_tailFilter.Next = filter; - m_tailFilter = filter; + this.m_tailFilter.Next = filter; + this.m_tailFilter = filter; } } @@ -555,7 +555,7 @@ virtual public void AddFilter(IFilter filter) /// virtual public void ClearFilters() { - m_headFilter = m_tailFilter = null; + this.m_headFilter = this.m_tailFilter = null; } #endregion Public Instance Methods @@ -577,7 +577,7 @@ virtual public void ClearFilters() /// virtual protected bool IsAsSevereAsThreshold(Level level) { - return ((m_threshold == null) || level >= m_threshold); + return ((this.m_threshold == null) || level >= this.m_threshold); } /// @@ -636,7 +636,7 @@ virtual protected void Append(LoggingEvent[] loggingEvents) { foreach(LoggingEvent loggingEvent in loggingEvents) { - Append(loggingEvent); + this.Append(loggingEvent); } } @@ -660,9 +660,9 @@ virtual protected void Append(LoggingEvent[] loggingEvents) /// true if the call to should proceed. virtual protected bool PreAppendCheck() { - if ((m_layout == null) && RequiresLayout) + if ((this.m_layout == null) && this.RequiresLayout) { - ErrorHandler.Error("AppenderSkeleton: No layout set for the appender named ["+m_name+"]."); + this.ErrorHandler.Error("AppenderSkeleton: No layout set for the appender named ["+this.m_name+"]."); return false; } @@ -696,18 +696,18 @@ virtual protected bool PreAppendCheck() protected string RenderLoggingEvent(LoggingEvent loggingEvent) { // Create the render writer on first use - if (m_renderWriter == null) + if (this.m_renderWriter == null) { - m_renderWriter = new ReusableStringWriter(System.Globalization.CultureInfo.InvariantCulture); + this.m_renderWriter = new ReusableStringWriter(System.Globalization.CultureInfo.InvariantCulture); } - lock (m_renderWriter) + lock (this.m_renderWriter) { // Reset the writer so we can reuse it - m_renderWriter.Reset(c_renderBufferMaxCapacity, c_renderBufferSize); + this.m_renderWriter.Reset(c_renderBufferMaxCapacity, c_renderBufferSize); - RenderLoggingEvent(m_renderWriter, loggingEvent); - return m_renderWriter.ToString(); + this.RenderLoggingEvent(this.m_renderWriter, loggingEvent); + return this.m_renderWriter.ToString(); } } @@ -736,30 +736,30 @@ protected string RenderLoggingEvent(LoggingEvent loggingEvent) /// protected void RenderLoggingEvent(TextWriter writer, LoggingEvent loggingEvent) { - if (m_layout == null) + if (this.m_layout == null) { throw new InvalidOperationException("A layout must be set"); } - if (m_layout.IgnoresException) + if (this.m_layout.IgnoresException) { string exceptionStr = loggingEvent.GetExceptionString(); if (exceptionStr != null && exceptionStr.Length > 0) { // render the event and the exception - m_layout.Format(writer, loggingEvent); + this.m_layout.Format(writer, loggingEvent); writer.WriteLine(exceptionStr); } else { // there is no exception to render - m_layout.Format(writer, loggingEvent); + this.m_layout.Format(writer, loggingEvent); } } else { // The layout will render the exception - m_layout.Format(writer, loggingEvent); + this.m_layout.Format(writer, loggingEvent); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AspNetTraceAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AspNetTraceAppender.cs index 5d8f874d9dd..b95018f45f6 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AspNetTraceAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/AspNetTraceAppender.cs @@ -98,11 +98,11 @@ override protected void Append(LoggingEvent loggingEvent) { if (loggingEvent.Level >= Level.Warn) { - HttpContext.Current.Trace.Warn(m_category.Format(loggingEvent), RenderLoggingEvent(loggingEvent)); + HttpContext.Current.Trace.Warn(this.m_category.Format(loggingEvent), this.RenderLoggingEvent(loggingEvent)); } else { - HttpContext.Current.Trace.Write(m_category.Format(loggingEvent), RenderLoggingEvent(loggingEvent)); + HttpContext.Current.Trace.Write(this.m_category.Format(loggingEvent), this.RenderLoggingEvent(loggingEvent)); } } } @@ -139,8 +139,8 @@ override protected bool RequiresLayout /// public PatternLayout Category { - get { return m_category; } - set { m_category = value; } + get { return this.m_category; } + set { this.m_category = value; } } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingAppenderSkeleton.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingAppenderSkeleton.cs index 57c85208878..bbee04460fe 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingAppenderSkeleton.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingAppenderSkeleton.cs @@ -105,7 +105,7 @@ protected BufferingAppenderSkeleton() : this(true) /// protected BufferingAppenderSkeleton(bool eventMustBeFixed) : base() { - m_eventMustBeFixed = eventMustBeFixed; + this.m_eventMustBeFixed = eventMustBeFixed; } #endregion Protected Instance Constructors @@ -132,8 +132,8 @@ protected BufferingAppenderSkeleton(bool eventMustBeFixed) : base() /// public bool Lossy { - get { return m_lossy; } - set { m_lossy = value; } + get { return this.m_lossy; } + set { this.m_lossy = value; } } /// @@ -161,8 +161,8 @@ public bool Lossy /// public int BufferSize { - get { return m_bufferSize; } - set { m_bufferSize = value; } + get { return this.m_bufferSize; } + set { this.m_bufferSize = value; } } /// @@ -184,8 +184,8 @@ public int BufferSize /// public ITriggeringEventEvaluator Evaluator { - get { return m_evaluator; } - set { m_evaluator = value; } + get { return this.m_evaluator; } + set { this.m_evaluator = value; } } /// @@ -203,8 +203,8 @@ public ITriggeringEventEvaluator Evaluator /// public ITriggeringEventEvaluator LossyEvaluator { - get { return m_lossyEvaluator; } - set { m_lossyEvaluator = value; } + get { return this.m_lossyEvaluator; } + set { this.m_lossyEvaluator = value; } } /// @@ -227,16 +227,16 @@ public ITriggeringEventEvaluator LossyEvaluator [Obsolete("Use Fix property. Scheduled removal in v10.0.0.")] virtual public bool OnlyFixPartialEventData { - get { return (Fix == FixFlags.Partial); } + get { return (this.Fix == FixFlags.Partial); } set { if (value) { - Fix = FixFlags.Partial; + this.Fix = FixFlags.Partial; } else { - Fix = FixFlags.All; + this.Fix = FixFlags.All; } } } @@ -257,8 +257,8 @@ virtual public bool OnlyFixPartialEventData /// virtual public FixFlags Fix { - get { return m_fixFlags; } - set { m_fixFlags = value; } + get { return this.m_fixFlags; } + set { this.m_fixFlags = value; } } #endregion Public Instance Properties @@ -272,7 +272,7 @@ virtual public FixFlags Fix /// True if all logging events were flushed successfully, else false. public override bool Flush(int millisecondsTimeout) { - Flush(); + this.Flush(); return true; } @@ -290,7 +290,7 @@ public override bool Flush(int millisecondsTimeout) /// public virtual void Flush() { - Flush(false); + this.Flush(false); } /// @@ -321,22 +321,22 @@ public virtual void Flush(bool flushLossyBuffer) // Appends while the buffer is flushed. lock(this) { - if (m_cb != null && m_cb.Length > 0) + if (this.m_cb != null && this.m_cb.Length > 0) { - if (m_lossy) + if (this.m_lossy) { // If we are allowed to eagerly flush from the lossy buffer if (flushLossyBuffer) { - if (m_lossyEvaluator != null) + if (this.m_lossyEvaluator != null) { // Test the contents of the buffer against the lossy evaluator - LoggingEvent[] bufferedEvents = m_cb.PopAll(); + LoggingEvent[] bufferedEvents = this.m_cb.PopAll(); ArrayList filteredEvents = new ArrayList(bufferedEvents.Length); foreach(LoggingEvent loggingEvent in bufferedEvents) { - if (m_lossyEvaluator.IsTriggeringEvent(loggingEvent)) + if (this.m_lossyEvaluator.IsTriggeringEvent(loggingEvent)) { filteredEvents.Add(loggingEvent); } @@ -345,20 +345,20 @@ public virtual void Flush(bool flushLossyBuffer) // Send the events that meet the lossy evaluator criteria if (filteredEvents.Count > 0) { - SendBuffer((LoggingEvent[])filteredEvents.ToArray(typeof(LoggingEvent))); + this.SendBuffer((LoggingEvent[])filteredEvents.ToArray(typeof(LoggingEvent))); } } else { // No lossy evaluator, all buffered events are discarded - m_cb.Clear(); + this.m_cb.Clear(); } } } else { // Not lossy, send whole buffer - SendFromBuffer(null, m_cb); + this.SendFromBuffer(null, this.m_cb); } } } @@ -391,18 +391,18 @@ override public void ActivateOptions() // If the appender is in Lossy mode then we will // only send the buffer when the Evaluator triggers // therefore check we have an evaluator. - if (m_lossy && m_evaluator == null) + if (this.m_lossy && this.m_evaluator == null) { - ErrorHandler.Error("Appender ["+Name+"] is Lossy but has no Evaluator. The buffer will never be sent!"); + this.ErrorHandler.Error("Appender ["+this.Name+"] is Lossy but has no Evaluator. The buffer will never be sent!"); } - if (m_bufferSize > 1) + if (this.m_bufferSize > 1) { - m_cb = new CyclicBuffer(m_bufferSize); + this.m_cb = new CyclicBuffer(this.m_bufferSize); } else { - m_cb = null; + this.m_cb = null; } } @@ -423,7 +423,7 @@ override public void ActivateOptions() override protected void OnClose() { // Flush the buffer on close - Flush(true); + this.Flush(true); } /// @@ -462,21 +462,21 @@ override protected void Append(LoggingEvent loggingEvent) // sent immediately because there is not enough space in the buffer // to buffer up more than 1 event. Therefore as a special case // we don't use the buffer at all. - if (m_cb == null || m_bufferSize <= 1) + if (this.m_cb == null || this.m_bufferSize <= 1) { // Only send the event if we are in non lossy mode or the event is a triggering event - if ((!m_lossy) || - (m_evaluator != null && m_evaluator.IsTriggeringEvent(loggingEvent)) || - (m_lossyEvaluator != null && m_lossyEvaluator.IsTriggeringEvent(loggingEvent))) + if ((!this.m_lossy) || + (this.m_evaluator != null && this.m_evaluator.IsTriggeringEvent(loggingEvent)) || + (this.m_lossyEvaluator != null && this.m_lossyEvaluator.IsTriggeringEvent(loggingEvent))) { - if (m_eventMustBeFixed) + if (this.m_eventMustBeFixed) { // Derive class expects fixed events loggingEvent.Fix = this.Fix; } // Not buffering events, send immediately - SendBuffer(new LoggingEvent[] { loggingEvent } ); + this.SendBuffer(new LoggingEvent[] { loggingEvent } ); } } else @@ -487,34 +487,34 @@ override protected void Append(LoggingEvent loggingEvent) loggingEvent.Fix = this.Fix; // Add to the buffer, returns the event discarded from the buffer if there is no space remaining after the append - LoggingEvent discardedLoggingEvent = m_cb.Append(loggingEvent); + LoggingEvent discardedLoggingEvent = this.m_cb.Append(loggingEvent); if (discardedLoggingEvent != null) { // Buffer is full and has had to discard an event - if (!m_lossy) + if (!this.m_lossy) { // Not lossy, must send all events - SendFromBuffer(discardedLoggingEvent, m_cb); + this.SendFromBuffer(discardedLoggingEvent, this.m_cb); } else { // Check if the discarded event should not be logged - if (m_lossyEvaluator == null || !m_lossyEvaluator.IsTriggeringEvent(discardedLoggingEvent)) + if (this.m_lossyEvaluator == null || !this.m_lossyEvaluator.IsTriggeringEvent(discardedLoggingEvent)) { // Clear the discarded event as we should not forward it discardedLoggingEvent = null; } // Check if the event should trigger the whole buffer to be sent - if (m_evaluator != null && m_evaluator.IsTriggeringEvent(loggingEvent)) + if (this.m_evaluator != null && this.m_evaluator.IsTriggeringEvent(loggingEvent)) { - SendFromBuffer(discardedLoggingEvent, m_cb); + this.SendFromBuffer(discardedLoggingEvent, this.m_cb); } else if (discardedLoggingEvent != null) { // Just send the discarded event - SendBuffer(new LoggingEvent[] { discardedLoggingEvent } ); + this.SendBuffer(new LoggingEvent[] { discardedLoggingEvent } ); } } } @@ -523,9 +523,9 @@ override protected void Append(LoggingEvent loggingEvent) // Buffer is not yet full // Check if the event should trigger the whole buffer to be sent - if (m_evaluator != null && m_evaluator.IsTriggeringEvent(loggingEvent)) + if (this.m_evaluator != null && this.m_evaluator.IsTriggeringEvent(loggingEvent)) { - SendFromBuffer(null, m_cb); + this.SendFromBuffer(null, this.m_cb); } } } @@ -551,11 +551,11 @@ virtual protected void SendFromBuffer(LoggingEvent firstLoggingEvent, CyclicBuff if (firstLoggingEvent == null) { - SendBuffer(bufferEvents); + this.SendBuffer(bufferEvents); } else if (bufferEvents.Length == 0) { - SendBuffer(new LoggingEvent[] { firstLoggingEvent } ); + this.SendBuffer(new LoggingEvent[] { firstLoggingEvent } ); } else { @@ -564,7 +564,7 @@ virtual protected void SendFromBuffer(LoggingEvent firstLoggingEvent, CyclicBuff Array.Copy(bufferEvents, 0, events, 1, bufferEvents.Length); events[0] = firstLoggingEvent; - SendBuffer(events); + this.SendBuffer(events); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingForwardingAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingForwardingAppender.cs index 27ffb29cfe0..79956690351 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingForwardingAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/BufferingForwardingAppender.cs @@ -86,9 +86,9 @@ override protected void OnClose() // Delegate to base, which will flush buffers base.OnClose(); - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.RemoveAllAppenders(); + this.m_appenderAttachedImpl.RemoveAllAppenders(); } } } @@ -109,9 +109,9 @@ override protected void OnClose() override protected void SendBuffer(LoggingEvent[] events) { // Pass the logging event on to the attached appenders - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.AppendLoopOnAppenders(events); + this.m_appenderAttachedImpl.AppendLoopOnAppenders(events); } } @@ -138,11 +138,11 @@ virtual public void AddAppender(IAppender newAppender) } lock(this) { - if (m_appenderAttachedImpl == null) + if (this.m_appenderAttachedImpl == null) { - m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); + this.m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); } - m_appenderAttachedImpl.AddAppender(newAppender); + this.m_appenderAttachedImpl.AddAppender(newAppender); } } @@ -163,13 +163,13 @@ virtual public AppenderCollection Appenders { lock(this) { - if (m_appenderAttachedImpl == null) + if (this.m_appenderAttachedImpl == null) { return AppenderCollection.EmptyCollection; } else { - return m_appenderAttachedImpl.Appenders; + return this.m_appenderAttachedImpl.Appenders; } } } @@ -191,12 +191,12 @@ virtual public IAppender GetAppender(string name) { lock(this) { - if (m_appenderAttachedImpl == null || name == null) + if (this.m_appenderAttachedImpl == null || name == null) { return null; } - return m_appenderAttachedImpl.GetAppender(name); + return this.m_appenderAttachedImpl.GetAppender(name); } } @@ -212,10 +212,10 @@ virtual public void RemoveAllAppenders() { lock(this) { - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.RemoveAllAppenders(); - m_appenderAttachedImpl = null; + this.m_appenderAttachedImpl.RemoveAllAppenders(); + this.m_appenderAttachedImpl = null; } } } @@ -234,9 +234,9 @@ virtual public IAppender RemoveAppender(IAppender appender) { lock(this) { - if (appender != null && m_appenderAttachedImpl != null) + if (appender != null && this.m_appenderAttachedImpl != null) { - return m_appenderAttachedImpl.RemoveAppender(appender); + return this.m_appenderAttachedImpl.RemoveAppender(appender); } } return null; @@ -256,9 +256,9 @@ virtual public IAppender RemoveAppender(string name) { lock(this) { - if (name != null && m_appenderAttachedImpl != null) + if (name != null && this.m_appenderAttachedImpl != null) { - return m_appenderAttachedImpl.RemoveAppender(name); + return this.m_appenderAttachedImpl.RemoveAppender(name); } } return null; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ColoredConsoleAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ColoredConsoleAppender.cs index cd9a6833224..7cd00e055d6 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ColoredConsoleAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ColoredConsoleAppender.cs @@ -197,8 +197,8 @@ public ColoredConsoleAppender(ILayout layout) : this(layout, false) [Obsolete("Instead use the default constructor and set the Layout & Target properties. Scheduled removal in v10.0.0.")] public ColoredConsoleAppender(ILayout layout, bool writeToErrorStream) { - Layout = layout; - m_writeToErrorStream = writeToErrorStream; + this.Layout = layout; + this.m_writeToErrorStream = writeToErrorStream; } #endregion // Public Instance Constructors @@ -221,18 +221,18 @@ public ColoredConsoleAppender(ILayout layout, bool writeToErrorStream) /// virtual public string Target { - get { return m_writeToErrorStream ? ConsoleError : ConsoleOut; } + get { return this.m_writeToErrorStream ? ConsoleError : ConsoleOut; } set { string v = value.Trim(); if (string.Compare(ConsoleError, v, true, CultureInfo.InvariantCulture) == 0) { - m_writeToErrorStream = true; + this.m_writeToErrorStream = true; } else { - m_writeToErrorStream = false; + this.m_writeToErrorStream = false; } } } @@ -250,7 +250,7 @@ virtual public string Target /// public void AddMapping(LevelColors mapping) { - m_levelMapping.Add(mapping); + this.m_levelMapping.Add(mapping); } #endregion // Public Instance Properties @@ -275,10 +275,10 @@ public void AddMapping(LevelColors mapping) [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, UnmanagedCode = true)] override protected void Append(log4net.Core.LoggingEvent loggingEvent) { - if (m_consoleOutputWriter != null) + if (this.m_consoleOutputWriter != null) { IntPtr consoleHandle = IntPtr.Zero; - if (m_writeToErrorStream) + if (this.m_writeToErrorStream) { // Write to the error stream consoleHandle = GetStdHandle(STD_ERROR_HANDLE); @@ -293,14 +293,14 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) ushort colorInfo = (ushort)Colors.White; // see if there is a specified lookup - LevelColors levelColors = m_levelMapping.Lookup(loggingEvent.Level) as LevelColors; + LevelColors levelColors = this.m_levelMapping.Lookup(loggingEvent.Level) as LevelColors; if (levelColors != null) { colorInfo = levelColors.CombinedColor; } // Render the event to a string - string strLoggingMessage = RenderLoggingEvent(loggingEvent); + string strLoggingMessage = this.RenderLoggingEvent(loggingEvent); // get the current console color - to restore later CONSOLE_SCREEN_BUFFER_INFO bufferInfo; @@ -401,7 +401,7 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) } // Write to the output stream - m_consoleOutputWriter.Write(messageCharArray, 0, arrayLength); + this.m_consoleOutputWriter.Write(messageCharArray, 0, arrayLength); // Restore the console back to its previous color scheme SetConsoleTextAttribute(consoleHandle, bufferInfo.wAttributes); @@ -409,7 +409,7 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) if (appendNewline) { // Write the newline, after changing the color scheme - m_consoleOutputWriter.Write(s_windowsNewline, 0, 2); + this.m_consoleOutputWriter.Write(s_windowsNewline, 0, 2); } } } @@ -445,12 +445,12 @@ override protected bool RequiresLayout public override void ActivateOptions() { base.ActivateOptions(); - m_levelMapping.ActivateOptions(); + this.m_levelMapping.ActivateOptions(); System.IO.Stream consoleOutputStream = null; // Use the Console methods to open a Stream over the console std handle - if (m_writeToErrorStream) + if (this.m_writeToErrorStream) { // Write to the error stream consoleOutputStream = Console.OpenStandardError(); @@ -465,15 +465,15 @@ public override void ActivateOptions() System.Text.Encoding consoleEncoding = System.Text.Encoding.GetEncoding(GetConsoleOutputCP()); // Create a writer around the console stream - m_consoleOutputWriter = new System.IO.StreamWriter(consoleOutputStream, consoleEncoding, 0x100); + this.m_consoleOutputWriter = new System.IO.StreamWriter(consoleOutputStream, consoleEncoding, 0x100); - m_consoleOutputWriter.AutoFlush = true; + this.m_consoleOutputWriter.AutoFlush = true; // SuppressFinalize on m_consoleOutputWriter because all it will do is flush // and close the file handle. Because we have set AutoFlush the additional flush // is not required. The console file handle should not be closed, so we don't call // Dispose, Close or the finalizer. - GC.SuppressFinalize(m_consoleOutputWriter); + GC.SuppressFinalize(this.m_consoleOutputWriter); } #endregion // Override implementation of AppenderSkeleton @@ -617,8 +617,8 @@ public class LevelColors : LevelMappingEntry /// public Colors ForeColor { - get { return m_foreColor; } - set { m_foreColor = value; } + get { return this.m_foreColor; } + set { this.m_foreColor = value; } } /// @@ -632,8 +632,8 @@ public Colors ForeColor /// public Colors BackColor { - get { return m_backColor; } - set { m_backColor = value; } + get { return this.m_backColor; } + set { this.m_backColor = value; } } /// @@ -647,7 +647,7 @@ public Colors BackColor public override void ActivateOptions() { base.ActivateOptions(); - m_combinedColor = (ushort)( (int)m_foreColor + (((int)m_backColor) << 4) ); + this.m_combinedColor = (ushort)( (int)this.m_foreColor + (((int)this.m_backColor) << 4) ); } /// @@ -656,7 +656,7 @@ public override void ActivateOptions() /// internal ushort CombinedColor { - get { return m_combinedColor; } + get { return this.m_combinedColor; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ConsoleAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ConsoleAppender.cs index 0ef228676e9..996d1eae1a0 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ConsoleAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ConsoleAppender.cs @@ -97,8 +97,8 @@ public ConsoleAppender(ILayout layout) : this(layout, false) [Obsolete("Instead use the default constructor and set the Layout & Target properties. Scheduled removal in v10.0.0.")] public ConsoleAppender(ILayout layout, bool writeToErrorStream) { - Layout = layout; - m_writeToErrorStream = writeToErrorStream; + this.Layout = layout; + this.m_writeToErrorStream = writeToErrorStream; } #endregion Public Instance Constructors @@ -121,18 +121,18 @@ public ConsoleAppender(ILayout layout, bool writeToErrorStream) /// virtual public string Target { - get { return m_writeToErrorStream ? ConsoleError : ConsoleOut; } + get { return this.m_writeToErrorStream ? ConsoleError : ConsoleOut; } set { string v = value.Trim(); if (SystemInfo.EqualsIgnoringCase(ConsoleError, v)) { - m_writeToErrorStream = true; + this.m_writeToErrorStream = true; } else { - m_writeToErrorStream = false; + this.m_writeToErrorStream = false; } } } @@ -159,15 +159,15 @@ override protected void Append(LoggingEvent loggingEvent) // Write to the output stream Console.Write(RenderLoggingEvent(loggingEvent)); #else - if (m_writeToErrorStream) + if (this.m_writeToErrorStream) { // Write to the error stream - Console.Error.Write(RenderLoggingEvent(loggingEvent)); + Console.Error.Write(this.RenderLoggingEvent(loggingEvent)); } else { // Write to the output stream - Console.Write(RenderLoggingEvent(loggingEvent)); + Console.Write(this.RenderLoggingEvent(loggingEvent)); } #endif } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/DebugAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/DebugAppender.cs index 29172bb8f09..ff7325f822e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/DebugAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/DebugAppender.cs @@ -73,7 +73,7 @@ public DebugAppender() [System.Obsolete("Instead use the default constructor and set the Layout property")] public DebugAppender(ILayout layout) { - Layout = layout; + this.Layout = layout; } #endregion Public Instance Constructors @@ -100,8 +100,8 @@ public DebugAppender(ILayout layout) /// public bool ImmediateFlush { - get { return m_immediateFlush; } - set { m_immediateFlush = value; } + get { return this.m_immediateFlush; } + set { this.m_immediateFlush = value; } } #endregion Public Instance Properties @@ -115,7 +115,7 @@ public bool ImmediateFlush public override bool Flush(int millisecondsTimeout) { // Nothing to do if ImmediateFlush is true - if (m_immediateFlush) return true; + if (this.m_immediateFlush) return true; // System.Diagnostics.Debug is thread-safe, so no need for lock(this). System.Diagnostics.Debug.Flush(); @@ -142,12 +142,12 @@ override protected void Append(LoggingEvent loggingEvent) // // Write the string to the Debug system // - System.Diagnostics.Debug.Write(RenderLoggingEvent(loggingEvent), loggingEvent.LoggerName); + System.Diagnostics.Debug.Write(this.RenderLoggingEvent(loggingEvent), loggingEvent.LoggerName); #if !NETSTANDARD1_3 // // Flush the Debug system if needed // - if (m_immediateFlush) + if (this.m_immediateFlush) { System.Diagnostics.Debug.Flush(); } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/EventLogAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/EventLogAppender.cs index b271d14386b..1d4f77de601 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/EventLogAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/EventLogAppender.cs @@ -102,9 +102,9 @@ public class EventLogAppender : AppenderSkeleton /// public EventLogAppender() { - m_applicationName = System.Threading.Thread.GetDomain().FriendlyName; - m_logName = "Application"; // Defaults to application log - m_machineName = "."; // Only log on the local machine + this.m_applicationName = System.Threading.Thread.GetDomain().FriendlyName; + this.m_logName = "Application"; // Defaults to application log + this.m_machineName = "."; // Only log on the local machine } /// @@ -120,7 +120,7 @@ public EventLogAppender() [Obsolete("Instead use the default constructor and set the Layout property. Scheduled removal in v10.0.0.")] public EventLogAppender(ILayout layout) : this() { - Layout = layout; + this.Layout = layout; } #endregion // Public Instance Constructors @@ -147,8 +147,8 @@ public EventLogAppender(ILayout layout) : this() /// public string LogName { - get { return m_logName; } - set { m_logName = value; } + get { return this.m_logName; } + set { this.m_logName = value; } } /// @@ -163,8 +163,8 @@ public string LogName /// public string ApplicationName { - get { return m_applicationName; } - set { m_applicationName = value; } + get { return this.m_applicationName; } + set { this.m_applicationName = value; } } /// @@ -182,7 +182,7 @@ public string ApplicationName /// public string MachineName { - get { return m_machineName; } + get { return this.m_machineName; } set { /* Currently we do not allow the machine name to be changed */; } } @@ -198,7 +198,7 @@ public string MachineName /// public void AddMapping(Level2EventLogEntryType mapping) { - m_levelMapping.Add(mapping); + this.m_levelMapping.Add(mapping); } /// @@ -220,8 +220,8 @@ public void AddMapping(Level2EventLogEntryType mapping) /// public SecurityContext SecurityContext { - get { return m_securityContext; } - set { m_securityContext = value; } + get { return this.m_securityContext; } + set { this.m_securityContext = value; } } /// @@ -236,8 +236,8 @@ public SecurityContext SecurityContext /// /// public int EventId { - get { return m_eventId; } - set { m_eventId = value; } + get { return this.m_eventId; } + set { this.m_eventId = value; } } @@ -254,8 +254,8 @@ public int EventId { /// public short Category { - get { return m_category; } - set { m_category = value; } + get { return this.m_category; } + set { this.m_category = value; } } #endregion // Public Instance Properties @@ -283,66 +283,66 @@ override public void ActivateOptions() { base.ActivateOptions(); - if (m_securityContext == null) + if (this.m_securityContext == null) { - m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); + this.m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); } bool sourceAlreadyExists = false; string currentLogName = null; - using (SecurityContext.Impersonate(this)) + using (this.SecurityContext.Impersonate(this)) { - sourceAlreadyExists = EventLog.SourceExists(m_applicationName); + sourceAlreadyExists = EventLog.SourceExists(this.m_applicationName); if (sourceAlreadyExists) { - currentLogName = EventLog.LogNameFromSourceName(m_applicationName, m_machineName); + currentLogName = EventLog.LogNameFromSourceName(this.m_applicationName, this.m_machineName); } } - if (sourceAlreadyExists && currentLogName != m_logName) + if (sourceAlreadyExists && currentLogName != this.m_logName) { - LogLog.Debug(declaringType, "Changing event source [" + m_applicationName + "] from log [" + currentLogName + "] to log [" + m_logName + "]"); + LogLog.Debug(declaringType, "Changing event source [" + this.m_applicationName + "] from log [" + currentLogName + "] to log [" + this.m_logName + "]"); } else if (!sourceAlreadyExists) { - LogLog.Debug(declaringType, "Creating event source Source [" + m_applicationName + "] in log " + m_logName + "]"); + LogLog.Debug(declaringType, "Creating event source Source [" + this.m_applicationName + "] in log " + this.m_logName + "]"); } string registeredLogName = null; - using (SecurityContext.Impersonate(this)) + using (this.SecurityContext.Impersonate(this)) { - if (sourceAlreadyExists && currentLogName != m_logName) + if (sourceAlreadyExists && currentLogName != this.m_logName) { // // Re-register this to the current application if the user has changed // the application / logfile association // - EventLog.DeleteEventSource(m_applicationName, m_machineName); - CreateEventSource(m_applicationName, m_logName, m_machineName); + EventLog.DeleteEventSource(this.m_applicationName, this.m_machineName); + CreateEventSource(this.m_applicationName, this.m_logName, this.m_machineName); - registeredLogName = EventLog.LogNameFromSourceName(m_applicationName, m_machineName); + registeredLogName = EventLog.LogNameFromSourceName(this.m_applicationName, this.m_machineName); } else if (!sourceAlreadyExists) { - CreateEventSource(m_applicationName, m_logName, m_machineName); + CreateEventSource(this.m_applicationName, this.m_logName, this.m_machineName); - registeredLogName = EventLog.LogNameFromSourceName(m_applicationName, m_machineName); + registeredLogName = EventLog.LogNameFromSourceName(this.m_applicationName, this.m_machineName); } } - m_levelMapping.ActivateOptions(); + this.m_levelMapping.ActivateOptions(); - LogLog.Debug(declaringType, "Source [" + m_applicationName + "] is registered to log [" + registeredLogName + "]"); + LogLog.Debug(declaringType, "Source [" + this.m_applicationName + "] is registered to log [" + registeredLogName + "]"); } catch (System.Security.SecurityException ex) { - ErrorHandler.Error("Caught a SecurityException trying to access the EventLog. Most likely the event source " - + m_applicationName + this.ErrorHandler.Error("Caught a SecurityException trying to access the EventLog. Most likely the event source " + + this.m_applicationName + " doesn't exist and must be created by a local administrator. Will disable EventLogAppender." + " See http://logging.apache.org/log4net/release/faq.html#trouble-EventLog", ex); - Threshold = Level.Off; + this.Threshold = Level.Off; } } @@ -388,7 +388,7 @@ override protected void Append(LoggingEvent loggingEvent) // // Write the resulting string to the event log system // - int eventID = m_eventId; + int eventID = this.m_eventId; // Look for the EventID property object eventIDPropertyObj = loggingEvent.LookupProperty("EventID"); @@ -415,13 +415,13 @@ override protected void Append(LoggingEvent loggingEvent) } else { - ErrorHandler.Error("Unable to parse event ID property [" + eventIDPropertyString + "]."); + this.ErrorHandler.Error("Unable to parse event ID property [" + eventIDPropertyString + "]."); } } } } - short category = m_category; + short category = this.m_category; // Look for the Category property object categoryPropertyObj = loggingEvent.LookupProperty("Category"); if (categoryPropertyObj != null) @@ -447,7 +447,7 @@ override protected void Append(LoggingEvent loggingEvent) } else { - ErrorHandler.Error("Unable to parse event category property [" + categoryPropertyString + "]."); + this.ErrorHandler.Error("Unable to parse event category property [" + categoryPropertyString + "]."); } } } @@ -456,7 +456,7 @@ override protected void Append(LoggingEvent loggingEvent) // Write to the event log try { - string eventTxt = RenderLoggingEvent(loggingEvent); + string eventTxt = this.RenderLoggingEvent(loggingEvent); // There is a limit of about 32K characters for an event log message if (eventTxt.Length > MAX_EVENTLOG_MESSAGE_SIZE) @@ -464,16 +464,16 @@ override protected void Append(LoggingEvent loggingEvent) eventTxt = eventTxt.Substring(0, MAX_EVENTLOG_MESSAGE_SIZE); } - EventLogEntryType entryType = GetEntryType(loggingEvent.Level); + EventLogEntryType entryType = this.GetEntryType(loggingEvent.Level); - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { - EventLog.WriteEntry(m_applicationName, eventTxt, entryType, eventID, category); + EventLog.WriteEntry(this.m_applicationName, eventTxt, entryType, eventID, category); } } catch(Exception ex) { - ErrorHandler.Error("Unable to write to event log [" + m_logName + "] using source [" + m_applicationName + "]", ex); + this.ErrorHandler.Error("Unable to write to event log [" + this.m_logName + "] using source [" + this.m_applicationName + "]", ex); } } @@ -509,7 +509,7 @@ override protected bool RequiresLayout virtual protected EventLogEntryType GetEntryType(Level level) { // see if there is a specified lookup. - Level2EventLogEntryType entryType = m_levelMapping.Lookup(level) as Level2EventLogEntryType; + Level2EventLogEntryType entryType = this.m_levelMapping.Lookup(level) as Level2EventLogEntryType; if (entryType != null) { return entryType.EventLogEntryType; @@ -600,8 +600,8 @@ public class Level2EventLogEntryType : LevelMappingEntry /// public EventLogEntryType EventLogEntryType { - get { return m_entryType; } - set { m_entryType = value; } + get { return this.m_entryType; } + set { this.m_entryType = value; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/FileAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/FileAppender.cs index b8dd8349948..74112f09c4a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/FileAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/FileAppender.cs @@ -161,7 +161,7 @@ public LockingStream(LockingModelBase locking) { throw new ArgumentException("Locking model may not be null", "locking"); } - m_lockingModel = locking; + this.m_lockingModel = locking; } #region Override Implementation of Stream @@ -179,9 +179,9 @@ protected override void Dispose(bool disposing) // Methods public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { - AssertLocked(); - IAsyncResult ret = m_realStream.BeginRead(buffer, offset, count, callback, state); - m_readTotal = EndRead(ret); + this.AssertLocked(); + IAsyncResult ret = this.m_realStream.BeginRead(buffer, offset, count, callback, state); + this.m_readTotal = this.EndRead(ret); return ret; } @@ -190,21 +190,21 @@ public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, Asy /// public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, AsyncCallback callback, object state) { - AssertLocked(); - IAsyncResult ret = m_realStream.BeginWrite(buffer, offset, count, callback, state); - EndWrite(ret); + this.AssertLocked(); + IAsyncResult ret = this.m_realStream.BeginWrite(buffer, offset, count, callback, state); + this.EndWrite(ret); return ret; } public override void Close() { - m_lockingModel.CloseFile(); + this.m_lockingModel.CloseFile(); } public override int EndRead(IAsyncResult asyncResult) { - AssertLocked(); - return m_readTotal; + this.AssertLocked(); + return this.m_readTotal; } public override void EndWrite(IAsyncResult asyncResult) { @@ -215,57 +215,57 @@ public override void EndWrite(IAsyncResult asyncResult) #if NET_4_5 || NETSTANDARD1_3 public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { - AssertLocked(); - return m_realStream.ReadAsync(buffer, offset, count, cancellationToken); + this.AssertLocked(); + return this.m_realStream.ReadAsync(buffer, offset, count, cancellationToken); } public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { - AssertLocked(); + this.AssertLocked(); return base.WriteAsync(buffer, offset, count, cancellationToken); } #endif public override void Flush() { - AssertLocked(); - m_realStream.Flush(); + this.AssertLocked(); + this.m_realStream.Flush(); } public override int Read(byte[] buffer, int offset, int count) { - return m_realStream.Read(buffer, offset, count); + return this.m_realStream.Read(buffer, offset, count); } public override int ReadByte() { - return m_realStream.ReadByte(); + return this.m_realStream.ReadByte(); } public override long Seek(long offset, SeekOrigin origin) { - AssertLocked(); - return m_realStream.Seek(offset, origin); + this.AssertLocked(); + return this.m_realStream.Seek(offset, origin); } public override void SetLength(long value) { - AssertLocked(); - m_realStream.SetLength(value); + this.AssertLocked(); + this.m_realStream.SetLength(value); } void IDisposable.Dispose() { #if NETSTANDARD1_3 Dispose(true); #else - Close(); + this.Close(); #endif } public override void Write(byte[] buffer, int offset, int count) { - AssertLocked(); - m_realStream.Write(buffer, offset, count); + this.AssertLocked(); + this.m_realStream.Write(buffer, offset, count); } public override void WriteByte(byte value) { - AssertLocked(); - m_realStream.WriteByte(value); + this.AssertLocked(); + this.m_realStream.WriteByte(value); } // Properties @@ -277,37 +277,37 @@ public override bool CanSeek { get { - AssertLocked(); - return m_realStream.CanSeek; + this.AssertLocked(); + return this.m_realStream.CanSeek; } } public override bool CanWrite { get { - AssertLocked(); - return m_realStream.CanWrite; + this.AssertLocked(); + return this.m_realStream.CanWrite; } } public override long Length { get { - AssertLocked(); - return m_realStream.Length; + this.AssertLocked(); + return this.m_realStream.Length; } } public override long Position { get { - AssertLocked(); - return m_realStream.Position; + this.AssertLocked(); + return this.m_realStream.Position; } set { - AssertLocked(); - m_realStream.Position = value; + this.AssertLocked(); + this.m_realStream.Position = value; } } @@ -317,7 +317,7 @@ public override long Position private void AssertLocked() { - if (m_realStream == null) + if (this.m_realStream == null) { throw new LockStateException("The file is not currently locked"); } @@ -328,14 +328,14 @@ public bool AcquireLock() bool ret = false; lock (this) { - if (m_lockLevel == 0) + if (this.m_lockLevel == 0) { // If lock is already acquired, nop - m_realStream = m_lockingModel.AcquireLock(); + this.m_realStream = this.m_lockingModel.AcquireLock(); } - if (m_realStream != null) + if (this.m_realStream != null) { - m_lockLevel++; + this.m_lockLevel++; ret = true; } } @@ -346,12 +346,12 @@ public void ReleaseLock() { lock (this) { - m_lockLevel--; - if (m_lockLevel == 0) + this.m_lockLevel--; + if (this.m_lockLevel == 0) { // If already unlocked, nop - m_lockingModel.ReleaseLock(); - m_realStream = null; + this.m_lockingModel.ReleaseLock(); + this.m_realStream = null; } } } @@ -456,8 +456,8 @@ public abstract class LockingModelBase /// public FileAppender CurrentAppender { - get { return m_appender; } - set { m_appender = value; } + get { return this.m_appender; } + set { this.m_appender = value; } } /// @@ -478,7 +478,7 @@ public FileAppender CurrentAppender /// protected Stream CreateStream(string filename, bool append, FileShare fileShare) { - using (CurrentAppender.SecurityContext.Impersonate(this)) + using (this.CurrentAppender.SecurityContext.Impersonate(this)) { // Ensure that the directory structure exists string directoryFullName = Path.GetDirectoryName(filename); @@ -504,7 +504,7 @@ protected Stream CreateStream(string filename, bool append, FileShare fileShare) /// protected void CloseStream(Stream stream) { - using (CurrentAppender.SecurityContext.Impersonate(this)) + using (this.CurrentAppender.SecurityContext.Impersonate(this)) { stream.Close(); } @@ -542,11 +542,11 @@ public override void OpenFile(string filename, bool append, Encoding encoding) { try { - m_stream = CreateStream(filename, append, FileShare.Read); + this.m_stream = this.CreateStream(filename, append, FileShare.Read); } catch (Exception e1) { - CurrentAppender.ErrorHandler.Error("Unable to acquire lock on file " + filename + ". " + e1.Message); + this.CurrentAppender.ErrorHandler.Error("Unable to acquire lock on file " + filename + ". " + e1.Message); } } @@ -560,8 +560,8 @@ public override void OpenFile(string filename, bool append, Encoding encoding) /// public override void CloseFile() { - CloseStream(m_stream); - m_stream = null; + this.CloseStream(this.m_stream); + this.m_stream = null; } /// @@ -575,7 +575,7 @@ public override void CloseFile() /// public override Stream AcquireLock() { - return m_stream; + return this.m_stream; } /// @@ -641,8 +641,8 @@ public class MinimalLock : LockingModelBase /// public override void OpenFile(string filename, bool append, Encoding encoding) { - m_filename = filename; - m_append = append; + this.m_filename = filename; + this.m_append = append; } /// @@ -671,19 +671,19 @@ public override void CloseFile() /// public override Stream AcquireLock() { - if (m_stream == null) + if (this.m_stream == null) { try { - m_stream = CreateStream(m_filename, m_append, FileShare.Read); - m_append = true; + this.m_stream = this.CreateStream(this.m_filename, this.m_append, FileShare.Read); + this.m_append = true; } catch (Exception e1) { - CurrentAppender.ErrorHandler.Error("Unable to acquire lock on file " + m_filename + ". " + e1.Message); + this.CurrentAppender.ErrorHandler.Error("Unable to acquire lock on file " + this.m_filename + ". " + e1.Message); } } - return m_stream; + return this.m_stream; } /// @@ -697,8 +697,8 @@ public override Stream AcquireLock() /// public override void ReleaseLock() { - CloseStream(m_stream); - m_stream = null; + this.CloseStream(this.m_stream); + this.m_stream = null; } /// @@ -751,11 +751,11 @@ public override void OpenFile(string filename, bool append, Encoding encoding) { try { - m_stream = CreateStream(filename, append, FileShare.ReadWrite); + this.m_stream = this.CreateStream(filename, append, FileShare.ReadWrite); } catch (Exception e1) { - CurrentAppender.ErrorHandler.Error("Unable to acquire lock on file " + filename + ". " + e1.Message); + this.CurrentAppender.ErrorHandler.Error("Unable to acquire lock on file " + filename + ". " + e1.Message); } } @@ -771,12 +771,12 @@ public override void CloseFile() { try { - CloseStream(m_stream); - m_stream = null; + this.CloseStream(this.m_stream); + this.m_stream = null; } finally { - ReleaseLock(); + this.ReleaseLock(); } } @@ -791,20 +791,20 @@ public override void CloseFile() /// public override Stream AcquireLock() { - if (m_mutex != null) + if (this.m_mutex != null) { // TODO: add timeout? - m_mutex.WaitOne(); + this.m_mutex.WaitOne(); // increment recursive watch - m_recursiveWatch++; + this.m_recursiveWatch++; // should always be true (and fast) for FileStream - if (m_stream != null) + if (this.m_stream != null) { - if (m_stream.CanSeek) + if (this.m_stream.CanSeek) { - m_stream.Seek(0, SeekOrigin.End); + this.m_stream.Seek(0, SeekOrigin.End); } } else @@ -814,9 +814,9 @@ public override Stream AcquireLock() } else { - CurrentAppender.ErrorHandler.Error("Programming error, no mutex available to acquire lock! From here on things will be dangerous!"); + this.CurrentAppender.ErrorHandler.Error("Programming error, no mutex available to acquire lock! From here on things will be dangerous!"); } - return m_stream; + return this.m_stream; } /// @@ -824,17 +824,17 @@ public override Stream AcquireLock() /// public override void ReleaseLock() { - if (m_mutex != null) + if (this.m_mutex != null) { - if (m_recursiveWatch > 0) + if (this.m_recursiveWatch > 0) { - m_recursiveWatch--; - m_mutex.ReleaseMutex(); + this.m_recursiveWatch--; + this.m_mutex.ReleaseMutex(); } } else { - CurrentAppender.ErrorHandler.Error("Programming error, no mutex available to release the lock!"); + this.CurrentAppender.ErrorHandler.Error("Programming error, no mutex available to release the lock!"); } } @@ -843,18 +843,18 @@ public override void ReleaseLock() /// public override void ActivateOptions() { - if (m_mutex == null) + if (this.m_mutex == null) { - string mutexFriendlyFilename = CurrentAppender.File + string mutexFriendlyFilename = this.CurrentAppender.File .Replace("\\", "_") .Replace(":", "_") .Replace("/", "_"); - m_mutex = new Mutex(false, mutexFriendlyFilename); + this.m_mutex = new Mutex(false, mutexFriendlyFilename); } else { - CurrentAppender.ErrorHandler.Error("Programming error, mutex already initialized!"); + this.CurrentAppender.ErrorHandler.Error("Programming error, mutex already initialized!"); } } @@ -863,18 +863,18 @@ public override void ActivateOptions() /// public override void OnClose() { - if (m_mutex != null) + if (this.m_mutex != null) { #if NET_4_0 || MONO_4_0 || NETSTANDARD1_3 - m_mutex.Dispose(); + this.m_mutex.Dispose(); #else m_mutex.Close(); #endif - m_mutex = null; + this.m_mutex = null; } else { - CurrentAppender.ErrorHandler.Error("Programming error, mutex not initialized!"); + this.CurrentAppender.ErrorHandler.Error("Programming error, mutex not initialized!"); } } } @@ -910,10 +910,10 @@ public FileAppender() [Obsolete("Instead use the default constructor and set the Layout, File & AppendToFile properties. Scheduled removal in v10.0.0.")] public FileAppender(ILayout layout, string filename, bool append) { - Layout = layout; - File = filename; - AppendToFile = append; - ActivateOptions(); + this.Layout = layout; + this.File = filename; + this.AppendToFile = append; + this.ActivateOptions(); } /// @@ -951,8 +951,8 @@ public FileAppender(ILayout layout, string filename) /// virtual public string File { - get { return m_fileName; } - set { m_fileName = value; } + get { return this.m_fileName; } + set { this.m_fileName = value; } } /// @@ -971,8 +971,8 @@ virtual public string File /// public bool AppendToFile { - get { return m_appendToFile; } - set { m_appendToFile = value; } + get { return this.m_appendToFile; } + set { this.m_appendToFile = value; } } /// @@ -989,8 +989,8 @@ public bool AppendToFile /// public Encoding Encoding { - get { return m_encoding; } - set { m_encoding = value; } + get { return this.m_encoding; } + set { this.m_encoding = value; } } /// @@ -1009,8 +1009,8 @@ public Encoding Encoding /// public SecurityContext SecurityContext { - get { return m_securityContext; } - set { m_securityContext = value; } + get { return this.m_securityContext; } + set { this.m_securityContext = value; } } #if NETCF @@ -1058,8 +1058,8 @@ public SecurityContext SecurityContext #endif public FileAppender.LockingModelBase LockingModel { - get { return m_lockingModel; } - set { m_lockingModel = value; } + get { return this.m_lockingModel; } + set { this.m_lockingModel = value; } } #endregion Public Instance Properties @@ -1089,30 +1089,30 @@ override public void ActivateOptions() { base.ActivateOptions(); - if (m_securityContext == null) + if (this.m_securityContext == null) { - m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); + this.m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); } - if (m_lockingModel == null) + if (this.m_lockingModel == null) { - m_lockingModel = new FileAppender.ExclusiveLock(); + this.m_lockingModel = new FileAppender.ExclusiveLock(); } - m_lockingModel.CurrentAppender = this; - m_lockingModel.ActivateOptions(); + this.m_lockingModel.CurrentAppender = this; + this.m_lockingModel.ActivateOptions(); - if (m_fileName != null) + if (this.m_fileName != null) { - using (SecurityContext.Impersonate(this)) + using (this.SecurityContext.Impersonate(this)) { - m_fileName = ConvertToFullPath(m_fileName.Trim()); + this.m_fileName = ConvertToFullPath(this.m_fileName.Trim()); } - SafeOpenFile(m_fileName, m_appendToFile); + this.SafeOpenFile(this.m_fileName, this.m_appendToFile); } else { - LogLog.Warn(declaringType, "FileAppender: File option not set for appender [" + Name + "]."); + LogLog.Warn(declaringType, "FileAppender: File option not set for appender [" + this.Name + "]."); LogLog.Warn(declaringType, "FileAppender: Are you using FileAppender instead of ConsoleAppender?"); } } @@ -1132,7 +1132,7 @@ override public void ActivateOptions() override protected void Reset() { base.Reset(); - m_fileName = null; + this.m_fileName = null; } /// @@ -1141,7 +1141,7 @@ override protected void Reset() override protected void OnClose() { base.OnClose(); - m_lockingModel.OnClose(); + this.m_lockingModel.OnClose(); } /// @@ -1155,7 +1155,7 @@ override protected void OnClose() /// override protected void PrepareWriter() { - SafeOpenFile(m_fileName, m_appendToFile); + this.SafeOpenFile(this.m_fileName, this.m_appendToFile); } /// @@ -1174,7 +1174,7 @@ override protected void PrepareWriter() /// override protected void Append(LoggingEvent loggingEvent) { - if (m_stream.AcquireLock()) + if (this.m_stream.AcquireLock()) { try { @@ -1182,7 +1182,7 @@ override protected void Append(LoggingEvent loggingEvent) } finally { - m_stream.ReleaseLock(); + this.m_stream.ReleaseLock(); } } } @@ -1200,7 +1200,7 @@ override protected void Append(LoggingEvent loggingEvent) /// override protected void Append(LoggingEvent[] loggingEvents) { - if (m_stream.AcquireLock()) + if (this.m_stream.AcquireLock()) { try { @@ -1208,7 +1208,7 @@ override protected void Append(LoggingEvent[] loggingEvents) } finally { - m_stream.ReleaseLock(); + this.m_stream.ReleaseLock(); } } } @@ -1223,17 +1223,17 @@ override protected void Append(LoggingEvent[] loggingEvents) /// protected override void WriteFooter() { - if (m_stream != null) + if (this.m_stream != null) { //WriteFooter can be called even before a file is opened - m_stream.AcquireLock(); + this.m_stream.AcquireLock(); try { base.WriteFooter(); } finally { - m_stream.ReleaseLock(); + this.m_stream.ReleaseLock(); } } } @@ -1248,9 +1248,9 @@ protected override void WriteFooter() /// protected override void WriteHeader() { - if (m_stream != null) + if (this.m_stream != null) { - if (m_stream.AcquireLock()) + if (this.m_stream.AcquireLock()) { try { @@ -1258,7 +1258,7 @@ protected override void WriteHeader() } finally { - m_stream.ReleaseLock(); + this.m_stream.ReleaseLock(); } } } @@ -1274,16 +1274,16 @@ protected override void WriteHeader() /// protected override void CloseWriter() { - if (m_stream != null) + if (this.m_stream != null) { - m_stream.AcquireLock(); + this.m_stream.AcquireLock(); try { base.CloseWriter(); } finally { - m_stream.ReleaseLock(); + this.m_stream.ReleaseLock(); } } } @@ -1303,7 +1303,7 @@ protected override void CloseWriter() /// protected void CloseFile() { - WriteFooterAndCloseWriter(); + this.WriteFooterAndCloseWriter(); } #endregion Public Instance Methods @@ -1325,11 +1325,11 @@ virtual protected void SafeOpenFile(string fileName, bool append) { try { - OpenFile(fileName, append); + this.OpenFile(fileName, append); } catch (Exception e) { - ErrorHandler.Error("OpenFile(" + fileName + "," + append + ") call failed.", e, ErrorCode.FileOpenFailure); + this.ErrorHandler.Error("OpenFile(" + fileName + "," + append + ") call failed.", e, ErrorCode.FileOpenFailure); } } @@ -1354,7 +1354,7 @@ virtual protected void OpenFile(string fileName, bool append) { // Internal check that the fileName passed in is a rooted path bool isPathRooted = false; - using (SecurityContext.Impersonate(this)) + using (this.SecurityContext.Impersonate(this)) { isPathRooted = Path.IsPathRooted(fileName); } @@ -1366,32 +1366,32 @@ virtual protected void OpenFile(string fileName, bool append) lock (this) { - Reset(); + this.Reset(); LogLog.Debug(declaringType, "Opening file for writing [" + fileName + "] append [" + append + "]"); // Save these for later, allowing retries if file open fails - m_fileName = fileName; - m_appendToFile = append; + this.m_fileName = fileName; + this.m_appendToFile = append; - LockingModel.CurrentAppender = this; - LockingModel.OpenFile(fileName, append, m_encoding); - m_stream = new LockingStream(LockingModel); + this.LockingModel.CurrentAppender = this; + this.LockingModel.OpenFile(fileName, append, this.m_encoding); + this.m_stream = new LockingStream(this.LockingModel); - if (m_stream != null) + if (this.m_stream != null) { - m_stream.AcquireLock(); + this.m_stream.AcquireLock(); try { - SetQWForFiles(m_stream); + this.SetQWForFiles(this.m_stream); } finally { - m_stream.ReleaseLock(); + this.m_stream.ReleaseLock(); } } - WriteHeader(); + this.WriteHeader(); } } @@ -1413,7 +1413,7 @@ virtual protected void OpenFile(string fileName, bool append) /// virtual protected void SetQWForFiles(Stream fileStream) { - SetQWForFiles(new StreamWriter(fileStream, m_encoding)); + this.SetQWForFiles(new StreamWriter(fileStream, this.m_encoding)); } /// @@ -1428,7 +1428,7 @@ virtual protected void SetQWForFiles(Stream fileStream) /// virtual protected void SetQWForFiles(TextWriter writer) { - QuietWriter = new QuietTextWriter(writer, ErrorHandler); + this.QuietWriter = new QuietTextWriter(writer, this.ErrorHandler); } #endregion Protected Instance Methods diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ForwardingAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ForwardingAppender.cs index 11316858ce0..2d2f864ee49 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ForwardingAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ForwardingAppender.cs @@ -77,9 +77,9 @@ override protected void OnClose() // Remove all the attached appenders lock(this) { - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.RemoveAllAppenders(); + this.m_appenderAttachedImpl.RemoveAllAppenders(); } } } @@ -96,9 +96,9 @@ override protected void OnClose() override protected void Append(LoggingEvent loggingEvent) { // Pass the logging event on the the attached appenders - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvent); + this.m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvent); } } @@ -114,9 +114,9 @@ override protected void Append(LoggingEvent loggingEvent) override protected void Append(LoggingEvent[] loggingEvents) { // Pass the logging event on the the attached appenders - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvents); + this.m_appenderAttachedImpl.AppendLoopOnAppenders(loggingEvents); } } @@ -143,11 +143,11 @@ virtual public void AddAppender(IAppender newAppender) } lock(this) { - if (m_appenderAttachedImpl == null) + if (this.m_appenderAttachedImpl == null) { - m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); + this.m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); } - m_appenderAttachedImpl.AddAppender(newAppender); + this.m_appenderAttachedImpl.AddAppender(newAppender); } } @@ -168,13 +168,13 @@ virtual public AppenderCollection Appenders { lock(this) { - if (m_appenderAttachedImpl == null) + if (this.m_appenderAttachedImpl == null) { return AppenderCollection.EmptyCollection; } else { - return m_appenderAttachedImpl.Appenders; + return this.m_appenderAttachedImpl.Appenders; } } } @@ -196,12 +196,12 @@ virtual public IAppender GetAppender(string name) { lock(this) { - if (m_appenderAttachedImpl == null || name == null) + if (this.m_appenderAttachedImpl == null || name == null) { return null; } - return m_appenderAttachedImpl.GetAppender(name); + return this.m_appenderAttachedImpl.GetAppender(name); } } @@ -217,10 +217,10 @@ virtual public void RemoveAllAppenders() { lock(this) { - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.RemoveAllAppenders(); - m_appenderAttachedImpl = null; + this.m_appenderAttachedImpl.RemoveAllAppenders(); + this.m_appenderAttachedImpl = null; } } } @@ -239,9 +239,9 @@ virtual public IAppender RemoveAppender(IAppender appender) { lock(this) { - if (appender != null && m_appenderAttachedImpl != null) + if (appender != null && this.m_appenderAttachedImpl != null) { - return m_appenderAttachedImpl.RemoveAppender(appender); + return this.m_appenderAttachedImpl.RemoveAppender(appender); } } return null; @@ -261,9 +261,9 @@ virtual public IAppender RemoveAppender(string name) { lock(this) { - if (name != null && m_appenderAttachedImpl != null) + if (name != null && this.m_appenderAttachedImpl != null) { - return m_appenderAttachedImpl.RemoveAppender(name); + return this.m_appenderAttachedImpl.RemoveAppender(name); } } return null; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/LocalSyslogAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/LocalSyslogAppender.cs index 3f2afaee9f8..b297ccfcba7 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/LocalSyslogAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/LocalSyslogAppender.cs @@ -289,8 +289,8 @@ public LocalSyslogAppender() /// public string Identity { - get { return m_identity; } - set { m_identity = value; } + get { return this.m_identity; } + set { this.m_identity = value; } } /// @@ -303,8 +303,8 @@ public string Identity /// public SyslogFacility Facility { - get { return m_facility; } - set { m_facility = value; } + get { return this.m_facility; } + set { this.m_facility = value; } } #endregion // Public Instance Properties @@ -320,7 +320,7 @@ public SyslogFacility Facility /// public void AddMapping(LevelSeverity mapping) { - m_levelMapping.Add(mapping); + this.m_levelMapping.Add(mapping); } #region IOptionHandler Implementation @@ -348,9 +348,9 @@ public override void ActivateOptions() { base.ActivateOptions(); - m_levelMapping.ActivateOptions(); + this.m_levelMapping.ActivateOptions(); - string identString = m_identity; + string identString = this.m_identity; if (identString == null) { // Set to app name by default @@ -360,10 +360,10 @@ public override void ActivateOptions() // create the native heap ansi string. Note this is a copy of our string // so we do not need to hold on to the string itself, holding on to the // handle will keep the heap ansi string alive. - m_handleToIdentity = Marshal.StringToHGlobalAnsi(identString); + this.m_handleToIdentity = Marshal.StringToHGlobalAnsi(identString); // open syslog - openlog(m_handleToIdentity, 1, m_facility); + openlog(this.m_handleToIdentity, 1, this.m_facility); } #endregion // IOptionHandler Implementation @@ -390,8 +390,8 @@ public override void ActivateOptions() #endif protected override void Append(LoggingEvent loggingEvent) { - int priority = GeneratePriority(m_facility, GetSeverity(loggingEvent.Level)); - string message = RenderLoggingEvent(loggingEvent); + int priority = GeneratePriority(this.m_facility, this.GetSeverity(loggingEvent.Level)); + string message = this.RenderLoggingEvent(loggingEvent); // Call the local libc syslog method // The second argument is a printf style format string @@ -423,10 +423,10 @@ protected override void OnClose() // Ignore dll not found at this point } - if (m_handleToIdentity != IntPtr.Zero) + if (this.m_handleToIdentity != IntPtr.Zero) { // free global ident - Marshal.FreeHGlobal(m_handleToIdentity); + Marshal.FreeHGlobal(this.m_handleToIdentity); } } @@ -460,7 +460,7 @@ override protected bool RequiresLayout /// virtual protected SyslogSeverity GetSeverity(Level level) { - LevelSeverity levelSeverity = m_levelMapping.Lookup(level) as LevelSeverity; + LevelSeverity levelSeverity = this.m_levelMapping.Lookup(level) as LevelSeverity; if (levelSeverity != null) { return levelSeverity.Severity; @@ -599,8 +599,8 @@ public class LevelSeverity : LevelMappingEntry /// public SyslogSeverity Severity { - get { return m_severity; } - set { m_severity = value; } + get { return this.m_severity; } + set { this.m_severity = value; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ManagedColoredConsoleAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ManagedColoredConsoleAppender.cs index 551c1a10105..a007e0c7171 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ManagedColoredConsoleAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/ManagedColoredConsoleAppender.cs @@ -132,18 +132,18 @@ public ManagedColoredConsoleAppender() /// virtual public string Target { - get { return m_writeToErrorStream ? ConsoleError : ConsoleOut; } + get { return this.m_writeToErrorStream ? ConsoleError : ConsoleOut; } set { string v = value.Trim(); if (SystemInfo.EqualsIgnoringCase(ConsoleError, v)) { - m_writeToErrorStream = true; + this.m_writeToErrorStream = true; } else { - m_writeToErrorStream = false; + this.m_writeToErrorStream = false; } } } @@ -161,7 +161,7 @@ virtual public string Target /// public void AddMapping(LevelColors mapping) { - m_levelMapping.Add(mapping); + this.m_levelMapping.Add(mapping); } #endregion // Public Instance Properties @@ -182,7 +182,7 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) { System.IO.TextWriter writer; - if (m_writeToErrorStream) + if (this.m_writeToErrorStream) writer = Console.Error; else writer = Console.Out; @@ -191,7 +191,7 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) Console.ResetColor(); // see if there is a specified lookup - LevelColors levelColors = m_levelMapping.Lookup(loggingEvent.Level) as LevelColors; + LevelColors levelColors = this.m_levelMapping.Lookup(loggingEvent.Level) as LevelColors; if (levelColors != null) { // if the backColor has been explicitly set @@ -203,7 +203,7 @@ override protected void Append(log4net.Core.LoggingEvent loggingEvent) } // Render the event to a string - string strLoggingMessage = RenderLoggingEvent(loggingEvent); + string strLoggingMessage = this.RenderLoggingEvent(loggingEvent); // and write it writer.Write(strLoggingMessage); @@ -236,7 +236,7 @@ override protected bool RequiresLayout public override void ActivateOptions() { base.ActivateOptions(); - m_levelMapping.ActivateOptions(); + this.m_levelMapping.ActivateOptions(); } #endregion // Override implementation of AppenderSkeleton @@ -310,7 +310,7 @@ public ConsoleColor ForeColor private bool hasForeColor; internal bool HasForeColor { get { - return hasForeColor; + return this.hasForeColor; } } @@ -334,7 +334,7 @@ public ConsoleColor BackColor private bool hasBackColor; internal bool HasBackColor { get { - return hasBackColor; + return this.hasBackColor; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/MemoryAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/MemoryAppender.cs index 89c2aa63550..3b5be65bad1 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/MemoryAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/MemoryAppender.cs @@ -72,7 +72,7 @@ public class MemoryAppender : AppenderSkeleton /// public MemoryAppender() : base() { - m_eventsList = new ArrayList(); + this.m_eventsList = new ArrayList(); } #endregion Protected Instance Constructors @@ -90,9 +90,9 @@ public MemoryAppender() : base() /// virtual public LoggingEvent[] GetEvents() { - lock (m_eventsList.SyncRoot) + lock (this.m_eventsList.SyncRoot) { - return (LoggingEvent[]) m_eventsList.ToArray(typeof(LoggingEvent)); + return (LoggingEvent[]) this.m_eventsList.ToArray(typeof(LoggingEvent)); } } @@ -116,16 +116,16 @@ virtual public LoggingEvent[] GetEvents() [Obsolete("Use Fix property. Scheduled removal in v10.0.0.")] virtual public bool OnlyFixPartialEventData { - get { return (Fix == FixFlags.Partial); } + get { return (this.Fix == FixFlags.Partial); } set { if (value) { - Fix = FixFlags.Partial; + this.Fix = FixFlags.Partial; } else { - Fix = FixFlags.All; + this.Fix = FixFlags.All; } } } @@ -142,8 +142,8 @@ virtual public bool OnlyFixPartialEventData /// virtual public FixFlags Fix { - get { return m_fixFlags; } - set { m_fixFlags = value; } + get { return this.m_fixFlags; } + set { this.m_fixFlags = value; } } #endregion Public Instance Properties @@ -164,9 +164,9 @@ override protected void Append(LoggingEvent loggingEvent) // volatile data in the event. loggingEvent.Fix = this.Fix; - lock (m_eventsList.SyncRoot) + lock (this.m_eventsList.SyncRoot) { - m_eventsList.Add(loggingEvent); + this.m_eventsList.Add(loggingEvent); } } @@ -182,9 +182,9 @@ override protected void Append(LoggingEvent loggingEvent) /// virtual public void Clear() { - lock (m_eventsList.SyncRoot) + lock (this.m_eventsList.SyncRoot) { - m_eventsList.Clear(); + this.m_eventsList.Clear(); } } @@ -199,10 +199,10 @@ virtual public void Clear() /// virtual public LoggingEvent[] PopAllEvents() { - lock (m_eventsList.SyncRoot) + lock (this.m_eventsList.SyncRoot) { - LoggingEvent[] tmp = (LoggingEvent[]) m_eventsList.ToArray(typeof (LoggingEvent)); - m_eventsList.Clear(); + LoggingEvent[] tmp = (LoggingEvent[]) this.m_eventsList.ToArray(typeof (LoggingEvent)); + this.m_eventsList.Clear(); return tmp; } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/NetSendAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/NetSendAppender.cs index 33acd21d5e6..349eceebcbf 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/NetSendAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/NetSendAppender.cs @@ -197,8 +197,8 @@ public NetSendAppender() /// public string Sender { - get { return m_sender; } - set { m_sender = value; } + get { return this.m_sender; } + set { this.m_sender = value; } } /// @@ -212,8 +212,8 @@ public string Sender /// public string Recipient { - get { return m_recipient; } - set { m_recipient = value; } + get { return this.m_recipient; } + set { this.m_recipient = value; } } /// @@ -232,8 +232,8 @@ public string Recipient /// public string Server { - get { return m_server; } - set { m_server = value; } + get { return this.m_server; } + set { this.m_server = value; } } /// @@ -252,8 +252,8 @@ public string Server /// public SecurityContext SecurityContext { - get { return m_securityContext; } - set { m_securityContext = value; } + get { return this.m_securityContext; } + set { this.m_securityContext = value; } } #endregion @@ -289,9 +289,9 @@ public override void ActivateOptions() throw new ArgumentNullException("Recipient", "The required property 'Recipient' was not specified."); } - if (m_securityContext == null) + if (this.m_securityContext == null) { - m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); + this.m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); } } @@ -319,9 +319,9 @@ protected override void Append(LoggingEvent loggingEvent) NativeError nativeError = null; // Render the event in the callers security context - string renderedLoggingEvent = RenderLoggingEvent(loggingEvent); + string renderedLoggingEvent = this.RenderLoggingEvent(loggingEvent); - using(m_securityContext.Impersonate(this)) + using(this.m_securityContext.Impersonate(this)) { // Send the message int returnValue = NetMessageBufferSend(this.Server, this.Recipient, this.Sender, renderedLoggingEvent, renderedLoggingEvent.Length * Marshal.SystemDefaultCharSize); @@ -337,7 +337,7 @@ protected override void Append(LoggingEvent loggingEvent) if (nativeError != null) { // Handle the error over to the ErrorHandler - ErrorHandler.Error(nativeError.ToString() + " (Params: Server=" + this.Server + ", Recipient=" + this.Recipient + ", Sender=" + this.Sender + ")"); + this.ErrorHandler.Error(nativeError.ToString() + " (Params: Server=" + this.Server + ", Recipient=" + this.Recipient + ", Sender=" + this.Sender + ")"); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/OutputDebugStringAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/OutputDebugStringAppender.cs index e34c4684ddb..9f001df6916 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/OutputDebugStringAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/OutputDebugStringAppender.cs @@ -93,7 +93,7 @@ override protected void Append(LoggingEvent loggingEvent) } #endif - OutputDebugString(RenderLoggingEvent(loggingEvent)); + OutputDebugString(this.RenderLoggingEvent(loggingEvent)); } /// diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemoteSyslogAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemoteSyslogAppender.cs index e9ff6f67140..a9f408320fb 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemoteSyslogAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemoteSyslogAppender.cs @@ -298,8 +298,8 @@ public RemoteSyslogAppender() /// public PatternLayout Identity { - get { return m_identity; } - set { m_identity = value; } + get { return this.m_identity; } + set { this.m_identity = value; } } /// @@ -312,8 +312,8 @@ public PatternLayout Identity /// public SyslogFacility Facility { - get { return m_facility; } - set { m_facility = value; } + get { return this.m_facility; } + set { this.m_facility = value; } } #endregion Public Instance Properties @@ -329,7 +329,7 @@ public SyslogFacility Facility /// public void AddMapping(LevelSeverity mapping) { - m_levelMapping.Add(mapping); + this.m_levelMapping.Add(mapping); } #region AppenderSkeleton Implementation @@ -351,14 +351,14 @@ protected override void Append(LoggingEvent loggingEvent) try { // Priority - int priority = GeneratePriority(m_facility, GetSeverity(loggingEvent.Level)); + int priority = GeneratePriority(this.m_facility, this.GetSeverity(loggingEvent.Level)); // Identity string identity; - if (m_identity != null) + if (this.m_identity != null) { - identity = m_identity.Format(loggingEvent); + identity = this.m_identity.Format(loggingEvent); } else { @@ -366,7 +366,7 @@ protected override void Append(LoggingEvent loggingEvent) } // Message. The message goes after the tag/identity - string message = RenderLoggingEvent(loggingEvent); + string message = this.RenderLoggingEvent(loggingEvent); Byte[] buffer; int i = 0; @@ -422,7 +422,7 @@ protected override void Append(LoggingEvent loggingEvent) } catch (Exception e) { - ErrorHandler.Error( + this.ErrorHandler.Error( "Unable to send logging event to remote syslog " + this.RemoteAddress.ToString() + " on port " + @@ -443,7 +443,7 @@ protected override void Append(LoggingEvent loggingEvent) public override void ActivateOptions() { base.ActivateOptions(); - m_levelMapping.ActivateOptions(); + this.m_levelMapping.ActivateOptions(); } #endregion AppenderSkeleton Implementation @@ -462,7 +462,7 @@ public override void ActivateOptions() /// virtual protected SyslogSeverity GetSeverity(Level level) { - LevelSeverity levelSeverity = m_levelMapping.Lookup(level) as LevelSeverity; + LevelSeverity levelSeverity = this.m_levelMapping.Lookup(level) as LevelSeverity; if (levelSeverity != null) { return levelSeverity.Severity; @@ -590,8 +590,8 @@ public class LevelSeverity : LevelMappingEntry /// public SyslogSeverity Severity { - get { return m_severity; } - set { m_severity = value; } + get { return this.m_severity; } + set { this.m_severity = value; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemotingAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemotingAppender.cs index 8d17012b606..88f911fe87c 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemotingAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RemotingAppender.cs @@ -118,8 +118,8 @@ public RemotingAppender() /// public string Sink { - get { return m_sinkUrl; } - set { m_sinkUrl = value; } + get { return this.m_sinkUrl; } + set { this.m_sinkUrl = value; } } #endregion Public Instance Properties @@ -152,7 +152,7 @@ override public void ActivateOptions() IDictionary channelProperties = new Hashtable(); channelProperties["typeFilterLevel"] = "Full"; - m_sinkObj = (IRemoteLoggingSink)Activator.GetObject(typeof(IRemoteLoggingSink), m_sinkUrl, channelProperties); + this.m_sinkObj = (IRemoteLoggingSink)Activator.GetObject(typeof(IRemoteLoggingSink), this.m_sinkUrl, channelProperties); } #endregion @@ -180,15 +180,15 @@ override public void ActivateOptions() override protected void SendBuffer(LoggingEvent[] events) { // Setup for an async send - BeginAsyncSend(); + this.BeginAsyncSend(); // Send the events - if (!ThreadPool.QueueUserWorkItem(new WaitCallback(SendBufferCallback), events)) + if (!ThreadPool.QueueUserWorkItem(new WaitCallback(this.SendBufferCallback), events)) { // Cancel the async send - EndAsyncSend(); + this.EndAsyncSend(); - ErrorHandler.Error("RemotingAppender ["+Name+"] failed to ThreadPool.QueueUserWorkItem logging events in SendBuffer."); + this.ErrorHandler.Error("RemotingAppender ["+this.Name+"] failed to ThreadPool.QueueUserWorkItem logging events in SendBuffer."); } } @@ -216,9 +216,9 @@ override protected void OnClose() base.OnClose(); // Wait for the work queue to become empty before closing, timeout 30 seconds - if (!m_workQueueEmptyEvent.WaitOne(30 * 1000, false)) + if (!this.m_workQueueEmptyEvent.WaitOne(30 * 1000, false)) { - ErrorHandler.Error("RemotingAppender ["+Name+"] failed to send all queued events before close, in OnClose."); + this.ErrorHandler.Error("RemotingAppender ["+this.Name+"] failed to send all queued events before close, in OnClose."); } } @@ -230,7 +230,7 @@ override protected void OnClose() public override bool Flush(int millisecondsTimeout) { base.Flush(); - return m_workQueueEmptyEvent.WaitOne(millisecondsTimeout, false); + return this.m_workQueueEmptyEvent.WaitOne(millisecondsTimeout, false); } #endregion @@ -241,10 +241,10 @@ public override bool Flush(int millisecondsTimeout) private void BeginAsyncSend() { // The work queue is not empty - m_workQueueEmptyEvent.Reset(); + this.m_workQueueEmptyEvent.Reset(); // Increment the queued count - Interlocked.Increment(ref m_queuedCallbackCount); + Interlocked.Increment(ref this.m_queuedCallbackCount); } /// @@ -253,10 +253,10 @@ private void BeginAsyncSend() private void EndAsyncSend() { // Decrement the queued count - if (Interlocked.Decrement(ref m_queuedCallbackCount) <= 0) + if (Interlocked.Decrement(ref this.m_queuedCallbackCount) <= 0) { // If the work queue is empty then set the event - m_workQueueEmptyEvent.Set(); + this.m_workQueueEmptyEvent.Set(); } } @@ -276,15 +276,15 @@ private void SendBufferCallback(object state) LoggingEvent[] events = (LoggingEvent[])state; // Send the events - m_sinkObj.LogEvents(events); + this.m_sinkObj.LogEvents(events); } catch(Exception ex) { - ErrorHandler.Error("Failed in SendBufferCallback", ex); + this.ErrorHandler.Error("Failed in SendBufferCallback", ex); } finally { - EndAsyncSend(); + this.EndAsyncSend(); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RollingFileAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RollingFileAppender.cs index 47149e515cc..88159f5f5b2 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RollingFileAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/RollingFileAppender.cs @@ -246,14 +246,14 @@ public RollingFileAppender() ~RollingFileAppender() { #if !NETCF - if (m_mutexForRolling != null) + if (this.m_mutexForRolling != null) { #if NET_4_0 || MONO_4_0 || NETSTANDARD1_3 - m_mutexForRolling.Dispose(); + this.m_mutexForRolling.Dispose(); #else m_mutexForRolling.Close(); #endif - m_mutexForRolling = null; + this.m_mutexForRolling = null; } #endif } @@ -304,8 +304,8 @@ public RollingFileAppender() #endif public IDateTime DateTimeStrategy { - get { return m_dateTime; } - set { m_dateTime = value; } + get { return this.m_dateTime; } + set { this.m_dateTime = value; } } /// @@ -328,8 +328,8 @@ public IDateTime DateTimeStrategy /// public string DatePattern { - get { return m_datePattern; } - set { m_datePattern = value; } + get { return this.m_datePattern; } + set { this.m_datePattern = value; } } /// @@ -357,8 +357,8 @@ public string DatePattern /// public int MaxSizeRollBackups { - get { return m_maxSizeRollBackups; } - set { m_maxSizeRollBackups = value; } + get { return this.m_maxSizeRollBackups; } + set { this.m_maxSizeRollBackups = value; } } /// @@ -382,8 +382,8 @@ public int MaxSizeRollBackups /// public long MaxFileSize { - get { return m_maxFileSize; } - set { m_maxFileSize = value; } + get { return this.m_maxFileSize; } + set { this.m_maxFileSize = value; } } /// @@ -414,8 +414,8 @@ public long MaxFileSize /// public string MaximumFileSize { - get { return m_maxFileSize.ToString(NumberFormatInfo.InvariantInfo); } - set { m_maxFileSize = OptionConverter.ToFileSize(value, m_maxFileSize + 1); } + get { return this.m_maxFileSize.ToString(NumberFormatInfo.InvariantInfo); } + set { this.m_maxFileSize = OptionConverter.ToFileSize(value, this.m_maxFileSize + 1); } } /// @@ -443,8 +443,8 @@ public string MaximumFileSize /// public int CountDirection { - get { return m_countDirection; } - set { m_countDirection = value; } + get { return this.m_countDirection; } + set { this.m_countDirection = value; } } /// @@ -464,32 +464,32 @@ public int CountDirection /// public RollingMode RollingStyle { - get { return m_rollingStyle; } + get { return this.m_rollingStyle; } set { - m_rollingStyle = value; - switch (m_rollingStyle) + this.m_rollingStyle = value; + switch (this.m_rollingStyle) { case RollingMode.Once: - m_rollDate = false; - m_rollSize = false; + this.m_rollDate = false; + this.m_rollSize = false; this.AppendToFile = false; break; case RollingMode.Size: - m_rollDate = false; - m_rollSize = true; + this.m_rollDate = false; + this.m_rollSize = true; break; case RollingMode.Date: - m_rollDate = true; - m_rollSize = false; + this.m_rollDate = true; + this.m_rollSize = false; break; case RollingMode.Composite: - m_rollDate = true; - m_rollSize = true; + this.m_rollDate = true; + this.m_rollSize = true; break; } } @@ -511,8 +511,8 @@ public RollingMode RollingStyle /// public bool PreserveLogFileNameExtension { - get { return m_preserveLogFileNameExtension; } - set { m_preserveLogFileNameExtension = value; } + get { return this.m_preserveLogFileNameExtension; } + set { this.m_preserveLogFileNameExtension = value; } } /// @@ -536,8 +536,8 @@ public bool PreserveLogFileNameExtension /// public bool StaticLogFileName { - get { return m_staticLogFileName; } - set { m_staticLogFileName = value; } + get { return this.m_staticLogFileName; } + set { this.m_staticLogFileName = value; } } #endregion Public Instance Properties @@ -566,7 +566,7 @@ public bool StaticLogFileName /// the writer to set override protected void SetQWForFiles(TextWriter writer) { - QuietWriter = new CountingQuietTextWriter(writer, ErrorHandler); + this.QuietWriter = new CountingQuietTextWriter(writer, this.ErrorHandler); } /// @@ -582,7 +582,7 @@ override protected void SetQWForFiles(TextWriter writer) /// override protected void Append(LoggingEvent loggingEvent) { - AdjustFileBeforeAppend(); + this.AdjustFileBeforeAppend(); base.Append(loggingEvent); } @@ -599,7 +599,7 @@ override protected void Append(LoggingEvent loggingEvent) /// override protected void Append(LoggingEvent[] loggingEvents) { - AdjustFileBeforeAppend(); + this.AdjustFileBeforeAppend(); base.Append(loggingEvents); } @@ -620,28 +620,28 @@ virtual protected void AdjustFileBeforeAppend() try { // if rolling should be locked, acquire the lock - if (m_mutexForRolling != null) + if (this.m_mutexForRolling != null) { - m_mutexForRolling.WaitOne(); + this.m_mutexForRolling.WaitOne(); } #endif - if (m_rollDate) + if (this.m_rollDate) { - DateTime n = m_dateTime.Now; - if (n >= m_nextCheck) + DateTime n = this.m_dateTime.Now; + if (n >= this.m_nextCheck) { - m_now = n; - m_nextCheck = NextCheckDate(m_now, m_rollPoint); + this.m_now = n; + this.m_nextCheck = this.NextCheckDate(this.m_now, this.m_rollPoint); - RollOverTime(true); + this.RollOverTime(true); } } - if (m_rollSize) + if (this.m_rollSize) { - if ((File != null) && ((CountingQuietTextWriter)QuietWriter).Count >= m_maxFileSize) + if ((this.File != null) && ((CountingQuietTextWriter)this.QuietWriter).Count >= this.m_maxFileSize) { - RollOverSize(); + this.RollOverSize(); } } #if !NETCF @@ -649,9 +649,9 @@ virtual protected void AdjustFileBeforeAppend() finally { // if rolling should be locked, release the lock - if (m_mutexForRolling != null) + if (this.m_mutexForRolling != null) { - m_mutexForRolling.ReleaseMutex(); + this.m_mutexForRolling.ReleaseMutex(); } } #endif @@ -671,13 +671,13 @@ override protected void OpenFile(string fileName, bool append) { lock(this) { - fileName = GetNextOutputFileName(fileName); + fileName = this.GetNextOutputFileName(fileName); // Calculate the current size of the file long currentCount = 0; if (append) { - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { if (System.IO.File.Exists(fileName)) { @@ -693,23 +693,23 @@ override protected void OpenFile(string fileName, bool append) // If not Appending to an existing file we should have rolled the file out of the // way. Therefore we should not be over-writing an existing file. // The only exception is if we are not allowed to roll the existing file away. - if (m_maxSizeRollBackups != 0 && FileExists(fileName)) + if (this.m_maxSizeRollBackups != 0 && this.FileExists(fileName)) { LogLog.Error(declaringType, "RollingFileAppender: INTERNAL ERROR. Append is False but OutputFile ["+fileName+"] already exists."); } } } - if (!m_staticLogFileName) + if (!this.m_staticLogFileName) { - m_scheduledFilename = fileName; + this.m_scheduledFilename = fileName; } // Open the file (call the base class to do it) base.OpenFile(fileName, append); // Set the file size onto the counting writer - ((CountingQuietTextWriter)QuietWriter).Count = currentCount; + ((CountingQuietTextWriter)this.QuietWriter).Count = currentCount; } } @@ -727,18 +727,18 @@ override protected void OpenFile(string fileName, bool append) /// protected string GetNextOutputFileName(string fileName) { - if (!m_staticLogFileName) + if (!this.m_staticLogFileName) { fileName = fileName.Trim(); - if (m_rollDate) + if (this.m_rollDate) { - fileName = CombinePath(fileName, m_now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); + fileName = this.CombinePath(fileName, this.m_now.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); } - if (m_countDirection >= 0) + if (this.m_countDirection >= 0) { - fileName = CombinePath(fileName, "." + m_curSizeRollBackups); + fileName = this.CombinePath(fileName, "." + this.m_curSizeRollBackups); } } @@ -754,21 +754,21 @@ protected string GetNextOutputFileName(string fileName) /// private void DetermineCurSizeRollBackups() { - m_curSizeRollBackups = 0; + this.m_curSizeRollBackups = 0; string fullPath = null; string fileName = null; - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { - fullPath = System.IO.Path.GetFullPath(m_baseFileName); + fullPath = System.IO.Path.GetFullPath(this.m_baseFileName); fileName = System.IO.Path.GetFileName(fullPath); } - ArrayList arrayFiles = GetExistingFiles(fullPath); - InitializeRollBackups(fileName, arrayFiles); + ArrayList arrayFiles = this.GetExistingFiles(fullPath); + this.InitializeRollBackups(fileName, arrayFiles); - LogLog.Debug(declaringType, "curSizeRollBackups starts at ["+m_curSizeRollBackups+"]"); + LogLog.Debug(declaringType, "curSizeRollBackups starts at ["+this.m_curSizeRollBackups+"]"); } /// @@ -779,7 +779,7 @@ private void DetermineCurSizeRollBackups() /// private string GetWildcardPatternForFile(string baseFileName) { - if (m_preserveLogFileNameExtension) + if (this.m_preserveLogFileNameExtension) { return Path.GetFileNameWithoutExtension(baseFileName) + "*" + Path.GetExtension(baseFileName); } @@ -801,7 +801,7 @@ private ArrayList GetExistingFiles(string baseFilePath) string directory = null; - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { string fullPath = Path.GetFullPath(baseFilePath); @@ -810,7 +810,7 @@ private ArrayList GetExistingFiles(string baseFilePath) { string baseFileName = Path.GetFileName(fullPath); - string[] files = Directory.GetFiles(directory, GetWildcardPatternForFile(baseFileName)); + string[] files = Directory.GetFiles(directory, this.GetWildcardPatternForFile(baseFileName)); if (files != null) { @@ -834,33 +834,33 @@ private ArrayList GetExistingFiles(string baseFilePath) /// private void RollOverIfDateBoundaryCrossing() { - if (m_staticLogFileName && m_rollDate) + if (this.m_staticLogFileName && this.m_rollDate) { - if (FileExists(m_baseFileName)) + if (this.FileExists(this.m_baseFileName)) { DateTime last; - using(SecurityContext.Impersonate(this)) { + using(this.SecurityContext.Impersonate(this)) { #if !NET_1_0 && !CLI_1_0 && !NETCF - if (DateTimeStrategy is UniversalDateTime) + if (this.DateTimeStrategy is UniversalDateTime) { - last = System.IO.File.GetLastWriteTimeUtc(m_baseFileName); + last = System.IO.File.GetLastWriteTimeUtc(this.m_baseFileName); } else { #endif - last = System.IO.File.GetLastWriteTime(m_baseFileName); + last = System.IO.File.GetLastWriteTime(this.m_baseFileName); #if !NET_1_0 && !CLI_1_0 && !NETCF } #endif } - LogLog.Debug(declaringType, "["+last.ToString(m_datePattern,System.Globalization.DateTimeFormatInfo.InvariantInfo)+"] vs. ["+m_now.ToString(m_datePattern,System.Globalization.DateTimeFormatInfo.InvariantInfo)+"]"); + LogLog.Debug(declaringType, "["+last.ToString(this.m_datePattern,System.Globalization.DateTimeFormatInfo.InvariantInfo)+"] vs. ["+this.m_now.ToString(this.m_datePattern,System.Globalization.DateTimeFormatInfo.InvariantInfo)+"]"); - if (!(last.ToString(m_datePattern,System.Globalization.DateTimeFormatInfo.InvariantInfo).Equals(m_now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))) + if (!(last.ToString(this.m_datePattern,System.Globalization.DateTimeFormatInfo.InvariantInfo).Equals(this.m_now.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)))) { - m_scheduledFilename = CombinePath(m_baseFileName, last.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); - LogLog.Debug(declaringType, "Initial roll over to ["+m_scheduledFilename+"]"); - RollOverTime(false); - LogLog.Debug(declaringType, "curSizeRollBackups after rollOver at ["+m_curSizeRollBackups+"]"); + this.m_scheduledFilename = this.CombinePath(this.m_baseFileName, last.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); + LogLog.Debug(declaringType, "Initial roll over to ["+this.m_scheduledFilename+"]"); + this.RollOverTime(false); + LogLog.Debug(declaringType, "curSizeRollBackups after rollOver at ["+this.m_curSizeRollBackups+"]"); } } } @@ -881,23 +881,23 @@ private void RollOverIfDateBoundaryCrossing() /// protected void ExistingInit() { - DetermineCurSizeRollBackups(); - RollOverIfDateBoundaryCrossing(); + this.DetermineCurSizeRollBackups(); + this.RollOverIfDateBoundaryCrossing(); // If file exists and we are not appending then roll it out of the way - if (AppendToFile == false) + if (this.AppendToFile == false) { bool fileExists = false; - string fileName = GetNextOutputFileName(m_baseFileName); + string fileName = this.GetNextOutputFileName(this.m_baseFileName); - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { fileExists = System.IO.File.Exists(fileName); } if (fileExists) { - if (m_maxSizeRollBackups == 0) + if (this.m_maxSizeRollBackups == 0) { LogLog.Debug(declaringType, "Output file ["+fileName+"] already exists. MaxSizeRollBackups is 0; cannot roll. Overwriting existing file."); } @@ -905,7 +905,7 @@ protected void ExistingInit() { LogLog.Debug(declaringType, "Output file ["+fileName+"] already exists. Not appending to file. Rolling existing file out of the way."); - RollOverRenameFiles(fileName); + this.RollOverRenameFiles(fileName); } } } @@ -946,11 +946,11 @@ private void InitializeFromOneFile(string baseFile, string curFileName) */ // Only look for files in the current roll point - if (m_rollDate && !m_staticLogFileName) + if (this.m_rollDate && !this.m_staticLogFileName) { - string date = m_dateTime.Now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo); - string prefix = m_preserveLogFileNameExtension ? Path.GetFileNameWithoutExtension(baseFile) + date : baseFile + date; - string suffix = m_preserveLogFileNameExtension ? Path.GetExtension(baseFile) : ""; + string date = this.m_dateTime.Now.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo); + string prefix = this.m_preserveLogFileNameExtension ? Path.GetFileNameWithoutExtension(baseFile) + date : baseFile + date; + string suffix = this.m_preserveLogFileNameExtension ? Path.GetExtension(baseFile) : ""; if (!curFileName.StartsWith(prefix) || !curFileName.EndsWith(suffix)) { LogLog.Debug(declaringType, "Ignoring file ["+curFileName+"] because it is from a different date period"); @@ -961,41 +961,41 @@ private void InitializeFromOneFile(string baseFile, string curFileName) try { // Bump the counter up to the highest count seen so far - int backup = GetBackUpIndex(curFileName); + int backup = this.GetBackUpIndex(curFileName); // caution: we might get a false positive when certain // date patterns such as yyyyMMdd are used...those are // valid number but aren't the kind of back up index // we're looking for - if (backup > m_curSizeRollBackups) + if (backup > this.m_curSizeRollBackups) { - if (0 == m_maxSizeRollBackups) + if (0 == this.m_maxSizeRollBackups) { // Stay at zero when zero backups are desired } - else if (-1 == m_maxSizeRollBackups) + else if (-1 == this.m_maxSizeRollBackups) { // Infinite backups, so go as high as the highest value - m_curSizeRollBackups = backup; + this.m_curSizeRollBackups = backup; } else { // Backups limited to a finite number - if (m_countDirection >= 0) + if (this.m_countDirection >= 0) { // Go with the highest file when counting up - m_curSizeRollBackups = backup; + this.m_curSizeRollBackups = backup; } else { // Clip to the limit when counting down - if (backup <= m_maxSizeRollBackups) + if (backup <= this.m_maxSizeRollBackups) { - m_curSizeRollBackups = backup; + this.m_curSizeRollBackups = backup; } } } - LogLog.Debug(declaringType, "File name [" + curFileName + "] moves current count to [" + m_curSizeRollBackups + "]"); + LogLog.Debug(declaringType, "File name [" + curFileName + "] moves current count to [" + this.m_curSizeRollBackups + "]"); } } catch(FormatException) @@ -1020,7 +1020,7 @@ private int GetBackUpIndex(string curFileName) int backUpIndex = -1; string fileName = curFileName; - if (m_preserveLogFileNameExtension) + if (this.m_preserveLogFileNameExtension) { fileName = Path.GetFileNameWithoutExtension(fileName); } @@ -1051,7 +1051,7 @@ private void InitializeRollBackups(string baseFile, ArrayList arrayFiles) foreach(string curFileName in arrayFiles) { - InitializeFromOneFile(baseFileLower, curFileName.ToLower(System.Globalization.CultureInfo.InvariantCulture)); + this.InitializeFromOneFile(baseFileLower, curFileName.ToLower(System.Globalization.CultureInfo.InvariantCulture)); } } } @@ -1082,7 +1082,7 @@ private RollPoint ComputeCheckPeriod(string datePattern) for(int i = (int)RollPoint.TopOfMinute; i <= (int)RollPoint.TopOfMonth; i++) { // Get string representation of next pattern - string r1 = NextCheckDate(s_date1970, (RollPoint)i).ToString(datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo); + string r1 = this.NextCheckDate(s_date1970, (RollPoint)i).ToString(datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo); LogLog.Debug(declaringType, "Type = ["+i+"], r0 = ["+r0+"], r1 = ["+r1+"]"); @@ -1120,38 +1120,38 @@ private RollPoint ComputeCheckPeriod(string datePattern) /// override public void ActivateOptions() { - if (m_dateTime == null) + if (this.m_dateTime == null) { - m_dateTime = new LocalDateTime(); + this.m_dateTime = new LocalDateTime(); } - if (m_rollDate && m_datePattern != null) + if (this.m_rollDate && this.m_datePattern != null) { - m_now = m_dateTime.Now; - m_rollPoint = ComputeCheckPeriod(m_datePattern); + this.m_now = this.m_dateTime.Now; + this.m_rollPoint = this.ComputeCheckPeriod(this.m_datePattern); - if (m_rollPoint == RollPoint.InvalidRollPoint) + if (this.m_rollPoint == RollPoint.InvalidRollPoint) { - throw new ArgumentException("Invalid RollPoint, unable to parse ["+m_datePattern+"]"); + throw new ArgumentException("Invalid RollPoint, unable to parse ["+this.m_datePattern+"]"); } // next line added as this removes the name check in rollOver - m_nextCheck = NextCheckDate(m_now, m_rollPoint); + this.m_nextCheck = this.NextCheckDate(this.m_now, this.m_rollPoint); } else { - if (m_rollDate) + if (this.m_rollDate) { - ErrorHandler.Error("Either DatePattern or rollingStyle options are not set for ["+Name+"]."); + this.ErrorHandler.Error("Either DatePattern or rollingStyle options are not set for ["+this.Name+"]."); } } - if (SecurityContext == null) + if (this.SecurityContext == null) { - SecurityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); + this.SecurityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); } - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { // Must convert the FileAppender's m_filePath to an absolute path before we // call ExistingInit(). This will be done by the base.ActivateOptions() but @@ -1159,20 +1159,20 @@ override public void ActivateOptions() base.File = ConvertToFullPath(base.File.Trim()); // Store fully qualified base file name - m_baseFileName = base.File; + this.m_baseFileName = base.File; } #if !NETCF // initialize the mutex that is used to lock rolling - m_mutexForRolling = new Mutex(false, m_baseFileName.Replace("\\", "_").Replace(":", "_").Replace("/", "_")); + this.m_mutexForRolling = new Mutex(false, this.m_baseFileName.Replace("\\", "_").Replace(":", "_").Replace("/", "_")); #endif - if (m_rollDate && File != null && m_scheduledFilename == null) + if (this.m_rollDate && this.File != null && this.m_scheduledFilename == null) { - m_scheduledFilename = CombinePath(File, m_now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); + this.m_scheduledFilename = this.CombinePath(this.File, this.m_now.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); } - ExistingInit(); + this.ExistingInit(); base.ActivateOptions(); } @@ -1190,7 +1190,7 @@ override public void ActivateOptions() private string CombinePath(string path1, string path2) { string extension = Path.GetExtension(path1); - if (m_preserveLogFileNameExtension && extension.Length > 0) + if (this.m_preserveLogFileNameExtension && extension.Length > 0) { return Path.Combine(Path.GetDirectoryName(path1), Path.GetFileNameWithoutExtension(path1) + path2 + extension); } @@ -1213,22 +1213,22 @@ private string CombinePath(string path1, string path2) /// protected void RollOverTime(bool fileIsOpen) { - if (m_staticLogFileName) + if (this.m_staticLogFileName) { // Compute filename, but only if datePattern is specified - if (m_datePattern == null) + if (this.m_datePattern == null) { - ErrorHandler.Error("Missing DatePattern option in rollOver()."); + this.ErrorHandler.Error("Missing DatePattern option in rollOver()."); return; } //is the new file name equivalent to the 'current' one //something has gone wrong if we hit this -- we should only //roll over if the new file will be different from the old - string dateFormat = m_now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo); - if (m_scheduledFilename.Equals(CombinePath(File, dateFormat))) + string dateFormat = this.m_now.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo); + if (this.m_scheduledFilename.Equals(this.CombinePath(this.File, dateFormat))) { - ErrorHandler.Error("Compare " + m_scheduledFilename + " : " + CombinePath(File, dateFormat)); + this.ErrorHandler.Error("Compare " + this.m_scheduledFilename + " : " + this.CombinePath(this.File, dateFormat)); return; } @@ -1239,26 +1239,26 @@ protected void RollOverTime(bool fileIsOpen) } //we may have to roll over a large number of backups here - for (int i = 1; i <= m_curSizeRollBackups; i++) + for (int i = 1; i <= this.m_curSizeRollBackups; i++) { - string from = CombinePath(File, "." + i); - string to = CombinePath(m_scheduledFilename, "." + i); - RollFile(from, to); + string from = this.CombinePath(this.File, "." + i); + string to = this.CombinePath(this.m_scheduledFilename, "." + i); + this.RollFile(from, to); } - RollFile(File, m_scheduledFilename); + this.RollFile(this.File, this.m_scheduledFilename); } //We've cleared out the old date and are ready for the new - m_curSizeRollBackups = 0; + this.m_curSizeRollBackups = 0; //new scheduled name - m_scheduledFilename = CombinePath(File, m_now.ToString(m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); + this.m_scheduledFilename = this.CombinePath(this.File, this.m_now.ToString(this.m_datePattern, System.Globalization.DateTimeFormatInfo.InvariantInfo)); if (fileIsOpen) { // This will also close the file. This is OK since multiple close operations are safe. - SafeOpenFile(m_baseFileName, false); + this.SafeOpenFile(this.m_baseFileName, false); } } @@ -1275,23 +1275,23 @@ protected void RollOverTime(bool fileIsOpen) /// protected void RollFile(string fromFile, string toFile) { - if (FileExists(fromFile)) + if (this.FileExists(fromFile)) { // Delete the toFile if it exists - DeleteFile(toFile); + this.DeleteFile(toFile); // We may not have permission to move the file, or the file may be locked try { LogLog.Debug(declaringType, "Moving [" + fromFile + "] -> [" + toFile + "]"); - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { System.IO.File.Move(fromFile, toFile); } } catch(Exception moveEx) { - ErrorHandler.Error("Exception while rolling file [" + fromFile + "] -> [" + toFile + "]", moveEx, ErrorCode.GenericFailure); + this.ErrorHandler.Error("Exception while rolling file [" + fromFile + "] -> [" + toFile + "]", moveEx, ErrorCode.GenericFailure); } } else @@ -1312,7 +1312,7 @@ protected void RollFile(string fromFile, string toFile) /// protected bool FileExists(string path) { - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { return System.IO.File.Exists(path); } @@ -1332,7 +1332,7 @@ protected bool FileExists(string path) /// protected void DeleteFile(string fileName) { - if (FileExists(fileName)) + if (this.FileExists(fileName)) { // We may not have permission to delete the file, or the file may be locked @@ -1343,7 +1343,7 @@ protected void DeleteFile(string fileName) string tempFileName = fileName + "." + Environment.TickCount + ".DeletePending"; try { - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { System.IO.File.Move(fileName, tempFileName); } @@ -1357,7 +1357,7 @@ protected void DeleteFile(string fileName) // Try to delete the file (either the original or the moved file) try { - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { System.IO.File.Delete(fileToDelete); } @@ -1368,7 +1368,7 @@ protected void DeleteFile(string fileName) if (fileToDelete == fileName) { // Unable to move or delete the file - ErrorHandler.Error("Exception while deleting file [" + fileToDelete + "]", deleteEx, ErrorCode.GenericFailure); + this.ErrorHandler.Error("Exception while deleting file [" + fileToDelete + "]", deleteEx, ErrorCode.GenericFailure); } else { @@ -1410,20 +1410,20 @@ protected void RollOverSize() { this.CloseFile(); // keep windows happy. - LogLog.Debug(declaringType, "rolling over count ["+((CountingQuietTextWriter)QuietWriter).Count+"]"); - LogLog.Debug(declaringType, "maxSizeRollBackups ["+m_maxSizeRollBackups+"]"); - LogLog.Debug(declaringType, "curSizeRollBackups ["+m_curSizeRollBackups+"]"); - LogLog.Debug(declaringType, "countDirection ["+m_countDirection+"]"); + LogLog.Debug(declaringType, "rolling over count ["+((CountingQuietTextWriter)this.QuietWriter).Count+"]"); + LogLog.Debug(declaringType, "maxSizeRollBackups ["+this.m_maxSizeRollBackups+"]"); + LogLog.Debug(declaringType, "curSizeRollBackups ["+this.m_curSizeRollBackups+"]"); + LogLog.Debug(declaringType, "countDirection ["+this.m_countDirection+"]"); - RollOverRenameFiles(File); + this.RollOverRenameFiles(this.File); - if (!m_staticLogFileName && m_countDirection >= 0) + if (!this.m_staticLogFileName && this.m_countDirection >= 0) { - m_curSizeRollBackups++; + this.m_curSizeRollBackups++; } // This will also close the file. This is OK since multiple close operations are safe. - SafeOpenFile(m_baseFileName, false); + this.SafeOpenFile(this.m_baseFileName, false); } /// @@ -1455,38 +1455,38 @@ protected void RollOverSize() protected void RollOverRenameFiles(string baseFileName) { // If maxBackups <= 0, then there is no file renaming to be done. - if (m_maxSizeRollBackups != 0) + if (this.m_maxSizeRollBackups != 0) { - if (m_countDirection < 0) + if (this.m_countDirection < 0) { // Delete the oldest file, to keep Windows happy. - if (m_curSizeRollBackups == m_maxSizeRollBackups) + if (this.m_curSizeRollBackups == this.m_maxSizeRollBackups) { - DeleteFile(CombinePath(baseFileName, "." + m_maxSizeRollBackups)); - m_curSizeRollBackups--; + this.DeleteFile(this.CombinePath(baseFileName, "." + this.m_maxSizeRollBackups)); + this.m_curSizeRollBackups--; } // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2} - for (int i = m_curSizeRollBackups; i >= 1; i--) + for (int i = this.m_curSizeRollBackups; i >= 1; i--) { - RollFile((CombinePath(baseFileName, "." + i)), (CombinePath(baseFileName, "." + (i + 1)))); + this.RollFile((this.CombinePath(baseFileName, "." + i)), (this.CombinePath(baseFileName, "." + (i + 1)))); } - m_curSizeRollBackups++; + this.m_curSizeRollBackups++; // Rename fileName to fileName.1 - RollFile(baseFileName, CombinePath(baseFileName, ".1")); + this.RollFile(baseFileName, this.CombinePath(baseFileName, ".1")); } else { //countDirection >= 0 - if (m_curSizeRollBackups >= m_maxSizeRollBackups && m_maxSizeRollBackups > 0) + if (this.m_curSizeRollBackups >= this.m_maxSizeRollBackups && this.m_maxSizeRollBackups > 0) { //delete the first and keep counting up. - int oldestFileIndex = m_curSizeRollBackups - m_maxSizeRollBackups; + int oldestFileIndex = this.m_curSizeRollBackups - this.m_maxSizeRollBackups; // If static then there is 1 file without a number, therefore 1 less archive - if (m_staticLogFileName) + if (this.m_staticLogFileName) { oldestFileIndex++; } @@ -1495,7 +1495,7 @@ protected void RollOverRenameFiles(string baseFileName) // If not using a static log file then the baseFileName will already have a numbered postfix which // we must remove, however it may have a date postfix which we must keep! string archiveFileBaseName = baseFileName; - if (!m_staticLogFileName) + if (!this.m_staticLogFileName) { int lastDotIndex = archiveFileBaseName.LastIndexOf("."); if (lastDotIndex >= 0) @@ -1505,13 +1505,13 @@ protected void RollOverRenameFiles(string baseFileName) } // Delete the archive file - DeleteFile(CombinePath(archiveFileBaseName, "." + oldestFileIndex)); + this.DeleteFile(this.CombinePath(archiveFileBaseName, "." + oldestFileIndex)); } - if (m_staticLogFileName) + if (this.m_staticLogFileName) { - m_curSizeRollBackups++; - RollFile(baseFileName, CombinePath(baseFileName, "." + m_curSizeRollBackups)); + this.m_curSizeRollBackups++; + this.RollFile(baseFileName, this.CombinePath(baseFileName, "." + this.m_curSizeRollBackups)); } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpAppender.cs index c66747a01e8..03b83ceb2b9 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpAppender.cs @@ -114,8 +114,8 @@ public SmtpAppender() /// public string To { - get { return m_to; } - set { m_to = MaybeTrimSeparators(value); } + get { return this.m_to; } + set { this.m_to = MaybeTrimSeparators(value); } } /// @@ -140,8 +140,8 @@ public string To /// public string Cc { - get { return m_cc; } - set { m_cc = MaybeTrimSeparators(value); } + get { return this.m_cc; } + set { this.m_cc = MaybeTrimSeparators(value); } } /// @@ -158,8 +158,8 @@ public string Cc /// public string Bcc { - get { return m_bcc; } - set { m_bcc = MaybeTrimSeparators(value); } + get { return this.m_bcc; } + set { this.m_bcc = MaybeTrimSeparators(value); } } /// @@ -175,8 +175,8 @@ public string Bcc /// public string From { - get { return m_from; } - set { m_from = value; } + get { return this.m_from; } + set { this.m_from = value; } } /// @@ -192,8 +192,8 @@ public string From /// public string Subject { - get { return m_subject; } - set { m_subject = value; } + get { return this.m_subject; } + set { this.m_subject = value; } } /// @@ -212,8 +212,8 @@ public string Subject /// public string SmtpHost { - get { return m_smtpHost; } - set { m_smtpHost = value; } + get { return this.m_smtpHost; } + set { this.m_smtpHost = value; } } /// @@ -251,8 +251,8 @@ public bool LocationInfo /// public SmtpAuthentication Authentication { - get { return m_authentication; } - set { m_authentication = value; } + get { return this.m_authentication; } + set { this.m_authentication = value; } } /// @@ -268,8 +268,8 @@ public SmtpAuthentication Authentication /// public string Username { - get { return m_username; } - set { m_username = value; } + get { return this.m_username; } + set { this.m_username = value; } } /// @@ -285,8 +285,8 @@ public string Username /// public string Password { - get { return m_password; } - set { m_password = value; } + get { return this.m_password; } + set { this.m_password = value; } } /// @@ -302,8 +302,8 @@ public string Password /// public int Port { - get { return m_port; } - set { m_port = value; } + get { return this.m_port; } + set { this.m_port = value; } } /// @@ -324,8 +324,8 @@ public int Port /// public MailPriority Priority { - get { return m_mailPriority; } - set { m_mailPriority = value; } + get { return this.m_mailPriority; } + set { this.m_mailPriority = value; } } #if NET_2_0 || MONO_2_0 @@ -337,8 +337,8 @@ public MailPriority Priority /// public bool EnableSsl { - get { return m_enableSsl; } - set { m_enableSsl = value; } + get { return this.m_enableSsl; } + set { this.m_enableSsl = value; } } /// @@ -349,8 +349,8 @@ public bool EnableSsl /// public string ReplyTo { - get { return m_replyTo; } - set { m_replyTo = value; } + get { return this.m_replyTo; } + set { this.m_replyTo = value; } } #endif @@ -362,8 +362,8 @@ public string ReplyTo /// public Encoding SubjectEncoding { - get { return m_subjectEncoding; } - set { m_subjectEncoding = value; } + get { return this.m_subjectEncoding; } + set { this.m_subjectEncoding = value; } } /// @@ -374,8 +374,8 @@ public Encoding SubjectEncoding /// public Encoding BodyEncoding { - get { return m_bodyEncoding; } - set { m_bodyEncoding = value; } + get { return this.m_bodyEncoding; } + set { this.m_bodyEncoding = value; } } #endregion // Public Instance Properties @@ -394,7 +394,7 @@ override protected void SendBuffer(LoggingEvent[] events) { StringWriter writer = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - string t = Layout.Header; + string t = this.Layout.Header; if (t != null) { writer.Write(t); @@ -403,20 +403,20 @@ override protected void SendBuffer(LoggingEvent[] events) for(int i = 0; i < events.Length; i++) { // Render the event and append the text to the buffer - RenderLoggingEvent(writer, events[i]); + this.RenderLoggingEvent(writer, events[i]); } - t = Layout.Footer; + t = this.Layout.Footer; if (t != null) { writer.Write(t); } - SendEmail(writer.ToString()); + this.SendEmail(writer.ToString()); } catch(Exception e) { - ErrorHandler.Error("Error occurred while sending e-mail notification.", e); + this.ErrorHandler.Error("Error occurred while sending e-mail notification.", e); } } @@ -455,20 +455,20 @@ virtual protected void SendEmail(string messageBody) // Create and configure the smtp client SmtpClient smtpClient = new SmtpClient(); - if (!String.IsNullOrEmpty(m_smtpHost)) + if (!String.IsNullOrEmpty(this.m_smtpHost)) { - smtpClient.Host = m_smtpHost; + smtpClient.Host = this.m_smtpHost; } - smtpClient.Port = m_port; + smtpClient.Port = this.m_port; smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; - smtpClient.EnableSsl = m_enableSsl; + smtpClient.EnableSsl = this.m_enableSsl; - if (m_authentication == SmtpAuthentication.Basic) + if (this.m_authentication == SmtpAuthentication.Basic) { // Perform basic authentication - smtpClient.Credentials = new System.Net.NetworkCredential(m_username, m_password); + smtpClient.Credentials = new System.Net.NetworkCredential(this.m_username, this.m_password); } - else if (m_authentication == SmtpAuthentication.Ntlm) + else if (this.m_authentication == SmtpAuthentication.Ntlm) { // Perform integrated authentication (NTLM) smtpClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; @@ -477,30 +477,30 @@ virtual protected void SendEmail(string messageBody) using (MailMessage mailMessage = new MailMessage()) { mailMessage.Body = messageBody; - mailMessage.BodyEncoding = m_bodyEncoding; - mailMessage.From = new MailAddress(m_from); - mailMessage.To.Add(m_to); - if (!String.IsNullOrEmpty(m_cc)) + mailMessage.BodyEncoding = this.m_bodyEncoding; + mailMessage.From = new MailAddress(this.m_from); + mailMessage.To.Add(this.m_to); + if (!String.IsNullOrEmpty(this.m_cc)) { - mailMessage.CC.Add(m_cc); + mailMessage.CC.Add(this.m_cc); } - if (!String.IsNullOrEmpty(m_bcc)) + if (!String.IsNullOrEmpty(this.m_bcc)) { - mailMessage.Bcc.Add(m_bcc); + mailMessage.Bcc.Add(this.m_bcc); } - if (!String.IsNullOrEmpty(m_replyTo)) + if (!String.IsNullOrEmpty(this.m_replyTo)) { // .NET 4.0 warning CS0618: 'System.Net.Mail.MailMessage.ReplyTo' is obsolete: // 'ReplyTo is obsoleted for this type. Please use ReplyToList instead which can accept multiple addresses. http://go.microsoft.com/fwlink/?linkid=14202' #if !NET_4_0 && !MONO_4_0 mailMessage.ReplyTo = new MailAddress(m_replyTo); #else - mailMessage.ReplyToList.Add(new MailAddress(m_replyTo)); + mailMessage.ReplyToList.Add(new MailAddress(this.m_replyTo)); #endif } - mailMessage.Subject = m_subject; - mailMessage.SubjectEncoding = m_subjectEncoding; - mailMessage.Priority = m_mailPriority; + mailMessage.Subject = this.m_subject; + mailMessage.SubjectEncoding = this.m_subjectEncoding; + mailMessage.Priority = this.m_mailPriority; // TODO: Consider using SendAsync to send the message without blocking. This would be a change in // behaviour compared to .NET 1.x. We would need a SendCompletedCallback to log errors. diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpPickupDirAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpPickupDirAppender.cs index 66eedf87fa0..8082f2fc340 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpPickupDirAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/SmtpPickupDirAppender.cs @@ -68,7 +68,7 @@ public class SmtpPickupDirAppender : BufferingAppenderSkeleton /// public SmtpPickupDirAppender() { - m_fileExtension = string.Empty; // Default to empty string, not null + this.m_fileExtension = string.Empty; // Default to empty string, not null } #endregion Public Instance Constructors @@ -88,8 +88,8 @@ public SmtpPickupDirAppender() /// public string To { - get { return m_to; } - set { m_to = value; } + get { return this.m_to; } + set { this.m_to = value; } } /// @@ -105,8 +105,8 @@ public string To /// public string From { - get { return m_from; } - set { m_from = value; } + get { return this.m_from; } + set { this.m_from = value; } } /// @@ -122,8 +122,8 @@ public string From /// public string Subject { - get { return m_subject; } - set { m_subject = value; } + get { return this.m_subject; } + set { this.m_subject = value; } } /// @@ -137,8 +137,8 @@ public string Subject /// public string PickupDir { - get { return m_pickupDir; } - set { m_pickupDir = value; } + get { return this.m_pickupDir; } + set { this.m_pickupDir = value; } } /// @@ -154,22 +154,22 @@ public string PickupDir /// public string FileExtension { - get { return m_fileExtension; } + get { return this.m_fileExtension; } set { - m_fileExtension = value; - if (m_fileExtension == null) + this.m_fileExtension = value; + if (this.m_fileExtension == null) { - m_fileExtension = string.Empty; + this.m_fileExtension = string.Empty; } // Make sure any non empty extension starts with a dot #if NET_2_0 || MONO_2_0 - if (!string.IsNullOrEmpty(m_fileExtension) && !m_fileExtension.StartsWith(".")) + if (!string.IsNullOrEmpty(this.m_fileExtension) && !this.m_fileExtension.StartsWith(".")) #else if (m_fileExtension != null && m_fileExtension.Length > 0 && !m_fileExtension.StartsWith(".")) #endif { - m_fileExtension = "." + m_fileExtension; + this.m_fileExtension = "." + this.m_fileExtension; } } } @@ -190,8 +190,8 @@ public string FileExtension /// public SecurityContext SecurityContext { - get { return m_securityContext; } - set { m_securityContext = value; } + get { return this.m_securityContext; } + set { this.m_securityContext = value; } } #endregion Public Instance Properties @@ -217,27 +217,27 @@ override protected void SendBuffer(LoggingEvent[] events) StreamWriter writer = null; // Impersonate to open the file - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { - filePath = Path.Combine(m_pickupDir, SystemInfo.NewGuid().ToString("N") + m_fileExtension); + filePath = Path.Combine(this.m_pickupDir, SystemInfo.NewGuid().ToString("N") + this.m_fileExtension); writer = File.CreateText(filePath); } if (writer == null) { - ErrorHandler.Error("Failed to create output file for writing ["+filePath+"]", null, ErrorCode.FileOpenFailure); + this.ErrorHandler.Error("Failed to create output file for writing ["+filePath+"]", null, ErrorCode.FileOpenFailure); } else { using(writer) { - writer.WriteLine("To: " + m_to); - writer.WriteLine("From: " + m_from); - writer.WriteLine("Subject: " + m_subject); + writer.WriteLine("To: " + this.m_to); + writer.WriteLine("From: " + this.m_from); + writer.WriteLine("Subject: " + this.m_subject); writer.WriteLine("Date: " + DateTime.UtcNow.ToString("r")); writer.WriteLine(""); - string t = Layout.Header; + string t = this.Layout.Header; if (t != null) { writer.Write(t); @@ -246,10 +246,10 @@ override protected void SendBuffer(LoggingEvent[] events) for(int i = 0; i < events.Length; i++) { // Render the event and append the text to the buffer - RenderLoggingEvent(writer, events[i]); + this.RenderLoggingEvent(writer, events[i]); } - t = Layout.Footer; + t = this.Layout.Footer; if (t != null) { writer.Write(t); @@ -262,7 +262,7 @@ override protected void SendBuffer(LoggingEvent[] events) } catch(Exception e) { - ErrorHandler.Error("Error occurred while sending e-mail notification.", e); + this.ErrorHandler.Error("Error occurred while sending e-mail notification.", e); } } @@ -290,14 +290,14 @@ override public void ActivateOptions() { base.ActivateOptions(); - if (m_securityContext == null) + if (this.m_securityContext == null) { - m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); + this.m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this); } - using(SecurityContext.Impersonate(this)) + using(this.SecurityContext.Impersonate(this)) { - m_pickupDir = ConvertToFullPath(m_pickupDir.Trim()); + this.m_pickupDir = ConvertToFullPath(this.m_pickupDir.Trim()); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TelnetAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TelnetAppender.cs index c0848339ee1..9bbf5517772 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TelnetAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TelnetAppender.cs @@ -107,7 +107,7 @@ public int Port { get { - return m_listeningPort; + return this.m_listeningPort; } set { @@ -121,7 +121,7 @@ public int Port } else { - m_listeningPort = value; + this.m_listeningPort = value; } } } @@ -140,10 +140,10 @@ protected override void OnClose() { base.OnClose(); - if (m_handler != null) + if (this.m_handler != null) { - m_handler.Dispose(); - m_handler = null; + this.m_handler.Dispose(); + this.m_handler = null; } } @@ -185,8 +185,8 @@ public override void ActivateOptions() base.ActivateOptions(); try { - LogLog.Debug(declaringType, "Creating SocketHandler to listen on port ["+m_listeningPort+"]"); - m_handler = new SocketHandler(m_listeningPort); + LogLog.Debug(declaringType, "Creating SocketHandler to listen on port ["+this.m_listeningPort+"]"); + this.m_handler = new SocketHandler(this.m_listeningPort); } catch(Exception ex) { @@ -206,9 +206,9 @@ public override void ActivateOptions() /// protected override void Append(LoggingEvent loggingEvent) { - if (m_handler != null && m_handler.HasConnections) + if (this.m_handler != null && this.m_handler.HasConnections) { - m_handler.Send(RenderLoggingEvent(loggingEvent)); + this.m_handler.Send(this.RenderLoggingEvent(loggingEvent)); } } @@ -257,15 +257,15 @@ protected class SocketClient : IDisposable /// public SocketClient(Socket socket) { - m_socket = socket; + this.m_socket = socket; try { - m_writer = new StreamWriter(new NetworkStream(socket)); + this.m_writer = new StreamWriter(new NetworkStream(socket)); } catch { - Dispose(); + this.Dispose(); throw; } } @@ -281,8 +281,8 @@ public SocketClient(Socket socket) /// public void Send(String message) { - m_writer.Write(message); - m_writer.Flush(); + this.m_writer.Write(message); + this.m_writer.Flush(); } #region IDisposable Members @@ -299,29 +299,29 @@ public void Dispose() { try { - if (m_writer != null) + if (this.m_writer != null) { - m_writer.Close(); - m_writer = null; + this.m_writer.Close(); + this.m_writer = null; } } catch { } - if (m_socket != null) + if (this.m_socket != null) { try { - m_socket.Shutdown(SocketShutdown.Both); + this.m_socket.Shutdown(SocketShutdown.Both); } catch { } try { - m_socket.Close(); + this.m_socket.Close(); } catch { } - m_socket = null; + this.m_socket = null; } } @@ -339,11 +339,11 @@ public void Dispose() /// public SocketHandler(int port) { - m_serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + this.m_serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); - m_serverSocket.Bind(new IPEndPoint(IPAddress.Any, port)); - m_serverSocket.Listen(5); - AcceptConnection(); + this.m_serverSocket.Bind(new IPEndPoint(IPAddress.Any, port)); + this.m_serverSocket.Listen(5); + this.AcceptConnection(); } private void AcceptConnection() @@ -351,7 +351,7 @@ private void AcceptConnection() #if NETSTANDARD1_3 m_serverSocket.AcceptAsync().ContinueWith(OnConnect, TaskScheduler.Default); #else - m_serverSocket.BeginAccept(new AsyncCallback(OnConnect), null); + this.m_serverSocket.BeginAccept(new AsyncCallback(this.OnConnect), null); #endif } @@ -366,7 +366,7 @@ private void AcceptConnection() /// public void Send(String message) { - ArrayList localClients = m_clients; + ArrayList localClients = this.m_clients; foreach (SocketClient client in localClients) { @@ -378,7 +378,7 @@ public void Send(String message) { // The client has closed the connection, remove it from our list client.Dispose(); - RemoveClient(client); + this.RemoveClient(client); } } } @@ -391,9 +391,9 @@ private void AddClient(SocketClient client) { lock(this) { - ArrayList clientsCopy = (ArrayList)m_clients.Clone(); + ArrayList clientsCopy = (ArrayList)this.m_clients.Clone(); clientsCopy.Add(client); - m_clients = clientsCopy; + this.m_clients = clientsCopy; } } @@ -405,9 +405,9 @@ private void RemoveClient(SocketClient client) { lock(this) { - ArrayList clientsCopy = (ArrayList)m_clients.Clone(); + ArrayList clientsCopy = (ArrayList)this.m_clients.Clone(); clientsCopy.Remove(client); - m_clients = clientsCopy; + this.m_clients = clientsCopy; } } @@ -428,7 +428,7 @@ public bool HasConnections { get { - ArrayList localClients = m_clients; + ArrayList localClients = this.m_clients; return (localClients != null && localClients.Count > 0); } @@ -457,18 +457,18 @@ private void OnConnect(IAsyncResult asyncResult) Socket socket = acceptTask.GetAwaiter().GetResult(); #else // Block until a client connects - Socket socket = m_serverSocket.EndAccept(asyncResult); + Socket socket = this.m_serverSocket.EndAccept(asyncResult); #endif LogLog.Debug(declaringType, "Accepting connection from ["+socket.RemoteEndPoint.ToString()+"]"); SocketClient client = new SocketClient(socket); - int currentActiveConnectionsCount = m_clients.Count; + int currentActiveConnectionsCount = this.m_clients.Count; if (currentActiveConnectionsCount < MAX_CONNECTIONS) { try { client.Send("TelnetAppender v1.0 (" + (currentActiveConnectionsCount + 1) + " active connections)\r\n\r\n"); - AddClient(client); + this.AddClient(client); } catch { @@ -486,9 +486,9 @@ private void OnConnect(IAsyncResult asyncResult) } finally { - if (m_serverSocket != null) + if (this.m_serverSocket != null) { - AcceptConnection(); + this.AcceptConnection(); } } } @@ -505,16 +505,16 @@ private void OnConnect(IAsyncResult asyncResult) /// public void Dispose() { - ArrayList localClients = m_clients; + ArrayList localClients = this.m_clients; foreach (SocketClient client in localClients) { client.Dispose(); } - m_clients.Clear(); + this.m_clients.Clear(); - Socket localSocket = m_serverSocket; - m_serverSocket = null; + Socket localSocket = this.m_serverSocket; + this.m_serverSocket = null; try { localSocket.Shutdown(SocketShutdown.Both); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TextWriterAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TextWriterAppender.cs index 636dff88aa8..85dcc69e3a0 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TextWriterAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TextWriterAppender.cs @@ -96,8 +96,8 @@ public TextWriterAppender() [Obsolete("Instead use the default constructor and set the Layout & Writer properties. Scheduled removal in v10.0.0.")] public TextWriterAppender(ILayout layout, TextWriter writer) { - Layout = layout; - Writer = writer; + this.Layout = layout; + this.Writer = writer; } #endregion @@ -129,8 +129,8 @@ public TextWriterAppender(ILayout layout, TextWriter writer) /// public bool ImmediateFlush { - get { return m_immediateFlush; } - set { m_immediateFlush = value; } + get { return this.m_immediateFlush; } + set { this.m_immediateFlush = value; } } /// @@ -150,16 +150,16 @@ public bool ImmediateFlush /// virtual public TextWriter Writer { - get { return m_qtw; } + get { return this.m_qtw; } set { lock(this) { - Reset(); + this.Reset(); if (value != null) { - m_qtw = new QuietTextWriter(value, ErrorHandler); - WriteHeader(); + this.m_qtw = new QuietTextWriter(value, this.ErrorHandler); + this.WriteHeader(); } } } @@ -186,20 +186,20 @@ override protected bool PreAppendCheck() return false; } - if (m_qtw == null) + if (this.m_qtw == null) { // Allow subclass to lazily create the writer - PrepareWriter(); + this.PrepareWriter(); - if (m_qtw == null) + if (this.m_qtw == null) { - ErrorHandler.Error("No output stream or file set for the appender named ["+ Name +"]."); + this.ErrorHandler.Error("No output stream or file set for the appender named ["+ this.Name +"]."); return false; } } - if (m_qtw.Closed) + if (this.m_qtw.Closed) { - ErrorHandler.Error("Output stream for appender named ["+ Name +"] has been closed."); + this.ErrorHandler.Error("Output stream for appender named ["+ this.Name +"] has been closed."); return false; } @@ -222,11 +222,11 @@ override protected bool PreAppendCheck() /// override protected void Append(LoggingEvent loggingEvent) { - RenderLoggingEvent(m_qtw, loggingEvent); + this.RenderLoggingEvent(this.m_qtw, loggingEvent); - if (m_immediateFlush) + if (this.m_immediateFlush) { - m_qtw.Flush(); + this.m_qtw.Flush(); } } @@ -245,12 +245,12 @@ override protected void Append(LoggingEvent[] loggingEvents) { foreach(LoggingEvent loggingEvent in loggingEvents) { - RenderLoggingEvent(m_qtw, loggingEvent); + this.RenderLoggingEvent(this.m_qtw, loggingEvent); } - if (m_immediateFlush) + if (this.m_immediateFlush) { - m_qtw.Flush(); + this.m_qtw.Flush(); } } @@ -264,7 +264,7 @@ override protected void OnClose() { lock(this) { - Reset(); + this.Reset(); } } @@ -289,9 +289,9 @@ override public IErrorHandler ErrorHandler else { base.ErrorHandler = value; - if (m_qtw != null) + if (this.m_qtw != null) { - m_qtw.ErrorHandler = value; + this.m_qtw.ErrorHandler = value; } } } @@ -326,8 +326,8 @@ override protected bool RequiresLayout /// virtual protected void WriteFooterAndCloseWriter() { - WriteFooter(); - CloseWriter(); + this.WriteFooter(); + this.CloseWriter(); } /// @@ -340,15 +340,15 @@ virtual protected void WriteFooterAndCloseWriter() /// virtual protected void CloseWriter() { - if (m_qtw != null) + if (this.m_qtw != null) { try { - m_qtw.Close(); + this.m_qtw.Close(); } catch(Exception e) { - ErrorHandler.Error("Could not close writer ["+m_qtw+"]", e); + this.ErrorHandler.Error("Could not close writer ["+this.m_qtw+"]", e); // do need to invoke an error handler // at this late stage } @@ -366,8 +366,8 @@ virtual protected void CloseWriter() /// virtual protected void Reset() { - WriteFooterAndCloseWriter(); - m_qtw = null; + this.WriteFooterAndCloseWriter(); + this.m_qtw = null; } /// @@ -380,12 +380,12 @@ virtual protected void Reset() /// virtual protected void WriteFooter() { - if (Layout != null && m_qtw != null && !m_qtw.Closed) + if (this.Layout != null && this.m_qtw != null && !this.m_qtw.Closed) { - string f = Layout.Footer; + string f = this.Layout.Footer; if (f != null) { - m_qtw.Write(f); + this.m_qtw.Write(f); } } } @@ -400,12 +400,12 @@ virtual protected void WriteFooter() /// virtual protected void WriteHeader() { - if (Layout != null && m_qtw != null && !m_qtw.Closed) + if (this.Layout != null && this.m_qtw != null && !this.m_qtw.Closed) { - string h = Layout.Header; + string h = this.Layout.Header; if (h != null) { - m_qtw.Write(h); + this.m_qtw.Write(h); } } } @@ -439,8 +439,8 @@ virtual protected void PrepareWriter() /// protected QuietTextWriter QuietWriter { - get { return m_qtw; } - set { m_qtw = value; } + get { return this.m_qtw; } + set { this.m_qtw = value; } } #endregion Protected Instance Methods @@ -494,12 +494,12 @@ protected QuietTextWriter QuietWriter public override bool Flush(int millisecondsTimeout) { // Nothing to do if ImmediateFlush is true - if (m_immediateFlush) return true; + if (this.m_immediateFlush) return true; // lock(this) will block any Appends while the buffer is flushed. lock (this) { - m_qtw.Flush(); + this.m_qtw.Flush(); } return true; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TraceAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TraceAppender.cs index a1800210d16..84471d25825 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TraceAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/TraceAppender.cs @@ -84,7 +84,7 @@ public TraceAppender() [System.Obsolete("Instead use the default constructor and set the Layout property")] public TraceAppender(ILayout layout) { - Layout = layout; + this.Layout = layout; } #endregion Public Instance Constructors @@ -111,8 +111,8 @@ public TraceAppender(ILayout layout) /// public bool ImmediateFlush { - get { return m_immediateFlush; } - set { m_immediateFlush = value; } + get { return this.m_immediateFlush; } + set { this.m_immediateFlush = value; } } /// @@ -128,8 +128,8 @@ public bool ImmediateFlush /// public PatternLayout Category { - get { return m_category; } - set { m_category = value; } + get { return this.m_category; } + set { this.m_category = value; } } #endregion Public Instance Properties @@ -153,13 +153,13 @@ override protected void Append(LoggingEvent loggingEvent) #if NETCF System.Diagnostics.Debug.Write(RenderLoggingEvent(loggingEvent), m_category.Format(loggingEvent)); #else - System.Diagnostics.Trace.Write(RenderLoggingEvent(loggingEvent), m_category.Format(loggingEvent)); + System.Diagnostics.Trace.Write(this.RenderLoggingEvent(loggingEvent), this.m_category.Format(loggingEvent)); #endif // // Flush the Trace system if needed // - if (m_immediateFlush) + if (this.m_immediateFlush) { #if NETCF System.Diagnostics.Debug.Flush(); @@ -219,7 +219,7 @@ override protected bool RequiresLayout public override bool Flush(int millisecondsTimeout) { // Nothing to do if ImmediateFlush is true - if (m_immediateFlush) return true; + if (this.m_immediateFlush) return true; // System.Diagnostics.Trace and System.Diagnostics.Debug are thread-safe, so no need for lock(this). #if NETCF diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/UdpAppender.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/UdpAppender.cs index fe98c5915c3..3dd834bc287 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Appender/UdpAppender.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Appender/UdpAppender.cs @@ -197,8 +197,8 @@ public UdpAppender() /// public IPAddress RemoteAddress { - get { return m_remoteAddress; } - set { m_remoteAddress = value; } + get { return this.m_remoteAddress; } + set { this.m_remoteAddress = value; } } /// @@ -217,7 +217,7 @@ public IPAddress RemoteAddress /// The value specified is less than or greater than . public int RemotePort { - get { return m_remotePort; } + get { return this.m_remotePort; } set { if (value < IPEndPoint.MinPort || value > IPEndPoint.MaxPort) @@ -230,7 +230,7 @@ public int RemotePort } else { - m_remotePort = value; + this.m_remotePort = value; } } } @@ -254,7 +254,7 @@ public int RemotePort /// The value specified is less than or greater than . public int LocalPort { - get { return m_localPort; } + get { return this.m_localPort; } set { if (value != 0 && (value < IPEndPoint.MinPort || value > IPEndPoint.MaxPort)) @@ -267,7 +267,7 @@ public int LocalPort } else { - m_localPort = value; + this.m_localPort = value; } } } @@ -285,8 +285,8 @@ public int LocalPort /// public Encoding Encoding { - get { return m_encoding; } - set { m_encoding = value; } + get { return this.m_encoding; } + set { this.m_encoding = value; } } #endregion Public Instance Properties @@ -406,7 +406,7 @@ protected override void Append(LoggingEvent loggingEvent) { try { - Byte [] buffer = m_encoding.GetBytes(RenderLoggingEvent(loggingEvent).ToCharArray()); + Byte [] buffer = this.m_encoding.GetBytes(this.RenderLoggingEvent(loggingEvent).ToCharArray()); #if NETSTANDARD1_3 Client.SendAsync(buffer, buffer.Length, RemoteEndPoint).Wait(); #else @@ -415,7 +415,7 @@ protected override void Append(LoggingEvent loggingEvent) } catch (Exception ex) { - ErrorHandler.Error( + this.ErrorHandler.Error( "Unable to send logging event to remote host " + this.RemoteAddress.ToString() + " on port " + @@ -485,7 +485,7 @@ protected virtual void InitializeClientConnection() #if NETCF || NET_1_0 || SSCLI_1_0 || CLI_1_0 this.Client = new UdpClient(); #else - this.Client = new UdpClient(RemoteAddress.AddressFamily); + this.Client = new UdpClient(this.RemoteAddress.AddressFamily); #endif } else @@ -493,13 +493,13 @@ protected virtual void InitializeClientConnection() #if NETCF || NET_1_0 || SSCLI_1_0 || CLI_1_0 this.Client = new UdpClient(this.LocalPort); #else - this.Client = new UdpClient(this.LocalPort, RemoteAddress.AddressFamily); + this.Client = new UdpClient(this.LocalPort, this.RemoteAddress.AddressFamily); #endif } } catch (Exception ex) { - ErrorHandler.Error( + this.ErrorHandler.Error( "Could not initialize the UdpClient connection on port " + this.LocalPort.ToString(NumberFormatInfo.InvariantInfo) + ".", ex, diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/AliasRepositoryAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/AliasRepositoryAttribute.cs index 38b01e937cb..ba6cd8a6840 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/AliasRepositoryAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/AliasRepositoryAttribute.cs @@ -70,7 +70,7 @@ namespace log4net.Config /// public AliasRepositoryAttribute(string name) { - Name = name; + this.Name = name; } #endregion Public Instance Constructors @@ -90,8 +90,8 @@ public AliasRepositoryAttribute(string name) /// public string Name { - get { return m_name; } - set { m_name = value ; } + get { return this.m_name; } + set { this.m_name = value ; } } #endregion Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/ConfiguratorAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/ConfiguratorAttribute.cs index 55b367e73be..f96a9feb2f9 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/ConfiguratorAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/ConfiguratorAttribute.cs @@ -60,7 +60,7 @@ public abstract class ConfiguratorAttribute : Attribute, IComparable /// protected ConfiguratorAttribute(int priority) { - m_priority = priority; + this.m_priority = priority; } /// @@ -102,7 +102,7 @@ public int CompareTo(object obj) if (target != null) { // Compare the priorities - result = target.m_priority.CompareTo(m_priority); + result = target.m_priority.CompareTo(this.m_priority); if (result == 0) { // Same priority, so have to provide some ordering diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/PluginAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/PluginAttribute.cs index 78a425f379a..b10326ee2a4 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/PluginAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/PluginAttribute.cs @@ -69,7 +69,7 @@ public sealed class PluginAttribute : Attribute, IPluginFactory /// public PluginAttribute(string typeName) { - m_typeName = typeName; + this.m_typeName = typeName; } #endif @@ -85,7 +85,7 @@ public PluginAttribute(string typeName) /// public PluginAttribute(Type type) { - m_type = type; + this.m_type = type; } #endregion Public Instance Constructors @@ -105,8 +105,8 @@ public PluginAttribute(Type type) /// public Type Type { - get { return m_type; } - set { m_type = value ; } + get { return this.m_type; } + set { this.m_type = value ; } } /// @@ -125,8 +125,8 @@ public Type Type /// public string TypeName { - get { return m_typeName; } - set { m_typeName = value ; } + get { return this.m_typeName; } + set { this.m_typeName = value ; } } #endregion Public Instance Properties @@ -145,12 +145,12 @@ public string TypeName /// The plugin object. public IPlugin CreatePlugin() { - Type pluginType = m_type; + Type pluginType = this.m_type; #if !NETSTANDARD1_3 - if (m_type == null) + if (this.m_type == null) { // Get the plugin object type from the string type name - pluginType = SystemInfo.GetTypeFromString(m_typeName, true, true); + pluginType = SystemInfo.GetTypeFromString(this.m_typeName, true, true); } #endif // Check that the type is a plugin @@ -181,11 +181,11 @@ public IPlugin CreatePlugin() /// A representation of the properties of this object override public string ToString() { - if (m_type != null) + if (this.m_type != null) { - return "PluginAttribute[Type=" + m_type.FullName + "]"; + return "PluginAttribute[Type=" + this.m_type.FullName + "]"; } - return "PluginAttribute[Type=" + m_typeName + "]"; + return "PluginAttribute[Type=" + this.m_typeName + "]"; } #endregion Override implementation of Object diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/RepositoryAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/RepositoryAttribute.cs index 92295e886ec..65c77db7556 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/RepositoryAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/RepositoryAttribute.cs @@ -82,7 +82,7 @@ public RepositoryAttribute() /// public RepositoryAttribute(string name) { - m_name = name; + this.m_name = name; } #endregion Public Instance Constructors @@ -104,8 +104,8 @@ public RepositoryAttribute(string name) /// public string Name { - get { return m_name; } - set { m_name = value ; } + get { return this.m_name; } + set { this.m_name = value ; } } /// @@ -130,8 +130,8 @@ public string Name /// public Type RepositoryType { - get { return m_repositoryType; } - set { m_repositoryType = value ; } + get { return this.m_repositoryType; } + set { this.m_repositoryType = value ; } } #endregion Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/SecurityContextProviderAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/SecurityContextProviderAttribute.cs index 54d495e5098..400ec191e44 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/SecurityContextProviderAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/SecurityContextProviderAttribute.cs @@ -66,7 +66,7 @@ public sealed class SecurityContextProviderAttribute : ConfiguratorAttribute /// public SecurityContextProviderAttribute(Type providerType) : base(100) /* configurator priority 100 to execute before the XmlConfigurator */ { - m_providerType = providerType; + this.m_providerType = providerType; } #endregion @@ -87,8 +87,8 @@ public SecurityContextProviderAttribute(Type providerType) : base(100) /* config /// public Type ProviderType { - get { return m_providerType; } - set { m_providerType = value; } + get { return this.m_providerType; } + set { this.m_providerType = value; } } #endregion Public Instance Properties @@ -108,19 +108,19 @@ public Type ProviderType /// override public void Configure(Assembly sourceAssembly, ILoggerRepository targetRepository) { - if (m_providerType == null) + if (this.m_providerType == null) { LogLog.Error(declaringType, "Attribute specified on assembly ["+sourceAssembly.FullName+"] with null ProviderType."); } else { - LogLog.Debug(declaringType, "Creating provider of type ["+ m_providerType.FullName +"]"); + LogLog.Debug(declaringType, "Creating provider of type ["+ this.m_providerType.FullName +"]"); - SecurityContextProvider provider = Activator.CreateInstance(m_providerType) as SecurityContextProvider; + SecurityContextProvider provider = Activator.CreateInstance(this.m_providerType) as SecurityContextProvider; if (provider == null) { - LogLog.Error(declaringType, "Failed to create SecurityContextProvider instance of type ["+m_providerType.Name+"]."); + LogLog.Error(declaringType, "Failed to create SecurityContextProvider instance of type ["+this.m_providerType.Name+"]."); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfigurator.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfigurator.cs index 6cabb823d30..6e624e56ca8 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfigurator.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfigurator.cs @@ -979,29 +979,29 @@ private sealed class ConfigureAndWatchHandler : IDisposable #endif public ConfigureAndWatchHandler(ILoggerRepository repository, FileInfo configFile) { - m_repository = repository; - m_configFile = configFile; + this.m_repository = repository; + this.m_configFile = configFile; // Create a new FileSystemWatcher and set its properties. - m_watcher = new FileSystemWatcher(); + this.m_watcher = new FileSystemWatcher(); - m_watcher.Path = m_configFile.DirectoryName; - m_watcher.Filter = m_configFile.Name; + this.m_watcher.Path = this.m_configFile.DirectoryName; + this.m_watcher.Filter = this.m_configFile.Name; // Set the notification filters - m_watcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.LastWrite | NotifyFilters.FileName; + this.m_watcher.NotifyFilter = NotifyFilters.CreationTime | NotifyFilters.LastWrite | NotifyFilters.FileName; // Add event handlers. OnChanged will do for all event handlers that fire a FileSystemEventArgs - m_watcher.Changed += new FileSystemEventHandler(ConfigureAndWatchHandler_OnChanged); - m_watcher.Created += new FileSystemEventHandler(ConfigureAndWatchHandler_OnChanged); - m_watcher.Deleted += new FileSystemEventHandler(ConfigureAndWatchHandler_OnChanged); - m_watcher.Renamed += new RenamedEventHandler(ConfigureAndWatchHandler_OnRenamed); + this.m_watcher.Changed += new FileSystemEventHandler(this.ConfigureAndWatchHandler_OnChanged); + this.m_watcher.Created += new FileSystemEventHandler(this.ConfigureAndWatchHandler_OnChanged); + this.m_watcher.Deleted += new FileSystemEventHandler(this.ConfigureAndWatchHandler_OnChanged); + this.m_watcher.Renamed += new RenamedEventHandler(this.ConfigureAndWatchHandler_OnRenamed); // Begin watching. - m_watcher.EnableRaisingEvents = true; + this.m_watcher.EnableRaisingEvents = true; // Create the timer that will be used to deliver events. Set as disabled - m_timer = new Timer(new TimerCallback(OnWatchedFileChange), null, Timeout.Infinite, Timeout.Infinite); + this.m_timer = new Timer(new TimerCallback(this.OnWatchedFileChange), null, Timeout.Infinite, Timeout.Infinite); } /// @@ -1016,11 +1016,11 @@ public ConfigureAndWatchHandler(ILoggerRepository repository, FileInfo configFil /// private void ConfigureAndWatchHandler_OnChanged(object source, FileSystemEventArgs e) { - LogLog.Debug(declaringType, "ConfigureAndWatchHandler: "+e.ChangeType+" [" + m_configFile.FullName + "]"); + LogLog.Debug(declaringType, "ConfigureAndWatchHandler: "+e.ChangeType+" [" + this.m_configFile.FullName + "]"); // Deliver the event in TimeoutMillis time // timer will fire only once - m_timer.Change(TimeoutMillis, Timeout.Infinite); + this.m_timer.Change(TimeoutMillis, Timeout.Infinite); } /// @@ -1035,11 +1035,11 @@ private void ConfigureAndWatchHandler_OnChanged(object source, FileSystemEventAr /// private void ConfigureAndWatchHandler_OnRenamed(object source, RenamedEventArgs e) { - LogLog.Debug(declaringType, "ConfigureAndWatchHandler: " + e.ChangeType + " [" + m_configFile.FullName + "]"); + LogLog.Debug(declaringType, "ConfigureAndWatchHandler: " + e.ChangeType + " [" + this.m_configFile.FullName + "]"); // Deliver the event in TimeoutMillis time // timer will fire only once - m_timer.Change(TimeoutMillis, Timeout.Infinite); + this.m_timer.Change(TimeoutMillis, Timeout.Infinite); } /// @@ -1048,7 +1048,7 @@ private void ConfigureAndWatchHandler_OnRenamed(object source, RenamedEventArgs /// null private void OnWatchedFileChange(object state) { - XmlConfigurator.InternalConfigure(m_repository, m_configFile); + XmlConfigurator.InternalConfigure(this.m_repository, this.m_configFile); } /// @@ -1059,9 +1059,9 @@ private void OnWatchedFileChange(object state) #endif public void Dispose() { - m_watcher.EnableRaisingEvents = false; - m_watcher.Dispose(); - m_timer.Dispose(); + this.m_watcher.EnableRaisingEvents = false; + this.m_watcher.Dispose(); + this.m_timer.Dispose(); } } #endif diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfiguratorAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfiguratorAttribute.cs index 3418c01f0a0..e44602e0a2f 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfiguratorAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Config/XmlConfiguratorAttribute.cs @@ -122,8 +122,8 @@ public XmlConfiguratorAttribute() : base(0) /* configurator priority 0 */ /// public string ConfigFile { - get { return m_configFile; } - set { m_configFile = value; } + get { return this.m_configFile; } + set { this.m_configFile = value; } } /// @@ -150,8 +150,8 @@ public string ConfigFile /// public string ConfigFileExtension { - get { return m_configFileExtension; } - set { m_configFileExtension = value; } + get { return this.m_configFileExtension; } + set { this.m_configFileExtension = value; } } /// @@ -178,8 +178,8 @@ public string ConfigFileExtension /// public bool Watch { - get { return m_configureAndWatch; } - set { m_configureAndWatch = value; } + get { return this.m_configureAndWatch; } + set { this.m_configureAndWatch = value; } } #endregion Public Instance Properties @@ -219,11 +219,11 @@ override public void Configure(Assembly sourceAssembly, ILoggerRepository target if (applicationBaseDirectory == null || (new Uri(applicationBaseDirectory)).IsFile) { - ConfigureFromFile(sourceAssembly, targetRepository); + this.ConfigureFromFile(sourceAssembly, targetRepository); } else { - ConfigureFromUri(sourceAssembly, targetRepository); + this.ConfigureFromUri(sourceAssembly, targetRepository); } } @@ -243,9 +243,9 @@ private void ConfigureFromFile(Assembly sourceAssembly, ILoggerRepository target string fullPath2ConfigFile = null; // Select the config file - if (m_configFile == null || m_configFile.Length == 0) + if (this.m_configFile == null || this.m_configFile.Length == 0) { - if (m_configFileExtension == null || m_configFileExtension.Length == 0) + if (this.m_configFileExtension == null || this.m_configFileExtension.Length == 0) { // Use the default .config file for the AppDomain try @@ -260,9 +260,9 @@ private void ConfigureFromFile(Assembly sourceAssembly, ILoggerRepository target else { // Force the extension to start with a '.' - if (m_configFileExtension[0] != '.') + if (this.m_configFileExtension[0] != '.') { - m_configFileExtension = "." + m_configFileExtension; + this.m_configFileExtension = "." + this.m_configFileExtension; } string applicationBaseDirectory = null; @@ -277,7 +277,7 @@ private void ConfigureFromFile(Assembly sourceAssembly, ILoggerRepository target if (applicationBaseDirectory != null) { - fullPath2ConfigFile = Path.Combine(applicationBaseDirectory, SystemInfo.AssemblyFileName(sourceAssembly) + m_configFileExtension); + fullPath2ConfigFile = Path.Combine(applicationBaseDirectory, SystemInfo.AssemblyFileName(sourceAssembly) + this.m_configFileExtension); } } } @@ -290,23 +290,23 @@ private void ConfigureFromFile(Assembly sourceAssembly, ILoggerRepository target } catch(Exception ex) { - LogLog.Warn(declaringType, "Exception getting ApplicationBaseDirectory. ConfigFile property path ["+m_configFile+"] will be treated as an absolute path.", ex); + LogLog.Warn(declaringType, "Exception getting ApplicationBaseDirectory. ConfigFile property path ["+this.m_configFile+"] will be treated as an absolute path.", ex); } if (applicationBaseDirectory != null) { // Just the base dir + the config file - fullPath2ConfigFile = Path.Combine(applicationBaseDirectory, m_configFile); + fullPath2ConfigFile = Path.Combine(applicationBaseDirectory, this.m_configFile); } else { - fullPath2ConfigFile = m_configFile; + fullPath2ConfigFile = this.m_configFile; } } if (fullPath2ConfigFile != null) { - ConfigureFromFile(targetRepository, new FileInfo(fullPath2ConfigFile)); + this.ConfigureFromFile(targetRepository, new FileInfo(fullPath2ConfigFile)); } } @@ -325,7 +325,7 @@ private void ConfigureFromFile(ILoggerRepository targetRepository, FileInfo conf XmlConfigurator.Configure(targetRepository, configFile); #else // Do we configure just once or do we configure and then watch? - if (m_configureAndWatch) + if (this.m_configureAndWatch) { XmlConfigurator.ConfigureAndWatch(targetRepository, configFile); } @@ -347,9 +347,9 @@ private void ConfigureFromUri(Assembly sourceAssembly, ILoggerRepository targetR Uri fullPath2ConfigFile = null; // Select the config file - if (m_configFile == null || m_configFile.Length == 0) + if (this.m_configFile == null || this.m_configFile.Length == 0) { - if (m_configFileExtension == null || m_configFileExtension.Length == 0) + if (this.m_configFileExtension == null || this.m_configFileExtension.Length == 0) { string systemConfigFilePath = null; try @@ -372,9 +372,9 @@ private void ConfigureFromUri(Assembly sourceAssembly, ILoggerRepository targetR else { // Force the extension to start with a '.' - if (m_configFileExtension[0] != '.') + if (this.m_configFileExtension[0] != '.') { - m_configFileExtension = "." + m_configFileExtension; + this.m_configFileExtension = "." + this.m_configFileExtension; } string systemConfigFilePath = null; @@ -398,7 +398,7 @@ private void ConfigureFromUri(Assembly sourceAssembly, ILoggerRepository targetR { path = path.Substring(0, startOfExtension); } - path += m_configFileExtension; + path += this.m_configFileExtension; builder.Path = path; fullPath2ConfigFile = builder.Uri; @@ -414,17 +414,17 @@ private void ConfigureFromUri(Assembly sourceAssembly, ILoggerRepository targetR } catch(Exception ex) { - LogLog.Warn(declaringType, "Exception getting ApplicationBaseDirectory. ConfigFile property path ["+m_configFile+"] will be treated as an absolute URI.", ex); + LogLog.Warn(declaringType, "Exception getting ApplicationBaseDirectory. ConfigFile property path ["+this.m_configFile+"] will be treated as an absolute URI.", ex); } if (applicationBaseDirectory != null) { // Just the base dir + the config file - fullPath2ConfigFile = new Uri(new Uri(applicationBaseDirectory), m_configFile); + fullPath2ConfigFile = new Uri(new Uri(applicationBaseDirectory), this.m_configFile); } else { - fullPath2ConfigFile = new Uri(m_configFile); + fullPath2ConfigFile = new Uri(this.m_configFile); } } @@ -434,11 +434,11 @@ private void ConfigureFromUri(Assembly sourceAssembly, ILoggerRepository targetR { // The m_configFile could be an absolute local path, therefore we have to be // prepared to switch back to using FileInfos here - ConfigureFromFile(targetRepository, new FileInfo(fullPath2ConfigFile.LocalPath)); + this.ConfigureFromFile(targetRepository, new FileInfo(fullPath2ConfigFile.LocalPath)); } else { - if (m_configureAndWatch) + if (this.m_configureAndWatch) { LogLog.Warn(declaringType, "XmlConfiguratorAttribute: Unable to watch config file loaded from a URI"); } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/CompactRepositorySelector.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/CompactRepositorySelector.cs index be2cbac386d..b8a53990693 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/CompactRepositorySelector.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/CompactRepositorySelector.cs @@ -90,9 +90,9 @@ public CompactRepositorySelector(Type defaultRepositoryType) throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("defaultRepositoryType", (object)defaultRepositoryType, "Parameter: defaultRepositoryType, Value: ["+defaultRepositoryType+"] out of range. Argument must implement the ILoggerRepository interface"); } - m_defaultRepositoryType = defaultRepositoryType; + this.m_defaultRepositoryType = defaultRepositoryType; - LogLog.Debug(declaringType, "defaultRepositoryType ["+m_defaultRepositoryType+"]"); + LogLog.Debug(declaringType, "defaultRepositoryType ["+this.m_defaultRepositoryType+"]"); } #endregion @@ -116,7 +116,7 @@ public CompactRepositorySelector(Type defaultRepositoryType) /// public ILoggerRepository GetRepository(Assembly assembly) { - return CreateRepository(assembly, m_defaultRepositoryType); + return this.CreateRepository(assembly, this.m_defaultRepositoryType); } /// @@ -144,7 +144,7 @@ public ILoggerRepository GetRepository(string repositoryName) lock(this) { // Lookup in map - ILoggerRepository rep = m_name2repositoryMap[repositoryName] as ILoggerRepository; + ILoggerRepository rep = this.m_name2repositoryMap[repositoryName] as ILoggerRepository; if (rep == null) { throw new LogException("Repository ["+repositoryName+"] is NOT defined."); @@ -178,7 +178,7 @@ public ILoggerRepository CreateRepository(Assembly assembly, Type repositoryType // If the type is not set then use the default type if (repositoryType == null) { - repositoryType = m_defaultRepositoryType; + repositoryType = this.m_defaultRepositoryType; } lock(this) @@ -186,11 +186,11 @@ public ILoggerRepository CreateRepository(Assembly assembly, Type repositoryType // This method should not throw if the default repository already exists. // First check that the repository does not exist - ILoggerRepository rep = m_name2repositoryMap[DefaultRepositoryName] as ILoggerRepository; + ILoggerRepository rep = this.m_name2repositoryMap[DefaultRepositoryName] as ILoggerRepository; if (rep == null) { // Must create the repository - rep = CreateRepository(DefaultRepositoryName, repositoryType); + rep = this.CreateRepository(DefaultRepositoryName, repositoryType); } return rep; @@ -230,7 +230,7 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository // If the type is not set then use the default type if (repositoryType == null) { - repositoryType = m_defaultRepositoryType; + repositoryType = this.m_defaultRepositoryType; } lock(this) @@ -238,7 +238,7 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository ILoggerRepository rep = null; // First check that the repository does not exist - rep = m_name2repositoryMap[repositoryName] as ILoggerRepository; + rep = this.m_name2repositoryMap[repositoryName] as ILoggerRepository; if (rep != null) { throw new LogException("Repository ["+repositoryName+"] is already defined. Repositories cannot be redefined."); @@ -254,10 +254,10 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository rep.Name = repositoryName; // Store in map - m_name2repositoryMap[repositoryName] = rep; + this.m_name2repositoryMap[repositoryName] = rep; // Notify listeners that the repository has been created - OnLoggerRepositoryCreatedEvent(rep); + this.OnLoggerRepositoryCreatedEvent(rep); } return rep; @@ -280,7 +280,7 @@ public bool ExistsRepository(string repositoryName) { lock(this) { - return m_name2repositoryMap.ContainsKey(repositoryName); + return this.m_name2repositoryMap.ContainsKey(repositoryName); } } @@ -297,7 +297,7 @@ public ILoggerRepository[] GetAllRepositories() { lock(this) { - ICollection reps = m_name2repositoryMap.Values; + ICollection reps = this.m_name2repositoryMap.Values; ILoggerRepository[] all = new ILoggerRepository[reps.Count]; reps.CopyTo(all, 0); return all; @@ -335,8 +335,8 @@ public ILoggerRepository[] GetAllRepositories() /// public event LoggerRepositoryCreationEventHandler LoggerRepositoryCreatedEvent { - add { m_loggerRepositoryCreatedEvent += value; } - remove { m_loggerRepositoryCreatedEvent -= value; } + add { this.m_loggerRepositoryCreatedEvent += value; } + remove { this.m_loggerRepositoryCreatedEvent -= value; } } /// @@ -351,7 +351,7 @@ public event LoggerRepositoryCreationEventHandler LoggerRepositoryCreatedEvent /// protected virtual void OnLoggerRepositoryCreatedEvent(ILoggerRepository repository) { - LoggerRepositoryCreationEventHandler handler = m_loggerRepositoryCreatedEvent; + LoggerRepositoryCreationEventHandler handler = this.m_loggerRepositoryCreatedEvent; if (handler != null) { handler(this, new LoggerRepositoryCreationEventArgs(repository)); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/DefaultRepositorySelector.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/DefaultRepositorySelector.cs index b2fce7208bf..1d3c737b8c1 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/DefaultRepositorySelector.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/DefaultRepositorySelector.cs @@ -72,8 +72,8 @@ public class DefaultRepositorySelector : IRepositorySelector /// public event LoggerRepositoryCreationEventHandler LoggerRepositoryCreatedEvent { - add { m_loggerRepositoryCreatedEvent += value; } - remove { m_loggerRepositoryCreatedEvent -= value; } + add { this.m_loggerRepositoryCreatedEvent += value; } + remove { this.m_loggerRepositoryCreatedEvent -= value; } } #endregion Public Events @@ -106,9 +106,9 @@ public DefaultRepositorySelector(Type defaultRepositoryType) throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("defaultRepositoryType", defaultRepositoryType, "Parameter: defaultRepositoryType, Value: [" + defaultRepositoryType + "] out of range. Argument must implement the ILoggerRepository interface"); } - m_defaultRepositoryType = defaultRepositoryType; + this.m_defaultRepositoryType = defaultRepositoryType; - LogLog.Debug(declaringType, "defaultRepositoryType [" + m_defaultRepositoryType + "]"); + LogLog.Debug(declaringType, "defaultRepositoryType [" + this.m_defaultRepositoryType + "]"); } #endregion Public Instance Constructors @@ -144,7 +144,7 @@ public ILoggerRepository GetRepository(Assembly repositoryAssembly) { throw new ArgumentNullException("repositoryAssembly"); } - return CreateRepository(repositoryAssembly, m_defaultRepositoryType); + return this.CreateRepository(repositoryAssembly, this.m_defaultRepositoryType); } /// @@ -174,7 +174,7 @@ public ILoggerRepository GetRepository(string repositoryName) lock(this) { // Lookup in map - ILoggerRepository rep = m_name2repositoryMap[repositoryName] as ILoggerRepository; + ILoggerRepository rep = this.m_name2repositoryMap[repositoryName] as ILoggerRepository; if (rep == null) { throw new LogException("Repository [" + repositoryName + "] is NOT defined."); @@ -221,7 +221,7 @@ public ILoggerRepository GetRepository(string repositoryName) /// is . public ILoggerRepository CreateRepository(Assembly repositoryAssembly, Type repositoryType) { - return CreateRepository(repositoryAssembly, repositoryType, DefaultRepositoryName, true); + return this.CreateRepository(repositoryAssembly, repositoryType, DefaultRepositoryName, true); } /// @@ -272,13 +272,13 @@ public ILoggerRepository CreateRepository(Assembly repositoryAssembly, Type repo // If the type is not set then use the default type if (repositoryType == null) { - repositoryType = m_defaultRepositoryType; + repositoryType = this.m_defaultRepositoryType; } lock(this) { // Lookup in map - ILoggerRepository rep = m_assembly2repositoryMap[repositoryAssembly] as ILoggerRepository; + ILoggerRepository rep = this.m_assembly2repositoryMap[repositoryAssembly] as ILoggerRepository; if (rep == null) { // Not found, therefore create @@ -291,30 +291,30 @@ public ILoggerRepository CreateRepository(Assembly repositoryAssembly, Type repo if (readAssemblyAttributes) { // Get the repository and type from the assembly attributes - GetInfoForAssembly(repositoryAssembly, ref actualRepositoryName, ref actualRepositoryType); + this.GetInfoForAssembly(repositoryAssembly, ref actualRepositoryName, ref actualRepositoryType); } LogLog.Debug(declaringType, "Assembly [" + repositoryAssembly + "] using repository [" + actualRepositoryName + "] and repository type [" + actualRepositoryType + "]"); // Lookup the repository in the map (as this may already be defined) - rep = m_name2repositoryMap[actualRepositoryName] as ILoggerRepository; + rep = this.m_name2repositoryMap[actualRepositoryName] as ILoggerRepository; if (rep == null) { // Create the repository - rep = CreateRepository(actualRepositoryName, actualRepositoryType); + rep = this.CreateRepository(actualRepositoryName, actualRepositoryType); if (readAssemblyAttributes) { try { // Look for aliasing attributes - LoadAliases(repositoryAssembly, rep); + this.LoadAliases(repositoryAssembly, rep); // Look for plugins defined on the assembly - LoadPlugins(repositoryAssembly, rep); + this.LoadPlugins(repositoryAssembly, rep); // Configure the repository using the assembly attributes - ConfigureRepository(repositoryAssembly, rep); + this.ConfigureRepository(repositoryAssembly, rep); } catch (Exception ex) { @@ -331,7 +331,7 @@ public ILoggerRepository CreateRepository(Assembly repositoryAssembly, Type repo try { // Look for plugins defined on the assembly - LoadPlugins(repositoryAssembly, rep); + this.LoadPlugins(repositoryAssembly, rep); } catch (Exception ex) { @@ -339,7 +339,7 @@ public ILoggerRepository CreateRepository(Assembly repositoryAssembly, Type repo } } } - m_assembly2repositoryMap[repositoryAssembly] = rep; + this.m_assembly2repositoryMap[repositoryAssembly] = rep; } return rep; } @@ -371,7 +371,7 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository // If the type is not set then use the default type if (repositoryType == null) { - repositoryType = m_defaultRepositoryType; + repositoryType = this.m_defaultRepositoryType; } lock(this) @@ -379,7 +379,7 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository ILoggerRepository rep = null; // First check that the repository does not exist - rep = m_name2repositoryMap[repositoryName] as ILoggerRepository; + rep = this.m_name2repositoryMap[repositoryName] as ILoggerRepository; if (rep != null) { throw new LogException("Repository [" + repositoryName + "] is already defined. Repositories cannot be redefined."); @@ -387,7 +387,7 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository else { // Lookup an alias before trying to create the new repository - ILoggerRepository aliasedRepository = m_alias2repositoryMap[repositoryName] as ILoggerRepository; + ILoggerRepository aliasedRepository = this.m_alias2repositoryMap[repositoryName] as ILoggerRepository; if (aliasedRepository != null) { // Found an alias @@ -400,7 +400,7 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository rep = aliasedRepository; // Store in map - m_name2repositoryMap[repositoryName] = rep; + this.m_name2repositoryMap[repositoryName] = rep; } else { @@ -423,10 +423,10 @@ public ILoggerRepository CreateRepository(string repositoryName, Type repository rep.Name = repositoryName; // Store in map - m_name2repositoryMap[repositoryName] = rep; + this.m_name2repositoryMap[repositoryName] = rep; // Notify listeners that the repository has been created - OnLoggerRepositoryCreatedEvent(rep); + this.OnLoggerRepositoryCreatedEvent(rep); } } @@ -450,7 +450,7 @@ public bool ExistsRepository(string repositoryName) { lock(this) { - return m_name2repositoryMap.ContainsKey(repositoryName); + return this.m_name2repositoryMap.ContainsKey(repositoryName); } } @@ -467,7 +467,7 @@ public ILoggerRepository[] GetAllRepositories() { lock(this) { - ICollection reps = m_name2repositoryMap.Values; + ICollection reps = this.m_name2repositoryMap.Values; ILoggerRepository[] all = new ILoggerRepository[reps.Count]; reps.CopyTo(all, 0); return all; @@ -512,20 +512,20 @@ public void AliasRepository(string repositoryAlias, ILoggerRepository repository lock(this) { // Check if the alias is already set - if (m_alias2repositoryMap.Contains(repositoryAlias)) + if (this.m_alias2repositoryMap.Contains(repositoryAlias)) { // Check if this is a duplicate of the current alias - if (repositoryTarget != ((ILoggerRepository)m_alias2repositoryMap[repositoryAlias])) + if (repositoryTarget != ((ILoggerRepository)this.m_alias2repositoryMap[repositoryAlias])) { // Cannot redefine existing alias - throw new InvalidOperationException("Repository [" + repositoryAlias + "] is already aliased to repository [" + ((ILoggerRepository)m_alias2repositoryMap[repositoryAlias]).Name + "]. Aliases cannot be redefined."); + throw new InvalidOperationException("Repository [" + repositoryAlias + "] is already aliased to repository [" + ((ILoggerRepository)this.m_alias2repositoryMap[repositoryAlias]).Name + "]. Aliases cannot be redefined."); } } // Check if the alias is already mapped to a repository - else if (m_name2repositoryMap.Contains(repositoryAlias)) + else if (this.m_name2repositoryMap.Contains(repositoryAlias)) { // Check if this is a duplicate of the current mapping - if ( repositoryTarget != ((ILoggerRepository)m_name2repositoryMap[repositoryAlias]) ) + if ( repositoryTarget != ((ILoggerRepository)this.m_name2repositoryMap[repositoryAlias]) ) { // Cannot define alias for already mapped repository throw new InvalidOperationException("Repository [" + repositoryAlias + "] already exists and cannot be aliased to repository [" + repositoryTarget.Name + "]."); @@ -534,7 +534,7 @@ public void AliasRepository(string repositoryAlias, ILoggerRepository repository else { // Set the alias - m_alias2repositoryMap[repositoryAlias] = repositoryTarget; + this.m_alias2repositoryMap[repositoryAlias] = repositoryTarget; } } } @@ -554,7 +554,7 @@ public void AliasRepository(string repositoryAlias, ILoggerRepository repository /// protected virtual void OnLoggerRepositoryCreatedEvent(ILoggerRepository repository) { - LoggerRepositoryCreationEventHandler handler = m_loggerRepositoryCreatedEvent; + LoggerRepositoryCreationEventHandler handler = this.m_loggerRepositoryCreatedEvent; if (handler != null) { handler(this, new LoggerRepositoryCreationEventArgs(repository)); @@ -874,7 +874,7 @@ private void LoadAliases(Assembly assembly, ILoggerRepository repository) { try { - AliasRepository(configAttr.Name, repository); + this.AliasRepository(configAttr.Name, repository); } catch(Exception ex) { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/ExceptionEvaluator.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/ExceptionEvaluator.cs index a648f4c3a31..226fefcc383 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/ExceptionEvaluator.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/ExceptionEvaluator.cs @@ -71,8 +71,8 @@ public ExceptionEvaluator(Type exType, bool triggerOnSubClass) throw new ArgumentNullException("exType"); } - m_type = exType; - m_triggerOnSubclass = triggerOnSubClass; + this.m_type = exType; + this.m_triggerOnSubclass = triggerOnSubClass; } /// @@ -80,8 +80,8 @@ public ExceptionEvaluator(Type exType, bool triggerOnSubClass) /// public Type ExceptionType { - get { return m_type; } - set { m_type = value; } + get { return this.m_type; } + set { this.m_type = value; } } /// @@ -89,8 +89,8 @@ public Type ExceptionType /// public bool TriggerOnSubclass { - get { return m_triggerOnSubclass; } - set { m_triggerOnSubclass = value; } + get { return this.m_triggerOnSubclass; } + set { this.m_triggerOnSubclass = value; } } #region ITriggeringEventEvaluator Members @@ -116,15 +116,15 @@ public bool IsTriggeringEvent(LoggingEvent loggingEvent) throw new ArgumentNullException("loggingEvent"); } - if (m_triggerOnSubclass && loggingEvent.ExceptionObject != null) + if (this.m_triggerOnSubclass && loggingEvent.ExceptionObject != null) { // check if loggingEvent.ExceptionObject is of type ExceptionType or subclass of ExceptionType Type exceptionObjectType = loggingEvent.ExceptionObject.GetType(); - return exceptionObjectType == m_type || exceptionObjectType.IsSubclassOf(m_type); + return exceptionObjectType == this.m_type || exceptionObjectType.IsSubclassOf(this.m_type); } - else if (!m_triggerOnSubclass && loggingEvent.ExceptionObject != null) + else if (!this.m_triggerOnSubclass && loggingEvent.ExceptionObject != null) { // check if loggingEvent.ExceptionObject is of type ExceptionType - return loggingEvent.ExceptionObject.GetType() == m_type; + return loggingEvent.ExceptionObject.GetType() == this.m_type; } else { // loggingEvent.ExceptionObject is null diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/IRepositorySelector.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/IRepositorySelector.cs index fb471cb0c75..204fdf1f94a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/IRepositorySelector.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/IRepositorySelector.cs @@ -70,7 +70,7 @@ public class LoggerRepositoryCreationEventArgs : EventArgs /// public LoggerRepositoryCreationEventArgs(ILoggerRepository repository) { - m_repository = repository; + this.m_repository = repository; } /// @@ -86,7 +86,7 @@ public LoggerRepositoryCreationEventArgs(ILoggerRepository repository) /// public ILoggerRepository LoggerRepository { - get { return m_repository; } + get { return this.m_repository; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/Level.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/Level.cs index db27675736d..6725a241ec7 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/Level.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/Level.cs @@ -114,13 +114,13 @@ public Level(int level, string levelName, string displayName) throw new ArgumentNullException("displayName"); } - m_levelValue = level; + this.m_levelValue = level; #if NETSTANDARD1_3 m_levelName = levelName; #else - m_levelName = string.Intern(levelName); + this.m_levelName = string.Intern(levelName); #endif - m_levelDisplayName = displayName; + this.m_levelDisplayName = displayName; } /// @@ -155,7 +155,7 @@ public Level(int level, string levelName) : this(level, levelName, levelName) /// public string Name { - get { return m_levelName; } + get { return this.m_levelName; } } /// @@ -171,7 +171,7 @@ public string Name /// public int Value { - get { return m_levelValue; } + get { return this.m_levelValue; } } /// @@ -187,7 +187,7 @@ public int Value /// public string DisplayName { - get { return m_levelDisplayName; } + get { return this.m_levelDisplayName; } } #endregion Public Instance Properties @@ -208,7 +208,7 @@ public string DisplayName /// override public string ToString() { - return m_levelName; + return this.m_levelName; } /// @@ -228,7 +228,7 @@ override public bool Equals(object o) Level otherLevel = o as Level; if (otherLevel != null) { - return m_levelValue == otherLevel.m_levelValue; + return this.m_levelValue == otherLevel.m_levelValue; } else { @@ -251,7 +251,7 @@ override public bool Equals(object o) /// override public int GetHashCode() { - return m_levelValue; + return this.m_levelValue; } #endregion Override implementation of Object diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelCollection.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelCollection.cs index d5bb89a9104..6e6f006ab5f 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelCollection.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelCollection.cs @@ -103,7 +103,7 @@ public static LevelCollection ReadOnly(LevelCollection list) /// public LevelCollection() { - m_array = new Level[DEFAULT_CAPACITY]; + this.m_array = new Level[DEFAULT_CAPACITY]; } /// @@ -115,7 +115,7 @@ public LevelCollection() /// public LevelCollection(int capacity) { - m_array = new Level[capacity]; + this.m_array = new Level[capacity]; } /// @@ -125,8 +125,8 @@ public LevelCollection(int capacity) /// The LevelCollection whose elements are copied to the new collection. public LevelCollection(LevelCollection c) { - m_array = new Level[c.Count]; - AddRange(c); + this.m_array = new Level[c.Count]; + this.AddRange(c); } /// @@ -136,8 +136,8 @@ public LevelCollection(LevelCollection c) /// The array whose elements are copied to the new list. public LevelCollection(Level[] a) { - m_array = new Level[a.Length]; - AddRange(a); + this.m_array = new Level[a.Length]; + this.AddRange(a); } /// @@ -147,8 +147,8 @@ public LevelCollection(Level[] a) /// The collection whose elements are copied to the new list. public LevelCollection(ICollection col) { - m_array = new Level[col.Count]; - AddRange(col); + this.m_array = new Level[col.Count]; + this.AddRange(col); } /// @@ -169,7 +169,7 @@ protected internal enum Tag /// protected internal LevelCollection(Tag tag) { - m_array = null; + this.m_array = null; } #endregion @@ -180,7 +180,7 @@ protected internal LevelCollection(Tag tag) /// public virtual int Count { - get { return m_count; } + get { return this.m_count; } } /// @@ -201,12 +201,12 @@ public virtual void CopyTo(Level[] array) /// The zero-based index in at which copying begins. public virtual void CopyTo(Level[] array, int start) { - if (m_count > array.GetUpperBound(0) + 1 - start) + if (this.m_count > array.GetUpperBound(0) + 1 - start) { throw new System.ArgumentException("Destination array was not long enough."); } - Array.Copy(m_array, 0, array, start, m_count); + Array.Copy(this.m_array, 0, array, start, this.m_count); } /// @@ -223,7 +223,7 @@ public virtual bool IsSynchronized /// public virtual object SyncRoot { - get { return m_array; } + get { return this.m_array; } } #endregion @@ -243,14 +243,14 @@ public virtual Level this[int index] { get { - ValidateIndex(index); // throws - return m_array[index]; + this.ValidateIndex(index); // throws + return this.m_array[index]; } set { - ValidateIndex(index); // throws - ++m_version; - m_array[index] = value; + this.ValidateIndex(index); // throws + ++this.m_version; + this.m_array[index] = value; } } @@ -261,15 +261,15 @@ public virtual Level this[int index] /// The index at which the value has been added. public virtual int Add(Level item) { - if (m_count == m_array.Length) + if (this.m_count == this.m_array.Length) { - EnsureCapacity(m_count + 1); + this.EnsureCapacity(this.m_count + 1); } - m_array[m_count] = item; - m_version++; + this.m_array[this.m_count] = item; + this.m_version++; - return m_count++; + return this.m_count++; } /// @@ -277,9 +277,9 @@ public virtual int Add(Level item) /// public virtual void Clear() { - ++m_version; - m_array = new Level[DEFAULT_CAPACITY]; - m_count = 0; + ++this.m_version; + this.m_array = new Level[DEFAULT_CAPACITY]; + this.m_count = 0; } /// @@ -288,10 +288,10 @@ public virtual void Clear() /// A new with a shallow copy of the collection data. public virtual object Clone() { - LevelCollection newCol = new LevelCollection(m_count); - Array.Copy(m_array, 0, newCol.m_array, 0, m_count); - newCol.m_count = m_count; - newCol.m_version = m_version; + LevelCollection newCol = new LevelCollection(this.m_count); + Array.Copy(this.m_array, 0, newCol.m_array, 0, this.m_count); + newCol.m_count = this.m_count; + newCol.m_version = this.m_version; return newCol; } @@ -303,9 +303,9 @@ public virtual object Clone() /// true if is found in the LevelCollection; otherwise, false. public virtual bool Contains(Level item) { - for (int i=0; i != m_count; ++i) + for (int i=0; i != this.m_count; ++i) { - if (m_array[i].Equals(item)) + if (this.m_array[i].Equals(item)) { return true; } @@ -324,9 +324,9 @@ public virtual bool Contains(Level item) /// public virtual int IndexOf(Level item) { - for (int i=0; i != m_count; ++i) + for (int i=0; i != this.m_count; ++i) { - if (m_array[i].Equals(item)) + if (this.m_array[i].Equals(item)) { return i; } @@ -346,21 +346,21 @@ public virtual int IndexOf(Level item) /// public virtual void Insert(int index, Level item) { - ValidateIndex(index, true); // throws + this.ValidateIndex(index, true); // throws - if (m_count == m_array.Length) + if (this.m_count == this.m_array.Length) { - EnsureCapacity(m_count + 1); + this.EnsureCapacity(this.m_count + 1); } - if (index < m_count) + if (index < this.m_count) { - Array.Copy(m_array, index, m_array, index + 1, m_count - index); + Array.Copy(this.m_array, index, this.m_array, index + 1, this.m_count - index); } - m_array[index] = item; - m_count++; - m_version++; + this.m_array[index] = item; + this.m_count++; + this.m_version++; } /// @@ -372,14 +372,14 @@ public virtual void Insert(int index, Level item) /// public virtual void Remove(Level item) { - int i = IndexOf(item); + int i = this.IndexOf(item); if (i < 0) { throw new System.ArgumentException("Cannot remove the specified item because it was not found in the specified Collection."); } - ++m_version; - RemoveAt(i); + ++this.m_version; + this.RemoveAt(i); } /// @@ -393,21 +393,21 @@ public virtual void Remove(Level item) /// public virtual void RemoveAt(int index) { - ValidateIndex(index); // throws + this.ValidateIndex(index); // throws - m_count--; + this.m_count--; - if (index < m_count) + if (index < this.m_count) { - Array.Copy(m_array, index + 1, m_array, index, m_count - index); + Array.Copy(this.m_array, index + 1, this.m_array, index, this.m_count - index); } // We can't set the deleted entry equal to null, because it might be a value type. // Instead, we'll create an empty single-element array of the right type and copy it // over the entry we want to erase. Level[] temp = new Level[1]; - Array.Copy(temp, 0, m_array, m_count, 1); - m_version++; + Array.Copy(temp, 0, this.m_array, this.m_count, 1); + this.m_version++; } /// @@ -452,26 +452,26 @@ public virtual int Capacity { get { - return m_array.Length; + return this.m_array.Length; } set { - if (value < m_count) + if (value < this.m_count) { - value = m_count; + value = this.m_count; } - if (value != m_array.Length) + if (value != this.m_array.Length) { if (value > 0) { Level[] temp = new Level[value]; - Array.Copy(m_array, 0, temp, 0, m_count); - m_array = temp; + Array.Copy(this.m_array, 0, temp, 0, this.m_count); + this.m_array = temp; } else { - m_array = new Level[DEFAULT_CAPACITY]; + this.m_array = new Level[DEFAULT_CAPACITY]; } } } @@ -484,16 +484,16 @@ public virtual int Capacity /// The new of the LevelCollection. public virtual int AddRange(LevelCollection x) { - if (m_count + x.Count >= m_array.Length) + if (this.m_count + x.Count >= this.m_array.Length) { - EnsureCapacity(m_count + x.Count); + this.EnsureCapacity(this.m_count + x.Count); } - Array.Copy(x.m_array, 0, m_array, m_count, x.Count); - m_count += x.Count; - m_version++; + Array.Copy(x.m_array, 0, this.m_array, this.m_count, x.Count); + this.m_count += x.Count; + this.m_version++; - return m_count; + return this.m_count; } /// @@ -503,16 +503,16 @@ public virtual int AddRange(LevelCollection x) /// The new of the LevelCollection. public virtual int AddRange(Level[] x) { - if (m_count + x.Length >= m_array.Length) + if (this.m_count + x.Length >= this.m_array.Length) { - EnsureCapacity(m_count + x.Length); + this.EnsureCapacity(this.m_count + x.Length); } - Array.Copy(x, 0, m_array, m_count, x.Length); - m_count += x.Length; - m_version++; + Array.Copy(x, 0, this.m_array, this.m_count, x.Length); + this.m_count += x.Length; + this.m_version++; - return m_count; + return this.m_count; } /// @@ -522,17 +522,17 @@ public virtual int AddRange(Level[] x) /// The new of the LevelCollection. public virtual int AddRange(ICollection col) { - if (m_count + col.Count >= m_array.Length) + if (this.m_count + col.Count >= this.m_array.Length) { - EnsureCapacity(m_count + col.Count); + this.EnsureCapacity(this.m_count + col.Count); } foreach(object item in col) { - Add((Level)item); + this.Add((Level)item); } - return m_count; + return this.m_count; } /// @@ -540,7 +540,7 @@ public virtual int AddRange(ICollection col) /// public virtual void TrimToSize() { - this.Capacity = m_count; + this.Capacity = this.m_count; } #endregion @@ -554,7 +554,7 @@ public virtual void TrimToSize() /// private void ValidateIndex(int i) { - ValidateIndex(i, false); + this.ValidateIndex(i, false); } /// @@ -564,7 +564,7 @@ private void ValidateIndex(int i) /// private void ValidateIndex(int i, bool allowEqualEnd) { - int max = (allowEqualEnd) ? (m_count) : (m_count-1); + int max = (allowEqualEnd) ? (this.m_count) : (this.m_count-1); if (i < 0 || i > max) { throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("i", (object)i, "Index was out of range. Must be non-negative and less than the size of the collection. [" + (object)i + "] Specified argument was out of the range of valid values."); @@ -573,7 +573,7 @@ private void ValidateIndex(int i, bool allowEqualEnd) private void EnsureCapacity(int min) { - int newCapacity = ((m_array.Length == 0) ? DEFAULT_CAPACITY : m_array.Length * 2); + int newCapacity = ((this.m_array.Length == 0) ? DEFAULT_CAPACITY : this.m_array.Length * 2); if (newCapacity < min) { newCapacity = min; @@ -588,7 +588,7 @@ private void EnsureCapacity(int min) void ICollection.CopyTo(Array array, int start) { - Array.Copy(m_array, 0, array, start, m_count); + Array.Copy(this.m_array, 0, array, start, this.m_count); } #endregion @@ -665,9 +665,9 @@ private sealed class Enumerator : IEnumerator, ILevelCollectionEnumerator /// internal Enumerator(LevelCollection tc) { - m_collection = tc; - m_index = -1; - m_version = tc.m_version; + this.m_collection = tc; + this.m_index = -1; + this.m_version = tc.m_version; } #endregion @@ -679,7 +679,7 @@ internal Enumerator(LevelCollection tc) /// public Level Current { - get { return m_collection[m_index]; } + get { return this.m_collection[this.m_index]; } } /// @@ -694,13 +694,13 @@ public Level Current /// public bool MoveNext() { - if (m_version != m_collection.m_version) + if (this.m_version != this.m_collection.m_version) { throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute."); } - ++m_index; - return (m_index < m_collection.Count); + ++this.m_index; + return (this.m_index < this.m_collection.Count); } /// @@ -708,7 +708,7 @@ public bool MoveNext() /// public void Reset() { - m_index = -1; + this.m_index = -1; } #endregion @@ -739,7 +739,7 @@ private sealed class ReadOnlyLevelCollection : LevelCollection internal ReadOnlyLevelCollection(LevelCollection list) : base(Tag.Default) { - m_collection = list; + this.m_collection = list; } #endregion @@ -748,21 +748,21 @@ internal ReadOnlyLevelCollection(LevelCollection list) : base(Tag.Default) public override void CopyTo(Level[] array) { - m_collection.CopyTo(array); + this.m_collection.CopyTo(array); } public override void CopyTo(Level[] array, int start) { - m_collection.CopyTo(array,start); + this.m_collection.CopyTo(array,start); } public override int Count { - get { return m_collection.Count; } + get { return this.m_collection.Count; } } public override bool IsSynchronized { - get { return m_collection.IsSynchronized; } + get { return this.m_collection.IsSynchronized; } } public override object SyncRoot @@ -776,7 +776,7 @@ public override object SyncRoot public override Level this[int i] { - get { return m_collection[i]; } + get { return this.m_collection[i]; } set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); } } @@ -792,12 +792,12 @@ public override void Clear() public override bool Contains(Level x) { - return m_collection.Contains(x); + return this.m_collection.Contains(x); } public override int IndexOf(Level x) { - return m_collection.IndexOf(x); + return this.m_collection.IndexOf(x); } public override void Insert(int pos, Level x) @@ -831,7 +831,7 @@ public override bool IsReadOnly public override ILevelCollectionEnumerator GetEnumerator() { - return m_collection.GetEnumerator(); + return this.m_collection.GetEnumerator(); } #endregion @@ -841,7 +841,7 @@ public override ILevelCollectionEnumerator GetEnumerator() // (just to mimic some nice features of ArrayList) public override int Capacity { - get { return m_collection.Capacity; } + get { return this.m_collection.Capacity; } set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelEvaluator.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelEvaluator.cs index efea500fc27..5253092040d 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelEvaluator.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelEvaluator.cs @@ -86,7 +86,7 @@ public LevelEvaluator(Level threshold) throw new ArgumentNullException("threshold"); } - m_threshold = threshold; + this.m_threshold = threshold; } /// @@ -105,8 +105,8 @@ public LevelEvaluator(Level threshold) /// public Level Threshold { - get { return m_threshold; } - set { m_threshold = value; } + get { return this.m_threshold; } + set { this.m_threshold = value; } } /// @@ -131,7 +131,7 @@ public bool IsTriggeringEvent(LoggingEvent loggingEvent) throw new ArgumentNullException("loggingEvent"); } - return (loggingEvent.Level >= m_threshold); + return (loggingEvent.Level >= this.m_threshold); } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelMap.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelMap.cs index 0978475eff3..75c147fdf4e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelMap.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LevelMap.cs @@ -75,7 +75,7 @@ public LevelMap() public void Clear() { // Clear all current levels - m_mapName2Level.Clear(); + this.m_mapName2Level.Clear(); } /// @@ -101,7 +101,7 @@ public Level this[string name] lock(this) { - return (Level)m_mapName2Level[name]; + return (Level)this.m_mapName2Level[name]; } } } @@ -119,7 +119,7 @@ public Level this[string name] /// public void Add(string name, int value) { - Add(name, value, null); + this.Add(name, value, null); } /// @@ -149,7 +149,7 @@ public void Add(string name, int value, string displayName) displayName = name; } - Add(new Level(value, name, displayName)); + this.Add(new Level(value, name, displayName)); } /// @@ -169,7 +169,7 @@ public void Add(Level level) } lock(this) { - m_mapName2Level[level.Name] = level; + this.m_mapName2Level[level.Name] = level; } } @@ -188,7 +188,7 @@ public LevelCollection AllLevels { lock(this) { - return new LevelCollection(m_mapName2Level.Values); + return new LevelCollection(this.m_mapName2Level.Values); } } } @@ -220,10 +220,10 @@ public Level LookupWithDefault(Level defaultLevel) lock(this) { - Level level = (Level)m_mapName2Level[defaultLevel.Name]; + Level level = (Level)this.m_mapName2Level[defaultLevel.Name]; if (level == null) { - m_mapName2Level[defaultLevel.Name] = defaultLevel; + this.m_mapName2Level[defaultLevel.Name] = defaultLevel; return defaultLevel; } return level; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LocationInfo.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LocationInfo.cs index d8fd65abaf8..62dcb85fb8a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LocationInfo.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LocationInfo.cs @@ -81,11 +81,11 @@ public class LocationInfo public LocationInfo(Type callerStackBoundaryDeclaringType) { // Initialize all fields - m_className = NA; - m_fileName = NA; - m_lineNumber = NA; - m_methodName = NA; - m_fullInfo = NA; + this.m_className = NA; + this.m_fileName = NA; + this.m_lineNumber = NA; + this.m_methodName = NA; + this.m_fullInfo = NA; #if !(NETCF || NETSTANDARD1_3) // StackTrace isn't fully implemented for NETSTANDARD1_3 https://github.com/dotnet/corefx/issues/1797 if (callerStackBoundaryDeclaringType != null) @@ -122,13 +122,13 @@ public LocationInfo(Type callerStackBoundaryDeclaringType) // take into account the frames we skip above int adjustedFrameCount = st.FrameCount - frameIndex; ArrayList stackFramesList = new ArrayList(adjustedFrameCount); - m_stackFrames = new StackFrameItem[adjustedFrameCount]; + this.m_stackFrames = new StackFrameItem[adjustedFrameCount]; for (int i=frameIndex; i < st.FrameCount; i++) { stackFramesList.Add(new StackFrameItem(st.GetFrame(i))); } - stackFramesList.CopyTo(m_stackFrames, 0); + stackFramesList.CopyTo(this.m_stackFrames, 0); // now frameIndex is the first 'user' caller frame StackFrame locationFrame = st.GetFrame(frameIndex); @@ -139,17 +139,17 @@ public LocationInfo(Type callerStackBoundaryDeclaringType) if (method != null) { - m_methodName = method.Name; + this.m_methodName = method.Name; if (method.DeclaringType != null) { - m_className = method.DeclaringType.FullName; + this.m_className = method.DeclaringType.FullName; } } - m_fileName = locationFrame.GetFileName(); - m_lineNumber = locationFrame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo); + this.m_fileName = locationFrame.GetFileName(); + this.m_lineNumber = locationFrame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo); // Combine all location info - m_fullInfo = m_className + '.' + m_methodName + '(' + m_fileName + ':' + m_lineNumber + ')'; + this.m_fullInfo = this.m_className + '.' + this.m_methodName + '(' + this.m_fileName + ':' + this.m_lineNumber + ')'; } } } @@ -178,12 +178,12 @@ public LocationInfo(Type callerStackBoundaryDeclaringType) /// public LocationInfo(string className, string methodName, string fileName, string lineNumber) { - m_className = className; - m_fileName = fileName; - m_lineNumber = lineNumber; - m_methodName = methodName; - m_fullInfo = m_className + '.' + m_methodName + '(' + m_fileName + - ':' + m_lineNumber + ')'; + this.m_className = className; + this.m_fileName = fileName; + this.m_lineNumber = lineNumber; + this.m_methodName = methodName; + this.m_fullInfo = this.m_className + '.' + this.m_methodName + '(' + this.m_fileName + + ':' + this.m_lineNumber + ')'; } #endregion Public Instance Constructors @@ -206,7 +206,7 @@ public LocationInfo(string className, string methodName, string fileName, string /// public string ClassName { - get { return m_className; } + get { return this.m_className; } } /// @@ -222,7 +222,7 @@ public string ClassName /// public string FileName { - get { return m_fileName; } + get { return this.m_fileName; } } /// @@ -238,7 +238,7 @@ public string FileName /// public string LineNumber { - get { return m_lineNumber; } + get { return this.m_lineNumber; } } /// @@ -254,7 +254,7 @@ public string LineNumber /// public string MethodName { - get { return m_methodName; } + get { return this.m_methodName; } } /// @@ -272,7 +272,7 @@ public string MethodName /// public string FullInfo { - get { return m_fullInfo; } + get { return this.m_fullInfo; } } #if !(NETCF || NETSTANDARD1_3) @@ -281,7 +281,7 @@ public string FullInfo /// public StackFrameItem[] StackFrames { - get { return m_stackFrames; } + get { return this.m_stackFrames; } } #endif diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LogImpl.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LogImpl.cs index 0fe1046683a..aae8f791aa9 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LogImpl.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LogImpl.cs @@ -116,10 +116,10 @@ public class LogImpl : LoggerWrapperImpl, ILog public LogImpl(ILogger logger) : base(logger) { // Listen for changes to the repository - logger.Repository.ConfigurationChanged += new LoggerRepositoryConfigurationChangedEventHandler(LoggerRepositoryConfigurationChanged); + logger.Repository.ConfigurationChanged += new LoggerRepositoryConfigurationChangedEventHandler(this.LoggerRepositoryConfigurationChanged); // load the current levels - ReloadLevels(logger.Repository); + this.ReloadLevels(logger.Repository); } #endregion Public Instance Constructors @@ -137,11 +137,11 @@ protected virtual void ReloadLevels(ILoggerRepository repository) { LevelMap levelMap = repository.LevelMap; - m_levelDebug = levelMap.LookupWithDefault(Level.Debug); - m_levelInfo = levelMap.LookupWithDefault(Level.Info); - m_levelWarn = levelMap.LookupWithDefault(Level.Warn); - m_levelError = levelMap.LookupWithDefault(Level.Error); - m_levelFatal = levelMap.LookupWithDefault(Level.Fatal); + this.m_levelDebug = levelMap.LookupWithDefault(Level.Debug); + this.m_levelInfo = levelMap.LookupWithDefault(Level.Info); + this.m_levelWarn = levelMap.LookupWithDefault(Level.Warn); + this.m_levelError = levelMap.LookupWithDefault(Level.Error); + this.m_levelFatal = levelMap.LookupWithDefault(Level.Fatal); } #region Implementation of ILog @@ -171,7 +171,7 @@ protected virtual void ReloadLevels(ILoggerRepository repository) /// virtual public void Debug(object message) { - Logger.Log(ThisDeclaringType, m_levelDebug, message, null); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, message, null); } /// @@ -192,7 +192,7 @@ virtual public void Debug(object message) /// virtual public void Debug(object message, Exception exception) { - Logger.Log(ThisDeclaringType, m_levelDebug, message, exception); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, message, exception); } /// @@ -219,9 +219,9 @@ virtual public void Debug(object message, Exception exception) /// virtual public void DebugFormat(string format, params object[] args) { - if (IsDebugEnabled) + if (this.IsDebugEnabled) { - Logger.Log(ThisDeclaringType, m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } } @@ -249,9 +249,9 @@ virtual public void DebugFormat(string format, params object[] args) /// virtual public void DebugFormat(string format, object arg0) { - if (IsDebugEnabled) + if (this.IsDebugEnabled) { - Logger.Log(ThisDeclaringType, m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); } } @@ -280,9 +280,9 @@ virtual public void DebugFormat(string format, object arg0) /// virtual public void DebugFormat(string format, object arg0, object arg1) { - if (IsDebugEnabled) + if (this.IsDebugEnabled) { - Logger.Log(ThisDeclaringType, m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); } } @@ -312,9 +312,9 @@ virtual public void DebugFormat(string format, object arg0, object arg1) /// virtual public void DebugFormat(string format, object arg0, object arg1, object arg2) { - if (IsDebugEnabled) + if (this.IsDebugEnabled) { - Logger.Log(ThisDeclaringType, m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); } } @@ -338,9 +338,9 @@ virtual public void DebugFormat(string format, object arg0, object arg1, object /// virtual public void DebugFormat(IFormatProvider provider, string format, params object[] args) { - if (IsDebugEnabled) + if (this.IsDebugEnabled) { - Logger.Log(ThisDeclaringType, m_levelDebug, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelDebug, new SystemStringFormat(provider, format, args), null); } } @@ -369,7 +369,7 @@ virtual public void DebugFormat(IFormatProvider provider, string format, params /// virtual public void Info(object message) { - Logger.Log(ThisDeclaringType, m_levelInfo, message, null); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, message, null); } /// @@ -390,7 +390,7 @@ virtual public void Info(object message) /// virtual public void Info(object message, Exception exception) { - Logger.Log(ThisDeclaringType, m_levelInfo, message, exception); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, message, exception); } /// @@ -417,9 +417,9 @@ virtual public void Info(object message, Exception exception) /// virtual public void InfoFormat(string format, params object[] args) { - if (IsInfoEnabled) + if (this.IsInfoEnabled) { - Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } } @@ -447,9 +447,9 @@ virtual public void InfoFormat(string format, params object[] args) /// virtual public void InfoFormat(string format, object arg0) { - if (IsInfoEnabled) + if (this.IsInfoEnabled) { - Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); } } @@ -478,9 +478,9 @@ virtual public void InfoFormat(string format, object arg0) /// virtual public void InfoFormat(string format, object arg0, object arg1) { - if (IsInfoEnabled) + if (this.IsInfoEnabled) { - Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); } } @@ -510,9 +510,9 @@ virtual public void InfoFormat(string format, object arg0, object arg1) /// virtual public void InfoFormat(string format, object arg0, object arg1, object arg2) { - if (IsInfoEnabled) + if (this.IsInfoEnabled) { - Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); } } @@ -536,9 +536,9 @@ virtual public void InfoFormat(string format, object arg0, object arg1, object a /// virtual public void InfoFormat(IFormatProvider provider, string format, params object[] args) { - if (IsInfoEnabled) + if (this.IsInfoEnabled) { - Logger.Log(ThisDeclaringType, m_levelInfo, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelInfo, new SystemStringFormat(provider, format, args), null); } } @@ -567,7 +567,7 @@ virtual public void InfoFormat(IFormatProvider provider, string format, params o /// virtual public void Warn(object message) { - Logger.Log(ThisDeclaringType, m_levelWarn, message, null); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, message, null); } /// @@ -588,7 +588,7 @@ virtual public void Warn(object message) /// virtual public void Warn(object message, Exception exception) { - Logger.Log(ThisDeclaringType, m_levelWarn, message, exception); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, message, exception); } /// @@ -615,9 +615,9 @@ virtual public void Warn(object message, Exception exception) /// virtual public void WarnFormat(string format, params object[] args) { - if (IsWarnEnabled) + if (this.IsWarnEnabled) { - Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } } @@ -645,9 +645,9 @@ virtual public void WarnFormat(string format, params object[] args) /// virtual public void WarnFormat(string format, object arg0) { - if (IsWarnEnabled) + if (this.IsWarnEnabled) { - Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); } } @@ -676,9 +676,9 @@ virtual public void WarnFormat(string format, object arg0) /// virtual public void WarnFormat(string format, object arg0, object arg1) { - if (IsWarnEnabled) + if (this.IsWarnEnabled) { - Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); } } @@ -708,9 +708,9 @@ virtual public void WarnFormat(string format, object arg0, object arg1) /// virtual public void WarnFormat(string format, object arg0, object arg1, object arg2) { - if (IsWarnEnabled) + if (this.IsWarnEnabled) { - Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); } } @@ -734,9 +734,9 @@ virtual public void WarnFormat(string format, object arg0, object arg1, object a /// virtual public void WarnFormat(IFormatProvider provider, string format, params object[] args) { - if (IsWarnEnabled) + if (this.IsWarnEnabled) { - Logger.Log(ThisDeclaringType, m_levelWarn, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelWarn, new SystemStringFormat(provider, format, args), null); } } @@ -765,7 +765,7 @@ virtual public void WarnFormat(IFormatProvider provider, string format, params o /// virtual public void Error(object message) { - Logger.Log(ThisDeclaringType, m_levelError, message, null); + this.Logger.Log(ThisDeclaringType, this.m_levelError, message, null); } /// @@ -786,7 +786,7 @@ virtual public void Error(object message) /// virtual public void Error(object message, Exception exception) { - Logger.Log(ThisDeclaringType, m_levelError, message, exception); + this.Logger.Log(ThisDeclaringType, this.m_levelError, message, exception); } /// @@ -813,9 +813,9 @@ virtual public void Error(object message, Exception exception) /// virtual public void ErrorFormat(string format, params object[] args) { - if (IsErrorEnabled) + if (this.IsErrorEnabled) { - Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } } @@ -843,9 +843,9 @@ virtual public void ErrorFormat(string format, params object[] args) /// virtual public void ErrorFormat(string format, object arg0) { - if (IsErrorEnabled) + if (this.IsErrorEnabled) { - Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); } } @@ -874,9 +874,9 @@ virtual public void ErrorFormat(string format, object arg0) /// virtual public void ErrorFormat(string format, object arg0, object arg1) { - if (IsErrorEnabled) + if (this.IsErrorEnabled) { - Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); } } @@ -906,9 +906,9 @@ virtual public void ErrorFormat(string format, object arg0, object arg1) /// virtual public void ErrorFormat(string format, object arg0, object arg1, object arg2) { - if (IsErrorEnabled) + if (this.IsErrorEnabled) { - Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelError, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); } } @@ -932,9 +932,9 @@ virtual public void ErrorFormat(string format, object arg0, object arg1, object /// virtual public void ErrorFormat(IFormatProvider provider, string format, params object[] args) { - if (IsErrorEnabled) + if (this.IsErrorEnabled) { - Logger.Log(ThisDeclaringType, m_levelError, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelError, new SystemStringFormat(provider, format, args), null); } } @@ -963,7 +963,7 @@ virtual public void ErrorFormat(IFormatProvider provider, string format, params /// virtual public void Fatal(object message) { - Logger.Log(ThisDeclaringType, m_levelFatal, message, null); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, message, null); } /// @@ -984,7 +984,7 @@ virtual public void Fatal(object message) /// virtual public void Fatal(object message, Exception exception) { - Logger.Log(ThisDeclaringType, m_levelFatal, message, exception); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, message, exception); } /// @@ -1011,9 +1011,9 @@ virtual public void Fatal(object message, Exception exception) /// virtual public void FatalFormat(string format, params object[] args) { - if (IsFatalEnabled) + if (this.IsFatalEnabled) { - Logger.Log(ThisDeclaringType, m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, args), null); } } @@ -1041,9 +1041,9 @@ virtual public void FatalFormat(string format, params object[] args) /// virtual public void FatalFormat(string format, object arg0) { - if (IsFatalEnabled) + if (this.IsFatalEnabled) { - Logger.Log(ThisDeclaringType, m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0 }), null); } } @@ -1072,9 +1072,9 @@ virtual public void FatalFormat(string format, object arg0) /// virtual public void FatalFormat(string format, object arg0, object arg1) { - if (IsFatalEnabled) + if (this.IsFatalEnabled) { - Logger.Log(ThisDeclaringType, m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1 }), null); } } @@ -1104,9 +1104,9 @@ virtual public void FatalFormat(string format, object arg0, object arg1) /// virtual public void FatalFormat(string format, object arg0, object arg1, object arg2) { - if (IsFatalEnabled) + if (this.IsFatalEnabled) { - Logger.Log(ThisDeclaringType, m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, new SystemStringFormat(CultureInfo.InvariantCulture, format, new object[] { arg0, arg1, arg2 }), null); } } @@ -1130,9 +1130,9 @@ virtual public void FatalFormat(string format, object arg0, object arg1, object /// virtual public void FatalFormat(IFormatProvider provider, string format, params object[] args) { - if (IsFatalEnabled) + if (this.IsFatalEnabled) { - Logger.Log(ThisDeclaringType, m_levelFatal, new SystemStringFormat(provider, format, args), null); + this.Logger.Log(ThisDeclaringType, this.m_levelFatal, new SystemStringFormat(provider, format, args), null); } } @@ -1181,7 +1181,7 @@ virtual public void FatalFormat(IFormatProvider provider, string format, params /// virtual public bool IsDebugEnabled { - get { return Logger.IsEnabledFor(m_levelDebug); } + get { return this.Logger.IsEnabledFor(this.m_levelDebug); } } /// @@ -1200,7 +1200,7 @@ virtual public bool IsDebugEnabled /// virtual public bool IsInfoEnabled { - get { return Logger.IsEnabledFor(m_levelInfo); } + get { return this.Logger.IsEnabledFor(this.m_levelInfo); } } /// @@ -1219,7 +1219,7 @@ virtual public bool IsInfoEnabled /// virtual public bool IsWarnEnabled { - get { return Logger.IsEnabledFor(m_levelWarn); } + get { return this.Logger.IsEnabledFor(this.m_levelWarn); } } /// @@ -1237,7 +1237,7 @@ virtual public bool IsWarnEnabled /// virtual public bool IsErrorEnabled { - get { return Logger.IsEnabledFor(m_levelError); } + get { return this.Logger.IsEnabledFor(this.m_levelError); } } /// @@ -1255,7 +1255,7 @@ virtual public bool IsErrorEnabled /// virtual public bool IsFatalEnabled { - get { return Logger.IsEnabledFor(m_levelFatal); } + get { return this.Logger.IsEnabledFor(this.m_levelFatal); } } #endregion Implementation of ILog @@ -1272,7 +1272,7 @@ private void LoggerRepositoryConfigurationChanged(object sender, EventArgs e) ILoggerRepository repository = sender as ILoggerRepository; if (repository != null) { - ReloadLevels(repository); + this.ReloadLevels(repository); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggerWrapperImpl.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggerWrapperImpl.cs index 43eedbbadb5..dd19beb3d94 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggerWrapperImpl.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggerWrapperImpl.cs @@ -48,7 +48,7 @@ public abstract class LoggerWrapperImpl : ILoggerWrapper /// protected LoggerWrapperImpl(ILogger logger) { - m_logger = logger; + this.m_logger = logger; } #endregion Public Instance Constructors @@ -73,7 +73,7 @@ protected LoggerWrapperImpl(ILogger logger) /// virtual public ILogger Logger { - get { return m_logger; } + get { return this.m_logger; } } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggingEvent.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggingEvent.cs index 64941abddff..655588ac078 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggingEvent.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/LoggingEvent.cs @@ -115,20 +115,20 @@ public DateTime TimeStampUtc { get { - if (TimeStamp != default(DateTime) && - _timeStampUtc == default(DateTime)) + if (this.TimeStamp != default(DateTime) && + this._timeStampUtc == default(DateTime)) { // TimeStamp field has been set explicitly but TimeStampUtc hasn't // => use TimeStamp - return TimeStamp.ToUniversalTime(); + return this.TimeStamp.ToUniversalTime(); } - return _timeStampUtc; + return this._timeStampUtc; } set { - _timeStampUtc = value; + this._timeStampUtc = value; // For backwards compatibility - TimeStamp = _timeStampUtc.ToLocalTime(); + this.TimeStamp = this._timeStampUtc.ToLocalTime(); } } private DateTime _timeStampUtc; @@ -362,16 +362,16 @@ public class LoggingEvent /// public LoggingEvent(Type callerStackBoundaryDeclaringType, log4net.Repository.ILoggerRepository repository, string loggerName, Level level, object message, Exception exception) { - m_callerStackBoundaryDeclaringType = callerStackBoundaryDeclaringType; - m_message = message; - m_repository = repository; - m_thrownException = exception; + this.m_callerStackBoundaryDeclaringType = callerStackBoundaryDeclaringType; + this.m_message = message; + this.m_repository = repository; + this.m_thrownException = exception; - m_data.LoggerName = loggerName; - m_data.Level = level; + this.m_data.LoggerName = loggerName; + this.m_data.Level = level; // Store the event creation time - m_data.TimeStampUtc = DateTime.UtcNow; + this.m_data.TimeStampUtc = DateTime.UtcNow; } /// @@ -401,11 +401,11 @@ public LoggingEvent(Type callerStackBoundaryDeclaringType, log4net.Repository.IL /// public LoggingEvent(Type callerStackBoundaryDeclaringType, log4net.Repository.ILoggerRepository repository, LoggingEventData data, FixFlags fixedData) { - m_callerStackBoundaryDeclaringType = callerStackBoundaryDeclaringType; - m_repository = repository; + this.m_callerStackBoundaryDeclaringType = callerStackBoundaryDeclaringType; + this.m_repository = repository; - m_data = data; - m_fixFlags = fixedData; + this.m_data = data; + this.m_fixFlags = fixedData; } /// @@ -480,28 +480,28 @@ public LoggingEvent(LoggingEventData data) : this(null, null, data) /// protected LoggingEvent(SerializationInfo info, StreamingContext context) { - m_data.LoggerName = info.GetString("LoggerName"); + this.m_data.LoggerName = info.GetString("LoggerName"); // Note we are deserializing the whole level object. That is the // name and the value. This value is correct for the source // hierarchy but may not be for the target hierarchy that this // event may be re-logged into. If it is to be re-logged it may // be necessary to re-lookup the level based only on the name. - m_data.Level = (Level)info.GetValue("Level", typeof(Level)); - - m_data.Message = info.GetString("Message"); - m_data.ThreadName = info.GetString("ThreadName"); - m_data.TimeStampUtc = info.GetDateTime("TimeStamp").ToUniversalTime(); - m_data.LocationInfo = (LocationInfo) info.GetValue("LocationInfo", typeof(LocationInfo)); - m_data.UserName = info.GetString("UserName"); - m_data.ExceptionString = info.GetString("ExceptionString"); - m_data.Properties = (PropertiesDictionary) info.GetValue("Properties", typeof(PropertiesDictionary)); - m_data.Domain = info.GetString("Domain"); - m_data.Identity = info.GetString("Identity"); + this.m_data.Level = (Level)info.GetValue("Level", typeof(Level)); + + this.m_data.Message = info.GetString("Message"); + this.m_data.ThreadName = info.GetString("ThreadName"); + this.m_data.TimeStampUtc = info.GetDateTime("TimeStamp").ToUniversalTime(); + this.m_data.LocationInfo = (LocationInfo) info.GetValue("LocationInfo", typeof(LocationInfo)); + this.m_data.UserName = info.GetString("UserName"); + this.m_data.ExceptionString = info.GetString("ExceptionString"); + this.m_data.Properties = (PropertiesDictionary) info.GetValue("Properties", typeof(PropertiesDictionary)); + this.m_data.Domain = info.GetString("Domain"); + this.m_data.Identity = info.GetString("Identity"); // We have restored all the values of this instance, i.e. all the values are fixed // Set the fix flags otherwise the data values may be overwritten from the current environment. - m_fixFlags = FixFlags.All; + this.m_fixFlags = FixFlags.All; } #endif @@ -572,7 +572,7 @@ public static DateTime StartTimeUtc /// public Level Level { - get { return m_data.Level; } + get { return this.m_data.Level; } } /// @@ -588,7 +588,7 @@ public Level Level /// public DateTime TimeStamp { - get { return m_data.TimeStampUtc.ToLocalTime(); } + get { return this.m_data.TimeStampUtc.ToLocalTime(); } } /// @@ -599,7 +599,7 @@ public DateTime TimeStamp /// public DateTime TimeStampUtc { - get { return m_data.TimeStampUtc; } + get { return this.m_data.TimeStampUtc; } } /// @@ -615,7 +615,7 @@ public DateTime TimeStampUtc /// public string LoggerName { - get { return m_data.LoggerName; } + get { return this.m_data.LoggerName; } } /// @@ -638,11 +638,11 @@ public LocationInfo LocationInformation { get { - if (m_data.LocationInfo == null && this.m_cacheUpdatable) + if (this.m_data.LocationInfo == null && this.m_cacheUpdatable) { - m_data.LocationInfo = new LocationInfo(m_callerStackBoundaryDeclaringType); + this.m_data.LocationInfo = new LocationInfo(this.m_callerStackBoundaryDeclaringType); } - return m_data.LocationInfo; + return this.m_data.LocationInfo; } } @@ -668,7 +668,7 @@ public LocationInfo LocationInformation /// public object MessageObject { - get { return m_message; } + get { return this.m_message; } } /// @@ -693,7 +693,7 @@ public object MessageObject /// public Exception ExceptionObject { - get { return m_thrownException; } + get { return this.m_thrownException; } } /// @@ -706,7 +706,7 @@ public Exception ExceptionObject /// public ILoggerRepository Repository { - get { return m_repository; } + get { return this.m_repository; } } /// @@ -717,7 +717,7 @@ internal void EnsureRepository(ILoggerRepository repository) { if (repository != null) { - m_repository = repository; + this.m_repository = repository; } } @@ -736,27 +736,27 @@ public string RenderedMessage { get { - if (m_data.Message == null && this.m_cacheUpdatable) + if (this.m_data.Message == null && this.m_cacheUpdatable) { - if (m_message == null) + if (this.m_message == null) { - m_data.Message = ""; + this.m_data.Message = ""; } - else if (m_message is string) + else if (this.m_message is string) { - m_data.Message = (m_message as string); + this.m_data.Message = (this.m_message as string); } - else if (m_repository != null) + else if (this.m_repository != null) { - m_data.Message = m_repository.RendererMap.FindAndRender(m_message); + this.m_data.Message = this.m_repository.RendererMap.FindAndRender(this.m_message); } else { // Very last resort - m_data.Message = m_message.ToString(); + this.m_data.Message = this.m_message.ToString(); } } - return m_data.Message; + return this.m_data.Message; } } @@ -775,26 +775,26 @@ public string RenderedMessage /// public void WriteRenderedMessage(TextWriter writer) { - if (m_data.Message != null) + if (this.m_data.Message != null) { - writer.Write(m_data.Message); + writer.Write(this.m_data.Message); } else { - if (m_message != null) + if (this.m_message != null) { - if (m_message is string) + if (this.m_message is string) { - writer.Write(m_message as string); + writer.Write(this.m_message as string); } - else if (m_repository != null) + else if (this.m_repository != null) { - m_repository.RendererMap.FindAndRender(m_message, writer); + this.m_repository.RendererMap.FindAndRender(this.m_message, writer); } else { // Very last resort - writer.Write(m_message.ToString()); + writer.Write(this.m_message.ToString()); } } } @@ -816,21 +816,21 @@ public string ThreadName { get { - if (m_data.ThreadName == null && this.m_cacheUpdatable) + if (this.m_data.ThreadName == null && this.m_cacheUpdatable) { #if NETCF || NETSTANDARD1_3 // Get thread ID only m_data.ThreadName = SystemInfo.CurrentThreadId.ToString(System.Globalization.NumberFormatInfo.InvariantInfo); #else - m_data.ThreadName = System.Threading.Thread.CurrentThread.Name; - if (m_data.ThreadName == null || m_data.ThreadName.Length == 0) + this.m_data.ThreadName = System.Threading.Thread.CurrentThread.Name; + if (this.m_data.ThreadName == null || this.m_data.ThreadName.Length == 0) { // The thread name is not available. Therefore we // go the the AppDomain to get the ID of the // current thread. (Why don't Threads know their own ID?) try { - m_data.ThreadName = SystemInfo.CurrentThreadId.ToString(System.Globalization.NumberFormatInfo.InvariantInfo); + this.m_data.ThreadName = SystemInfo.CurrentThreadId.ToString(System.Globalization.NumberFormatInfo.InvariantInfo); } catch(System.Security.SecurityException) { @@ -839,12 +839,12 @@ public string ThreadName LogLog.Debug(declaringType, "Security exception while trying to get current thread ID. Error Ignored. Empty thread name."); // As a last resort use the hash code of the Thread object - m_data.ThreadName = System.Threading.Thread.CurrentThread.GetHashCode().ToString(System.Globalization.CultureInfo.InvariantCulture); + this.m_data.ThreadName = System.Threading.Thread.CurrentThread.GetHashCode().ToString(System.Globalization.CultureInfo.InvariantCulture); } } #endif } - return m_data.ThreadName; + return this.m_data.ThreadName; } } @@ -899,7 +899,7 @@ public string UserName { get { - if (m_data.UserName == null && this.m_cacheUpdatable) + if (this.m_data.UserName == null && this.m_cacheUpdatable) { #if (NETCF || SSCLI || NETSTANDARD1_3) // NETSTANDARD1_3 TODO requires platform-specific code // On compact framework there's no notion of current Windows user @@ -910,11 +910,11 @@ public string UserName WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent(); if (windowsIdentity != null && windowsIdentity.Name != null) { - m_data.UserName = windowsIdentity.Name; + this.m_data.UserName = windowsIdentity.Name; } else { - m_data.UserName = ""; + this.m_data.UserName = ""; } } catch(System.Security.SecurityException) @@ -923,11 +923,11 @@ public string UserName // some undefined set of SecurityPermission flags. LogLog.Debug(declaringType, "Security exception while trying to get current windows identity. Error Ignored. Empty user name."); - m_data.UserName = ""; + this.m_data.UserName = ""; } #endif } - return m_data.UserName; + return this.m_data.UserName; } } @@ -947,7 +947,7 @@ public string Identity { get { - if (m_data.Identity == null && this.m_cacheUpdatable) + if (this.m_data.Identity == null && this.m_cacheUpdatable) { #if (NETCF || SSCLI || NETSTANDARD1_3) // On compact framework there's no notion of current thread principals @@ -959,11 +959,11 @@ public string Identity System.Threading.Thread.CurrentPrincipal.Identity != null && System.Threading.Thread.CurrentPrincipal.Identity.Name != null) { - m_data.Identity = System.Threading.Thread.CurrentPrincipal.Identity.Name; + this.m_data.Identity = System.Threading.Thread.CurrentPrincipal.Identity.Name; } else { - m_data.Identity = ""; + this.m_data.Identity = ""; } } catch (ObjectDisposedException) @@ -973,7 +973,7 @@ public string Identity // Seen to happen on IIS 7 or greater with windows authentication. LogLog.Debug(declaringType, "Object disposed exception while trying to get current thread principal. Error Ignored. Empty identity name."); - m_data.Identity = ""; + this.m_data.Identity = ""; } catch (System.Security.SecurityException) { @@ -981,11 +981,11 @@ public string Identity // some undefined set of SecurityPermission flags. LogLog.Debug(declaringType, "Security exception while trying to get current thread principal. Error Ignored. Empty identity name."); - m_data.Identity = ""; + this.m_data.Identity = ""; } #endif } - return m_data.Identity; + return this.m_data.Identity; } } @@ -1004,11 +1004,11 @@ public string Domain { get { - if (m_data.Domain == null && this.m_cacheUpdatable) + if (this.m_data.Domain == null && this.m_cacheUpdatable) { - m_data.Domain = SystemInfo.ApplicationFriendlyName; + this.m_data.Domain = SystemInfo.ApplicationFriendlyName; } - return m_data.Domain; + return this.m_data.Domain; } } @@ -1043,16 +1043,16 @@ public PropertiesDictionary Properties get { // If we have cached properties then return that otherwise changes will be lost - if (m_data.Properties != null) + if (this.m_data.Properties != null) { - return m_data.Properties; + return this.m_data.Properties; } - if (m_eventProperties == null) + if (this.m_eventProperties == null) { - m_eventProperties = new PropertiesDictionary(); + this.m_eventProperties = new PropertiesDictionary(); } - return m_eventProperties; + return this.m_eventProperties; } } @@ -1070,7 +1070,7 @@ public PropertiesDictionary Properties /// public FixFlags Fix { - get { return m_fixFlags; } + get { return this.m_fixFlags; } set { this.FixVolatileData(value); } } @@ -1105,22 +1105,22 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte // The caller must call FixVolatileData before this object // can be serialized. - info.AddValue("LoggerName", m_data.LoggerName); - info.AddValue("Level", m_data.Level); - info.AddValue("Message", m_data.Message); - info.AddValue("ThreadName", m_data.ThreadName); + info.AddValue("LoggerName", this.m_data.LoggerName); + info.AddValue("Level", this.m_data.Level); + info.AddValue("Message", this.m_data.Message); + info.AddValue("ThreadName", this.m_data.ThreadName); // TODO: consider serializing UTC rather than local time. Not implemented here because it // would give an unexpected result if client and server have different versions of this class. // info.AddValue("TimeStamp", m_data.TimeStampUtc); #pragma warning disable 618 - info.AddValue("TimeStamp", m_data.TimeStamp); + info.AddValue("TimeStamp", this.m_data.TimeStamp); #pragma warning restore 618 - info.AddValue("LocationInfo", m_data.LocationInfo); - info.AddValue("UserName", m_data.UserName); - info.AddValue("ExceptionString", m_data.ExceptionString); - info.AddValue("Properties", m_data.Properties); - info.AddValue("Domain", m_data.Domain); - info.AddValue("Identity", m_data.Identity); + info.AddValue("LocationInfo", this.m_data.LocationInfo); + info.AddValue("UserName", this.m_data.UserName); + info.AddValue("ExceptionString", this.m_data.ExceptionString); + info.AddValue("Properties", this.m_data.Properties); + info.AddValue("Domain", this.m_data.Domain); + info.AddValue("Identity", this.m_data.Identity); } #endif @@ -1145,7 +1145,7 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte /// public LoggingEventData GetLoggingEventData() { - return GetLoggingEventData(FixFlags.Partial); + return this.GetLoggingEventData(FixFlags.Partial); } /// @@ -1161,8 +1161,8 @@ public LoggingEventData GetLoggingEventData() /// public LoggingEventData GetLoggingEventData(FixFlags fixFlags) { - Fix = fixFlags; - return m_data; + this.Fix = fixFlags; + return this.m_data; } /// @@ -1180,7 +1180,7 @@ public LoggingEventData GetLoggingEventData(FixFlags fixFlags) [Obsolete("Use GetExceptionString instead. Scheduled removal in v10.0.0.")] public string GetExceptionStrRep() { - return GetExceptionString(); + return this.GetExceptionString(); } /// @@ -1198,27 +1198,27 @@ public string GetExceptionStrRep() /// public string GetExceptionString() { - if (m_data.ExceptionString == null && this.m_cacheUpdatable) + if (this.m_data.ExceptionString == null && this.m_cacheUpdatable) { - if (m_thrownException != null) + if (this.m_thrownException != null) { - if (m_repository != null) + if (this.m_repository != null) { // Render exception using the repositories renderer map - m_data.ExceptionString = m_repository.RendererMap.FindAndRender(m_thrownException); + this.m_data.ExceptionString = this.m_repository.RendererMap.FindAndRender(this.m_thrownException); } else { // Very last resort - m_data.ExceptionString = m_thrownException.ToString(); + this.m_data.ExceptionString = this.m_thrownException.ToString(); } } else { - m_data.ExceptionString = ""; + this.m_data.ExceptionString = ""; } } - return m_data.ExceptionString; + return this.m_data.ExceptionString; } /// @@ -1248,7 +1248,7 @@ public string GetExceptionString() [Obsolete("Use Fix property. Scheduled removal in v10.0.0.")] public void FixVolatileData() { - Fix = FixFlags.All; + this.Fix = FixFlags.All; } /// @@ -1284,11 +1284,11 @@ public void FixVolatileData(bool fastButLoose) { if (fastButLoose) { - Fix = FixFlags.Partial; + this.Fix = FixFlags.Partial; } else { - Fix = FixFlags.All; + this.Fix = FixFlags.All; } } @@ -1310,10 +1310,10 @@ protected void FixVolatileData(FixFlags flags) //Unlock the cache so that new values can be stored //This may not be ideal if we are no longer in the correct context //and someone calls fix. - m_cacheUpdatable=true; + this.m_cacheUpdatable=true; // determine the flags that we are actually fixing - FixFlags updateFlags = (FixFlags)((flags ^ m_fixFlags) & flags); + FixFlags updateFlags = (FixFlags)((flags ^ this.m_fixFlags) & flags); if (updateFlags > 0) { @@ -1322,14 +1322,14 @@ protected void FixVolatileData(FixFlags flags) // Force the message to be rendered forceCreation = this.RenderedMessage; - m_fixFlags |= FixFlags.Message; + this.m_fixFlags |= FixFlags.Message; } if ((updateFlags & FixFlags.ThreadName) != 0) { // Grab the thread name forceCreation = this.ThreadName; - m_fixFlags |= FixFlags.ThreadName; + this.m_fixFlags |= FixFlags.ThreadName; } if ((updateFlags & FixFlags.LocationInfo) != 0) @@ -1337,43 +1337,43 @@ protected void FixVolatileData(FixFlags flags) // Force the location information to be loaded forceCreation = this.LocationInformation; - m_fixFlags |= FixFlags.LocationInfo; + this.m_fixFlags |= FixFlags.LocationInfo; } if ((updateFlags & FixFlags.UserName) != 0) { // Grab the user name forceCreation = this.UserName; - m_fixFlags |= FixFlags.UserName; + this.m_fixFlags |= FixFlags.UserName; } if ((updateFlags & FixFlags.Domain) != 0) { // Grab the domain name forceCreation = this.Domain; - m_fixFlags |= FixFlags.Domain; + this.m_fixFlags |= FixFlags.Domain; } if ((updateFlags & FixFlags.Identity) != 0) { // Grab the identity forceCreation = this.Identity; - m_fixFlags |= FixFlags.Identity; + this.m_fixFlags |= FixFlags.Identity; } if ((updateFlags & FixFlags.Exception) != 0) { // Force the exception text to be loaded - forceCreation = GetExceptionString(); + forceCreation = this.GetExceptionString(); - m_fixFlags |= FixFlags.Exception; + this.m_fixFlags |= FixFlags.Exception; } if ((updateFlags & FixFlags.Properties) != 0) { - CacheProperties(); + this.CacheProperties(); - m_fixFlags |= FixFlags.Properties; + this.m_fixFlags |= FixFlags.Properties; } } @@ -1383,7 +1383,7 @@ protected void FixVolatileData(FixFlags flags) } //Finaly lock everything we've cached. - m_cacheUpdatable=false; + this.m_cacheUpdatable=false; } #endregion Public Instance Methods @@ -1394,9 +1394,9 @@ private void CreateCompositeProperties() { CompositeProperties compositeProperties = new CompositeProperties(); - if (m_eventProperties != null) + if (this.m_eventProperties != null) { - compositeProperties.Add(m_eventProperties); + compositeProperties.Add(this.m_eventProperties); } #if !(NETCF || NETSTANDARD1_3) PropertiesDictionary logicalThreadProperties = LogicalThreadContext.Properties.GetProperties(false); @@ -1415,24 +1415,24 @@ private void CreateCompositeProperties() // event properties PropertiesDictionary eventProperties = new PropertiesDictionary(); - eventProperties[UserNameProperty] = UserName; - eventProperties[IdentityProperty] = Identity; + eventProperties[UserNameProperty] = this.UserName; + eventProperties[IdentityProperty] = this.Identity; compositeProperties.Add(eventProperties); compositeProperties.Add(GlobalContext.Properties.GetReadOnlyProperties()); - m_compositeProperties = compositeProperties; + this.m_compositeProperties = compositeProperties; } private void CacheProperties() { - if (m_data.Properties == null && this.m_cacheUpdatable) + if (this.m_data.Properties == null && this.m_cacheUpdatable) { - if (m_compositeProperties == null) + if (this.m_compositeProperties == null) { - CreateCompositeProperties(); + this.CreateCompositeProperties(); } - PropertiesDictionary flattenedProperties = m_compositeProperties.Flatten(); + PropertiesDictionary flattenedProperties = this.m_compositeProperties.Flatten(); PropertiesDictionary fixedProperties = new PropertiesDictionary(); @@ -1460,7 +1460,7 @@ private void CacheProperties() } } - m_data.Properties = fixedProperties; + this.m_data.Properties = fixedProperties; } } @@ -1500,15 +1500,15 @@ private void CacheProperties() /// public object LookupProperty(string key) { - if (m_data.Properties != null) + if (this.m_data.Properties != null) { - return m_data.Properties[key]; + return this.m_data.Properties[key]; } - if (m_compositeProperties == null) + if (this.m_compositeProperties == null) { - CreateCompositeProperties(); + this.CreateCompositeProperties(); } - return m_compositeProperties[key]; + return this.m_compositeProperties[key]; } /// @@ -1527,15 +1527,15 @@ public object LookupProperty(string key) /// public PropertiesDictionary GetProperties() { - if (m_data.Properties != null) + if (this.m_data.Properties != null) { - return m_data.Properties; + return this.m_data.Properties; } - if (m_compositeProperties == null) + if (this.m_compositeProperties == null) { - CreateCompositeProperties(); + this.CreateCompositeProperties(); } - return m_compositeProperties.Flatten(); + return this.m_compositeProperties.Flatten(); } #endregion Public Instance Methods diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/MethodItem.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/MethodItem.cs index e4c13ed1417..76edfb49ac6 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/MethodItem.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/MethodItem.cs @@ -45,8 +45,8 @@ public class MethodItem /// public MethodItem() { - m_name = NA; - m_parameters = new string[0]; + this.m_name = NA; + this.m_parameters = new string[0]; } /// @@ -56,7 +56,7 @@ public MethodItem() public MethodItem(string name) : this() { - m_name = name; + this.m_name = name; } /// @@ -67,7 +67,7 @@ public MethodItem(string name) public MethodItem(string name, string[] parameters) : this(name) { - m_parameters = parameters; + this.m_parameters = parameters; } /// @@ -121,7 +121,7 @@ private static string[] GetMethodParameterNames(System.Reflection.MethodBase met /// public string Name { - get { return m_name; } + get { return this.m_name; } } /// @@ -140,7 +140,7 @@ public string Name /// public string[] Parameters { - get { return m_parameters; } + get { return this.m_parameters; } } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/StackFrameItem.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/StackFrameItem.cs index b53819a72e8..5a1e3b4df7f 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/StackFrameItem.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/StackFrameItem.cs @@ -47,23 +47,23 @@ public class StackFrameItem public StackFrameItem(StackFrame frame) { // set default values - m_lineNumber = NA; - m_fileName = NA; - m_method = new MethodItem(); - m_className = NA; + this.m_lineNumber = NA; + this.m_fileName = NA; + this.m_method = new MethodItem(); + this.m_className = NA; try { // get frame values - m_lineNumber = frame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo); - m_fileName = frame.GetFileName(); + this.m_lineNumber = frame.GetFileLineNumber().ToString(System.Globalization.NumberFormatInfo.InvariantInfo); + this.m_fileName = frame.GetFileName(); // get method values MethodBase method = frame.GetMethod(); if (method != null) { if(method.DeclaringType != null) - m_className = method.DeclaringType.FullName; - m_method = new MethodItem(method); + this.m_className = method.DeclaringType.FullName; + this.m_method = new MethodItem(method); } } catch (Exception ex) @@ -72,7 +72,7 @@ public StackFrameItem(StackFrame frame) } // set full info - m_fullInfo = m_className + '.' + m_method.Name + '(' + m_fileName + ':' + m_lineNumber + ')'; + this.m_fullInfo = this.m_className + '.' + this.m_method.Name + '(' + this.m_fileName + ':' + this.m_lineNumber + ')'; } #endregion @@ -95,7 +95,7 @@ public StackFrameItem(StackFrame frame) /// public string ClassName { - get { return m_className; } + get { return this.m_className; } } /// @@ -111,7 +111,7 @@ public string ClassName /// public string FileName { - get { return m_fileName; } + get { return this.m_fileName; } } /// @@ -127,7 +127,7 @@ public string FileName /// public string LineNumber { - get { return m_lineNumber; } + get { return this.m_lineNumber; } } /// @@ -143,7 +143,7 @@ public string LineNumber /// public MethodItem Method { - get { return m_method; } + get { return this.m_method; } } /// @@ -161,7 +161,7 @@ public MethodItem Method /// public string FullInfo { - get { return m_fullInfo; } + get { return this.m_fullInfo; } } #endregion Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/TimeEvaluator.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/TimeEvaluator.cs index 4440ecf5837..d4ac8f9db2c 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/TimeEvaluator.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/TimeEvaluator.cs @@ -87,8 +87,8 @@ public TimeEvaluator() /// public TimeEvaluator(int interval) { - m_interval = interval; - m_lastTimeUtc = DateTime.UtcNow; + this.m_interval = interval; + this.m_lastTimeUtc = DateTime.UtcNow; } /// @@ -106,8 +106,8 @@ public TimeEvaluator(int interval) /// public int Interval { - get { return m_interval; } - set { m_interval = value; } + get { return this.m_interval; } + set { this.m_interval = value; } } /// @@ -131,15 +131,15 @@ public bool IsTriggeringEvent(LoggingEvent loggingEvent) } // disable the evaluator if threshold is zero - if (m_interval == 0) return false; + if (this.m_interval == 0) return false; lock (this) // avoid triggering multiple times { - TimeSpan passed = DateTime.UtcNow.Subtract(m_lastTimeUtc); + TimeSpan passed = DateTime.UtcNow.Subtract(this.m_lastTimeUtc); - if (passed.TotalSeconds > m_interval) + if (passed.TotalSeconds > this.m_interval) { - m_lastTimeUtc = DateTime.UtcNow; + this.m_lastTimeUtc = DateTime.UtcNow; return true; } else diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Core/WrapperMap.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Core/WrapperMap.cs index c778a53daf9..ee8510b8483 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Core/WrapperMap.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Core/WrapperMap.cs @@ -84,10 +84,10 @@ public class WrapperMap /// public WrapperMap(WrapperCreationHandler createWrapperHandler) { - m_createWrapperHandler = createWrapperHandler; + this.m_createWrapperHandler = createWrapperHandler; // Create the delegates for the event callbacks - m_shutdownHandler = new LoggerRepositoryShutdownEventHandler(ILoggerRepository_Shutdown); + this.m_shutdownHandler = new LoggerRepositoryShutdownEventHandler(this.ILoggerRepository_Shutdown); } #endregion Public Instance Constructors @@ -120,7 +120,7 @@ virtual public ILoggerWrapper GetWrapper(ILogger logger) lock(this) { // Lookup hierarchy in map. - Hashtable wrappersMap = (Hashtable)m_repositories[logger.Repository]; + Hashtable wrappersMap = (Hashtable)this.m_repositories[logger.Repository]; if (wrappersMap == null) { @@ -128,10 +128,10 @@ virtual public ILoggerWrapper GetWrapper(ILogger logger) // Must register with hierarchy wrappersMap = new Hashtable(); - m_repositories[logger.Repository] = wrappersMap; + this.m_repositories[logger.Repository] = wrappersMap; // Register for config reset & shutdown on repository - logger.Repository.ShutdownEvent += m_shutdownHandler; + logger.Repository.ShutdownEvent += this.m_shutdownHandler; } // Look for the wrapper object in the map @@ -142,7 +142,7 @@ virtual public ILoggerWrapper GetWrapper(ILogger logger) // No wrapper object exists for the specified logger // Create a new wrapper wrapping the logger - wrapperObject = CreateNewWrapperObject(logger); + wrapperObject = this.CreateNewWrapperObject(logger); // Store wrapper logger in map wrappersMap[logger] = wrapperObject; @@ -192,9 +192,9 @@ protected Hashtable Repositories /// virtual protected ILoggerWrapper CreateNewWrapperObject(ILogger logger) { - if (m_createWrapperHandler != null) + if (this.m_createWrapperHandler != null) { - return m_createWrapperHandler(logger); + return this.m_createWrapperHandler(logger); } return null; } @@ -217,10 +217,10 @@ virtual protected void RepositoryShutdown(ILoggerRepository repository) lock(this) { // Remove the repository from map - m_repositories.Remove(repository); + this.m_repositories.Remove(repository); // Unhook events from the repository - repository.ShutdownEvent -= m_shutdownHandler; + repository.ShutdownEvent -= this.m_shutdownHandler; } } @@ -235,7 +235,7 @@ private void ILoggerRepository_Shutdown(object sender, EventArgs e) if (repository != null) { // Remove all repository from map - RepositoryShutdown(repository); + this.RepositoryShutdown(repository); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/AbsoluteTimeDateFormatter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/AbsoluteTimeDateFormatter.cs index 67b4c1a406b..f7380deeb24 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/AbsoluteTimeDateFormatter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/AbsoluteTimeDateFormatter.cs @@ -120,7 +120,7 @@ virtual public void FormatDate(DateTime dateToFormat, TextWriter writer) } else { - timeString = (string) s_lastTimeStrings[GetType()]; + timeString = (string) s_lastTimeStrings[this.GetType()]; } if (timeString == null) @@ -131,7 +131,7 @@ virtual public void FormatDate(DateTime dateToFormat, TextWriter writer) // PERF: Try removing this lock and using a new StringBuilder each time lock(s_lastTimeBuf) { - timeString = (string) s_lastTimeStrings[GetType()]; + timeString = (string) s_lastTimeStrings[this.GetType()]; if (timeString == null) { @@ -139,7 +139,7 @@ virtual public void FormatDate(DateTime dateToFormat, TextWriter writer) s_lastTimeBuf.Length = 0; // Calculate the new string for this second - FormatDateWithoutMillis(dateToFormat, s_lastTimeBuf); + this.FormatDateWithoutMillis(dateToFormat, s_lastTimeBuf); // Render the string buffer to a string timeString = s_lastTimeBuf.ToString(); @@ -150,7 +150,7 @@ virtual public void FormatDate(DateTime dateToFormat, TextWriter writer) System.Threading.Thread.MemoryBarrier(); #endif // Store the time as a string (we only have to do this once per second) - s_lastTimeStrings[GetType()] = timeString; + s_lastTimeStrings[this.GetType()] = timeString; s_lastTimeToTheSecond = currentTimeToTheSecond; } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/DateTimeDateFormatter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/DateTimeDateFormatter.cs index 0b84834be9a..74cace1ec24 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/DateTimeDateFormatter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/DateTimeDateFormatter.cs @@ -54,7 +54,7 @@ public class DateTimeDateFormatter : AbsoluteTimeDateFormatter /// public DateTimeDateFormatter() { - m_dateTimeFormatInfo = DateTimeFormatInfo.InvariantInfo; + this.m_dateTimeFormatInfo = DateTimeFormatInfo.InvariantInfo; } #endregion Public Instance Constructors @@ -86,7 +86,7 @@ override protected void FormatDateWithoutMillis(DateTime dateToFormat, StringBui buffer.Append(day); buffer.Append(' '); - buffer.Append(m_dateTimeFormatInfo.GetAbbreviatedMonthName(dateToFormat.Month)); + buffer.Append(this.m_dateTimeFormatInfo.GetAbbreviatedMonthName(dateToFormat.Month)); buffer.Append(' '); buffer.Append(dateToFormat.Year); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/SimpleDateFormatter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/SimpleDateFormatter.cs index 8002b224e3a..cef3143736e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/SimpleDateFormatter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/DateFormatter/SimpleDateFormatter.cs @@ -56,7 +56,7 @@ public class SimpleDateFormatter : IDateFormatter /// public SimpleDateFormatter(string format) { - m_formatString = format; + this.m_formatString = format; } #endregion Public Instance Constructors @@ -76,7 +76,7 @@ public SimpleDateFormatter(string format) /// virtual public void FormatDate(DateTime dateToFormat, TextWriter writer) { - writer.Write(dateToFormat.ToString(m_formatString, System.Globalization.DateTimeFormatInfo.InvariantInfo)); + writer.Write(dateToFormat.ToString(this.m_formatString, System.Globalization.DateTimeFormatInfo.InvariantInfo)); } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/FilterSkeleton.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/FilterSkeleton.cs index 974002987fe..500adf323de 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/FilterSkeleton.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/FilterSkeleton.cs @@ -150,8 +150,8 @@ virtual public void ActivateOptions() /// public IFilter Next { - get { return m_next; } - set { m_next = value; } + get { return this.m_next; } + set { this.m_next = value; } } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelMatchFilter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelMatchFilter.cs index 169adc448d1..ba9e3b55860 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelMatchFilter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelMatchFilter.cs @@ -89,8 +89,8 @@ public LevelMatchFilter() /// public bool AcceptOnMatch { - get { return m_acceptOnMatch; } - set { m_acceptOnMatch = value; } + get { return this.m_acceptOnMatch; } + set { this.m_acceptOnMatch = value; } } /// @@ -105,8 +105,8 @@ public bool AcceptOnMatch /// public Level LevelToMatch { - get { return m_levelToMatch; } - set { m_levelToMatch = value; } + get { return this.m_levelToMatch; } + set { this.m_levelToMatch = value; } } #region Override implementation of FilterSkeleton @@ -133,10 +133,10 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) throw new ArgumentNullException("loggingEvent"); } - if (m_levelToMatch != null && m_levelToMatch == loggingEvent.Level) + if (this.m_levelToMatch != null && this.m_levelToMatch == loggingEvent.Level) { // Found match - return m_acceptOnMatch ? FilterDecision.Accept : FilterDecision.Deny; + return this.m_acceptOnMatch ? FilterDecision.Accept : FilterDecision.Deny; } return FilterDecision.Neutral; } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelRangeFilter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelRangeFilter.cs index 5f0ace9a278..71f54627aee 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelRangeFilter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LevelRangeFilter.cs @@ -93,8 +93,8 @@ public LevelRangeFilter() /// public bool AcceptOnMatch { - get { return m_acceptOnMatch; } - set { m_acceptOnMatch = value; } + get { return this.m_acceptOnMatch; } + set { this.m_acceptOnMatch = value; } } /// @@ -109,8 +109,8 @@ public bool AcceptOnMatch /// public Level LevelMin { - get { return m_levelMin; } - set { m_levelMin = value; } + get { return this.m_levelMin; } + set { this.m_levelMin = value; } } /// @@ -125,8 +125,8 @@ public Level LevelMin /// public Level LevelMax { - get { return m_levelMax; } - set { m_levelMax = value; } + get { return this.m_levelMax; } + set { this.m_levelMax = value; } } #region Override implementation of FilterSkeleton @@ -153,25 +153,25 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) throw new ArgumentNullException("loggingEvent"); } - if (m_levelMin != null) + if (this.m_levelMin != null) { - if (loggingEvent.Level < m_levelMin) + if (loggingEvent.Level < this.m_levelMin) { // level of event is less than minimum return FilterDecision.Deny; } } - if (m_levelMax != null) + if (this.m_levelMax != null) { - if (loggingEvent.Level > m_levelMax) + if (loggingEvent.Level > this.m_levelMax) { // level of event is greater than maximum return FilterDecision.Deny; } } - if (m_acceptOnMatch) + if (this.m_acceptOnMatch) { // this filter set up to bypass later filters and always return // accept if level in range diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LoggerMatchFilter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LoggerMatchFilter.cs index 7b8d1a375f2..e3de1e16236 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LoggerMatchFilter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/LoggerMatchFilter.cs @@ -89,8 +89,8 @@ public LoggerMatchFilter() /// public bool AcceptOnMatch { - get { return m_acceptOnMatch; } - set { m_acceptOnMatch = value; } + get { return this.m_acceptOnMatch; } + set { this.m_acceptOnMatch = value; } } /// @@ -107,8 +107,8 @@ public bool AcceptOnMatch /// public string LoggerToMatch { - get { return m_loggerToMatch; } - set { m_loggerToMatch = value; } + get { return this.m_loggerToMatch; } + set { this.m_loggerToMatch = value; } } #endregion @@ -141,11 +141,11 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) } // Check if we have been setup to filter - if ((m_loggerToMatch != null && m_loggerToMatch.Length != 0) && - loggingEvent.LoggerName.StartsWith(m_loggerToMatch)) + if ((this.m_loggerToMatch != null && this.m_loggerToMatch.Length != 0) && + loggingEvent.LoggerName.StartsWith(this.m_loggerToMatch)) { // we've got a match - if (m_acceptOnMatch) + if (this.m_acceptOnMatch) { return FilterDecision.Accept; } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/PropertyFilter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/PropertyFilter.cs index de2915e0717..129dc94a958 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/PropertyFilter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/PropertyFilter.cs @@ -74,8 +74,8 @@ public PropertyFilter() /// public string Key { - get { return m_key; } - set { m_key = value; } + get { return this.m_key; } + set { this.m_key = value; } } #region Override implementation of FilterSkeleton @@ -106,7 +106,7 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) } // Check if we have a key to lookup the event property value with - if (m_key == null) + if (this.m_key == null) { // We cannot filter so allow the filter chain // to continue processing @@ -115,13 +115,13 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) // Lookup the string to match in from the properties using // the key specified. - object msgObj = loggingEvent.LookupProperty(m_key); + object msgObj = loggingEvent.LookupProperty(this.m_key); // Use an ObjectRenderer to convert the property value to a string string msg = loggingEvent.Repository.RendererMap.FindAndRender(msgObj); // Check if we have been setup to filter - if (msg == null || (m_stringToMatch == null && m_regexToMatch == null)) + if (msg == null || (this.m_stringToMatch == null && this.m_regexToMatch == null)) { // We cannot filter so allow the filter chain // to continue processing @@ -129,33 +129,33 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) } // Firstly check if we are matching using a regex - if (m_regexToMatch != null) + if (this.m_regexToMatch != null) { // Check the regex - if (m_regexToMatch.Match(msg).Success == false) + if (this.m_regexToMatch.Match(msg).Success == false) { // No match, continue processing return FilterDecision.Neutral; } // we've got a match - if (m_acceptOnMatch) + if (this.m_acceptOnMatch) { return FilterDecision.Accept; } return FilterDecision.Deny; } - else if (m_stringToMatch != null) + else if (this.m_stringToMatch != null) { // Check substring match - if (msg.IndexOf(m_stringToMatch) == -1) + if (msg.IndexOf(this.m_stringToMatch) == -1) { // No match, continue processing return FilterDecision.Neutral; } // we've got a match - if (m_acceptOnMatch) + if (this.m_acceptOnMatch) { return FilterDecision.Accept; } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/StringMatchFilter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/StringMatchFilter.cs index 82624eae630..ff6bcc8c4f3 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Filter/StringMatchFilter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Filter/StringMatchFilter.cs @@ -97,12 +97,12 @@ public StringMatchFilter() /// override public void ActivateOptions() { - if (m_stringRegexToMatch != null) + if (this.m_stringRegexToMatch != null) { #if NETSTANDARD1_3 m_regexToMatch = new Regex(m_stringRegexToMatch); #else - m_regexToMatch = new Regex(m_stringRegexToMatch, RegexOptions.Compiled); + this.m_regexToMatch = new Regex(this.m_stringRegexToMatch, RegexOptions.Compiled); #endif } } @@ -125,8 +125,8 @@ override public void ActivateOptions() /// public bool AcceptOnMatch { - get { return m_acceptOnMatch; } - set { m_acceptOnMatch = value; } + get { return this.m_acceptOnMatch; } + set { this.m_acceptOnMatch = value; } } /// @@ -146,8 +146,8 @@ public bool AcceptOnMatch /// public string StringToMatch { - get { return m_stringToMatch; } - set { m_stringToMatch = value; } + get { return this.m_stringToMatch; } + set { this.m_stringToMatch = value; } } /// @@ -167,8 +167,8 @@ public string StringToMatch /// public string RegexToMatch { - get { return m_stringRegexToMatch; } - set { m_stringRegexToMatch = value; } + get { return this.m_stringRegexToMatch; } + set { this.m_stringRegexToMatch = value; } } #region Override implementation of FilterSkeleton @@ -200,7 +200,7 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) string msg = loggingEvent.RenderedMessage; // Check if we have been setup to filter - if (msg == null || (m_stringToMatch == null && m_regexToMatch == null)) + if (msg == null || (this.m_stringToMatch == null && this.m_regexToMatch == null)) { // We cannot filter so allow the filter chain // to continue processing @@ -208,33 +208,33 @@ override public FilterDecision Decide(LoggingEvent loggingEvent) } // Firstly check if we are matching using a regex - if (m_regexToMatch != null) + if (this.m_regexToMatch != null) { // Check the regex - if (m_regexToMatch.Match(msg).Success == false) + if (this.m_regexToMatch.Match(msg).Success == false) { // No match, continue processing return FilterDecision.Neutral; } // we've got a match - if (m_acceptOnMatch) + if (this.m_acceptOnMatch) { return FilterDecision.Accept; } return FilterDecision.Deny; } - else if (m_stringToMatch != null) + else if (this.m_stringToMatch != null) { // Check substring match - if (msg.IndexOf(m_stringToMatch) == -1) + if (msg.IndexOf(this.m_stringToMatch) == -1) { // No match, continue processing return FilterDecision.Neutral; } // we've got a match - if (m_acceptOnMatch) + if (this.m_acceptOnMatch) { return FilterDecision.Accept; } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/DynamicPatternLayout.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/DynamicPatternLayout.cs index 416e9dcaaa5..44455b8c56a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/DynamicPatternLayout.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/DynamicPatternLayout.cs @@ -110,12 +110,12 @@ public override string Header { get { - return m_headerPatternString.Format(); + return this.m_headerPatternString.Format(); } set { base.Header = value; - m_headerPatternString = new PatternString(value); + this.m_headerPatternString = new PatternString(value); } } /* property DynamicPatternLayout Header */ @@ -134,12 +134,12 @@ public override string Footer { get { - return m_footerPatternString.Format(); + return this.m_footerPatternString.Format(); } set { base.Footer = value; - m_footerPatternString = new PatternString(value); + this.m_footerPatternString = new PatternString(value); } } /* property DynamicPatternLayout Footer */ #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Layout2RawLayoutAdapter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Layout2RawLayoutAdapter.cs index 6755192bcdf..c94ab7f0e1d 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Layout2RawLayoutAdapter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Layout2RawLayoutAdapter.cs @@ -64,7 +64,7 @@ public class Layout2RawLayoutAdapter : IRawLayout /// public Layout2RawLayoutAdapter(ILayout layout) { - m_layout = layout; + this.m_layout = layout; } #endregion @@ -88,7 +88,7 @@ public Layout2RawLayoutAdapter(ILayout layout) virtual public object Format(LoggingEvent loggingEvent) { StringWriter writer = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - m_layout.Format(writer, loggingEvent); + this.m_layout.Format(writer, loggingEvent); return writer.ToString(); } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/LayoutSkeleton.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/LayoutSkeleton.cs index 4ede8f21bec..d12dd2f56d4 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/LayoutSkeleton.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/LayoutSkeleton.cs @@ -154,7 +154,7 @@ protected LayoutSkeleton() public string Format(LoggingEvent loggingEvent) { StringWriter writer = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - Format(writer, loggingEvent); + this.Format(writer, loggingEvent); return writer.ToString(); } @@ -189,8 +189,8 @@ virtual public string ContentType /// virtual public string Header { - get { return m_header; } - set { m_header = value; } + get { return this.m_header; } + set { this.m_header = value; } } /// @@ -205,8 +205,8 @@ virtual public string Header /// virtual public string Footer { - get { return m_footer; } - set { m_footer = value; } + get { return this.m_footer; } + set { this.m_footer = value; } } /// @@ -227,8 +227,8 @@ virtual public string Footer /// virtual public bool IgnoresException { - get { return m_ignoresException; } - set { m_ignoresException = value; } + get { return this.m_ignoresException; } + set { this.m_ignoresException = value; } } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetCachePatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetCachePatternConverter.cs index d5668e7a68c..47ac867340c 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetCachePatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetCachePatternConverter.cs @@ -61,9 +61,9 @@ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, Ht { if (HttpRuntime.Cache != null) { - if (Option != null) + if (this.Option != null) { - WriteObject(writer, loggingEvent.Repository, HttpRuntime.Cache[Option]); + WriteObject(writer, loggingEvent.Repository, HttpRuntime.Cache[this.Option]); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetContextPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetContextPatternConverter.cs index cc402ba8a95..3ee3e3e835e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetContextPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetContextPatternConverter.cs @@ -57,9 +57,9 @@ internal sealed class AspNetContextPatternConverter : AspNetPatternLayoutConvert /// protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext) { - if (Option != null) + if (this.Option != null) { - WriteObject(writer, loggingEvent.Repository, httpContext.Items[Option]); + WriteObject(writer, loggingEvent.Repository, httpContext.Items[this.Option]); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetPatternConverter.cs index 0d5af4b74c4..66bde1fa57b 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetPatternConverter.cs @@ -51,7 +51,7 @@ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent) } else { - Convert(writer, loggingEvent, HttpContext.Current); + this.Convert(writer, loggingEvent, HttpContext.Current); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetRequestPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetRequestPatternConverter.cs index 0ac87578d81..351ce5e31aa 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetRequestPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetRequestPatternConverter.cs @@ -70,9 +70,9 @@ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, Ht if (request != null) { - if (Option != null) + if (this.Option != null) { - WriteObject(writer, loggingEvent.Repository, httpContext.Request.Params[Option]); + WriteObject(writer, loggingEvent.Repository, httpContext.Request.Params[this.Option]); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetSessionPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetSessionPatternConverter.cs index 36065560e10..7462a80bfd4 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetSessionPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/AspNetSessionPatternConverter.cs @@ -61,9 +61,9 @@ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, Ht { if (httpContext.Session != null) { - if (Option != null) + if (this.Option != null) { - WriteObject(writer, loggingEvent.Repository, httpContext.Session.Contents[Option]); + WriteObject(writer, loggingEvent.Repository, httpContext.Session.Contents[this.Option]); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/DatePatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/DatePatternConverter.cs index f2f7211eefe..b5cd2e4764f 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/DatePatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/DatePatternConverter.cs @@ -117,7 +117,7 @@ internal class DatePatternConverter : PatternLayoutConverter, IOptionHandler /// public void ActivateOptions() { - string dateFormatStr = Option; + string dateFormatStr = this.Option; if (dateFormatStr == null) { dateFormatStr = AbsoluteTimeDateFormatter.Iso8601TimeDateFormat; @@ -125,26 +125,26 @@ public void ActivateOptions() if (SystemInfo.EqualsIgnoringCase(dateFormatStr, AbsoluteTimeDateFormatter.Iso8601TimeDateFormat)) { - m_dateFormatter = new Iso8601DateFormatter(); + this.m_dateFormatter = new Iso8601DateFormatter(); } else if (SystemInfo.EqualsIgnoringCase(dateFormatStr, AbsoluteTimeDateFormatter.AbsoluteTimeDateFormat)) { - m_dateFormatter = new AbsoluteTimeDateFormatter(); + this.m_dateFormatter = new AbsoluteTimeDateFormatter(); } else if (SystemInfo.EqualsIgnoringCase(dateFormatStr, AbsoluteTimeDateFormatter.DateAndTimeDateFormat)) { - m_dateFormatter = new DateTimeDateFormatter(); + this.m_dateFormatter = new DateTimeDateFormatter(); } else { try { - m_dateFormatter = new SimpleDateFormatter(dateFormatStr); + this.m_dateFormatter = new SimpleDateFormatter(dateFormatStr); } catch (Exception e) { LogLog.Error(declaringType, "Could not instantiate SimpleDateFormatter with ["+dateFormatStr+"]", e); - m_dateFormatter = new Iso8601DateFormatter(); + this.m_dateFormatter = new Iso8601DateFormatter(); } } } @@ -169,7 +169,7 @@ override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) { try { - m_dateFormatter.FormatDate(loggingEvent.TimeStamp, writer); + this.m_dateFormatter.FormatDate(loggingEvent.TimeStamp, writer); } catch (Exception ex) { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/ExceptionPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/ExceptionPatternConverter.cs index cd675463967..c85b84ff080 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/ExceptionPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/ExceptionPatternConverter.cs @@ -52,7 +52,7 @@ internal sealed class ExceptionPatternConverter : PatternLayoutConverter public ExceptionPatternConverter() { // This converter handles the exception - IgnoresException = false; + this.IgnoresException = false; } /// @@ -96,9 +96,9 @@ public ExceptionPatternConverter() /// override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) { - if (loggingEvent.ExceptionObject != null && Option != null && Option.Length > 0) + if (loggingEvent.ExceptionObject != null && this.Option != null && this.Option.Length > 0) { - switch (Option.ToLower()) + switch (this.Option.ToLower()) { case "message": WriteObject(writer, loggingEvent.Repository, loggingEvent.ExceptionObject.Message); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/NamedPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/NamedPatternConverter.cs index 97b28b597bd..318a00dba60 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/NamedPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/NamedPatternConverter.cs @@ -70,11 +70,11 @@ public abstract class NamedPatternConverter : PatternLayoutConverter, IOptionHan /// public void ActivateOptions() { - m_precision = 0; + this.m_precision = 0; - if (Option != null) + if (this.Option != null) { - string optStr = Option.Trim(); + string optStr = this.Option.Trim(); if (optStr.Length > 0) { int precisionVal; @@ -86,7 +86,7 @@ public void ActivateOptions() } else { - m_precision = precisionVal; + this.m_precision = precisionVal; } } else @@ -126,8 +126,8 @@ public void ActivateOptions() /// sealed override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) { - string name = GetFullyQualifiedName(loggingEvent); - if (m_precision <= 0 || name == null || name.Length < 2) + string name = this.GetFullyQualifiedName(loggingEvent); + if (this.m_precision <= 0 || name == null || name.Length < 2) { writer.Write(name); } @@ -143,7 +143,7 @@ sealed override protected void Convert(TextWriter writer, LoggingEvent loggingEv } int end = name.LastIndexOf(DOT); - for(int i = 1; end > 0 && i < m_precision; i++) + for(int i = 1; end > 0 && i < this.m_precision; i++) { end = name.LastIndexOf('.', end - 1); } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PatternLayoutConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PatternLayoutConverter.cs index ba4eac5cc05..58b8acd1444 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PatternLayoutConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PatternLayoutConverter.cs @@ -75,8 +75,8 @@ protected PatternLayoutConverter() /// virtual public bool IgnoresException { - get { return m_ignoresException; } - set { m_ignoresException = value; } + get { return this.m_ignoresException; } + set { this.m_ignoresException = value; } } #endregion Public Properties @@ -106,7 +106,7 @@ override protected void Convert(TextWriter writer, object state) LoggingEvent loggingEvent = state as LoggingEvent; if (loggingEvent != null) { - Convert(writer, loggingEvent); + this.Convert(writer, loggingEvent); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PropertyPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PropertyPatternConverter.cs index bf637cf5199..a9b75942585 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PropertyPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/PropertyPatternConverter.cs @@ -66,10 +66,10 @@ internal sealed class PropertyPatternConverter : PatternLayoutConverter /// override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) { - if (Option != null) + if (this.Option != null) { // Write the value for the specified key - WriteObject(writer, loggingEvent.Repository, loggingEvent.LookupProperty(Option)); + WriteObject(writer, loggingEvent.Repository, loggingEvent.LookupProperty(this.Option)); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/StackTracePatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/StackTracePatternConverter.cs index fa4e80f361a..7b97a6dd96a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/StackTracePatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/StackTracePatternConverter.cs @@ -62,10 +62,10 @@ internal class StackTracePatternConverter : PatternLayoutConverter, IOptionHandl /// public void ActivateOptions() { - if (Option == null) + if (this.Option == null) return; - string optStr = Option.Trim(); + string optStr = this.Option.Trim(); if (optStr.Length != 0) { int stackLevelVal; @@ -77,7 +77,7 @@ public void ActivateOptions() } else { - m_stackFrameLevel = stackLevelVal; + this.m_stackFrameLevel = stackLevelVal; } } else @@ -106,7 +106,7 @@ override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) return; } - int stackFrameIndex = m_stackFrameLevel - 1; + int stackFrameIndex = this.m_stackFrameLevel - 1; while (stackFrameIndex >= 0) { if (stackFrameIndex >= stackframes.Length) @@ -116,7 +116,7 @@ override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) } StackFrameItem stackFrame = stackframes[stackFrameIndex]; - writer.Write("{0}.{1}", stackFrame.ClassName, GetMethodInformation(stackFrame.Method)); + writer.Write("{0}.{1}", stackFrame.ClassName, this.GetMethodInformation(stackFrame.Method)); if (stackFrameIndex > 0) { // TODO: make this user settable? diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/UtcDatePatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/UtcDatePatternConverter.cs index a86771072cb..6d6361caf91 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/UtcDatePatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/Pattern/UtcDatePatternConverter.cs @@ -71,7 +71,7 @@ override protected void Convert(TextWriter writer, LoggingEvent loggingEvent) { try { - m_dateFormatter.FormatDate(loggingEvent.TimeStampUtc, writer); + this.m_dateFormatter.FormatDate(loggingEvent.TimeStampUtc, writer); } catch (Exception ex) { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/PatternLayout.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/PatternLayout.cs index 67936a1d93c..752716047ac 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/PatternLayout.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/PatternLayout.cs @@ -986,15 +986,15 @@ public PatternLayout() : this(DefaultConversionPattern) public PatternLayout(string pattern) { // By default we do not process the exception - IgnoresException = true; + this.IgnoresException = true; - m_pattern = pattern; - if (m_pattern == null) + this.m_pattern = pattern; + if (this.m_pattern == null) { - m_pattern = DefaultConversionPattern; + this.m_pattern = DefaultConversionPattern; } - ActivateOptions(); + this.ActivateOptions(); } #endregion @@ -1011,8 +1011,8 @@ public PatternLayout(string pattern) /// public string ConversionPattern { - get { return m_pattern; } - set { m_pattern = value; } + get { return this.m_pattern; } + set { this.m_pattern = value; } } /// @@ -1039,7 +1039,7 @@ virtual protected PatternParser CreatePatternParser(string pattern) patternParser.PatternConverters[entry.Key] = converterInfo; } // Add the instance patterns - foreach(DictionaryEntry entry in m_instanceRulesRegistry) + foreach(DictionaryEntry entry in this.m_instanceRulesRegistry) { patternParser.PatternConverters[entry.Key] = entry.Value; } @@ -1067,9 +1067,9 @@ virtual protected PatternParser CreatePatternParser(string pattern) /// override public void ActivateOptions() { - m_head = CreatePatternParser(m_pattern).Parse(); + this.m_head = this.CreatePatternParser(this.m_pattern).Parse(); - PatternConverter curConverter = m_head; + PatternConverter curConverter = this.m_head; while(curConverter != null) { PatternLayoutConverter layoutConverter = curConverter as PatternLayoutConverter; @@ -1113,7 +1113,7 @@ override public void Format(TextWriter writer, LoggingEvent loggingEvent) throw new ArgumentNullException("loggingEvent"); } - PatternConverter c = m_head; + PatternConverter c = this.m_head; // loop through the chain of pattern converters while(c != null) @@ -1143,7 +1143,7 @@ public void AddConverter(ConverterInfo converterInfo) { throw new ArgumentException("The converter type specified [" + converterInfo.Type + "] must be a subclass of log4net.Util.PatternConverter", "converterInfo"); } - m_instanceRulesRegistry[converterInfo.Name] = converterInfo; + this.m_instanceRulesRegistry[converterInfo.Name] = converterInfo; } /// @@ -1171,7 +1171,7 @@ public void AddConverter(string name, Type type) converterInfo.Name = name; converterInfo.Type = type; - AddConverter(converterInfo); + this.AddConverter(converterInfo); } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/RawPropertyLayout.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/RawPropertyLayout.cs index 5401812d67f..32763a50704 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/RawPropertyLayout.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/RawPropertyLayout.cs @@ -66,8 +66,8 @@ public RawPropertyLayout() /// public string Key { - get { return m_key; } - set { m_key = value; } + get { return this.m_key; } + set { this.m_key = value; } } #region Implementation of IRawLayout @@ -86,7 +86,7 @@ public string Key /// public virtual object Format(LoggingEvent loggingEvent) { - return loggingEvent.LookupProperty(m_key); + return loggingEvent.LookupProperty(this.m_key); } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/SimpleLayout.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/SimpleLayout.cs index d6f75012f90..06efaa6399e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/SimpleLayout.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/SimpleLayout.cs @@ -53,7 +53,7 @@ public class SimpleLayout : LayoutSkeleton /// public SimpleLayout() { - IgnoresException = true; + this.IgnoresException = true; } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayout.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayout.cs index 8fa8a434ff6..51cad690689 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayout.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayout.cs @@ -121,8 +121,8 @@ public XmlLayout(bool locationInfo) : base(locationInfo) /// public string Prefix { - get { return m_prefix; } - set { m_prefix = value; } + get { return this.m_prefix; } + set { this.m_prefix = value; } } @@ -141,8 +141,8 @@ public string Prefix /// public bool Base64EncodeMessage { - get {return m_base64Message;} - set {m_base64Message=value;} + get {return this.m_base64Message;} + set {this.m_base64Message=value;} } /// @@ -160,8 +160,8 @@ public bool Base64EncodeMessage /// public bool Base64EncodeProperties { - get {return m_base64Properties;} - set {m_base64Properties=value;} + get {return this.m_base64Properties;} + set {this.m_base64Properties=value;} } @@ -193,14 +193,14 @@ override public void ActivateOptions() base.ActivateOptions(); // Cache the full element names including the prefix - if (m_prefix != null && m_prefix.Length > 0) + if (this.m_prefix != null && this.m_prefix.Length > 0) { - m_elmEvent = m_prefix + ":" + ELM_EVENT; - m_elmMessage = m_prefix + ":" + ELM_MESSAGE; - m_elmProperties = m_prefix + ":" + ELM_PROPERTIES; - m_elmData = m_prefix + ":" + ELM_DATA; - m_elmException = m_prefix + ":" + ELM_EXCEPTION; - m_elmLocation = m_prefix + ":" + ELM_LOCATION; + this.m_elmEvent = this.m_prefix + ":" + ELM_EVENT; + this.m_elmMessage = this.m_prefix + ":" + ELM_MESSAGE; + this.m_elmProperties = this.m_prefix + ":" + ELM_PROPERTIES; + this.m_elmData = this.m_prefix + ":" + ELM_DATA; + this.m_elmException = this.m_prefix + ":" + ELM_EXCEPTION; + this.m_elmLocation = this.m_prefix + ":" + ELM_LOCATION; } } @@ -221,7 +221,7 @@ override public void ActivateOptions() /// override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent) { - writer.WriteStartElement(m_elmEvent); + writer.WriteStartElement(this.m_elmEvent); writer.WriteAttributeString(ATTR_LOGGER, loggingEvent.LoggerName); #if NET_2_0 || NETCF_2_0 || MONO_2_0 || NETSTANDARD1_3 @@ -247,7 +247,7 @@ override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent) } // Append the message text - writer.WriteStartElement(m_elmMessage); + writer.WriteStartElement(this.m_elmMessage); if (!this.Base64EncodeMessage) { Transform.WriteEscapedXmlString(writer, loggingEvent.RenderedMessage, this.InvalidCharReplacement); @@ -265,10 +265,10 @@ override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent) // Append the properties text if (properties.Count > 0) { - writer.WriteStartElement(m_elmProperties); + writer.WriteStartElement(this.m_elmProperties); foreach(System.Collections.DictionaryEntry entry in properties) { - writer.WriteStartElement(m_elmData); + writer.WriteStartElement(this.m_elmData); writer.WriteAttributeString(ATTR_NAME, Transform.MaskXmlInvalidCharacters((string)entry.Key,this.InvalidCharReplacement)); // Use an ObjectRenderer to convert the object to a string @@ -293,16 +293,16 @@ override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent) if (exceptionStr != null && exceptionStr.Length > 0) { // Append the stack trace line - writer.WriteStartElement(m_elmException); + writer.WriteStartElement(this.m_elmException); Transform.WriteEscapedXmlString(writer, exceptionStr,this.InvalidCharReplacement); writer.WriteEndElement(); } - if (LocationInfo) + if (this.LocationInfo) { LocationInfo locationInfo = loggingEvent.LocationInformation; - writer.WriteStartElement(m_elmLocation); + writer.WriteStartElement(this.m_elmLocation); writer.WriteAttributeString(ATTR_CLASS, locationInfo.ClassName); writer.WriteAttributeString(ATTR_METHOD, locationInfo.MethodName); writer.WriteAttributeString(ATTR_FILE, locationInfo.FileName); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayoutBase.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayoutBase.cs index b8c3499963b..f656ec11a32 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayoutBase.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XMLLayoutBase.cs @@ -60,7 +60,7 @@ abstract public class XmlLayoutBase : LayoutSkeleton /// protected XmlLayoutBase() : this(false) { - IgnoresException = false; + this.IgnoresException = false; } /// @@ -82,8 +82,8 @@ protected XmlLayoutBase() : this(false) /// protected XmlLayoutBase(bool locationInfo) { - IgnoresException = false; - m_locationInfo = locationInfo; + this.IgnoresException = false; + this.m_locationInfo = locationInfo; } #endregion Protected Instance Constructors @@ -112,8 +112,8 @@ protected XmlLayoutBase(bool locationInfo) /// public bool LocationInfo { - get { return m_locationInfo; } - set { m_locationInfo = value; } + get { return this.m_locationInfo; } + set { this.m_locationInfo = value; } } /// /// The string to replace characters that can not be expressed in XML with. @@ -130,8 +130,8 @@ public bool LocationInfo /// public string InvalidCharReplacement { - get {return m_invalidCharReplacement;} - set {m_invalidCharReplacement=value;} + get {return this.m_invalidCharReplacement;} + set {this.m_invalidCharReplacement=value;} } #endregion @@ -213,7 +213,7 @@ override public void Format(TextWriter writer, LoggingEvent loggingEvent) xmlWriter.Namespaces = false; #endif // Write the event to the writer - FormatXml(xmlWriter, loggingEvent); + this.FormatXml(xmlWriter, loggingEvent); xmlWriter.WriteWhitespace(SystemInfo.NewLine); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XmlLayoutSchemaLog4j.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XmlLayoutSchemaLog4j.cs index 12575ee8abd..14f0f6f6870 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XmlLayoutSchemaLog4j.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Layout/XmlLayoutSchemaLog4j.cs @@ -237,7 +237,7 @@ override protected void FormatXml(XmlWriter writer, LoggingEvent loggingEvent) writer.WriteEndElement(); } - if (LocationInfo) + if (this.LocationInfo) { LocationInfo locationInfo = loggingEvent.LocationInformation; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/DefaultRenderer.cs b/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/DefaultRenderer.cs index c2c90cca9b0..e3f84bc09ee 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/DefaultRenderer.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/DefaultRenderer.cs @@ -165,7 +165,7 @@ public void RenderObject(RendererMap rendererMap, object obj, TextWriter writer) Array objArray = obj as Array; if (objArray != null) { - RenderArray(rendererMap, objArray, writer); + this.RenderArray(rendererMap, objArray, writer); return; } @@ -190,24 +190,24 @@ public void RenderObject(RendererMap rendererMap, object obj, TextWriter writer) IDictionary objDictionary = obj as IDictionary; if (objDictionary != null) { - RenderEnumerator(rendererMap, objDictionary.GetEnumerator(), writer); + this.RenderEnumerator(rendererMap, objDictionary.GetEnumerator(), writer); return; } - RenderEnumerator(rendererMap, objEnumerable.GetEnumerator(), writer); + this.RenderEnumerator(rendererMap, objEnumerable.GetEnumerator(), writer); return; } IEnumerator objEnumerator = obj as IEnumerator; if (objEnumerator != null) { - RenderEnumerator(rendererMap, objEnumerator, writer); + this.RenderEnumerator(rendererMap, objEnumerator, writer); return; } if (obj is DictionaryEntry) { - RenderDictionaryEntry(rendererMap, (DictionaryEntry)obj, writer); + this.RenderDictionaryEntry(rendererMap, (DictionaryEntry)obj, writer); return; } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/RendererMap.cs b/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/RendererMap.cs index b32452350fa..664957df220 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/RendererMap.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/ObjectRenderer/RendererMap.cs @@ -72,7 +72,7 @@ public class RendererMap /// public RendererMap() { - m_map = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable()); + this.m_map = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable()); } #endregion @@ -99,7 +99,7 @@ public string FindAndRender(object obj) } StringWriter stringWriter = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - FindAndRender(obj, stringWriter); + this.FindAndRender(obj, stringWriter); return stringWriter.ToString(); } @@ -136,7 +136,7 @@ public void FindAndRender(object obj, TextWriter writer) // Lookup the renderer for the specific type try { - Get(obj.GetType()).RenderObject(this, obj, writer); + this.Get(obj.GetType()).RenderObject(this, obj, writer); } catch(Exception ex) { @@ -194,7 +194,7 @@ public IObjectRenderer Get(Object obj) } else { - return Get(obj.GetType()); + return this.Get(obj.GetType()); } } @@ -220,7 +220,7 @@ public IObjectRenderer Get(Type type) IObjectRenderer result = null; // Check cache - result = (IObjectRenderer)m_cache[type]; + result = (IObjectRenderer)this.m_cache[type]; if (result == null) { @@ -231,7 +231,7 @@ public IObjectRenderer Get(Type type) #endif { // Search the type's interfaces - result = SearchTypeAndInterfaces(cur); + result = this.SearchTypeAndInterfaces(cur); if (result != null) { break; @@ -245,7 +245,7 @@ public IObjectRenderer Get(Type type) } // Add to cache - m_cache[type] = result; + this.m_cache[type] = result; } return result; @@ -258,7 +258,7 @@ public IObjectRenderer Get(Type type) /// the renderer for the specified type private IObjectRenderer SearchTypeAndInterfaces(Type type) { - IObjectRenderer r = (IObjectRenderer)m_map[type]; + IObjectRenderer r = (IObjectRenderer)this.m_map[type]; if (r != null) { return r; @@ -267,7 +267,7 @@ private IObjectRenderer SearchTypeAndInterfaces(Type type) { foreach(Type t in type.GetInterfaces()) { - r = SearchTypeAndInterfaces(t); + r = this.SearchTypeAndInterfaces(t); if (r != null) { return r; @@ -303,8 +303,8 @@ public IObjectRenderer DefaultRenderer /// public void Clear() { - m_map.Clear(); - m_cache.Clear(); + this.m_map.Clear(); + this.m_cache.Clear(); } /// @@ -321,7 +321,7 @@ public void Clear() /// public void Put(Type typeToRender, IObjectRenderer renderer) { - m_cache.Clear(); + this.m_cache.Clear(); if (typeToRender == null) { @@ -332,7 +332,7 @@ public void Put(Type typeToRender, IObjectRenderer renderer) throw new ArgumentNullException("renderer"); } - m_map[typeToRender] = renderer; + this.m_map[typeToRender] = renderer; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginCollection.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginCollection.cs index fe7673d318a..85b54e0c4b2 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginCollection.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginCollection.cs @@ -104,7 +104,7 @@ public static PluginCollection ReadOnly(PluginCollection list) /// public PluginCollection() { - m_array = new IPlugin[DEFAULT_CAPACITY]; + this.m_array = new IPlugin[DEFAULT_CAPACITY]; } /// @@ -116,7 +116,7 @@ public PluginCollection() /// public PluginCollection(int capacity) { - m_array = new IPlugin[capacity]; + this.m_array = new IPlugin[capacity]; } /// @@ -126,8 +126,8 @@ public PluginCollection(int capacity) /// The PluginCollection whose elements are copied to the new collection. public PluginCollection(PluginCollection c) { - m_array = new IPlugin[c.Count]; - AddRange(c); + this.m_array = new IPlugin[c.Count]; + this.AddRange(c); } /// @@ -137,8 +137,8 @@ public PluginCollection(PluginCollection c) /// The array whose elements are copied to the new list. public PluginCollection(IPlugin[] a) { - m_array = new IPlugin[a.Length]; - AddRange(a); + this.m_array = new IPlugin[a.Length]; + this.AddRange(a); } /// @@ -148,8 +148,8 @@ public PluginCollection(IPlugin[] a) /// The collection whose elements are copied to the new list. public PluginCollection(ICollection col) { - m_array = new IPlugin[col.Count]; - AddRange(col); + this.m_array = new IPlugin[col.Count]; + this.AddRange(col); } /// @@ -172,7 +172,7 @@ protected internal enum Tag /// protected internal PluginCollection(Tag tag) { - m_array = null; + this.m_array = null; } #endregion @@ -184,7 +184,7 @@ protected internal PluginCollection(Tag tag) /// public virtual int Count { - get { return m_count; } + get { return this.m_count; } } /// @@ -205,12 +205,12 @@ public virtual void CopyTo(IPlugin[] array) /// The zero-based index in at which copying begins. public virtual void CopyTo(IPlugin[] array, int start) { - if (m_count > array.GetUpperBound(0) + 1 - start) + if (this.m_count > array.GetUpperBound(0) + 1 - start) { throw new System.ArgumentException("Destination array was not long enough."); } - Array.Copy(m_array, 0, array, start, m_count); + Array.Copy(this.m_array, 0, array, start, this.m_count); } /// @@ -230,7 +230,7 @@ public virtual bool IsSynchronized /// public virtual object SyncRoot { - get { return m_array; } + get { return this.m_array; } } #endregion @@ -253,14 +253,14 @@ public virtual IPlugin this[int index] { get { - ValidateIndex(index); // throws - return m_array[index]; + this.ValidateIndex(index); // throws + return this.m_array[index]; } set { - ValidateIndex(index); // throws - ++m_version; - m_array[index] = value; + this.ValidateIndex(index); // throws + ++this.m_version; + this.m_array[index] = value; } } @@ -271,15 +271,15 @@ public virtual IPlugin this[int index] /// The index at which the value has been added. public virtual int Add(IPlugin item) { - if (m_count == m_array.Length) + if (this.m_count == this.m_array.Length) { - EnsureCapacity(m_count + 1); + this.EnsureCapacity(this.m_count + 1); } - m_array[m_count] = item; - m_version++; + this.m_array[this.m_count] = item; + this.m_version++; - return m_count++; + return this.m_count++; } /// @@ -287,9 +287,9 @@ public virtual int Add(IPlugin item) /// public virtual void Clear() { - ++m_version; - m_array = new IPlugin[DEFAULT_CAPACITY]; - m_count = 0; + ++this.m_version; + this.m_array = new IPlugin[DEFAULT_CAPACITY]; + this.m_count = 0; } /// @@ -298,10 +298,10 @@ public virtual void Clear() /// A new with a shallow copy of the collection data. public virtual object Clone() { - PluginCollection newCol = new PluginCollection(m_count); - Array.Copy(m_array, 0, newCol.m_array, 0, m_count); - newCol.m_count = m_count; - newCol.m_version = m_version; + PluginCollection newCol = new PluginCollection(this.m_count); + Array.Copy(this.m_array, 0, newCol.m_array, 0, this.m_count); + newCol.m_count = this.m_count; + newCol.m_version = this.m_version; return newCol; } @@ -313,9 +313,9 @@ public virtual object Clone() /// true if is found in the PluginCollection; otherwise, false. public virtual bool Contains(IPlugin item) { - for (int i=0; i != m_count; ++i) + for (int i=0; i != this.m_count; ++i) { - if (m_array[i].Equals(item)) + if (this.m_array[i].Equals(item)) { return true; } @@ -334,9 +334,9 @@ public virtual bool Contains(IPlugin item) /// public virtual int IndexOf(IPlugin item) { - for (int i=0; i != m_count; ++i) + for (int i=0; i != this.m_count; ++i) { - if (m_array[i].Equals(item)) + if (this.m_array[i].Equals(item)) { return i; } @@ -356,21 +356,21 @@ public virtual int IndexOf(IPlugin item) /// public virtual void Insert(int index, IPlugin item) { - ValidateIndex(index, true); // throws + this.ValidateIndex(index, true); // throws - if (m_count == m_array.Length) + if (this.m_count == this.m_array.Length) { - EnsureCapacity(m_count + 1); + this.EnsureCapacity(this.m_count + 1); } - if (index < m_count) + if (index < this.m_count) { - Array.Copy(m_array, index, m_array, index + 1, m_count - index); + Array.Copy(this.m_array, index, this.m_array, index + 1, this.m_count - index); } - m_array[index] = item; - m_count++; - m_version++; + this.m_array[index] = item; + this.m_count++; + this.m_version++; } /// @@ -382,13 +382,13 @@ public virtual void Insert(int index, IPlugin item) /// public virtual void Remove(IPlugin item) { - int i = IndexOf(item); + int i = this.IndexOf(item); if (i < 0) { throw new System.ArgumentException("Cannot remove the specified item because it was not found in the specified Collection."); } - ++m_version; - RemoveAt(i); + ++this.m_version; + this.RemoveAt(i); } /// @@ -402,21 +402,21 @@ public virtual void Remove(IPlugin item) /// public virtual void RemoveAt(int index) { - ValidateIndex(index); // throws + this.ValidateIndex(index); // throws - m_count--; + this.m_count--; - if (index < m_count) + if (index < this.m_count) { - Array.Copy(m_array, index + 1, m_array, index, m_count - index); + Array.Copy(this.m_array, index + 1, this.m_array, index, this.m_count - index); } // We can't set the deleted entry equal to null, because it might be a value type. // Instead, we'll create an empty single-element array of the right type and copy it // over the entry we want to erase. IPlugin[] temp = new IPlugin[1]; - Array.Copy(temp, 0, m_array, m_count, 1); - m_version++; + Array.Copy(temp, 0, this.m_array, this.m_count, 1); + this.m_version++; } /// @@ -464,26 +464,26 @@ public virtual int Capacity { get { - return m_array.Length; + return this.m_array.Length; } set { - if (value < m_count) + if (value < this.m_count) { - value = m_count; + value = this.m_count; } - if (value != m_array.Length) + if (value != this.m_array.Length) { if (value > 0) { IPlugin[] temp = new IPlugin[value]; - Array.Copy(m_array, 0, temp, 0, m_count); - m_array = temp; + Array.Copy(this.m_array, 0, temp, 0, this.m_count); + this.m_array = temp; } else { - m_array = new IPlugin[DEFAULT_CAPACITY]; + this.m_array = new IPlugin[DEFAULT_CAPACITY]; } } } @@ -496,16 +496,16 @@ public virtual int Capacity /// The new of the PluginCollection. public virtual int AddRange(PluginCollection x) { - if (m_count + x.Count >= m_array.Length) + if (this.m_count + x.Count >= this.m_array.Length) { - EnsureCapacity(m_count + x.Count); + this.EnsureCapacity(this.m_count + x.Count); } - Array.Copy(x.m_array, 0, m_array, m_count, x.Count); - m_count += x.Count; - m_version++; + Array.Copy(x.m_array, 0, this.m_array, this.m_count, x.Count); + this.m_count += x.Count; + this.m_version++; - return m_count; + return this.m_count; } /// @@ -515,16 +515,16 @@ public virtual int AddRange(PluginCollection x) /// The new of the PluginCollection. public virtual int AddRange(IPlugin[] x) { - if (m_count + x.Length >= m_array.Length) + if (this.m_count + x.Length >= this.m_array.Length) { - EnsureCapacity(m_count + x.Length); + this.EnsureCapacity(this.m_count + x.Length); } - Array.Copy(x, 0, m_array, m_count, x.Length); - m_count += x.Length; - m_version++; + Array.Copy(x, 0, this.m_array, this.m_count, x.Length); + this.m_count += x.Length; + this.m_version++; - return m_count; + return this.m_count; } /// @@ -534,17 +534,17 @@ public virtual int AddRange(IPlugin[] x) /// The new of the PluginCollection. public virtual int AddRange(ICollection col) { - if (m_count + col.Count >= m_array.Length) + if (this.m_count + col.Count >= this.m_array.Length) { - EnsureCapacity(m_count + col.Count); + this.EnsureCapacity(this.m_count + col.Count); } foreach(object item in col) { - Add((IPlugin)item); + this.Add((IPlugin)item); } - return m_count; + return this.m_count; } /// @@ -552,7 +552,7 @@ public virtual int AddRange(ICollection col) /// public virtual void TrimToSize() { - this.Capacity = m_count; + this.Capacity = this.m_count; } #endregion @@ -566,7 +566,7 @@ public virtual void TrimToSize() /// private void ValidateIndex(int i) { - ValidateIndex(i, false); + this.ValidateIndex(i, false); } /// @@ -576,7 +576,7 @@ private void ValidateIndex(int i) /// private void ValidateIndex(int i, bool allowEqualEnd) { - int max = (allowEqualEnd) ? (m_count) : (m_count-1); + int max = (allowEqualEnd) ? (this.m_count) : (this.m_count-1); if (i < 0 || i > max) { throw log4net.Util.SystemInfo.CreateArgumentOutOfRangeException("i", (object)i, "Index was out of range. Must be non-negative and less than the size of the collection. [" + (object)i + "] Specified argument was out of the range of valid values."); @@ -585,7 +585,7 @@ private void ValidateIndex(int i, bool allowEqualEnd) private void EnsureCapacity(int min) { - int newCapacity = ((m_array.Length == 0) ? DEFAULT_CAPACITY : m_array.Length * 2); + int newCapacity = ((this.m_array.Length == 0) ? DEFAULT_CAPACITY : this.m_array.Length * 2); if (newCapacity < min) { newCapacity = min; @@ -600,7 +600,7 @@ private void EnsureCapacity(int min) void ICollection.CopyTo(Array array, int start) { - Array.Copy(m_array, 0, array, start, m_count); + Array.Copy(this.m_array, 0, array, start, this.m_count); } #endregion @@ -678,9 +678,9 @@ private sealed class Enumerator : IEnumerator, IPluginCollectionEnumerator /// internal Enumerator(PluginCollection tc) { - m_collection = tc; - m_index = -1; - m_version = tc.m_version; + this.m_collection = tc; + this.m_index = -1; + this.m_version = tc.m_version; } #endregion @@ -695,7 +695,7 @@ internal Enumerator(PluginCollection tc) /// public IPlugin Current { - get { return m_collection[m_index]; } + get { return this.m_collection[this.m_index]; } } /// @@ -710,13 +710,13 @@ public IPlugin Current /// public bool MoveNext() { - if (m_version != m_collection.m_version) + if (this.m_version != this.m_collection.m_version) { throw new System.InvalidOperationException("Collection was modified; enumeration operation may not execute."); } - ++m_index; - return (m_index < m_collection.Count); + ++this.m_index; + return (this.m_index < this.m_collection.Count); } /// @@ -724,7 +724,7 @@ public bool MoveNext() /// public void Reset() { - m_index = -1; + this.m_index = -1; } #endregion @@ -756,7 +756,7 @@ private sealed class ReadOnlyPluginCollection : PluginCollection internal ReadOnlyPluginCollection(PluginCollection list) : base(Tag.Default) { - m_collection = list; + this.m_collection = list; } #endregion @@ -765,21 +765,21 @@ internal ReadOnlyPluginCollection(PluginCollection list) : base(Tag.Default) public override void CopyTo(IPlugin[] array) { - m_collection.CopyTo(array); + this.m_collection.CopyTo(array); } public override void CopyTo(IPlugin[] array, int start) { - m_collection.CopyTo(array,start); + this.m_collection.CopyTo(array,start); } public override int Count { - get { return m_collection.Count; } + get { return this.m_collection.Count; } } public override bool IsSynchronized { - get { return m_collection.IsSynchronized; } + get { return this.m_collection.IsSynchronized; } } public override object SyncRoot @@ -793,7 +793,7 @@ public override object SyncRoot public override IPlugin this[int i] { - get { return m_collection[i]; } + get { return this.m_collection[i]; } set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); } } @@ -809,12 +809,12 @@ public override void Clear() public override bool Contains(IPlugin x) { - return m_collection.Contains(x); + return this.m_collection.Contains(x); } public override int IndexOf(IPlugin x) { - return m_collection.IndexOf(x); + return this.m_collection.IndexOf(x); } public override void Insert(int pos, IPlugin x) @@ -848,7 +848,7 @@ public override bool IsReadOnly public override IPluginCollectionEnumerator GetEnumerator() { - return m_collection.GetEnumerator(); + return this.m_collection.GetEnumerator(); } #endregion @@ -858,7 +858,7 @@ public override IPluginCollectionEnumerator GetEnumerator() // (just to mimic some nice features of ArrayList) public override int Capacity { - get { return m_collection.Capacity; } + get { return this.m_collection.Capacity; } set { throw new NotSupportedException("This is a Read Only Collection and can not be modified"); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginMap.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginMap.cs index 675435ec685..54e75ba1c9b 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginMap.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginMap.cs @@ -56,7 +56,7 @@ public sealed class PluginMap /// public PluginMap(ILoggerRepository repository) { - m_repository = repository; + this.m_repository = repository; } #endregion Public Instance Constructors @@ -88,7 +88,7 @@ public IPlugin this[string name] lock(this) { - return (IPlugin)m_mapName2Plugin[name]; + return (IPlugin)this.m_mapName2Plugin[name]; } } } @@ -108,7 +108,7 @@ public PluginCollection AllPlugins { lock(this) { - return new PluginCollection(m_mapName2Plugin.Values); + return new PluginCollection(this.m_mapName2Plugin.Values); } } } @@ -144,10 +144,10 @@ public void Add(IPlugin plugin) lock(this) { // Get the current plugin if it exists - curPlugin = m_mapName2Plugin[plugin.Name] as IPlugin; + curPlugin = this.m_mapName2Plugin[plugin.Name] as IPlugin; // Store new plugin - m_mapName2Plugin[plugin.Name] = plugin; + this.m_mapName2Plugin[plugin.Name] = plugin; } // Shutdown existing plugin with same name @@ -157,7 +157,7 @@ public void Add(IPlugin plugin) } // Attach new plugin to repository - plugin.Attach(m_repository); + plugin.Attach(this.m_repository); } /// @@ -177,7 +177,7 @@ public void Remove(IPlugin plugin) } lock(this) { - m_mapName2Plugin.Remove(plugin.Name); + this.m_mapName2Plugin.Remove(plugin.Name); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginSkeleton.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginSkeleton.cs index fd152285343..ac570152872 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginSkeleton.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/PluginSkeleton.cs @@ -50,7 +50,7 @@ public abstract class PluginSkeleton : IPlugin /// protected PluginSkeleton(string name) { - m_name = name; + this.m_name = name; } #endregion Protected Instance Constructors @@ -76,8 +76,8 @@ protected PluginSkeleton(string name) /// public virtual string Name { - get { return m_name; } - set { m_name = value; } + get { return this.m_name; } + set { this.m_name = value; } } /// @@ -94,7 +94,7 @@ public virtual string Name /// public virtual void Attach(ILoggerRepository repository) { - m_repository = repository; + this.m_repository = repository; } /// diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/RemoteLoggingServerPlugin.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/RemoteLoggingServerPlugin.cs index ea338100375..5859b64660a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/RemoteLoggingServerPlugin.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Plugin/RemoteLoggingServerPlugin.cs @@ -82,7 +82,7 @@ public RemoteLoggingServerPlugin() : base("RemoteLoggingServerPlugin:Unset URI") /// public RemoteLoggingServerPlugin(string sinkUri) : base("RemoteLoggingServerPlugin:"+sinkUri) { - m_sinkUri = sinkUri; + this.m_sinkUri = sinkUri; } #endregion Public Instance Constructors @@ -103,8 +103,8 @@ public RemoteLoggingServerPlugin(string sinkUri) : base("RemoteLoggingServerPlug /// public virtual string SinkUri { - get { return m_sinkUri; } - set { m_sinkUri = value; } + get { return this.m_sinkUri; } + set { this.m_sinkUri = value; } } #endregion Public Instance Properties @@ -131,11 +131,11 @@ override public void Attach(ILoggerRepository repository) base.Attach(repository); // Create the sink and marshal it - m_sink = new RemoteLoggingSinkImpl(repository); + this.m_sink = new RemoteLoggingSinkImpl(repository); try { - RemotingServices.Marshal(m_sink, m_sinkUri, typeof(IRemoteLoggingSink)); + RemotingServices.Marshal(this.m_sink, this.m_sinkUri, typeof(IRemoteLoggingSink)); } catch(Exception ex) { @@ -158,8 +158,8 @@ override public void Attach(ILoggerRepository repository) override public void Shutdown() { // Stops the sink from receiving messages - RemotingServices.Disconnect(m_sink); - m_sink = null; + RemotingServices.Disconnect(this.m_sink); + this.m_sink = null; base.Shutdown(); } @@ -211,7 +211,7 @@ private class RemoteLoggingSinkImpl : MarshalByRefObject, IRemoteLoggingSink /// public RemoteLoggingSinkImpl(ILoggerRepository repository) { - m_repository = repository; + this.m_repository = repository; } #endregion Public Instance Constructors @@ -235,7 +235,7 @@ public void LogEvents(LoggingEvent[] events) { if (logEvent != null) { - m_repository.Log(logEvent); + this.m_repository.Log(logEvent); } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/ConfigurationChangedEventArgs.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/ConfigurationChangedEventArgs.cs index 366c9b02e7b..1782f12de7d 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/ConfigurationChangedEventArgs.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/ConfigurationChangedEventArgs.cs @@ -49,7 +49,7 @@ public ConfigurationChangedEventArgs(ICollection configurationMessages) /// public ICollection ConfigurationMessages { - get { return configurationMessages; } + get { return this.configurationMessages; } } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Hierarchy.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Hierarchy.cs index 108a8ce327f..26eca251046 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Hierarchy.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Hierarchy.cs @@ -72,7 +72,7 @@ public class LoggerCreationEventArgs : EventArgs /// public LoggerCreationEventArgs(Logger log) { - m_log = log; + this.m_log = log; } /// @@ -88,7 +88,7 @@ public LoggerCreationEventArgs(Logger log) /// public Logger Logger { - get { return m_log; } + get { return this.m_log; } } } @@ -137,8 +137,8 @@ public class Hierarchy : LoggerRepositorySkeleton, IBasicRepositoryConfigurator, /// public event LoggerCreationEventHandler LoggerCreatedEvent { - add { m_loggerCreatedEvent += value; } - remove { m_loggerCreatedEvent -= value; } + add { this.m_loggerCreatedEvent += value; } + remove { this.m_loggerCreatedEvent -= value; } } #endregion Public Events @@ -202,9 +202,9 @@ public Hierarchy(PropertiesDictionary properties, ILoggerFactory loggerFactory) throw new ArgumentNullException("loggerFactory"); } - m_defaultFactory = loggerFactory; + this.m_defaultFactory = loggerFactory; - m_ht = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable()); + this.m_ht = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable()); } #endregion Public Instance Constructors @@ -222,8 +222,8 @@ public Hierarchy(PropertiesDictionary properties, ILoggerFactory loggerFactory) /// public bool EmittedNoAppenderWarning { - get { return m_emittedNoAppenderWarning; } - set { m_emittedNoAppenderWarning = value; } + get { return this.m_emittedNoAppenderWarning; } + set { this.m_emittedNoAppenderWarning = value; } } /// @@ -238,22 +238,22 @@ public Logger Root { get { - if (m_root == null) + if (this.m_root == null) { lock(this) { - if (m_root == null) + if (this.m_root == null) { // Create the root logger - Logger root = m_defaultFactory.CreateLogger(this, null); + Logger root = this.m_defaultFactory.CreateLogger(this, null); root.Hierarchy = this; // Store root - m_root = root; + this.m_root = root; } } } - return m_root; + return this.m_root; } } @@ -268,14 +268,14 @@ public Logger Root /// public ILoggerFactory LoggerFactory { - get { return m_defaultFactory; } + get { return this.m_defaultFactory; } set { if (value == null) { throw new ArgumentNullException("value"); } - m_defaultFactory = value; + this.m_defaultFactory = value; } } @@ -301,9 +301,9 @@ override public ILogger Exists(string name) throw new ArgumentNullException("name"); } - lock(m_ht) + lock(this.m_ht) { - return m_ht[new LoggerKey(name)] as Logger; + return this.m_ht[new LoggerKey(name)] as Logger; } } @@ -323,12 +323,12 @@ override public ILogger[] GetCurrentLoggers() // The accumulation in loggers is necessary because not all elements in // ht are Logger objects as there might be some ProvisionNodes // as well. - lock(m_ht) + lock(this.m_ht) { - System.Collections.ArrayList loggers = new System.Collections.ArrayList(m_ht.Count); + System.Collections.ArrayList loggers = new System.Collections.ArrayList(this.m_ht.Count); // Iterate through m_ht values - foreach(object node in m_ht.Values) + foreach(object node in this.m_ht.Values) { if (node is Logger) { @@ -363,7 +363,7 @@ override public ILogger GetLogger(string name) throw new ArgumentNullException("name"); } - return GetLogger(name, m_defaultFactory); + return this.GetLogger(name, this.m_defaultFactory); } /// @@ -392,9 +392,9 @@ override public void Shutdown() LogLog.Debug(declaringType, "Shutdown called on Hierarchy ["+this.Name+"]"); // begin by closing nested appenders - Root.CloseNestedAppenders(); + this.Root.CloseNestedAppenders(); - lock(m_ht) + lock(this.m_ht) { ILogger[] currentLoggers = this.GetCurrentLoggers(); @@ -404,7 +404,7 @@ override public void Shutdown() } // then, remove all appenders - Root.RemoveAllAppenders(); + this.Root.RemoveAllAppenders(); foreach(Logger logger in currentLoggers) { @@ -437,13 +437,13 @@ override public void Shutdown() /// override public void ResetConfiguration() { - Root.Level = LevelMap.LookupWithDefault(Level.Debug); - Threshold = LevelMap.LookupWithDefault(Level.All); + this.Root.Level = this.LevelMap.LookupWithDefault(Level.Debug); + this.Threshold = this.LevelMap.LookupWithDefault(Level.All); // the synchronization is needed to prevent hashtable surprises - lock(m_ht) + lock(this.m_ht) { - Shutdown(); // nested locks are OK + this.Shutdown(); // nested locks are OK foreach(Logger l in this.GetCurrentLoggers()) { @@ -455,7 +455,7 @@ override public void ResetConfiguration() base.ResetConfiguration(); // Notify listeners - OnConfigurationChanged(null); + this.OnConfigurationChanged(null); } /// @@ -481,7 +481,7 @@ override public void Log(LoggingEvent logEvent) throw new ArgumentNullException("logEvent"); } - this.GetLogger(logEvent.LoggerName, m_defaultFactory).Log(logEvent); + this.GetLogger(logEvent.LoggerName, this.m_defaultFactory).Log(logEvent); } /// @@ -502,9 +502,9 @@ override public Appender.IAppender[] GetAppenders() { System.Collections.ArrayList appenderList = new System.Collections.ArrayList(); - CollectAppenders(appenderList, Root); + CollectAppenders(appenderList, this.Root); - foreach(Logger logger in GetCurrentLoggers()) + foreach(Logger logger in this.GetCurrentLoggers()) { CollectAppenders(appenderList, logger); } @@ -559,7 +559,7 @@ private static void CollectAppenders(System.Collections.ArrayList appenderList, /// the appender to use to log all logging events void IBasicRepositoryConfigurator.Configure(IAppender appender) { - BasicRepositoryConfigure(appender); + this.BasicRepositoryConfigure(appender); } /// @@ -568,7 +568,7 @@ void IBasicRepositoryConfigurator.Configure(IAppender appender) /// the appenders to use to log all logging events void IBasicRepositoryConfigurator.Configure(params IAppender[] appenders) { - BasicRepositoryConfigure(appenders); + this.BasicRepositoryConfigure(appenders); } /// @@ -590,16 +590,16 @@ protected void BasicRepositoryConfigure(params IAppender[] appenders) { foreach (IAppender appender in appenders) { - Root.AddAppender(appender); + this.Root.AddAppender(appender); } } - Configured = true; + this.Configured = true; - ConfigurationMessages = configurationMessages; + this.ConfigurationMessages = configurationMessages; // Notify listeners - OnConfigurationChanged(new ConfigurationChangedEventArgs(configurationMessages)); + this.OnConfigurationChanged(new ConfigurationChangedEventArgs(configurationMessages)); } #endregion Implementation of IBasicRepositoryConfigurator @@ -612,7 +612,7 @@ protected void BasicRepositoryConfigure(params IAppender[] appenders) /// the element containing the root of the config void IXmlRepositoryConfigurator.Configure(System.Xml.XmlElement element) { - XmlRepositoryConfigure(element); + this.XmlRepositoryConfigure(element); } /// @@ -636,12 +636,12 @@ protected void XmlRepositoryConfigure(System.Xml.XmlElement element) config.Configure(element); } - Configured = true; + this.Configured = true; - ConfigurationMessages = configurationMessages; + this.ConfigurationMessages = configurationMessages; // Notify listeners - OnConfigurationChanged(new ConfigurationChangedEventArgs(configurationMessages)); + this.OnConfigurationChanged(new ConfigurationChangedEventArgs(configurationMessages)); } #endregion Implementation of IXmlRepositoryConfigurator @@ -677,9 +677,9 @@ public bool IsDisabled(Level level) throw new ArgumentNullException("level"); } - if (Configured) + if (this.Configured) { - return Threshold > level; + return this.Threshold > level; } else { @@ -704,9 +704,9 @@ public bool IsDisabled(Level level) /// public void Clear() { - lock(m_ht) + lock(this.m_ht) { - m_ht.Clear(); + this.m_ht.Clear(); } } @@ -742,18 +742,18 @@ public Logger GetLogger(string name, ILoggerFactory factory) // GetEffectiveLevel() method) are possible only if variable // assignments are non-atomic. - lock(m_ht) + lock(this.m_ht) { Logger logger = null; - Object node = m_ht[key]; + Object node = this.m_ht[key]; if (node == null) { logger = factory.CreateLogger(this, name); logger.Hierarchy = this; - m_ht[key] = logger; - UpdateParents(logger); - OnLoggerCreationEvent(logger); + this.m_ht[key] = logger; + this.UpdateParents(logger); + this.OnLoggerCreationEvent(logger); return logger; } @@ -768,10 +768,10 @@ public Logger GetLogger(string name, ILoggerFactory factory) { logger = factory.CreateLogger(this, name); logger.Hierarchy = this; - m_ht[key] = logger; + this.m_ht[key] = logger; UpdateChildren(nodeProvisionNode, logger); - UpdateParents(logger); - OnLoggerCreationEvent(logger); + this.UpdateParents(logger); + this.OnLoggerCreationEvent(logger); return logger; } @@ -793,7 +793,7 @@ public Logger GetLogger(string name, ILoggerFactory factory) /// protected virtual void OnLoggerCreationEvent(Logger logger) { - LoggerCreationEventHandler handler = m_loggerCreatedEvent; + LoggerCreationEventHandler handler = this.m_loggerCreatedEvent; if (handler != null) { handler(this, new LoggerCreationEventArgs(logger)); @@ -851,12 +851,12 @@ private void UpdateParents(Logger log) string substr = name.Substring(0, i); LoggerKey key = new LoggerKey(substr); // simple constructor - Object node = m_ht[key]; + Object node = this.m_ht[key]; // Create a provision node for a future parent. if (node == null) { ProvisionNode pn = new ProvisionNode(log); - m_ht[key] = pn; + this.m_ht[key] = pn; } else { @@ -954,7 +954,7 @@ internal void AddLevel(LevelEntry levelEntry) // Lookup replacement value if (levelEntry.Value == -1) { - Level previousLevel = LevelMap[levelEntry.Name]; + Level previousLevel = this.LevelMap[levelEntry.Name]; if (previousLevel == null) { throw new InvalidOperationException("Cannot redefine level ["+levelEntry.Name+"] because it is not defined in the LevelMap. To define the level supply the level value."); @@ -963,7 +963,7 @@ internal void AddLevel(LevelEntry levelEntry) levelEntry.Value = previousLevel.Value; } - LevelMap.Add(levelEntry.Name, levelEntry.Value, levelEntry.DisplayName); + this.LevelMap.Add(levelEntry.Name, levelEntry.Value, levelEntry.DisplayName); } /// @@ -991,8 +991,8 @@ internal class LevelEntry /// public int Value { - get { return m_levelValue; } - set { m_levelValue = value; } + get { return this.m_levelValue; } + set { this.m_levelValue = value; } } /// @@ -1008,8 +1008,8 @@ public int Value /// public string Name { - get { return m_levelName; } - set { m_levelName = value; } + get { return this.m_levelName; } + set { this.m_levelName = value; } } /// @@ -1025,8 +1025,8 @@ public string Name /// public string DisplayName { - get { return m_levelDisplayName; } - set { m_levelDisplayName = value; } + get { return this.m_levelDisplayName; } + set { this.m_levelDisplayName = value; } } /// @@ -1035,7 +1035,7 @@ public string DisplayName /// string info about this object public override string ToString() { - return "LevelEntry(Value="+m_levelValue+", Name="+m_levelName+", DisplayName="+m_levelDisplayName+")"; + return "LevelEntry(Value="+this.m_levelValue+", Name="+this.m_levelName+", DisplayName="+this.m_levelDisplayName+")"; } } @@ -1056,7 +1056,7 @@ internal void AddProperty(PropertyEntry propertyEntry) if (propertyEntry == null) throw new ArgumentNullException("propertyEntry"); if (propertyEntry.Key == null) throw new ArgumentNullException("propertyEntry.Key"); - Properties[propertyEntry.Key] = propertyEntry.Value; + this.Properties[propertyEntry.Key] = propertyEntry.Value; } #endregion Private Instance Methods diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Logger.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Logger.cs index e12323cd6a0..c439bf8cfbb 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Logger.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/Logger.cs @@ -81,7 +81,7 @@ protected Logger(string name) // NETCF: String.Intern causes Native Exception m_name = name; #else - m_name = string.Intern(name); + this.m_name = string.Intern(name); #endif } @@ -103,8 +103,8 @@ protected Logger(string name) /// virtual public Logger Parent { - get { return m_parent; } - set { m_parent = value; } + get { return this.m_parent; } + set { this.m_parent = value; } } /// @@ -126,8 +126,8 @@ virtual public Logger Parent /// virtual public bool Additivity { - get { return m_additive; } - set { m_additive = value; } + get { return this.m_additive; } + set { this.m_additive = value; } } /// @@ -173,8 +173,8 @@ virtual public Level EffectiveLevel /// virtual public Hierarchy Hierarchy { - get { return m_hierarchy; } - set { m_hierarchy = value; } + get { return this.m_hierarchy; } + set { this.m_hierarchy = value; } } /// @@ -190,8 +190,8 @@ virtual public Hierarchy Hierarchy /// virtual public Level Level { - get { return m_level; } - set { m_level = value; } + get { return this.m_level; } + set { this.m_level = value; } } #endregion Public Instance Properties @@ -220,18 +220,18 @@ virtual public void AddAppender(IAppender newAppender) throw new ArgumentNullException("newAppender"); } - m_appenderLock.AcquireWriterLock(); + this.m_appenderLock.AcquireWriterLock(); try { - if (m_appenderAttachedImpl == null) + if (this.m_appenderAttachedImpl == null) { - m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); + this.m_appenderAttachedImpl = new log4net.Util.AppenderAttachedImpl(); } - m_appenderAttachedImpl.AddAppender(newAppender); + this.m_appenderAttachedImpl.AddAppender(newAppender); } finally { - m_appenderLock.ReleaseWriterLock(); + this.m_appenderLock.ReleaseWriterLock(); } } @@ -251,21 +251,21 @@ virtual public AppenderCollection Appenders { get { - m_appenderLock.AcquireReaderLock(); + this.m_appenderLock.AcquireReaderLock(); try { - if (m_appenderAttachedImpl == null) + if (this.m_appenderAttachedImpl == null) { return AppenderCollection.EmptyCollection; } else { - return m_appenderAttachedImpl.Appenders; + return this.m_appenderAttachedImpl.Appenders; } } finally { - m_appenderLock.ReleaseReaderLock(); + this.m_appenderLock.ReleaseReaderLock(); } } } @@ -282,19 +282,19 @@ virtual public AppenderCollection Appenders /// virtual public IAppender GetAppender(string name) { - m_appenderLock.AcquireReaderLock(); + this.m_appenderLock.AcquireReaderLock(); try { - if (m_appenderAttachedImpl == null || name == null) + if (this.m_appenderAttachedImpl == null || name == null) { return null; } - return m_appenderAttachedImpl.GetAppender(name); + return this.m_appenderAttachedImpl.GetAppender(name); } finally { - m_appenderLock.ReleaseReaderLock(); + this.m_appenderLock.ReleaseReaderLock(); } } @@ -311,18 +311,18 @@ virtual public IAppender GetAppender(string name) /// virtual public void RemoveAllAppenders() { - m_appenderLock.AcquireWriterLock(); + this.m_appenderLock.AcquireWriterLock(); try { - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - m_appenderAttachedImpl.RemoveAllAppenders(); - m_appenderAttachedImpl = null; + this.m_appenderAttachedImpl.RemoveAllAppenders(); + this.m_appenderAttachedImpl = null; } } finally { - m_appenderLock.ReleaseWriterLock(); + this.m_appenderLock.ReleaseWriterLock(); } } @@ -341,17 +341,17 @@ virtual public void RemoveAllAppenders() /// virtual public IAppender RemoveAppender(IAppender appender) { - m_appenderLock.AcquireWriterLock(); + this.m_appenderLock.AcquireWriterLock(); try { - if (appender != null && m_appenderAttachedImpl != null) + if (appender != null && this.m_appenderAttachedImpl != null) { - return m_appenderAttachedImpl.RemoveAppender(appender); + return this.m_appenderAttachedImpl.RemoveAppender(appender); } } finally { - m_appenderLock.ReleaseWriterLock(); + this.m_appenderLock.ReleaseWriterLock(); } return null; } @@ -371,17 +371,17 @@ virtual public IAppender RemoveAppender(IAppender appender) /// virtual public IAppender RemoveAppender(string name) { - m_appenderLock.AcquireWriterLock(); + this.m_appenderLock.AcquireWriterLock(); try { - if (name != null && m_appenderAttachedImpl != null) + if (name != null && this.m_appenderAttachedImpl != null) { - return m_appenderAttachedImpl.RemoveAppender(name); + return this.m_appenderAttachedImpl.RemoveAppender(name); } } finally { - m_appenderLock.ReleaseWriterLock(); + this.m_appenderLock.ReleaseWriterLock(); } return null; } @@ -403,7 +403,7 @@ virtual public IAppender RemoveAppender(string name) /// virtual public string Name { - get { return m_name; } + get { return this.m_name; } } /// @@ -427,9 +427,9 @@ virtual public void Log(Type callerStackBoundaryDeclaringType, Level level, obje { try { - if (IsEnabledFor(level)) + if (this.IsEnabledFor(level)) { - ForcedLog((callerStackBoundaryDeclaringType != null) ? callerStackBoundaryDeclaringType : declaringType, level, message, exception); + this.ForcedLog((callerStackBoundaryDeclaringType != null) ? callerStackBoundaryDeclaringType : declaringType, level, message, exception); } } catch (Exception ex) @@ -463,9 +463,9 @@ virtual public void Log(LoggingEvent logEvent) { if (logEvent != null) { - if (IsEnabledFor(logEvent.Level)) + if (this.IsEnabledFor(logEvent.Level)) { - ForcedLog(logEvent); + this.ForcedLog(logEvent); } } } @@ -502,7 +502,7 @@ virtual public bool IsEnabledFor(Level level) { if (level != null) { - if (m_hierarchy.IsDisabled(level)) + if (this.m_hierarchy.IsDisabled(level)) { return false; } @@ -537,7 +537,7 @@ virtual public bool IsEnabledFor(Level level) /// public ILoggerRepository Repository { - get { return m_hierarchy; } + get { return this.m_hierarchy; } } #endregion Implementation of ILogger @@ -601,10 +601,10 @@ virtual protected void CallAppenders(LoggingEvent loggingEvent) // or impossible to determine which .config file is missing appender // definitions. // - if (!m_hierarchy.EmittedNoAppenderWarning && writes == 0) + if (!this.m_hierarchy.EmittedNoAppenderWarning && writes == 0) { - m_hierarchy.EmittedNoAppenderWarning = true; - LogLog.Debug(declaringType, "No appenders could be found for logger [" + Name + "] repository [" + Repository.Name + "]"); + this.m_hierarchy.EmittedNoAppenderWarning = true; + LogLog.Debug(declaringType, "No appenders could be found for logger [" + this.Name + "] repository [" + this.Repository.Name + "]"); LogLog.Debug(declaringType, "Please initialize the log4net system properly."); try { @@ -632,12 +632,12 @@ virtual protected void CallAppenders(LoggingEvent loggingEvent) /// virtual public void CloseNestedAppenders() { - m_appenderLock.AcquireWriterLock(); + this.m_appenderLock.AcquireWriterLock(); try { - if (m_appenderAttachedImpl != null) + if (this.m_appenderAttachedImpl != null) { - AppenderCollection appenders = m_appenderAttachedImpl.Appenders; + AppenderCollection appenders = this.m_appenderAttachedImpl.Appenders; foreach(IAppender appender in appenders) { if (appender is IAppenderAttachable) @@ -649,7 +649,7 @@ virtual public void CloseNestedAppenders() } finally { - m_appenderLock.ReleaseWriterLock(); + this.m_appenderLock.ReleaseWriterLock(); } } @@ -667,9 +667,9 @@ virtual public void CloseNestedAppenders() /// virtual public void Log(Level level, object message, Exception exception) { - if (IsEnabledFor(level)) + if (this.IsEnabledFor(level)) { - ForcedLog(declaringType, level, message, exception); + this.ForcedLog(declaringType, level, message, exception); } } @@ -689,7 +689,7 @@ virtual public void Log(Level level, object message, Exception exception) /// virtual protected void ForcedLog(Type callerStackBoundaryDeclaringType, Level level, object message, Exception exception) { - CallAppenders(new LoggingEvent(callerStackBoundaryDeclaringType, this.Hierarchy, this.Name, level, message, exception)); + this.CallAppenders(new LoggingEvent(callerStackBoundaryDeclaringType, this.Hierarchy, this.Name, level, message, exception)); } /// @@ -708,7 +708,7 @@ virtual protected void ForcedLog(LoggingEvent logEvent) // is required for the appenders to correctly lookup renderers etc... logEvent.EnsureRepository(this.Hierarchy); - CallAppenders(logEvent); + this.CallAppenders(logEvent); } #region Private Static Fields diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/LoggerKey.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/LoggerKey.cs index 1b63be167ba..ea1d6e275d0 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/LoggerKey.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/LoggerKey.cs @@ -72,9 +72,9 @@ internal LoggerKey(string name) // NETCF: String.Intern causes Native Exception m_name = name; #else - m_name = string.Intern(name); + this.m_name = string.Intern(name); #endif - m_hashCache = name.GetHashCode(); + this.m_hashCache = name.GetHashCode(); } #endregion Internal Instance Constructors @@ -92,7 +92,7 @@ internal LoggerKey(string name) /// override public int GetHashCode() { - return m_hashCache; + return this.m_hashCache; } /// @@ -123,7 +123,7 @@ override public bool Equals(object obj) return ( m_name == objKey.m_name ); #else // Compare reference types rather than string's overloaded == - return ( ((object)m_name) == ((object)objKey.m_name) ); + return ( ((object)this.m_name) == ((object)objKey.m_name) ); #endif } return false; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs index fccadbb5161..9001988fded 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/Hierarchy/XmlHierarchyConfigurator.cs @@ -66,8 +66,8 @@ private enum ConfigUpdateMode /// public XmlHierarchyConfigurator(Hierarchy hierarchy) { - m_hierarchy = hierarchy; - m_appenderBag = new Hashtable(); + this.m_hierarchy = hierarchy; + this.m_appenderBag = new Hashtable(); } #endregion Public Instance Constructors @@ -85,7 +85,7 @@ public XmlHierarchyConfigurator(Hierarchy hierarchy) /// public void Configure(XmlElement element) { - if (element == null || m_hierarchy == null) + if (element == null || this.m_hierarchy == null) { return; } @@ -163,7 +163,7 @@ public void Configure(XmlElement element) if (configUpdateMode == ConfigUpdateMode.Overwrite) { // Reset to original unset configuration - m_hierarchy.ResetConfiguration(); + this.m_hierarchy.ResetConfiguration(); LogLog.Debug(declaringType, "Configuration reset before reading config."); } @@ -180,20 +180,20 @@ public void Configure(XmlElement element) if (currentElement.LocalName == LOGGER_TAG) { - ParseLogger(currentElement); + this.ParseLogger(currentElement); } else if (currentElement.LocalName == CATEGORY_TAG) { // TODO: deprecated use of category - ParseLogger(currentElement); + this.ParseLogger(currentElement); } else if (currentElement.LocalName == ROOT_TAG) { - ParseRoot(currentElement); + this.ParseRoot(currentElement); } else if (currentElement.LocalName == RENDERER_TAG) { - ParseRenderer(currentElement); + this.ParseRenderer(currentElement); } else if (currentElement.LocalName == APPENDER_TAG) { @@ -203,7 +203,7 @@ public void Configure(XmlElement element) else { // Read the param tags and set properties on the hierarchy - SetParameter(currentElement, m_hierarchy); + this.SetParameter(currentElement, this.m_hierarchy); } } } @@ -213,10 +213,10 @@ public void Configure(XmlElement element) LogLog.Debug(declaringType, "Hierarchy Threshold [" + thresholdStr + "]"); if (thresholdStr.Length > 0 && thresholdStr != "null") { - Level thresholdLevel = (Level) ConvertStringTo(typeof(Level), thresholdStr); + Level thresholdLevel = (Level) this.ConvertStringTo(typeof(Level), thresholdStr); if (thresholdLevel != null) { - m_hierarchy.Threshold = thresholdLevel; + this.m_hierarchy.Threshold = thresholdLevel; } else { @@ -246,7 +246,7 @@ protected IAppender FindAppenderByReference(XmlElement appenderRef) { string appenderName = appenderRef.GetAttribute(REF_ATTR); - IAppender appender = (IAppender)m_appenderBag[appenderName]; + IAppender appender = (IAppender)this.m_appenderBag[appenderName]; if (appender != null) { return appender; @@ -275,10 +275,10 @@ protected IAppender FindAppenderByReference(XmlElement appenderRef) } else { - appender = ParseAppender(element); + appender = this.ParseAppender(element); if (appender != null) { - m_appenderBag[appenderName] = appender; + this.m_appenderBag[appenderName] = appender; } return appender; } @@ -328,7 +328,7 @@ protected IAppender ParseAppender(XmlElement appenderElement) { LogLog.Debug(declaringType, "Attaching appender named [" + refName + "] to appender named [" + appender.Name + "]."); - IAppender referencedAppender = FindAppenderByReference(currentElement); + IAppender referencedAppender = this.FindAppenderByReference(currentElement); if (referencedAppender != null) { appenderContainer.AddAppender(referencedAppender); @@ -342,7 +342,7 @@ protected IAppender ParseAppender(XmlElement appenderElement) else { // For all other tags we use standard set param method - SetParameter(currentElement, appender); + this.SetParameter(currentElement, appender); } } } @@ -380,7 +380,7 @@ protected void ParseLogger(XmlElement loggerElement) string loggerName = loggerElement.GetAttribute(NAME_ATTR); LogLog.Debug(declaringType, "Retrieving an instance of log4net.Repository.Logger for logger [" + loggerName + "]."); - Logger log = m_hierarchy.GetLogger(loggerName) as Logger; + Logger log = this.m_hierarchy.GetLogger(loggerName) as Logger; // Setting up a logger needs to be an atomic operation, in order // to protect potential log operations while logger @@ -391,7 +391,7 @@ protected void ParseLogger(XmlElement loggerElement) LogLog.Debug(declaringType, "Setting [" + log.Name + "] additivity to [" + additivity + "]."); log.Additivity = additivity; - ParseChildrenOfLoggerElement(loggerElement, log, false); + this.ParseChildrenOfLoggerElement(loggerElement, log, false); } } @@ -406,11 +406,11 @@ protected void ParseLogger(XmlElement loggerElement) /// protected void ParseRoot(XmlElement rootElement) { - Logger root = m_hierarchy.Root; + Logger root = this.m_hierarchy.Root; // logger configuration needs to be atomic lock(root) { - ParseChildrenOfLoggerElement(rootElement, root, true); + this.ParseChildrenOfLoggerElement(rootElement, root, true); } } @@ -439,7 +439,7 @@ protected void ParseChildrenOfLoggerElement(XmlElement catElement, Logger log, b if (currentElement.LocalName == APPENDER_REF_TAG) { - IAppender appender = FindAppenderByReference(currentElement); + IAppender appender = this.FindAppenderByReference(currentElement); string refName = currentElement.GetAttribute(REF_ATTR); if (appender != null) { @@ -453,11 +453,11 @@ protected void ParseChildrenOfLoggerElement(XmlElement catElement, Logger log, b } else if (currentElement.LocalName == LEVEL_TAG || currentElement.LocalName == PRIORITY_TAG) { - ParseLevel(currentElement, log, isRoot); + this.ParseLevel(currentElement, log, isRoot); } else { - SetParameter(currentElement, log); + this.SetParameter(currentElement, log); } } } @@ -497,7 +497,7 @@ protected void ParseRenderer(XmlElement element) #if NETSTANDARD1_3 m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(this.GetType().GetTypeInfo().Assembly, renderedClassName, true, true), renderer); #else - m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(renderedClassName, true, true), renderer); + this.m_hierarchy.RendererMap.Put(SystemInfo.GetTypeFromString(renderedClassName, true, true), renderer); #endif } catch(Exception e) @@ -601,7 +601,7 @@ protected void SetParameter(XmlElement element, object target) propInfo = null; // look for a method with the signature Add(type) - methInfo = FindMethodInfo(targetType, name); + methInfo = this.FindMethodInfo(targetType, name); if (methInfo != null) { @@ -647,8 +647,8 @@ protected void SetParameter(XmlElement element, object target) { // Expand environment variables in the string. IDictionary environmentVariables = Environment.GetEnvironmentVariables(); - if (HasCaseInsensitiveEnvironment) { - environmentVariables = CreateCaseInsensitiveWrapper(environmentVariables); + if (this.HasCaseInsensitiveEnvironment) { + environmentVariables = this.CreateCaseInsensitiveWrapper(environmentVariables); } propertyValue = OptionConverter.SubstituteVariables(propertyValue, environmentVariables); } @@ -710,7 +710,7 @@ protected void SetParameter(XmlElement element, object target) // Now try to convert the string value to an acceptable type // to pass to this property. - object convertedValue = ConvertStringTo(propertyType, propertyValue); + object convertedValue = this.ConvertStringTo(propertyType, propertyValue); // Check if we need to do an additional conversion if (convertedValue != null && parsedObjectConversionTargetType != null) @@ -769,7 +769,7 @@ protected void SetParameter(XmlElement element, object target) { object createdObject = null; - if (propertyType == typeof(string) && !HasAttributesOrElements(element)) + if (propertyType == typeof(string) && !this.HasAttributesOrElements(element)) { // If the property is a string and the element is empty (no attributes // or child elements) then we special case the object value to an empty string. @@ -787,7 +787,7 @@ protected void SetParameter(XmlElement element, object target) defaultObjectType = propertyType; } - createdObject = CreateObjectFromXml(element, defaultObjectType, propertyType); + createdObject = this.CreateObjectFromXml(element, defaultObjectType, propertyType); } if (createdObject == null) @@ -939,7 +939,7 @@ protected object ConvertStringTo(Type type, string value) if (typeof(Level) == type) { // Property wants a level - Level levelValue = m_hierarchy.LevelMap[value]; + Level levelValue = this.m_hierarchy.LevelMap[value]; if (levelValue == null) { @@ -1043,7 +1043,7 @@ protected object CreateObjectFromXml(XmlElement element, Type defaultTargetType, { if (currentNode.NodeType == XmlNodeType.Element) { - SetParameter((XmlElement)currentNode, createdObject); + this.SetParameter((XmlElement)currentNode, createdObject); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/LoggerRepositorySkeleton.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/LoggerRepositorySkeleton.cs index 5e8fdacd61b..a251bcc3575 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Repository/LoggerRepositorySkeleton.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Repository/LoggerRepositorySkeleton.cs @@ -88,17 +88,17 @@ protected LoggerRepositorySkeleton() : this(new PropertiesDictionary()) /// protected LoggerRepositorySkeleton(PropertiesDictionary properties) { - m_properties = properties; - m_rendererMap = new RendererMap(); - m_pluginMap = new PluginMap(this); - m_levelMap = new LevelMap(); - m_configurationMessages = EmptyCollection.Instance; - m_configured = false; + this.m_properties = properties; + this.m_rendererMap = new RendererMap(); + this.m_pluginMap = new PluginMap(this); + this.m_levelMap = new LevelMap(); + this.m_configurationMessages = EmptyCollection.Instance; + this.m_configured = false; - AddBuiltinLevels(); + this.AddBuiltinLevels(); // Don't disable any levels by default. - m_threshold = Level.All; + this.m_threshold = Level.All; } #endregion @@ -120,8 +120,8 @@ protected LoggerRepositorySkeleton(PropertiesDictionary properties) /// virtual public string Name { - get { return m_name; } - set { m_name = value; } + get { return this.m_name; } + set { this.m_name = value; } } /// @@ -137,18 +137,18 @@ virtual public string Name /// virtual public Level Threshold { - get { return m_threshold; } + get { return this.m_threshold; } set { if (value != null) { - m_threshold = value; + this.m_threshold = value; } else { // Must not set threshold to null LogLog.Warn(declaringType, "LoggerRepositorySkeleton: Threshold cannot be set to null. Setting to ALL"); - m_threshold = Level.All; + this.m_threshold = Level.All; } } } @@ -170,7 +170,7 @@ virtual public Level Threshold /// virtual public RendererMap RendererMap { - get { return m_rendererMap; } + get { return this.m_rendererMap; } } /// @@ -187,7 +187,7 @@ virtual public RendererMap RendererMap /// virtual public PluginMap PluginMap { - get { return m_pluginMap; } + get { return this.m_pluginMap; } } /// @@ -205,7 +205,7 @@ virtual public PluginMap PluginMap /// virtual public LevelMap LevelMap { - get { return m_levelMap; } + get { return this.m_levelMap; } } /// @@ -262,13 +262,13 @@ virtual public LevelMap LevelMap virtual public void Shutdown() { // Shutdown attached plugins - foreach(IPlugin plugin in PluginMap.AllPlugins) + foreach(IPlugin plugin in this.PluginMap.AllPlugins) { plugin.Shutdown(); } // Notify listeners - OnShutdown(null); + this.OnShutdown(null); } /// @@ -290,17 +290,17 @@ virtual public void Shutdown() virtual public void ResetConfiguration() { // Clear internal data structures - m_rendererMap.Clear(); - m_levelMap.Clear(); - m_configurationMessages = EmptyCollection.Instance; + this.m_rendererMap.Clear(); + this.m_levelMap.Clear(); + this.m_configurationMessages = EmptyCollection.Instance; // Add the predefined levels to the map - AddBuiltinLevels(); + this.AddBuiltinLevels(); - Configured = false; + this.Configured = false; // Notify listeners - OnConfigurationReset(null); + this.OnConfigurationReset(null); } /// @@ -334,8 +334,8 @@ virtual public void ResetConfiguration() /// virtual public bool Configured { - get { return m_configured; } - set { m_configured = value; } + get { return this.m_configured; } + set { this.m_configured = value; } } /// @@ -344,8 +344,8 @@ virtual public bool Configured /// virtual public ICollection ConfigurationMessages { - get { return m_configurationMessages; } - set { m_configurationMessages = value; } + get { return this.m_configurationMessages; } + set { this.m_configurationMessages = value; } } /// @@ -361,8 +361,8 @@ virtual public ICollection ConfigurationMessages /// public event LoggerRepositoryShutdownEventHandler ShutdownEvent { - add { m_shutdownEvent += value; } - remove { m_shutdownEvent -= value; } + add { this.m_shutdownEvent += value; } + remove { this.m_shutdownEvent -= value; } } /// @@ -379,8 +379,8 @@ public event LoggerRepositoryShutdownEventHandler ShutdownEvent /// public event LoggerRepositoryConfigurationResetEventHandler ConfigurationReset { - add { m_configurationResetEvent += value; } - remove { m_configurationResetEvent -= value; } + add { this.m_configurationResetEvent += value; } + remove { this.m_configurationResetEvent -= value; } } /// @@ -396,8 +396,8 @@ public event LoggerRepositoryConfigurationResetEventHandler ConfigurationReset /// public event LoggerRepositoryConfigurationChangedEventHandler ConfigurationChanged { - add { m_configurationChangedEvent += value; } - remove { m_configurationChangedEvent -= value; } + add { this.m_configurationChangedEvent += value; } + remove { this.m_configurationChangedEvent -= value; } } /// @@ -411,7 +411,7 @@ public event LoggerRepositoryConfigurationChangedEventHandler ConfigurationChang /// public PropertiesDictionary Properties { - get { return m_properties; } + get { return this.m_properties; } } /// @@ -443,32 +443,32 @@ public PropertiesDictionary Properties private void AddBuiltinLevels() { // Add the predefined levels to the map - m_levelMap.Add(Level.Off); + this.m_levelMap.Add(Level.Off); // Unrecoverable errors - m_levelMap.Add(Level.Emergency); - m_levelMap.Add(Level.Fatal); - m_levelMap.Add(Level.Alert); + this.m_levelMap.Add(Level.Emergency); + this.m_levelMap.Add(Level.Fatal); + this.m_levelMap.Add(Level.Alert); // Recoverable errors - m_levelMap.Add(Level.Critical); - m_levelMap.Add(Level.Severe); - m_levelMap.Add(Level.Error); - m_levelMap.Add(Level.Warn); + this.m_levelMap.Add(Level.Critical); + this.m_levelMap.Add(Level.Severe); + this.m_levelMap.Add(Level.Error); + this.m_levelMap.Add(Level.Warn); // Information - m_levelMap.Add(Level.Notice); - m_levelMap.Add(Level.Info); + this.m_levelMap.Add(Level.Notice); + this.m_levelMap.Add(Level.Info); // Debug - m_levelMap.Add(Level.Debug); - m_levelMap.Add(Level.Fine); - m_levelMap.Add(Level.Trace); - m_levelMap.Add(Level.Finer); - m_levelMap.Add(Level.Verbose); - m_levelMap.Add(Level.Finest); - - m_levelMap.Add(Level.All); + this.m_levelMap.Add(Level.Debug); + this.m_levelMap.Add(Level.Fine); + this.m_levelMap.Add(Level.Trace); + this.m_levelMap.Add(Level.Finer); + this.m_levelMap.Add(Level.Verbose); + this.m_levelMap.Add(Level.Finest); + + this.m_levelMap.Add(Level.All); } /// @@ -492,7 +492,7 @@ virtual public void AddRenderer(Type typeToRender, IObjectRenderer rendererInsta throw new ArgumentNullException("rendererInstance"); } - m_rendererMap.Put(typeToRender, rendererInstance); + this.m_rendererMap.Put(typeToRender, rendererInstance); } /// @@ -511,7 +511,7 @@ protected virtual void OnShutdown(EventArgs e) e = EventArgs.Empty; } - LoggerRepositoryShutdownEventHandler handler = m_shutdownEvent; + LoggerRepositoryShutdownEventHandler handler = this.m_shutdownEvent; if (handler != null) { handler(this, e); @@ -534,7 +534,7 @@ protected virtual void OnConfigurationReset(EventArgs e) e = EventArgs.Empty; } - LoggerRepositoryConfigurationResetEventHandler handler = m_configurationResetEvent; + LoggerRepositoryConfigurationResetEventHandler handler = this.m_configurationResetEvent; if (handler != null) { handler(this, e); @@ -557,7 +557,7 @@ protected virtual void OnConfigurationChanged(EventArgs e) e = EventArgs.Empty; } - LoggerRepositoryConfigurationChangedEventHandler handler = m_configurationChangedEvent; + LoggerRepositoryConfigurationChangedEventHandler handler = this.m_configurationChangedEvent; if (handler != null) { handler(this, e); @@ -576,7 +576,7 @@ protected virtual void OnConfigurationChanged(EventArgs e) /// public void RaiseConfigurationChanged(EventArgs e) { - OnConfigurationChanged(e); + this.OnConfigurationChanged(e); } private static int GetWaitTime(DateTime startTimeUtc, int millisecondsTimeout) @@ -607,7 +607,7 @@ public bool Flush(int millisecondsTimeout) DateTime startTimeUtc = DateTime.UtcNow; // Do buffering appenders first. These may be forwarding to other appenders - foreach(log4net.Appender.IAppender appender in GetAppenders()) + foreach(log4net.Appender.IAppender appender in this.GetAppenders()) { log4net.Appender.IFlushable flushable = appender as log4net.Appender.IFlushable; if (flushable == null) continue; @@ -619,7 +619,7 @@ public bool Flush(int millisecondsTimeout) } // Do non-buffering appenders. - foreach (log4net.Appender.IAppender appender in GetAppenders()) + foreach (log4net.Appender.IAppender appender in this.GetAppenders()) { log4net.Appender.IFlushable flushable = appender as log4net.Appender.IFlushable; if (flushable == null) continue; diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/AppenderAttachedImpl.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/AppenderAttachedImpl.cs index 546532bc271..acb6864011b 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/AppenderAttachedImpl.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/AppenderAttachedImpl.cs @@ -79,17 +79,17 @@ public int AppendLoopOnAppenders(LoggingEvent loggingEvent) } // m_appenderList is null when empty - if (m_appenderList == null) + if (this.m_appenderList == null) { return 0; } - if (m_appenderArray == null) + if (this.m_appenderArray == null) { - m_appenderArray = m_appenderList.ToArray(); + this.m_appenderArray = this.m_appenderList.ToArray(); } - foreach(IAppender appender in m_appenderArray) + foreach(IAppender appender in this.m_appenderArray) { try { @@ -100,7 +100,7 @@ public int AppendLoopOnAppenders(LoggingEvent loggingEvent) LogLog.Error(declaringType, "Failed to append to appender [" + appender.Name + "]", ex); } } - return m_appenderList.Count; + return this.m_appenderList.Count; } /// @@ -127,21 +127,21 @@ public int AppendLoopOnAppenders(LoggingEvent[] loggingEvents) if (loggingEvents.Length == 1) { // Fall back to single event path - return AppendLoopOnAppenders(loggingEvents[0]); + return this.AppendLoopOnAppenders(loggingEvents[0]); } // m_appenderList is null when empty - if (m_appenderList == null) + if (this.m_appenderList == null) { return 0; } - if (m_appenderArray == null) + if (this.m_appenderArray == null) { - m_appenderArray = m_appenderList.ToArray(); + this.m_appenderArray = this.m_appenderList.ToArray(); } - foreach(IAppender appender in m_appenderArray) + foreach(IAppender appender in this.m_appenderArray) { try { @@ -152,7 +152,7 @@ public int AppendLoopOnAppenders(LoggingEvent[] loggingEvents) LogLog.Error(declaringType, "Failed to append to appender [" + appender.Name + "]", ex); } } - return m_appenderList.Count; + return this.m_appenderList.Count; } #endregion Public Instance Methods @@ -210,14 +210,14 @@ public void AddAppender(IAppender newAppender) throw new ArgumentNullException("newAppender"); } - m_appenderArray = null; - if (m_appenderList == null) + this.m_appenderArray = null; + if (this.m_appenderList == null) { - m_appenderList = new AppenderCollection(1); + this.m_appenderList = new AppenderCollection(1); } - if (!m_appenderList.Contains(newAppender)) + if (!this.m_appenderList.Contains(newAppender)) { - m_appenderList.Add(newAppender); + this.m_appenderList.Add(newAppender); } } @@ -237,14 +237,14 @@ public AppenderCollection Appenders { get { - if (m_appenderList == null) + if (this.m_appenderList == null) { // We must always return a valid collection return AppenderCollection.EmptyCollection; } else { - return AppenderCollection.ReadOnly(m_appenderList); + return AppenderCollection.ReadOnly(this.m_appenderList); } } } @@ -264,9 +264,9 @@ public AppenderCollection Appenders /// public IAppender GetAppender(string name) { - if (m_appenderList != null && name != null) + if (this.m_appenderList != null && name != null) { - foreach(IAppender appender in m_appenderList) + foreach(IAppender appender in this.m_appenderList) { if (name == appender.Name) { @@ -287,9 +287,9 @@ public IAppender GetAppender(string name) /// public void RemoveAllAppenders() { - if (m_appenderList != null) + if (this.m_appenderList != null) { - foreach(IAppender appender in m_appenderList) + foreach(IAppender appender in this.m_appenderList) { try { @@ -300,8 +300,8 @@ public void RemoveAllAppenders() LogLog.Error(declaringType, "Failed to Close appender ["+appender.Name+"]", ex); } } - m_appenderList = null; - m_appenderArray = null; + this.m_appenderList = null; + this.m_appenderArray = null; } } @@ -319,14 +319,14 @@ public void RemoveAllAppenders() /// public IAppender RemoveAppender(IAppender appender) { - if (appender != null && m_appenderList != null) + if (appender != null && this.m_appenderList != null) { - m_appenderList.Remove(appender); - if (m_appenderList.Count == 0) + this.m_appenderList.Remove(appender); + if (this.m_appenderList.Count == 0) { - m_appenderList = null; + this.m_appenderList = null; } - m_appenderArray = null; + this.m_appenderArray = null; } return appender; } @@ -345,7 +345,7 @@ public IAppender RemoveAppender(IAppender appender) /// public IAppender RemoveAppender(string name) { - return RemoveAppender(GetAppender(name)); + return this.RemoveAppender(this.GetAppender(name)); } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/CompositeProperties.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/CompositeProperties.cs index 5b6f43662dc..92157d12733 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/CompositeProperties.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/CompositeProperties.cs @@ -87,13 +87,13 @@ public object this[string key] get { // Look in the flattened properties first - if (m_flattened != null) + if (this.m_flattened != null) { - return m_flattened[key]; + return this.m_flattened[key]; } // Look for the key in all the nested properties - foreach(ReadOnlyPropertiesDictionary cur in m_nestedProperties) + foreach(ReadOnlyPropertiesDictionary cur in this.m_nestedProperties) { if (cur.Contains(key)) { @@ -120,8 +120,8 @@ public object this[string key] /// public void Add(ReadOnlyPropertiesDictionary properties) { - m_flattened = null; - m_nestedProperties.Add(properties); + this.m_flattened = null; + this.m_nestedProperties.Add(properties); } /// @@ -136,21 +136,21 @@ public void Add(ReadOnlyPropertiesDictionary properties) /// public PropertiesDictionary Flatten() { - if (m_flattened == null) + if (this.m_flattened == null) { - m_flattened = new PropertiesDictionary(); + this.m_flattened = new PropertiesDictionary(); - for(int i=m_nestedProperties.Count; --i>=0; ) + for(int i=this.m_nestedProperties.Count; --i>=0; ) { - ReadOnlyPropertiesDictionary cur = (ReadOnlyPropertiesDictionary)m_nestedProperties[i]; + ReadOnlyPropertiesDictionary cur = (ReadOnlyPropertiesDictionary)this.m_nestedProperties[i]; foreach(DictionaryEntry entry in cur) { - m_flattened[(string)entry.Key] = entry.Value; + this.m_flattened[(string)entry.Key] = entry.Value; } } } - return m_flattened; + return this.m_flattened; } #endregion Public Instance Methods diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ConverterInfo.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ConverterInfo.cs index 1ec69a0cce7..7fd64a75113 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ConverterInfo.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ConverterInfo.cs @@ -59,8 +59,8 @@ public ConverterInfo() /// public string Name { - get { return m_name; } - set { m_name = value; } + get { return this.m_name; } + set { this.m_name = value; } } /// @@ -74,8 +74,8 @@ public string Name /// public Type Type { - get { return m_type; } - set { m_type = value; } + get { return this.m_type; } + set { this.m_type = value; } } /// @@ -84,7 +84,7 @@ public Type Type /// public void AddProperty(PropertyEntry entry) { - properties[entry.Key] = entry.Value; + this.properties[entry.Key] = entry.Value; } /// @@ -92,7 +92,7 @@ public void AddProperty(PropertyEntry entry) /// public PropertiesDictionary Properties { - get { return properties; } + get { return this.properties; } } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/CountingQuietTextWriter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/CountingQuietTextWriter.cs index ffa6a6147c5..7c63dfae5f7 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/CountingQuietTextWriter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/CountingQuietTextWriter.cs @@ -56,7 +56,7 @@ public class CountingQuietTextWriter : QuietTextWriter /// public CountingQuietTextWriter(TextWriter writer, IErrorHandler errorHandler) : base(writer, errorHandler) { - m_countBytes = 0; + this.m_countBytes = 0; } #endregion Public Instance Constructors @@ -81,7 +81,7 @@ public override void Write(char value) // get the number of bytes needed to represent the // char using the supplied encoding. - m_countBytes += this.Encoding.GetByteCount(new char[] { value }); + this.m_countBytes += this.Encoding.GetByteCount(new char[] { value }); } catch(Exception e) { @@ -111,7 +111,7 @@ public override void Write(char[] buffer, int index, int count) // get the number of bytes needed to represent the // char array using the supplied encoding. - m_countBytes += this.Encoding.GetByteCount(buffer, index, count); + this.m_countBytes += this.Encoding.GetByteCount(buffer, index, count); } catch(Exception e) { @@ -140,7 +140,7 @@ override public void Write(string str) // get the number of bytes needed to represent the // string using the supplied encoding. - m_countBytes += this.Encoding.GetByteCount(str); + this.m_countBytes += this.Encoding.GetByteCount(str); } catch(Exception e) { @@ -166,8 +166,8 @@ override public void Write(string str) /// public long Count { - get { return m_countBytes; } - set { m_countBytes = value; } + get { return this.m_countBytes; } + set { this.m_countBytes = value; } } #endregion Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/CyclicBuffer.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/CyclicBuffer.cs index 97fc99775a9..3b4a5266596 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/CyclicBuffer.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/CyclicBuffer.cs @@ -59,11 +59,11 @@ public CyclicBuffer(int maxSize) throw SystemInfo.CreateArgumentOutOfRangeException("maxSize", (object)maxSize, "Parameter: maxSize, Value: [" + maxSize + "] out of range. Non zero positive integer required"); } - m_maxSize = maxSize; - m_events = new LoggingEvent[maxSize]; - m_first = 0; - m_last = 0; - m_numElems = 0; + this.m_maxSize = maxSize; + this.m_events = new LoggingEvent[maxSize]; + this.m_first = 0; + this.m_last = 0; + this.m_numElems = 0; } #endregion Public Instance Constructors @@ -92,25 +92,25 @@ public LoggingEvent Append(LoggingEvent loggingEvent) lock(this) { // save the discarded event - LoggingEvent discardedLoggingEvent = m_events[m_last]; + LoggingEvent discardedLoggingEvent = this.m_events[this.m_last]; // overwrite the last event position - m_events[m_last] = loggingEvent; - if (++m_last == m_maxSize) + this.m_events[this.m_last] = loggingEvent; + if (++this.m_last == this.m_maxSize) { - m_last = 0; + this.m_last = 0; } - if (m_numElems < m_maxSize) + if (this.m_numElems < this.m_maxSize) { - m_numElems++; + this.m_numElems++; } - else if (++m_first == m_maxSize) + else if (++this.m_first == this.m_maxSize) { - m_first = 0; + this.m_first = 0; } - if (m_numElems < m_maxSize) + if (this.m_numElems < this.m_maxSize) { // Space remaining return null; @@ -138,14 +138,14 @@ public LoggingEvent PopOldest() lock(this) { LoggingEvent ret = null; - if (m_numElems > 0) + if (this.m_numElems > 0) { - m_numElems--; - ret = m_events[m_first]; - m_events[m_first] = null; - if (++m_first == m_maxSize) + this.m_numElems--; + ret = this.m_events[this.m_first]; + this.m_events[this.m_first] = null; + if (++this.m_first == this.m_maxSize) { - m_first = 0; + this.m_first = 0; } } return ret; @@ -165,22 +165,22 @@ public LoggingEvent[] PopAll() { lock(this) { - LoggingEvent[] ret = new LoggingEvent[m_numElems]; + LoggingEvent[] ret = new LoggingEvent[this.m_numElems]; - if (m_numElems > 0) + if (this.m_numElems > 0) { - if (m_first < m_last) + if (this.m_first < this.m_last) { - Array.Copy(m_events, m_first, ret, 0, m_numElems); + Array.Copy(this.m_events, this.m_first, ret, 0, this.m_numElems); } else { - Array.Copy(m_events, m_first, ret, 0, m_maxSize - m_first); - Array.Copy(m_events, 0, ret, m_maxSize - m_first, m_last); + Array.Copy(this.m_events, this.m_first, ret, 0, this.m_maxSize - this.m_first); + Array.Copy(this.m_events, 0, ret, this.m_maxSize - this.m_first, this.m_last); } } - Clear(); + this.Clear(); return ret; } @@ -199,11 +199,11 @@ public void Clear() lock(this) { // Set all the elements to null - Array.Clear(m_events, 0, m_events.Length); + Array.Clear(this.m_events, 0, this.m_events.Length); - m_first = 0; - m_last = 0; - m_numElems = 0; + this.m_first = 0; + this.m_last = 0; + this.m_numElems = 0; } } @@ -286,12 +286,12 @@ public LoggingEvent this[int i] { lock(this) { - if (i < 0 || i >= m_numElems) + if (i < 0 || i >= this.m_numElems) { return null; } - return m_events[(m_first + i) % m_maxSize]; + return this.m_events[(this.m_first + i) % this.m_maxSize]; } } } @@ -311,7 +311,7 @@ public int MaxSize { lock(this) { - return m_maxSize; + return this.m_maxSize; } } #if RESIZABLE_CYCLIC_BUFFER @@ -339,7 +339,7 @@ public int Length { lock(this) { - return m_numElems; + return this.m_numElems; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/FormattingInfo.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/FormattingInfo.cs index 7e6ee9dbbfd..59b03cdeb58 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/FormattingInfo.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/FormattingInfo.cs @@ -66,9 +66,9 @@ public FormattingInfo() /// public FormattingInfo(int min, int max, bool leftAlign) { - m_min = min; - m_max = max; - m_leftAlign = leftAlign; + this.m_min = min; + this.m_max = max; + this.m_leftAlign = leftAlign; } #endregion Public Instance Constructors @@ -88,8 +88,8 @@ public FormattingInfo(int min, int max, bool leftAlign) /// public int Min { - get { return m_min; } - set { m_min = value; } + get { return this.m_min; } + set { this.m_min = value; } } /// @@ -105,8 +105,8 @@ public int Min /// public int Max { - get { return m_max; } - set { m_max = value; } + get { return this.m_max; } + set { this.m_max = value; } } /// @@ -123,8 +123,8 @@ public int Max /// public bool LeftAlign { - get { return m_leftAlign; } - set { m_leftAlign = value; } + get { return this.m_leftAlign; } + set { this.m_leftAlign = value; } } #endregion Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/GlobalContextProperties.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/GlobalContextProperties.cs index 0c7cac6b147..f612f0e9d67 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/GlobalContextProperties.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/GlobalContextProperties.cs @@ -101,17 +101,17 @@ override public object this[string key] { get { - return m_readOnlyProperties[key]; + return this.m_readOnlyProperties[key]; } set { - lock(m_syncRoot) + lock(this.m_syncRoot) { - PropertiesDictionary mutableProps = new PropertiesDictionary(m_readOnlyProperties); + PropertiesDictionary mutableProps = new PropertiesDictionary(this.m_readOnlyProperties); mutableProps[key] = value; - m_readOnlyProperties = new ReadOnlyPropertiesDictionary(mutableProps); + this.m_readOnlyProperties = new ReadOnlyPropertiesDictionary(mutableProps); } } } @@ -132,15 +132,15 @@ override public object this[string key] /// public void Remove(string key) { - lock(m_syncRoot) + lock(this.m_syncRoot) { - if (m_readOnlyProperties.Contains(key)) + if (this.m_readOnlyProperties.Contains(key)) { - PropertiesDictionary mutableProps = new PropertiesDictionary(m_readOnlyProperties); + PropertiesDictionary mutableProps = new PropertiesDictionary(this.m_readOnlyProperties); mutableProps.Remove(key); - m_readOnlyProperties = new ReadOnlyPropertiesDictionary(mutableProps); + this.m_readOnlyProperties = new ReadOnlyPropertiesDictionary(mutableProps); } } } @@ -150,9 +150,9 @@ public void Remove(string key) /// public void Clear() { - lock(m_syncRoot) + lock(this.m_syncRoot) { - m_readOnlyProperties = new ReadOnlyPropertiesDictionary(); + this.m_readOnlyProperties = new ReadOnlyPropertiesDictionary(); } } @@ -172,7 +172,7 @@ public void Clear() /// internal ReadOnlyPropertiesDictionary GetReadOnlyProperties() { - return m_readOnlyProperties; + return this.m_readOnlyProperties; } #endregion Internal Instance Methods diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMapping.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMapping.cs index b73ac3ba009..6b749b77e78 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMapping.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMapping.cs @@ -71,11 +71,11 @@ public LevelMapping() /// public void Add(LevelMappingEntry entry) { - if (m_entriesMap.ContainsKey(entry.Level)) + if (this.m_entriesMap.ContainsKey(entry.Level)) { - m_entriesMap.Remove(entry.Level); + this.m_entriesMap.Remove(entry.Level); } - m_entriesMap.Add(entry.Level, entry); + this.m_entriesMap.Add(entry.Level, entry); } /// @@ -95,9 +95,9 @@ public void Add(LevelMappingEntry entry) /// public LevelMappingEntry Lookup(Level level) { - if (m_entries != null) + if (this.m_entries != null) { - foreach(LevelMappingEntry entry in m_entries) + foreach(LevelMappingEntry entry in this.m_entries) { if (level >= entry.Level) { @@ -122,11 +122,11 @@ public LevelMappingEntry Lookup(Level level) /// public void ActivateOptions() { - Level[] sortKeys = new Level[m_entriesMap.Count]; - LevelMappingEntry[] sortValues = new LevelMappingEntry[m_entriesMap.Count]; + Level[] sortKeys = new Level[this.m_entriesMap.Count]; + LevelMappingEntry[] sortValues = new LevelMappingEntry[this.m_entriesMap.Count]; - m_entriesMap.Keys.CopyTo(sortKeys, 0); - m_entriesMap.Values.CopyTo(sortValues, 0); + this.m_entriesMap.Keys.CopyTo(sortKeys, 0); + this.m_entriesMap.Values.CopyTo(sortValues, 0); // Sort in level order Array.Sort(sortKeys, sortValues, 0, sortKeys.Length, null); @@ -139,7 +139,7 @@ public void ActivateOptions() entry.ActivateOptions(); } - m_entries = sortValues; + this.m_entries = sortValues; } #endregion // IOptionHandler Members diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMappingEntry.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMappingEntry.cs index 79c11d8a965..f118b96d51c 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMappingEntry.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LevelMappingEntry.cs @@ -72,8 +72,8 @@ protected LevelMappingEntry() /// public Level Level { - get { return m_level; } - set { m_level = value; } + get { return this.m_level; } + set { this.m_level = value; } } #endregion // Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogLog.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogLog.cs index 140f5b43c04..dacd4ea49ca 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogLog.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogLog.cs @@ -72,7 +72,7 @@ public sealed class LogLog /// public Type Source { - get { return source; } + get { return this.source; } } /// @@ -80,7 +80,7 @@ public Type Source /// public DateTime TimeStamp { - get { return timeStampUtc.ToLocalTime(); } + get { return this.timeStampUtc.ToLocalTime(); } } /// @@ -88,7 +88,7 @@ public DateTime TimeStamp /// public DateTime TimeStampUtc { - get { return timeStampUtc; } + get { return this.timeStampUtc; } } /// @@ -101,7 +101,7 @@ public DateTime TimeStampUtc /// public string Prefix { - get { return prefix; } + get { return this.prefix; } } /// @@ -109,7 +109,7 @@ public string Prefix /// public string Message { - get { return message; } + get { return this.message; } } /// @@ -120,7 +120,7 @@ public string Message /// public Exception Exception { - get { return exception; } + get { return this.exception; } } /// @@ -130,7 +130,7 @@ public Exception Exception /// public override string ToString() { - return Prefix + Source.Name + ": " + Message; + return this.Prefix + this.Source.Name + ": " + this.Message; } #region Private Instance Constructors @@ -144,7 +144,7 @@ public override string ToString() /// public LogLog(Type source, string prefix, string message, Exception exception) { - timeStampUtc = DateTime.UtcNow; + this.timeStampUtc = DateTime.UtcNow; this.source = source; this.prefix = prefix; @@ -627,14 +627,14 @@ public LogReceivedAdapter(IList items) { this.items = items; - handler = new LogReceivedEventHandler(LogLog_LogReceived); + this.handler = new LogReceivedEventHandler(this.LogLog_LogReceived); - LogReceived += handler; + LogReceived += this.handler; } void LogLog_LogReceived(object source, LogReceivedEventArgs e) { - items.Add(e.LogLog); + this.items.Add(e.LogLog); } /// @@ -642,7 +642,7 @@ void LogLog_LogReceived(object source, LogReceivedEventArgs e) /// public IList Items { - get { return items; } + get { return this.items; } } /// @@ -650,7 +650,7 @@ public IList Items /// public void Dispose() { - LogReceived -= handler; + LogReceived -= this.handler; } } } @@ -676,7 +676,7 @@ public LogReceivedEventArgs(LogLog loglog) /// public LogLog LogLog { - get { return loglog; } + get { return this.loglog; } } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextProperties.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextProperties.cs index b979997019f..4fee33e94b6 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextProperties.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextProperties.cs @@ -94,7 +94,7 @@ override public object this[string key] get { // Don't create the dictionary if it does not already exist - PropertiesDictionary dictionary = GetProperties(false); + PropertiesDictionary dictionary = this.GetProperties(false); if (dictionary != null) { return dictionary[key]; @@ -104,7 +104,7 @@ override public object this[string key] set { // Force the dictionary to be created - PropertiesDictionary props = GetProperties(true); + PropertiesDictionary props = this.GetProperties(true); // Reason for cloning the dictionary below: object instances set on the CallContext // need to be immutable to correctly flow through async/await PropertiesDictionary immutableProps = new PropertiesDictionary(props); @@ -128,7 +128,7 @@ override public object this[string key] /// public void Remove(string key) { - PropertiesDictionary dictionary = GetProperties(false); + PropertiesDictionary dictionary = this.GetProperties(false); if (dictionary != null) { PropertiesDictionary immutableProps = new PropertiesDictionary(dictionary); @@ -147,7 +147,7 @@ public void Remove(string key) /// public void Clear() { - PropertiesDictionary dictionary = GetProperties(false); + PropertiesDictionary dictionary = this.GetProperties(false); if (dictionary != null) { PropertiesDictionary immutableProps = new PropertiesDictionary(); @@ -173,7 +173,7 @@ public void Clear() /// internal PropertiesDictionary GetProperties(bool create) { - if (!m_disabled) + if (!this.m_disabled) { try { @@ -187,7 +187,7 @@ internal PropertiesDictionary GetProperties(bool create) } catch (SecurityException secEx) { - m_disabled = true; + this.m_disabled = true; // Thrown if we don't have permission to read or write the CallContext LogLog.Warn(declaringType, "SecurityException while accessing CallContext. Disabling LogicalThreadContextProperties", secEx); diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStack.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStack.cs index f3a2a1dc856..3591dd9938b 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStack.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStack.cs @@ -91,8 +91,8 @@ internal LogicalThreadContextStack(string propertyKey, TwoArgAction public int Count { - get { return m_stack.Count; } + get { return this.m_stack.Count; } } #endregion // Public Properties @@ -138,7 +138,7 @@ public int Count /// public void Clear() { - m_registerNew(m_propertyKey, new LogicalThreadContextStack(m_propertyKey, m_registerNew)); + this.m_registerNew(this.m_propertyKey, new LogicalThreadContextStack(this.m_propertyKey, this.m_registerNew)); } /// @@ -155,15 +155,15 @@ public void Clear() public string Pop() { // copy current stack - Stack stack = new Stack(new Stack(m_stack)); + Stack stack = new Stack(new Stack(this.m_stack)); string result = ""; if (stack.Count > 0) { result = ((StackFrame)(stack.Pop())).Message; } - LogicalThreadContextStack ltcs = new LogicalThreadContextStack(m_propertyKey, m_registerNew); + LogicalThreadContextStack ltcs = new LogicalThreadContextStack(this.m_propertyKey, this.m_registerNew); ltcs.m_stack = stack; - m_registerNew(m_propertyKey, ltcs); + this.m_registerNew(this.m_propertyKey, ltcs); return result; } @@ -193,12 +193,12 @@ public string Pop() public IDisposable Push(string message) { // do modifications on a copy - Stack stack = new Stack(new Stack(m_stack)); + Stack stack = new Stack(new Stack(this.m_stack)); stack.Push(new StackFrame(message, (stack.Count > 0) ? (StackFrame)stack.Peek() : null)); - LogicalThreadContextStack contextStack = new LogicalThreadContextStack(m_propertyKey, m_registerNew); + LogicalThreadContextStack contextStack = new LogicalThreadContextStack(this.m_propertyKey, this.m_registerNew); contextStack.m_stack = stack; - m_registerNew(m_propertyKey, contextStack); + this.m_registerNew(this.m_propertyKey, contextStack); return new AutoPopStackFrame(contextStack, stack.Count - 1); } @@ -212,7 +212,7 @@ public IDisposable Push(string message) /// The current context information. internal string GetFullMessage() { - Stack stack = m_stack; + Stack stack = this.m_stack; if (stack.Count > 0) { return ((StackFrame)(stack.Peek())).FullMessage; @@ -233,8 +233,8 @@ internal string GetFullMessage() /// internal Stack InternalStack { - get { return m_stack; } - set { m_stack = value; } + get { return this.m_stack; } + set { this.m_stack = value; } } #endregion Internal Methods @@ -250,7 +250,7 @@ internal Stack InternalStack /// public override string ToString() { - return GetFullMessage(); + return this.GetFullMessage(); } /// @@ -264,7 +264,7 @@ public override string ToString() /// object IFixingRequired.GetFixedObject() { - return GetFullMessage(); + return this.GetFullMessage(); } /// @@ -300,12 +300,12 @@ private sealed class StackFrame /// internal StackFrame(string message, StackFrame parent) { - m_message = message; - m_parent = parent; + this.m_message = message; + this.m_parent = parent; if (parent == null) { - m_fullMessage = message; + this.m_fullMessage = message; } } @@ -324,7 +324,7 @@ internal StackFrame(string message, StackFrame parent) /// internal string Message { - get { return m_message; } + get { return this.m_message; } } /// @@ -342,11 +342,11 @@ internal string FullMessage { get { - if (m_fullMessage == null && m_parent != null) + if (this.m_fullMessage == null && this.m_parent != null) { - m_fullMessage = string.Concat(m_parent.FullMessage, " ", m_message); + this.m_fullMessage = string.Concat(this.m_parent.FullMessage, " ", this.m_message); } - return m_fullMessage; + return this.m_fullMessage; } } @@ -393,8 +393,8 @@ private struct AutoPopStackFrame : IDisposable /// internal AutoPopStackFrame(LogicalThreadContextStack logicalThreadContextStack, int frameDepth) { - m_frameDepth = frameDepth; - m_logicalThreadContextStack = logicalThreadContextStack; + this.m_frameDepth = frameDepth; + this.m_logicalThreadContextStack = logicalThreadContextStack; } #endregion Internal Instance Constructors @@ -411,16 +411,16 @@ internal AutoPopStackFrame(LogicalThreadContextStack logicalThreadContextStack, /// public void Dispose() { - if (m_frameDepth >= 0 && m_logicalThreadContextStack.m_stack != null) + if (this.m_frameDepth >= 0 && this.m_logicalThreadContextStack.m_stack != null) { - Stack stack = new Stack(new Stack(m_logicalThreadContextStack.m_stack)); - while (stack.Count > m_frameDepth) + Stack stack = new Stack(new Stack(this.m_logicalThreadContextStack.m_stack)); + while (stack.Count > this.m_frameDepth) { stack.Pop(); } - LogicalThreadContextStack ltcs = new LogicalThreadContextStack(m_logicalThreadContextStack.m_propertyKey, m_logicalThreadContextStack.m_registerNew); + LogicalThreadContextStack ltcs = new LogicalThreadContextStack(this.m_logicalThreadContextStack.m_propertyKey, this.m_logicalThreadContextStack.m_registerNew); ltcs.m_stack = stack; - m_logicalThreadContextStack.m_registerNew(m_logicalThreadContextStack.m_propertyKey, + this.m_logicalThreadContextStack.m_registerNew(this.m_logicalThreadContextStack.m_propertyKey, ltcs); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStacks.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStacks.cs index 909ddf7b018..222a32bb1bd 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStacks.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/LogicalThreadContextStacks.cs @@ -52,7 +52,7 @@ public sealed class LogicalThreadContextStacks /// internal LogicalThreadContextStacks(LogicalThreadContextProperties properties) { - m_properties = properties; + this.m_properties = properties; } #endregion Public Instance Constructors @@ -76,16 +76,16 @@ public LogicalThreadContextStack this[string key] { LogicalThreadContextStack stack = null; - object propertyValue = m_properties[key]; + object propertyValue = this.m_properties[key]; if (propertyValue == null) { // Stack does not exist, create #if NET_2_0 || MONO_2_0 - stack = new LogicalThreadContextStack(key, registerNew); + stack = new LogicalThreadContextStack(key, this.registerNew); #else stack = new LogicalThreadContextStack(key, new TwoArgAction(registerNew)); #endif - m_properties[key] = stack; + this.m_properties[key] = stack; } else { @@ -107,7 +107,7 @@ public LogicalThreadContextStack this[string key] LogLog.Error(declaringType, "ThreadContextStacks: Request for stack named [" + key + "] failed because a property with the same name exists which is a [" + propertyValue.GetType().Name + "] with value [" + propertyValueString + "]"); #if NET_2_0 || MONO_2_0 - stack = new LogicalThreadContextStack(key, registerNew); + stack = new LogicalThreadContextStack(key, this.registerNew); #else stack = new LogicalThreadContextStack(key, new TwoArgAction(registerNew)); #endif @@ -124,7 +124,7 @@ public LogicalThreadContextStack this[string key] private void registerNew(string stackName, LogicalThreadContextStack stack) { - m_properties[stackName] = stack; + this.m_properties[stackName] = stack; } #endregion Private Instance Fields diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/NativeError.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/NativeError.cs index ee8ac248fd8..be19b4d97bf 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/NativeError.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/NativeError.cs @@ -62,8 +62,8 @@ public sealed class NativeError /// private NativeError(int number, string message) { - m_number = number; - m_message = message; + this.m_number = number; + this.m_message = message; } #endregion // Protected Instance Constructors @@ -83,7 +83,7 @@ private NativeError(int number, string message) /// public int Number { - get { return m_number; } + get { return this.m_number; } } /// @@ -99,7 +99,7 @@ public int Number /// public string Message { - get { return m_message; } + get { return this.m_message; } } #endregion // Public Instance Properties diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/OnlyOnceErrorHandler.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/OnlyOnceErrorHandler.cs index 17803f8c11f..8e85f2fdded 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/OnlyOnceErrorHandler.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/OnlyOnceErrorHandler.cs @@ -58,7 +58,7 @@ public class OnlyOnceErrorHandler : IErrorHandler /// public OnlyOnceErrorHandler() { - m_prefix = ""; + this.m_prefix = ""; } /// @@ -73,7 +73,7 @@ public OnlyOnceErrorHandler() /// public OnlyOnceErrorHandler(string prefix) { - m_prefix = prefix; + this.m_prefix = prefix; } #endregion Public Instance Constructors @@ -85,11 +85,11 @@ public OnlyOnceErrorHandler(string prefix) /// public void Reset() { - m_enabledDateUtc = DateTime.MinValue; - m_errorCode = ErrorCode.GenericFailure; - m_exception = null; - m_message = null; - m_firstTime = true; + this.m_enabledDateUtc = DateTime.MinValue; + this.m_errorCode = ErrorCode.GenericFailure; + this.m_exception = null; + this.m_message = null; + this.m_firstTime = true; } #region Implementation of IErrorHandler @@ -107,9 +107,9 @@ public void Reset() /// public void Error(string message, Exception e, ErrorCode errorCode) { - if (m_firstTime) + if (this.m_firstTime) { - FirstError(message, e, errorCode); + this.FirstError(message, e, errorCode); } } @@ -125,14 +125,14 @@ public void Error(string message, Exception e, ErrorCode errorCode) /// /// public virtual void FirstError(string message, Exception e, ErrorCode errorCode) { - m_enabledDateUtc = DateTime.UtcNow; - m_errorCode = errorCode; - m_exception = e; - m_message = message; - m_firstTime = false; + this.m_enabledDateUtc = DateTime.UtcNow; + this.m_errorCode = errorCode; + this.m_exception = e; + this.m_message = message; + this.m_firstTime = false; if (LogLog.InternalDebugging && !LogLog.QuietMode) { - LogLog.Error(declaringType, "[" + m_prefix + "] ErrorCode: " + errorCode.ToString() + ". " + message, e); + LogLog.Error(declaringType, "[" + this.m_prefix + "] ErrorCode: " + errorCode.ToString() + ". " + message, e); } } @@ -148,7 +148,7 @@ public virtual void FirstError(string message, Exception e, ErrorCode errorCode) /// public void Error(string message, Exception e) { - Error(message, e, ErrorCode.GenericFailure); + this.Error(message, e, ErrorCode.GenericFailure); } /// @@ -162,7 +162,7 @@ public void Error(string message, Exception e) /// public void Error(string message) { - Error(message, null, ErrorCode.GenericFailure); + this.Error(message, null, ErrorCode.GenericFailure); } #endregion Implementation of IErrorHandler @@ -182,7 +182,7 @@ public void Error(string message) /// public bool IsEnabled { - get { return m_firstTime; } + get { return this.m_firstTime; } } /// @@ -192,8 +192,8 @@ public DateTime EnabledDate { get { - if (m_enabledDateUtc == DateTime.MinValue) return DateTime.MinValue; - return m_enabledDateUtc.ToLocalTime(); + if (this.m_enabledDateUtc == DateTime.MinValue) return DateTime.MinValue; + return this.m_enabledDateUtc.ToLocalTime(); } } @@ -202,7 +202,7 @@ public DateTime EnabledDate /// public DateTime EnabledDateUtc { - get { return m_enabledDateUtc; } + get { return this.m_enabledDateUtc; } } /// @@ -210,7 +210,7 @@ public DateTime EnabledDateUtc /// public string ErrorMessage { - get { return m_message; } + get { return this.m_message; } } /// @@ -221,7 +221,7 @@ public string ErrorMessage /// public Exception Exception { - get { return m_exception; } + get { return this.m_exception; } } /// @@ -232,7 +232,7 @@ public Exception Exception /// public ErrorCode ErrorCode { - get { return m_errorCode; } + get { return this.m_errorCode; } } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternConverter.cs index 6fd2ed14aa1..610b2ca250b 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternConverter.cs @@ -76,7 +76,7 @@ protected PatternConverter() /// public virtual PatternConverter Next { - get { return m_next; } + get { return this.m_next; } } /// @@ -92,12 +92,12 @@ public virtual PatternConverter Next /// public virtual FormattingInfo FormattingInfo { - get { return new FormattingInfo(m_min, m_max, m_leftAlign); } + get { return new FormattingInfo(this.m_min, this.m_max, this.m_leftAlign); } set { - m_min = value.Min; - m_max = value.Max; - m_leftAlign = value.LeftAlign; + this.m_min = value.Min; + this.m_max = value.Max; + this.m_leftAlign = value.LeftAlign; } } @@ -114,8 +114,8 @@ public virtual FormattingInfo FormattingInfo /// public virtual string Option { - get { return m_option; } - set { m_option = value; } + get { return this.m_option; } + set { this.m_option = value; } } #endregion Public Instance Properties @@ -152,8 +152,8 @@ public virtual string Option /// public virtual PatternConverter SetNext(PatternConverter patternConverter) { - m_next = patternConverter; - return m_next; + this.m_next = patternConverter; + return this.m_next; } /// @@ -171,27 +171,27 @@ public virtual PatternConverter SetNext(PatternConverter patternConverter) /// virtual public void Format(TextWriter writer, object state) { - if (m_min < 0 && m_max == int.MaxValue) + if (this.m_min < 0 && this.m_max == int.MaxValue) { // Formatting options are not in use - Convert(writer, state); + this.Convert(writer, state); } else { string msg = null; int len; - lock (m_formatWriter) + lock (this.m_formatWriter) { - m_formatWriter.Reset(c_renderBufferMaxCapacity, c_renderBufferSize); + this.m_formatWriter.Reset(c_renderBufferMaxCapacity, c_renderBufferSize); - Convert(m_formatWriter, state); + this.Convert(this.m_formatWriter, state); - StringBuilder buf = m_formatWriter.GetStringBuilder(); + StringBuilder buf = this.m_formatWriter.GetStringBuilder(); len = buf.Length; - if (len > m_max) + if (len > this.m_max) { - msg = buf.ToString(len - m_max, m_max); - len = m_max; + msg = buf.ToString(len - this.m_max, this.m_max); + len = this.m_max; } else { @@ -199,16 +199,16 @@ virtual public void Format(TextWriter writer, object state) } } - if (len < m_min) + if (len < this.m_min) { - if (m_leftAlign) + if (this.m_leftAlign) { writer.Write(msg); - SpacePad(writer, m_min - len); + SpacePad(writer, this.m_min - len); } else { - SpacePad(writer, m_min - len); + SpacePad(writer, this.m_min - len); writer.Write(msg); } } @@ -394,8 +394,8 @@ protected static void WriteObject(TextWriter writer, ILoggerRepository repositor /// public PropertiesDictionary Properties { - get { return properties; } - set { properties = value; } + get { return this.properties; } + set { this.properties = value; } } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternParser.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternParser.cs index 95327fdbfcd..493ff4da6fa 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternParser.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternParser.cs @@ -58,7 +58,7 @@ public sealed class PatternParser /// public PatternParser(string pattern) { - m_pattern = pattern; + this.m_pattern = pattern; } #endregion Public Instance Constructors @@ -76,11 +76,11 @@ public PatternParser(string pattern) /// public PatternConverter Parse() { - string[] converterNamesCache = BuildCache(); + string[] converterNamesCache = this.BuildCache(); - ParseInternal(m_pattern, converterNamesCache); + this.ParseInternal(this.m_pattern, converterNamesCache); - return m_head; + return this.m_head; } #endregion Public Instance Methods @@ -100,7 +100,7 @@ public PatternConverter Parse() /// public Hashtable PatternConverters { - get { return m_patternConverters; } + get { return this.m_patternConverters; } } #endregion Public Instance Properties @@ -118,8 +118,8 @@ public Hashtable PatternConverters /// private string[] BuildCache() { - string[] converterNamesCache = new string[m_patternConverters.Keys.Count]; - m_patternConverters.Keys.CopyTo(converterNamesCache, 0); + string[] converterNamesCache = new string[this.m_patternConverters.Keys.Count]; + this.m_patternConverters.Keys.CopyTo(converterNamesCache, 0); // sort array so that longer strings come first Array.Sort(converterNamesCache, 0, converterNamesCache.Length, StringLengthComparer.Instance); @@ -192,7 +192,7 @@ private void ParseInternal(string pattern, string[] matches) int i = pattern.IndexOf('%', offset); if (i < 0 || i == pattern.Length - 1) { - ProcessLiteral(pattern.Substring(offset)); + this.ProcessLiteral(pattern.Substring(offset)); offset = pattern.Length; } else @@ -200,12 +200,12 @@ private void ParseInternal(string pattern, string[] matches) if (pattern[i+1] == '%') { // Escaped - ProcessLiteral(pattern.Substring(offset, i - offset + 1)); + this.ProcessLiteral(pattern.Substring(offset, i - offset + 1)); offset = i + 2; } else { - ProcessLiteral(pattern.Substring(offset, i - offset)); + this.ProcessLiteral(pattern.Substring(offset, i - offset)); offset = i + 1; FormattingInfo formattingInfo = new FormattingInfo(); @@ -295,7 +295,7 @@ private void ParseInternal(string pattern, string[] matches) } } - ProcessConverter(matches[m], option, formattingInfo); + this.ProcessConverter(matches[m], option, formattingInfo); break; } } @@ -314,7 +314,7 @@ private void ProcessLiteral(string text) if (text.Length > 0) { // Convert into a pattern - ProcessConverter("literal", text, new FormattingInfo()); + this.ProcessConverter("literal", text, new FormattingInfo()); } } @@ -329,7 +329,7 @@ private void ProcessConverter(string converterName, string option, FormattingInf LogLog.Debug(declaringType, "Converter ["+converterName+"] Option ["+option+"] Format [min="+formattingInfo.Min+",max="+formattingInfo.Max+",leftAlign="+formattingInfo.LeftAlign+"]"); // Lookup the converter type - ConverterInfo converterInfo = (ConverterInfo)m_patternConverters[converterName]; + ConverterInfo converterInfo = (ConverterInfo)this.m_patternConverters[converterName]; if (converterInfo == null) { LogLog.Error(declaringType, "Unknown converter name ["+converterName+"] in conversion pattern."); @@ -359,7 +359,7 @@ private void ProcessConverter(string converterName, string option, FormattingInf optionHandler.ActivateOptions(); } - AddConverter(pc); + this.AddConverter(pc); } } @@ -372,9 +372,9 @@ private void AddConverter(PatternConverter pc) { // Add the pattern converter to the list. - if (m_head == null) + if (this.m_head == null) { - m_head = m_tail = pc; + this.m_head = this.m_tail = pc; } else { @@ -382,7 +382,7 @@ private void AddConverter(PatternConverter pc) // Update the tail reference // note that a converter may combine the 'next' into itself // and therefore the tail would not change! - m_tail = m_tail.SetNext(pc); + this.m_tail = this.m_tail.SetNext(pc); } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternString.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternString.cs index 159a75923ca..c61bc295b65 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternString.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternString.cs @@ -355,8 +355,8 @@ public PatternString() /// public PatternString(string pattern) { - m_pattern = pattern; - ActivateOptions(); + this.m_pattern = pattern; + this.ActivateOptions(); } #endregion @@ -376,8 +376,8 @@ public PatternString(string pattern) /// public string ConversionPattern { - get { return m_pattern; } - set { m_pattern = value; } + get { return this.m_pattern; } + set { this.m_pattern = value; } } #region Implementation of IOptionHandler @@ -400,7 +400,7 @@ public string ConversionPattern /// virtual public void ActivateOptions() { - m_head = CreatePatternParser(m_pattern).Parse(); + this.m_head = this.CreatePatternParser(this.m_pattern).Parse(); } #endregion @@ -430,7 +430,7 @@ private PatternParser CreatePatternParser(string pattern) patternParser.PatternConverters.Add(entry.Key, converterInfo); } // Add the instance patterns - foreach(DictionaryEntry entry in m_instanceRulesRegistry) + foreach(DictionaryEntry entry in this.m_instanceRulesRegistry) { patternParser.PatternConverters[entry.Key] = entry.Value; } @@ -454,7 +454,7 @@ public void Format(TextWriter writer) throw new ArgumentNullException("writer"); } - PatternConverter c = m_head; + PatternConverter c = this.m_head; // loop through the chain of pattern converters while(c != null) @@ -476,7 +476,7 @@ public void Format(TextWriter writer) public string Format() { StringWriter writer = new StringWriter(System.Globalization.CultureInfo.InvariantCulture); - Format(writer); + this.Format(writer); return writer.ToString(); } @@ -498,7 +498,7 @@ public void AddConverter(ConverterInfo converterInfo) { throw new ArgumentException("The converter type specified [" + converterInfo.Type + "] must be a subclass of log4net.Util.PatternConverter", "converterInfo"); } - m_instanceRulesRegistry[converterInfo.Name] = converterInfo; + this.m_instanceRulesRegistry[converterInfo.Name] = converterInfo; } /// @@ -520,7 +520,7 @@ public void AddConverter(string name, Type type) converterInfo.Name = name; converterInfo.Type = type; - AddConverter(converterInfo); + this.AddConverter(converterInfo); } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/AppSettingPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/AppSettingPatternConverter.cs index 3a2b03f9f7d..1d09e6fc6cc 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/AppSettingPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/AppSettingPatternConverter.cs @@ -101,10 +101,10 @@ private static IDictionary AppSettingsDictionary override protected void Convert(TextWriter writer, object state) { - if (Option != null) + if (this.Option != null) { // Write the value for the specified key - WriteObject(writer, null, System.Configuration.ConfigurationManager.AppSettings[Option]); + WriteObject(writer, null, System.Configuration.ConfigurationManager.AppSettings[this.Option]); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/DatePatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/DatePatternConverter.cs index 8885f9f054a..bcbc02a5375 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/DatePatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/DatePatternConverter.cs @@ -116,7 +116,7 @@ internal class DatePatternConverter : PatternConverter, IOptionHandler /// public void ActivateOptions() { - string dateFormatStr = Option; + string dateFormatStr = this.Option; if (dateFormatStr == null) { @@ -125,26 +125,26 @@ public void ActivateOptions() if (SystemInfo.EqualsIgnoringCase(dateFormatStr, AbsoluteTimeDateFormatter.Iso8601TimeDateFormat)) { - m_dateFormatter = new Iso8601DateFormatter(); + this.m_dateFormatter = new Iso8601DateFormatter(); } else if (SystemInfo.EqualsIgnoringCase(dateFormatStr, AbsoluteTimeDateFormatter.AbsoluteTimeDateFormat)) { - m_dateFormatter = new AbsoluteTimeDateFormatter(); + this.m_dateFormatter = new AbsoluteTimeDateFormatter(); } else if (SystemInfo.EqualsIgnoringCase(dateFormatStr, AbsoluteTimeDateFormatter.DateAndTimeDateFormat)) { - m_dateFormatter = new DateTimeDateFormatter(); + this.m_dateFormatter = new DateTimeDateFormatter(); } else { try { - m_dateFormatter = new SimpleDateFormatter(dateFormatStr); + this.m_dateFormatter = new SimpleDateFormatter(dateFormatStr); } catch (Exception e) { LogLog.Error(declaringType, "Could not instantiate SimpleDateFormatter with ["+dateFormatStr+"]", e); - m_dateFormatter = new Iso8601DateFormatter(); + this.m_dateFormatter = new Iso8601DateFormatter(); } } } @@ -169,7 +169,7 @@ override protected void Convert(TextWriter writer, object state) { try { - m_dateFormatter.FormatDate(DateTime.Now, writer); + this.m_dateFormatter.FormatDate(DateTime.Now, writer); } catch (Exception ex) { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/EnvironmentFolderPathPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/EnvironmentFolderPathPatternConverter.cs index 0bd7f25a7b9..f96e54e1ad4 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/EnvironmentFolderPathPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/EnvironmentFolderPathPatternConverter.cs @@ -59,10 +59,10 @@ override protected void Convert(TextWriter writer, object state) { try { - if (Option != null && Option.Length > 0) + if (this.Option != null && this.Option.Length > 0) { Environment.SpecialFolder specialFolder = - (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), Option, true); + (Environment.SpecialFolder)Enum.Parse(typeof(Environment.SpecialFolder), this.Option, true); string envFolderPathValue = Environment.GetFolderPath(specialFolder); if (envFolderPathValue != null && envFolderPathValue.Length > 0) diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/LiteralPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/LiteralPatternConverter.cs index dd7b9bf2e9c..b0ddd53432f 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/LiteralPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/LiteralPatternConverter.cs @@ -64,7 +64,7 @@ public override PatternConverter SetNext(PatternConverter pc) if (literalPc != null) { // Combine the two adjacent literals together - Option = Option + literalPc.Option; + this.Option = this.Option + literalPc.Option; // We are the next converter now return this; @@ -90,7 +90,7 @@ public override PatternConverter SetNext(PatternConverter pc) /// override public void Format(TextWriter writer, object state) { - writer.Write(Option); + writer.Write(this.Option); } /// diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/NewLinePatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/NewLinePatternConverter.cs index 7b73233fa77..4ea8de35994 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/NewLinePatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/NewLinePatternConverter.cs @@ -71,17 +71,17 @@ internal sealed class NewLinePatternConverter : LiteralPatternConverter, IOption /// public void ActivateOptions() { - if (SystemInfo.EqualsIgnoringCase(Option, "DOS")) + if (SystemInfo.EqualsIgnoringCase(this.Option, "DOS")) { - Option = "\r\n"; + this.Option = "\r\n"; } - else if (SystemInfo.EqualsIgnoringCase(Option, "UNIX")) + else if (SystemInfo.EqualsIgnoringCase(this.Option, "UNIX")) { - Option = "\n"; + this.Option = "\n"; } else { - Option = SystemInfo.NewLine; + this.Option = SystemInfo.NewLine; } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/PropertyPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/PropertyPatternConverter.cs index 58f83c18ea4..f4410c1257c 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/PropertyPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/PropertyPatternConverter.cs @@ -88,10 +88,10 @@ override protected void Convert(TextWriter writer, object state) // TODO: Add Repository Properties compositeProperties.Add(GlobalContext.Properties.GetReadOnlyProperties()); - if (Option != null) + if (this.Option != null) { // Write the value for the specified key - WriteObject(writer, null, compositeProperties[Option]); + WriteObject(writer, null, compositeProperties[this.Option]); } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/RandomStringPatternConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/RandomStringPatternConverter.cs index 61ca2f5262c..9effee8cbbd 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/RandomStringPatternConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PatternStringConverters/RandomStringPatternConverter.cs @@ -81,13 +81,13 @@ internal sealed class RandomStringPatternConverter : PatternConverter, IOptionHa /// public void ActivateOptions() { - string optionStr = Option; + string optionStr = this.Option; if (optionStr != null && optionStr.Length > 0) { int lengthVal; if (SystemInfo.TryParse(optionStr, out lengthVal)) { - m_length = lengthVal; + this.m_length = lengthVal; } else { @@ -114,7 +114,7 @@ override protected void Convert(TextWriter writer, object state) { lock(s_random) { - for(int i=0; i override public object this[string key] { - get { return InnerHashtable[key]; } - set { InnerHashtable[key] = value; } + get { return this.InnerHashtable[key]; } + set { this.InnerHashtable[key] = value; } } #endregion Public Instance Properties @@ -135,7 +135,7 @@ override public object this[string key] /// public void Remove(string key) { - InnerHashtable.Remove(key); + this.InnerHashtable.Remove(key); } #endregion Public Instance Methods @@ -153,7 +153,7 @@ public void Remove(string key) /// IDictionaryEnumerator IDictionary.GetEnumerator() { - return InnerHashtable.GetEnumerator(); + return this.InnerHashtable.GetEnumerator(); } /// @@ -167,7 +167,7 @@ IDictionaryEnumerator IDictionary.GetEnumerator() /// void IDictionary.Remove(object key) { - InnerHashtable.Remove(key); + this.InnerHashtable.Remove(key); } /// @@ -182,7 +182,7 @@ void IDictionary.Remove(object key) /// bool IDictionary.Contains(object key) { - return InnerHashtable.Contains(key); + return this.InnerHashtable.Contains(key); } /// @@ -195,7 +195,7 @@ bool IDictionary.Contains(object key) /// public override void Clear() { - InnerHashtable.Clear(); + this.InnerHashtable.Clear(); } /// @@ -215,7 +215,7 @@ void IDictionary.Add(object key, object value) { throw new ArgumentException("key must be a string", "key"); } - InnerHashtable.Add(key, value); + this.InnerHashtable.Add(key, value); } /// @@ -255,7 +255,7 @@ object IDictionary.this[object key] { throw new ArgumentException("key must be a string", "key"); } - return InnerHashtable[key]; + return this.InnerHashtable[key]; } set { @@ -263,7 +263,7 @@ object IDictionary.this[object key] { throw new ArgumentException("key must be a string", "key"); } - InnerHashtable[key] = value; + this.InnerHashtable[key] = value; } } @@ -272,7 +272,7 @@ object IDictionary.this[object key] /// ICollection IDictionary.Values { - get { return InnerHashtable.Values; } + get { return this.InnerHashtable.Values; } } /// @@ -280,7 +280,7 @@ ICollection IDictionary.Values /// ICollection IDictionary.Keys { - get { return InnerHashtable.Keys; } + get { return this.InnerHashtable.Keys; } } /// @@ -302,7 +302,7 @@ bool IDictionary.IsFixedSize /// void ICollection.CopyTo(Array array, int index) { - InnerHashtable.CopyTo(array, index); + this.InnerHashtable.CopyTo(array, index); } /// @@ -310,7 +310,7 @@ void ICollection.CopyTo(Array array, int index) /// bool ICollection.IsSynchronized { - get { return InnerHashtable.IsSynchronized; } + get { return this.InnerHashtable.IsSynchronized; } } /// @@ -318,7 +318,7 @@ bool ICollection.IsSynchronized /// object ICollection.SyncRoot { - get { return InnerHashtable.SyncRoot; } + get { return this.InnerHashtable.SyncRoot; } } #endregion @@ -330,7 +330,7 @@ object ICollection.SyncRoot /// IEnumerator IEnumerable.GetEnumerator() { - return ((IEnumerable)InnerHashtable).GetEnumerator(); + return ((IEnumerable)this.InnerHashtable).GetEnumerator(); } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PropertyEntry.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PropertyEntry.cs index ab70274744a..98df2c73bb0 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/PropertyEntry.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/PropertyEntry.cs @@ -51,8 +51,8 @@ public class PropertyEntry /// public string Key { - get { return m_key; } - set { m_key = value; } + get { return this.m_key; } + set { this.m_key = value; } } /// @@ -68,8 +68,8 @@ public string Key /// public object Value { - get { return m_value; } - set { m_value = value; } + get { return this.m_value; } + set { this.m_value = value; } } /// @@ -78,7 +78,7 @@ public object Value /// string info about this object public override string ToString() { - return "PropertyEntry(Key=" + m_key + ", Value=" + m_value + ")"; + return "PropertyEntry(Key=" + this.m_key + ", Value=" + this.m_value + ")"; } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/QuietTextWriter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/QuietTextWriter.cs index 62a0d0c55f1..405e089e107 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/QuietTextWriter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/QuietTextWriter.cs @@ -59,7 +59,7 @@ public QuietTextWriter(TextWriter writer, IErrorHandler errorHandler) : base(wri { throw new ArgumentNullException("errorHandler"); } - ErrorHandler = errorHandler; + this.ErrorHandler = errorHandler; } #endregion Public Instance Constructors @@ -79,7 +79,7 @@ public QuietTextWriter(TextWriter writer, IErrorHandler errorHandler) : base(wri /// public IErrorHandler ErrorHandler { - get { return m_errorHandler; } + get { return this.m_errorHandler; } set { if (value == null) @@ -87,7 +87,7 @@ public IErrorHandler ErrorHandler // This is a programming error on the part of the enclosing appender. throw new ArgumentNullException("value"); } - m_errorHandler = value; + this.m_errorHandler = value; } } @@ -104,7 +104,7 @@ public IErrorHandler ErrorHandler /// public bool Closed { - get { return m_closed; } + get { return this.m_closed; } } #endregion Public Instance Properties @@ -128,7 +128,7 @@ public override void Write(char value) } catch(Exception e) { - m_errorHandler.Error("Failed to write [" + value + "].", e, ErrorCode.WriteFailure); + this.m_errorHandler.Error("Failed to write [" + value + "].", e, ErrorCode.WriteFailure); } } @@ -151,7 +151,7 @@ public override void Write(char[] buffer, int index, int count) } catch(Exception e) { - m_errorHandler.Error("Failed to write buffer.", e, ErrorCode.WriteFailure); + this.m_errorHandler.Error("Failed to write buffer.", e, ErrorCode.WriteFailure); } } @@ -172,7 +172,7 @@ override public void Write(string value) } catch(Exception e) { - m_errorHandler.Error("Failed to write [" + value + "].", e, ErrorCode.WriteFailure); + this.m_errorHandler.Error("Failed to write [" + value + "].", e, ErrorCode.WriteFailure); } } @@ -186,7 +186,7 @@ override public void Write(string value) /// override public void Close() { - m_closed = true; + this.m_closed = true; base.Close(); } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReadOnlyPropertiesDictionary.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReadOnlyPropertiesDictionary.cs index a3f51db6268..23e7f0aa4e9 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReadOnlyPropertiesDictionary.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReadOnlyPropertiesDictionary.cs @@ -88,7 +88,7 @@ public ReadOnlyPropertiesDictionary(ReadOnlyPropertiesDictionary propertiesDicti { foreach(DictionaryEntry entry in propertiesDictionary) { - InnerHashtable.Add(entry.Key, entry.Value); + this.InnerHashtable.Add(entry.Key, entry.Value); } } @@ -113,7 +113,7 @@ protected ReadOnlyPropertiesDictionary(SerializationInfo info, StreamingContext foreach(SerializationEntry entry in info) { // The keys are stored as Xml encoded names - InnerHashtable[XmlConvert.DecodeName(entry.Name)] = entry.Value; + this.InnerHashtable[XmlConvert.DecodeName(entry.Name)] = entry.Value; } } #endif @@ -133,8 +133,8 @@ protected ReadOnlyPropertiesDictionary(SerializationInfo info, StreamingContext /// public string[] GetKeys() { - string[] keys = new String[InnerHashtable.Count]; - InnerHashtable.Keys.CopyTo(keys, 0); + string[] keys = new String[this.InnerHashtable.Count]; + this.InnerHashtable.Keys.CopyTo(keys, 0); return keys; } @@ -154,7 +154,7 @@ public string[] GetKeys() /// public virtual object this[string key] { - get { return InnerHashtable[key]; } + get { return this.InnerHashtable[key]; } set { throw new NotSupportedException("This is a Read Only Dictionary and can not be modified"); } } @@ -174,7 +174,7 @@ public virtual object this[string key] /// public bool Contains(string key) { - return InnerHashtable.Contains(key); + return this.InnerHashtable.Contains(key); } #endregion @@ -192,7 +192,7 @@ public bool Contains(string key) /// protected Hashtable InnerHashtable { - get { return m_hashtable; } + get { return this.m_hashtable; } } #region Implementation of ISerializable @@ -215,7 +215,7 @@ protected Hashtable InnerHashtable #endif public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { - foreach(DictionaryEntry entry in InnerHashtable.Clone() as IDictionary) + foreach(DictionaryEntry entry in this.InnerHashtable.Clone() as IDictionary) { string entryKey = entry.Key as string; object entryValue = entry.Value; @@ -247,7 +247,7 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte /// IDictionaryEnumerator IDictionary.GetEnumerator() { - return InnerHashtable.GetEnumerator(); + return this.InnerHashtable.GetEnumerator(); } /// @@ -266,7 +266,7 @@ void IDictionary.Remove(object key) /// bool IDictionary.Contains(object key) { - return InnerHashtable.Contains(key); + return this.InnerHashtable.Contains(key); } /// @@ -303,7 +303,7 @@ object IDictionary.this[object key] get { if (!(key is string)) throw new ArgumentException("key must be a string"); - return InnerHashtable[key]; + return this.InnerHashtable[key]; } set { @@ -316,7 +316,7 @@ object IDictionary.this[object key] /// ICollection IDictionary.Values { - get { return InnerHashtable.Values; } + get { return this.InnerHashtable.Values; } } /// @@ -324,7 +324,7 @@ ICollection IDictionary.Values /// ICollection IDictionary.Keys { - get { return InnerHashtable.Keys; } + get { return this.InnerHashtable.Keys; } } /// @@ -332,7 +332,7 @@ ICollection IDictionary.Keys /// bool IDictionary.IsFixedSize { - get { return InnerHashtable.IsFixedSize; } + get { return this.InnerHashtable.IsFixedSize; } } #endregion @@ -346,7 +346,7 @@ bool IDictionary.IsFixedSize /// void ICollection.CopyTo(Array array, int index) { - InnerHashtable.CopyTo(array, index); + this.InnerHashtable.CopyTo(array, index); } /// @@ -354,7 +354,7 @@ void ICollection.CopyTo(Array array, int index) /// bool ICollection.IsSynchronized { - get { return InnerHashtable.IsSynchronized; } + get { return this.InnerHashtable.IsSynchronized; } } /// @@ -362,7 +362,7 @@ bool ICollection.IsSynchronized /// public int Count { - get { return InnerHashtable.Count; } + get { return this.InnerHashtable.Count; } } /// @@ -370,7 +370,7 @@ public int Count /// object ICollection.SyncRoot { - get { return InnerHashtable.SyncRoot; } + get { return this.InnerHashtable.SyncRoot; } } #endregion @@ -382,7 +382,7 @@ object ICollection.SyncRoot /// IEnumerator IEnumerable.GetEnumerator() { - return ((IEnumerable)InnerHashtable).GetEnumerator(); + return ((IEnumerable)this.InnerHashtable).GetEnumerator(); } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReaderWriterLock.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReaderWriterLock.cs index ae5ff43cb27..ffee56ba61e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReaderWriterLock.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ReaderWriterLock.cs @@ -68,7 +68,7 @@ public ReaderWriterLock() #if HAS_READERWRITERLOCK #if HAS_READERWRITERLOCKSLIM - m_lock = new System.Threading.ReaderWriterLockSlim(System.Threading.LockRecursionPolicy.SupportsRecursion); + this.m_lock = new System.Threading.ReaderWriterLockSlim(System.Threading.LockRecursionPolicy.SupportsRecursion); #else m_lock = new System.Threading.ReaderWriterLock(); #endif @@ -96,7 +96,7 @@ public void AcquireReaderLock() try { } finally { - m_lock.EnterReadLock(); + this.m_lock.EnterReadLock(); } #else m_lock.AcquireReaderLock(-1); @@ -119,7 +119,7 @@ public void ReleaseReaderLock() { #if HAS_READERWRITERLOCK #if HAS_READERWRITERLOCKSLIM - m_lock.ExitReadLock(); + this.m_lock.ExitReadLock(); #else m_lock.ReleaseReaderLock(); @@ -145,7 +145,7 @@ public void AcquireWriterLock() try { } finally { - m_lock.EnterWriteLock(); + this.m_lock.EnterWriteLock(); } #else m_lock.AcquireWriterLock(-1); @@ -168,7 +168,7 @@ public void ReleaseWriterLock() { #if HAS_READERWRITERLOCK #if HAS_READERWRITERLOCKSLIM - m_lock.ExitWriteLock(); + this.m_lock.ExitWriteLock(); #else m_lock.ReleaseWriterLock(); #endif diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/SystemStringFormat.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/SystemStringFormat.cs index c010bbd034d..41e068bb74c 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/SystemStringFormat.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/SystemStringFormat.cs @@ -53,9 +53,9 @@ public sealed class SystemStringFormat /// An array containing zero or more objects to format. public SystemStringFormat(IFormatProvider provider, string format, params object[] args) { - m_provider = provider; - m_format = format; - m_args = args; + this.m_provider = provider; + this.m_format = format; + this.m_args = args; } #endregion Constructor @@ -66,7 +66,7 @@ public SystemStringFormat(IFormatProvider provider, string format, params object /// the formatted string public override string ToString() { - return StringFormat(m_provider, m_format, m_args); + return StringFormat(this.m_provider, this.m_format, this.m_args); } #region StringFormat diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/TextWriterAdapter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/TextWriterAdapter.cs index 5e1a341dc16..e65a8a827ca 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/TextWriterAdapter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/TextWriterAdapter.cs @@ -65,7 +65,7 @@ public abstract class TextWriterAdapter : TextWriter /// protected TextWriterAdapter(TextWriter writer) : base(CultureInfo.InvariantCulture) { - m_writer = writer; + this.m_writer = writer; } #endregion @@ -85,8 +85,8 @@ protected TextWriterAdapter(TextWriter writer) : base(CultureInfo.InvariantCult /// protected TextWriter Writer { - get { return m_writer; } - set { m_writer = value; } + get { return this.m_writer; } + set { this.m_writer = value; } } #endregion Protected Instance Properties @@ -106,7 +106,7 @@ protected TextWriter Writer /// override public Encoding Encoding { - get { return m_writer.Encoding; } + get { return this.m_writer.Encoding; } } /// @@ -122,7 +122,7 @@ override public Encoding Encoding /// override public IFormatProvider FormatProvider { - get { return m_writer.FormatProvider; } + get { return this.m_writer.FormatProvider; } } /// @@ -138,8 +138,8 @@ override public IFormatProvider FormatProvider /// override public String NewLine { - get { return m_writer.NewLine; } - set { m_writer.NewLine = value; } + get { return this.m_writer.NewLine; } + set { this.m_writer.NewLine = value; } } #endregion @@ -161,7 +161,7 @@ virtual public void Close() #else override public void Close() { - m_writer.Close(); + this.m_writer.Close(); } #endif @@ -178,7 +178,7 @@ override protected void Dispose(bool disposing) { if (disposing) { - ((IDisposable)m_writer).Dispose(); + ((IDisposable)this.m_writer).Dispose(); } } @@ -193,7 +193,7 @@ override protected void Dispose(bool disposing) /// override public void Flush() { - m_writer.Flush(); + this.m_writer.Flush(); } /// @@ -207,7 +207,7 @@ override public void Flush() /// override public void Write(char value) { - m_writer.Write(value); + this.m_writer.Write(value); } /// @@ -223,7 +223,7 @@ override public void Write(char value) /// override public void Write(char[] buffer, int index, int count) { - m_writer.Write(buffer, index, count); + this.m_writer.Write(buffer, index, count); } /// @@ -237,7 +237,7 @@ override public void Write(char[] buffer, int index, int count) /// override public void Write(String value) { - m_writer.Write(value); + this.m_writer.Write(value); } #endregion diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextProperties.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextProperties.cs index d37c4e0afaf..0856987ffb9 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextProperties.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextProperties.cs @@ -101,7 +101,7 @@ override public object this[string key] } set { - GetProperties(true)[key] = value; + this.GetProperties(true)[key] = value; } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStack.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStack.cs index b4087e02439..8120593c66a 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStack.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStack.cs @@ -84,7 +84,7 @@ internal ThreadContextStack() /// public int Count { - get { return m_stack.Count; } + get { return this.m_stack.Count; } } #endregion // Public Properties @@ -108,7 +108,7 @@ public int Count /// public void Clear() { - m_stack.Clear(); + this.m_stack.Clear(); } /// @@ -124,7 +124,7 @@ public void Clear() /// public string Pop() { - Stack stack = m_stack; + Stack stack = this.m_stack; if (stack.Count > 0) { return ((StackFrame)(stack.Pop())).Message; @@ -157,7 +157,7 @@ public string Pop() /// public IDisposable Push(string message) { - Stack stack = m_stack; + Stack stack = this.m_stack; stack.Push(new StackFrame(message, (stack.Count>0) ? (StackFrame)stack.Peek() : null)); return new AutoPopStackFrame(stack, stack.Count - 1); @@ -173,7 +173,7 @@ public IDisposable Push(string message) /// The current context information. internal string GetFullMessage() { - Stack stack = m_stack; + Stack stack = this.m_stack; if (stack.Count > 0) { return ((StackFrame)(stack.Peek())).FullMessage; @@ -194,8 +194,8 @@ internal string GetFullMessage() /// internal Stack InternalStack { - get { return m_stack; } - set { m_stack = value; } + get { return this.m_stack; } + set { this.m_stack = value; } } #endregion Internal Methods @@ -211,7 +211,7 @@ internal Stack InternalStack /// public override string ToString() { - return GetFullMessage(); + return this.GetFullMessage(); } /// @@ -225,7 +225,7 @@ public override string ToString() /// object IFixingRequired.GetFixedObject() { - return GetFullMessage(); + return this.GetFullMessage(); } /// @@ -261,12 +261,12 @@ private sealed class StackFrame /// internal StackFrame(string message, StackFrame parent) { - m_message = message; - m_parent = parent; + this.m_message = message; + this.m_parent = parent; if (parent == null) { - m_fullMessage = message; + this.m_fullMessage = message; } } @@ -285,7 +285,7 @@ internal StackFrame(string message, StackFrame parent) /// internal string Message { - get { return m_message; } + get { return this.m_message; } } /// @@ -303,11 +303,11 @@ internal string FullMessage { get { - if (m_fullMessage == null && m_parent != null) + if (this.m_fullMessage == null && this.m_parent != null) { - m_fullMessage = string.Concat(m_parent.FullMessage, " ", m_message); + this.m_fullMessage = string.Concat(this.m_parent.FullMessage, " ", this.m_message); } - return m_fullMessage; + return this.m_fullMessage; } } @@ -354,8 +354,8 @@ private struct AutoPopStackFrame : IDisposable /// internal AutoPopStackFrame(Stack frameStack, int frameDepth) { - m_frameStack = frameStack; - m_frameDepth = frameDepth; + this.m_frameStack = frameStack; + this.m_frameDepth = frameDepth; } #endregion Internal Instance Constructors @@ -372,11 +372,11 @@ internal AutoPopStackFrame(Stack frameStack, int frameDepth) /// public void Dispose() { - if (m_frameDepth >= 0 && m_frameStack != null) + if (this.m_frameDepth >= 0 && this.m_frameStack != null) { - while(m_frameStack.Count > m_frameDepth) + while(this.m_frameStack.Count > this.m_frameDepth) { - m_frameStack.Pop(); + this.m_frameStack.Pop(); } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStacks.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStacks.cs index a8ae7efcb9f..19a2df0f25e 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStacks.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/ThreadContextStacks.cs @@ -51,7 +51,7 @@ public sealed class ThreadContextStacks /// internal ThreadContextStacks(ContextPropertiesBase properties) { - m_properties = properties; + this.m_properties = properties; } #endregion Public Instance Constructors @@ -75,12 +75,12 @@ public ThreadContextStack this[string key] { ThreadContextStack stack = null; - object propertyValue = m_properties[key]; + object propertyValue = this.m_properties[key]; if (propertyValue == null) { // Stack does not exist, create stack = new ThreadContextStack(); - m_properties[key] = stack; + this.m_properties[key] = stack; } else { diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/PatternStringConverter.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/PatternStringConverter.cs index d4f103a577d..5be9aba5da3 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/PatternStringConverter.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/PatternStringConverter.cs @@ -88,7 +88,7 @@ public bool CanConvertTo(Type targetType) public object ConvertTo(object source, Type targetType) { PatternString patternString = source as PatternString; - if (patternString != null && CanConvertTo(targetType)) + if (patternString != null && this.CanConvertTo(targetType)) { return patternString.Format(); } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/TypeConverterAttribute.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/TypeConverterAttribute.cs index 7e6be986d7d..400bb476484 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/TypeConverterAttribute.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/TypeConverters/TypeConverterAttribute.cs @@ -79,7 +79,7 @@ public TypeConverterAttribute() /// public TypeConverterAttribute(string typeName) { - m_typeName = typeName; + this.m_typeName = typeName; } /// @@ -94,7 +94,7 @@ public TypeConverterAttribute(string typeName) /// public TypeConverterAttribute(Type converterType) { - m_typeName = log4net.Util.SystemInfo.AssemblyQualifiedName(converterType); + this.m_typeName = log4net.Util.SystemInfo.AssemblyQualifiedName(converterType); } #endregion @@ -113,8 +113,8 @@ public TypeConverterAttribute(Type converterType) /// public string ConverterTypeName { - get { return m_typeName; } - set { m_typeName = value ; } + get { return this.m_typeName; } + set { this.m_typeName = value ; } } } } diff --git a/DNN Platform/DotNetNuke.Log4net/log4net/Util/WindowsSecurityContext.cs b/DNN Platform/DotNetNuke.Log4net/log4net/Util/WindowsSecurityContext.cs index 9623f1392b9..62a17b290f5 100644 --- a/DNN Platform/DotNetNuke.Log4net/log4net/Util/WindowsSecurityContext.cs +++ b/DNN Platform/DotNetNuke.Log4net/log4net/Util/WindowsSecurityContext.cs @@ -134,8 +134,8 @@ public WindowsSecurityContext() /// public ImpersonationMode Credentials { - get { return m_impersonationMode; } - set { m_impersonationMode = value; } + get { return this.m_impersonationMode; } + set { this.m_impersonationMode = value; } } /// @@ -152,8 +152,8 @@ public ImpersonationMode Credentials /// public string UserName { - get { return m_userName; } - set { m_userName = value; } + get { return this.m_userName; } + set { this.m_userName = value; } } /// @@ -174,8 +174,8 @@ public string UserName /// public string DomainName { - get { return m_domainName; } - set { m_domainName = value; } + get { return this.m_domainName; } + set { this.m_domainName = value; } } /// @@ -192,7 +192,7 @@ public string DomainName /// public string Password { - set { m_password = value; } + set { this.m_password = value; } } #endregion @@ -223,13 +223,13 @@ public string Password /// or properties were not specified. public void ActivateOptions() { - if (m_impersonationMode == ImpersonationMode.User) + if (this.m_impersonationMode == ImpersonationMode.User) { - if (m_userName == null) throw new ArgumentNullException("m_userName"); - if (m_domainName == null) throw new ArgumentNullException("m_domainName"); - if (m_password == null) throw new ArgumentNullException("m_password"); + if (this.m_userName == null) throw new ArgumentNullException("m_userName"); + if (this.m_domainName == null) throw new ArgumentNullException("m_domainName"); + if (this.m_password == null) throw new ArgumentNullException("m_password"); - m_identity = LogonUser(m_userName, m_domainName, m_password); + this.m_identity = LogonUser(this.m_userName, this.m_domainName, this.m_password); } } @@ -251,14 +251,14 @@ public void ActivateOptions() /// public override IDisposable Impersonate(object state) { - if (m_impersonationMode == ImpersonationMode.User) + if (this.m_impersonationMode == ImpersonationMode.User) { - if (m_identity != null) + if (this.m_identity != null) { - return new DisposableImpersonationContext(m_identity.Impersonate()); + return new DisposableImpersonationContext(this.m_identity.Impersonate()); } } - else if (m_impersonationMode == ImpersonationMode.Process) + else if (this.m_impersonationMode == ImpersonationMode.Process) { // Impersonate(0) will revert to the process credentials return new DisposableImpersonationContext(WindowsIdentity.Impersonate(IntPtr.Zero)); @@ -363,7 +363,7 @@ private sealed class DisposableImpersonationContext : IDisposable /// public DisposableImpersonationContext(WindowsImpersonationContext impersonationContext) { - m_impersonationContext = impersonationContext; + this.m_impersonationContext = impersonationContext; } /// @@ -376,7 +376,7 @@ public DisposableImpersonationContext(WindowsImpersonationContext impersonationC /// public void Dispose() { - m_impersonationContext.Undo(); + this.m_impersonationContext.Undo(); } } diff --git a/DNN Platform/DotNetNuke.Log4net/packages.config b/DNN Platform/DotNetNuke.Log4net/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/DotNetNuke.Log4net/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.ModulePipeline/DotNetNuke.ModulePipeline.csproj b/DNN Platform/DotNetNuke.ModulePipeline/DotNetNuke.ModulePipeline.csproj index a66b285d4e9..9f6ad4eb9ce 100644 --- a/DNN Platform/DotNetNuke.ModulePipeline/DotNetNuke.ModulePipeline.csproj +++ b/DNN Platform/DotNetNuke.ModulePipeline/DotNetNuke.ModulePipeline.csproj @@ -14,8 +14,16 @@ + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/DNN Platform/DotNetNuke.ModulePipeline/ModuleControlPipeline.cs b/DNN Platform/DotNetNuke.ModulePipeline/ModuleControlPipeline.cs index bc2ce2b5fd1..e0556f87837 100644 --- a/DNN Platform/DotNetNuke.ModulePipeline/ModuleControlPipeline.cs +++ b/DNN Platform/DotNetNuke.ModulePipeline/ModuleControlPipeline.cs @@ -44,23 +44,23 @@ public ModuleControlPipeline( MvcModuleControlFactory mvc, ReflectedModuleControlFactory fallthrough) { - _controlFactories = new Dictionary(StringComparer.OrdinalIgnoreCase); - _controlFactories.Add(".ascx", webforms); - _controlFactories.Add(".htm", html5); - _controlFactories.Add(".html", html5); - _controlFactories.Add(".cshtml", razor3); - _controlFactories.Add(".vbhtml", razor3); - _controlFactories.Add(".mvc", mvc); - _controlFactories.Add("default", fallthrough); + this._controlFactories = new Dictionary(StringComparer.OrdinalIgnoreCase); + this._controlFactories.Add(".ascx", webforms); + this._controlFactories.Add(".htm", html5); + this._controlFactories.Add(".html", html5); + this._controlFactories.Add(".cshtml", razor3); + this._controlFactories.Add(".vbhtml", razor3); + this._controlFactories.Add(".mvc", mvc); + this._controlFactories.Add("default", fallthrough); } #if NET472 private IModuleControlFactory GetModuleControlFactory(string controlSrc) { string extension = Path.GetExtension(controlSrc); - _controlFactories.TryGetValue(extension, out IModuleControlFactory factory); + this._controlFactories.TryGetValue(extension, out IModuleControlFactory factory); - return factory ?? _controlFactories["default"]; + return factory ?? this._controlFactories["default"]; } public Control LoadModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration, string controlKey, string controlSrc) @@ -69,7 +69,7 @@ public Control LoadModuleControl(TemplateControl containerControl, ModuleInfo mo TraceLogger.Debug($"ModuleControlFactory.LoadModuleControl Start (TabId:{moduleConfiguration.TabID},ModuleId:{moduleConfiguration.ModuleID}): ModuleControlSource:{moduleConfiguration.ModuleControl.ControlSrc}"); Control control = null; - IModuleControlFactory controlFactory = GetModuleControlFactory(controlSrc); + IModuleControlFactory controlFactory = this.GetModuleControlFactory(controlSrc); if (controlFactory != null) { @@ -100,7 +100,7 @@ public Control LoadModuleControl(TemplateControl containerControl, ModuleInfo mo if (TraceLogger.IsDebugEnabled) TraceLogger.Debug($"ModuleControlFactory.LoadModuleControl Start (TabId:{moduleConfiguration.TabID},ModuleId:{moduleConfiguration.ModuleID}): ModuleControlSource:{moduleConfiguration.ModuleControl.ControlSrc}"); Control control = null; - IModuleControlFactory controlFactory = GetModuleControlFactory(moduleConfiguration.ModuleControl.ControlSrc); + IModuleControlFactory controlFactory = this.GetModuleControlFactory(moduleConfiguration.ModuleControl.ControlSrc); if (controlFactory != null) { @@ -132,7 +132,7 @@ public Control LoadSettingsControl(TemplateControl containerControl, ModuleInfo TraceLogger.Debug($"ModuleControlFactory.LoadSettingsControl Start (TabId:{moduleConfiguration.TabID},ModuleId:{moduleConfiguration.ModuleID}): ModuleControlSource:{moduleConfiguration.ModuleControl.ControlSrc}"); Control control = null; - IModuleControlFactory controlFactory = GetModuleControlFactory(controlSrc); + IModuleControlFactory controlFactory = this.GetModuleControlFactory(controlSrc); if (controlFactory != null) { @@ -171,7 +171,7 @@ public Control CreateCachedControl(string cachedContent, ModuleInfo moduleConfig public Control CreateModuleControl(ModuleInfo moduleConfiguration) { - IModuleControlFactory factory = GetModuleControlFactory(moduleConfiguration.ModuleControl.ControlSrc); + IModuleControlFactory factory = this.GetModuleControlFactory(moduleConfiguration.ModuleControl.ControlSrc); return factory.CreateModuleControl(moduleConfiguration); } #endif diff --git a/DNN Platform/DotNetNuke.Web.Client/ClientResourceSettings.cs b/DNN Platform/DotNetNuke.Web.Client/ClientResourceSettings.cs index 81faf9f80ad..5facd7ae9d2 100644 --- a/DNN Platform/DotNetNuke.Web.Client/ClientResourceSettings.cs +++ b/DNN Platform/DotNetNuke.Web.Client/ClientResourceSettings.cs @@ -79,22 +79,22 @@ public Boolean IsOverridingDefaultSettingsEnabled() public bool? AreCompositeFilesEnabled() { - return IsBooleanSettingEnabled(EnableCompositeFilesKey); + return this.IsBooleanSettingEnabled(EnableCompositeFilesKey); } public bool? EnableCssMinification() { - return IsBooleanSettingEnabled(MinifyCssKey); + return this.IsBooleanSettingEnabled(MinifyCssKey); } public bool? EnableJsMinification() { - return IsBooleanSettingEnabled(MinifyJsKey); + return this.IsBooleanSettingEnabled(MinifyJsKey); } private bool? IsBooleanSettingEnabled(string settingKey) { - if (Status != UpgradeStatus.None) + if (this.Status != UpgradeStatus.None) { return false; } @@ -234,13 +234,13 @@ private UpgradeStatus Status { get { - if (!_statusChecked) + if (!this._statusChecked) { - _status = GetStatusByReflection(); - _statusChecked = true; + this._status = this.GetStatusByReflection(); + this._statusChecked = true; } - return _status; + return this._status; } } diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceExclude.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceExclude.cs index b29bcc0035d..61ab9ab9db0 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceExclude.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceExclude.cs @@ -19,17 +19,17 @@ public abstract class ClientResourceExclude : Control protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - var loader = Page.FindControl("ClientResourceIncludes"); - Name = Name.ToLowerInvariant(); + var loader = this.Page.FindControl("ClientResourceIncludes"); + this.Name = this.Name.ToLowerInvariant(); if (loader != null) { ClientDependencyInclude ctlToRemove = null; - if (!String.IsNullOrEmpty(Name)) + if (!String.IsNullOrEmpty(this.Name)) { foreach (ClientDependencyInclude ctl in loader.Controls) { - if (ctl.Name.ToLowerInvariant() == Name && ctl.DependencyType == DependencyType) + if (ctl.Name.ToLowerInvariant() == this.Name && ctl.DependencyType == this.DependencyType) { ctlToRemove = ctl; break; diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceLoader.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceLoader.cs index 6def076460b..dd0585be492 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceLoader.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/ClientResourceLoader.cs @@ -26,12 +26,12 @@ private bool AsyncPostBackHandlerEnabled protected override void OnPreRender(System.EventArgs e) { - foreach (var path in Paths) + foreach (var path in this.Paths) { path.Name = path.Name.ToLowerInvariant(); } - if (AsyncPostBackHandlerEnabled) + if (this.AsyncPostBackHandlerEnabled) { const string handlerScript = @" var loadScriptInSingleMode = function(){ @@ -131,7 +131,7 @@ protected override void OnPreRender(System.EventArgs e) }; }(jQuery)); "; - Page.ClientScript.RegisterStartupScript(this.GetType(), "CRMHandler", handlerScript, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "CRMHandler", handlerScript, true); } base.OnPreRender(e); diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssExclude.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssExclude.cs index 06ff0a4dc00..04dee47b775 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssExclude.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssExclude.cs @@ -10,7 +10,7 @@ public class DnnCssExclude : ClientResourceExclude { public DnnCssExclude() { - DependencyType = ClientDependency.Core.ClientDependencyType.Css; + this.DependencyType = ClientDependency.Core.ClientDependencyType.Css; } } } diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssInclude.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssInclude.cs index db410a0d89a..4052e63d82a 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssInclude.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnCssInclude.cs @@ -15,7 +15,7 @@ public class DnnCssInclude : CssInclude { public DnnCssInclude() { - ForceProvider = ClientResourceManager.DefaultCssProvider; + this.ForceProvider = ClientResourceManager.DefaultCssProvider; } protected override void OnLoad(System.EventArgs e) @@ -27,9 +27,9 @@ protected override void OnLoad(System.EventArgs e) protected override void Render(HtmlTextWriter writer) { - if (AddTag || Context.IsDebuggingEnabled) + if (this.AddTag || this.Context.IsDebuggingEnabled) { - writer.Write("", DependencyType, FilePath, ForceProvider, Priority); + writer.Write("", this.DependencyType, this.FilePath, this.ForceProvider, this.Priority); } } } diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsExclude.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsExclude.cs index 467139294d4..4c811a488a5 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsExclude.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsExclude.cs @@ -10,7 +10,7 @@ public class DnnJsExclude : ClientResourceExclude { public DnnJsExclude() { - DependencyType = ClientDependency.Core.ClientDependencyType.Javascript; + this.DependencyType = ClientDependency.Core.ClientDependencyType.Javascript; } } } diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsInclude.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsInclude.cs index 42dc3d5b589..43560e38ca7 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsInclude.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsInclude.cs @@ -18,7 +18,7 @@ public class DnnJsInclude : JsInclude /// public DnnJsInclude() { - ForceProvider = ClientResourceManager.DefaultJsProvider; + this.ForceProvider = ClientResourceManager.DefaultJsProvider; } protected override void OnLoad(System.EventArgs e) @@ -30,9 +30,9 @@ protected override void OnLoad(System.EventArgs e) protected override void Render(HtmlTextWriter writer) { - if (AddTag || Context.IsDebuggingEnabled) + if (this.AddTag || this.Context.IsDebuggingEnabled) { - writer.Write("", DependencyType, FilePath, ForceProvider, Priority); + writer.Write("", this.DependencyType, this.FilePath, this.ForceProvider, this.Priority); } } } diff --git a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsIncludeFallback.cs b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsIncludeFallback.cs index 3538ada725c..61e53affdb1 100644 --- a/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsIncludeFallback.cs +++ b/DNN Platform/DotNetNuke.Web.Client/Controls/DnnJsIncludeFallback.cs @@ -16,8 +16,8 @@ public class DnnJsIncludeFallback : WebControl public DnnJsIncludeFallback(string objectName, string fileName) { - ObjectName = objectName; - FileName = fileName; + this.ObjectName = objectName; + this.FileName = fileName; } public string ObjectName { get; set; } @@ -29,18 +29,18 @@ public override void RenderControl(HtmlTextWriter writer) writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript"); writer.RenderBeginTag(HtmlTextWriterTag.Script); - if (ObjectName.Contains(".")) + if (this.ObjectName.Contains(".")) { //generate function check - writer.Write("if (typeof " + ObjectName + " != 'function') {"); + writer.Write("if (typeof " + this.ObjectName + " != 'function') {"); } else { //generate object check - writer.Write("if (typeof " + ObjectName + " == 'undefined') {"); + writer.Write("if (typeof " + this.ObjectName + " == 'undefined') {"); } - writer.Write("document.write('"; - Page.ClientScript.RegisterClientScriptBlock(GetType(), "DnnFormNumericTextBoxItem", initalizeScript); + var initalizeScript = ""; + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DnnFormNumericTextBoxItem", initalizeScript); - return _textBox; + return this._textBox; } protected override void OnInit(EventArgs e) { base.OnInit(e); - FormMode = DnnFormMode.Short; + this.FormMode = DnnFormMode.Short; } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormPagesItem.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormPagesItem.cs index c094568a206..5b51a860ea1 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormPagesItem.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormPagesItem.cs @@ -12,9 +12,9 @@ public class DnnFormPagesItem : DnnFormComboBoxItem { public DnnFormPagesItem() { - ListSource = TabController.GetPortalTabs(PortalSettings.PortalId, Null.NullInteger, true, "<" + Localization.GetString("None_Specified") + ">", true, false, true, true, false); - ListTextField = "TabName"; - ListValueField = "TabID"; + this.ListSource = TabController.GetPortalTabs(this.PortalSettings.PortalId, Null.NullInteger, true, "<" + Localization.GetString("None_Specified") + ">", true, false, true, true, false); + this.ListTextField = "TabName"; + this.ListValueField = "TabID"; } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormSkinsItem.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormSkinsItem.cs index d834b9de828..e4c15b9916c 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormSkinsItem.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormSkinsItem.cs @@ -36,12 +36,12 @@ public class DnnFormSkinsItem : DnnFormItemBase private void ContainerIndexChanged(object sender, EventArgs e) { - UpdateDataSource(_containerValue, _containerCombo.SelectedValue, ContainerDataField); + this.UpdateDataSource(this._containerValue, this._containerCombo.SelectedValue, this.ContainerDataField); } private void SkinIndexChanged(object sender, EventArgs e) { - UpdateDataSource(_skinValue, _skinCombo.SelectedValue, SkinDataField); + this.UpdateDataSource(this._skinValue, this._skinCombo.SelectedValue, this.SkinDataField); } private Dictionary GetSkins(string skinRoot) @@ -49,10 +49,10 @@ private Dictionary GetSkins(string skinRoot) // load host skins var skins = SkinController.GetSkins(null, skinRoot, SkinScope.Host).ToDictionary(skin => skin.Key, skin => skin.Value); - if (IncludePortalSkins) + if (this.IncludePortalSkins) { // load portal skins - var portal = PortalController.Instance.GetPortal(PortalId); + var portal = PortalController.Instance.GetPortal(this.PortalId); foreach (var skin in SkinController.GetSkins(portal, skinRoot, SkinScope.Site)) { @@ -68,50 +68,50 @@ protected override WebControl CreateControlInternal(Control container) container.Controls.Add(panel); - var skinLabel = new Label { Text = LocalizeString("Skin") }; + var skinLabel = new Label { Text = this.LocalizeString("Skin") }; skinLabel.CssClass += "dnnFormSkinLabel"; panel.Controls.Add(skinLabel); //_skinCombo = new DropDownList { ID = ID + "_SkinComboBox" }; - _skinCombo = new DnnComboBox { ID = ID + "_SkinComboBox" }; - _skinCombo.CssClass += "dnnFormSkinInput"; - _skinCombo.SelectedIndexChanged += SkinIndexChanged; - panel.Controls.Add(_skinCombo); + this._skinCombo = new DnnComboBox { ID = this.ID + "_SkinComboBox" }; + this._skinCombo.CssClass += "dnnFormSkinInput"; + this._skinCombo.SelectedIndexChanged += this.SkinIndexChanged; + panel.Controls.Add(this._skinCombo); - DnnFormComboBoxItem.BindListInternal(_skinCombo, _skinValue, GetSkins(SkinController.RootSkin), "Key", "Value"); + DnnFormComboBoxItem.BindListInternal(this._skinCombo, this._skinValue, this.GetSkins(SkinController.RootSkin), "Key", "Value"); - var containerLabel = new Label { Text = LocalizeString("Container") }; + var containerLabel = new Label { Text = this.LocalizeString("Container") }; containerLabel.CssClass += "dnnFormSkinLabel"; panel.Controls.Add(containerLabel); //_containerCombo = new DropDownList { ID = ID + "_ContainerComboBox" }; - _containerCombo = new DnnComboBox { ID = ID + "_ContainerComboBox" }; - _containerCombo.CssClass += "dnnFormSkinInput"; - _containerCombo.SelectedIndexChanged += ContainerIndexChanged; - panel.Controls.Add(_containerCombo); + this._containerCombo = new DnnComboBox { ID = this.ID + "_ContainerComboBox" }; + this._containerCombo.CssClass += "dnnFormSkinInput"; + this._containerCombo.SelectedIndexChanged += this.ContainerIndexChanged; + panel.Controls.Add(this._containerCombo); - DnnFormComboBoxItem.BindListInternal(_containerCombo, _containerValue, GetSkins(SkinController.RootContainer), "Key", "Value"); + DnnFormComboBoxItem.BindListInternal(this._containerCombo, this._containerValue, this.GetSkins(SkinController.RootContainer), "Key", "Value"); return panel; } protected override void DataBindInternal() { - DataBindInternal(SkinDataField, ref _skinValue); + this.DataBindInternal(this.SkinDataField, ref this._skinValue); - DataBindInternal(ContainerDataField, ref _containerValue); + this.DataBindInternal(this.ContainerDataField, ref this._containerValue); - Value = new Pair {First = _skinValue, Second = _containerValue}; + this.Value = new Pair {First = this._skinValue, Second = this._containerValue}; } protected override void LoadControlState(object state) { base.LoadControlState(state); - var pair = Value as Pair; + var pair = this.Value as Pair; if (pair != null) { - _skinValue = pair.First; - _containerValue = pair.Second; + this._skinValue = pair.First; + this._containerValue = pair.Second; } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormToggleButtonItem.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormToggleButtonItem.cs index d975dd455fe..454028ea4b1 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormToggleButtonItem.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnFormToggleButtonItem.cs @@ -32,7 +32,7 @@ public enum CheckBoxMode public DnnFormToggleButtonItem() { - Mode = CheckBoxMode.TrueFalse; + this.Mode = CheckBoxMode.TrueFalse; } public CheckBoxMode Mode { get; set; } @@ -40,56 +40,56 @@ public DnnFormToggleButtonItem() private void CheckedChanged(object sender, EventArgs e) { string newValue; - switch (Mode) + switch (this.Mode) { case CheckBoxMode.YN: - newValue = (_checkBox.Checked) ? "Y" : "N"; + newValue = (this._checkBox.Checked) ? "Y" : "N"; break; case CheckBoxMode.YesNo: - newValue = (_checkBox.Checked) ? "Yes" : "No"; + newValue = (this._checkBox.Checked) ? "Yes" : "No"; break; default: - newValue = (_checkBox.Checked) ? "true" : "false"; + newValue = (this._checkBox.Checked) ? "true" : "false"; break; } - UpdateDataSource(Value, newValue, DataField); + this.UpdateDataSource(this.Value, newValue, this.DataField); } protected override WebControl CreateControlInternal(Control container) { //_checkBox = new DnnRadButton {ID = ID + "_CheckBox", ButtonType = RadButtonType.ToggleButton, ToggleType = ButtonToggleType.CheckBox, AutoPostBack = false}; - _checkBox = new CheckBox{ ID = ID + "_CheckBox", AutoPostBack = false }; + this._checkBox = new CheckBox{ ID = this.ID + "_CheckBox", AutoPostBack = false }; - _checkBox.CheckedChanged += CheckedChanged; - container.Controls.Add(_checkBox); + this._checkBox.CheckedChanged += this.CheckedChanged; + container.Controls.Add(this._checkBox); //Load from ControlState - if (!_checkBox.Page.IsPostBack) + if (!this._checkBox.Page.IsPostBack) { } - switch (Mode) + switch (this.Mode) { case CheckBoxMode.YN: case CheckBoxMode.YesNo: - var stringValue = Value as string; + var stringValue = this.Value as string; if (stringValue != null) { - _checkBox.Checked = stringValue.StartsWith("Y", StringComparison.InvariantCultureIgnoreCase); + this._checkBox.Checked = stringValue.StartsWith("Y", StringComparison.InvariantCultureIgnoreCase); } break; default: - _checkBox.Checked = Convert.ToBoolean(Value); + this._checkBox.Checked = Convert.ToBoolean(this.Value); break; } - return _checkBox; + return this._checkBox; } protected override void OnInit(EventArgs e) { base.OnInit(e); - FormMode = DnnFormMode.Short; + this.FormMode = DnnFormMode.Short; } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGrid.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGrid.cs index d86100c615a..c6db0b0eafe 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGrid.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGrid.cs @@ -35,12 +35,12 @@ protected override void OnInit(EventArgs e) base.EnableEmbeddedBaseStylesheet = false; Utilities.ApplySkin(this); JavaScript.RequestRegistration(CommonJs.DnnPlugins); - if (string.IsNullOrEmpty(ClientSettings.ClientEvents.OnGridCreated)) + if (string.IsNullOrEmpty(this.ClientSettings.ClientEvents.OnGridCreated)) { - ClientSettings.ClientEvents.OnGridCreated = "$.dnnGridCreated"; + this.ClientSettings.ClientEvents.OnGridCreated = "$.dnnGridCreated"; } - this.PreRender += new EventHandler(DnnGrid_PreRender); + this.PreRender += new EventHandler(this.DnnGrid_PreRender); this.MasterTableView.NoMasterRecordsText = Localization.GetString("NoRecords", Localization.SharedResourceFile); } @@ -48,19 +48,19 @@ protected override void OnInit(EventArgs e) void DnnGrid_PreRender(object sender, EventArgs e) { var items = this.MasterTableView.Items; - if (ScreenRowNumber == 0) - ScreenRowNumber = 15; + if (this.ScreenRowNumber == 0) + this.ScreenRowNumber = 15; - if (items.Count > ScreenRowNumber) + if (items.Count > this.ScreenRowNumber) { // need scroll this.ClientSettings.Scrolling.AllowScroll = true; this.ClientSettings.Scrolling.UseStaticHeaders = true; - if(RowHeight == 0) - RowHeight = 25; + if(this.RowHeight == 0) + this.RowHeight = 25; - this.ClientSettings.Scrolling.ScrollHeight = RowHeight * ScreenRowNumber; + this.ClientSettings.Scrolling.ScrollHeight = this.RowHeight * this.ScreenRowNumber; } else { diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridAttachmentColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridAttachmentColumn.cs index efb46f9867e..f6aafddefa6 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridAttachmentColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridAttachmentColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBinaryImageColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBinaryImageColumn.cs index abfded16d98..1d91dd9c114 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBinaryImageColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBinaryImageColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBoundColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBoundColumn.cs index 939dbddbb39..02047ed6baf 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBoundColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridBoundColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,18 +44,18 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { GridHeaderItem headerItem = inItem as GridHeaderItem; - string columnName = DataField; - if (!Owner.AllowSorting) + string columnName = this.DataField; + if (!this.Owner.AllowSorting) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } else { LinkButton button = (LinkButton) headerItem[columnName].Controls[0]; - button.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + button.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridButtonColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridButtonColumn.cs index fb55a5cecce..40aa919f777 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridButtonColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridButtonColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } @@ -79,7 +79,7 @@ public override string ImageUrl get { if (string.IsNullOrEmpty(base.ImageUrl)) - base.ImageUrl = Entities.Icons.IconController.IconURL(IconKey, IconSize, IconStyle); + base.ImageUrl = Entities.Icons.IconController.IconURL(this.IconKey, this.IconSize, this.IconStyle); return base.ImageUrl; } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCalculatedColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCalculatedColumn.cs index 61d0f7745a8..5f3e17704ed 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCalculatedColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCalculatedColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCheckBoxColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCheckBoxColumn.cs index fbb000f1d68..f6ed3e26d3e 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCheckBoxColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridCheckBoxColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridClientSelectColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridClientSelectColumn.cs index 127c27c01da..2218d1af778 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridClientSelectColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridClientSelectColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,11 +44,11 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { if (! inItem.OwnerTableView.OwnerGrid.AllowMultiRowSelection) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridColumn.cs index ba30c79b64a..d26fff4043c 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -35,7 +35,7 @@ public override GridColumn Clone() { var dnnGridColumn = new DnnGridColumn(); dnnGridColumn.CopyBaseProperties(this); - dnnGridColumn.setHeaderText = HeaderText; + dnnGridColumn.setHeaderText = this.HeaderText; return dnnGridColumn; } @@ -46,12 +46,12 @@ public override string HeaderText get { if (String.IsNullOrEmpty(base.HeaderText)) - base.HeaderText = Localization.GetString(string.Format("{0}.Header", _HeaderText), DotNetNuke.Web.UI.Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent)); + base.HeaderText = Localization.GetString(string.Format("{0}.Header", this._HeaderText), DotNetNuke.Web.UI.Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent)); return base.HeaderText; } set { - _HeaderText = value; + this._HeaderText = value; base.HeaderText = ""; } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDateTimeColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDateTimeColumn.cs index e9b93296193..d10d395698c 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDateTimeColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDateTimeColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDropDownColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDropDownColumn.cs index 56c1e672615..a2e4498348f 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDropDownColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridDropDownColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridEditColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridEditColumn.cs index 893e01b8adf..85b050d64f5 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridEditColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridEditColumn.cs @@ -18,7 +18,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridExpandColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridExpandColumn.cs index 674e1bc6dc0..646002c06ec 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridExpandColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridExpandColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridGroupSplitterColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridGroupSplitterColumn.cs index 6657aca32e0..ac0a3a18319 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridGroupSplitterColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridGroupSplitterColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHTMLEditorColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHTMLEditorColumn.cs index 86639421bbc..07d16c05ac9 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHTMLEditorColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHTMLEditorColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHyperlinkColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHyperlinkColumn.cs index 6140b6f1172..a030410daf3 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHyperlinkColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridHyperlinkColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageColumn.cs index 1abd95818ac..7ba156dcee0 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumn.cs index 88f3a2b0e39..a20d2d0cc18 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumn.cs @@ -30,8 +30,8 @@ public class DnnGridImageCommandColumn : DnnGridTemplateColumn /// A String public ImageCommandColumnEditMode EditMode { - get { return _editMode; } - set { _editMode = value; } + get { return this._editMode; } + set { this._editMode = value; } } @@ -43,14 +43,14 @@ public string ImageURL { get { - if (!string.IsNullOrEmpty(_imageURL)) + if (!string.IsNullOrEmpty(this._imageURL)) { - return _imageURL; + return this._imageURL; } - return IconController.IconURL(IconKey, IconSize, IconStyle); + return IconController.IconURL(this.IconKey, this.IconSize, this.IconStyle); } - set { _imageURL = value; } + set { this._imageURL = value; } } @@ -110,8 +110,8 @@ public string ImageURL /// A Boolean public bool ShowImage { - get { return _showImage; } - set { _showImage = value; } + get { return this._showImage; } + set { this._showImage = value; } } @@ -139,22 +139,22 @@ private DnnGridImageCommandColumnTemplate CreateTemplate(GridItemType type) var template = new DnnGridImageCommandColumnTemplate(type); if (type != GridItemType.Header) { - template.ImageURL = ImageURL; + template.ImageURL = this.ImageURL; if (!isDesignMode) { - template.CommandName = CommandName; - template.VisibleField = VisibleField; - template.KeyField = KeyField; + template.CommandName = this.CommandName; + template.VisibleField = this.VisibleField; + template.KeyField = this.KeyField; } } - template.EditMode = EditMode; - template.NavigateURL = NavigateURL; - template.NavigateURLFormatString = NavigateURLFormatString; - template.OnClickJs = OnClickJs; - template.ShowImage = ShowImage; - template.Visible = Visible; + template.EditMode = this.EditMode; + template.NavigateURL = this.NavigateURL; + template.NavigateURLFormatString = this.NavigateURLFormatString; + template.OnClickJs = this.OnClickJs; + template.ShowImage = this.ShowImage; + template.Visible = this.Visible; - template.Text = type == GridItemType.Header ? HeaderText : Text; + template.Text = type == GridItemType.Header ? this.HeaderText : this.Text; //Set Design Mode to True template.DesignMode = isDesignMode; @@ -167,18 +167,18 @@ private DnnGridImageCommandColumnTemplate CreateTemplate(GridItemType type) /// public override void Initialize() { - ItemTemplate = CreateTemplate(GridItemType.Item); - EditItemTemplate = CreateTemplate(GridItemType.EditItem); - HeaderTemplate = CreateTemplate(GridItemType.Header); + this.ItemTemplate = this.CreateTemplate(GridItemType.Item); + this.EditItemTemplate = this.CreateTemplate(GridItemType.EditItem); + this.HeaderTemplate = this.CreateTemplate(GridItemType.Header); if (HttpContext.Current == null) { - HeaderStyle.Font.Names = new[] { "Tahoma, Verdana, Arial" }; - HeaderStyle.Font.Size = new FontUnit("10pt"); - HeaderStyle.Font.Bold = true; + this.HeaderStyle.Font.Names = new[] { "Tahoma, Verdana, Arial" }; + this.HeaderStyle.Font.Size = new FontUnit("10pt"); + this.HeaderStyle.Font.Bold = true; } - ItemStyle.HorizontalAlign = HorizontalAlign.Center; - HeaderStyle.HorizontalAlign = HorizontalAlign.Center; + this.ItemStyle.HorizontalAlign = HorizontalAlign.Center; + this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumnTemplate.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumnTemplate.cs index f77a4a8e67b..c97b7dcbc4f 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumnTemplate.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridImageCommandColumnTemplate.cs @@ -28,7 +28,7 @@ public DnnGridImageCommandColumnTemplate() public DnnGridImageCommandColumnTemplate(GridItemType itemType) { - ItemType = itemType; + this.ItemType = itemType; } @@ -52,8 +52,8 @@ public DnnGridImageCommandColumnTemplate(GridItemType itemType) /// A String public ImageCommandColumnEditMode EditMode { - get { return _editMode; } - set { _editMode = value; } + get { return this._editMode; } + set { this._editMode = value; } } @@ -70,8 +70,8 @@ public ImageCommandColumnEditMode EditMode /// A String public GridItemType ItemType { - get { return _itemType; } - set { _itemType = value; } + get { return this._itemType; } + set { this._itemType = value; } } @@ -110,8 +110,8 @@ public GridItemType ItemType /// A Boolean public bool ShowImage { - get { return _showImage; } - set { _showImage = value; } + get { return this._showImage; } + set { this._showImage = value; } } @@ -130,8 +130,8 @@ public bool ShowImage /// A Boolean public bool Visible { - get { return _visible; } - set { _visible = value; } + get { return this._visible; } + set { this._visible = value; } } @@ -151,59 +151,59 @@ public bool Visible /// The parent container (DataGridItem) public void InstantiateIn(Control container) { - switch (ItemType) + switch (this.ItemType) { case GridItemType.Item: case GridItemType.AlternatingItem: case GridItemType.SelectedItem: case GridItemType.EditItem: - if (EditMode == ImageCommandColumnEditMode.URL) + if (this.EditMode == ImageCommandColumnEditMode.URL) { - var hypLink = new HyperLink {ToolTip = Text}; - if (!String.IsNullOrEmpty(ImageURL) && ShowImage) + var hypLink = new HyperLink {ToolTip = this.Text}; + if (!String.IsNullOrEmpty(this.ImageURL) && this.ShowImage) { - var img = new Image {ImageUrl = DesignMode ? ImageURL.Replace("~/", "../../") : ImageURL}; + var img = new Image {ImageUrl = this.DesignMode ? this.ImageURL.Replace("~/", "../../") : this.ImageURL}; hypLink.Controls.Add(img); - img.ToolTip = Text; + img.ToolTip = this.Text; } else { - hypLink.Text = Text; + hypLink.Text = this.Text; } - hypLink.DataBinding += ItemDataBinding; + hypLink.DataBinding += this.ItemDataBinding; container.Controls.Add(hypLink); } else { - if (!String.IsNullOrEmpty(ImageURL) && ShowImage) + if (!String.IsNullOrEmpty(this.ImageURL) && this.ShowImage) { var colIcon = new ImageButton - {ImageUrl = DesignMode ? ImageURL.Replace("~/", "../../") : ImageURL, ToolTip = Text}; - if (!String.IsNullOrEmpty(OnClickJs)) + {ImageUrl = this.DesignMode ? this.ImageURL.Replace("~/", "../../") : this.ImageURL, ToolTip = this.Text}; + if (!String.IsNullOrEmpty(this.OnClickJs)) { - ClientAPI.AddButtonConfirm(colIcon, OnClickJs); + ClientAPI.AddButtonConfirm(colIcon, this.OnClickJs); } - colIcon.CommandName = CommandName; - colIcon.DataBinding += ItemDataBinding; + colIcon.CommandName = this.CommandName; + colIcon.DataBinding += this.ItemDataBinding; container.Controls.Add(colIcon); } - if (!String.IsNullOrEmpty(Text) && !ShowImage) + if (!String.IsNullOrEmpty(this.Text) && !this.ShowImage) { - var colLink = new LinkButton {ToolTip = Text}; - if (!String.IsNullOrEmpty(OnClickJs)) + var colLink = new LinkButton {ToolTip = this.Text}; + if (!String.IsNullOrEmpty(this.OnClickJs)) { - ClientAPI.AddButtonConfirm(colLink, OnClickJs); + ClientAPI.AddButtonConfirm(colLink, this.OnClickJs); } - colLink.CommandName = CommandName; - colLink.Text = Text; - colLink.DataBinding += ItemDataBinding; + colLink.CommandName = this.CommandName; + colLink.Text = this.Text; + colLink.DataBinding += this.ItemDataBinding; container.Controls.Add(colLink); } } break; case GridItemType.Footer: case GridItemType.Header: - container.Controls.Add(new LiteralControl(Text)); + container.Controls.Add(new LiteralControl(this.Text)); break; } } @@ -223,12 +223,12 @@ public IOrderedDictionary ExtractValues(Control container) /// The parent container (DataGridItem) private bool GetIsVisible(GridItem container) { - if (!String.IsNullOrEmpty(VisibleField)) + if (!String.IsNullOrEmpty(this.VisibleField)) { - return Convert.ToBoolean(DataBinder.Eval(container.DataItem, VisibleField)); + return Convert.ToBoolean(DataBinder.Eval(container.DataItem, this.VisibleField)); } - return Visible; + return this.Visible; } @@ -239,9 +239,9 @@ private bool GetIsVisible(GridItem container) private int GetValue(GridItem container) { int keyValue = Null.NullInteger; - if (!String.IsNullOrEmpty(KeyField)) + if (!String.IsNullOrEmpty(this.KeyField)) { - keyValue = Convert.ToInt32(DataBinder.Eval(container.DataItem, KeyField)); + keyValue = Convert.ToInt32(DataBinder.Eval(container.DataItem, this.KeyField)); } return keyValue; } @@ -258,14 +258,14 @@ private void ItemDataBinding(object sender, EventArgs e) { GridItem container; int keyValue; - if (EditMode == ImageCommandColumnEditMode.URL) + if (this.EditMode == ImageCommandColumnEditMode.URL) { var hypLink = (HyperLink) sender; container = (GridItem) hypLink.NamingContainer; - keyValue = GetValue(container); - if (!String.IsNullOrEmpty(NavigateURLFormatString)) + keyValue = this.GetValue(container); + if (!String.IsNullOrEmpty(this.NavigateURLFormatString)) { - hypLink.NavigateUrl = string.Format(NavigateURLFormatString, keyValue); + hypLink.NavigateUrl = string.Format(this.NavigateURLFormatString, keyValue); } else { @@ -275,22 +275,22 @@ private void ItemDataBinding(object sender, EventArgs e) else { //Bind Image Button - if (!String.IsNullOrEmpty(ImageURL) && ShowImage) + if (!String.IsNullOrEmpty(this.ImageURL) && this.ShowImage) { var colIcon = (ImageButton) sender; container = (GridItem) colIcon.NamingContainer; - keyValue = GetValue(container); + keyValue = this.GetValue(container); colIcon.CommandArgument = keyValue.ToString(CultureInfo.InvariantCulture); - colIcon.Visible = GetIsVisible(container); + colIcon.Visible = this.GetIsVisible(container); } - if (!String.IsNullOrEmpty(Text) && !ShowImage) + if (!String.IsNullOrEmpty(this.Text) && !this.ShowImage) { //Bind Link Button var colLink = (LinkButton) sender; container = (GridItem) colLink.NamingContainer; - keyValue = GetValue(container); + keyValue = this.GetValue(container); colLink.CommandArgument = keyValue.ToString(CultureInfo.InvariantCulture); - colLink.Visible = GetIsVisible(container); + colLink.Visible = this.GetIsVisible(container); } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridItemSelectedEventArgs.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridItemSelectedEventArgs.cs index 020706963e9..c22140a699a 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridItemSelectedEventArgs.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridItemSelectedEventArgs.cs @@ -20,7 +20,7 @@ public class DnnGridItemSelectedEventArgs : EventArgs public DnnGridItemSelectedEventArgs(GridItemCollection selectedItems) { - _SelectedItems = selectedItems; + this._SelectedItems = selectedItems; } #endregion @@ -31,7 +31,7 @@ public GridItemCollection SelectedItems { get { - return _SelectedItems; + return this._SelectedItems; } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridMaskedColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridMaskedColumn.cs index 3d3536f3218..d992281a08b 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridMaskedColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridMaskedColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridNumericColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridNumericColumn.cs index d9e5738b47a..b73236d8a6a 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridNumericColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridNumericColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRatingColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRatingColumn.cs index c4d162b9009..e1126422a4c 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRatingColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRatingColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRowIndicatorColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRowIndicatorColumn.cs index 8d6483f8d9a..5fafc551d6c 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRowIndicatorColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridRowIndicatorColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridTemplateColumn.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridTemplateColumn.cs index 634d6c8d767..bfede5202c7 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridTemplateColumn.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnGridTemplateColumn.cs @@ -23,7 +23,7 @@ public string LocalResourceFile { get { - return Utilities.GetLocalResourceFile(Owner.OwnerGrid.Parent); + return Utilities.GetLocalResourceFile(this.Owner.OwnerGrid.Parent); } } @@ -44,9 +44,9 @@ public override GridColumn Clone() public override void InitializeCell(TableCell cell, int columnIndex, GridItem inItem) { base.InitializeCell(cell, columnIndex, inItem); - if (inItem is GridHeaderItem && HeaderTemplate == null && !String.IsNullOrEmpty(HeaderText)) + if (inItem is GridHeaderItem && this.HeaderTemplate == null && !String.IsNullOrEmpty(this.HeaderText)) { - cell.Text = Localization.GetString(string.Format("{0}.Header", HeaderText), LocalResourceFile); + cell.Text = Localization.GetString(string.Format("{0}.Header", this.HeaderText), this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnLanguageComboBox.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnLanguageComboBox.cs index d0b7bfcb943..5e99122556e 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnLanguageComboBox.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnLanguageComboBox.cs @@ -51,13 +51,13 @@ protected override HtmlTextWriterTag TagKey public DnnLanguageComboBox() { - AutoPostBack = Null.NullBoolean; - CausesValidation = Null.NullBoolean; - ShowFlag = true; - ShowModeButtons = true; - HideLanguagesList = new Dictionary(); - FlagImageUrlFormatString = "~/images/Flags/{0}.gif"; - _viewTypePersonalizationKey = "ViewType" + PortalId; + this.AutoPostBack = Null.NullBoolean; + this.CausesValidation = Null.NullBoolean; + this.ShowFlag = true; + this.ShowModeButtons = true; + this.HideLanguagesList = new Dictionary(); + this.FlagImageUrlFormatString = "~/images/Flags/{0}.gif"; + this._viewTypePersonalizationKey = "ViewType" + this.PortalId; } #endregion @@ -68,7 +68,7 @@ private string DisplayMode { get { - string displayMode = Convert.ToString(Personalization.GetProfile("LanguageDisplayMode", _viewTypePersonalizationKey)); + string displayMode = Convert.ToString(Personalization.GetProfile("LanguageDisplayMode", this._viewTypePersonalizationKey)); if (string.IsNullOrEmpty(displayMode)) { displayMode = "NATIVE"; @@ -87,11 +87,11 @@ public LanguagesListType LanguagesListType { get { - return _languagesListType; + return this._languagesListType; } set { - _languagesListType = value; + this._languagesListType = value; } } @@ -101,7 +101,7 @@ public string SelectedValue { get { - string selectedValue = DisplayMode.Equals("NATIVE", StringComparison.InvariantCultureIgnoreCase) ? _nativeCombo.SelectedValue : _englishCombo.SelectedValue; + string selectedValue = this.DisplayMode.Equals("NATIVE", StringComparison.InvariantCultureIgnoreCase) ? this._nativeCombo.SelectedValue : this._englishCombo.SelectedValue; if (selectedValue == "None") { selectedValue = Null.NullString; @@ -132,20 +132,20 @@ public void BindData(bool refresh) if (refresh) { List cultures; - switch (LanguagesListType) + switch (this.LanguagesListType) { case LanguagesListType.Supported: cultures = LocaleController.Instance.GetCultures(LocaleController.Instance.GetLocales(Null.NullInteger)); break; case LanguagesListType.Enabled: - cultures = LocaleController.Instance.GetCultures(LocaleController.Instance.GetLocales(PortalId)); + cultures = LocaleController.Instance.GetCultures(LocaleController.Instance.GetLocales(this.PortalId)); break; default: cultures = new List(CultureInfo.GetCultures(CultureTypes.SpecificCultures)); break; } - foreach (KeyValuePair lang in HideLanguagesList) + foreach (KeyValuePair lang in this.HideLanguagesList) { string cultureCode = lang.Value.Code; CultureInfo culture = cultures.Where(c => c.Name == cultureCode).SingleOrDefault(); @@ -155,18 +155,18 @@ public void BindData(bool refresh) } } - _nativeCombo.DataSource = cultures.OrderBy(c => c.NativeName); - _englishCombo.DataSource = cultures.OrderBy(c => c.EnglishName); + this._nativeCombo.DataSource = cultures.OrderBy(c => c.NativeName); + this._englishCombo.DataSource = cultures.OrderBy(c => c.EnglishName); } - _nativeCombo.DataBind(); - _englishCombo.DataBind(); + this._nativeCombo.DataBind(); + this._englishCombo.DataBind(); - if (IncludeNoneSpecified && refresh) + if (this.IncludeNoneSpecified && refresh) { - _englishCombo.Items.Insert(0, new RadComboBoxItem(Localization.GetString("System_Default", Localization.SharedResourceFile), "None")); - _nativeCombo.Items.Insert(0, new RadComboBoxItem(Localization.GetString("System_Default", Localization.SharedResourceFile), "None")); + this._englishCombo.Items.Insert(0, new RadComboBoxItem(Localization.GetString("System_Default", Localization.SharedResourceFile), "None")); + this._nativeCombo.Items.Insert(0, new RadComboBoxItem(Localization.GetString("System_Default", Localization.SharedResourceFile), "None")); } } @@ -177,91 +177,91 @@ public void BindData(bool refresh) protected override void OnInit(EventArgs e) { base.OnInit(e); - _nativeCombo = new DnnComboBox(); - _nativeCombo.DataValueField = "Name"; - _nativeCombo.DataTextField = "NativeName"; - _nativeCombo.SelectedIndexChanged += ItemChangedInternal; - Controls.Add(_nativeCombo); - - _englishCombo = new DnnComboBox(); - _englishCombo.DataValueField = "Name"; - _englishCombo.DataTextField = "EnglishName"; - _englishCombo.SelectedIndexChanged += ItemChangedInternal; - Controls.Add(_englishCombo); - - _modeRadioButtonList = new RadioButtonList(); - _modeRadioButtonList.AutoPostBack = true; - _modeRadioButtonList.RepeatDirection = RepeatDirection.Horizontal; - _modeRadioButtonList.Items.Add(new ListItem(Localization.GetString("NativeName", Localization.GlobalResourceFile), "NATIVE")); - _modeRadioButtonList.Items.Add(new ListItem(Localization.GetString("EnglishName", Localization.GlobalResourceFile), "ENGLISH")); - _modeRadioButtonList.SelectedIndexChanged += ModeChangedInternal; - Controls.Add(_modeRadioButtonList); + this._nativeCombo = new DnnComboBox(); + this._nativeCombo.DataValueField = "Name"; + this._nativeCombo.DataTextField = "NativeName"; + this._nativeCombo.SelectedIndexChanged += this.ItemChangedInternal; + this.Controls.Add(this._nativeCombo); + + this._englishCombo = new DnnComboBox(); + this._englishCombo.DataValueField = "Name"; + this._englishCombo.DataTextField = "EnglishName"; + this._englishCombo.SelectedIndexChanged += this.ItemChangedInternal; + this.Controls.Add(this._englishCombo); + + this._modeRadioButtonList = new RadioButtonList(); + this._modeRadioButtonList.AutoPostBack = true; + this._modeRadioButtonList.RepeatDirection = RepeatDirection.Horizontal; + this._modeRadioButtonList.Items.Add(new ListItem(Localization.GetString("NativeName", Localization.GlobalResourceFile), "NATIVE")); + this._modeRadioButtonList.Items.Add(new ListItem(Localization.GetString("EnglishName", Localization.GlobalResourceFile), "ENGLISH")); + this._modeRadioButtonList.SelectedIndexChanged += this.ModeChangedInternal; + this.Controls.Add(this._modeRadioButtonList); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - _originalValue = SelectedValue; + this._originalValue = this.SelectedValue; } protected virtual void OnItemChanged() { - if (ItemChanged != null) + if (this.ItemChanged != null) { - ItemChanged(this, new EventArgs()); + this.ItemChanged(this, new EventArgs()); } } protected void OnModeChanged(EventArgs e) { - if (ModeChanged != null) + if (this.ModeChanged != null) { - ModeChanged(this, e); + this.ModeChanged(this, e); } } protected override void OnPreRender(EventArgs e) { - if (DisplayMode.Equals("ENGLISH", StringComparison.InvariantCultureIgnoreCase)) + if (this.DisplayMode.Equals("ENGLISH", StringComparison.InvariantCultureIgnoreCase)) { - if (_englishCombo.Items.FindItemByValue(_originalValue) != null) + if (this._englishCombo.Items.FindItemByValue(this._originalValue) != null) { - _englishCombo.Items.FindItemByValue(_originalValue).Selected = true; + this._englishCombo.Items.FindItemByValue(this._originalValue).Selected = true; } } else { - if (_nativeCombo.Items.FindItemByValue(_originalValue) != null) + if (this._nativeCombo.Items.FindItemByValue(this._originalValue) != null) { - _nativeCombo.Items.FindItemByValue(_originalValue).Selected = true; + this._nativeCombo.Items.FindItemByValue(this._originalValue).Selected = true; } } - _modeRadioButtonList.Items.FindByValue(DisplayMode).Selected = true; + this._modeRadioButtonList.Items.FindByValue(this.DisplayMode).Selected = true; - foreach (RadComboBoxItem item in _englishCombo.Items) + foreach (RadComboBoxItem item in this._englishCombo.Items) { - item.ImageUrl = string.Format(FlagImageUrlFormatString, item.Value); + item.ImageUrl = string.Format(this.FlagImageUrlFormatString, item.Value); } - foreach (RadComboBoxItem item in _nativeCombo.Items) + foreach (RadComboBoxItem item in this._nativeCombo.Items) { - item.ImageUrl = string.Format(FlagImageUrlFormatString, item.Value); + item.ImageUrl = string.Format(this.FlagImageUrlFormatString, item.Value); } - _englishCombo.AutoPostBack = AutoPostBack; - _englishCombo.CausesValidation = CausesValidation; - _englishCombo.Visible = (DisplayMode.Equals("ENGLISH", StringComparison.InvariantCultureIgnoreCase)); + this._englishCombo.AutoPostBack = this.AutoPostBack; + this._englishCombo.CausesValidation = this.CausesValidation; + this._englishCombo.Visible = (this.DisplayMode.Equals("ENGLISH", StringComparison.InvariantCultureIgnoreCase)); - _nativeCombo.AutoPostBack = AutoPostBack; - _nativeCombo.CausesValidation = CausesValidation; - _nativeCombo.Visible = (DisplayMode.Equals("NATIVE", StringComparison.InvariantCultureIgnoreCase)); + this._nativeCombo.AutoPostBack = this.AutoPostBack; + this._nativeCombo.CausesValidation = this.CausesValidation; + this._nativeCombo.Visible = (this.DisplayMode.Equals("NATIVE", StringComparison.InvariantCultureIgnoreCase)); - _modeRadioButtonList.Visible = ShowModeButtons; + this._modeRadioButtonList.Visible = this.ShowModeButtons; - _englishCombo.Width = Width; - _nativeCombo.Width = Width; + this._englishCombo.Width = this.Width; + this._nativeCombo.Width = this.Width; base.OnPreRender(e); } @@ -274,19 +274,19 @@ public void SetLanguage(string code) { if (string.IsNullOrEmpty(code)) { - _nativeCombo.SelectedIndex = _nativeCombo.FindItemIndexByValue("None"); - _englishCombo.SelectedIndex = _englishCombo.FindItemIndexByValue("None"); + this._nativeCombo.SelectedIndex = this._nativeCombo.FindItemIndexByValue("None"); + this._englishCombo.SelectedIndex = this._englishCombo.FindItemIndexByValue("None"); } else { - _nativeCombo.SelectedIndex = _nativeCombo.FindItemIndexByValue(code); - _englishCombo.SelectedIndex = _englishCombo.FindItemIndexByValue(code); + this._nativeCombo.SelectedIndex = this._nativeCombo.FindItemIndexByValue(code); + this._englishCombo.SelectedIndex = this._englishCombo.FindItemIndexByValue(code); } } public override void DataBind() { - BindData(!Page.IsPostBack); + this.BindData(!this.Page.IsPostBack); } #endregion @@ -295,17 +295,17 @@ public override void DataBind() private void ModeChangedInternal(object sender, EventArgs e) { - Personalization.SetProfile("LanguageDisplayMode", _viewTypePersonalizationKey, _modeRadioButtonList.SelectedValue); + Personalization.SetProfile("LanguageDisplayMode", this._viewTypePersonalizationKey, this._modeRadioButtonList.SelectedValue); //Resort - BindData(true); + this.BindData(true); - OnModeChanged(EventArgs.Empty); + this.OnModeChanged(EventArgs.Empty); } private void ItemChangedInternal(object sender, EventArgs e) { - OnItemChanged(); + this.OnItemChanged(); } #endregion diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnModuleComboBox.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnModuleComboBox.cs index 1696f74422d..2b2e9025875 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnModuleComboBox.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnModuleComboBox.cs @@ -43,7 +43,7 @@ public int ItemCount { get { - return _moduleCombo.Items.Count; + return this._moduleCombo.Items.Count; } } @@ -51,7 +51,7 @@ public string SelectedValue { get { - return _moduleCombo.SelectedValue; + return this._moduleCombo.SelectedValue; } } @@ -59,18 +59,18 @@ public string RadComboBoxClientId { get { - return _moduleCombo.ClientID; + return this._moduleCombo.ClientID; } } public override bool Enabled { get { - return _moduleCombo.Enabled; + return this._moduleCombo.Enabled; } set { - _moduleCombo.Enabled = value; + this._moduleCombo.Enabled = value; } } @@ -81,7 +81,7 @@ public override bool Enabled { private Dictionary GetPortalDesktopModules() { IOrderedEnumerable> portalModulesList; - if (Filter == null) + if (this.Filter == null) { portalModulesList = DesktopModuleController.GetPortalDesktopModules(PortalSettings.Current.PortalId) .Where((kvp) => kvp.Value.DesktopModule.Category == "Uncategorised" || String.IsNullOrEmpty(kvp.Value.DesktopModule.Category)) @@ -90,7 +90,7 @@ private Dictionary GetPortalDesktopModules() else { portalModulesList = DesktopModuleController.GetPortalDesktopModules(PortalSettings.Current.PortalId) - .Where(Filter) + .Where(this.Filter) .OrderBy(c => c.Key); } @@ -127,7 +127,7 @@ private void BindPortalDesktopModuleImages() var portalDesktopModules = DesktopModuleController.GetDesktopModules(PortalSettings.Current.PortalId); var packages = PackageController.Instance.GetExtensionPackages(PortalSettings.Current.PortalId); - foreach (RadComboBoxItem item in _moduleCombo.Items) + foreach (RadComboBoxItem item in this._moduleCombo.Items) { string imageUrl = (from pkgs in packages @@ -146,7 +146,7 @@ private void BindTabModuleImages(int tabID) var moduleDefnitions = ModuleDefinitionController.GetModuleDefinitions(); var packages = PackageController.Instance.GetExtensionPackages(PortalSettings.Current.PortalId); - foreach (RadComboBoxItem item in _moduleCombo.Items) + foreach (RadComboBoxItem item in this._moduleCombo.Items) { string imageUrl = (from pkgs in packages join portMods in portalDesktopModules on pkgs.PackageID equals portMods.Value.PackageID @@ -166,34 +166,34 @@ where tabMods.Value.ModuleID.ToString() == item.Value protected override void OnInit(EventArgs e) { base.OnInit(e); - _moduleCombo = new DnnComboBox(); - _moduleCombo.DataValueField = "key"; - _moduleCombo.DataTextField = "value"; - Controls.Add(_moduleCombo); + this._moduleCombo = new DnnComboBox(); + this._moduleCombo.DataValueField = "key"; + this._moduleCombo.DataTextField = "value"; + this.Controls.Add(this._moduleCombo); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - _originalValue = SelectedValue; + this._originalValue = this.SelectedValue; } protected virtual void OnItemChanged() { - if (ItemChanged != null) + if (this.ItemChanged != null) { - ItemChanged(this, new EventArgs()); + this.ItemChanged(this, new EventArgs()); } } protected override void OnPreRender(EventArgs e) { - if (_moduleCombo.Items.FindItemByValue(_originalValue) != null) + if (this._moduleCombo.Items.FindItemByValue(this._originalValue) != null) { - _moduleCombo.Items.FindItemByValue(_originalValue).Selected = true; + this._moduleCombo.Items.FindItemByValue(this._originalValue).Selected = true; } - _moduleCombo.Width = Width; + this._moduleCombo.Width = this.Width; base.OnPreRender(e); } @@ -203,23 +203,23 @@ protected override void OnPreRender(EventArgs e) public void BindAllPortalDesktopModules() { - _moduleCombo.SelectedValue = null; - _moduleCombo.DataSource = GetPortalDesktopModules(); - _moduleCombo.DataBind(); - BindPortalDesktopModuleImages(); + this._moduleCombo.SelectedValue = null; + this._moduleCombo.DataSource = this.GetPortalDesktopModules(); + this._moduleCombo.DataBind(); + this.BindPortalDesktopModuleImages(); } public void BindTabModulesByTabID(int tabID) { - _moduleCombo.SelectedValue = null; - _moduleCombo.DataSource = GetTabModules(tabID); - _moduleCombo.DataBind(); - BindTabModuleImages(tabID); + this._moduleCombo.SelectedValue = null; + this._moduleCombo.DataSource = GetTabModules(tabID); + this._moduleCombo.DataBind(); + this.BindTabModuleImages(tabID); } public void SetModule(string code) { - _moduleCombo.SelectedIndex = _moduleCombo.FindItemIndexByValue(code); + this._moduleCombo.SelectedIndex = this._moduleCombo.FindItemIndexByValue(code); } #endregion diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnRadButton.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnRadButton.cs index 440afeb6dcc..6542f246ef5 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnRadButton.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnRadButton.cs @@ -24,12 +24,12 @@ public class DnnRadButton : RadButton protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); base.Render(writer); } @@ -41,15 +41,15 @@ public bool Localize { get { - if (DesignMode) + if (this.DesignMode) { return false; } - return _Localize; + return this._Localize; } set { - _Localize = value; + this._Localize = value; } } @@ -57,20 +57,20 @@ public bool Localize public virtual void LocalizeStrings() { - if ((Localize)) + if ((this.Localize)) { - if ((!string.IsNullOrEmpty(ToolTip))) + if ((!string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(ToolTip, LocalResourceFile); + this.ToolTip = Localization.GetString(this.ToolTip, this.LocalResourceFile); } - if ((!string.IsNullOrEmpty(Text))) + if ((!string.IsNullOrEmpty(this.Text))) { - Text = Localization.GetString(Text, LocalResourceFile); + this.Text = Localization.GetString(this.Text, this.LocalResourceFile); - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(string.Format("{0}.ToolTip", Text), LocalResourceFile); + this.ToolTip = Localization.GetString(string.Format("{0}.ToolTip", this.Text), this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnSkinComboBox.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnSkinComboBox.cs index bf2fa505021..9bab86c6402 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnSkinComboBox.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnSkinComboBox.cs @@ -39,7 +39,7 @@ public class DnnSkinComboBox : DnnComboBox private PortalInfo Portal { - get { return PortalId == Null.NullInteger ? null : PortalController.Instance.GetPortal(PortalId); } + get { return this.PortalId == Null.NullInteger ? null : PortalController.Instance.GetPortal(this.PortalId); } } #endregion @@ -48,7 +48,7 @@ private PortalInfo Portal public DnnSkinComboBox() { - PortalId = Null.NullInteger; + this.PortalId = Null.NullInteger; } #endregion @@ -59,33 +59,33 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - DataTextField = "Key"; - DataValueField = "Value"; + this.DataTextField = "Key"; + this.DataValueField = "Value"; - if (!Page.IsPostBack && !string.IsNullOrEmpty(RootPath)) + if (!this.Page.IsPostBack && !string.IsNullOrEmpty(this.RootPath)) { - DataSource = SkinController.GetSkins(Portal, RootPath, Scope) + this.DataSource = SkinController.GetSkins(this.Portal, this.RootPath, this.Scope) .ToDictionary(skin => skin.Key, skin => skin.Value); - DataBind(SelectedValue); + this.DataBind(this.SelectedValue); - if (IncludeNoneSpecificItem) + if (this.IncludeNoneSpecificItem) { - InsertItem(0, NoneSpecificText, string.Empty); + this.InsertItem(0, this.NoneSpecificText, string.Empty); } } - AttachEvents(); + this.AttachEvents(); } protected override void PerformDataBinding(IEnumerable dataSource) { //do not select item during data binding, item will select later - var selectedValue = SelectedValue; - SelectedValue = string.Empty; + var selectedValue = this.SelectedValue; + this.SelectedValue = string.Empty; base.PerformDataBinding(dataSource); - SelectedValue = selectedValue; + this.SelectedValue = selectedValue; } #endregion @@ -99,19 +99,19 @@ private void AttachEvents() return; } - Attributes.Add("PortalPath", Portal != null ? Portal.HomeDirectory : string.Empty); - Attributes.Add("HostPath", Globals.HostPath); + this.Attributes.Add("PortalPath", this.Portal != null ? this.Portal.HomeDirectory : string.Empty); + this.Attributes.Add("HostPath", Globals.HostPath); - OnClientSelectedIndexChanged = "selectedIndexChangedMethod"; + this.OnClientSelectedIndexChanged = "selectedIndexChangedMethod"; var indexChangedMethod = @"function selectedIndexChangedMethod(sender, eventArgs){ var value = eventArgs.get_item().get_value(); value = value.replace('[L]', sender.get_attributes().getAttribute('PortalPath')); value = value.replace('[G]', sender.get_attributes().getAttribute('HostPath')); sender.get_inputDomElement().title = value; }"; - Page.ClientScript.RegisterClientScriptBlock(GetType(), "OnClientSelectedIndexChanged", indexChangedMethod, true); + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "OnClientSelectedIndexChanged", indexChangedMethod, true); - foreach (RadComboBoxItem item in Items) + foreach (RadComboBoxItem item in this.Items) { if (string.IsNullOrEmpty(item.Value)) { @@ -119,15 +119,15 @@ private void AttachEvents() } var tooltip = item.Value.Replace("[G]", Globals.HostPath); - if (Portal != null) + if (this.Portal != null) { - tooltip = tooltip.Replace("[L]", Portal.HomeDirectory); + tooltip = tooltip.Replace("[L]", this.Portal.HomeDirectory); } item.ToolTip = tooltip; - if (item.Value.Equals(SelectedValue)) + if (item.Value.Equals(this.SelectedValue)) { - ToolTip = tooltip; + this.ToolTip = tooltip; } } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnTabPanel.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnTabPanel.cs index b8a07ba284f..6cec4d7eb7e 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnTabPanel.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnTabPanel.cs @@ -26,12 +26,12 @@ private RadTabStrip TelerikTabs { get { - if (_TelerikTabs == null) + if (this._TelerikTabs == null) { - _TelerikTabs = new RadTabStrip(); + this._TelerikTabs = new RadTabStrip(); } - return _TelerikTabs; + return this._TelerikTabs; } } @@ -39,12 +39,12 @@ private RadMultiPage TelerikPages { get { - if (_TelerikPages == null) + if (this._TelerikPages == null) { - _TelerikPages = new RadMultiPage(); + this._TelerikPages = new RadMultiPage(); } - return _TelerikPages; + return this._TelerikPages; } } @@ -52,12 +52,12 @@ public DnnTabCollection Tabs { get { - if (_Tabs == null) + if (this._Tabs == null) { - _Tabs = new DnnTabCollection(this); + this._Tabs = new DnnTabCollection(this); } - return _Tabs; + return this._Tabs; } } @@ -68,30 +68,30 @@ protected override void OnLoad(EventArgs e) protected override void CreateChildControls() { - Controls.Clear(); + this.Controls.Clear(); - TelerikTabs.ID = ID + "_Tabs"; - TelerikTabs.Skin = "Office2007"; - TelerikTabs.EnableEmbeddedSkins = true; + this.TelerikTabs.ID = this.ID + "_Tabs"; + this.TelerikTabs.Skin = "Office2007"; + this.TelerikTabs.EnableEmbeddedSkins = true; - TelerikPages.ID = ID + "_Pages"; + this.TelerikPages.ID = this.ID + "_Pages"; - TelerikTabs.MultiPageID = TelerikPages.ID; + this.TelerikTabs.MultiPageID = this.TelerikPages.ID; - Controls.Add(TelerikTabs); - Controls.Add(TelerikPages); + this.Controls.Add(this.TelerikTabs); + this.Controls.Add(this.TelerikPages); } protected override void OnPreRender(EventArgs e) { - if ((!Page.IsPostBack)) + if ((!this.Page.IsPostBack)) { - TelerikTabs.SelectedIndex = 0; - TelerikPages.SelectedIndex = 0; + this.TelerikTabs.SelectedIndex = 0; + this.TelerikPages.SelectedIndex = 0; int idIndex = 0; - foreach (DnnTab t in Tabs) + foreach (DnnTab t in this.Tabs) { RadTab tab = new RadTab(); tab.TabTemplate = t.Header; @@ -101,8 +101,8 @@ protected override void OnPreRender(EventArgs e) tab.PageViewID = "PV_" + idIndex; pageView.ID = "PV_" + idIndex; - TelerikTabs.Tabs.Add(tab); - TelerikPages.PageViews.Add(pageView); + this.TelerikTabs.Tabs.Add(tab); + this.TelerikPages.PageViews.Add(pageView); idIndex = idIndex + 1; } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnToolTip.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnToolTip.cs index a33defbd747..06abb4c6a89 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnToolTip.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/DnnToolTip.cs @@ -19,7 +19,7 @@ public class DnnToolTip : RadToolTip, ILocalizable protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); base.Render(writer); } @@ -34,11 +34,11 @@ public bool Localize { return false; } - return _localize; + return this._localize; } set { - _localize = value; + this._localize = value; } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateEditControl.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateEditControl.cs index 6d86dde5abc..5d4283089e7 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateEditControl.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateEditControl.cs @@ -54,7 +54,7 @@ protected DateTime DateValue DateTime dteValue = Null.NullDate; try { - var dteString = Convert.ToString(Value); + var dteString = Convert.ToString(this.Value); DateTime.TryParse(dteString, CultureInfo.InvariantCulture, DateTimeStyles.None, out dteValue); } catch (Exception exc) @@ -93,10 +93,10 @@ protected virtual string Format { get { - string _Format = DefaultFormat; - if (CustomAttributes != null) + string _Format = this.DefaultFormat; + if (this.CustomAttributes != null) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is FormatAttribute) { @@ -124,7 +124,7 @@ protected DateTime OldDateValue try { //Try and cast the value to an DateTime - var dteString = OldValue as string; + var dteString = this.OldValue as string; if (!string.IsNullOrEmpty(dteString)) { dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture); @@ -147,15 +147,15 @@ protected override string StringValue get { string _StringValue = Null.NullString; - if ((DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && DateValue != Null.NullDate)) + if ((this.DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && this.DateValue != Null.NullDate)) { - _StringValue = DateValue.ToString(Format); + _StringValue = this.DateValue.ToString(this.Format); } return _StringValue; } set { - Value = DateTime.Parse(value); + this.Value = DateTime.Parse(value); } } @@ -179,8 +179,8 @@ public override string EditControlClientId { get { - EnsureChildControls(); - return DateControl.DateInput.ClientID; + this.EnsureChildControls(); + return this.DateControl.DateInput.ClientID; } } @@ -193,12 +193,12 @@ private DnnDatePicker DateControl { get { - if (_dateControl == null) + if (this._dateControl == null) { - _dateControl = new DnnDatePicker(); + this._dateControl = new DnnDatePicker(); } - return _dateControl; + return this._dateControl; } } @@ -209,40 +209,40 @@ protected override void CreateChildControls() base.CreateChildControls(); - DateControl.ControlStyle.CopyFrom(ControlStyle); - DateControl.ID = base.ID + "_control"; + this.DateControl.ControlStyle.CopyFrom(this.ControlStyle); + this.DateControl.ID = base.ID + "_control"; - Controls.Add(DateControl); + this.Controls.Add(this.DateControl); } protected virtual void LoadDateControls() { - if (DateValue != Null.NullDate) + if (this.DateValue != Null.NullDate) { - DateControl.SelectedDate = DateValue.Date; + this.DateControl.SelectedDate = this.DateValue.Date; } } public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - EnsureChildControls(); + this.EnsureChildControls(); bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "_control"]; if (!presentValue.Equals(postedValue)) { if (string.IsNullOrEmpty(postedValue)) { - Value = Null.NullDate; + this.Value = Null.NullDate; dataChanged = true; } else { - Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture); + this.Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture); dataChanged = true; } } - LoadDateControls(); + this.LoadDateControls(); return dataChanged; } @@ -252,10 +252,10 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo /// An EventArgs object protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = DateValue; - args.OldValue = OldDateValue; - args.StringValue = DateValue.ToString(CultureInfo.InvariantCulture); + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DateValue; + args.OldValue = this.OldDateValue; + args.StringValue = this.DateValue.ToString(CultureInfo.InvariantCulture); base.OnValueChanged(args); } @@ -263,11 +263,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LoadDateControls(); + this.LoadDateControls(); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -277,7 +277,7 @@ protected override void OnPreRender(EventArgs e) /// protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } /// ----------------------------------------------------------------------------- @@ -288,9 +288,9 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - writer.Write(StringValue); + writer.Write(this.StringValue); writer.RenderEndTag(); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateTimeEditControl.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateTimeEditControl.cs index 2a9b4d85abf..6c56bbabf9e 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateTimeEditControl.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/PropertyEditorControls/DateTimeEditControl.cs @@ -58,7 +58,7 @@ protected DateTime DateValue DateTime dteValue = Null.NullDate; try { - var dteString = Convert.ToString(Value); + var dteString = Convert.ToString(this.Value); DateTime.TryParse(dteString, CultureInfo.InvariantCulture, DateTimeStyles.None, out dteValue); } catch (Exception exc) @@ -97,10 +97,10 @@ protected virtual string Format { get { - string _Format = DefaultFormat; - if (CustomAttributes != null) + string _Format = this.DefaultFormat; + if (this.CustomAttributes != null) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is FormatAttribute) { @@ -128,7 +128,7 @@ protected DateTime OldDateValue try { //Try and cast the value to an DateTime - var dteString = OldValue as string; + var dteString = this.OldValue as string; if (!string.IsNullOrEmpty(dteString)) { dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture); @@ -151,15 +151,15 @@ protected override string StringValue get { string _StringValue = Null.NullString; - if ((DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && DateValue != Null.NullDate)) + if ((this.DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && this.DateValue != Null.NullDate)) { - _StringValue = DateValue.ToString(Format); + _StringValue = this.DateValue.ToString(this.Format); } return _StringValue; } set { - Value = DateTime.Parse(value); + this.Value = DateTime.Parse(value); } } @@ -187,12 +187,12 @@ private DnnDateTimePicker DateControl { get { - if (_dateControl == null) + if (this._dateControl == null) { - _dateControl = new DnnDateTimePicker(); + this._dateControl = new DnnDateTimePicker(); } - return _dateControl; + return this._dateControl; } } @@ -202,31 +202,31 @@ protected override void CreateChildControls() { base.CreateChildControls(); - DateControl.ControlStyle.CopyFrom(ControlStyle); - DateControl.ID = base.ID + "_control"; + this.DateControl.ControlStyle.CopyFrom(this.ControlStyle); + this.DateControl.ID = base.ID + "_control"; - Controls.Add(DateControl); + this.Controls.Add(this.DateControl); } protected virtual void LoadDateControls() { - if (DateValue != Null.NullDate) + if (this.DateValue != Null.NullDate) { - DateControl.SelectedDate = DateValue; + this.DateControl.SelectedDate = this.DateValue; } } public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - EnsureChildControls(); + this.EnsureChildControls(); bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "_control"]; if (!presentValue.Equals(postedValue)) { if (string.IsNullOrEmpty(postedValue)) { - Value = Null.NullDate; + this.Value = Null.NullDate; dataChanged = true; } else @@ -235,12 +235,12 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo if (DateTime.TryParseExact(postedValue, "yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out value)) { - Value = value; + this.Value = value; dataChanged = true; } } } - LoadDateControls(); + this.LoadDateControls(); return dataChanged; } @@ -250,10 +250,10 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo /// An EventArgs object protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = DateValue; - args.OldValue = OldDateValue; - args.StringValue = DateValue.ToString(CultureInfo.InvariantCulture); + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DateValue; + args.OldValue = this.OldDateValue; + args.StringValue = this.DateValue.ToString(CultureInfo.InvariantCulture); base.OnValueChanged(args); } @@ -261,11 +261,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LoadDateControls(); + this.LoadDateControls(); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -275,7 +275,7 @@ protected override void OnPreRender(EventArgs e) /// protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } /// ----------------------------------------------------------------------------- @@ -286,9 +286,9 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - writer.Write(StringValue); + writer.Write(this.StringValue); writer.RenderEndTag(); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsList.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsList.cs index 8871db08ad8..f1d895ae555 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsList.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsList.cs @@ -37,7 +37,7 @@ public bool IsHeirarchical { get { - return _IsHeirarchical; + return this._IsHeirarchical; } } @@ -46,10 +46,10 @@ public Term SelectedTerm get { Term _SelectedTerm = null; - if (!string.IsNullOrEmpty(SelectedValue)) + if (!string.IsNullOrEmpty(this.SelectedValue)) { - int _TermId = int.Parse(SelectedValue); - foreach (Term term in Terms) + int _TermId = int.Parse(this.SelectedValue); + foreach (Term term in this.Terms) { if (term.TermId == _TermId) { @@ -67,13 +67,13 @@ public string SelectedValue get { string _SelectedValue = Null.NullString; - if (IsHeirarchical) + if (this.IsHeirarchical) { - _SelectedValue = _TreeView.SelectedValue; + _SelectedValue = this._TreeView.SelectedValue; } else { - _SelectedValue = _ListBox.SelectedValue; + _SelectedValue = this._ListBox.SelectedValue; } return _SelectedValue; } @@ -84,13 +84,13 @@ public List Terms get { object _DataSource = null; - if (IsHeirarchical) + if (this.IsHeirarchical) { - _DataSource = _TreeView.DataSource; + _DataSource = this._TreeView.DataSource; } else { - _DataSource = _ListBox.DataSource; + _DataSource = this._ListBox.DataSource; } return _DataSource as List; } @@ -102,43 +102,43 @@ public List Terms protected override void CreateChildControls() { - Controls.Clear(); - - _ListBox = new DnnListBox(); - _ListBox.ID = string.Concat(ID, "_List"); - _ListBox.DataTextField = "Name"; - _ListBox.DataValueField = "TermId"; - _ListBox.AutoPostBack = true; - _ListBox.SelectedIndexChanged += ListBoxSelectedIndexChanged; - - _TreeView = new DnnTreeView(); - _TreeView.ID = string.Concat(ID, "_Tree"); - _TreeView.DataTextField = "Name"; - _TreeView.DataValueField = "TermId"; - _TreeView.DataFieldID = "TermId"; - _TreeView.DataFieldParentID = "ParentTermId"; - _TreeView.NodeClick += TreeViewNodeClick; - - Controls.Add(_ListBox); - Controls.Add(_TreeView); + this.Controls.Clear(); + + this._ListBox = new DnnListBox(); + this._ListBox.ID = string.Concat(this.ID, "_List"); + this._ListBox.DataTextField = "Name"; + this._ListBox.DataValueField = "TermId"; + this._ListBox.AutoPostBack = true; + this._ListBox.SelectedIndexChanged += this.ListBoxSelectedIndexChanged; + + this._TreeView = new DnnTreeView(); + this._TreeView.ID = string.Concat(this.ID, "_Tree"); + this._TreeView.DataTextField = "Name"; + this._TreeView.DataValueField = "TermId"; + this._TreeView.DataFieldID = "TermId"; + this._TreeView.DataFieldParentID = "ParentTermId"; + this._TreeView.NodeClick += this.TreeViewNodeClick; + + this.Controls.Add(this._ListBox); + this.Controls.Add(this._TreeView); } protected override void OnInit(EventArgs e) { - EnsureChildControls(); + this.EnsureChildControls(); } protected override void OnPreRender(EventArgs e) { - _ListBox.Visible = !IsHeirarchical; - _TreeView.Visible = IsHeirarchical; + this._ListBox.Visible = !this.IsHeirarchical; + this._TreeView.Visible = this.IsHeirarchical; - _ListBox.Height = Height; - _ListBox.Width = Width; - _TreeView.Height = Height; - _TreeView.Width = Width; + this._ListBox.Height = this.Height; + this._ListBox.Width = this.Width; + this._TreeView.Height = this.Height; + this._TreeView.Width = this.Width; - _TreeView.ExpandAllNodes(); + this._TreeView.ExpandAllNodes(); base.OnPreRender(e); } @@ -146,9 +146,9 @@ protected override void OnPreRender(EventArgs e) protected virtual void OnSelectedTermChanged(TermsEventArgs e) { //Raise the SelectedTermChanged Event - if (SelectedTermChanged != null) + if (this.SelectedTermChanged != null) { - SelectedTermChanged(this, e); + this.SelectedTermChanged(this, e); } } @@ -159,13 +159,13 @@ protected virtual void OnSelectedTermChanged(TermsEventArgs e) private void ListBoxSelectedIndexChanged(object sender, EventArgs e) { //Raise the SelectedTermChanged Event - OnSelectedTermChanged(new TermsEventArgs(SelectedTerm)); + this.OnSelectedTermChanged(new TermsEventArgs(this.SelectedTerm)); } private void TreeViewNodeClick(object sender, RadTreeNodeEventArgs e) { //Raise the SelectedTermChanged Event - OnSelectedTermChanged(new TermsEventArgs(SelectedTerm)); + this.OnSelectedTermChanged(new TermsEventArgs(this.SelectedTerm)); } #endregion @@ -174,22 +174,22 @@ private void TreeViewNodeClick(object sender, RadTreeNodeEventArgs e) public void BindTerms(List terms, bool isHeirarchical, bool dataBind) { - _IsHeirarchical = isHeirarchical; + this._IsHeirarchical = isHeirarchical; - _ListBox.DataSource = terms; - _TreeView.DataSource = terms; + this._ListBox.DataSource = terms; + this._TreeView.DataSource = terms; if (dataBind) { - _ListBox.DataBind(); - _TreeView.DataBind(); + this._ListBox.DataBind(); + this._TreeView.DataBind(); } } public void ClearSelectedTerm() { - _ListBox.SelectedIndex = Null.NullInteger; - _TreeView.UnselectAllNodes(); + this._ListBox.SelectedIndex = Null.NullInteger; + this._TreeView.UnselectAllNodes(); } #endregion diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsSelector.cs b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsSelector.cs index 7d38f8f1dae..05a0c7ad9ce 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsSelector.cs +++ b/DNN Platform/DotNetNuke.Web.Deprecated/UI/WebControls/TermsSelector.cs @@ -28,9 +28,9 @@ public class TermsSelector : DnnComboBox, IClientAPICallbackEventHandler { public TermsSelector() { - IncludeSystemVocabularies = false; - IncludeTags = true; - EnableViewState = false; + this.IncludeSystemVocabularies = false; + this.IncludeTags = true; + this.EnableViewState = false; } #region Public Properties @@ -49,20 +49,20 @@ public TermsSelector() protected override void OnInit(EventArgs e) { - ItemTemplate = new TreeViewTemplate(); - Items.Add(new RadComboBoxItem()); + this.ItemTemplate = new TreeViewTemplate(); + this.Items.Add(new RadComboBoxItem()); base.OnInit(e); JavaScript.RequestRegistration(CommonJs.jQueryMigrate); - OnClientDropDownOpened = "webcontrols.termsSelector.OnClientDropDownOpened"; - if (!string.IsNullOrEmpty(CssClass)) + this.OnClientDropDownOpened = "webcontrols.termsSelector.OnClientDropDownOpened"; + if (!string.IsNullOrEmpty(this.CssClass)) { - CssClass = string.Format("{0} TermsSelector", CssClass); + this.CssClass = string.Format("{0} TermsSelector", this.CssClass); } else { - CssClass = "TermsSelector"; + this.CssClass = "TermsSelector"; } } @@ -70,46 +70,46 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (Page.IsPostBack) + if (this.Page.IsPostBack) { - if (Terms == null) + if (this.Terms == null) { - Terms = new List(); + this.Terms = new List(); } else { - Terms.Clear(); + this.Terms.Clear(); } - if (!string.IsNullOrEmpty(SelectedValue)) + if (!string.IsNullOrEmpty(this.SelectedValue)) { - foreach (var id in SelectedValue.Split(',')) + foreach (var id in this.SelectedValue.Split(',')) { var termId = Convert.ToInt32(id.Trim()); var term = Util.GetTermController().GetTerm(termId); if (term != null) { - Terms.Add(term); + this.Terms.Add(term); } } //clear the append item by client side - if (Items.Count > 1) + if (this.Items.Count > 1) { - Items.Remove(1); + this.Items.Remove(1); } } } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - Page.ClientScript.RegisterClientScriptResource(GetType(), "DotNetNuke.Web.UI.WebControls.Resources.TermsSelector.js"); + this.Page.ClientScript.RegisterClientScriptResource(this.GetType(), "DotNetNuke.Web.UI.WebControls.Resources.TermsSelector.js"); - ClientResourceManager.RegisterStyleSheet(Page, - Page.ClientScript.GetWebResourceUrl(GetType(), "DotNetNuke.Web.UI.WebControls.Resources.TermsSelector.css")); + ClientResourceManager.RegisterStyleSheet(this.Page, + this.Page.ClientScript.GetWebResourceUrl(this.GetType(), "DotNetNuke.Web.UI.WebControls.Resources.TermsSelector.css")); - ClientAPI.RegisterClientVariable(Page, "TermsSelectorCallback", + ClientAPI.RegisterClientVariable(this.Page, "TermsSelectorCallback", ClientAPI.GetCallbackEventReference(this, "'[PARAMS]'", "webcontrols.termsSelector.itemDataLoaded", "this", "webcontrols.termsSelector.itemDataLoadError"), true); } @@ -118,13 +118,13 @@ protected override void OnLoad(EventArgs e) protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Terms != null) + if (this.Terms != null) { - Attributes.Add("SelectedTerms", String.Join(",", Terms.Select(t => t.TermId.ToString()).ToArray())); + this.Attributes.Add("SelectedTerms", String.Join(",", this.Terms.Select(t => t.TermId.ToString()).ToArray())); } - Attributes.Add("IncludeSystemVocabularies", IncludeSystemVocabularies.ToString().ToLowerInvariant()); - Attributes.Add("IncludeTags", IncludeTags.ToString().ToLowerInvariant()); - Attributes.Add("PortalId", PortalId.ToString()); + this.Attributes.Add("IncludeSystemVocabularies", this.IncludeSystemVocabularies.ToString().ToLowerInvariant()); + this.Attributes.Add("IncludeTags", this.IncludeTags.ToString().ToLowerInvariant()); + this.Attributes.Add("PortalId", this.PortalId.ToString()); } #endregion @@ -146,18 +146,18 @@ public class TreeViewTemplate : ITemplate public void InstantiateIn(Control container) { - _container = (RadComboBoxItem)container; - _termsSelector = (TermsSelector)container.Parent; + this._container = (RadComboBoxItem)container; + this._termsSelector = (TermsSelector)container.Parent; - _tree = new DnnTreeView(); - _tree.ID = string.Format("{0}_TreeView", _termsSelector.ID); - _tree.CheckBoxes = true; - _tree.EnableViewState = false; + this._tree = new DnnTreeView(); + this._tree.ID = string.Format("{0}_TreeView", this._termsSelector.ID); + this._tree.CheckBoxes = true; + this._tree.EnableViewState = false; //bind client-side events - _tree.OnClientNodeChecked = "webcontrols.termsSelector.OnClientNodeChecked"; + this._tree.OnClientNodeChecked = "webcontrols.termsSelector.OnClientNodeChecked"; - _container.Controls.Add(_tree); + this._container.Controls.Add(this._tree); } @@ -171,10 +171,10 @@ public void InstantiateIn(Control container) public string RaiseClientAPICallbackEvent(string eventArgument) { var parameters = eventArgument.Split('-'); - PortalId = Convert.ToInt32(parameters[1]); - IncludeTags = Convert.ToBoolean(parameters[2]); - IncludeSystemVocabularies = Convert.ToBoolean(parameters[3]); - var terms = GetTerms(); + this.PortalId = Convert.ToInt32(parameters[1]); + this.IncludeTags = Convert.ToBoolean(parameters[2]); + this.IncludeSystemVocabularies = Convert.ToBoolean(parameters[3]); + var terms = this.GetTerms(); terms.Insert(0, new { clientId = parameters[0] }); var serializer = new JavaScriptSerializer(); return serializer.Serialize(terms); @@ -188,20 +188,20 @@ private ArrayList GetTerms() { var vocabRep = Util.GetVocabularyController(); var terms = new ArrayList(); - var vocabularies = from v in vocabRep.GetVocabularies() where v.ScopeType.ScopeType == "Application" || (v.ScopeType.ScopeType == "Portal" && v.ScopeId == PortalId) select v; + var vocabularies = from v in vocabRep.GetVocabularies() where v.ScopeType.ScopeType == "Application" || (v.ScopeType.ScopeType == "Portal" && v.ScopeId == this.PortalId) select v; foreach (Vocabulary v in vocabularies) { if (v.IsSystem) { - if (IncludeSystemVocabularies || (IncludeTags && v.Name == "Tags")) + if (this.IncludeSystemVocabularies || (this.IncludeTags && v.Name == "Tags")) { - AddTerms(v, terms); + this.AddTerms(v, terms); } } else { - AddTerms(v, terms); + this.AddTerms(v, terms); } } diff --git a/DNN Platform/DotNetNuke.Web.Deprecated/packages.config b/DNN Platform/DotNetNuke.Web.Deprecated/packages.config index f60bd73968b..56ff2303e0d 100644 --- a/DNN Platform/DotNetNuke.Web.Deprecated/packages.config +++ b/DNN Platform/DotNetNuke.Web.Deprecated/packages.config @@ -3,4 +3,5 @@ + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Common/PropertyHelper.cs b/DNN Platform/DotNetNuke.Web.Mvc/Common/PropertyHelper.cs index 8c8fa219bf8..d168bf5df50 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Common/PropertyHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Common/PropertyHelper.cs @@ -22,8 +22,8 @@ public PropertyHelper(PropertyInfo property) { Requires.NotNull("property", property); - Name = property.Name; - _valueGetter = MakeFastPropertyGetter(property); + this.Name = property.Name; + this._valueGetter = MakeFastPropertyGetter(property); } // Implementation of the fast getter. @@ -94,7 +94,7 @@ public object GetValue(object instance) { //Contract.Assert(_valueGetter != null, "Must call Initialize before using this object"); - return _valueGetter(instance); + return this._valueGetter(instance); } /// diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcDependencyResolver.cs b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcDependencyResolver.cs index b6f82a8ca43..42d24cf12d7 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcDependencyResolver.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcDependencyResolver.cs @@ -20,7 +20,7 @@ internal class DnnMvcDependencyResolver : IDependencyResolver public DnnMvcDependencyResolver(IServiceProvider serviceProvider) { - _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); + this._serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); } /// @@ -34,7 +34,7 @@ public DnnMvcDependencyResolver(IServiceProvider serviceProvider) /// public object GetService(Type serviceType) { - var accessor = _serviceProvider.GetRequiredService(); + var accessor = this._serviceProvider.GetRequiredService(); var scope = accessor.GetScope(); if (scope != null) return scope.ServiceProvider.GetService(serviceType); @@ -53,7 +53,7 @@ public object GetService(Type serviceType) /// public IEnumerable GetServices(Type serviceType) { - var accessor = _serviceProvider.GetRequiredService(); + var accessor = this._serviceProvider.GetRequiredService(); var scope = accessor.GetScope(); if (scope != null) return scope.ServiceProvider.GetServices(serviceType); diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs index 89c6b493c79..8699e531191 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcHandler.cs @@ -27,7 +27,7 @@ public DnnMvcHandler(RequestContext requestContext) throw new ArgumentNullException("requestContext"); } - RequestContext = requestContext; + this.RequestContext = requestContext; } public static readonly string MvcVersionHeaderName = "X-AspNetMvc-Version"; @@ -38,13 +38,13 @@ internal ControllerBuilder ControllerBuilder { get { - if (_controllerBuilder == null) + if (this._controllerBuilder == null) { - _controllerBuilder = ControllerBuilder.Current; + this._controllerBuilder = ControllerBuilder.Current; } - return _controllerBuilder; + return this._controllerBuilder; } - set { _controllerBuilder = value; } + set { this._controllerBuilder = value; } } protected virtual bool IsReusable @@ -56,13 +56,13 @@ protected virtual bool IsReusable bool IHttpHandler.IsReusable { - get { return IsReusable; } + get { return this.IsReusable; } } void IHttpHandler.ProcessRequest(HttpContext httpContext) { - MembershipModule.AuthenticateRequest(RequestContext.HttpContext, allowUnknownExtensions: true); - ProcessRequest(httpContext); + MembershipModule.AuthenticateRequest(this.RequestContext.HttpContext, allowUnknownExtensions: true); + this.ProcessRequest(httpContext); } public RequestContext RequestContext { get; private set; } @@ -70,19 +70,19 @@ void IHttpHandler.ProcessRequest(HttpContext httpContext) protected virtual void ProcessRequest(HttpContext httpContext) { HttpContextBase httpContextBase = new HttpContextWrapper(httpContext); - ProcessRequest(httpContextBase); + this.ProcessRequest(httpContextBase); } protected internal virtual void ProcessRequest(HttpContextBase httpContext) { try { - var moduleExecutionEngine = GetModuleExecutionEngine(); + var moduleExecutionEngine = this.GetModuleExecutionEngine(); // Check if the controller supports IDnnController var moduleResult = - moduleExecutionEngine.ExecuteModule(GetModuleRequestContext(httpContext)); + moduleExecutionEngine.ExecuteModule(this.GetModuleRequestContext(httpContext)); httpContext.SetModuleRequestResult(moduleResult); - RenderModule(moduleResult); + this.RenderModule(moduleResult); } finally { @@ -112,7 +112,7 @@ private ModuleRequestContext GetModuleRequestContext(HttpContextBase httpContext { HttpContext = httpContext, ModuleContext = moduleContext, - ModuleApplication = new ModuleApplication(RequestContext, DisableMvcResponseHeader) + ModuleApplication = new ModuleApplication(this.RequestContext, DisableMvcResponseHeader) { ModuleName = desktopModule.ModuleName, FolderPath = desktopModule.FolderName, @@ -124,7 +124,7 @@ private ModuleRequestContext GetModuleRequestContext(HttpContextBase httpContext private void RenderModule(ModuleRequestResult moduleResult) { - var writer = RequestContext.HttpContext.Response.Output; + var writer = this.RequestContext.HttpContext.Response.Output; var moduleExecutionEngine = ComponentFactory.GetComponent(); diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcRouteHandler.cs b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcRouteHandler.cs index a326c72bc26..5beb220bc42 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcRouteHandler.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/DnnMvcRouteHandler.cs @@ -20,12 +20,12 @@ public DnnMvcRouteHandler() public DnnMvcRouteHandler(IControllerFactory controllerFactory) { - _controllerFactory = controllerFactory; + this._controllerFactory = controllerFactory; } protected virtual IHttpHandler GetHttpHandler(RequestContext requestContext) { - requestContext.HttpContext.SetSessionStateBehavior(GetSessionStateBehavior(requestContext)); + requestContext.HttpContext.SetSessionStateBehavior(this.GetSessionStateBehavior(requestContext)); return new DnnMvcHandler(requestContext); } @@ -37,7 +37,7 @@ protected virtual SessionStateBehavior GetSessionStateBehavior(RequestContext re throw new InvalidOperationException("No Controller"); } - IControllerFactory controllerFactory = _controllerFactory ?? ControllerBuilder.Current.GetControllerFactory(); + IControllerFactory controllerFactory = this._controllerFactory ?? ControllerBuilder.Current.GetControllerFactory(); return controllerFactory.GetControllerSessionBehavior(requestContext, controllerName); } @@ -45,7 +45,7 @@ protected virtual SessionStateBehavior GetSessionStateBehavior(RequestContext re IHttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext) { - return GetHttpHandler(requestContext); + return this.GetHttpHandler(requestContext); } #endregion diff --git a/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj b/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj index 7960f3f49ef..490cc3c2c7a 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj +++ b/DNN Platform/DotNetNuke.Web.Mvc/DotNetNuke.Web.Mvc.csproj @@ -1,227 +1,233 @@ - - - - - Debug - AnyCPU - {64DC5798-9D37-4F8D-97DD-8403E6E70DD3} - Library - Properties - DotNetNuke.Web.Mvc - DotNetNuke.Web.Mvc - v4.7.2 - 512 - ..\..\ - true - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - 7 - - - - False - ..\Library\bin\DotNetNuke.dll - - - - ..\..\packages\Microsoft.AspNet.WebHelpers.3.1.1\lib\net45\Microsoft.Web.Helpers.dll - True - - - ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - True - - - - - - - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll - True - - - False - ..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - False - ..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - - - False - ..\..\Packages\Microsoft.AspNet.Mvc.5.1.3\lib\net45\System.Web.Mvc.dll - True - - - ..\..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll - True - - - False - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll - True - - - - - - - - ..\..\packages\Microsoft.AspNet.WebPages.Data.3.1.1\lib\net45\WebMatrix.Data.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.WebData.3.1.1\lib\net45\WebMatrix.WebData.dll - True - - - - - SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - Designer - - - - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - - - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} - DotNetNuke.DependencyInjection - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} - DotNetNuke.HttpModules - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + + Debug + AnyCPU + {64DC5798-9D37-4F8D-97DD-8403E6E70DD3} + Library + Properties + DotNetNuke.Web.Mvc + DotNetNuke.Web.Mvc + v4.7.2 + 512 + ..\..\ + true + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + 7 + + + + False + ..\Library\bin\DotNetNuke.dll + + + + ..\..\packages\Microsoft.AspNet.WebHelpers.3.1.1\lib\net45\Microsoft.Web.Helpers.dll + True + + + ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + + + + + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll + True + + + False + ..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + False + ..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + + + False + ..\..\Packages\Microsoft.AspNet.Mvc.5.1.3\lib\net45\System.Web.Mvc.dll + True + + + ..\..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll + True + + + False + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll + True + + + + + + + + ..\..\packages\Microsoft.AspNet.WebPages.Data.3.1.1\lib\net45\WebMatrix.Data.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.WebData.3.1.1\lib\net45\WebMatrix.WebData.dll + True + + + + + SolutionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + + Designer + + + Designer + + + + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + + + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} + DotNetNuke.DependencyInjection + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} + DotNetNuke.HttpModules + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthFilterContext.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthFilterContext.cs index ab5930d5d4d..b42ff75a433 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthFilterContext.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthFilterContext.cs @@ -16,8 +16,8 @@ public class AuthFilterContext { public AuthFilterContext(AuthorizationContext filterContext, string authFailureMessage) { - ActionContext = filterContext; - AuthFailureMessage = authFailureMessage; + this.ActionContext = filterContext; + this.AuthFailureMessage = authFailureMessage; } public AuthorizationContext ActionContext { get; private set; } @@ -29,10 +29,10 @@ public AuthFilterContext(AuthorizationContext filterContext, string authFailureM /// public virtual void HandleUnauthorizedRequest() { - ActionContext.Result = new HttpUnauthorizedResult(AuthFailureMessage); + this.ActionContext.Result = new HttpUnauthorizedResult(this.AuthFailureMessage); if (!Host.DebugMode) { - ActionContext.RequestContext.HttpContext.Response.SuppressFormsAuthenticationRedirect = true; + this.ActionContext.RequestContext.HttpContext.Response.SuppressFormsAuthenticationRedirect = true; } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthorizeAttributeBase.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthorizeAttributeBase.cs index 5f2b4a23564..ccbfd294166 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthorizeAttributeBase.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/AuthorizeAttributeBase.cs @@ -18,25 +18,25 @@ protected virtual bool AuthorizeCore(HttpContextBase httpContext) private void CacheValidateHandler(HttpContext context, object data, ref HttpValidationStatus validationStatus) { - validationStatus = OnCacheAuthorization(new HttpContextWrapper(context)); + validationStatus = this.OnCacheAuthorization(new HttpContextWrapper(context)); } public virtual void OnAuthorization(AuthorizationContext filterContext) { Requires.NotNull("filterContext", filterContext); - if (SkipAuthorization(filterContext)) + if (this.SkipAuthorization(filterContext)) { return; } - if (AuthorizeCore(filterContext.HttpContext)) + if (this.AuthorizeCore(filterContext.HttpContext)) { - HandleAuthorizedRequest(filterContext); + this.HandleAuthorizedRequest(filterContext); } else { - HandleUnauthorizedRequest(filterContext); + this.HandleUnauthorizedRequest(filterContext); } } @@ -44,7 +44,7 @@ protected virtual void HandleAuthorizedRequest(AuthorizationContext filterContex { HttpCachePolicyBase cachePolicy = filterContext.HttpContext.Response.Cache; cachePolicy.SetProxyMaxAge(new TimeSpan(0)); - cachePolicy.AddValidationCallback(CacheValidateHandler, null /* data */); + cachePolicy.AddValidationCallback(this.CacheValidateHandler, null /* data */); } protected virtual void HandleUnauthorizedRequest(AuthorizationContext filterContext) @@ -59,7 +59,7 @@ protected virtual HttpValidationStatus OnCacheAuthorization(HttpContextBase http { Requires.NotNull("httpContext", httpContext); - bool isAuthorized = AuthorizeCore(httpContext); + bool isAuthorized = this.AuthorizeCore(httpContext); return (isAuthorized) ? HttpValidationStatus.Valid : HttpValidationStatus.IgnoreThisRequest; } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnAuthorizeAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnAuthorizeAttribute.cs index 804d2442587..848e2de6a4b 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnAuthorizeAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnAuthorizeAttribute.cs @@ -25,11 +25,11 @@ public class DnnAuthorizeAttribute : AuthorizeAttributeBase /// public string StaticRoles { - get { return _staticRoles; } + get { return this._staticRoles; } set { - _staticRoles = value; - _staticRolesSplit = SplitString(_staticRoles); + this._staticRoles = value; + this._staticRolesSplit = this.SplitString(this._staticRoles); } } @@ -38,11 +38,11 @@ public string StaticRoles /// public string DenyRoles { - get { return _denyRoles; } + get { return this._denyRoles; } set { - _denyRoles = value; - _denyRolesSplit = SplitString(_denyRoles); + this._denyRoles = value; + this._denyRolesSplit = this.SplitString(this._denyRoles); } } @@ -58,24 +58,24 @@ protected virtual UserInfo GetCurrentUser() protected override bool AuthorizeCore(HttpContextBase httpContext) { - if (!IsAuthenticated()) + if (!this.IsAuthenticated()) { return false; } - if (_denyRolesSplit.Any()) + if (this._denyRolesSplit.Any()) { - var currentUser = GetCurrentUser(); - if (!currentUser.IsSuperUser && _denyRolesSplit.Any(currentUser.IsInRole)) + var currentUser = this.GetCurrentUser(); + if (!currentUser.IsSuperUser && this._denyRolesSplit.Any(currentUser.IsInRole)) { return false; } } - if (_staticRolesSplit.Any()) + if (this._staticRolesSplit.Any()) { - var currentUser = GetCurrentUser(); - if (!_staticRolesSplit.Any(currentUser.IsInRole)) + var currentUser = this.GetCurrentUser(); + if (!this._staticRolesSplit.Any(currentUser.IsInRole)) { return false; } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnHandleErrorAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnHandleErrorAttribute.cs index cd637b29754..29c7f52c802 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnHandleErrorAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnHandleErrorAttribute.cs @@ -20,7 +20,7 @@ public override void OnException(ExceptionContext filterContext) throw new InvalidOperationException("This attribute can only be applied to Controllers that implement IDnnController"); } - LogException(filterContext.Exception); + this.LogException(filterContext.Exception); } protected virtual void LogException(Exception exception) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnModuleAuthorizeAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnModuleAuthorizeAttribute.cs index e0442e2db11..f19e4397d4a 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnModuleAuthorizeAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/DnnModuleAuthorizeAttribute.cs @@ -18,7 +18,7 @@ public class DnnModuleAuthorizeAttribute : AuthorizeAttributeBase public DnnModuleAuthorizeAttribute() { - AccessLevel = SecurityAccessLevel.Host; + this.AccessLevel = SecurityAccessLevel.Host; } public SecurityAccessLevel AccessLevel { get; set; } @@ -27,9 +27,9 @@ public DnnModuleAuthorizeAttribute() protected override bool AuthorizeCore(HttpContextBase httpContext) { - if (_module != null) + if (this._module != null) { - return HasModuleAccess(); + return this.HasModuleAccess(); } return false; @@ -44,14 +44,14 @@ public override void OnAuthorization(AuthorizationContext filterContext) throw new InvalidOperationException("This attribute can only be applied to Controllers that implement IDnnController"); } - _module = controller.ModuleContext.Configuration; + this._module = controller.ModuleContext.Configuration; base.OnAuthorization(filterContext); } protected virtual bool HasModuleAccess() { - return ModulePermissionController.HasModuleAccess(AccessLevel, PermissionKey, _module); + return ModulePermissionController.HasModuleAccess(this.AccessLevel, this.PermissionKey, this._module); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionAttribute.cs index cbdd99ece55..5a2c13c6da9 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionAttribute.cs @@ -18,7 +18,7 @@ public class ModuleActionAttribute : ActionFilterAttribute { public ModuleActionAttribute() { - SecurityAccessLevel = SecurityAccessLevel.Edit; + this.SecurityAccessLevel = SecurityAccessLevel.Edit; } /// @@ -61,13 +61,13 @@ public override void OnActionExecuting(ActionExecutingContext filterContext) } controller.ModuleActions.Add(-1, - (!String.IsNullOrEmpty(TitleKey)) ? controller.LocalizeString(TitleKey) : Title, + (!String.IsNullOrEmpty(this.TitleKey)) ? controller.LocalizeString(this.TitleKey) : this.Title, ModuleActionType.AddContent, "", - Icon, - controller.ModuleContext.EditUrl(ControlKey), + this.Icon, + controller.ModuleContext.EditUrl(this.ControlKey), false, - SecurityAccessLevel, + this.SecurityAccessLevel, true, false); } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionItemsAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionItemsAttribute.cs index eea254c9fd5..9caec28420c 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionItemsAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ModuleActionItemsAttribute.cs @@ -32,27 +32,27 @@ public override void OnActionExecuting(ActionExecutingContext filterContext) object instance; - if (Type == null) + if (this.Type == null) { type = filterContext.Controller.GetType(); instance = controller; } else { - type = Type; + type = this.Type; instance = Reflection.CreateInstance(type); } - if (String.IsNullOrEmpty(MethodName)) + if (String.IsNullOrEmpty(this.MethodName)) { methodName = String.Format(MethodNameTemplate, filterContext.ActionDescriptor.ActionName); } else { - methodName = MethodName; + methodName = this.MethodName; } - var method = GetMethod(type, methodName); + var method = this.GetMethod(type, methodName); controller.ModuleActions = method.Invoke(instance, null) as ModuleActionCollection; } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/RequireHostAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/RequireHostAttribute.cs index eee20cb0ea3..902e754e1da 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/RequireHostAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/RequireHostAttribute.cs @@ -23,9 +23,9 @@ protected override bool AuthorizeCore(HttpContextBase httpContext) return false; } - if (_user != null) + if (this._user != null) { - return _user.IsSuperUser; + return this._user.IsSuperUser; } return false; @@ -40,7 +40,7 @@ public override void OnAuthorization(AuthorizationContext filterContext) throw new InvalidOperationException("This attribute can only be applied to Controllers that implement IDnnController"); } - _user = controller.ModuleContext.PortalSettings.UserInfo; + this._user = controller.ModuleContext.PortalSettings.UserInfo; base.OnAuthorization(filterContext); } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ValidateAntiForgeryTokenAttribute.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ValidateAntiForgeryTokenAttribute.cs index 0b28c295fac..1cce240df41 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ValidateAntiForgeryTokenAttribute.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionFilters/ValidateAntiForgeryTokenAttribute.cs @@ -31,7 +31,7 @@ public virtual bool IsAuthenticated(HttpContextBase httpContext) form.AllKeys.Contains("__RequestVerificationToken") ? form.GetValues("__RequestVerificationToken").FirstOrDefault(): null ); - var cookieValue = GetAntiForgeryCookieValue(httpContext); + var cookieValue = this.GetAntiForgeryCookieValue(httpContext); if (token != null) { AntiForgery.Instance.Validate(cookieValue, token); @@ -73,7 +73,7 @@ protected string GetAntiForgeryCookieValue(HttpContextBase context) protected override bool AuthorizeCore(HttpContextBase httpContext) { - if (!IsAuthenticated(httpContext)) + if (!this.IsAuthenticated(httpContext)) { return false; } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnPartialViewResult.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnPartialViewResult.cs index 36cbeb44dd7..9f6555bd2a7 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnPartialViewResult.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnPartialViewResult.cs @@ -21,25 +21,25 @@ public void ExecuteResult(ControllerContext context, TextWriter writer) Requires.NotNull("context", context); Requires.NotNull("writer", writer); - if (String.IsNullOrEmpty(ViewName)) + if (String.IsNullOrEmpty(this.ViewName)) { - ViewName = context.RouteData.GetRequiredString("action"); + this.ViewName = context.RouteData.GetRequiredString("action"); } ViewEngineResult result = null; - if (View == null) + if (this.View == null) { - result = ViewEngineCollection.FindPartialView(context, ViewName); - View = result.View; + result = this.ViewEngineCollection.FindPartialView(context, this.ViewName); + this.View = result.View; } - var viewContext = new ViewContext(context, View, ViewData, TempData, writer); - View.Render(viewContext, writer); + var viewContext = new ViewContext(context, this.View, this.ViewData, this.TempData, writer); + this.View.Render(viewContext, writer); if (result != null) { - result.ViewEngine.ReleaseView(context, View); + result.ViewEngine.ReleaseView(context, this.View); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs index 9d5481460b2..e70fdcdede5 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnRedirecttoRouteResult.cs @@ -18,15 +18,15 @@ internal class DnnRedirecttoRouteResult : RedirectToRouteResult public DnnRedirecttoRouteResult(string actionName, string controllerName, string routeName, RouteValueDictionary routeValues, bool permanent) : base(routeName, routeValues, permanent) { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - ActionName = actionName; - ControllerName = controllerName; + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.ActionName = actionName; + this.ControllerName = controllerName; } public DnnRedirecttoRouteResult(string actionName, string controllerName, string routeName, RouteValueDictionary routeValues, bool permanent, DnnUrlHelper url) : this(actionName, controllerName, routeName, routeValues, permanent) { - Url = url; + this.Url = url; } public DnnUrlHelper Url { get; private set; } @@ -42,17 +42,17 @@ public override void ExecuteResult(ControllerContext context) Guard.Against(context.IsChildAction, "Cannot Redirect In Child Action"); string url; - if (Url != null && context.Controller is IDnnController) + if (this.Url != null && context.Controller is IDnnController) { - url = Url.Action(ActionName, ControllerName); + url = this.Url.Action(this.ActionName, this.ControllerName); } else { //TODO - match other actions - url = NavigationManager.NavigateURL(); + url = this.NavigationManager.NavigateURL(); } - if (Permanent) + if (this.Permanent) { context.HttpContext.Response.RedirectPermanent(url, true); } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnViewResult.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnViewResult.cs index 5233024a151..fbdcda60889 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnViewResult.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ActionResults/DnnViewResult.cs @@ -16,25 +16,25 @@ public void ExecuteResult(ControllerContext context, TextWriter writer) Requires.NotNull("context", context); Requires.NotNull("writer", writer); - if (String.IsNullOrEmpty(ViewName)) + if (String.IsNullOrEmpty(this.ViewName)) { - ViewName = context.RouteData.GetRequiredString("action"); + this.ViewName = context.RouteData.GetRequiredString("action"); } ViewEngineResult result = null; - if (View == null) + if (this.View == null) { - result = ViewEngineCollection.FindView(context, ViewName, MasterName); - View = result.View; + result = this.ViewEngineCollection.FindView(context, this.ViewName, this.MasterName); + this.View = result.View; } - var viewContext = new ViewContext(context, View, ViewData, TempData, writer); - View.Render(viewContext, writer); + var viewContext = new ViewContext(context, this.View, this.ViewData, this.TempData, writer); + this.View.Render(viewContext, writer); if (result != null) { - result.ViewEngine.ReleaseView(context, View); + result.ViewEngine.ReleaseView(context, this.View); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/Controllers/DnnController.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/Controllers/DnnController.cs index af5e899f7c9..ec0e4523815 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/Controllers/DnnController.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/Controllers/DnnController.cs @@ -24,17 +24,17 @@ public abstract class DnnController : Controller, IDnnController { protected DnnController() { - ActionInvoker = new ResultCapturingActionInvoker(); + this.ActionInvoker = new ResultCapturingActionInvoker(); } public ModuleInfo ActiveModule { - get { return (ModuleContext == null) ? null : ModuleContext.Configuration; } + get { return (this.ModuleContext == null) ? null : this.ModuleContext.Configuration; } } public TabInfo ActivePage { - get { return (PortalSettings == null) ? null : PortalSettings.ActiveTab; } + get { return (this.PortalSettings == null) ? null : this.PortalSettings.ActiveTab; } } public Page DnnPage { get; set; } @@ -45,7 +45,7 @@ public TabInfo ActivePage public string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } public ModuleActionCollection ModuleActions { get; set; } @@ -54,12 +54,12 @@ public string LocalizeString(string key) public PortalSettings PortalSettings { - get { return (ModuleContext == null) ? null : ModuleContext.PortalSettings; } + get { return (this.ModuleContext == null) ? null : this.ModuleContext.PortalSettings; } } protected override RedirectToRouteResult RedirectToAction(string actionName, string controllerName, RouteValueDictionary routeValues) { - return new DnnRedirecttoRouteResult(actionName, controllerName, string.Empty, routeValues, false, Url); + return new DnnRedirecttoRouteResult(actionName, controllerName, string.Empty, routeValues, false, this.Url); } protected internal RedirectToRouteResult RedirectToDefaultRoute() @@ -71,28 +71,28 @@ public ActionResult ResultOfLastExecute { get { - var actionInvoker = ActionInvoker as ResultCapturingActionInvoker; + var actionInvoker = this.ActionInvoker as ResultCapturingActionInvoker; return (actionInvoker != null) ? actionInvoker.ResultOfLastInvoke : null; } } public new UserInfo User { - get { return (PortalSettings == null) ? null : PortalSettings.UserInfo; } + get { return (this.PortalSettings == null) ? null : this.PortalSettings.UserInfo; } } protected override ViewResult View(IView view, object model) { if (model != null) { - ViewData.Model = model; + this.ViewData.Model = model; } return new DnnViewResult { View = view, - ViewData = ViewData, - TempData = TempData + ViewData = this.ViewData, + TempData = this.TempData }; } @@ -100,16 +100,16 @@ protected override ViewResult View(string viewName, string masterName, object mo { if (model != null) { - ViewData.Model = model; + this.ViewData.Model = model; } return new DnnViewResult { ViewName = viewName, MasterName = masterName, - ViewData = ViewData, - TempData = TempData, - ViewEngineCollection = ViewEngineCollection + ViewData = this.ViewData, + TempData = this.TempData, + ViewEngineCollection = this.ViewEngineCollection }; } @@ -117,22 +117,22 @@ protected override PartialViewResult PartialView(string viewName, object model) { if (model != null) { - ViewData.Model = model; + this.ViewData.Model = model; } return new DnnPartialViewResult { ViewName = viewName, - ViewData = ViewData, - TempData = TempData, - ViewEngineCollection = ViewEngineCollection + ViewData = this.ViewData, + TempData = this.TempData, + ViewEngineCollection = this.ViewEngineCollection }; } protected override void Initialize(RequestContext requestContext) { base.Initialize(requestContext); - Url = new DnnUrlHelper(requestContext, this); + this.Url = new DnnUrlHelper(requestContext, this); } public ViewEngineCollection ViewEngineCollectionEx { get; set; } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPage.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPage.cs index b08347747b4..0e75331ada8 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPage.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPage.cs @@ -17,10 +17,10 @@ public abstract class DnnWebViewPage : WebViewPage public override void InitHelpers() { - Ajax = new AjaxHelper(ViewContext, this); - Html = new DnnHtmlHelper(ViewContext, this); - Url = new DnnUrlHelper(ViewContext); - Dnn = new DnnHelper(ViewContext, this); + this.Ajax = new AjaxHelper(this.ViewContext, this); + this.Html = new DnnHtmlHelper(this.ViewContext, this); + this.Url = new DnnUrlHelper(this.ViewContext); + this.Dnn = new DnnHelper(this.ViewContext, this); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPageOfT.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPageOfT.cs index 119711f8970..75283a835ec 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPageOfT.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/DnnWebViewPageOfT.cs @@ -17,10 +17,10 @@ public abstract class DnnWebViewPage : WebViewPage public override void InitHelpers() { - Ajax = new AjaxHelper(ViewContext, this); - Html = new DnnHtmlHelper(ViewContext, this); - Url = new DnnUrlHelper(ViewContext); - Dnn = new DnnHelper(ViewContext, this); + this.Ajax = new AjaxHelper(this.ViewContext, this); + this.Html = new DnnHtmlHelper(this.ViewContext, this); + this.Url = new DnnUrlHelper(this.ViewContext); + this.Dnn = new DnnHelper(this.ViewContext, this); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ModuleDelegatingViewEngine.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ModuleDelegatingViewEngine.cs index aefe9b4dc61..b6f3fc1f6cf 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/ModuleDelegatingViewEngine.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/ModuleDelegatingViewEngine.cs @@ -27,7 +27,7 @@ public class ModuleDelegatingViewEngine : IViewEngine /// The controller context.The name of the partial view.true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. public ViewEngineResult FindPartialView(ControllerContext controllerContext, string partialViewName, bool useCache) { - return RunAgainstModuleViewEngines(controllerContext, e => e.FindPartialView(controllerContext, partialViewName, useCache)); + return this.RunAgainstModuleViewEngines(controllerContext, e => e.FindPartialView(controllerContext, partialViewName, useCache)); } /// @@ -39,7 +39,7 @@ public ViewEngineResult FindPartialView(ControllerContext controllerContext, str /// The controller context.The name of the view.The name of the master.true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. public ViewEngineResult FindView(ControllerContext controllerContext, string viewName, string masterName, bool useCache) { - return RunAgainstModuleViewEngines(controllerContext, e => e.FindView(controllerContext, viewName, masterName, useCache)); + return this.RunAgainstModuleViewEngines(controllerContext, e => e.FindView(controllerContext, viewName, masterName, useCache)); } /// @@ -48,9 +48,9 @@ public ViewEngineResult FindView(ControllerContext controllerContext, string vie /// The controller context.The view. public void ReleaseView(ControllerContext controllerContext, IView view) { - if (_viewEngineMappings.ContainsKey(view)) + if (this._viewEngineMappings.ContainsKey(view)) { - _viewEngineMappings[view].ReleaseView(controllerContext, view); + this._viewEngineMappings[view].ReleaseView(controllerContext, view); } } @@ -65,7 +65,7 @@ private ViewEngineResult RunAgainstModuleViewEngines(ControllerContext controlle // If there is a view, store the view<->viewengine mapping so release works correctly if (result.View != null) { - _viewEngineMappings[result.View] = result.ViewEngine; + this._viewEngineMappings[result.View] = result.ViewEngine; } return result; diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ModuleApplication.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ModuleApplication.cs index 510a97dbb6a..010c2e9a944 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ModuleApplication.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ModuleApplication.cs @@ -42,11 +42,11 @@ public ModuleApplication(bool disableMvcResponseHeader) : this(null, disableMvcR } public ModuleApplication(RequestContext requestContext, bool disableMvcResponseHeader) { - RequestContext = requestContext; + this.RequestContext = requestContext; // ReSharper disable once DoNotCallOverridableMethodsInConstructor DisableMvcResponseHeader = disableMvcResponseHeader; - ControllerFactory = Globals.DependencyProvider.GetRequiredService(); - ViewEngines = new ViewEngineCollection(); + this.ControllerFactory = Globals.DependencyProvider.GetRequiredService(); + this.ViewEngines = new ViewEngineCollection(); //ViewEngines.Add(new ModuleDelegatingViewEngine()); } @@ -68,19 +68,19 @@ protected void EnsureInitialized() { // Double-check lock to wait for initialization // TODO: Is there a better (preferably using events and waits) way to do this? - if (_initialized) return; - lock (_lock) + if (this._initialized) return; + lock (this._lock) { - if (_initialized) return; - Init(); - _initialized = true; + if (this._initialized) return; + this.Init(); + this._initialized = true; } } public virtual ModuleRequestResult ExecuteRequest(ModuleRequestContext context) { - EnsureInitialized(); - RequestContext = RequestContext ?? new RequestContext(context.HttpContext, context.RouteData); + this.EnsureInitialized(); + this.RequestContext = this.RequestContext ?? new RequestContext(context.HttpContext, context.RouteData); var currentContext = HttpContext.Current; if (currentContext != null) { @@ -90,13 +90,13 @@ public virtual ModuleRequestResult ExecuteRequest(ModuleRequestContext context) ValidationUtility.EnableDynamicValidation(currentContext); } } - AddVersionHeader(RequestContext.HttpContext); - RemoveOptionalRoutingParameters(); + this.AddVersionHeader(this.RequestContext.HttpContext); + this.RemoveOptionalRoutingParameters(); - var controllerName = RequestContext.RouteData.GetRequiredString("controller"); + var controllerName = this.RequestContext.RouteData.GetRequiredString("controller"); //Construct the controller using the ControllerFactory - var controller = ControllerFactory.CreateController(RequestContext, controllerName); + var controller = this.ControllerFactory.CreateController(this.RequestContext, controllerName); try { // Check if the controller supports IDnnController @@ -120,11 +120,11 @@ public virtual ModuleRequestResult ExecuteRequest(ModuleRequestContext context) Localization.LocalResourceDirectory, controllerName); - moduleController.ViewEngineCollectionEx = ViewEngines; + moduleController.ViewEngineCollectionEx = this.ViewEngines; // Execute the controller and capture the result // if our ActionFilter is executed after the ActionResult has triggered an Exception the filter // MUST explicitly flip the ExceptionHandled bit otherwise the view will not render - moduleController.Execute(RequestContext); + moduleController.Execute(this.RequestContext); var result = moduleController.ResultOfLastExecute; // Return the final result @@ -139,13 +139,13 @@ public virtual ModuleRequestResult ExecuteRequest(ModuleRequestContext context) } finally { - ControllerFactory.ReleaseController(controller); + this.ControllerFactory.ReleaseController(controller); } } protected internal virtual void Init() { - var prefix = NormalizeFolderPath(FolderPath); + var prefix = NormalizeFolderPath(this.FolderPath); string[] masterFormats = { string.Format(CultureInfo.InvariantCulture, ControllerMasterFormat, prefix), @@ -159,7 +159,7 @@ protected internal virtual void Init() string.Format(CultureInfo.InvariantCulture, SharedPartialFormat, prefix) }; - ViewEngines.Add(new RazorViewEngine + this.ViewEngines.Add(new RazorViewEngine { MasterLocationFormats = masterFormats, ViewLocationFormats = viewFormats, @@ -183,7 +183,7 @@ protected internal virtual void AddVersionHeader(HttpContextBase httpContext) private void RemoveOptionalRoutingParameters() { - var rvd = RequestContext.RouteData.Values; + var rvd = this.RequestContext.RouteData.Values; // Ensure delegate is stateless rvd.RemoveFromDictionary((entry) => entry.Value == UrlParameter.Optional); diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ResultCapturingActionInvoker.cs b/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ResultCapturingActionInvoker.cs index b3da91bb666..bd5f98c7b16 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ResultCapturingActionInvoker.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Framework/Modules/ResultCapturingActionInvoker.cs @@ -14,21 +14,21 @@ public class ResultCapturingActionInvoker : ControllerActionInvoker protected override ActionExecutedContext InvokeActionMethodWithFilters(ControllerContext controllerContext, IList filters, ActionDescriptor actionDescriptor, IDictionary parameters) { var context = base.InvokeActionMethodWithFilters(controllerContext, filters, actionDescriptor, parameters); - ResultOfLastInvoke = context.Result; + this.ResultOfLastInvoke = context.Result; return context; } protected override ExceptionContext InvokeExceptionFilters(ControllerContext controllerContext, IList filters, Exception exception) { var context = base.InvokeExceptionFilters(controllerContext, filters, exception); - ResultOfLastInvoke = context.Result; + this.ResultOfLastInvoke = context.Result; return context; } protected override void InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) { //Do not invoke the action. Instead, store it for later retrieval - if(ResultOfLastInvoke == null) ResultOfLastInvoke = actionResult; + if(this.ResultOfLastInvoke == null) this.ResultOfLastInvoke = actionResult; } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelper.cs b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelper.cs index b6df16a1210..859dfbbdc8e 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelper.cs @@ -32,7 +32,7 @@ public DnnHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, protected DnnHelper(HtmlHelper htmlHelper) { - HtmlHelper = htmlHelper; + this.HtmlHelper = htmlHelper; var controller = htmlHelper.ViewContext.Controller as IDnnController; @@ -41,20 +41,20 @@ protected DnnHelper(HtmlHelper htmlHelper) throw new InvalidOperationException("The DnnHelper class can only be used in Views that inherit from DnnWebViewPage"); } - DnnPage = controller.DnnPage; + this.DnnPage = controller.DnnPage; - ModuleContext = controller.ModuleContext; - LocalResourceFile = controller.LocalResourceFile; + this.ModuleContext = controller.ModuleContext; + this.LocalResourceFile = controller.LocalResourceFile; } public ModuleInfo ActiveModule { - get { return (ModuleContext == null) ? null : ModuleContext.Configuration; } + get { return (this.ModuleContext == null) ? null : this.ModuleContext.Configuration; } } public TabInfo ActivePage { - get { return (PortalSettings == null) ? null : PortalSettings.ActiveTab; } + get { return (this.PortalSettings == null) ? null : this.PortalSettings.ActiveTab; } } public Page DnnPage { get; set; } @@ -65,29 +65,29 @@ public TabInfo ActivePage public string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } public ModuleInstanceContext ModuleContext { get; set; } public PortalSettings PortalSettings { - get { return (ModuleContext == null) ? null : ModuleContext.PortalSettings; } + get { return (this.ModuleContext == null) ? null : this.ModuleContext.PortalSettings; } } - public RouteCollection RouteCollection { get { return HtmlHelper.RouteCollection; } } + public RouteCollection RouteCollection { get { return this.HtmlHelper.RouteCollection; } } public UserInfo User { - get { return (PortalSettings == null) ? null : PortalSettings.UserInfo; } + get { return (this.PortalSettings == null) ? null : this.PortalSettings.UserInfo; } } - public dynamic ViewBag { get { return HtmlHelper.ViewBag; } } + public dynamic ViewBag { get { return this.HtmlHelper.ViewBag; } } - public ViewContext ViewContext { get { return HtmlHelper.ViewContext; } } + public ViewContext ViewContext { get { return this.HtmlHelper.ViewContext; } } - public ViewDataDictionary ViewData { get { return HtmlHelper.ViewData; } } + public ViewDataDictionary ViewData { get { return this.HtmlHelper.ViewData; } } - public IViewDataContainer ViewDataContainer { get { return HtmlHelper.ViewDataContainer; } } + public IViewDataContainer ViewDataContainer { get { return this.HtmlHelper.ViewDataContainer; } } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelperOfT.cs b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelperOfT.cs index 6b20adb762f..ebcaf413106 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelperOfT.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHelperOfT.cs @@ -22,7 +22,7 @@ public DnnHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, public new ViewDataDictionary ViewData { - get { return ((HtmlHelper)HtmlHelper).ViewData; } + get { return ((HtmlHelper)this.HtmlHelper).ViewData; } } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelper.cs b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelper.cs index 9045367645b..658db511cf1 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelper.cs @@ -27,7 +27,7 @@ public DnnHtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContain protected DnnHtmlHelper(HtmlHelper htmlHelper) { - HtmlHelper = htmlHelper; + this.HtmlHelper = htmlHelper; var controller = htmlHelper.ViewContext.Controller as IDnnController; @@ -36,7 +36,7 @@ protected DnnHtmlHelper(HtmlHelper htmlHelper) throw new InvalidOperationException("The DnnHtmlHelper class can only be used in Views that inherit from DnnWebViewPage"); } - ModuleContext = controller.ModuleContext; + this.ModuleContext = controller.ModuleContext; } public MvcHtmlString AntiForgeryToken() @@ -49,45 +49,45 @@ public MvcHtmlString AntiForgeryToken() public ModuleInstanceContext ModuleContext { get; set; } - public RouteCollection RouteCollection => HtmlHelper.RouteCollection; + public RouteCollection RouteCollection => this.HtmlHelper.RouteCollection; - public dynamic ViewBag => HtmlHelper.ViewBag; + public dynamic ViewBag => this.HtmlHelper.ViewBag; - public ViewContext ViewContext => HtmlHelper.ViewContext; + public ViewContext ViewContext => this.HtmlHelper.ViewContext; - public ViewDataDictionary ViewData => HtmlHelper.ViewData; + public ViewDataDictionary ViewData => this.HtmlHelper.ViewData; - public IViewDataContainer ViewDataContainer => HtmlHelper.ViewDataContainer; + public IViewDataContainer ViewDataContainer => this.HtmlHelper.ViewDataContainer; - public string AttributeEncode(string value) => HtmlHelper.AttributeEncode(value); + public string AttributeEncode(string value) => this.HtmlHelper.AttributeEncode(value); - public string AttributeEncode(object value) => HtmlHelper.AttributeEncode(value); + public string AttributeEncode(object value) => this.HtmlHelper.AttributeEncode(value); - public string Encode(string value) => HtmlHelper.Encode(value); + public string Encode(string value) => this.HtmlHelper.Encode(value); - public string Encode(object value) => HtmlHelper.Encode(value); + public string Encode(object value) => this.HtmlHelper.Encode(value); - public string FormatValue(object value, string format) => HtmlHelper.FormatValue(value, format); + public string FormatValue(object value, string format) => this.HtmlHelper.FormatValue(value, format); - public MvcHtmlString HttpMethodOverride(HttpVerbs httpVerb) => HtmlHelper.HttpMethodOverride(httpVerb); + public MvcHtmlString HttpMethodOverride(HttpVerbs httpVerb) => this.HtmlHelper.HttpMethodOverride(httpVerb); - public MvcHtmlString HttpMethodOverride(string httpVerb) => HtmlHelper.HttpMethodOverride(httpVerb); + public MvcHtmlString HttpMethodOverride(string httpVerb) => this.HtmlHelper.HttpMethodOverride(httpVerb); - public IHtmlString Raw(string value) => HtmlHelper.Raw(value); + public IHtmlString Raw(string value) => this.HtmlHelper.Raw(value); - public IHtmlString Raw(object value) => HtmlHelper.Raw(value); + public IHtmlString Raw(object value) => this.HtmlHelper.Raw(value); - public IDictionary GetUnobtrusiveValidationAttributes(string name) => HtmlHelper.GetUnobtrusiveValidationAttributes(name); + public IDictionary GetUnobtrusiveValidationAttributes(string name) => this.HtmlHelper.GetUnobtrusiveValidationAttributes(name); - public IDictionary GetUnobtrusiveValidationAttributes(string name, ModelMetadata metadata) => HtmlHelper.GetUnobtrusiveValidationAttributes(name, metadata); + public IDictionary GetUnobtrusiveValidationAttributes(string name, ModelMetadata metadata) => this.HtmlHelper.GetUnobtrusiveValidationAttributes(name, metadata); - public void EnableClientValidation() => HtmlHelper.EnableClientValidation(); + public void EnableClientValidation() => this.HtmlHelper.EnableClientValidation(); - public void EnableClientValidation(bool enabled) => HtmlHelper.EnableClientValidation(enabled); + public void EnableClientValidation(bool enabled) => this.HtmlHelper.EnableClientValidation(enabled); - public void EnableUnobtrusiveJavaScript() => HtmlHelper.EnableUnobtrusiveJavaScript(); + public void EnableUnobtrusiveJavaScript() => this.HtmlHelper.EnableUnobtrusiveJavaScript(); - public void EnableUnobtrusiveJavaScript(bool enabled) => HtmlHelper.EnableUnobtrusiveJavaScript(enabled); + public void EnableUnobtrusiveJavaScript(bool enabled) => this.HtmlHelper.EnableUnobtrusiveJavaScript(enabled); } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelperOfT.cs b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelperOfT.cs index ea778c3d9f7..65d4fd793ec 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelperOfT.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnHtmlHelperOfT.cs @@ -22,8 +22,8 @@ public DnnHtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContain internal new HtmlHelper HtmlHelper => (HtmlHelper)base.HtmlHelper; - public new object ViewBag => HtmlHelper.ViewBag; + public new object ViewBag => this.HtmlHelper.ViewBag; - public new ViewDataDictionary ViewData => HtmlHelper.ViewData; + public new ViewDataDictionary ViewData => this.HtmlHelper.ViewData; } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnUrlHelper.cs b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnUrlHelper.cs index 2731d2d813e..b78e54de659 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnUrlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Helpers/DnnUrlHelper.cs @@ -29,27 +29,27 @@ public DnnUrlHelper(RequestContext requestContext, IDnnController controller) Requires.NotNull("requestContext", requestContext); Requires.NotNull("controller", controller); - UrlHelper = new UrlHelper(requestContext); - _controller = controller; - ModuleContext = _controller.ModuleContext; + this.UrlHelper = new UrlHelper(requestContext); + this._controller = controller; + this.ModuleContext = this._controller.ModuleContext; } public DnnUrlHelper(ViewContext viewContext, RouteCollection routeCollection) { Requires.NotNull("viewContext", viewContext); - UrlHelper = new UrlHelper(viewContext.RequestContext, routeCollection); + this.UrlHelper = new UrlHelper(viewContext.RequestContext, routeCollection); - _viewContext = viewContext; + this._viewContext = viewContext; - _controller = viewContext.Controller as IDnnController; + this._controller = viewContext.Controller as IDnnController; - if (_controller == null) + if (this._controller == null) { throw new InvalidOperationException("The DnnUrlHelper class can only be used in Views that inherit from DnnWebViewPage"); } - ModuleContext = _controller.ModuleContext; + this.ModuleContext = this._controller.ModuleContext; } internal UrlHelper UrlHelper { get; set; } @@ -71,7 +71,7 @@ public virtual string Encode(string url) /// The virtual path of the content. public virtual string Content(string contentPath) { - return UrlHelper.Content(contentPath); + return this.UrlHelper.Content(contentPath); } /// @@ -84,49 +84,49 @@ public virtual string Content(string contentPath) /// The URL. public virtual bool IsLocalUrl(string url) { - return UrlHelper.IsLocalUrl(url); + return this.UrlHelper.IsLocalUrl(url); } public virtual string Action() { - return UrlHelper.RequestContext.HttpContext.Request.RawUrl; + return this.UrlHelper.RequestContext.HttpContext.Request.RawUrl; } public virtual string Action(string actionName) { - return GenerateUrl(actionName, null, new RouteValueDictionary()); + return this.GenerateUrl(actionName, null, new RouteValueDictionary()); } public virtual string Action(string actionName, RouteValueDictionary routeValues) { - return GenerateUrl(actionName, null, routeValues); + return this.GenerateUrl(actionName, null, routeValues); } public virtual string Action(string actionName, object routeValues) { - return GenerateUrl(actionName, null, TypeHelper.ObjectToDictionary(routeValues)); + return this.GenerateUrl(actionName, null, TypeHelper.ObjectToDictionary(routeValues)); } public virtual string Action(string actionName, string controllerName) { - return GenerateUrl(actionName, controllerName, new RouteValueDictionary()); + return this.GenerateUrl(actionName, controllerName, new RouteValueDictionary()); } public virtual string Action(string actionName, string controllerName, RouteValueDictionary routeValues) { - return GenerateUrl(actionName, controllerName, routeValues); + return this.GenerateUrl(actionName, controllerName, routeValues); } public virtual string Action(string actionName, string controllerName, object routeValues) { - return GenerateUrl(actionName, controllerName, TypeHelper.ObjectToDictionary(routeValues)); + return this.GenerateUrl(actionName, controllerName, TypeHelper.ObjectToDictionary(routeValues)); } private string GenerateUrl(string actionName, string controllerName, RouteValueDictionary routeValues) { - routeValues["controller"] = controllerName ?? _controller.ControllerContext?.RouteData.Values["controller"]; + routeValues["controller"] = controllerName ?? this._controller.ControllerContext?.RouteData.Values["controller"]; routeValues["action"] = actionName; - return ModuleRoutingProvider.Instance().GenerateUrl(routeValues, ModuleContext); + return ModuleRoutingProvider.Instance().GenerateUrl(routeValues, this.ModuleContext); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs b/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs index 3eafb1efbd1..4f42fff820f 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs @@ -36,12 +36,12 @@ public class MvcHostControl : ModuleControlBase, IActionable public MvcHostControl() { - _controlKey = String.Empty; + this._controlKey = String.Empty; } public MvcHostControl(string controlKey) { - _controlKey = controlKey; + this._controlKey = controlKey; } #endregion @@ -104,7 +104,7 @@ private IModuleExecutionEngine GetModuleExecutionEngine() private ModuleRequestContext GetModuleRequestContext(HttpContextBase httpContext) { - var module = ModuleContext.Configuration; + var module = this.ModuleContext.Configuration; //TODO DesktopModuleControllerAdapter usage is temporary in order to make method testable var desktopModule = DesktopModuleControllerAdapter.Instance.GetDesktopModule(module.DesktopModuleID, module.PortalID); @@ -112,15 +112,15 @@ private ModuleRequestContext GetModuleRequestContext(HttpContextBase httpContext var defaultRouteData = ModuleRoutingProvider.Instance().GetRouteData(null, defaultControl); - var moduleApplication = GetModuleApplication(desktopModule, defaultRouteData); + var moduleApplication = this.GetModuleApplication(desktopModule, defaultRouteData); RouteData routeData; var queryString = httpContext.Request.QueryString; - if (String.IsNullOrEmpty(_controlKey)) + if (String.IsNullOrEmpty(this._controlKey)) { - _controlKey = queryString.GetValueOrDefault("ctl", String.Empty); + this._controlKey = queryString.GetValueOrDefault("ctl", String.Empty); } var moduleId = Null.NullInteger; @@ -129,22 +129,22 @@ private ModuleRequestContext GetModuleRequestContext(HttpContextBase httpContext int.TryParse(queryString["moduleid"], out moduleId); } - if (moduleId != ModuleContext.ModuleId && String.IsNullOrEmpty(_controlKey)) + if (moduleId != this.ModuleContext.ModuleId && String.IsNullOrEmpty(this._controlKey)) { //Set default routeData for module that is not the "selected" module routeData = defaultRouteData; } else { - var control = ModuleControlControllerAdapter.Instance.GetModuleControlByControlKey(_controlKey, module.ModuleDefID); + var control = ModuleControlControllerAdapter.Instance.GetModuleControlByControlKey(this._controlKey, module.ModuleDefID); routeData = ModuleRoutingProvider.Instance().GetRouteData(httpContext, control); } var moduleRequestContext = new ModuleRequestContext { - DnnPage = Page, + DnnPage = this.Page, HttpContext = httpContext, - ModuleContext = ModuleContext, + ModuleContext = this.ModuleContext, ModuleApplication = moduleApplication, RouteData = routeData }; @@ -160,7 +160,7 @@ private ModuleActionCollection LoadActions(ModuleRequestResult result) { foreach (ModuleAction action in result.ModuleActions) { - action.ID = ModuleContext.GetNextActionID(); + action.ID = this.ModuleContext.GetNextActionID(); actions.Add(action); } } @@ -189,13 +189,13 @@ protected void ExecuteModule() { HttpContextBase httpContext = new HttpContextWrapper(HttpContext.Current); - var moduleExecutionEngine = GetModuleExecutionEngine(); + var moduleExecutionEngine = this.GetModuleExecutionEngine(); - _result = moduleExecutionEngine.ExecuteModule(GetModuleRequestContext(httpContext)); + this._result = moduleExecutionEngine.ExecuteModule(this.GetModuleRequestContext(httpContext)); - ModuleActions = LoadActions(_result); + this.ModuleActions = this.LoadActions(this._result); - httpContext.SetModuleRequestResult(_result); + httpContext.SetModuleRequestResult(this._result); } catch (Exception exc) { @@ -219,9 +219,9 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (ExecuteModuleImmediately) + if (this.ExecuteModuleImmediately) { - ExecuteModule(); + this.ExecuteModule(); } } @@ -230,11 +230,11 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); try { - if (_result == null) return; - var mvcString = RenderModule(_result); + if (this._result == null) return; + var mvcString = this.RenderModule(this._result); if (!string.IsNullOrEmpty(Convert.ToString(mvcString))) { - Controls.Add(new LiteralControl(Convert.ToString(mvcString))); + this.Controls.Add(new LiteralControl(Convert.ToString(mvcString))); } } catch (Exception exc) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/MvcSettingsControl.cs b/DNN Platform/DotNetNuke.Web.Mvc/MvcSettingsControl.cs index 17fc6f229b0..c8fd7be3d73 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/MvcSettingsControl.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/MvcSettingsControl.cs @@ -11,19 +11,19 @@ public class MvcSettingsControl : MvcHostControl, ISettingsControl { public MvcSettingsControl() : base("Settings") { - ExecuteModuleImmediately = false; + this.ExecuteModuleImmediately = false; } public void LoadSettings() { - ExecuteModule(); + this.ExecuteModule(); } public void UpdateSettings() { - ExecuteModule(); + this.ExecuteModule(); - ModuleController.Instance.UpdateModule(ModuleContext.Configuration); + ModuleController.Instance.UpdateModule(this.ModuleContext.Configuration); } } } diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Routing/MvcRoutingManager.cs b/DNN Platform/DotNetNuke.Web.Mvc/Routing/MvcRoutingManager.cs index f4794bafefd..bf4215d59d1 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Routing/MvcRoutingManager.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Routing/MvcRoutingManager.cs @@ -28,9 +28,9 @@ public MvcRoutingManager() : this(RouteTable.Routes) internal MvcRoutingManager(RouteCollection routes) { - _routes = routes; - _portalAliasMvcRouteManager = new PortalAliasMvcRouteManager(); - TypeLocator = new TypeLocator(); + this._routes = routes; + this._portalAliasMvcRouteManager = new PortalAliasMvcRouteManager(); + this.TypeLocator = new TypeLocator(); } internal ITypeLocator TypeLocator { get; set; } @@ -39,12 +39,12 @@ internal MvcRoutingManager(RouteCollection routes) public Route MapRoute(string moduleFolderName, string routeName, string url, string[] namespaces) { - return MapRoute(moduleFolderName, routeName, url, null /* defaults */, null /* constraints */, namespaces); + return this.MapRoute(moduleFolderName, routeName, url, null /* defaults */, null /* constraints */, namespaces); } public Route MapRoute(string moduleFolderName, string routeName, string url, object defaults, string[] namespaces) { - return MapRoute(moduleFolderName, routeName, url, defaults, null /* constraints */, namespaces); + return this.MapRoute(moduleFolderName, routeName, url, defaults, null /* constraints */, namespaces); } public Route MapRoute(string moduleFolderName, string routeName, string url, object defaults, object constraints, string[] namespaces) @@ -60,7 +60,7 @@ public Route MapRoute(string moduleFolderName, string routeName, string url, obj url = url.Trim('/', '\\'); - var prefixCounts = _portalAliasMvcRouteManager.GetRoutePrefixCounts(); + var prefixCounts = this._portalAliasMvcRouteManager.GetRoutePrefixCounts(); Route route = null; if (url == null) @@ -68,10 +68,10 @@ public Route MapRoute(string moduleFolderName, string routeName, string url, obj foreach (var count in prefixCounts) { - var fullRouteName = _portalAliasMvcRouteManager.GetRouteName(moduleFolderName, routeName, count); - var routeUrl = _portalAliasMvcRouteManager.GetRouteUrl(moduleFolderName, url, count); + var fullRouteName = this._portalAliasMvcRouteManager.GetRouteName(moduleFolderName, routeName, count); + var routeUrl = this._portalAliasMvcRouteManager.GetRouteUrl(moduleFolderName, url, count); route = MapRouteWithNamespace(fullRouteName, routeUrl, defaults, constraints, namespaces); - _routes.Add(route); + this._routes.Add(route); Logger.Trace("Mapping route: " + fullRouteName + " @ " + routeUrl); } @@ -84,12 +84,12 @@ public void RegisterRoutes() { //add standard tab and module id provider GlobalConfiguration.Configuration.AddTabAndModuleInfoProvider(new StandardTabAndModuleInfoProvider()); - using (_routes.GetWriteLock()) + using (this._routes.GetWriteLock()) { //_routes.Clear(); -- don't use; it will remove original WEP API maps - LocateServicesAndMapRoutes(); + this.LocateServicesAndMapRoutes(); } - Logger.TraceFormat("Registered a total of {0} routes", _routes.Count); + Logger.TraceFormat("Registered a total of {0} routes", this._routes.Count); } private static bool IsTracingEnabled() @@ -102,10 +102,10 @@ private static bool IsTracingEnabled() private void LocateServicesAndMapRoutes() { RegisterSystemRoutes(); - ClearCachedRouteData(); + this.ClearCachedRouteData(); - _moduleUsage.Clear(); - foreach (var routeMapper in GetServiceRouteMappers()) + this._moduleUsage.Clear(); + foreach (var routeMapper in this.GetServiceRouteMappers()) { try { @@ -121,7 +121,7 @@ private void LocateServicesAndMapRoutes() private void ClearCachedRouteData() { - _portalAliasMvcRouteManager.ClearCachedData(); + this._portalAliasMvcRouteManager.ClearCachedData(); } private static void RegisterSystemRoutes() @@ -131,7 +131,7 @@ private static void RegisterSystemRoutes() private IEnumerable GetServiceRouteMappers() { - IEnumerable types = GetAllServiceRouteMapperTypes(); + IEnumerable types = this.GetAllServiceRouteMapperTypes(); foreach (var routeMapperType in types) { @@ -156,7 +156,7 @@ private IEnumerable GetServiceRouteMappers() private IEnumerable GetAllServiceRouteMapperTypes() { - return TypeLocator.GetAllMatchingTypes(IsValidServiceRouteMapper); + return this.TypeLocator.GetAllMatchingTypes(IsValidServiceRouteMapper); } internal static bool IsValidServiceRouteMapper(Type t) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Routing/PortalAliasMvcRouteManager.cs b/DNN Platform/DotNetNuke.Web.Mvc/Routing/PortalAliasMvcRouteManager.cs index 634803e2fdd..71d97d254b3 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Routing/PortalAliasMvcRouteManager.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Routing/PortalAliasMvcRouteManager.cs @@ -39,7 +39,7 @@ public string GetRouteName(string moduleFolderName, string routeName, PortalAlia alias = alias.Remove(i, appPath.Length); } } - return GetRouteName(moduleFolderName, routeName, CalcAliasPrefixCount(alias)); + return this.GetRouteName(moduleFolderName, routeName, CalcAliasPrefixCount(alias)); } private static string GeneratePrefixString(int count) @@ -86,12 +86,12 @@ public string GetRouteUrl(string moduleFolderName, string url, int count) public void ClearCachedData() { - _prefixCounts = null; + this._prefixCounts = null; } public IEnumerable GetRoutePrefixCounts() { - if (_prefixCounts != null) return _prefixCounts; + if (this._prefixCounts != null) return this._prefixCounts; //prefixCounts are required for each route that is mapped but they only change //when a new portal is added so cache them until that time var portals = PortalController.Instance.GetPortals(); @@ -104,7 +104,7 @@ var count in portal => PortalAliasController.Instance.GetPortalAliasesByPortalId(portal.PortalID) .Select(x => x.HTTPAlias)) - .Select(StripApplicationPath) + .Select(this.StripApplicationPath) .SelectMany( aliases => aliases.Select(CalcAliasPrefixCount).Where(count => !segmentCounts1.Contains(count)))) @@ -112,9 +112,9 @@ var count in segmentCounts1.Add(count); } IEnumerable segmentCounts = segmentCounts1; - _prefixCounts = segmentCounts.OrderByDescending(x => x).ToList(); + this._prefixCounts = segmentCounts.OrderByDescending(x => x).ToList(); - return _prefixCounts; + return this._prefixCounts; } private static int CalcAliasPrefixCount(string alias) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs index e95879044af..bbbe9b5d9cb 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/Routing/StandardModuleRoutingProvider.cs @@ -23,7 +23,7 @@ public class StandardModuleRoutingProvider : ModuleRoutingProvider private const string ExcludedRouteValues = "mid,ctl,popup"; public StandardModuleRoutingProvider() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } @@ -41,7 +41,7 @@ public override string GenerateUrl(RouteValueDictionary routeValues, ModuleInsta if (String.IsNullOrEmpty(controlKey)) { additionalParams.Insert(0, "moduleId=" + moduleContext.Configuration.ModuleID); - url = NavigationManager.NavigateURL("", additionalParams.ToArray()); + url = this.NavigationManager.NavigateURL("", additionalParams.ToArray()); } else { diff --git a/DNN Platform/DotNetNuke.Web.Mvc/packages.config b/DNN Platform/DotNetNuke.Web.Mvc/packages.config index 66010687c57..1a237298448 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/packages.config +++ b/DNN Platform/DotNetNuke.Web.Mvc/packages.config @@ -7,4 +7,5 @@ + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj b/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj index 04694be556c..85352046976 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj +++ b/DNN Platform/DotNetNuke.Web.Razor/DotNetNuke.Web.Razor.csproj @@ -1,149 +1,156 @@ - - - - Debug - AnyCPU - - - - - {9806C125-8CA9-48CC-940A-CCD0442C5993} - Library - Properties - DotNetNuke.Web.Razor - DotNetNuke.Web.Razor - 512 - Windows - v4.7.2 - - ..\..\ - true - - - true - full - DEBUG;TRACE - bin\ - bin\DotNetNuke.Web.Razor.XML - 4 - 1591 - 7 - - - pdbonly - TRACE - true - bin\ - bin\DotNetNuke.Web.Razor.XML - 1591 - 7 - - - On - - - - False - ..\Library\bin\DotNetNuke.dll - - - ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\..\packages\Microsoft.AspNet.WebHelpers.3.1.1\lib\net45\Microsoft.Web.Helpers.dll - True - - - True - ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll - True - - - ..\..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll - True - - - - - ..\..\packages\Microsoft.AspNet.WebPages.Data.3.1.1\lib\net45\WebMatrix.Data.dll - True - - - ..\..\packages\Microsoft.AspNet.WebPages.WebData.3.1.1\lib\net45\WebMatrix.WebData.dll - True - - - - - - - - - - - - - - - SolutionInfo.cs - - - - - - - - - - ASPXCodeBehind - - - - - - - - - - - - - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - - - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} - DotNetNuke.DependencyInjection - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + + + + + {9806C125-8CA9-48CC-940A-CCD0442C5993} + Library + Properties + DotNetNuke.Web.Razor + DotNetNuke.Web.Razor + 512 + Windows + v4.7.2 + + ..\..\ + true + + + true + full + DEBUG;TRACE + bin\ + bin\DotNetNuke.Web.Razor.XML + 4 + 1591 + 7 + + + pdbonly + TRACE + true + bin\ + bin\DotNetNuke.Web.Razor.XML + 1591 + 7 + + + On + + + + False + ..\Library\bin\DotNetNuke.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\packages\Microsoft.AspNet.WebHelpers.3.1.1\lib\net45\Microsoft.Web.Helpers.dll + True + + + True + ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll + True + + + ..\..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll + True + + + + + ..\..\packages\Microsoft.AspNet.WebPages.Data.3.1.1\lib\net45\WebMatrix.Data.dll + True + + + ..\..\packages\Microsoft.AspNet.WebPages.WebData.3.1.1\lib\net45\WebMatrix.WebData.dll + True + + + + + + + + + + + + + + + SolutionInfo.cs + + + + + + + + + + ASPXCodeBehind + + + + + + + + + + stylecop.json + + + + + + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + + + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} + DotNetNuke.DependencyInjection + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web.Razor/DotNetNukeWebPage.cs b/DNN Platform/DotNetNuke.Web.Razor/DotNetNukeWebPage.cs index b10e7c7ed76..c983a0a0f94 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/DotNetNukeWebPage.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/DotNetNukeWebPage.cs @@ -30,14 +30,14 @@ protected override void ConfigurePage(WebPageBase parentPage) base.ConfigurePage(parentPage); //Child pages need to get their context from the Parent - Context = parentPage.Context; + this.Context = parentPage.Context; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public dynamic Model { - get { return _model ?? (_model = PageContext.Model); } - set { _model = value; } + get { return this._model ?? (this._model = this.PageContext.Model); } + set { this._model = value; } } } @@ -49,14 +49,14 @@ public abstract class DotNetNukeWebPage :DotNetNukeWebPage where TModel public DotNetNukeWebPage() { var model = Globals.DependencyProvider.GetService(); - Model = model ?? Activator.CreateInstance(); + this.Model = model ?? Activator.CreateInstance(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public new TModel Model { - get { return PageContext?.Model as TModel ?? _model; } - set { _model = value; } + get { return this.PageContext?.Model as TModel ?? this._model; } + set { this._model = value; } } } } diff --git a/DNN Platform/DotNetNuke.Web.Razor/Helpers/DnnHelper.cs b/DNN Platform/DotNetNuke.Web.Razor/Helpers/DnnHelper.cs index d29eb216b20..44634ac8cdd 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/Helpers/DnnHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/Helpers/DnnHelper.cs @@ -23,7 +23,7 @@ public class DnnHelper [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public DnnHelper(ModuleInstanceContext context) { - _context = context; + this._context = context; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -31,7 +31,7 @@ public ModuleInfo Module { get { - return _context.Configuration; + return this._context.Configuration; } } @@ -40,7 +40,7 @@ public TabInfo Tab { get { - return _context.PortalSettings.ActiveTab; + return this._context.PortalSettings.ActiveTab; } } @@ -49,7 +49,7 @@ public PortalSettings Portal { get { - return _context.PortalSettings; + return this._context.PortalSettings; } } @@ -58,7 +58,7 @@ public UserInfo User { get { - return _context.PortalSettings.UserInfo; + return this._context.PortalSettings.UserInfo; } } } diff --git a/DNN Platform/DotNetNuke.Web.Razor/Helpers/HtmlHelper.cs b/DNN Platform/DotNetNuke.Web.Razor/Helpers/HtmlHelper.cs index 3d0006d8dad..0fedc2341e5 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/Helpers/HtmlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/Helpers/HtmlHelper.cs @@ -22,20 +22,20 @@ public class HtmlHelper [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public HtmlHelper(ModuleInstanceContext context, string resourcefile) { - _context = context; - _resourceFile = resourcefile; + this._context = context; + this._resourceFile = resourcefile; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public object GetLocalizedString(string key) { - return Localization.GetString(key, _resourceFile); + return Localization.GetString(key, this._resourceFile); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public object GetLocalizedString(string key, string culture) { - return Localization.GetString(key, _resourceFile, culture); + return Localization.GetString(key, this._resourceFile, culture); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] diff --git a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs index 0f0f387f30e..fdbf001f6b6 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/Helpers/UrlHelper.cs @@ -23,20 +23,20 @@ public class UrlHelper [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public UrlHelper(ModuleInstanceContext context) { - _context = context; - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this._context = context; + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public string NavigateToControl() { - return NavigationManager.NavigateURL(_context.TabId); + return this.NavigationManager.NavigateURL(this._context.TabId); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public string NavigateToControl(string controlKey) { - return NavigationManager.NavigateURL(_context.TabId, controlKey, "mid=" + _context.ModuleId); + return this.NavigationManager.NavigateURL(this._context.TabId, controlKey, "mid=" + this._context.ModuleId); } } } diff --git a/DNN Platform/DotNetNuke.Web.Razor/RazorEngine.cs b/DNN Platform/DotNetNuke.Web.Razor/RazorEngine.cs index dcc19963dd5..bf4c9c053f7 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/RazorEngine.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/RazorEngine.cs @@ -26,13 +26,13 @@ public class RazorEngine [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public RazorEngine(string razorScriptFile, ModuleInstanceContext moduleContext, string localResourceFile) { - RazorScriptFile = razorScriptFile; - ModuleContext = moduleContext; - LocalResourceFile = localResourceFile ?? Path.Combine(Path.GetDirectoryName(razorScriptFile), Localization.LocalResourceDirectory, Path.GetFileName(razorScriptFile) + ".resx"); + this.RazorScriptFile = razorScriptFile; + this.ModuleContext = moduleContext; + this.LocalResourceFile = localResourceFile ?? Path.Combine(Path.GetDirectoryName(razorScriptFile), Localization.LocalResourceDirectory, Path.GetFileName(razorScriptFile) + ".resx"); try { - InitWebpage(); + this.InitWebpage(); } catch (HttpParseException) { @@ -69,9 +69,9 @@ protected HttpContextBase HttpContext [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public Type RequestedModelType() { - if (Webpage != null) + if (this.Webpage != null) { - var webpageType = Webpage.GetType(); + var webpageType = this.Webpage.GetType(); if (webpageType.BaseType.IsGenericType) { return webpageType.BaseType.GetGenericArguments()[0]; @@ -85,7 +85,7 @@ public void Render(TextWriter writer, T model) { try { - Webpage.ExecutePageHierarchy(new WebPageContext(HttpContext, Webpage, model), writer, Webpage); + this.Webpage.ExecutePageHierarchy(new WebPageContext(this.HttpContext, this.Webpage, model), writer, this.Webpage); } catch (Exception exc) { @@ -98,7 +98,7 @@ public void Render(TextWriter writer) { try { - Webpage.ExecutePageHierarchy(new WebPageContext(HttpContext, Webpage, null), writer, Webpage); + this.Webpage.ExecutePageHierarchy(new WebPageContext(this.HttpContext, this.Webpage, null), writer, this.Webpage); } catch (Exception exc) { @@ -111,7 +111,7 @@ public void Render(TextWriter writer, WebPageContext context) { try { - Webpage.ExecutePageHierarchy(context, writer, Webpage); + this.Webpage.ExecutePageHierarchy(context, writer, this.Webpage); } catch (Exception exc) { @@ -121,7 +121,7 @@ public void Render(TextWriter writer, WebPageContext context) private object CreateWebPageInstance() { - var compiledType = BuildManager.GetCompiledType(RazorScriptFile); + var compiledType = BuildManager.GetCompiledType(this.RazorScriptFile); object objectValue = null; if (((compiledType != null))) { @@ -132,28 +132,28 @@ private object CreateWebPageInstance() private void InitHelpers(DotNetNukeWebPage webPage) { - webPage.Dnn = new DnnHelper(ModuleContext); - webPage.Html = new HtmlHelper(ModuleContext, LocalResourceFile); - webPage.Url = new UrlHelper(ModuleContext); + webPage.Dnn = new DnnHelper(this.ModuleContext); + webPage.Html = new HtmlHelper(this.ModuleContext, this.LocalResourceFile); + webPage.Url = new UrlHelper(this.ModuleContext); } private void InitWebpage() { - if (!string.IsNullOrEmpty(RazorScriptFile)) + if (!string.IsNullOrEmpty(this.RazorScriptFile)) { - var objectValue = RuntimeHelpers.GetObjectValue(CreateWebPageInstance()); + var objectValue = RuntimeHelpers.GetObjectValue(this.CreateWebPageInstance()); if ((objectValue == null)) { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage found at '{0}' was not created.", new object[] {RazorScriptFile})); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage found at '{0}' was not created.", new object[] {this.RazorScriptFile})); } - Webpage = objectValue as DotNetNukeWebPage; - if ((Webpage == null)) + this.Webpage = objectValue as DotNetNukeWebPage; + if ((this.Webpage == null)) { - throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage at '{0}' must derive from DotNetNukeWebPage.", new object[] {RazorScriptFile})); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The webpage at '{0}' must derive from DotNetNukeWebPage.", new object[] {this.RazorScriptFile})); } - Webpage.Context = HttpContext; - Webpage.VirtualPath = VirtualPathUtility.GetDirectory(RazorScriptFile); - InitHelpers(Webpage); + this.Webpage.Context = this.HttpContext; + this.Webpage.VirtualPath = VirtualPathUtility.GetDirectory(this.RazorScriptFile); + this.InitHelpers(this.Webpage); } } } diff --git a/DNN Platform/DotNetNuke.Web.Razor/RazorHostControl.cs b/DNN Platform/DotNetNuke.Web.Razor/RazorHostControl.cs index 9cad1bce2c7..1190a92572e 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/RazorHostControl.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/RazorHostControl.cs @@ -25,13 +25,13 @@ public class RazorHostControl : ModuleControlBase, IActionable [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public RazorHostControl(string scriptFile) { - _razorScriptFile = scriptFile; + this._razorScriptFile = scriptFile; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] protected virtual string RazorScriptFile { - get { return _razorScriptFile; } + get { return this._razorScriptFile; } } private RazorEngine _engine; @@ -39,12 +39,12 @@ private RazorEngine Engine { get { - if (_engine == null) + if (this._engine == null) { - _engine = new RazorEngine(RazorScriptFile, ModuleContext, LocalResourceFile); + this._engine = new RazorEngine(this.RazorScriptFile, this.ModuleContext, this.LocalResourceFile); } - return _engine; + return this._engine; } } @@ -53,11 +53,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (!(string.IsNullOrEmpty(RazorScriptFile))) + if (!(string.IsNullOrEmpty(this.RazorScriptFile))) { var writer = new StringWriter(); - Engine.Render(writer); - Controls.Add(new LiteralControl(HttpUtility.HtmlDecode(writer.ToString()))); + this.Engine.Render(writer); + this.Controls.Add(new LiteralControl(HttpUtility.HtmlDecode(writer.ToString()))); } } @@ -66,9 +66,9 @@ public ModuleActionCollection ModuleActions { get { - if (Engine.Webpage is IActionable) + if (this.Engine.Webpage is IActionable) { - return (Engine.Webpage as IActionable).ModuleActions; + return (this.Engine.Webpage as IActionable).ModuleActions; } return new ModuleActionCollection(); diff --git a/DNN Platform/DotNetNuke.Web.Razor/RazorModuleBase.cs b/DNN Platform/DotNetNuke.Web.Razor/RazorModuleBase.cs index 7b2e8a06cc1..eb985eb896c 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/RazorModuleBase.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/RazorModuleBase.cs @@ -22,16 +22,16 @@ protected virtual string RazorScriptFile { get { - var scriptFolder = AppRelativeTemplateSourceDirectory; - var fileRoot = Path.GetFileNameWithoutExtension(AppRelativeVirtualPath); + var scriptFolder = this.AppRelativeTemplateSourceDirectory; + var fileRoot = Path.GetFileNameWithoutExtension(this.AppRelativeVirtualPath); var scriptFile = scriptFolder + "_" + fileRoot + ".cshtml"; - if (! (File.Exists(Server.MapPath(scriptFile)))) + if (! (File.Exists(this.Server.MapPath(scriptFile)))) { //Try VB (vbhtml) scriptFile = scriptFolder + "_" + fileRoot + ".vbhtml"; - if (!(File.Exists(Server.MapPath(scriptFile)))) + if (!(File.Exists(this.Server.MapPath(scriptFile)))) { //Return "" scriptFile = ""; @@ -48,13 +48,13 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); try { - if (! (string.IsNullOrEmpty(RazorScriptFile))) + if (! (string.IsNullOrEmpty(this.RazorScriptFile))) { - var razorEngine = new RazorEngine(RazorScriptFile, ModuleContext, LocalResourceFile); + var razorEngine = new RazorEngine(this.RazorScriptFile, this.ModuleContext, this.LocalResourceFile); var writer = new StringWriter(); razorEngine.Render(writer); - Controls.Add(new LiteralControl(writer.ToString())); + this.Controls.Add(new LiteralControl(writer.ToString())); } } catch (Exception ex) diff --git a/DNN Platform/DotNetNuke.Web.Razor/RazorModuleControlFactory.cs b/DNN Platform/DotNetNuke.Web.Razor/RazorModuleControlFactory.cs index 2b5c7229235..ec0a0683d8b 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/RazorModuleControlFactory.cs +++ b/DNN Platform/DotNetNuke.Web.Razor/RazorModuleControlFactory.cs @@ -21,13 +21,13 @@ public override Control CreateControl(TemplateControl containerControl, string c [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public override Control CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) { - return CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); + return this.CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public override Control CreateSettingsControl(TemplateControl containerControl, ModuleInfo moduleConfiguration, string controlSrc) { - return CreateControl(containerControl, String.Empty, controlSrc); + return this.CreateControl(containerControl, String.Empty, controlSrc); } } } diff --git a/DNN Platform/DotNetNuke.Web.Razor/packages.config b/DNN Platform/DotNetNuke.Web.Razor/packages.config index 319b210263a..3284de701ab 100644 --- a/DNN Platform/DotNetNuke.Web.Razor/packages.config +++ b/DNN Platform/DotNetNuke.Web.Razor/packages.config @@ -8,4 +8,5 @@ + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Web/Api/Auth/AuthMessageHandlerBase.cs b/DNN Platform/DotNetNuke.Web/Api/Auth/AuthMessageHandlerBase.cs index 289ef200e40..6bead9f1418 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Auth/AuthMessageHandlerBase.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Auth/AuthMessageHandlerBase.cs @@ -24,20 +24,20 @@ public abstract class AuthMessageHandlerBase : DelegatingHandler protected AuthMessageHandlerBase(bool includeByDefault, bool forceSsl) { - DefaultInclude = includeByDefault; - ForceSsl = forceSsl; + this.DefaultInclude = includeByDefault; + this.ForceSsl = forceSsl; } protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { - var response = OnInboundRequest(request, cancellationToken); + var response = this.OnInboundRequest(request, cancellationToken); if(response != null) { response.RequestMessage = response.RequestMessage ?? request; //if someone returns new HttpResponseMessage(), fill in the requestMessage for other handlers in the chain return Task.Factory.StartNew(() => response, cancellationToken); } - return base.SendAsync(request, cancellationToken).ContinueWith(x => OnOutboundResponse(x.Result, cancellationToken), cancellationToken); + return base.SendAsync(request, cancellationToken).ContinueWith(x => this.OnOutboundResponse(x.Result, cancellationToken), cancellationToken); } /// @@ -64,14 +64,14 @@ public virtual HttpResponseMessage OnOutboundResponse(HttpResponseMessage respon protected bool NeedsAuthentication(HttpRequestMessage request) { - if (MustEnforceSslInRequest(request)) + if (this.MustEnforceSslInRequest(request)) { return !Thread.CurrentPrincipal.Identity.IsAuthenticated; } if (Logger.IsTraceEnabled) { - Logger.Trace($"{AuthScheme}: Validating request vs. SSL mode ({ForceSsl}) failed. "); + Logger.Trace($"{this.AuthScheme}: Validating request vs. SSL mode ({this.ForceSsl}) failed. "); } // will let callers to return without authenticating the user @@ -96,7 +96,7 @@ protected static bool IsXmlHttpRequest(HttpRequestMessage request) /// True if matcher the request scheme; false otherwise. private bool MustEnforceSslInRequest(HttpRequestMessage request) { - return !ForceSsl || request.RequestUri.Scheme.Equals("HTTPS", StringComparison.InvariantCultureIgnoreCase); + return !this.ForceSsl || request.RequestUri.Scheme.Equals("HTTPS", StringComparison.InvariantCultureIgnoreCase); } protected static void SetCurrentPrincipal(IPrincipal principal, HttpRequestMessage request) diff --git a/DNN Platform/DotNetNuke.Web/Api/Auth/BasicAuthMessageHandler.cs b/DNN Platform/DotNetNuke.Web/Api/Auth/BasicAuthMessageHandler.cs index ea0870f6338..1ef2cbfb871 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Auth/BasicAuthMessageHandler.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Auth/BasicAuthMessageHandler.cs @@ -29,12 +29,12 @@ public BasicAuthMessageHandler(bool includeByDefault, bool forceSsl) public override HttpResponseMessage OnInboundRequest(HttpRequestMessage request, CancellationToken cancellationToken) { - if(NeedsAuthentication(request)) + if(this.NeedsAuthentication(request)) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (portalSettings != null) { - TryToAuthenticate(request, portalSettings.PortalId); + this.TryToAuthenticate(request, portalSettings.PortalId); } } @@ -43,9 +43,9 @@ public override HttpResponseMessage OnInboundRequest(HttpRequestMessage request, public override HttpResponseMessage OnOutboundResponse(HttpResponseMessage response, CancellationToken cancellationToken) { - if (response.StatusCode == HttpStatusCode.Unauthorized && SupportsBasicAuth(response.RequestMessage)) + if (response.StatusCode == HttpStatusCode.Unauthorized && this.SupportsBasicAuth(response.RequestMessage)) { - response.Headers.WwwAuthenticate.Add(new AuthenticationHeaderValue(AuthScheme, "realm=\"DNNAPI\"")); + response.Headers.WwwAuthenticate.Add(new AuthenticationHeaderValue(this.AuthScheme, "realm=\"DNNAPI\"")); } return base.OnOutboundResponse(response, cancellationToken); @@ -58,7 +58,7 @@ private bool SupportsBasicAuth(HttpRequestMessage request) private void TryToAuthenticate(HttpRequestMessage request, int portalId) { - UserCredentials credentials = GetCredentials(request); + UserCredentials credentials = this.GetCredentials(request); if (credentials == null) { @@ -73,7 +73,7 @@ private void TryToAuthenticate(HttpRequestMessage request, int portalId) if (user != null) { - SetCurrentPrincipal(new GenericPrincipal(new GenericIdentity(credentials.UserName, AuthScheme), null), request); + SetCurrentPrincipal(new GenericPrincipal(new GenericIdentity(credentials.UserName, this.AuthScheme), null), request); } } @@ -84,7 +84,7 @@ private UserCredentials GetCredentials(HttpRequestMessage request) return null; } - if (request?.Headers.Authorization.Scheme.ToLower() != AuthScheme.ToLower()) + if (request?.Headers.Authorization.Scheme.ToLower() != this.AuthScheme.ToLower()) { return null; } @@ -95,7 +95,7 @@ private UserCredentials GetCredentials(HttpRequestMessage request) return null; } - string decoded = _encoding.GetString(Convert.FromBase64String(authorization)); + string decoded = this._encoding.GetString(Convert.FromBase64String(authorization)); string[] parts = decoded.Split(new[] {':'}, 2); if (parts.Length < 2) @@ -112,8 +112,8 @@ internal class UserCredentials { public UserCredentials(string userName, string password) { - UserName = userName; - Password = password; + this.UserName = userName; + this.Password = password; } public string Password { get; set; } diff --git a/DNN Platform/DotNetNuke.Web/Api/Auth/DigestAuthMessageHandler.cs b/DNN Platform/DotNetNuke.Web/Api/Auth/DigestAuthMessageHandler.cs index 89d33e17e4a..f22759a891a 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Auth/DigestAuthMessageHandler.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Auth/DigestAuthMessageHandler.cs @@ -26,7 +26,7 @@ public DigestAuthMessageHandler(bool includeByDefault, bool forceSsl) public override HttpResponseMessage OnInboundRequest(HttpRequestMessage request, CancellationToken cancellationToken) { - if (NeedsAuthentication(request)) + if (this.NeedsAuthentication(request)) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (portalSettings != null) @@ -36,7 +36,7 @@ public override HttpResponseMessage OnInboundRequest(HttpRequestMessage request, if (isStale) { var staleResponse = request.CreateResponse(HttpStatusCode.Unauthorized); - AddStaleWwwAuthenticateHeader(staleResponse); + this.AddStaleWwwAuthenticateHeader(staleResponse); return staleResponse; } @@ -48,9 +48,9 @@ public override HttpResponseMessage OnInboundRequest(HttpRequestMessage request, public override HttpResponseMessage OnOutboundResponse(HttpResponseMessage response, CancellationToken cancellationToken) { - if (response.StatusCode == HttpStatusCode.Unauthorized && SupportsDigestAuth(response.RequestMessage)) + if (response.StatusCode == HttpStatusCode.Unauthorized && this.SupportsDigestAuth(response.RequestMessage)) { - AddWwwAuthenticateHeader(response); + this.AddWwwAuthenticateHeader(response); } return base.OnOutboundResponse(response, cancellationToken); @@ -58,13 +58,13 @@ public override HttpResponseMessage OnOutboundResponse(HttpResponseMessage respo private void AddStaleWwwAuthenticateHeader(HttpResponseMessage response) { - AddWwwAuthenticateHeader(response, true); + this.AddWwwAuthenticateHeader(response, true); } private void AddWwwAuthenticateHeader(HttpResponseMessage response, bool isStale = false) { var value = string.Format("realm=\"DNNAPI\", nonce=\"{0}\", opaque=\"0000000000000000\", stale={1}, algorithm=MD5, qop=\"auth\"", CreateNewNonce(), isStale); - response.Headers.WwwAuthenticate.Add(new AuthenticationHeaderValue(AuthScheme, value)); + response.Headers.WwwAuthenticate.Add(new AuthenticationHeaderValue(this.AuthScheme, value)); } private static string CreateNewNonce() diff --git a/DNN Platform/DotNetNuke.Web/Api/AuthFilterBase.cs b/DNN Platform/DotNetNuke.Web/Api/AuthFilterBase.cs index 75f8f433e2a..df7b01e0871 100644 --- a/DNN Platform/DotNetNuke.Web/Api/AuthFilterBase.cs +++ b/DNN Platform/DotNetNuke.Web/Api/AuthFilterBase.cs @@ -31,7 +31,7 @@ protected virtual void OnAuthorization(HttpActionContext actionContext) const string failureMessage = "Authorization has been denied for this request."; var authFilterContext = new AuthFilterContext(actionContext, failureMessage); - if (!IsAuthorized(authFilterContext)) + if (!this.IsAuthorized(authFilterContext)) { authFilterContext.HandleUnauthorizedRequest(); } @@ -49,7 +49,7 @@ Task IAuthorizationFilter.ExecuteAuthorizationFilterAsync(H try { - OnAuthorization(actionContext); + this.OnAuthorization(actionContext); } catch (Exception e) { diff --git a/DNN Platform/DotNetNuke.Web/Api/AuthFilterContext.cs b/DNN Platform/DotNetNuke.Web/Api/AuthFilterContext.cs index 6ebd4a4508a..b63e02d4a1b 100644 --- a/DNN Platform/DotNetNuke.Web/Api/AuthFilterContext.cs +++ b/DNN Platform/DotNetNuke.Web/Api/AuthFilterContext.cs @@ -13,8 +13,8 @@ public class AuthFilterContext { public AuthFilterContext(HttpActionContext actionContext, string authFailureMessage) { - ActionContext = actionContext; - AuthFailureMessage = authFailureMessage; + this.ActionContext = actionContext; + this.AuthFailureMessage = authFailureMessage; } public HttpActionContext ActionContext { get; private set; } @@ -26,7 +26,7 @@ public AuthFilterContext(HttpActionContext actionContext, string authFailureMess /// public virtual void HandleUnauthorizedRequest() { - ActionContext.Response = ActionContext.ControllerContext.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, AuthFailureMessage); + this.ActionContext.Response = this.ActionContext.ControllerContext.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, this.AuthFailureMessage); } } } diff --git a/DNN Platform/DotNetNuke.Web/Api/AuthorizeAttributeBase.cs b/DNN Platform/DotNetNuke.Web/Api/AuthorizeAttributeBase.cs index d44f74a1242..0a185ce17d3 100644 --- a/DNN Platform/DotNetNuke.Web/Api/AuthorizeAttributeBase.cs +++ b/DNN Platform/DotNetNuke.Web/Api/AuthorizeAttributeBase.cs @@ -28,14 +28,14 @@ public override void OnAuthorization(HttpActionContext actionContext) { Requires.NotNull("actionContext", actionContext); - if (SkipAuthorization(actionContext)) + if (this.SkipAuthorization(actionContext)) { return; } const string failureMessage = "Authorization has been denied for this request."; var authFilterContext = new AuthFilterContext(actionContext, failureMessage); - if (!IsAuthorized(authFilterContext)) + if (!this.IsAuthorized(authFilterContext)) { authFilterContext.HandleUnauthorizedRequest(); } diff --git a/DNN Platform/DotNetNuke.Web/Api/DnnApiController.cs b/DNN Platform/DotNetNuke.Web/Api/DnnApiController.cs index f3ef25530e0..e3416a36d97 100644 --- a/DNN Platform/DotNetNuke.Web/Api/DnnApiController.cs +++ b/DNN Platform/DotNetNuke.Web/Api/DnnApiController.cs @@ -17,12 +17,12 @@ public abstract class DnnApiController : ApiController protected DnnApiController() { - _activeModule = new Lazy(InitModuleInfo); + this._activeModule = new Lazy(this.InitModuleInfo); } private ModuleInfo InitModuleInfo() { - return Request.FindModuleInfo(); + return this.Request.FindModuleInfo(); } /// @@ -39,14 +39,14 @@ public PortalSettings PortalSettings /// /// UserInfo for the current user /// - public UserInfo UserInfo { get { return PortalSettings.UserInfo; } } + public UserInfo UserInfo { get { return this.PortalSettings.UserInfo; } } /// /// ModuleInfo for the current module /// Will be null unless a valid pair of module and tab ids were provided in the request /// public ModuleInfo ActiveModule { - get { return _activeModule.Value; } + get { return this._activeModule.Value; } } } } diff --git a/DNN Platform/DotNetNuke.Web/Api/DnnAuthorizeAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/DnnAuthorizeAttribute.cs index f0caff26bf2..c43bcb1252b 100644 --- a/DNN Platform/DotNetNuke.Web/Api/DnnAuthorizeAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/DnnAuthorizeAttribute.cs @@ -37,11 +37,11 @@ internal static void AppendToDefaultAuthTypes(string authType) /// public string StaticRoles { - get { return _staticRoles; } + get { return this._staticRoles; } set { - _staticRoles = value; - _staticRolesSplit = SplitString(_staticRoles); + this._staticRoles = value; + this._staticRolesSplit = SplitString(this._staticRoles); } } @@ -50,11 +50,11 @@ public string StaticRoles /// public string DenyRoles { - get { return _denyRoles; } + get { return this._denyRoles; } set { - _denyRoles = value; - _denyRolesSplit = SplitString(_denyRoles); + this._denyRoles = value; + this._denyRolesSplit = SplitString(this._denyRoles); } } @@ -63,11 +63,11 @@ public string DenyRoles /// public string AuthTypes { - get { return _authTypes; } + get { return this._authTypes; } set { - _authTypes = value; - _authTypesSplit = SplitString(_authTypes); + this._authTypes = value; + this._authTypesSplit = SplitString(this._authTypes); } } @@ -81,19 +81,19 @@ public override bool IsAuthorized(AuthFilterContext context) return false; } - if(_denyRolesSplit.Any()) + if(this._denyRolesSplit.Any()) { var currentUser = PortalController.Instance.GetCurrentPortalSettings().UserInfo; - if (!currentUser.IsSuperUser && _denyRolesSplit.Any(currentUser.IsInRole)) + if (!currentUser.IsSuperUser && this._denyRolesSplit.Any(currentUser.IsInRole)) { return false; } } - if (_staticRolesSplit.Any()) + if (this._staticRolesSplit.Any()) { var currentUser = PortalController.Instance.GetCurrentPortalSettings().UserInfo; - if (!_staticRolesSplit.Any(currentUser.IsInRole)) + if (!this._staticRolesSplit.Any(currentUser.IsInRole)) { return false; } @@ -104,9 +104,9 @@ public override bool IsAuthorized(AuthFilterContext context) var currentAuthType = (identity.AuthenticationType ?? "").Trim(); if (currentAuthType.Length > 0) { - if (_authTypesSplit.Any()) + if (this._authTypesSplit.Any()) { - return _authTypesSplit.Contains(currentAuthType); + return this._authTypesSplit.Contains(currentAuthType); } return DefaultAuthTypes.Contains(currentAuthType); diff --git a/DNN Platform/DotNetNuke.Web/Api/DnnExceptionAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/DnnExceptionAttribute.cs index 1beadbadd4a..90500982d05 100644 --- a/DNN Platform/DotNetNuke.Web/Api/DnnExceptionAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/DnnExceptionAttribute.cs @@ -26,11 +26,11 @@ public override void OnException(HttpActionExecutedContext actionExecutedContext var actionName = actionExecutedContext.ActionContext.ActionDescriptor.ActionName; var controllerName = actionExecutedContext.ActionContext.ControllerContext.ControllerDescriptor.ControllerName; - var resourceFile = string.IsNullOrEmpty(LocalResourceFile) + var resourceFile = string.IsNullOrEmpty(this.LocalResourceFile) ? Localization.ExceptionsResourceFile - : LocalResourceFile; + : this.LocalResourceFile; - var key = string.IsNullOrEmpty(MessageKey) ? controllerName + "_" + actionName + ".Error" : MessageKey; + var key = string.IsNullOrEmpty(this.MessageKey) ? controllerName + "_" + actionName + ".Error" : this.MessageKey; HttpStatusCode statusCode; if (exception is NotImplementedException) diff --git a/DNN Platform/DotNetNuke.Web/Api/DnnHttpControllerSelector.cs b/DNN Platform/DotNetNuke.Web/Api/DnnHttpControllerSelector.cs index 6ca2460c3a0..ab312503500 100644 --- a/DNN Platform/DotNetNuke.Web/Api/DnnHttpControllerSelector.cs +++ b/DNN Platform/DotNetNuke.Web/Api/DnnHttpControllerSelector.cs @@ -29,22 +29,22 @@ public DnnHttpControllerSelector(HttpConfiguration configuration) { Requires.NotNull("configuration", configuration); - _configuration = configuration; - _descriptorCache = new Lazy>(InitTypeCache, + this._configuration = configuration; + this._descriptorCache = new Lazy>(this.InitTypeCache, isThreadSafe: true); } private ConcurrentDictionary DescriptorCache { - get { return _descriptorCache.Value; } + get { return this._descriptorCache.Value; } } public HttpControllerDescriptor SelectController(HttpRequestMessage request) { Requires.NotNull("request", request); - string controllerName = GetControllerName(request); - IEnumerable namespaces = GetNameSpaces(request); + string controllerName = this.GetControllerName(request); + IEnumerable namespaces = this.GetNameSpaces(request); if (namespaces == null || !namespaces.Any() || String.IsNullOrEmpty(controllerName)) { throw new HttpResponseException(request.CreateErrorResponse(HttpStatusCode.NotFound, @@ -55,10 +55,10 @@ public HttpControllerDescriptor SelectController(HttpRequestMessage request) var matches = new List(); foreach (string ns in namespaces) { - string fullName = GetFullName(controllerName, ns); + string fullName = this.GetFullName(controllerName, ns); HttpControllerDescriptor descriptor; - if (DescriptorCache.TryGetValue(fullName, out descriptor)) + if (this.DescriptorCache.TryGetValue(fullName, out descriptor)) { matches.Add(descriptor); } @@ -80,7 +80,7 @@ public HttpControllerDescriptor SelectController(HttpRequestMessage request) public IDictionary GetControllerMapping() { - return DescriptorCache; + return this.DescriptorCache; } private string GetFullName(string controllerName, string ns) @@ -115,8 +115,8 @@ private string GetControllerName(HttpRequestMessage request) private ConcurrentDictionary InitTypeCache() { - IAssembliesResolver assembliesResolver = _configuration.Services.GetAssembliesResolver(); - IHttpControllerTypeResolver controllersResolver = _configuration.Services.GetHttpControllerTypeResolver(); + IAssembliesResolver assembliesResolver = this._configuration.Services.GetAssembliesResolver(); + IHttpControllerTypeResolver controllersResolver = this._configuration.Services.GetHttpControllerTypeResolver(); ICollection controllerTypes = controllersResolver.GetControllerTypes(assembliesResolver); @@ -127,7 +127,7 @@ private ConcurrentDictionary InitTypeCache() if (type.FullName != null) { string controllerName = type.Name.Substring(0, type.Name.Length - ControllerSuffix.Length); - dict.TryAdd(type.FullName.ToLowerInvariant(), new HttpControllerDescriptor(_configuration, controllerName, type)); + dict.TryAdd(type.FullName.ToLowerInvariant(), new HttpControllerDescriptor(this._configuration, controllerName, type)); } } diff --git a/DNN Platform/DotNetNuke.Web/Api/DnnModuleAuthorizeAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/DnnModuleAuthorizeAttribute.cs index 719688a1d02..7c71a9bb784 100644 --- a/DNN Platform/DotNetNuke.Web/Api/DnnModuleAuthorizeAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/DnnModuleAuthorizeAttribute.cs @@ -14,7 +14,7 @@ public class DnnModuleAuthorizeAttribute : AuthorizeAttributeBase, IOverrideDefa { public DnnModuleAuthorizeAttribute() { - AccessLevel = SecurityAccessLevel.Host; + this.AccessLevel = SecurityAccessLevel.Host; } public string PermissionKey { get; set; } @@ -22,11 +22,11 @@ public DnnModuleAuthorizeAttribute() public override bool IsAuthorized(AuthFilterContext context) { - var activeModule = FindModuleInfo(context.ActionContext.Request); + var activeModule = this.FindModuleInfo(context.ActionContext.Request); if (activeModule != null) { - return ModulePermissionController.HasModuleAccess(AccessLevel, PermissionKey, activeModule); + return ModulePermissionController.HasModuleAccess(this.AccessLevel, this.PermissionKey, activeModule); } return false; diff --git a/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthentication.cs b/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthentication.cs index ecc11fdb18b..316e9128a9d 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthentication.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthentication.cs @@ -22,8 +22,8 @@ internal class DigestAuthentication public DigestAuthenticationRequest Request { - get { return _request; } - set { _request = value; } + get { return this._request; } + set { this._request = value; } } public bool IsValid { get; private set; } @@ -32,40 +32,40 @@ public DigestAuthenticationRequest Request public string CalculateHashedDigest() { - return CreateMd5HashBinHex(GenerateUnhashedDigest()); + return CreateMd5HashBinHex(this.GenerateUnhashedDigest()); } public IPrincipal User { get; private set; } public DigestAuthentication(DigestAuthenticationRequest request, int portalId, string ipAddress) { - _request = request; - _portalId = portalId; - _ipAddress = ipAddress ?? ""; - AuthenticateRequest(); + this._request = request; + this._portalId = portalId; + this._ipAddress = ipAddress ?? ""; + this.AuthenticateRequest(); } private void AuthenticateRequest() { - _password = GetPassword(Request); - if(_password != null) + this._password = this.GetPassword(this.Request); + if(this._password != null) { - IsNonceStale = ! (IsNonceValid(_request.RequestParams["nonce"])); + this.IsNonceStale = ! (IsNonceValid(this._request.RequestParams["nonce"])); //Services.Logging.LoggingController.SimpleLog(String.Format("Request hash: {0} - Response Hash: {1}", _request.RequestParams("response"), HashedDigest)) - if ((! IsNonceStale) && _request.RequestParams["response"] == CalculateHashedDigest()) + if ((! this.IsNonceStale) && this._request.RequestParams["response"] == this.CalculateHashedDigest()) { - IsValid = true; - User = new GenericPrincipal(new GenericIdentity(_request.RawUsername, AuthenticationScheme), null); + this.IsValid = true; + this.User = new GenericPrincipal(new GenericIdentity(this._request.RawUsername, AuthenticationScheme), null); } } } private string GetPassword(DigestAuthenticationRequest request) { - UserInfo user = UserController.GetUserByName(_portalId, request.CleanUsername); + UserInfo user = UserController.GetUserByName(this._portalId, request.CleanUsername); if (user == null) { - user = UserController.GetUserByName(_portalId, request.RawUsername); + user = UserController.GetUserByName(this._portalId, request.RawUsername); } if (user == null) { @@ -75,28 +75,28 @@ private string GetPassword(DigestAuthenticationRequest request) //Try to validate user var loginStatus = UserLoginStatus.LOGIN_FAILURE; - user = UserController.ValidateUser(_portalId, user.Username, password, "DNN", "", _ipAddress, ref loginStatus); + user = UserController.ValidateUser(this._portalId, user.Username, password, "DNN", "", this._ipAddress, ref loginStatus); return user != null ? password : null; } private string GenerateUnhashedDigest() { - string a1 = String.Format("{0}:{1}:{2}", _request.RequestParams["username"].Replace("\\\\", "\\"), - _request.RequestParams["realm"], _password); + string a1 = String.Format("{0}:{1}:{2}", this._request.RequestParams["username"].Replace("\\\\", "\\"), + this._request.RequestParams["realm"], this._password); string ha1 = CreateMd5HashBinHex(a1); - string a2 = String.Format("{0}:{1}", _request.HttpMethod, _request.RequestParams["uri"]); + string a2 = String.Format("{0}:{1}", this._request.HttpMethod, this._request.RequestParams["uri"]); string ha2 = CreateMd5HashBinHex(a2); string unhashedDigest; - if (_request.RequestParams["qop"] != null) + if (this._request.RequestParams["qop"] != null) { - unhashedDigest = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", ha1, _request.RequestParams["nonce"], - _request.RequestParams["nc"], _request.RequestParams["cnonce"], - _request.RequestParams["qop"], ha2); + unhashedDigest = String.Format("{0}:{1}:{2}:{3}:{4}:{5}", ha1, this._request.RequestParams["nonce"], + this._request.RequestParams["nc"], this._request.RequestParams["cnonce"], + this._request.RequestParams["qop"], ha2); } else { - unhashedDigest = String.Format("{0}:{1}:{2}", ha1, _request.RequestParams["nonce"], ha2); + unhashedDigest = String.Format("{0}:{1}:{2}", ha1, this._request.RequestParams["nonce"], ha2); } //Services.Logging.LoggingController.SimpleLog(A1, HA1, A2, HA2, unhashedDigest) return unhashedDigest; diff --git a/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthenticationRequest.cs b/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthenticationRequest.cs index dd2cff1aef4..fd86654b899 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthenticationRequest.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Internal/Auth/DigestAuthenticationRequest.cs @@ -26,17 +26,17 @@ public DigestAuthenticationRequest(string authorizationHeader, string httpMethod //opaque="5ccc069c403ebaf9f0171e9517f40e41" try { - RequestParams = new NameValueCollection(); + this.RequestParams = new NameValueCollection(); foreach (Match m in AuthHeaderRegex.Matches(authorizationHeader)) { - RequestParams.Add(m.Groups["name"].Value, m.Groups["value"].Value); + this.RequestParams.Add(m.Groups["name"].Value, m.Groups["value"].Value); } - HttpMethod = httpMethod; - RawUsername = RequestParams["username"].Replace("\\\\", "\\"); - CleanUsername = RawUsername; - if (CleanUsername.LastIndexOf("\\", System.StringComparison.Ordinal) > 0) + this.HttpMethod = httpMethod; + this.RawUsername = this.RequestParams["username"].Replace("\\\\", "\\"); + this.CleanUsername = this.RawUsername; + if (this.CleanUsername.LastIndexOf("\\", System.StringComparison.Ordinal) > 0) { - CleanUsername = CleanUsername.Substring(CleanUsername.LastIndexOf("\\", System.StringComparison.Ordinal) + 2 - 1); + this.CleanUsername = this.CleanUsername.Substring(this.CleanUsername.LastIndexOf("\\", System.StringComparison.Ordinal) + 2 - 1); } } catch (Exception) diff --git a/DNN Platform/DotNetNuke.Web/Api/Internal/DnnDependencyResolver.cs b/DNN Platform/DotNetNuke.Web/Api/Internal/DnnDependencyResolver.cs index cf107c4a16e..e2d674e375f 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Internal/DnnDependencyResolver.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Internal/DnnDependencyResolver.cs @@ -27,7 +27,7 @@ internal class DnnDependencyResolver : IDependencyResolver /// public DnnDependencyResolver(IServiceProvider serviceProvider) { - _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); + this._serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); } /// @@ -38,7 +38,7 @@ public DnnDependencyResolver(IServiceProvider serviceProvider) /// public IDependencyScope BeginScope() { - var accessor = _serviceProvider.GetRequiredService(); + var accessor = this._serviceProvider.GetRequiredService(); var scope = accessor.GetScope(); return new DnnDependencyResolver(scope.ServiceProvider); } @@ -54,7 +54,7 @@ public IDependencyScope BeginScope() /// public object GetService(Type serviceType) { - return _serviceProvider.GetService(serviceType); + return this._serviceProvider.GetService(serviceType); } /// @@ -68,7 +68,7 @@ public object GetService(Type serviceType) /// public IEnumerable GetServices(Type serviceType) { - return _serviceProvider.GetServices(serviceType); + return this._serviceProvider.GetServices(serviceType); } /// @@ -77,7 +77,7 @@ public IEnumerable GetServices(Type serviceType) /// public void Dispose() { - Dispose(true); + this.Dispose(true); } /// diff --git a/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPageEditorAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPageEditorAttribute.cs index 2a727d4ad0f..9e06b4416c1 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPageEditorAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPageEditorAttribute.cs @@ -18,7 +18,7 @@ public override bool IsAuthorized(AuthFilterContext context) { Requires.NotNull("context", context); - return PagePermissionsAttributesHelper.HasTabPermission("EDIT,CONTENT,MANAGE") || IsModuleAdmin(((DnnApiController)context.ActionContext.ControllerContext.Controller).PortalSettings); + return PagePermissionsAttributesHelper.HasTabPermission("EDIT,CONTENT,MANAGE") || this.IsModuleAdmin(((DnnApiController)context.ActionContext.ControllerContext.Controller).PortalSettings); } diff --git a/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPagePermissionAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPagePermissionAttribute.cs index b92ef3b6731..fa24377da01 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPagePermissionAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Internal/DnnPagePermissionAttribute.cs @@ -14,18 +14,18 @@ public string PermissionKey { get { - return permissionKey; + return this.permissionKey; } set { - permissionKey = value; + this.permissionKey = value; } } public override bool IsAuthorized(AuthFilterContext context) { Requires.NotNull("context", context); - return PagePermissionsAttributesHelper.HasTabPermission(PermissionKey); + return PagePermissionsAttributesHelper.HasTabPermission(this.PermissionKey); } } } diff --git a/DNN Platform/DotNetNuke.Web/Api/Internal/ServicesRoutingManager.cs b/DNN Platform/DotNetNuke.Web/Api/Internal/ServicesRoutingManager.cs index d28919f3ee6..f97c16d4ba0 100644 --- a/DNN Platform/DotNetNuke.Web/Api/Internal/ServicesRoutingManager.cs +++ b/DNN Platform/DotNetNuke.Web/Api/Internal/ServicesRoutingManager.cs @@ -35,9 +35,9 @@ public ServicesRoutingManager() : this(RouteTable.Routes) internal ServicesRoutingManager(RouteCollection routes) { - _routes = routes; - _portalAliasRouteManager = new PortalAliasRouteManager(); - TypeLocator = new TypeLocator(); + this._routes = routes; + this._portalAliasRouteManager = new PortalAliasRouteManager(); + this.TypeLocator = new TypeLocator(); } internal ITypeLocator TypeLocator { get; set; } @@ -57,14 +57,14 @@ public IList MapHttpRoute(string moduleFolderName, string routeName, stri url = url.Trim('/', '\\'); - IEnumerable prefixCounts = _portalAliasRouteManager.GetRoutePrefixCounts(); + IEnumerable prefixCounts = this._portalAliasRouteManager.GetRoutePrefixCounts(); var routes = new List(); foreach (int count in prefixCounts) { - string fullRouteName = _portalAliasRouteManager.GetRouteName(moduleFolderName, routeName, count); - string routeUrl = _portalAliasRouteManager.GetRouteUrl(moduleFolderName, url, count); - Route route = MapHttpRouteWithNamespace(fullRouteName, routeUrl, defaults, constraints, namespaces); + string fullRouteName = this._portalAliasRouteManager.GetRouteName(moduleFolderName, routeName, count); + string routeUrl = this._portalAliasRouteManager.GetRouteUrl(moduleFolderName, url, count); + Route route = this.MapHttpRouteWithNamespace(fullRouteName, routeUrl, defaults, constraints, namespaces); routes.Add(route); if (Logger.IsTraceEnabled) Logger.Trace("Mapping route: " + fullRouteName + " @ " + routeUrl); @@ -72,7 +72,7 @@ public IList MapHttpRoute(string moduleFolderName, string routeName, stri //compatible with old service path: DesktopModules/{namespace}/API/{controller}/{action}. var oldRouteName = $"{fullRouteName}-old"; var oldRouteUrl = PortalAliasRouteManager.GetOldRouteUrl(moduleFolderName, url, count); - var oldRoute = MapHttpRouteWithNamespace(oldRouteName, oldRouteUrl, defaults, constraints, namespaces); + var oldRoute = this.MapHttpRouteWithNamespace(oldRouteName, oldRouteUrl, defaults, constraints, namespaces); routes.Add(oldRoute); if (Logger.IsTraceEnabled) Logger.Trace("Mapping route: " + oldRouteName + " @ " + oldRouteUrl); @@ -83,12 +83,12 @@ public IList MapHttpRoute(string moduleFolderName, string routeName, stri public IList MapHttpRoute(string moduleFolderName, string routeName, string url, object defaults, string[] namespaces) { - return MapHttpRoute(moduleFolderName, routeName, url, defaults, null, namespaces); + return this.MapHttpRoute(moduleFolderName, routeName, url, defaults, null, namespaces); } public IList MapHttpRoute(string moduleFolderName, string routeName, string url, string[] namespaces) { - return MapHttpRoute(moduleFolderName, routeName, url, null, null, namespaces); + return this.MapHttpRoute(moduleFolderName, routeName, url, null, null, namespaces); } #endregion @@ -133,12 +133,12 @@ public void RegisterRoutes() GlobalConfiguration.Configuration.AddTabAndModuleInfoProvider(new StandardTabAndModuleInfoProvider()); } - using (_routes.GetWriteLock()) + using (this._routes.GetWriteLock()) { - _routes.Clear(); - LocateServicesAndMapRoutes(); + this._routes.Clear(); + this.LocateServicesAndMapRoutes(); } - Logger.TraceFormat("Registered a total of {0} routes", _routes.Count); + Logger.TraceFormat("Registered a total of {0} routes", this._routes.Count); } private static void RegisterAuthenticationHandlers() @@ -207,11 +207,11 @@ private static bool IsTracingEnabled() private void LocateServicesAndMapRoutes() { - RegisterSystemRoutes(); - ClearCachedRouteData(); + this.RegisterSystemRoutes(); + this.ClearCachedRouteData(); - _moduleUsage.Clear(); - foreach (IServiceRouteMapper routeMapper in GetServiceRouteMappers()) + this._moduleUsage.Clear(); + foreach (IServiceRouteMapper routeMapper in this.GetServiceRouteMappers()) { try { @@ -227,7 +227,7 @@ private void LocateServicesAndMapRoutes() private void ClearCachedRouteData() { - _portalAliasRouteManager.ClearCachedData(); + this._portalAliasRouteManager.ClearCachedData(); } private void RegisterSystemRoutes() @@ -237,7 +237,7 @@ private void RegisterSystemRoutes() private IEnumerable GetServiceRouteMappers() { - IEnumerable types = GetAllServiceRouteMapperTypes(); + IEnumerable types = this.GetAllServiceRouteMapperTypes(); foreach (Type routeMapperType in types) { @@ -262,7 +262,7 @@ private IEnumerable GetServiceRouteMappers() private IEnumerable GetAllServiceRouteMapperTypes() { - return TypeLocator.GetAllMatchingTypes(IsValidServiceRouteMapper); + return this.TypeLocator.GetAllMatchingTypes(IsValidServiceRouteMapper); } internal static bool IsValidServiceRouteMapper(Type t) @@ -272,7 +272,7 @@ internal static bool IsValidServiceRouteMapper(Type t) private Route MapHttpRouteWithNamespace(string name, string url, object defaults, object constraints, string[] namespaces) { - Route route = _routes.MapHttpRoute(name, url, defaults, constraints); + Route route = this._routes.MapHttpRoute(name, url, defaults, constraints); if(route.DataTokens == null) { diff --git a/DNN Platform/DotNetNuke.Web/Api/PortalAliasRouteManager.cs b/DNN Platform/DotNetNuke.Web/Api/PortalAliasRouteManager.cs index 5d3fd5e8e4e..8e2bdfc4ed5 100644 --- a/DNN Platform/DotNetNuke.Web/Api/PortalAliasRouteManager.cs +++ b/DNN Platform/DotNetNuke.Web/Api/PortalAliasRouteManager.cs @@ -38,7 +38,7 @@ public string GetRouteName(string moduleFolderName, string routeName, PortalAlia alias = alias.Remove(i, appPath.Length); } } - return GetRouteName(moduleFolderName, routeName, CalcAliasPrefixCount(alias)); + return this.GetRouteName(moduleFolderName, routeName, CalcAliasPrefixCount(alias)); } private string GeneratePrefixString(int count) @@ -82,7 +82,7 @@ public string GetRouteUrl(string moduleFolderName, string url, int count) Requires.NotNegative("count", count); Requires.NotNullOrEmpty("moduleFolderName", moduleFolderName); - return string.Format("{0}API/{1}/{2}", GeneratePrefixString(count), moduleFolderName, url); + return string.Format("{0}API/{1}/{2}", this.GeneratePrefixString(count), moduleFolderName, url); } //TODO: this method need remove after drop use old api format. @@ -97,12 +97,12 @@ public static string GetOldRouteUrl(string moduleFolderName, string url, int cou public void ClearCachedData() { - _prefixCounts = null; + this._prefixCounts = null; } public IEnumerable GetRoutePrefixCounts() { - if (_prefixCounts == null) + if (this._prefixCounts == null) { //prefixCounts are required for each route that is mapped but they only change //when a new portal is added so cache them until that time @@ -117,7 +117,7 @@ public IEnumerable GetRoutePrefixCounts() { IEnumerable aliases = PortalAliasController.Instance.GetPortalAliasesByPortalId(portal.PortalID).Select(x => x.HTTPAlias); - aliases = StripApplicationPath(aliases); + aliases = this.StripApplicationPath(aliases); foreach (string alias in aliases) { @@ -130,10 +130,10 @@ public IEnumerable GetRoutePrefixCounts() } } IEnumerable segmentCounts = segmentCounts1; - _prefixCounts = segmentCounts.OrderByDescending(x => x).ToList(); + this._prefixCounts = segmentCounts.OrderByDescending(x => x).ToList(); } - return _prefixCounts; + return this._prefixCounts; } private static int CalcAliasPrefixCount(string alias) diff --git a/DNN Platform/DotNetNuke.Web/Api/StringPassThroughMediaTypeFormatter.cs b/DNN Platform/DotNetNuke.Web/Api/StringPassThroughMediaTypeFormatter.cs index 103903238b5..aebf5a0fdfe 100644 --- a/DNN Platform/DotNetNuke.Web/Api/StringPassThroughMediaTypeFormatter.cs +++ b/DNN Platform/DotNetNuke.Web/Api/StringPassThroughMediaTypeFormatter.cs @@ -29,7 +29,7 @@ public StringPassThroughMediaTypeFormatter(IEnumerable mediaTypes) { foreach (var type in mediaTypes) { - SupportedMediaTypes.Add(new MediaTypeHeaderValue(type)); + this.SupportedMediaTypes.Add(new MediaTypeHeaderValue(type)); } } diff --git a/DNN Platform/DotNetNuke.Web/Api/SupportedModulesAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/SupportedModulesAttribute.cs index ea52e23931d..de8567c2d80 100644 --- a/DNN Platform/DotNetNuke.Web/Api/SupportedModulesAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/SupportedModulesAttribute.cs @@ -17,16 +17,16 @@ public class SupportedModulesAttribute : AuthorizeAttributeBase public SupportedModulesAttribute(string supportedModules) { - _supportedModules = supportedModules.Split(new[] { ',' }); + this._supportedModules = supportedModules.Split(new[] { ',' }); } public override bool IsAuthorized(AuthFilterContext context) { - var module = FindModuleInfo(context.ActionContext.Request); + var module = this.FindModuleInfo(context.ActionContext.Request); if (module != null) { - return ModuleIsSupported(module); + return this.ModuleIsSupported(module); } return false; @@ -34,7 +34,7 @@ public override bool IsAuthorized(AuthFilterContext context) private bool ModuleIsSupported(ModuleInfo module) { - return _supportedModules.Contains(module.DesktopModule.ModuleName); + return this._supportedModules.Contains(module.DesktopModule.ModuleName); } protected virtual ModuleInfo FindModuleInfo(HttpRequestMessage request) diff --git a/DNN Platform/DotNetNuke.Web/Api/TraceWriter.cs b/DNN Platform/DotNetNuke.Web/Api/TraceWriter.cs index 500b34c63f9..b7d6cb82be1 100644 --- a/DNN Platform/DotNetNuke.Web/Api/TraceWriter.cs +++ b/DNN Platform/DotNetNuke.Web/Api/TraceWriter.cs @@ -17,19 +17,19 @@ internal sealed class TraceWriter : ITraceWriter public TraceWriter(bool isTracingEnabled) { - _enabled = isTracingEnabled; + this._enabled = isTracingEnabled; } public void Trace(HttpRequestMessage request, string category, TraceLevel level, Action traceAction) { - if(!_enabled || level == TraceLevel.Off) + if(!this._enabled || level == TraceLevel.Off) { return; } var rec = new TraceRecord(request, category, level); traceAction(rec); - Log(rec); + this.Log(rec); } private void Log(TraceRecord rec) diff --git a/DNN Platform/DotNetNuke.Web/Api/ValidateAntiForgeryTokenAttribute.cs b/DNN Platform/DotNetNuke.Web/Api/ValidateAntiForgeryTokenAttribute.cs index 87aca01a1c4..9024d612a98 100644 --- a/DNN Platform/DotNetNuke.Web/Api/ValidateAntiForgeryTokenAttribute.cs +++ b/DNN Platform/DotNetNuke.Web/Api/ValidateAntiForgeryTokenAttribute.cs @@ -38,7 +38,7 @@ public override void OnActionExecuting(HttpActionContext actionContext) { if (!BypassTokenCheck()) { - var result = IsAuthorized(actionContext); + var result = this.IsAuthorized(actionContext); if (!result.Item1) { throw new UnauthorizedAccessException(result.Item2); diff --git a/DNN Platform/DotNetNuke.Web/Api/WebApiException.cs b/DNN Platform/DotNetNuke.Web/Api/WebApiException.cs index ff61470e9af..6095857fe5e 100644 --- a/DNN Platform/DotNetNuke.Web/Api/WebApiException.cs +++ b/DNN Platform/DotNetNuke.Web/Api/WebApiException.cs @@ -23,13 +23,13 @@ public class WebApiException : Exception public WebApiException(Exception innerException, HttpResponseMessage result) : base(innerException.Message, innerException) { - Result = result; + this.Result = result; } public WebApiException(Exception innerException, HttpResponseMessage result, string body) : this(innerException, result) { - Body = body; + this.Body = body; } /// @@ -44,7 +44,7 @@ public WebApiException(Exception innerException, HttpResponseMessage result, str public dynamic BodyAsJson() { - return JsonConvert.DeserializeObject(Body); + return JsonConvert.DeserializeObject(this.Body); } } } diff --git a/DNN Platform/DotNetNuke.Web/Common/DotNetNukeHttpApplication.cs b/DNN Platform/DotNetNuke.Web/Common/DotNetNukeHttpApplication.cs index e83cebb67e8..4c5c2810f4e 100644 --- a/DNN Platform/DotNetNuke.Web/Common/DotNetNukeHttpApplication.cs +++ b/DNN Platform/DotNetNuke.Web/Common/DotNetNukeHttpApplication.cs @@ -201,7 +201,7 @@ private void Application_BeginRequest(object sender, EventArgs e) return; } - if (IsInstallInProgress(app)) + if (this.IsInstallInProgress(app)) { return; } diff --git a/DNN Platform/DotNetNuke.Web/Common/LazyServiceProvider.cs b/DNN Platform/DotNetNuke.Web/Common/LazyServiceProvider.cs index 3b2c47ca81e..dacbf1e6374 100644 --- a/DNN Platform/DotNetNuke.Web/Common/LazyServiceProvider.cs +++ b/DNN Platform/DotNetNuke.Web/Common/LazyServiceProvider.cs @@ -12,15 +12,15 @@ public class LazyServiceProvider : IServiceProvider public object GetService(Type serviceType) { - if (_serviceProvider is null) + if (this._serviceProvider is null) throw new Exception("Cannot resolve services until the service provider is built."); - return _serviceProvider.GetService(serviceType); + return this._serviceProvider.GetService(serviceType); } internal void SetProvider(IServiceProvider serviceProvider) { - _serviceProvider = serviceProvider; + this._serviceProvider = serviceProvider; } } } diff --git a/DNN Platform/DotNetNuke.Web/Components/Controllers/ControlBarController.cs b/DNN Platform/DotNetNuke.Web/Components/Controllers/ControlBarController.cs index a60e6c3bc62..0194e16c1c2 100644 --- a/DNN Platform/DotNetNuke.Web/Components/Controllers/ControlBarController.cs +++ b/DNN Platform/DotNetNuke.Web/Components/Controllers/ControlBarController.cs @@ -25,7 +25,7 @@ public class ControlBarController: ServiceLocator> GetCategoryDesktopModules(int portalId, string category, string searchTerm = "") { @@ -43,7 +43,7 @@ public IEnumerable> GetBookmarkedD { var formattedSearchTerm = String.IsNullOrEmpty(searchTerm) ? string.Empty : searchTerm.ToLower(CultureInfo.InvariantCulture); - IEnumerable> bookmarkedModules = GetBookmarkedModules(PortalSettings.Current.PortalId, userId) + IEnumerable> bookmarkedModules = this.GetBookmarkedModules(PortalSettings.Current.PortalId, userId) .Where(kvp => kvp.Key.ToLower(CultureInfo.InvariantCulture).Contains(formattedSearchTerm)); return bookmarkedModules; @@ -54,7 +54,7 @@ public void SaveBookMark(int portalId, int userId, string bookmarkTitle, string var ensuredBookmarkValue = bookmarkValue; if (bookmarkTitle == BookmarkModulesTitle) { - ensuredBookmarkValue = EnsureBookmarkValue(portalId, ensuredBookmarkValue); + ensuredBookmarkValue = this.EnsureBookmarkValue(portalId, ensuredBookmarkValue); } var personalizationController = new DotNetNuke.Services.Personalization.PersonalizationController(); @@ -78,7 +78,7 @@ public string GetBookmarkCategory(int portalId) public UpgradeIndicatorViewModel GetUpgradeIndicator(Version version, bool isLocal, bool isSecureConnection) { var imageUrl = Upgrade.UpgradeIndicator(version, isLocal, isSecureConnection); - return !String.IsNullOrEmpty(imageUrl) ? GetDefaultUpgradeIndicator(imageUrl) : null; + return !String.IsNullOrEmpty(imageUrl) ? this.GetDefaultUpgradeIndicator(imageUrl) : null; } public string GetControlBarLogoURL() @@ -88,8 +88,8 @@ public string GetControlBarLogoURL() public IEnumerable GetCustomMenuItems() { - var menuItemsExtensionPoints = _mef.GetUserControlExtensionPoints("ControlBar", "CustomMenuItems"); - return menuItemsExtensionPoints.Select(GetMenuItemFromExtensionPoint); + var menuItemsExtensionPoints = this._mef.GetUserControlExtensionPoints("ControlBar", "CustomMenuItems"); + return menuItemsExtensionPoints.Select(this.GetMenuItemFromExtensionPoint); } private UpgradeIndicatorViewModel GetDefaultUpgradeIndicator(string imageUrl) @@ -122,7 +122,7 @@ private MenuItemViewModel GetMenuItemFromExtensionPoint(IUserControlExtensionPoi private string EnsureBookmarkValue(int portalId, string bookmarkValue) { - var bookmarkCategoryModules = GetCategoryDesktopModules(portalId, GetBookmarkCategory(portalId)); + var bookmarkCategoryModules = this.GetCategoryDesktopModules(portalId, this.GetBookmarkCategory(portalId)); var ensuredModules = bookmarkValue.Split(',').Where(desktopModuleId => bookmarkCategoryModules.All(m => m.Value.DesktopModuleID.ToString(CultureInfo.InvariantCulture) != desktopModuleId)).ToList(); return String.Join(",", ensuredModules.Distinct()); } diff --git a/DNN Platform/DotNetNuke.Web/ConfigSection/MessageHandlersCollection.cs b/DNN Platform/DotNetNuke.Web/ConfigSection/MessageHandlersCollection.cs index 5077c8fdaa0..adcd7357944 100644 --- a/DNN Platform/DotNetNuke.Web/ConfigSection/MessageHandlersCollection.cs +++ b/DNN Platform/DotNetNuke.Web/ConfigSection/MessageHandlersCollection.cs @@ -12,15 +12,15 @@ public MessageHandlerEntry this[int index] { get { - return BaseGet(index) as MessageHandlerEntry; + return this.BaseGet(index) as MessageHandlerEntry; } set { - if (BaseGet(index) != null) + if (this.BaseGet(index) != null) { - BaseRemoveAt(index); + this.BaseRemoveAt(index); } - BaseAdd(index, value); + this.BaseAdd(index, value); } } diff --git a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj index 04a05b4dad4..71b441306e6 100644 --- a/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj +++ b/DNN Platform/DotNetNuke.Web/DotNetNuke.Web.csproj @@ -412,6 +412,9 @@ + + stylecop.json + Designer @@ -433,6 +436,10 @@ DotNetNuke.ModulePipeline + + + + diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/ContentWorkflowServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/ContentWorkflowServiceController.cs index ad9b457495e..486e8d8fced 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/ContentWorkflowServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/ContentWorkflowServiceController.cs @@ -26,7 +26,7 @@ public class ContentWorkflowServiceController : DnnApiController #region Constructor public ContentWorkflowServiceController() { - _workflowEngine = WorkflowEngine.Instance; + this._workflowEngine = WorkflowEngine.Instance; } #endregion @@ -42,7 +42,7 @@ public HttpResponseMessage Reject(NotificationDTO postData) { if (string.IsNullOrEmpty(notification.Context)) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } string[] parameters = notification.Context.Split(':'); @@ -52,11 +52,11 @@ public HttpResponseMessage Reject(NotificationDTO postData) ContentItemId = int.Parse(parameters[0]), CurrentStateId = int.Parse(parameters[2]), Message = new StateTransactionMessage (), - UserId = UserInfo.UserID + UserId = this.UserInfo.UserID }; - _workflowEngine.DiscardState(stateTransiction); + this._workflowEngine.DiscardState(stateTransiction); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } } catch (Exception exc) @@ -64,7 +64,7 @@ public HttpResponseMessage Reject(NotificationDTO postData) Exceptions.LogException(exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); } [HttpPost] @@ -78,7 +78,7 @@ public HttpResponseMessage Approve(NotificationDTO postData) { if (string.IsNullOrEmpty(notification.Context)) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } string[] parameters = notification.Context.Split(':'); @@ -88,11 +88,11 @@ public HttpResponseMessage Approve(NotificationDTO postData) ContentItemId = int.Parse(parameters[0]), CurrentStateId = int.Parse(parameters[2]), Message = new StateTransactionMessage(), - UserId = UserInfo.UserID + UserId = this.UserInfo.UserID }; - _workflowEngine.CompleteState(stateTransiction); + this._workflowEngine.CompleteState(stateTransiction); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } } catch (Exception exc) @@ -100,7 +100,7 @@ public HttpResponseMessage Approve(NotificationDTO postData) Exceptions.LogException(exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); } @@ -117,7 +117,7 @@ public HttpResponseMessage Review(NotificationDTO postData) { if (string.IsNullOrEmpty(notification.Context)) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success"}); } var source = notification.Context; @@ -129,20 +129,20 @@ public HttpResponseMessage Review(NotificationDTO postData) parameters = parameters.ToList().Skip(1).ToArray(); } - var workflow = ContentWorkflowController.Instance.GetDefaultWorkflow(PortalSettings.PortalId); + var workflow = ContentWorkflowController.Instance.GetDefaultWorkflow(this.PortalSettings.PortalId); var workflowSource = ContentWorkflowController.Instance.GetWorkflowSource(workflow.WorkflowID, source); if (workflowSource == null) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } var sourceAction = Reflection.CreateInstance(Reflection.CreateType(workflowSource.SourceType)) as IContentWorkflowAction; if (sourceAction == null) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Link = sourceAction.GetAction(parameters) }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Link = sourceAction.GetAction(parameters) }); } } catch (Exception exc) @@ -150,7 +150,7 @@ public HttpResponseMessage Review(NotificationDTO postData) Exceptions.LogException(exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/ControlBarController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/ControlBarController.cs index 44976fbdcc3..07e29123648 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/ControlBarController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/ControlBarController.cs @@ -43,7 +43,7 @@ public class ControlBarController : DnnApiController public ControlBarController() { - Controller = Components.Controllers.ControlBarController.Instance; + this.Controller = Components.Controllers.ControlBarController.Instance; } public class ModuleDefDTO @@ -98,12 +98,12 @@ public HttpResponseMessage GetPortalDesktopModules(string category, int loadingS { category = "All"; } - var bookmarCategory = Controller.GetBookmarkCategory(PortalSettings.Current.PortalId); - var bookmarkedModules = Controller.GetBookmarkedDesktopModules(PortalSettings.Current.PortalId, UserController.Instance.GetCurrentUserInfo().UserID, searchTerm); - var bookmarkCategoryModules = Controller.GetCategoryDesktopModules(PortalSettings.PortalId, bookmarCategory, searchTerm); + var bookmarCategory = this.Controller.GetBookmarkCategory(PortalSettings.Current.PortalId); + var bookmarkedModules = this.Controller.GetBookmarkedDesktopModules(PortalSettings.Current.PortalId, UserController.Instance.GetCurrentUserInfo().UserID, searchTerm); + var bookmarkCategoryModules = this.Controller.GetCategoryDesktopModules(this.PortalSettings.PortalId, bookmarCategory, searchTerm); var filteredList = bookmarCategory == category ? bookmarkCategoryModules.OrderBy(m => m.Key).Union(bookmarkedModules.OrderBy(m => m.Key)).Distinct() - : Controller.GetCategoryDesktopModules(PortalSettings.PortalId, category, searchTerm).OrderBy(m => m.Key); + : this.Controller.GetCategoryDesktopModules(this.PortalSettings.PortalId, category, searchTerm).OrderBy(m => m.Key); if (!string.IsNullOrEmpty(excludeCategories)) { @@ -129,23 +129,23 @@ public HttpResponseMessage GetPortalDesktopModules(string category, int loadingS { ModuleID = kvp.Value.DesktopModuleID, ModuleName = kvp.Key, - ModuleImage = GetDeskTopModuleImage(kvp.Value.DesktopModuleID), + ModuleImage = this.GetDeskTopModuleImage(kvp.Value.DesktopModuleID), Bookmarked = bookmarkedModules.Any(m => m.Key == kvp.Key), ExistsInBookmarkCategory = bookmarkCategoryModules.Any(m => m.Key == kvp.Key) }).ToList(); - return Request.CreateResponse(HttpStatusCode.OK, result); + return this.Request.CreateResponse(HttpStatusCode.OK, result); } [HttpGet] [DnnPageEditor] public HttpResponseMessage GetPageList(string portal) { - var portalSettings = GetPortalSettings(portal); + var portalSettings = this.GetPortalSettings(portal); List tabList = null; - if (PortalSettings.PortalId == portalSettings.PortalId) + if (this.PortalSettings.PortalId == portalSettings.PortalId) { - tabList = TabController.GetPortalTabs(portalSettings.PortalId, PortalSettings.ActiveTab.TabID, false, string.Empty, true, false, false, false, true); + tabList = TabController.GetPortalTabs(portalSettings.PortalId, this.PortalSettings.ActiveTab.TabID, false, string.Empty, true, false, false, false, true); } else { @@ -164,20 +164,20 @@ where portals.Any(x => x.PortalID == PortalSettings.Current.PortalId) else { // try to get pages not allowed - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } } List result = new List(); foreach (var tab in tabList) { - if (tab.PortalID == PortalSettings.PortalId || (GetModules(tab.TabID).Count > 0 && tab.TabID != portalSettings.AdminTabId && tab.ParentId != portalSettings.AdminTabId)) + if (tab.PortalID == this.PortalSettings.PortalId || (this.GetModules(tab.TabID).Count > 0 && tab.TabID != portalSettings.AdminTabId && tab.ParentId != portalSettings.AdminTabId)) { result.Add(new PageDefDTO { TabID = tab.TabID, IndentedTabName = tab.IndentedTabName }); } } - return Request.CreateResponse(HttpStatusCode.OK, result); + return this.Request.CreateResponse(HttpStatusCode.OK, result); } [HttpGet] @@ -191,18 +191,18 @@ public HttpResponseMessage GetTabModules(string tab) var result = new List(); if (tabID > 0) { - var pageModules = GetModules(tabID); + var pageModules = this.GetModules(tabID); Dictionary resultDict = pageModules.ToDictionary(module => module.ModuleID, module => module.ModuleTitle); result.AddRange(from kvp in resultDict - let imageUrl = GetTabModuleImage(tabID, kvp.Key) + let imageUrl = this.GetTabModuleImage(tabID, kvp.Key) select new ModuleDefDTO { ModuleID = kvp.Key, ModuleName = kvp.Value, ModuleImage = imageUrl } ); } - return Request.CreateResponse(HttpStatusCode.OK, result); + return this.Request.CreateResponse(HttpStatusCode.OK, result); } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } private IList GetModules(int tabID) @@ -211,7 +211,7 @@ private IList GetModules(int tabID) var tabModules = ModuleController.Instance.GetTabModules(tabID); var pageModules = isRemote - ? tabModules.Values.Where(m => ModuleSupportsSharing(m) && !m.IsDeleted).ToList() + ? tabModules.Values.Where(m => this.ModuleSupportsSharing(m) && !m.IsDeleted).ToList() : tabModules.Values.Where(m => ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", m) && !m.IsDeleted).ToList(); return pageModules; @@ -224,13 +224,13 @@ private IList GetModules(int tabID) public HttpResponseMessage CopyPermissionsToChildren() { if (TabPermissionController.CanManagePage() && UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators") - && ActiveTabHasChildren() && !PortalSettings.ActiveTab.IsSuperTab) + && this.ActiveTabHasChildren() && !this.PortalSettings.ActiveTab.IsSuperTab) { - TabController.CopyPermissionsToChildren(PortalSettings.ActiveTab, PortalSettings.ActiveTab.TabPermissions); - return Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); + TabController.CopyPermissionsToChildren(this.PortalSettings.ActiveTab, this.PortalSettings.ActiveTab.TabPermissions); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] @@ -238,7 +238,7 @@ public HttpResponseMessage CopyPermissionsToChildren() [DnnPageEditor] public HttpResponseMessage AddModule(AddModuleDTO dto) { - if (TabPermissionController.CanAddContentToPage() && CanAddModuleToPage()) + if (TabPermissionController.CanAddContentToPage() && this.CanAddModuleToPage()) { int permissionType; try @@ -259,7 +259,7 @@ public HttpResponseMessage AddModule(AddModuleDTO dto) { sortID = int.Parse(dto.Sort); if (sortID >= 0) - positionID = GetPaneModuleOrder(dto.Pane, sortID); + positionID = this.GetPaneModuleOrder(dto.Pane, sortID); } catch (Exception exc) { @@ -314,16 +314,16 @@ public HttpResponseMessage AddModule(AddModuleDTO dto) if ((pageID > -1)) { - tabModuleId = DoAddExistingModule(moduleLstID, pageID, dto.Pane, positionID, "", dto.CopyModule == "true"); + tabModuleId = this.DoAddExistingModule(moduleLstID, pageID, dto.Pane, positionID, "", dto.CopyModule == "true"); } } else { - tabModuleId = DoAddNewModule("", moduleLstID, dto.Pane, positionID, permissionType, ""); + tabModuleId = this.DoAddNewModule("", moduleLstID, dto.Pane, positionID, permissionType, ""); } } - return Request.CreateResponse(HttpStatusCode.OK, new { TabModuleID = tabModuleId }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { TabModuleID = tabModuleId }); } catch (Exception ex) { @@ -331,7 +331,7 @@ public HttpResponseMessage AddModule(AddModuleDTO dto) } } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] @@ -343,10 +343,10 @@ public HttpResponseMessage ClearHostCache() { DataCache.ClearCache(); ClientResourceManager.ClearCache(); - return Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] @@ -360,10 +360,10 @@ public HttpResponseMessage RecycleApplicationPool() log.AddProperty("Message", "UserRestart"); LogController.Instance.AddLog(log); Config.Touch(); - return Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] @@ -382,7 +382,7 @@ public HttpResponseMessage SwitchSite(SwitchSiteDTO dto) if ((portalAliases.Count > 0 && (portalAliases[0] != null))) { - return Request.CreateResponse(HttpStatusCode.OK, new { RedirectURL = Globals.AddHTTP(((PortalAliasInfo)portalAliases[0]).HTTPAlias) }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { RedirectURL = Globals.AddHTTP(((PortalAliasInfo)portalAliases[0]).HTTPAlias) }); } } } @@ -396,7 +396,7 @@ public HttpResponseMessage SwitchSite(SwitchSiteDTO dto) } } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] @@ -405,16 +405,16 @@ public HttpResponseMessage SwitchLanguage(SwitchLanguageDTO dto) { try { - if (PortalSettings.AllowUserUICulture && PortalSettings.ContentLocalizationEnabled) + if (this.PortalSettings.AllowUserUICulture && this.PortalSettings.ContentLocalizationEnabled) { if ((!string.IsNullOrEmpty(dto.Language))) { var personalizationController = new DotNetNuke.Services.Personalization.PersonalizationController(); - var personalization = personalizationController.LoadProfile(UserInfo.UserID, PortalSettings.PortalId); + var personalization = personalizationController.LoadProfile(this.UserInfo.UserID, this.PortalSettings.PortalId); personalization.Profile["Usability:UICulture"] = dto.Language; personalization.IsModified = true; personalizationController.SaveProfile(personalization); - return Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); } } @@ -428,7 +428,7 @@ public HttpResponseMessage SwitchLanguage(SwitchLanguageDTO dto) Exceptions.LogException(ex); } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] @@ -439,12 +439,12 @@ public HttpResponseMessage ToggleUserMode(UserModeDTO userMode) if (userMode == null) userMode = new UserModeDTO { UserMode = "VIEW" }; - ToggleUserMode(userMode.UserMode); - var response = Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); + this.ToggleUserMode(userMode.UserMode); + var response = this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); if (userMode.UserMode.Equals("VIEW", StringComparison.InvariantCultureIgnoreCase)) { - var cookie = Request.Headers.GetCookies("StayInEditMode").FirstOrDefault(); + var cookie = this.Request.Headers.GetCookies("StayInEditMode").FirstOrDefault(); if (cookie != null && !string.IsNullOrEmpty(cookie["StayInEditMode"].Value)) { var expireCookie = new CookieHeaderValue("StayInEditMode", ""); @@ -470,9 +470,9 @@ public HttpResponseMessage SaveBookmark(BookmarkDTO bookmark) { if (string.IsNullOrEmpty(bookmark.Bookmark)) bookmark.Bookmark = string.Empty; - Controller.SaveBookMark(PortalSettings.PortalId, UserInfo.UserID, bookmark.Title, bookmark.Bookmark); + this.Controller.SaveBookMark(this.PortalSettings.PortalId, this.UserInfo.UserID, bookmark.Title, bookmark.Bookmark); - return Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }); } public class LockingDTO @@ -486,7 +486,7 @@ public class LockingDTO public HttpResponseMessage LockInstance(LockingDTO lockingRequest) { HostController.Instance.Update("IsLocked", lockingRequest.Lock.ToString(), true); - return Request.CreateResponse(HttpStatusCode.OK); + return this.Request.CreateResponse(HttpStatusCode.OK); } [HttpPost] @@ -494,15 +494,15 @@ public HttpResponseMessage LockInstance(LockingDTO lockingRequest) [RequireHost] public HttpResponseMessage LockSite(LockingDTO lockingRequest) { - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "IsLocked", lockingRequest.Lock.ToString(), true); - return Request.CreateResponse(HttpStatusCode.OK); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "IsLocked", lockingRequest.Lock.ToString(), true); + return this.Request.CreateResponse(HttpStatusCode.OK); } private void ToggleUserMode(string mode) { var personalizationController = new DotNetNuke.Services.Personalization.PersonalizationController(); - var personalization = personalizationController.LoadProfile(UserInfo.UserID, PortalSettings.PortalId); - personalization.Profile["Usability:UserMode" + PortalSettings.PortalId] = mode.ToUpper(); + var personalization = personalizationController.LoadProfile(this.UserInfo.UserID, this.PortalSettings.PortalId); + personalization.Profile["Usability:UserMode" + this.PortalSettings.PortalId] = mode.ToUpper(); personalization.IsModified = true; personalizationController.SaveProfile(personalization); } @@ -517,7 +517,7 @@ private PortalSettings GetPortalSettings(string portal) if (!string.IsNullOrEmpty(portal)) { var selectedPortalId = int.Parse(portal); - if (PortalSettings.PortalId != selectedPortalId) + if (this.PortalSettings.PortalId != selectedPortalId) { portalSettings = new PortalSettings(selectedPortalId); } @@ -586,7 +586,7 @@ public bool CanAddModuleToPage() private bool ActiveTabHasChildren() { - var children = TabController.GetTabsByParent(PortalSettings.ActiveTab.TabID, PortalSettings.ActiveTab.PortalID); + var children = TabController.GetTabsByParent(this.PortalSettings.ActiveTab.TabID, this.PortalSettings.ActiveTab.PortalID); if (((children == null) || children.Count < 1)) { @@ -710,7 +710,7 @@ private int DoAddExistingModule(int moduleId, int tabId, string paneName, int po //Ensure the Portal Admin has View rights var permissionController = new PermissionController(); ArrayList arrSystemModuleViewPermissions = permissionController.GetPermissionByCodeAndKey("SYSTEM_MODULE_DEFINITION", "VIEW"); - AddModulePermission(newModule, + this.AddModulePermission(newModule, (PermissionInfo)arrSystemModuleViewPermissions[0], PortalSettings.Current.AdministratorRoleId, Null.NullInteger, @@ -872,14 +872,14 @@ private int DoAddNewModule(string title, int desktopModuleId, string paneName, i private string GetModuleName(string moduleName) { - if (_nameDics == null) + if (this._nameDics == null) { - _nameDics = new Dictionary {{"SearchCrawlerAdmin", "SearchCrawler Admin"}, + this._nameDics = new Dictionary {{"SearchCrawlerAdmin", "SearchCrawler Admin"}, {"SearchCrawlerInput", "SearchCrawler Input"}, {"SearchCrawlerResults", "SearchCrawler Results"}}; } - return _nameDics.ContainsKey(moduleName) ? _nameDics[moduleName] : moduleName; + return this._nameDics.ContainsKey(moduleName) ? this._nameDics[moduleName] : moduleName; } } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/CountryRegionController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/CountryRegionController.cs index 3e3083e3761..6a14b1a42db 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/CountryRegionController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/CountryRegionController.cs @@ -25,7 +25,7 @@ public HttpResponseMessage Countries() { var searchString = (HttpContext.Current.Request.Params["SearchString"] ?? "").NormalizeString(); var countries = CachedCountryList.GetCountryList(Thread.CurrentThread.CurrentCulture.Name); - return Request.CreateResponse(HttpStatusCode.OK, countries.Values.Where( + return this.Request.CreateResponse(HttpStatusCode.OK, countries.Values.Where( x => x.NormalizedFullName.IndexOf(searchString, StringComparison.CurrentCulture) > -1).OrderBy(x => x.NormalizedFullName)); } @@ -47,7 +47,7 @@ public HttpResponseMessage Regions(int country) Value = r.EntryID.ToString() }); } - return Request.CreateResponse(HttpStatusCode.OK, res.OrderBy(r => r.Text)); + return this.Request.CreateResponse(HttpStatusCode.OK, res.OrderBy(r => r.Text)); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/EventLogServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/EventLogServiceController.cs index 37d1376e834..802bf439573 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/EventLogServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/EventLogServiceController.cs @@ -29,7 +29,7 @@ public HttpResponseMessage GetLogDetails(string guid) Guid logId; if (string.IsNullOrEmpty(guid) || !Guid.TryParse(guid, out logId)) { - return Request.CreateResponse(HttpStatusCode.BadRequest); + return this.Request.CreateResponse(HttpStatusCode.BadRequest); } try @@ -38,19 +38,19 @@ public HttpResponseMessage GetLogDetails(string guid) logInfo = EventLogController.Instance.GetSingleLog(logInfo, LoggingProvider.ReturnType.LogInfoObjects) as LogInfo; if (logInfo == null) { - return Request.CreateResponse(HttpStatusCode.BadRequest); + return this.Request.CreateResponse(HttpStatusCode.BadRequest); } - return Request.CreateResponse(HttpStatusCode.OK, new + return this.Request.CreateResponse(HttpStatusCode.OK, new { Title = Localization.GetSafeJSString("CriticalError.Error", Localization.SharedResourceFile), - Content = GetPropertiesText(logInfo) + Content = this.GetPropertiesText(logInfo) }); } catch (Exception ex) { Logger.Error(ex); - return Request.CreateResponse(HttpStatusCode.BadRequest); + return this.Request.CreateResponse(HttpStatusCode.BadRequest); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs index 309077e67ca..5d38081a49c 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/FileUploadController.cs @@ -59,19 +59,19 @@ public class SavedFileDTO [HttpPost] public HttpResponseMessage LoadFiles(FolderItemDTO folderItem) { - int effectivePortalId = PortalSettings.PortalId; + int effectivePortalId = this.PortalSettings.PortalId; if (folderItem.FolderId <= 0) { - return Request.CreateResponse(HttpStatusCode.BadRequest); + return this.Request.CreateResponse(HttpStatusCode.BadRequest); } var folder = FolderManager.Instance.GetFolder(folderItem.FolderId); if (folder == null) { - return Request.CreateResponse(HttpStatusCode.BadRequest); + return this.Request.CreateResponse(HttpStatusCode.BadRequest); } int userId; @@ -91,7 +91,7 @@ public HttpResponseMessage LoadFiles(FolderItemDTO folderItem) var list = Globals.GetFileList(effectivePortalId, folderItem.FileFilter, !folderItem.Required, folder.FolderPath); var fileItems = list.OfType().ToList(); - return Request.CreateResponse(HttpStatusCode.OK, fileItems); + return this.Request.CreateResponse(HttpStatusCode.OK, fileItems); } [HttpGet] @@ -103,18 +103,18 @@ public HttpResponseMessage LoadImage(string fileId) if (int.TryParse(fileId, out file)) { var imageUrl = ShowImage(file); - return Request.CreateResponse(HttpStatusCode.OK, imageUrl); + return this.Request.CreateResponse(HttpStatusCode.OK, imageUrl); } } - return Request.CreateResponse(HttpStatusCode.InternalServerError); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError); } [HttpPost] [IFrameSupportedValidateAntiForgeryToken] public Task PostFile() { - HttpRequestMessage request = Request; + HttpRequestMessage request = this.Request; if (!request.Content.IsMimeMultipartContent()) { @@ -124,9 +124,9 @@ public Task PostFile() var provider = new MultipartMemoryStreamProvider(); // local references for use in closure - var portalSettings = PortalSettings; + var portalSettings = this.PortalSettings; var currentSynchronizationContext = SynchronizationContext.Current; - var userInfo = UserInfo; + var userInfo = this.UserInfo; var task = request.Content.ReadAsMultipartAsync(provider) .ContinueWith(o => { @@ -200,7 +200,7 @@ public Task PostFile() if (!string.IsNullOrEmpty(errorMessage)) { - return Request.CreateResponse( + return this.Request.CreateResponse( HttpStatusCode.BadRequest, new { @@ -209,7 +209,7 @@ public Task PostFile() }, mediaTypeFormatter, "text/plain"); } - return Request.CreateResponse(HttpStatusCode.OK, returnFileDto, mediaTypeFormatter, "text/plain"); + return this.Request.CreateResponse(HttpStatusCode.OK, returnFileDto, mediaTypeFormatter, "text/plain"); }); return task; @@ -536,7 +536,7 @@ private static FileUploadDto UploadFile( [AllowAnonymous] public Task UploadFromLocal() { - return UploadFromLocal(PortalSettings.PortalId); + return this.UploadFromLocal(this.PortalSettings.PortalId); } [HttpPost] @@ -544,7 +544,7 @@ public Task UploadFromLocal() [AllowAnonymous] public Task UploadFromLocal(int portalId) { - var request = Request; + var request = this.Request; FileUploadDto result = null; if (!request.Content.IsMimeMultipartContent()) { @@ -552,18 +552,18 @@ public Task UploadFromLocal(int portalId) } if (portalId > -1) { - if (!IsPortalIdValid(portalId)) throw new HttpResponseException(HttpStatusCode.Unauthorized); + if (!this.IsPortalIdValid(portalId)) throw new HttpResponseException(HttpStatusCode.Unauthorized); } else { - portalId = PortalSettings.PortalId; + portalId = this.PortalSettings.PortalId; } var provider = new MultipartMemoryStreamProvider(); // local references for use in closure var currentSynchronizationContext = SynchronizationContext.Current; - var userInfo = UserInfo; + var userInfo = this.UserInfo; var task = request.Content.ReadAsMultipartAsync(provider) .ContinueWith(o => { @@ -643,7 +643,7 @@ public Task UploadFromLocal(int portalId) * because IE9 with iframe-transport manages the response * as a file download */ - return Request.CreateResponse( + return this.Request.CreateResponse( HttpStatusCode.OK, result, mediaTypeFormatter, @@ -664,9 +664,9 @@ public HttpResponseMessage UploadFromUrl(UploadByUrlDto dto) var mediaTypeFormatter = new JsonMediaTypeFormatter(); mediaTypeFormatter.SupportedMediaTypes.Add(new MediaTypeHeaderValue("text/plain")); - if (VerifySafeUrl(dto.Url) == false) + if (this.VerifySafeUrl(dto.Url) == false) { - return Request.CreateResponse(HttpStatusCode.BadRequest); + return this.Request.CreateResponse(HttpStatusCode.BadRequest); } try @@ -680,7 +680,7 @@ public HttpResponseMessage UploadFromUrl(UploadByUrlDto dto) throw new Exception("No server response"); } - var fileName = GetFileName(response); + var fileName = this.GetFileName(response); if (string.IsNullOrEmpty(fileName)) { fileName = HttpUtility.UrlDecode(new Uri(dto.Url).Segments.Last()); @@ -689,21 +689,21 @@ public HttpResponseMessage UploadFromUrl(UploadByUrlDto dto) var portalId = dto.PortalId; if (portalId > -1) { - if (!IsPortalIdValid(portalId)) throw new HttpResponseException(HttpStatusCode.Unauthorized); + if (!this.IsPortalIdValid(portalId)) throw new HttpResponseException(HttpStatusCode.Unauthorized); } else { - portalId = PortalSettings.PortalId; + portalId = this.PortalSettings.PortalId; } - result = UploadFile(responseStream, portalId, UserInfo, dto.Folder.ValueOrEmpty(), dto.Filter.ValueOrEmpty(), + result = UploadFile(responseStream, portalId, this.UserInfo, dto.Folder.ValueOrEmpty(), dto.Filter.ValueOrEmpty(), fileName, dto.Overwrite, dto.IsHostMenu, dto.Unzip, dto.ValidationCode); /* Response Content Type cannot be application/json * because IE9 with iframe-transport manages the response * as a file download */ - return Request.CreateResponse( + return this.Request.CreateResponse( HttpStatusCode.OK, result, mediaTypeFormatter, @@ -715,7 +715,7 @@ public HttpResponseMessage UploadFromUrl(UploadByUrlDto dto) { Message = ex.Message }; - return Request.CreateResponse( + return this.Request.CreateResponse( HttpStatusCode.OK, result, mediaTypeFormatter, @@ -793,10 +793,10 @@ where portals.Any(x => x.PortalID == PortalSettings.Current.PortalId) private bool IsPortalIdValid(int portalId) { - if (UserInfo.IsSuperUser) return true; - if (PortalSettings.PortalId == portalId) return true; + if (this.UserInfo.IsSuperUser) return true; + if (this.PortalSettings.PortalId == portalId) return true; - var isAdminUser = PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); + var isAdminUser = PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); if (!isAdminUser) return false; var mygroup = GetMyPortalGroup(); diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/ItemListServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/ItemListServiceController.cs index 7a1f4dfe192..6e79954f707 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/ItemListServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/ItemListServiceController.cs @@ -74,10 +74,10 @@ public HttpResponseMessage GetPageDescendants(string parentId = null, int sortOr var response = new { Success = true, - Items = GetPageDescendantsInternal(portalId, parentId, sortOrder, searchText, + Items = this.GetPageDescendantsInternal(portalId, parentId, sortOrder, searchText, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles, disabledNotSelectable) }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -88,11 +88,11 @@ public HttpResponseMessage GetTreePathForPage(string itemId, int sortOrder = 0, var response = new { Success = true, - Tree = GetTreePathForPageInternal(portalId, itemId, sortOrder, false, + Tree = this.GetTreePathForPageInternal(portalId, itemId, sortOrder, false, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -103,11 +103,11 @@ public HttpResponseMessage SortPages(string treeAsJson, int sortOrder = 0, strin var response = new { Success = true, - Tree = string.IsNullOrEmpty(searchText) ? SortPagesInternal(portalId, treeAsJson, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles) - : SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), + Tree = string.IsNullOrEmpty(searchText) ? this.SortPagesInternal(portalId, treeAsJson, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles) + : this.SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -118,11 +118,11 @@ public HttpResponseMessage SortPagesInPortalGroup(string treeAsJson, int sortOrd var response = new { Success = true, - Tree = string.IsNullOrEmpty(searchText) ? SortPagesInPortalGroupInternal(treeAsJson, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles) - : SearchPagesInPortalGroupInternal(treeAsJson, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), + Tree = string.IsNullOrEmpty(searchText) ? this.SortPagesInPortalGroupInternal(treeAsJson, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles) + : this.SearchPagesInPortalGroupInternal(treeAsJson, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -133,10 +133,10 @@ public HttpResponseMessage GetPages(int sortOrder = 0, int portalId = -1, var response = new { Success = true, - Tree = GetPagesInternal(portalId, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles, disabledNotSelectable), + Tree = this.GetPagesInternal(portalId, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles, disabledNotSelectable), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -148,7 +148,7 @@ public HttpResponseMessage GetPagesInPortalGroup(int sortOrder = 0) Tree = GetPagesInPortalGroupInternal(sortOrder), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -159,11 +159,11 @@ public HttpResponseMessage SearchPages(string searchText, int sortOrder = 0, int var response = new { Success = true, - Tree = string.IsNullOrEmpty(searchText) ? GetPagesInternal(portalId, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles, false) - : SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), + Tree = string.IsNullOrEmpty(searchText) ? this.GetPagesInternal(portalId, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles, false) + : this.SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -174,9 +174,9 @@ public HttpResponseMessage GetPageDescendantsInPortalGroup(string parentId = nul var response = new { Success = true, - Items = GetPageDescendantsInPortalGroupInternal(parentId, sortOrder, searchText, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles) + Items = this.GetPageDescendantsInPortalGroupInternal(parentId, sortOrder, searchText, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles) }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -187,10 +187,10 @@ public HttpResponseMessage GetTreePathForPageInPortalGroup(string itemId, int so var response = new { Success = true, - Tree = GetTreePathForPageInternal(itemId, sortOrder, true, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), + Tree = this.GetTreePathForPageInternal(itemId, sortOrder, true, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -202,10 +202,10 @@ public HttpResponseMessage SearchPagesInPortalGroup(string searchText, int sortO { Success = true, Tree = string.IsNullOrEmpty(searchText) ? GetPagesInPortalGroupInternal(sortOrder) - : SearchPagesInPortalGroupInternal(searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), + : this.SearchPagesInPortalGroupInternal(searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } #endregion @@ -218,9 +218,9 @@ public HttpResponseMessage GetFolderDescendants(string parentId = null, int sort var response = new { Success = true, - Items = GetFolderDescendantsInternal(portalId, parentId, sortOrder, searchText, permission) + Items = this.GetFolderDescendantsInternal(portalId, parentId, sortOrder, searchText, permission) }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -229,10 +229,10 @@ public HttpResponseMessage GetFolders(int sortOrder = 0, string permission = nul var response = new { Success = true, - Tree = GetFoldersInternal(portalId, sortOrder, permission), + Tree = this.GetFoldersInternal(portalId, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -241,10 +241,10 @@ public HttpResponseMessage SortFolders(string treeAsJson, int sortOrder = 0, str var response = new { Success = true, - Tree = string.IsNullOrEmpty(searchText) ? SortFoldersInternal(portalId, treeAsJson, sortOrder, permission) : SearchFoldersInternal(portalId, searchText, sortOrder, permission), + Tree = string.IsNullOrEmpty(searchText) ? this.SortFoldersInternal(portalId, treeAsJson, sortOrder, permission) : this.SearchFoldersInternal(portalId, searchText, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -253,10 +253,10 @@ public HttpResponseMessage GetTreePathForFolder(string itemId, int sortOrder = 0 var response = new { Success = true, - Tree = GetTreePathForFolderInternal(itemId, sortOrder, permission), + Tree = this.GetTreePathForFolderInternal(itemId, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -265,10 +265,10 @@ public HttpResponseMessage SearchFolders(string searchText, int sortOrder = 0, s var response = new { Success = true, - Tree = string.IsNullOrEmpty(searchText) ? GetFoldersInternal(portalId, sortOrder, permission) : SearchFoldersInternal(portalId, searchText, sortOrder, permission), + Tree = string.IsNullOrEmpty(searchText) ? this.GetFoldersInternal(portalId, sortOrder, permission) : this.SearchFoldersInternal(portalId, searchText, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } #endregion @@ -281,10 +281,10 @@ public HttpResponseMessage GetFiles(int parentId, string filter, int sortOrder = var response = new { Success = true, - Tree = GetFilesInternal(portalId, parentId, filter, string.Empty, sortOrder, permission), + Tree = this.GetFilesInternal(portalId, parentId, filter, string.Empty, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -293,10 +293,10 @@ public HttpResponseMessage SortFiles(int parentId, string filter, int sortOrder var response = new { Success = true, - Tree = string.IsNullOrEmpty(searchText) ? SortFilesInternal(portalId, parentId, filter, sortOrder, permission) : GetFilesInternal(portalId, parentId, filter, searchText, sortOrder, permission), + Tree = string.IsNullOrEmpty(searchText) ? this.SortFilesInternal(portalId, parentId, filter, sortOrder, permission) : this.GetFilesInternal(portalId, parentId, filter, searchText, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } [HttpGet] @@ -305,10 +305,10 @@ public HttpResponseMessage SearchFiles(int parentId, string filter, string searc var response = new { Success = true, - Tree = GetFilesInternal(portalId, parentId, filter, searchText, sortOrder, permission), + Tree = this.GetFilesInternal(portalId, parentId, filter, searchText, sortOrder, permission), IgnoreRoot = true }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } #endregion @@ -323,16 +323,16 @@ private NTree GetPagesInternal(int portalId, int sortOrder, bool includ { if (portalId == -1) { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } - var tabs = GetPortalPages(portalId, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + var tabs = this.GetPortalPages(portalId, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); var sortedTree = new NTree { Data = new ItemDto { Key = RootKey } }; if (tabs == null) { return sortedTree; } - var filterTabs = FilterTabsByRole(tabs, roles, disabledNotSelectable); + var filterTabs = this.FilterTabsByRole(tabs, roles, disabledNotSelectable); var children = ApplySort(GetChildrenOf(tabs, Null.NullInteger, filterTabs), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); sortedTree.Children = children; return sortedTree; @@ -365,7 +365,7 @@ private IEnumerable GetPageDescendantsInPortalGroupInternal(string pare } if (!String.IsNullOrEmpty(searchText)) { - return SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles).Children.Select(node => node.Data); + return this.SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles).Children.Select(node => node.Data); } } else @@ -376,7 +376,7 @@ private IEnumerable GetPageDescendantsInPortalGroupInternal(string pare parentIdAsInt = -1; } } - return GetPageDescendantsInternal(portalId, parentIdAsInt, sortOrder, searchText, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + return this.GetPageDescendantsInternal(portalId, parentIdAsInt, sortOrder, searchText, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); } private IEnumerable GetPageDescendantsInternal(int portalId, string parentId, int sortOrder, @@ -385,7 +385,7 @@ private IEnumerable GetPageDescendantsInternal(int portalId, string par { int id; id = int.TryParse(parentId, out id) ? id : Null.NullInteger; - return GetPageDescendantsInternal(portalId, id, sortOrder, searchText, includeDisabled , includeAllTypes, includeActive, includeHostPages, roles, disabledNotSelectable); + return this.GetPageDescendantsInternal(portalId, id, sortOrder, searchText, includeDisabled , includeAllTypes, includeActive, includeHostPages, roles, disabledNotSelectable); } private IEnumerable GetPageDescendantsInternal(int portalId, int parentId, int sortOrder, @@ -396,11 +396,11 @@ private IEnumerable GetPageDescendantsInternal(int portalId, int parent if (portalId == -1) { - portalId = GetActivePortalId(parentId); + portalId = this.GetActivePortalId(parentId); } else { - if (!IsPortalIdValid(portalId)) return new List(); + if (!this.IsPortalIdValid(portalId)) return new List(); } Func searchFunc; @@ -415,7 +415,7 @@ private IEnumerable GetPageDescendantsInternal(int portalId, int parent if (portalId > -1) { - tabs = TabController.GetPortalTabs(portalId, (includeActive) ? Null.NullInteger : PortalSettings.ActiveTab.TabID, false, null, true, false, includeAllTypes, true, false) + tabs = TabController.GetPortalTabs(portalId, (includeActive) ? Null.NullInteger : this.PortalSettings.ActiveTab.TabID, false, null, true, false, includeAllTypes, true, false) .Where(tab => searchFunc(tab) && tab.ParentId == parentId && (includeDisabled || !tab.DisableLink) @@ -425,7 +425,7 @@ private IEnumerable GetPageDescendantsInternal(int portalId, int parent .OrderBy(tab => tab.TabOrder) .ToList(); - if (PortalSettings.UserInfo.IsSuperUser && includeHostPages) + if (this.PortalSettings.UserInfo.IsSuperUser && includeHostPages) { tabs.AddRange(TabController.Instance.GetTabsByPortal(-1).AsList() .Where(tab => searchFunc(tab) && tab.ParentId == parentId && !tab.IsDeleted && !tab.DisableLink && !tab.IsSystem) @@ -435,7 +435,7 @@ private IEnumerable GetPageDescendantsInternal(int portalId, int parent } else { - if (PortalSettings.UserInfo.IsSuperUser) + if (this.PortalSettings.UserInfo.IsSuperUser) { tabs = TabController.Instance.GetTabsByPortal(-1).AsList() @@ -449,7 +449,7 @@ private IEnumerable GetPageDescendantsInternal(int portalId, int parent } } - var filterTabs = FilterTabsByRole(tabs, roles, disabledNotSelectable); + var filterTabs = this.FilterTabsByRole(tabs, roles, disabledNotSelectable); var pages = tabs.Select(tab => new ItemDto { @@ -471,11 +471,11 @@ private NTree SearchPagesInternal(int portalId, string searchText, int List tabs; if (portalId == -1) { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } else { - if (!IsPortalIdValid(portalId)) + if (!this.IsPortalIdValid(portalId)) { return tree; } @@ -495,7 +495,7 @@ private NTree SearchPagesInternal(int portalId, string searchText, int { tabs = TabController.Instance.GetTabsByPortal(portalId).Where(tab => - (includeActive || tab.Value.TabID != PortalSettings.ActiveTab.TabID) + (includeActive || tab.Value.TabID != this.PortalSettings.ActiveTab.TabID) && (includeDisabled || !tab.Value.DisableLink) && (includeAllTypes || tab.Value.TabType == TabType.Normal) && searchFunc(tab.Value) @@ -504,7 +504,7 @@ private NTree SearchPagesInternal(int portalId, string searchText, int .Select(tab => tab.Value) .ToList(); - if (PortalSettings.UserInfo.IsSuperUser && includeHostPages) + if (this.PortalSettings.UserInfo.IsSuperUser && includeHostPages) { tabs.AddRange(TabController.Instance.GetTabsByPortal(-1).Where(tab => !tab.Value.DisableLink && searchFunc(tab.Value) && !tab.Value.IsSystem) .OrderBy(tab => tab.Value.TabOrder) @@ -514,7 +514,7 @@ private NTree SearchPagesInternal(int portalId, string searchText, int } else { - if (PortalSettings.UserInfo.IsSuperUser) + if (this.PortalSettings.UserInfo.IsSuperUser) { tabs = TabController.Instance.GetTabsByPortal(-1).Where(tab => !tab.Value.DisableLink && searchFunc(tab.Value) && !tab.Value.IsSystem) .OrderBy(tab => tab.Value.TabOrder) @@ -527,7 +527,7 @@ private NTree SearchPagesInternal(int portalId, string searchText, int } } - var filterTabs = FilterTabsByRole(tabs, roles, disabledNotSelectable); + var filterTabs = this.FilterTabsByRole(tabs, roles, disabledNotSelectable); var pages = tabs.Select(tab => new ItemDto { @@ -548,11 +548,11 @@ private List GetPortalPages(int portalId, bool includeDisabled = false, List tabs = null; if (portalId == -1) { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } else { - if (!IsPortalIdValid(portalId)) + if (!this.IsPortalIdValid(portalId)) { return null; } @@ -560,18 +560,18 @@ private List GetPortalPages(int portalId, bool includeDisabled = false, if (portalId > -1) { - tabs = TabController.GetPortalTabs(portalId, (includeActive) ? Null.NullInteger : PortalSettings.ActiveTab.TabID, false, null, true, false, includeAllTypes, true, false) + tabs = TabController.GetPortalTabs(portalId, (includeActive) ? Null.NullInteger : this.PortalSettings.ActiveTab.TabID, false, null, true, false, includeAllTypes, true, false) .Where(t => (!t.DisableLink || includeDisabled) && !t.IsSystem) .ToList(); - if (PortalSettings.UserInfo.IsSuperUser && includeHostPages) + if (this.PortalSettings.UserInfo.IsSuperUser && includeHostPages) { tabs.AddRange(TabController.Instance.GetTabsByPortal(-1).AsList().Where(t => !t.IsDeleted && !t.DisableLink && !t.IsSystem).ToList()); } } else { - if (PortalSettings.UserInfo.IsSuperUser) + if (this.PortalSettings.UserInfo.IsSuperUser) { tabs = TabController.Instance.GetTabsByPortal(-1).AsList().Where(t => !t.IsDeleted && !t.DisableLink && !t.IsSystem).ToList(); } @@ -603,14 +603,14 @@ private NTree SortPagesInternal(int portalId, string treeAsJson, int so bool includeHostPages = false, string roles = "") { var tree = DotNetNuke.Common.Utilities.Json.Deserialize>(treeAsJson); - return SortPagesInternal(portalId, tree, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + return this.SortPagesInternal(portalId, tree, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); } private NTree SortPagesInternal(int portalId, NTree openedNodesTree, int sortOrder, bool includeDisabled = false, bool includeAllTypes = false, bool includeActive = false, bool includeHostPages = false, string roles = "") { - var pages = GetPortalPages(portalId, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + var pages = this.GetPortalPages(portalId, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); var sortedTree = new NTree { Data = new ItemDto { Key = RootKey } }; if (pages == null) { @@ -632,7 +632,7 @@ private NTree SearchPagesInPortalGroupInternal(string searchText, int s int portalId; if (int.TryParse(child.Data.Key.Replace(PortalPrefix, string.Empty), out portalId)) { - var pageTree = SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + var pageTree = this.SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); child.Children = pageTree.Children; } } @@ -668,7 +668,7 @@ private NTree SearchPagesInPortalGroupInternal(string treeAsJson, strin int portalId; if (int.TryParse(treeNodeChild.Data.Key.Replace(PortalPrefix, string.Empty), out portalId)) { - var pageTree = SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + var pageTree = this.SearchPagesInternal(portalId, searchText, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); treeNodeChild.Children = pageTree.Children; } } @@ -680,7 +680,7 @@ private NTree SortPagesInPortalGroupInternal(string treeAsJson, int sor bool includeHostPages = false, string roles = "") { var tree = DotNetNuke.Common.Utilities.Json.Deserialize>(treeAsJson); - return SortPagesInPortalGroupInternal(tree, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + return this.SortPagesInPortalGroupInternal(tree, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); } private NTree SortPagesInPortalGroupInternal(NTree openedNode, int sortOrder, @@ -709,7 +709,7 @@ private NTree SortPagesInPortalGroupInternal(NTree openedNod { portalId = -1; } - var treeOfPages = SortPagesInternal(portalId, openedNodeChild, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + var treeOfPages = this.SortPagesInternal(portalId, openedNodeChild, sortOrder, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); treeNodeChild.Children = treeOfPages.Children; } } @@ -747,7 +747,7 @@ private NTree GetTreePathForPageInternal(int portalId, string itemId, i { itemIdAsInt = Null.NullInteger; } - return GetTreePathForPageInternal(portalId, itemIdAsInt, sortOrder, includePortalTree, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + return this.GetTreePathForPageInternal(portalId, itemIdAsInt, sortOrder, includePortalTree, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); } private NTree GetTreePathForPageInternal(string itemId, int sortOrder, @@ -770,7 +770,7 @@ private NTree GetTreePathForPageInternal(string itemId, int sortOrder, { return tree; } - return GetTreePathForPageInternal(portalId, itemIdAsInt, sortOrder, includePortalTree, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + return this.GetTreePathForPageInternal(portalId, itemIdAsInt, sortOrder, includePortalTree, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); } private NTree GetTreePathForPageInternal(int portalId, int selectedItemId, @@ -785,7 +785,7 @@ private NTree GetTreePathForPageInternal(int portalId, int selectedItem return tree; } - var pages = GetPortalPages(portalId, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); + var pages = this.GetPortalPages(portalId, includeDisabled, includeAllTypes, includeActive, includeHostPages, roles); if (pages == null) { @@ -812,7 +812,7 @@ private NTree GetTreePathForPageInternal(int portalId, int selectedItem var parentId = page.ParentId; var parentTab = parentId > 0 ? pages.SingleOrDefault(t => t.TabID == parentId) : null; - var filterTabs = FilterTabsByRole(pages, roles, disabledNotSelectable); + var filterTabs = this.FilterTabsByRole(pages, roles, disabledNotSelectable); while (parentTab != null) { // load all sibiling @@ -937,11 +937,11 @@ private List FilterTabsByRole(IList tabs, string roles, bool disab private NTree GetFoldersInternal(int portalId, int sortOrder, string permissions) { var tree = new NTree { Data = new ItemDto { Key = RootKey } }; - var children = ApplySort(GetFolderDescendantsInternal(portalId, -1, sortOrder, string.Empty, permissions), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); + var children = ApplySort(this.GetFolderDescendantsInternal(portalId, -1, sortOrder, string.Empty, permissions), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); tree.Children = children; foreach (var child in tree.Children) { - children = ApplySort(GetFolderDescendantsInternal(portalId, child.Data.Key, sortOrder, string.Empty, permissions), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); + children = ApplySort(this.GetFolderDescendantsInternal(portalId, child.Data.Key, sortOrder, string.Empty, permissions), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); child.Children = children; } return tree; @@ -950,13 +950,13 @@ private NTree GetFoldersInternal(int portalId, int sortOrder, string pe private NTree SortFoldersInternal(int portalId, string treeAsJson, int sortOrder, string permissions) { var tree = DotNetNuke.Common.Utilities.Json.Deserialize>(treeAsJson); - return SortFoldersInternal(portalId, tree, sortOrder, permissions); + return this.SortFoldersInternal(portalId, tree, sortOrder, permissions); } private NTree SortFoldersInternal(int portalId, NTree openedNodesTree, int sortOrder, string permissions) { var sortedTree = new NTree { Data = new ItemDto { Key = RootKey } }; - SortFoldersRecursevely(portalId, sortedTree, openedNodesTree, sortOrder, permissions); + this.SortFoldersRecursevely(portalId, sortedTree, openedNodesTree, sortOrder, permissions); return sortedTree; } @@ -966,7 +966,7 @@ private void SortFoldersRecursevely(int portalId, NTree treeNode, NTree { return; } - var children = ApplySort(GetFolderDescendantsInternal(portalId, openedNode.Data.Id, sortOrder, string.Empty, permissions), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); + var children = ApplySort(this.GetFolderDescendantsInternal(portalId, openedNode.Data.Id, sortOrder, string.Empty, permissions), sortOrder).Select(dto => new NTree { Data = dto }).ToList(); treeNode.Children = children; if (openedNode.HasChildren()) { @@ -977,7 +977,7 @@ private void SortFoldersRecursevely(int portalId, NTree treeNode, NTree { continue; } - SortFoldersRecursevely(portalId, treeNodeChild, openedNodeChild, sortOrder, permissions); + this.SortFoldersRecursevely(portalId, treeNodeChild, openedNodeChild, sortOrder, permissions); } } } @@ -986,18 +986,18 @@ private IEnumerable GetFolderDescendantsInternal(int portalId, string p { int id; id = int.TryParse(parentId, out id) ? id : Null.NullInteger; - return GetFolderDescendantsInternal(portalId, id, sortOrder, searchText, permission); + return this.GetFolderDescendantsInternal(portalId, id, sortOrder, searchText, permission); } private IEnumerable GetFolderDescendantsInternal(int portalId, int parentId, int sortOrder, string searchText, string permission) { if (portalId > -1) { - if (!IsPortalIdValid(portalId)) return new List(); + if (!this.IsPortalIdValid(portalId)) return new List(); } else { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } var parentFolder = parentId > -1 ? FolderManager.Instance.GetFolder(parentId) : FolderManager.Instance.GetFolder(portalId, ""); @@ -1007,25 +1007,25 @@ private IEnumerable GetFolderDescendantsInternal(int portalId, int pare } var hasPermission = string.IsNullOrEmpty(permission) ? - (HasPermission(parentFolder, "BROWSE") || HasPermission(parentFolder, "READ")) : - HasPermission(parentFolder, permission.ToUpper()); + (this.HasPermission(parentFolder, "BROWSE") || this.HasPermission(parentFolder, "READ")) : + this.HasPermission(parentFolder, permission.ToUpper()); if (!hasPermission) return new List(); if (parentId < 1) return new List { new ItemDto { Key = parentFolder.FolderID.ToString(CultureInfo.InvariantCulture), Value = portalId == -1 ? DynamicSharedConstants.HostRootFolder : DynamicSharedConstants.RootFolder, - HasChildren = HasChildren(parentFolder, permission), + HasChildren = this.HasChildren(parentFolder, permission), Selectable = true } }; - var childrenFolders = GetFolderDescendants(parentFolder, searchText, permission); + var childrenFolders = this.GetFolderDescendants(parentFolder, searchText, permission); var folders = childrenFolders.Select(folder => new ItemDto { Key = folder.FolderID.ToString(CultureInfo.InvariantCulture), Value = folder.FolderName, - HasChildren = HasChildren(folder, permission), + HasChildren = this.HasChildren(folder, permission), Selectable = true }); @@ -1038,17 +1038,17 @@ private NTree SearchFoldersInternal(int portalId, string searchText, in if (portalId > -1) { - if (!IsPortalIdValid(portalId)) + if (!this.IsPortalIdValid(portalId)) { return tree; } } else { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } - var allFolders = GetPortalFolders(portalId, searchText, permission); + var allFolders = this.GetPortalFolders(portalId, searchText, permission); var folders = allFolders.Select(f => new ItemDto { Key = f.FolderID.ToString(CultureInfo.InvariantCulture), @@ -1082,8 +1082,8 @@ private NTree GetTreePathForFolderInternal(string selectedItemId, int s } var hasPermission = string.IsNullOrEmpty(permission) ? - (HasPermission(folder, "BROWSE") || HasPermission(folder, "READ")) : - HasPermission(folder, permission.ToUpper()); + (this.HasPermission(folder, "BROWSE") || this.HasPermission(folder, "READ")) : + this.HasPermission(folder, permission.ToUpper()); if (!hasPermission) return new NTree(); var selfTree = new NTree @@ -1092,7 +1092,7 @@ private NTree GetTreePathForFolderInternal(string selectedItemId, int s { Key = folder.FolderID.ToString(CultureInfo.InvariantCulture), Value = folder.FolderName, - HasChildren = HasChildren(folder, permission), + HasChildren = this.HasChildren(folder, permission), Selectable = true } }; @@ -1102,12 +1102,12 @@ private NTree GetTreePathForFolderInternal(string selectedItemId, int s while (parentFolder != null) { // load all sibling - var siblingFolders = GetFolderDescendants(parentFolder, string.Empty, permission) + var siblingFolders = this.GetFolderDescendants(parentFolder, string.Empty, permission) .Select(folderInfo => new ItemDto { Key = folderInfo.FolderID.ToString(CultureInfo.InvariantCulture), Value = folderInfo.FolderName, - HasChildren = HasChildren(folderInfo, permission), + HasChildren = this.HasChildren(folderInfo, permission), Selectable = true }).ToList(); siblingFolders = ApplySort(siblingFolders, sortOrder).ToList(); @@ -1150,7 +1150,7 @@ private NTree GetTreePathForFolderInternal(string selectedItemId, int s private bool HasPermission(IFolderInfo folder, string permissionKey) { - var hasPermision = PortalSettings.UserInfo.IsSuperUser; + var hasPermision = this.PortalSettings.UserInfo.IsSuperUser; if (!hasPermision && folder != null) { @@ -1174,8 +1174,8 @@ private IEnumerable GetFolderDescendants(IFolderInfo parentFolder, permission = string.IsNullOrEmpty(permission) ? null : permission.ToUpper(); return FolderManager.Instance.GetFolders(parentFolder).Where(folder => (string.IsNullOrEmpty(permission) ? - (HasPermission(folder, "BROWSE") || HasPermission(folder, "READ")) : - (HasPermission(folder, permission)) + (this.HasPermission(folder, "BROWSE") || this.HasPermission(folder, "READ")) : + (this.HasPermission(folder, permission)) ) && searchFunc(folder)); } @@ -1183,7 +1183,7 @@ private IEnumerable GetPortalFolders(int portalId, string searchTex { if (portalId == -1) { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } Func searchFunc; if (String.IsNullOrEmpty(searchText)) @@ -1197,8 +1197,8 @@ private IEnumerable GetPortalFolders(int portalId, string searchTex permission = string.IsNullOrEmpty(permission) ? null : permission.ToUpper(); return FolderManager.Instance.GetFolders(portalId).Where(folder => (string.IsNullOrEmpty(permission) ? - (HasPermission(folder, "BROWSE") || HasPermission(folder, "READ")) : - (HasPermission(folder, permission)) + (this.HasPermission(folder, "BROWSE") || this.HasPermission(folder, "READ")) : + (this.HasPermission(folder, permission)) ) && searchFunc(folder)); } @@ -1207,8 +1207,8 @@ private bool HasChildren(IFolderInfo parentFolder, string permission) permission = string.IsNullOrEmpty(permission) ? null : permission.ToUpper(); return FolderManager.Instance.GetFolders(parentFolder).Any(folder => (string.IsNullOrEmpty(permission) ? - (HasPermission(folder, "BROWSE") || HasPermission(folder, "READ")) : - (HasPermission(folder, permission)) + (this.HasPermission(folder, "BROWSE") || this.HasPermission(folder, "READ")) : + (this.HasPermission(folder, permission)) ) ); } @@ -1220,7 +1220,7 @@ private bool HasChildren(IFolderInfo parentFolder, string permission) private NTree GetFilesInternal(int portalId, int parentId, string filter, string searchText, int sortOrder, string permissions) { var tree = new NTree { Data = new ItemDto { Key = RootKey } }; - var children = GetFileItemsDto(portalId, parentId, filter, searchText, permissions, sortOrder).Select(dto => new NTree { Data = dto }).ToList(); + var children = this.GetFileItemsDto(portalId, parentId, filter, searchText, permissions, sortOrder).Select(dto => new NTree { Data = dto }).ToList(); tree.Children = children; return tree; } @@ -1228,7 +1228,7 @@ private NTree GetFilesInternal(int portalId, int parentId, string filte private NTree SortFilesInternal(int portalId, int parentId, string filter, int sortOrder, string permissions) { var sortedTree = new NTree { Data = new ItemDto { Key = RootKey } }; - var children = GetFileItemsDto(portalId, parentId, filter, string.Empty, permissions, sortOrder).Select(dto => new NTree { Data = dto }).ToList(); + var children = this.GetFileItemsDto(portalId, parentId, filter, string.Empty, permissions, sortOrder).Select(dto => new NTree { Data = dto }).ToList(); sortedTree.Children = children; return sortedTree; } @@ -1237,11 +1237,11 @@ private IEnumerable GetFileItemsDto(int portalId, int parentId, string { if (portalId > -1) { - if (!IsPortalIdValid(portalId)) return new List(); + if (!this.IsPortalIdValid(portalId)) return new List(); } else { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } var parentFolder = parentId > -1 ? FolderManager.Instance.GetFolder(parentId) : FolderManager.Instance.GetFolder(portalId, ""); @@ -1251,8 +1251,8 @@ private IEnumerable GetFileItemsDto(int portalId, int parentId, string } var hasPermission = string.IsNullOrEmpty(permission) ? - (HasPermission(parentFolder, "BROWSE") || HasPermission(parentFolder, "READ")) : - HasPermission(parentFolder, permission.ToUpper()); + (this.HasPermission(parentFolder, "BROWSE") || this.HasPermission(parentFolder, "READ")) : + this.HasPermission(parentFolder, permission.ToUpper()); if (!hasPermission) return new List(); if (parentId < 1) @@ -1260,7 +1260,7 @@ private IEnumerable GetFileItemsDto(int portalId, int parentId, string return new List(); } - var files = GetFiles(parentFolder, filter, searchText); + var files = this.GetFiles(parentFolder, filter, searchText); var filesDto = files.Select(f => new ItemDto { @@ -1315,12 +1315,12 @@ public HttpResponseMessage SearchUser(string q) { try { - var portalId = PortalController.GetEffectivePortalId(PortalSettings.PortalId); + var portalId = PortalController.GetEffectivePortalId(this.PortalSettings.PortalId); const int numResults = 5; // GetUsersAdvancedSearch doesn't accept a comma or a single quote in the query so we have to remove them for now. See issue 20224. q = q.Replace(",", "").Replace("'", ""); - if (q.Length == 0) return Request.CreateResponse(HttpStatusCode.OK, null); + if (q.Length == 0) return this.Request.CreateResponse(HttpStatusCode.OK, null); var results = UserController.Instance.GetUsersBasicSearch(portalId, 0, numResults, "DisplayName", true, "DisplayName", q) .Select(user => new SearchResult @@ -1330,12 +1330,12 @@ public HttpResponseMessage SearchUser(string q) iconfile = UserController.Instance.GetUserProfilePictureUrl(user.UserID, 32, 32), }).ToList(); - return Request.CreateResponse(HttpStatusCode.OK, results.OrderBy(sr => sr.name)); + return this.Request.CreateResponse(HttpStatusCode.OK, results.OrderBy(sr => sr.name)); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -1366,7 +1366,7 @@ where string.IsNullOrEmpty(q) || t.Name.IndexOf(q, StringComparison.InvariantCul select new {text = t.Name, value = t.TermId}}); } - return Request.CreateResponse(HttpStatusCode.OK, terms); + return this.Request.CreateResponse(HttpStatusCode.OK, terms); } #endregion @@ -1403,10 +1403,10 @@ where portals.Any(x => x.PortalID == PortalSettings.Current.PortalId) private bool IsPortalIdValid(int portalId) { - if (UserInfo.IsSuperUser) return true; - if (PortalSettings.PortalId == portalId) return true; + if (this.UserInfo.IsSuperUser) return true; + if (this.PortalSettings.PortalId == portalId) return true; - var isAdminUser = PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); + var isAdminUser = PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); if (!isAdminUser) return false; var mygroup = GetMyPortalGroup(); @@ -1420,7 +1420,7 @@ private int GetActivePortalId(int pageId) if (portalId == Null.NullInteger) { - portalId = GetActivePortalId(); + portalId = this.GetActivePortalId(); } return portalId; } @@ -1429,7 +1429,7 @@ private int GetActivePortalId() { var portalId = -1; if (!TabController.CurrentPage.IsSuperTab) - portalId = PortalSettings.PortalId; + portalId = this.PortalSettings.PortalId; return portalId; } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs index 07810fce374..1f5962e4834 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/LanguageServiceController.cs @@ -24,7 +24,7 @@ public class LanguageServiceController : DnnApiController protected INavigationManager NavigationManager { get; } public LanguageServiceController(INavigationManager navigationManager) { - NavigationManager = navigationManager; + this.NavigationManager = navigationManager; } public class PageDto @@ -35,7 +35,7 @@ public class PageDto } private bool IsDefaultLanguage(string code) { - return code == PortalSettings.DefaultLanguage; + return code == this.PortalSettings.DefaultLanguage; } [HttpGet] @@ -45,21 +45,21 @@ public HttpResponseMessage GetNonTranslatedPages(string languageCode) var locale = new LocaleController().GetLocale(languageCode); List pages = new List(); - if (!IsDefaultLanguage(locale.Code)) + if (!this.IsDefaultLanguage(locale.Code)) { TabController ctl = new TabController(); - var nonTranslated = (from t in ctl.GetTabsByPortal(PortalSettings.PortalId).WithCulture(locale.Code, false).Values where !t.IsTranslated && !t.IsDeleted select t); + var nonTranslated = (from t in ctl.GetTabsByPortal(this.PortalSettings.PortalId).WithCulture(locale.Code, false).Values where !t.IsTranslated && !t.IsDeleted select t); foreach (TabInfo page in nonTranslated) { pages.Add(new PageDto() { Name = page.TabName, - ViewUrl = NavigationManager.NavigateURL(page.TabID), - EditUrl = NavigationManager.NavigateURL(page.TabID, "Tab", "action=edit", "returntabid=" + PortalSettings.ActiveTab.TabID) + ViewUrl = this.NavigationManager.NavigateURL(page.TabID), + EditUrl = this.NavigationManager.NavigateURL(page.TabID, "Tab", "action=edit", "returntabid=" + this.PortalSettings.ActiveTab.TabID) }); } } - return Request.CreateResponse(HttpStatusCode.OK, pages); + return this.Request.CreateResponse(HttpStatusCode.OK, pages); } } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/MessagingServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/MessagingServiceController.cs index e73a6e1026b..0641c595a4b 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/MessagingServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/MessagingServiceController.cs @@ -33,12 +33,12 @@ public HttpResponseMessage WaitTimeForNextMessage() { try { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Value = InternalMessagingController.Instance.WaitTimeForNextMessage(UserInfo) }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Value = InternalMessagingController.Instance.WaitTimeForNextMessage(this.UserInfo) }); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -57,7 +57,7 @@ public HttpResponseMessage Create(CreateDTO postData) { try { - var portalId = PortalController.GetEffectivePortalId(PortalSettings.PortalId); + var portalId = PortalController.GetEffectivePortalId(this.PortalSettings.PortalId); var roleIdsList = string.IsNullOrEmpty(postData.RoleIds) ? null : postData.RoleIds.FromJson>(); var userIdsList = string.IsNullOrEmpty(postData.UserIds) ? null : postData.UserIds.FromJson>(); var fileIdsList = string.IsNullOrEmpty(postData.FileIds) ? null : postData.FileIds.FromJson>(); @@ -74,12 +74,12 @@ public HttpResponseMessage Create(CreateDTO postData) var message = new Message { Subject = HttpUtility.UrlDecode(postData.Subject), Body = HttpUtility.UrlDecode(postData.Body) }; MessagingController.Instance.SendMessage(message, roles, users, fileIdsList); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Value = message.MessageID }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Value = message.MessageID }); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -88,13 +88,13 @@ public HttpResponseMessage Search(string q) { try { - var portalId = PortalController.GetEffectivePortalId(PortalSettings.PortalId); - var isAdmin = UserInfo.IsSuperUser || UserInfo.IsInRole("Administrators"); + var portalId = PortalController.GetEffectivePortalId(this.PortalSettings.PortalId); + var isAdmin = this.UserInfo.IsSuperUser || this.UserInfo.IsInRole("Administrators"); const int numResults = 10; // GetUsersAdvancedSearch doesn't accept a comma or a single quote in the query so we have to remove them for now. See issue 20224. q = q.Replace(",", "").Replace("'", ""); - if (q.Length == 0) return Request.CreateResponse(HttpStatusCode.OK, null); + if (q.Length == 0) return this.Request.CreateResponse(HttpStatusCode.OK, null); var results = UserController.Instance.GetUsersBasicSearch(portalId, 0, numResults, "DisplayName", true, "DisplayName", q) .Select(user => new SearchResult @@ -109,22 +109,22 @@ public HttpResponseMessage Search(string q) results.AddRange(from roleInfo in roles where isAdmin || - UserInfo.Social.Roles.SingleOrDefault(ur => ur.RoleID == roleInfo.RoleID && ur.IsOwner) != null + this.UserInfo.Social.Roles.SingleOrDefault(ur => ur.RoleID == roleInfo.RoleID && ur.IsOwner) != null select new SearchResult { id = "role-" + roleInfo.RoleID, name = roleInfo.RoleName, iconfile = TestableGlobals.Instance.ResolveUrl(string.IsNullOrEmpty(roleInfo.IconFile) ? "~/images/no_avatar.gif" - : PortalSettings.HomeDirectory.TrimEnd('/') + "/" + roleInfo.IconFile) + : this.PortalSettings.HomeDirectory.TrimEnd('/') + "/" + roleInfo.IconFile) }); - return Request.CreateResponse(HttpStatusCode.OK, results.OrderBy(sr => sr.name)); + return this.Request.CreateResponse(HttpStatusCode.OK, results.OrderBy(sr => sr.name)); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/ModuleServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/ModuleServiceController.cs index cc3c1c50eae..9a650e2fca9 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/ModuleServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/ModuleServiceController.cs @@ -48,7 +48,7 @@ public HttpResponseMessage GetModuleShareable(int moduleId, int tabId, int porta } else { - portalId = FixPortalId(portalId); + portalId = this.FixPortalId(portalId); } DesktopModuleInfo desktopModule; @@ -62,17 +62,17 @@ public HttpResponseMessage GetModuleShareable(int moduleId, int tabId, int porta desktopModule = moduleInfo.DesktopModule; - requiresWarning = moduleInfo.PortalID != PortalSettings.PortalId && desktopModule.Shareable == ModuleSharing.Unknown; + requiresWarning = moduleInfo.PortalID != this.PortalSettings.PortalId && desktopModule.Shareable == ModuleSharing.Unknown; } if (desktopModule == null) { var message = string.Format("Cannot find module ID {0} (tab ID {1}, portal ID {2})", moduleId, tabId, portalId); Logger.Error(message); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, message); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, message); } - return Request.CreateResponse(HttpStatusCode.OK, new { Shareable = desktopModule.Shareable.ToString(), RequiresWarning = requiresWarning }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Shareable = desktopModule.Shareable.ToString(), RequiresWarning = requiresWarning }); } [HttpPost] @@ -97,7 +97,7 @@ public HttpResponseMessage MoveModule(MoveModuleDTO postData) ModuleController.Instance.UpdateModuleOrder(postData.TabId, postData.ModuleId, moduleOrder, postData.Pane); ModuleController.Instance.UpdateTabModuleOrder(postData.TabId); - return Request.CreateResponse(HttpStatusCode.OK); + return this.Request.CreateResponse(HttpStatusCode.OK); } /// @@ -113,15 +113,15 @@ public HttpResponseMessage DeleteModule(DeleteModuleDto deleteModuleDto) { ModuleController.Instance.DeleteTabModule(deleteModuleDto.TabId, deleteModuleDto.ModuleId, deleteModuleDto.SoftDelete); - return Request.CreateResponse(HttpStatusCode.OK); + return this.Request.CreateResponse(HttpStatusCode.OK); } private int FixPortalId(int portalId) { - return UserInfo.IsSuperUser && PortalSettings.PortalId != portalId && PortalController.Instance.GetPortals() + return this.UserInfo.IsSuperUser && this.PortalSettings.PortalId != portalId && PortalController.Instance.GetPortals() .OfType().Any(x => x.PortalID == portalId) ? portalId - : PortalSettings.PortalId; + : this.PortalSettings.PortalId; } } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/NewUserNotificationServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/NewUserNotificationServiceController.cs index 487d3880f1a..4c947019cfd 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/NewUserNotificationServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/NewUserNotificationServiceController.cs @@ -21,41 +21,41 @@ public class NewUserNotificationServiceController : DnnApiController [ValidateAntiForgeryToken] public HttpResponseMessage Authorize(NotificationDTO postData) { - var user = GetUser(postData); + var user = this.GetUser(postData); if (user == null) { NotificationsController.Instance.DeleteNotification(postData.NotificationId); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "User not found"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "User not found"); } user.Membership.Approved = true; - UserController.UpdateUser(PortalSettings.PortalId, user); + UserController.UpdateUser(this.PortalSettings.PortalId, user); //Update User Roles if needed - if (!user.IsSuperUser && user.IsInRole("Unverified Users") && PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.VerifiedRegistration) + if (!user.IsSuperUser && user.IsInRole("Unverified Users") && this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.VerifiedRegistration) { UserController.ApproveUser(user); } - Mail.SendMail(user, MessageType.UserAuthorized, PortalSettings); + Mail.SendMail(user, MessageType.UserAuthorized, this.PortalSettings); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage Reject(NotificationDTO postData) { - var user = GetUser(postData); + var user = this.GetUser(postData); if (user == null) { NotificationsController.Instance.DeleteNotification(postData.NotificationId); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "User not found"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "User not found"); } UserController.RemoveUser(user); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } [HttpPost] @@ -63,24 +63,24 @@ public HttpResponseMessage Reject(NotificationDTO postData) [ValidateAntiForgeryToken] public HttpResponseMessage SendVerificationMail(NotificationDTO postData) { - if (UserInfo.Membership.Approved) + if (this.UserInfo.Membership.Approved) { throw new UserAlreadyVerifiedException(); } - if (!UserInfo.IsInRole("Unverified Users")) + if (!this.UserInfo.IsInRole("Unverified Users")) { throw new InvalidVerificationCodeException(); } - var message = Mail.SendMail(UserInfo, MessageType.UserRegistrationVerified, PortalSettings); + var message = Mail.SendMail(this.UserInfo, MessageType.UserRegistrationVerified, this.PortalSettings); if (string.IsNullOrEmpty(message)) { - return Request.CreateResponse(HttpStatusCode.OK, new {Result = Localization.GetSafeJSString("VerificationMailSendSuccessful", Localization.SharedResourceFile) }); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = Localization.GetSafeJSString("VerificationMailSendSuccessful", Localization.SharedResourceFile) }); } else { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, message); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, message); } } @@ -94,7 +94,7 @@ private UserInfo GetUser(NotificationDTO notificationDto) return null; } - return UserController.GetUserById(PortalSettings.PortalId, userId); + return UserController.GetUserById(this.PortalSettings.PortalId, userId); } } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/NotificationsServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/NotificationsServiceController.cs index b46f3dcb60a..72f227f4483 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/NotificationsServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/NotificationsServiceController.cs @@ -26,19 +26,19 @@ public HttpResponseMessage Dismiss(NotificationDTO postData) { try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); if (recipient != null) { - NotificationsController.Instance.DeleteNotificationRecipient(postData.NotificationId, UserInfo.UserID); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + NotificationsController.Instance.DeleteNotificationRecipient(postData.NotificationId, this.UserInfo.UserID); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Unable to dismiss notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Unable to dismiss notification"); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -47,8 +47,8 @@ public HttpResponseMessage Dismiss(NotificationDTO postData) public HttpResponseMessage GetToasts() { var toasts = NotificationsController.Instance.GetToasts(this.UserInfo); - IList convertedObjects = toasts.Select(ToExpandoObject).ToList(); - return Request.CreateResponse(HttpStatusCode.OK, new { Success = true, Toasts = convertedObjects.Take(3) }); + IList convertedObjects = toasts.Select(this.ToExpandoObject).ToList(); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true, Toasts = convertedObjects.Take(3) }); } private object ToExpandoObject(Notification notification) diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/PageServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/PageServiceController.cs index f7115bdfa60..f7ab68d8023 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/PageServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/PageServiceController.cs @@ -25,11 +25,11 @@ protected int PortalId { get { - if (!_portalId.HasValue) + if (!this._portalId.HasValue) { - _portalId = PortalSettings.ActiveTab.IsSuperTab ? -1 : PortalSettings.PortalId; + this._portalId = this.PortalSettings.ActiveTab.IsSuperTab ? -1 : this.PortalSettings.PortalId; } - return _portalId.Value; + return this._portalId.Value; } } @@ -39,11 +39,11 @@ protected int PortalId [DnnPagePermission] public HttpResponseMessage PublishPage(PublishPageDto dto) { - var tabId = Request.FindTabId(); + var tabId = this.Request.FindTabId(); - TabPublishingController.Instance.SetTabPublishing(tabId, PortalId, dto.Publish); + TabPublishingController.Instance.SetTabPublishing(tabId, this.PortalId, dto.Publish); - return Request.CreateResponse(HttpStatusCode.OK); + return this.Request.CreateResponse(HttpStatusCode.OK); } [HttpPost] @@ -53,13 +53,13 @@ public HttpResponseMessage UpdateCustomUrl(SaveUrlDto dto) var urlPath = dto.Path.ValueOrEmpty().TrimStart('/'); bool modified; //Clean Url - var options = UrlRewriterUtils.ExtendOptionsForCustomURLs( UrlRewriterUtils.GetOptionsFromSettings(new FriendlyUrlSettings(PortalSettings.PortalId)) ); + var options = UrlRewriterUtils.ExtendOptionsForCustomURLs( UrlRewriterUtils.GetOptionsFromSettings(new FriendlyUrlSettings(this.PortalSettings.PortalId)) ); //now clean the path urlPath = FriendlyUrlController.CleanNameForUrl(urlPath, options, out modified); if (modified) { - return Request.CreateResponse(HttpStatusCode.OK, + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = false, @@ -69,10 +69,10 @@ public HttpResponseMessage UpdateCustomUrl(SaveUrlDto dto) } //Validate for uniqueness - urlPath = FriendlyUrlController.ValidateUrl(urlPath, -1, PortalSettings, out modified); + urlPath = FriendlyUrlController.ValidateUrl(urlPath, -1, this.PortalSettings, out modified); if (modified) { - return Request.CreateResponse(HttpStatusCode.OK, + return this.Request.CreateResponse(HttpStatusCode.OK, new { Success = false, @@ -81,8 +81,8 @@ public HttpResponseMessage UpdateCustomUrl(SaveUrlDto dto) }); } - var tab = PortalSettings.ActiveTab; - var cultureCode = LocaleController.Instance.GetLocales(PortalId) + var tab = this.PortalSettings.ActiveTab; + var cultureCode = LocaleController.Instance.GetLocales(this.PortalId) .Where(l => l.Value.KeyID == dto.LocaleKey) .Select(l => l.Value.Code) .SingleOrDefault(); @@ -107,20 +107,20 @@ public HttpResponseMessage UpdateCustomUrl(SaveUrlDto dto) HttpStatus = dto.StatusCodeKey.ToString(CultureInfo.InvariantCulture), IsSystem = dto.IsSystem // false }; - TabController.Instance.SaveTabUrl(tabUrl, PortalId, true); + TabController.Instance.SaveTabUrl(tabUrl, this.PortalId, true); } else { //Change the original 200 url to a redirect tabUrl.HttpStatus = "301"; tabUrl.SeqNum = dto.Id; - TabController.Instance.SaveTabUrl(tabUrl, PortalId, true); + TabController.Instance.SaveTabUrl(tabUrl, this.PortalId, true); //Add new custom url tabUrl.Url = dto.Path.ValueOrEmpty(); tabUrl.HttpStatus = "200"; tabUrl.SeqNum = tab.TabUrls.Max(t => t.SeqNum) + 1; - TabController.Instance.SaveTabUrl(tabUrl, PortalId, true); + TabController.Instance.SaveTabUrl(tabUrl, this.PortalId, true); } } else @@ -138,7 +138,7 @@ public HttpResponseMessage UpdateCustomUrl(SaveUrlDto dto) HttpStatus = dto.StatusCodeKey.ToString(CultureInfo.InvariantCulture), IsSystem = dto.IsSystem // false }; - TabController.Instance.SaveTabUrl(tabUrl, PortalId, true); + TabController.Instance.SaveTabUrl(tabUrl, this.PortalId, true); } @@ -147,7 +147,7 @@ public HttpResponseMessage UpdateCustomUrl(SaveUrlDto dto) Success = true, }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/ProfileServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/ProfileServiceController.cs index 8dcdeaa25ad..73a0a030578 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/ProfileServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/ProfileServiceController.cs @@ -30,8 +30,8 @@ public class ProfileServiceController : DnnApiController [HttpGet] public HttpResponseMessage Search(string q) { - var results = RegistrationProfileController.Instance.Search(PortalController.GetEffectivePortalId(PortalSettings.PortalId), q); - return Request.CreateResponse(HttpStatusCode.OK, + var results = RegistrationProfileController.Instance.Search(PortalController.GetEffectivePortalId(this.PortalSettings.PortalId), q); + return this.Request.CreateResponse(HttpStatusCode.OK, results.OrderBy(sr => sr) .Select(field => new { id = field, name = field }) ); @@ -44,13 +44,13 @@ public HttpResponseMessage UpdateVanityUrl(VanityUrlDTO vanityUrl) bool modified; //Clean Url - var options = UrlRewriterUtils.GetOptionsFromSettings(new FriendlyUrlSettings(PortalSettings.PortalId)); + var options = UrlRewriterUtils.GetOptionsFromSettings(new FriendlyUrlSettings(this.PortalSettings.PortalId)); var cleanUrl = FriendlyUrlController.CleanNameForUrl(vanityUrl.Url, options, out modified); if (modified) { - return Request.CreateResponse(HttpStatusCode.OK, + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "warning", Title = Localization.GetString("CleanWarningTitle", Localization.SharedResourceFile), @@ -60,12 +60,12 @@ public HttpResponseMessage UpdateVanityUrl(VanityUrlDTO vanityUrl) } //Validate for uniqueness - var uniqueUrl = FriendlyUrlController.ValidateUrl(cleanUrl, -1, PortalSettings, out modified); + var uniqueUrl = FriendlyUrlController.ValidateUrl(cleanUrl, -1, this.PortalSettings, out modified); if (modified) { - return Request.CreateResponse(HttpStatusCode.OK, + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "warning", @@ -75,14 +75,14 @@ public HttpResponseMessage UpdateVanityUrl(VanityUrlDTO vanityUrl) }); } - var user = PortalSettings.UserInfo; + var user = this.PortalSettings.UserInfo; user.VanityUrl = uniqueUrl; - UserController.UpdateUser(PortalSettings.PortalId, user); + UserController.UpdateUser(this.PortalSettings.PortalId, user); - DataCache.RemoveCache(string.Format(CacheController.VanityUrlLookupKey, PortalSettings.PortalId)); + DataCache.RemoveCache(string.Format(CacheController.VanityUrlLookupKey, this.PortalSettings.PortalId)); //Url is clean and validated so we can update the User - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } public class VanityUrlDTO @@ -97,7 +97,7 @@ public HttpResponseMessage ProfilePropertyValues() string searchString = HttpContext.Current.Request.Params["SearchString"].NormalizeString(); string propertyName = HttpContext.Current.Request.Params["PropName"].NormalizeString(); int portalId = int.Parse(HttpContext.Current.Request.Params["PortalId"]); - return Request.CreateResponse(HttpStatusCode.OK, Entities.Profile.ProfileController.SearchProfilePropertyValues(portalId, propertyName, searchString)); + return this.Request.CreateResponse(HttpStatusCode.OK, Entities.Profile.ProfileController.SearchProfilePropertyValues(portalId, propertyName, searchString)); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/RelationshipServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/RelationshipServiceController.cs index ebbb45fdb9b..49448352b78 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/RelationshipServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/RelationshipServiceController.cs @@ -29,7 +29,7 @@ public HttpResponseMessage AcceptFriend(NotificationDTO postData) try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); if (recipient != null) { var notification = NotificationsController.Instance.GetNotification(postData.NotificationId); @@ -39,7 +39,7 @@ public HttpResponseMessage AcceptFriend(NotificationDTO postData) var userRelationship = RelationshipController.Instance.GetUserRelationship(userRelationshipId); if (userRelationship != null) { - var friend = UserController.GetUserById(PortalSettings.PortalId, userRelationship.UserId); + var friend = UserController.GetUserById(this.PortalSettings.PortalId, userRelationship.UserId); FriendsController.Instance.AcceptFriend(friend); success = true; } @@ -53,10 +53,10 @@ public HttpResponseMessage AcceptFriend(NotificationDTO postData) if(success) { - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); } @@ -68,14 +68,14 @@ public HttpResponseMessage FollowBack(NotificationDTO postData) try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); if (recipient != null) { var notification = NotificationsController.Instance.GetNotification(postData.NotificationId); int targetUserId; if (int.TryParse(notification.Context, out targetUserId)) { - var targetUser = UserController.GetUserById(PortalSettings.PortalId, targetUserId); + var targetUser = UserController.GetUserById(this.PortalSettings.PortalId, targetUserId); if (targetUser == null) { @@ -84,11 +84,11 @@ public HttpResponseMessage FollowBack(NotificationDTO postData) Message = Localization.GetExceptionMessage("UserDoesNotExist", "The user you are trying to follow no longer exists.") }; - return Request.CreateResponse(HttpStatusCode.InternalServerError, response); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError, response); } FollowersController.Instance.FollowUser(targetUser); - NotificationsController.Instance.DeleteNotificationRecipient(postData.NotificationId, UserInfo.UserID); + NotificationsController.Instance.DeleteNotificationRecipient(postData.NotificationId, this.UserInfo.UserID); success = true; } @@ -102,20 +102,20 @@ public HttpResponseMessage FollowBack(NotificationDTO postData) Message = Localization.GetExceptionMessage("AlreadyFollowingUser", "You are already following this user.") }; - return Request.CreateResponse(HttpStatusCode.InternalServerError, response); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError, response); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc.Message); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc.Message); } if (success) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); } } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs index 1b0253b651a..f74e401d3b1 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/SearchServiceController.cs @@ -52,13 +52,13 @@ public class StopWordsDto public SearchServiceController() { var modDef = ModuleDefinitionController.GetModuleDefinitionByFriendlyName("Text/HTML"); - HtmlModuleDefitionId = modDef != null ? modDef.ModuleDefID : -1; + this.HtmlModuleDefitionId = modDef != null ? modDef.ModuleDefID : -1; } //this constructor is for unit tests internal SearchServiceController(int htmlModuleDefitionId)//, TabController newtabController, ModuleController newmoduleController) { - HtmlModuleDefitionId = htmlModuleDefitionId; + this.HtmlModuleDefitionId = htmlModuleDefitionId; //_tabController = newtabController; //_moduleController = newmoduleController; } @@ -69,7 +69,7 @@ internal SearchServiceController(int htmlModuleDefitionId)//, TabController newt private bool IsWildCardEnabledForModule() { - var searchModuleSettings = GetSearchModuleSettings(); + var searchModuleSettings = this.GetSearchModuleSettings(); var enableWildSearch = true; if (!string.IsNullOrEmpty(Convert.ToString(searchModuleSettings["EnableWildSearch"]))) { @@ -95,11 +95,11 @@ private static ArrayList GetModulesByDefinition(int portalID, string friendlyNam private ModuleInfo GetSearchModule() { - var arrModules = GetModulesByDefinition(PortalSettings.PortalId, "Search Results"); + var arrModules = GetModulesByDefinition(this.PortalSettings.PortalId, "Search Results"); ModuleInfo findModule = null; if (arrModules.Count > 1) { - findModule = arrModules.Cast().FirstOrDefault(searchModule => searchModule.CultureCode == PortalSettings.CultureCode); + findModule = arrModules.Cast().FirstOrDefault(searchModule => searchModule.CultureCode == this.PortalSettings.CultureCode); } return findModule ?? (arrModules.Count > 0 ? (ModuleInfo)arrModules[0] : null); @@ -107,23 +107,23 @@ private ModuleInfo GetSearchModule() private Hashtable GetSearchModuleSettings() { - if (ActiveModule != null && ActiveModule.ModuleDefinition.FriendlyName == "Search Results") + if (this.ActiveModule != null && this.ActiveModule.ModuleDefinition.FriendlyName == "Search Results") { - return ActiveModule.ModuleSettings; + return this.ActiveModule.ModuleSettings; } - var searchModule = GetSearchModule(); + var searchModule = this.GetSearchModule(); return searchModule != null ? searchModule.ModuleSettings : null; } private bool GetBooleanSetting(string settingName, bool defaultValue) { - if (PortalSettings == null) + if (this.PortalSettings == null) { return defaultValue; } - var settings = GetSearchModuleSettings(); + var settings = this.GetSearchModuleSettings(); if (settings == null || !settings.ContainsKey(settingName)) { return defaultValue; @@ -134,12 +134,12 @@ private bool GetBooleanSetting(string settingName, bool defaultValue) private int GetIntegerSetting(string settingName, int defaultValue) { - if (PortalSettings == null) + if (this.PortalSettings == null) { return defaultValue; } - var settings = GetSearchModuleSettings(); + var settings = this.GetSearchModuleSettings(); if (settings == null || !settings.ContainsKey(settingName)) { return defaultValue; @@ -162,11 +162,11 @@ private List GetSearchPortalIds(IDictionary settings, int portalId) list = Convert.ToString(settings["ScopeForPortals"]).Split('|').Select(s => Convert.ToInt32(s)).ToList(); } - if (portalId == -1) portalId = PortalSettings.ActiveTab.PortalID; + if (portalId == -1) portalId = this.PortalSettings.ActiveTab.PortalID; if (portalId > -1 && !list.Contains(portalId)) list.Add(portalId); //Add Host - var userInfo = UserInfo; + var userInfo = this.UserInfo; if (userInfo.IsSuperUser) list.Add(-1); @@ -231,7 +231,7 @@ private static IEnumerable GetSearchModuleDefIds(IDictionary settings, IEnu private IList GetSearchContentSources(IList typesList) { var sources = new List(); - var list = InternalSearchController.Instance.GetSearchContentSourceList(PortalSettings.PortalId); + var list = InternalSearchController.Instance.GetSearchContentSourceList(this.PortalSettings.PortalId); if (typesList.Any()) { @@ -285,16 +285,16 @@ internal IEnumerable GetGroupedDetailViews(SearchQuery search } } - var showFriendlyTitle = ActiveModule == null - || !ActiveModule.ModuleSettings.ContainsKey("ShowFriendlyTitle") - || Convert.ToBoolean(ActiveModule.ModuleSettings["ShowFriendlyTitle"]); + var showFriendlyTitle = this.ActiveModule == null + || !this.ActiveModule.ModuleSettings.ContainsKey("ShowFriendlyTitle") + || Convert.ToBoolean(this.ActiveModule.ModuleSettings["ShowFriendlyTitle"]); foreach (var results in tabGroups.Values) { var group = new GroupedDetailView(); //first entry var first = results[0]; - group.Title = showFriendlyTitle ? GetFriendlyTitle(first) : first.Title; + group.Title = showFriendlyTitle ? this.GetFriendlyTitle(first) : first.Title; group.DocumentUrl = first.Url; //Find a different title for multiple entries with same url @@ -308,16 +308,16 @@ internal IEnumerable GetGroupedDetailViews(SearchQuery search } else if (first.ModuleId > 0) { - var tabTitle = GetTabTitleFromModuleId(first.ModuleId); + var tabTitle = this.GetTabTitleFromModuleId(first.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { group.Title = tabTitle; } } } - else if (first.ModuleDefId > 0 && first.ModuleDefId == HtmlModuleDefitionId) //special handling for Html module + else if (first.ModuleDefId > 0 && first.ModuleDefId == this.HtmlModuleDefitionId) //special handling for Html module { - var tabTitle = GetTabTitleFromModuleId(first.ModuleId); + var tabTitle = this.GetTabTitleFromModuleId(first.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { group.Title = tabTitle; @@ -329,7 +329,7 @@ internal IEnumerable GetGroupedDetailViews(SearchQuery search foreach (var result in results) { - var title = showFriendlyTitle ? GetFriendlyTitle(result) : result.Title; + var title = showFriendlyTitle ? this.GetFriendlyTitle(result) : result.Title; var detail = new DetailedView { Title = title != null && title.Contains("<") ? HttpUtility.HtmlEncode(title) : title, @@ -365,7 +365,7 @@ internal List GetGroupedBasicViews(SearchQuery query, SearchCo { int totalHists; var results = new List(); - var previews = GetBasicViews(query, out totalHists); + var previews = this.GetBasicViews(query, out totalHists); foreach (var preview in previews) { @@ -410,10 +410,10 @@ internal IEnumerable GetBasicViews(SearchQuery searchQuery, out int t { var sResult = SearchController.Instance.SiteSearch(searchQuery); totalHits = sResult.TotalHits; - var showFriendlyTitle = GetBooleanSetting("ShowFriendlyTitle", true); - var showDescription = GetBooleanSetting("ShowDescription", true); - var showSnippet = GetBooleanSetting("ShowSnippet", true); - var maxDescriptionLength = GetIntegerSetting("MaxDescriptionLength", 100); + var showFriendlyTitle = this.GetBooleanSetting("ShowFriendlyTitle", true); + var showDescription = this.GetBooleanSetting("ShowDescription", true); + var showSnippet = this.GetBooleanSetting("ShowSnippet", true); + var maxDescriptionLength = this.GetIntegerSetting("MaxDescriptionLength", 100); return sResult.Results.Select(result => { @@ -425,7 +425,7 @@ internal IEnumerable GetBasicViews(SearchQuery searchQuery, out int t return new BasicView { - Title = GetTitle(result, showFriendlyTitle), + Title = this.GetTitle(result, showFriendlyTitle), DocumentTypeName = InternalSearchController.Instance.GetSearchDocumentTypeDisplayName(result), DocumentUrl = result.Url, Snippet = showSnippet ? result.Snippet : string.Empty, @@ -436,9 +436,9 @@ internal IEnumerable GetBasicViews(SearchQuery searchQuery, out int t private string GetTitle(SearchResult result, bool showFriendlyTitle = false) { - if (result.ModuleDefId > 0 && result.ModuleDefId == HtmlModuleDefitionId) //special handling for Html module + if (result.ModuleDefId > 0 && result.ModuleDefId == this.HtmlModuleDefitionId) //special handling for Html module { - var tabTitle = GetTabTitleFromModuleId(result.ModuleId); + var tabTitle = this.GetTabTitleFromModuleId(result.ModuleId); if (!string.IsNullOrEmpty(tabTitle)) { if (result.Title != "Enter Title" && result.Title != "Text/HTML") @@ -447,7 +447,7 @@ private string GetTitle(SearchResult result, bool showFriendlyTitle = false) } } - return showFriendlyTitle ? GetFriendlyTitle(result) : result.Title; + return showFriendlyTitle ? this.GetFriendlyTitle(result) : result.Title; } private const string ModuleTitleCacheKey = "SearchModuleTabTitle_{0}"; @@ -459,7 +459,7 @@ private string GetTabTitleFromModuleId(int moduleId) // no manual clearing of the cache exists; let is just expire var cacheKey = string.Format(ModuleTitleCacheKey, moduleId); - return CBO.GetCachedObject(new CacheItemArgs(cacheKey, ModuleTitleCacheTimeOut, ModuleTitleCachePriority, moduleId), GetTabTitleCallBack); + return CBO.GetCachedObject(new CacheItemArgs(cacheKey, ModuleTitleCacheTimeOut, ModuleTitleCachePriority, moduleId), this.GetTabTitleCallBack); } private object GetTabTitleCallBack(CacheItemArgs cacheItemArgs) @@ -490,11 +490,11 @@ public HttpResponseMessage Preview(string keywords, string culture, int forceWil var beginModifiedTimeUtc = SearchQueryStringParser.Instance.GetLastModifiedDate(cleanedKeywords, out cleanedKeywords); var searchTypes = SearchQueryStringParser.Instance.GetSearchTypeList(keywords, out cleanedKeywords); - var contentSources = GetSearchContentSources(searchTypes); - var settings = GetSearchModuleSettings(); + var contentSources = this.GetSearchContentSources(searchTypes); + var settings = this.GetSearchModuleSettings(); var searchTypeIds = GetSearchTypeIds(settings, contentSources); var moduleDefids = GetSearchModuleDefIds(settings, contentSources); - var portalIds = GetSearchPortalIds(settings, portal); + var portalIds = this.GetSearchPortalIds(settings, portal); var userSearchTypeId = SearchHelper.Instance.GetSearchTypeByName("user").SearchTypeId; var userSearchSource = contentSources.FirstOrDefault(s => s.SearchTypeId == userSearchTypeId); @@ -521,7 +521,7 @@ public HttpResponseMessage Preview(string keywords, string culture, int forceWil try { - results = GetGroupedBasicViews(query, userSearchSource, PortalSettings.PortalId); + results = this.GetGroupedBasicViews(query, userSearchSource, this.PortalSettings.PortalId); } catch (Exception ex) { @@ -529,7 +529,7 @@ public HttpResponseMessage Preview(string keywords, string culture, int forceWil } } - return Request.CreateResponse(HttpStatusCode.OK, results); + return this.Request.CreateResponse(HttpStatusCode.OK, results); } [HttpGet] @@ -542,11 +542,11 @@ public HttpResponseMessage Search(string search, string culture, int pageIndex, var beginModifiedTimeUtc = SearchQueryStringParser.Instance.GetLastModifiedDate(cleanedKeywords, out cleanedKeywords); var searchTypes = SearchQueryStringParser.Instance.GetSearchTypeList(cleanedKeywords, out cleanedKeywords); - var contentSources = GetSearchContentSources(searchTypes); - var settings = GetSearchModuleSettings(); + var contentSources = this.GetSearchContentSources(searchTypes); + var settings = this.GetSearchModuleSettings(); var searchTypeIds = GetSearchTypeIds(settings, contentSources); var moduleDefids = GetSearchModuleDefIds(settings, contentSources); - var portalIds = GetSearchPortalIds(settings, -1); + var portalIds = this.GetSearchPortalIds(settings, -1); var userSearchTypeId = SearchHelper.Instance.GetSearchTypeByName("user").SearchTypeId; var more = false; @@ -570,12 +570,12 @@ public HttpResponseMessage Search(string search, string culture, int pageIndex, TitleSnippetLength = 120, BodySnippetLength = 300, CultureCode = culture, - WildCardSearch = IsWildCardEnabledForModule() + WildCardSearch = this.IsWildCardEnabledForModule() }; try { - results = GetGroupedDetailViews(query, userSearchTypeId, out totalHits, out more).ToList(); + results = this.GetGroupedDetailViews(query, userSearchTypeId, out totalHits, out more).ToList(); } catch (Exception ex) { @@ -583,7 +583,7 @@ public HttpResponseMessage Search(string search, string culture, int pageIndex, } } - return Request.CreateResponse(HttpStatusCode.OK, new { results, totalHits, more }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { results, totalHits, more }); } [HttpPost] @@ -593,7 +593,7 @@ public HttpResponseMessage AddSynonymsGroup(SynonymsGroupDto synonymsGroup) { string duplicateWord; var synonymsGroupId = SearchHelper.Instance.AddSynonymsGroup(synonymsGroup.Tags, synonymsGroup.PortalId, synonymsGroup.Culture, out duplicateWord); - return Request.CreateResponse(HttpStatusCode.OK, new { Id = synonymsGroupId, DuplicateWord = duplicateWord }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Id = synonymsGroupId, DuplicateWord = duplicateWord }); } [HttpPost] @@ -603,7 +603,7 @@ public HttpResponseMessage UpdateSynonymsGroup(SynonymsGroupDto synonymsGroup) { string duplicateWord; var synonymsGroupId = SearchHelper.Instance.UpdateSynonymsGroup(synonymsGroup.Id, synonymsGroup.Tags, synonymsGroup.PortalId, synonymsGroup.Culture, out duplicateWord); - return Request.CreateResponse(HttpStatusCode.OK, new { Id = synonymsGroupId, DuplicateWord = duplicateWord }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Id = synonymsGroupId, DuplicateWord = duplicateWord }); } [HttpPost] @@ -612,7 +612,7 @@ public HttpResponseMessage UpdateSynonymsGroup(SynonymsGroupDto synonymsGroup) public HttpResponseMessage DeleteSynonymsGroup(SynonymsGroupDto synonymsGroup) { SearchHelper.Instance.DeleteSynonymsGroup(synonymsGroup.Id, synonymsGroup.PortalId, synonymsGroup.Culture); - return Request.CreateResponse(HttpStatusCode.OK); + return this.Request.CreateResponse(HttpStatusCode.OK); } @@ -622,7 +622,7 @@ public HttpResponseMessage DeleteSynonymsGroup(SynonymsGroupDto synonymsGroup) public HttpResponseMessage AddStopWords(StopWordsDto stopWords) { var stopWordsId = SearchHelper.Instance.AddSearchStopWords(stopWords.Words, stopWords.PortalId, stopWords.Culture); - return Request.CreateResponse(HttpStatusCode.OK, new { Id = stopWordsId }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Id = stopWordsId }); } [HttpPost] @@ -631,7 +631,7 @@ public HttpResponseMessage AddStopWords(StopWordsDto stopWords) public HttpResponseMessage UpdateStopWords(StopWordsDto stopWords) { var stopWordsId = SearchHelper.Instance.UpdateSearchStopWords(stopWords.Id, stopWords.Words, stopWords.PortalId, stopWords.Culture); - return Request.CreateResponse(HttpStatusCode.OK, new { Id = stopWordsId }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Id = stopWordsId }); } [HttpPost] @@ -640,7 +640,7 @@ public HttpResponseMessage UpdateStopWords(StopWordsDto stopWords) public HttpResponseMessage DeleteStopWords(StopWordsDto stopWords) { SearchHelper.Instance.DeleteSearchStopWords(stopWords.Id, stopWords.PortalId, stopWords.Culture); - return Request.CreateResponse(HttpStatusCode.OK); + return this.Request.CreateResponse(HttpStatusCode.OK); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/UserFileController.cs b/DNN Platform/DotNetNuke.Web/InternalServices/UserFileController.cs index df17aaa22ff..3fe65c4ae83 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/UserFileController.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/UserFileController.cs @@ -26,7 +26,7 @@ public class UserFileController : DnnApiController [HttpGet] public HttpResponseMessage GetItems() { - return GetItems(null); + return this.GetItems(null); } [DnnAuthorize] @@ -35,7 +35,7 @@ public HttpResponseMessage GetItems(string fileExtensions) { try { - var userFolder = _folderManager.GetUserFolder(UserInfo); + var userFolder = this._folderManager.GetUserFolder(this.UserInfo); var extensions = new List(); if (!string.IsNullOrEmpty(fileExtensions)) @@ -46,18 +46,18 @@ public HttpResponseMessage GetItems(string fileExtensions) var folderStructure = new Item { - children = GetChildren(userFolder, extensions), + children = this.GetChildren(userFolder, extensions), folder = true, id = userFolder.FolderID, name = Localization.GetString("UserFolderTitle.Text", Localization.SharedResourceFile) }; - return Request.CreateResponse(HttpStatusCode.OK, new List { folderStructure }); + return this.Request.CreateResponse(HttpStatusCode.OK, new List { folderStructure }); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -66,7 +66,7 @@ private List GetChildren(IFolderInfo folder, ICollection extension { var everything = new List(); - var folders = _folderManager.GetFolders(folder); + var folders = this._folderManager.GetFolders(folder); foreach (var currentFolder in folders) { @@ -76,11 +76,11 @@ private List GetChildren(IFolderInfo folder, ICollection extension name = currentFolder.DisplayName ?? currentFolder.FolderName, folder = true, parentId = folder.FolderID, - children = GetChildren(currentFolder, extensions) + children = this.GetChildren(currentFolder, extensions) }); } - var files = _folderManager.GetFiles(folder); + var files = this._folderManager.GetFiles(folder); foreach (var file in files) { @@ -93,7 +93,7 @@ private List GetChildren(IFolderInfo folder, ICollection extension name = file.FileName, folder = false, parentId = file.FolderId, - thumb_url = GetThumbUrl(file), + thumb_url = this.GetThumbUrl(file), type = GetTypeName(file), size = GetFileSize(file.Size), modified = GetModifiedTime(file.LastModificationTime) @@ -119,7 +119,7 @@ private string GetThumbUrl(IFileInfo file) } var fileIcon = IconController.IconURL("Ext" + file.Extension, "32x32"); - if (!System.IO.File.Exists(Request.GetHttpContext().Server.MapPath(fileIcon))) + if (!System.IO.File.Exists(this.Request.GetHttpContext().Server.MapPath(fileIcon))) { fileIcon = IconController.IconURL("File", "32x32"); } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/BasicView.cs b/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/BasicView.cs index 25f819fd273..e0739893d6f 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/BasicView.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/BasicView.cs @@ -49,7 +49,7 @@ public class BasicView public BasicView() { - Attributes = new Dictionary(); + this.Attributes = new Dictionary(); } } diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedBasicView.cs b/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedBasicView.cs index da304d721f7..ca9aad9b040 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedBasicView.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedBasicView.cs @@ -33,8 +33,8 @@ public GroupedBasicView() public GroupedBasicView(BasicView basic) { - DocumentTypeName = basic.DocumentTypeName; - Results = new List + this.DocumentTypeName = basic.DocumentTypeName; + this.Results = new List { new BasicView { diff --git a/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedDetailView.cs b/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedDetailView.cs index 70f0b267edf..dbaf1d6b8b1 100644 --- a/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedDetailView.cs +++ b/DNN Platform/DotNetNuke.Web/InternalServices/Views/Search/GroupedDetailView.cs @@ -35,7 +35,7 @@ public class GroupedDetailView public GroupedDetailView() { - Results = new List(); + this.Results = new List(); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/Models/ModuleDetail.cs b/DNN Platform/DotNetNuke.Web/Models/ModuleDetail.cs index d821abb6989..4b088690d68 100644 --- a/DNN Platform/DotNetNuke.Web/Models/ModuleDetail.cs +++ b/DNN Platform/DotNetNuke.Web/Models/ModuleDetail.cs @@ -21,7 +21,7 @@ public class ModuleDetail public ModuleDetail() { - ModuleInstances = new List(); + this.ModuleInstances = new List(); } } } diff --git a/DNN Platform/DotNetNuke.Web/Models/SiteDetail.cs b/DNN Platform/DotNetNuke.Web/Models/SiteDetail.cs index 9fff2b1467d..c832c3bd1a4 100644 --- a/DNN Platform/DotNetNuke.Web/Models/SiteDetail.cs +++ b/DNN Platform/DotNetNuke.Web/Models/SiteDetail.cs @@ -27,7 +27,7 @@ public class SiteDetail public SiteDetail() { - Modules = new List(); + this.Modules = new List(); } } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ModulePresenterBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/ModulePresenterBase.cs index 816f34b613a..5481897dd93 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ModulePresenterBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ModulePresenterBase.cs @@ -33,20 +33,20 @@ protected ModulePresenterBase(TView view) : base(view) var control = view as Control; if (control != null && control.Page != null) { - IsPostBack = control.Page.IsPostBack; + this.IsPostBack = control.Page.IsPostBack; } //Try and cast view to IModuleControl to get the Context var moduleControl = view as IModuleControl; if (moduleControl != null) { - LocalResourceFile = moduleControl.LocalResourceFile; - ModuleContext = moduleControl.ModuleContext; + this.LocalResourceFile = moduleControl.LocalResourceFile; + this.ModuleContext = moduleControl.ModuleContext; } - Validator = new Validator(new DataAnnotationsObjectValidator()); + this.Validator = new Validator(new DataAnnotationsObjectValidator()); - view.Initialize += InitializeInternal; - view.Load += LoadInternal; + view.Initialize += this.InitializeInternal; + view.Load += this.LoadInternal; } #endregion @@ -105,15 +105,15 @@ protected internal virtual bool IsUserAuthorized private void InitializeInternal(object sender, EventArgs e) { - LoadFromContext(); - OnInit(); + this.LoadFromContext(); + this.OnInit(); } private void LoadInternal(object sender, EventArgs e) { - if (CheckAuthPolicy()) + if (this.CheckAuthPolicy()) { - OnLoad(); + this.OnLoad(); } } @@ -123,15 +123,15 @@ private void LoadInternal(object sender, EventArgs e) protected internal virtual bool CheckAuthPolicy() { - if ((UserId == Null.NullInteger && !AllowAnonymousAccess)) + if ((this.UserId == Null.NullInteger && !this.AllowAnonymousAccess)) { - OnNoCurrentUser(); + this.OnNoCurrentUser(); return false; } - if ((!IsUserAuthorized)) + if ((!this.IsUserAuthorized)) { - OnUnauthorizedUser(); + this.OnUnauthorizedUser(); return false; } @@ -140,29 +140,29 @@ protected internal virtual bool CheckAuthPolicy() protected virtual void LoadFromContext() { - if (ModuleContext != null) + if (this.ModuleContext != null) { - ModuleInfo = ModuleContext.Configuration; - IsEditable = ModuleContext.IsEditable; - IsSuperUser = ModuleContext.PortalSettings.UserInfo.IsSuperUser; - ModuleId = ModuleContext.ModuleId; - PortalId = ModuleContext.PortalId; - Settings = new Dictionary(); - foreach (object key in ModuleContext.Settings.Keys) + this.ModuleInfo = this.ModuleContext.Configuration; + this.IsEditable = this.ModuleContext.IsEditable; + this.IsSuperUser = this.ModuleContext.PortalSettings.UserInfo.IsSuperUser; + this.ModuleId = this.ModuleContext.ModuleId; + this.PortalId = this.ModuleContext.PortalId; + this.Settings = new Dictionary(); + foreach (object key in this.ModuleContext.Settings.Keys) { - Settings[key.ToString()] = (string) ModuleContext.Settings[key]; + this.Settings[key.ToString()] = (string) this.ModuleContext.Settings[key]; } - TabId = ModuleContext.TabId; - UserId = ModuleContext.PortalSettings.UserInfo.UserID; + this.TabId = this.ModuleContext.TabId; + this.UserId = this.ModuleContext.PortalSettings.UserInfo.UserID; } } protected virtual string LocalizeString(string key) { string localizedString; - if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(LocalResourceFile)) + if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(this.LocalResourceFile)) { - localizedString = Localization.GetString(key, LocalResourceFile); + localizedString = Localization.GetString(key, this.LocalResourceFile); } else { @@ -181,47 +181,47 @@ protected virtual void OnLoad() protected virtual void OnNoCurrentUser() { - RedirectToLogin(); + this.RedirectToLogin(); } protected virtual void OnUnauthorizedUser() { - RedirectToAccessDenied(); + this.RedirectToAccessDenied(); } protected void RedirectToAccessDenied() { - Response.Redirect(TestableGlobals.Instance.AccessDeniedURL(), true); + this.Response.Redirect(TestableGlobals.Instance.AccessDeniedURL(), true); } protected void RedirectToCurrentPage() { - Response.Redirect(TestableGlobals.Instance.NavigateURL(), true); + this.Response.Redirect(TestableGlobals.Instance.NavigateURL(), true); } protected void RedirectToLogin() { - Response.Redirect(TestableGlobals.Instance.LoginURL(Request.RawUrl, false), true); + this.Response.Redirect(TestableGlobals.Instance.LoginURL(this.Request.RawUrl, false), true); } protected void ProcessModuleLoadException(Exception ex) { - View.ProcessModuleLoadException(ex); + this.View.ProcessModuleLoadException(ex); } protected void ShowMessage(string messageHeader, string message, ModuleMessage.ModuleMessageType messageType) { - ShowMessage(messageHeader, message, messageType, true); + this.ShowMessage(messageHeader, message, messageType, true); } protected void ShowMessage(string message, ModuleMessage.ModuleMessageType messageType) { - ShowMessage(message, messageType, true); + this.ShowMessage(message, messageType, true); } protected void ShowMessage(string message, ModuleMessage.ModuleMessageType messageType, bool localize) { - ShowMessage(string.Empty, message, messageType, localize); + this.ShowMessage(string.Empty, message, messageType, localize); } protected void ShowMessage(string messageHeader, string message, ModuleMessage.ModuleMessageType messageType, bool localize) @@ -230,10 +230,10 @@ protected void ShowMessage(string messageHeader, string message, ModuleMessage.M { if (localize) { - messageHeader = LocalizeString(messageHeader); - message = LocalizeString(message); + messageHeader = this.LocalizeString(messageHeader); + message = this.LocalizeString(message); } - View.ShowMessage(messageHeader, message, messageType); + this.View.ShowMessage(messageHeader, message, messageType); } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenter.cs b/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenter.cs index 01ea4a1400b..3eb1dd3728c 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenter.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenter.cs @@ -14,11 +14,11 @@ public class ModuleSettingsPresenterBase : ModulePresenterBase whe public ModuleSettingsPresenterBase(TView view) : base(view) { - view.OnLoadSettings += OnLoadSettingsInternal; - view.OnSaveSettings += OnSaveSettingsInternal; + view.OnLoadSettings += this.OnLoadSettingsInternal; + view.OnSaveSettings += this.OnSaveSettingsInternal; - ModuleSettings = new Dictionary(); - TabModuleSettings = new Dictionary(); + this.ModuleSettings = new Dictionary(); + this.TabModuleSettings = new Dictionary(); } #endregion @@ -31,12 +31,12 @@ public ModuleSettingsPresenterBase(TView view) : base(view) private void OnLoadSettingsInternal(object sender, EventArgs e) { - LoadSettings(); + this.LoadSettings(); } private void OnSaveSettingsInternal(object sender, EventArgs e) { - SaveSettings(); + this.SaveSettings(); } #endregion @@ -47,14 +47,14 @@ protected override void LoadFromContext() { base.LoadFromContext(); - foreach (var key in ModuleContext.Configuration.ModuleSettings.Keys) + foreach (var key in this.ModuleContext.Configuration.ModuleSettings.Keys) { - ModuleSettings.Add(Convert.ToString(key), Convert.ToString(ModuleContext.Configuration.ModuleSettings[key])); + this.ModuleSettings.Add(Convert.ToString(key), Convert.ToString(this.ModuleContext.Configuration.ModuleSettings[key])); } - foreach (var key in ModuleContext.Configuration.TabModuleSettings.Keys) + foreach (var key in this.ModuleContext.Configuration.TabModuleSettings.Keys) { - TabModuleSettings.Add(Convert.ToString(key), Convert.ToString(ModuleContext.Configuration.TabModuleSettings[key])); + this.TabModuleSettings.Add(Convert.ToString(key), Convert.ToString(this.ModuleContext.Configuration.TabModuleSettings[key])); } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenterOfT.cs b/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenterOfT.cs index a73aab9cd30..96c12c5f393 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenterOfT.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ModuleSettingsPresenterOfT.cs @@ -17,20 +17,20 @@ public abstract class ModuleSettingsPresenter : ModulePresenterBa { protected ModuleSettingsPresenter(TView view) : base(view) { - view.OnLoadSettings += OnLoadSettingsInternal; - view.OnSaveSettings += OnSaveSettingsInternal; + view.OnLoadSettings += this.OnLoadSettingsInternal; + view.OnSaveSettings += this.OnSaveSettingsInternal; } #region Event Handlers private void OnLoadSettingsInternal(object sender, EventArgs e) { - LoadSettings(); + this.LoadSettings(); } private void OnSaveSettingsInternal(object sender, EventArgs e) { - SaveSettings(); + this.SaveSettings(); } #endregion @@ -41,24 +41,24 @@ protected override void OnLoad() { base.OnLoad(); - if (IsPostBack) + if (this.IsPostBack) { //Initialize dictionaries as LoadSettings is not called on Postback - View.Model.ModuleSettings = new Dictionary(); - View.Model.TabModuleSettings = new Dictionary(); + this.View.Model.ModuleSettings = new Dictionary(); + this.View.Model.TabModuleSettings = new Dictionary(); } } protected virtual void LoadSettings() { - View.Model.ModuleSettings = new Dictionary( - ModuleContext.Configuration.ModuleSettings + this.View.Model.ModuleSettings = new Dictionary( + this.ModuleContext.Configuration.ModuleSettings .Cast() .ToDictionary(kvp => (string)kvp.Key, kvp => (string)kvp.Value) ); - View.Model.TabModuleSettings = new Dictionary( - ModuleContext.Configuration.TabModuleSettings + this.View.Model.TabModuleSettings = new Dictionary( + this.ModuleContext.Configuration.TabModuleSettings .Cast() .ToDictionary(kvp => (string)kvp.Key, kvp => (string)kvp.Value) ); @@ -68,14 +68,14 @@ protected virtual void SaveSettings() { var controller = ModuleController.Instance; - foreach (var setting in View.Model.ModuleSettings) + foreach (var setting in this.View.Model.ModuleSettings) { - ModuleController.Instance.UpdateModuleSetting(ModuleId, setting.Key, setting.Value); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, setting.Key, setting.Value); } - foreach (var setting in View.Model.TabModuleSettings) + foreach (var setting in this.View.Model.TabModuleSettings) { - ModuleController.Instance.UpdateTabModuleSetting(ModuleContext.TabModuleId, setting.Key, setting.Value); + ModuleController.Instance.UpdateTabModuleSetting(this.ModuleContext.TabModuleId, setting.Key, setting.Value); } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewBase.cs index 96f89162556..3c12a92d942 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewBase.cs @@ -25,7 +25,7 @@ public abstract class ModuleViewBase : ModuleUserControlBase, IModuleViewBase protected ModuleViewBase() { - AutoDataBind = true; + this.AutoDataBind = true; } #endregion @@ -34,29 +34,29 @@ protected ModuleViewBase() protected T DataItem() where T : class, new() { - var _T = Page.GetDataItem() as T ?? new T(); + var _T = this.Page.GetDataItem() as T ?? new T(); return _T; } protected T DataValue() { - return (T) Page.GetDataItem(); + return (T) this.Page.GetDataItem(); } protected string DataValue(string format) { - return string.Format(CultureInfo.CurrentCulture, format, DataValue()); + return string.Format(CultureInfo.CurrentCulture, format, this.DataValue()); } protected override void OnInit(EventArgs e) { - PageViewHost.Register(this, Context, false); + PageViewHost.Register(this, this.Context, false); base.OnInit(e); - Page.InitComplete += PageInitComplete; - Page.PreRenderComplete += PagePreRenderComplete; - Page.Load += PageLoad; + this.Page.InitComplete += this.PageInitComplete; + this.Page.PreRenderComplete += this.PagePreRenderComplete; + this.Page.Load += this.PageLoad; } #endregion @@ -94,17 +94,17 @@ public bool ThrowExceptionIfNoPresenterBound private void PageInitComplete(object sender, EventArgs e) { - if (Initialize != null) + if (this.Initialize != null) { - Initialize(this, EventArgs.Empty); + this.Initialize(this, EventArgs.Empty); } } private void PageLoad(object sender, EventArgs e) { - if (Load != null) + if (this.Load != null) { - Load(this, e); + this.Load(this, e); } } @@ -112,9 +112,9 @@ private void PagePreRenderComplete(object sender, EventArgs e) { //This event is raised after any async page tasks have completed, so it //is safe to data-bind - if ((AutoDataBind)) + if ((this.AutoDataBind)) { - DataBind(); + this.DataBind(); } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewOfT.cs b/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewOfT.cs index 83ffcc9a2d6..6a8a377e0b1 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewOfT.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ModuleViewOfT.cs @@ -24,14 +24,14 @@ public TModel Model { get { - if ((_model == null)) + if ((this._model == null)) { throw new InvalidOperationException( "The Model property is currently null, however it should have been automatically initialized by the presenter. This most likely indicates that no presenter was bound to the control. Check your presenter bindings."); } - return _model; + return this._model; } - set { _model = value; } + set { this._model = value; } } #endregion @@ -40,12 +40,12 @@ protected override void LoadViewState(object savedState) { //Call the base class to load any View State base.LoadViewState(savedState); - AttributeBasedViewStateSerializer.DeSerialize(Model, ViewState); + AttributeBasedViewStateSerializer.DeSerialize(this.Model, this.ViewState); } protected override object SaveViewState() { - AttributeBasedViewStateSerializer.Serialize(Model, ViewState); + AttributeBasedViewStateSerializer.Serialize(this.Model, this.ViewState); //Call the base class to save the View State return base.SaveViewState(); } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs index 8a6bb46e79a..aa8a1251812 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/ProfileModuleViewBase.cs @@ -22,7 +22,7 @@ namespace DotNetNuke.Web.Mvp protected INavigationManager NavigationManager { get; } public ProfileModuleViewBase() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region IProfileModule Members @@ -34,9 +34,9 @@ public int ProfileUserId get { int UserId = Null.NullInteger; - if (!string.IsNullOrEmpty(Request.Params["UserId"])) + if (!string.IsNullOrEmpty(this.Request.Params["UserId"])) { - UserId = Int32.Parse(Request.Params["UserId"]); + UserId = Int32.Parse(this.Request.Params["UserId"]); } return UserId; } @@ -50,13 +50,13 @@ protected bool IsUser { get { - return ProfileUserId == ModuleContext.PortalSettings.UserId; + return this.ProfileUserId == this.ModuleContext.PortalSettings.UserId; } } protected UserInfo ProfileUser { - get { return UserController.GetUserById(ModuleContext.PortalId, ProfileUserId); } + get { return UserController.GetUserById(this.ModuleContext.PortalId, this.ProfileUserId); } } #endregion @@ -66,7 +66,7 @@ protected UserInfo ProfileUser private string GetRedirectUrl() { //redirect user to default page if not specific the home tab, do this action to prevent loop redirect. - var homeTabId = ModuleContext.PortalSettings.HomeTabId; + var homeTabId = this.ModuleContext.PortalSettings.HomeTabId; string redirectUrl; if (homeTabId > Null.NullInteger) @@ -75,7 +75,7 @@ private string GetRedirectUrl() } else { - redirectUrl = TestableGlobals.Instance.GetPortalDomainName(PortalSettings.Current.PortalAlias.HTTPAlias, Request, true) + "/" + Globals.glbDefaultPage; + redirectUrl = TestableGlobals.Instance.GetPortalDomainName(PortalSettings.Current.PortalAlias.HTTPAlias, this.Request, true) + "/" + Globals.glbDefaultPage; } return redirectUrl; @@ -87,14 +87,14 @@ private string GetRedirectUrl() protected override void OnInit(EventArgs e) { - if (ProfileUserId == Null.NullInteger && - (ModuleContext.PortalSettings.ActiveTab.TabID == ModuleContext.PortalSettings.UserTabId - || ModuleContext.PortalSettings.ActiveTab.ParentId == ModuleContext.PortalSettings.UserTabId)) + if (this.ProfileUserId == Null.NullInteger && + (this.ModuleContext.PortalSettings.ActiveTab.TabID == this.ModuleContext.PortalSettings.UserTabId + || this.ModuleContext.PortalSettings.ActiveTab.ParentId == this.ModuleContext.PortalSettings.UserTabId)) { //Clicked on breadcrumb - don't know which user - Response.Redirect(Request.IsAuthenticated - ? NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) - : GetRedirectUrl(), true); + this.Response.Redirect(this.Request.IsAuthenticated + ? this.NavigationManager.NavigateURL(this.ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + this.ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) + : this.GetRedirectUrl(), true); } base.OnInit(e); diff --git a/DNN Platform/DotNetNuke.Web/Mvp/SettingsView.cs b/DNN Platform/DotNetNuke.Web/Mvp/SettingsView.cs index a637bdf72de..ce8a3133cd5 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/SettingsView.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/SettingsView.cs @@ -17,14 +17,14 @@ public TModel Model { get { - if ((_model == null)) + if ((this._model == null)) { throw new InvalidOperationException( "The Model property is currently null, however it should have been automatically initialized by the presenter. This most likely indicates that no presenter was bound to the control. Check your presenter bindings."); } - return _model; + return this._model; } - set { _model = value; } + set { this._model = value; } } #endregion @@ -33,9 +33,9 @@ protected string GetModuleSetting(string key, string defaultValue) { var value = defaultValue; - if(Model.ModuleSettings.ContainsKey(key)) + if(this.Model.ModuleSettings.ContainsKey(key)) { - value = Model.ModuleSettings[key]; + value = this.Model.ModuleSettings[key]; } return value; @@ -45,9 +45,9 @@ protected string GetTabModuleSetting(string key, string defaultValue) { var value = defaultValue; - if (Model.TabModuleSettings.ContainsKey(key)) + if (this.Model.TabModuleSettings.ContainsKey(key)) { - value = Model.TabModuleSettings[key]; + value = this.Model.TabModuleSettings[key]; } return value; diff --git a/DNN Platform/DotNetNuke.Web/Mvp/SettingsViewBase.cs b/DNN Platform/DotNetNuke.Web/Mvp/SettingsViewBase.cs index efcaf0486f2..841ccd051c9 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/SettingsViewBase.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/SettingsViewBase.cs @@ -19,22 +19,22 @@ public class SettingsViewBase : ModuleViewBase, ISettingsView, ISettingsControl public void LoadSettings() { - if (OnLoadSettings != null) + if (this.OnLoadSettings != null) { - OnLoadSettings(this, EventArgs.Empty); + this.OnLoadSettings(this, EventArgs.Empty); } - OnSettingsLoaded(); + this.OnSettingsLoaded(); } public void UpdateSettings() { - OnSavingSettings(); + this.OnSavingSettings(); - if (OnSaveSettings != null) + if (this.OnSaveSettings != null) { - OnSaveSettings(this, EventArgs.Empty); + this.OnSaveSettings(this, EventArgs.Empty); } } diff --git a/DNN Platform/DotNetNuke.Web/Mvp/WebServiceViewOfT.cs b/DNN Platform/DotNetNuke.Web/Mvp/WebServiceViewOfT.cs index 4f6642b18eb..e75ac7f8eaa 100644 --- a/DNN Platform/DotNetNuke.Web/Mvp/WebServiceViewOfT.cs +++ b/DNN Platform/DotNetNuke.Web/Mvp/WebServiceViewOfT.cs @@ -18,14 +18,14 @@ public TModel Model { get { - if ((_model == null)) + if ((this._model == null)) { throw new InvalidOperationException( "The Model property is currently null, however it should have been automatically initialized by the presenter. This most likely indicates that no presenter was bound to the control. Check your presenter bindings."); } - return _model; + return this._model; } - set { _model = value; } + set { this._model = value; } } #endregion diff --git a/DNN Platform/DotNetNuke.Web/Services/MobileHelperController.cs b/DNN Platform/DotNetNuke.Web/Services/MobileHelperController.cs index 6acba503d6b..91d37a2eea6 100644 --- a/DNN Platform/DotNetNuke.Web/Services/MobileHelperController.cs +++ b/DNN Platform/DotNetNuke.Web/Services/MobileHelperController.cs @@ -32,14 +32,14 @@ public class MobileHelperController : DnnApiController public IHttpActionResult Monikers(string moduleList) { var monikers = GetMonikersForList(moduleList); - return Ok(monikers.Select(kpv => new { tabModuleId = kpv.Key, moniker = kpv.Value })); + return this.Ok(monikers.Select(kpv => new { tabModuleId = kpv.Key, moniker = kpv.Value })); } [HttpGet] public HttpResponseMessage ModuleDetails(string moduleList) { - var siteDetails = GetSiteDetails(moduleList); - return Request.CreateResponse(HttpStatusCode.OK, siteDetails); + var siteDetails = this.GetSiteDetails(moduleList); + return this.Request.CreateResponse(HttpStatusCode.OK, siteDetails); } #region private methods @@ -81,10 +81,10 @@ private SiteDetail GetSiteDetails(string moduleList) { var siteDetails = new SiteDetail { - SiteName = PortalSettings.PortalName, - DnnVersion = _dnnVersion, - IsHost = UserInfo.IsSuperUser, - IsAdmin = UserInfo.IsInRole("Administrators") + SiteName = this.PortalSettings.PortalName, + DnnVersion = this._dnnVersion, + IsHost = this.UserInfo.IsSuperUser, + IsAdmin = this.UserInfo.IsInRole("Administrators") }; foreach (var moduleName in (moduleList ?? "").Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)) diff --git a/DNN Platform/DotNetNuke.Web/Services/ServiceRouteMapper.cs b/DNN Platform/DotNetNuke.Web/Services/ServiceRouteMapper.cs index a6c5bb376bd..01d3a6b346a 100644 --- a/DNN Platform/DotNetNuke.Web/Services/ServiceRouteMapper.cs +++ b/DNN Platform/DotNetNuke.Web/Services/ServiceRouteMapper.cs @@ -11,7 +11,7 @@ public class ServiceRouteMapper : IServiceRouteMapper public void RegisterRoutes(IMapRoute mapRouteManager) { mapRouteManager.MapHttpRoute( - "web", "default", "{controller}/{action}", new[] { GetType().Namespace }); + "web", "default", "{controller}/{action}", new[] { this.GetType().Namespace }); } } } diff --git a/DNN Platform/DotNetNuke.Web/Startup.cs b/DNN Platform/DotNetNuke.Web/Startup.cs index e8fdef66a8a..947db98a52b 100644 --- a/DNN Platform/DotNetNuke.Web/Startup.cs +++ b/DNN Platform/DotNetNuke.Web/Startup.cs @@ -20,15 +20,15 @@ public class Startup : IDnnStartup private static readonly ILog _logger = LoggerSource.Instance.GetLogger(typeof(Startup)); public Startup() { - Configure(); + this.Configure(); } private void Configure() { var services = new ServiceCollection(); services.AddSingleton(); - ConfigureServices(services); - DependencyProvider = services.BuildServiceProvider(); + this.ConfigureServices(services); + this.DependencyProvider = services.BuildServiceProvider(); } public IServiceProvider DependencyProvider { get; private set; } @@ -43,7 +43,7 @@ public void ConfigureServices(IServiceCollection services) !x.IsAbstract); var startupInstances = startupTypes - .Select(x => CreateInstance(x)) + .Select(x => this.CreateInstance(x)) .Where(x => x != null); foreach (IDnnStartup startup in startupInstances) diff --git a/DNN Platform/DotNetNuke.Web/UI/MessageWindowParameters.cs b/DNN Platform/DotNetNuke.Web/UI/MessageWindowParameters.cs index ff542e49ceb..7c7748311b4 100644 --- a/DNN Platform/DotNetNuke.Web/UI/MessageWindowParameters.cs +++ b/DNN Platform/DotNetNuke.Web/UI/MessageWindowParameters.cs @@ -19,35 +19,35 @@ public class MessageWindowParameters public MessageWindowParameters(string message) { - _Message = message; + this._Message = message; } public MessageWindowParameters(string message, string title) { - _Message = message; - _Title = title; + this._Message = message; + this._Title = title; } public MessageWindowParameters(string message, string title, string windowWidth, string windowHeight) { - _Message = message; - _Title = title; - _WindowWidth = Unit.Parse(windowWidth); - _WindowHeight = Unit.Parse(windowHeight); + this._Message = message; + this._Title = title; + this._WindowWidth = Unit.Parse(windowWidth); + this._WindowHeight = Unit.Parse(windowHeight); } public string Message { get { - return _Message; + return this._Message; } set { //todo: javascript encode for onclick events - _Message = value; - _Message = _Message.Replace("'", "\\'"); - _Message = _Message.Replace("\"", "\\\""); + this._Message = value; + this._Message = this._Message.Replace("'", "\\'"); + this._Message = this._Message.Replace("\"", "\\\""); } } @@ -55,14 +55,14 @@ public string Title { get { - return _Title; + return this._Title; } set { //todo: javascript encode for onclick events - _Title = value; - _Title = _Title.Replace("'", "\\'"); - _Title = _Title.Replace("\"", "\\\""); + this._Title = value; + this._Title = this._Title.Replace("'", "\\'"); + this._Title = this._Title.Replace("\"", "\\\""); } } @@ -70,11 +70,11 @@ public Unit WindowWidth { get { - return _WindowWidth; + return this._WindowWidth; } set { - _WindowWidth = value; + this._WindowWidth = value; } } @@ -82,11 +82,11 @@ public Unit WindowHeight { get { - return _WindowHeight; + return this._WindowHeight; } set { - _WindowHeight = value; + this._WindowHeight = value; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/RibbonBarManager.cs b/DNN Platform/DotNetNuke.Web/UI/RibbonBarManager.cs index 121699b9088..5fcd076ffc8 100644 --- a/DNN Platform/DotNetNuke.Web/UI/RibbonBarManager.cs +++ b/DNN Platform/DotNetNuke.Web/UI/RibbonBarManager.cs @@ -493,12 +493,12 @@ public DotNetNukeException(string message, Exception innerException) : base(mess public DotNetNukeException(string message, DotNetNukeErrorCode errorCode) : base(message) { - _ErrorCode = errorCode; + this._ErrorCode = errorCode; } public DotNetNukeException(string message, Exception innerException, DotNetNukeErrorCode errorCode) : base(message, innerException) { - _ErrorCode = errorCode; + this._ErrorCode = errorCode; } public DotNetNukeException(SerializationInfo info, StreamingContext context) : base(info, context) @@ -509,7 +509,7 @@ public DotNetNukeErrorCode ErrorCode { get { - return _ErrorCode; + return this._ErrorCode; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnButton.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnButton.cs index a6e69296e81..d9dd769da3b 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnButton.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnButton.cs @@ -21,8 +21,8 @@ public class DnnButton : Button, ILocalizable public DnnButton() { - CssClass = "CommandButton"; - DisabledCssClass = "CommandButtonDisabled"; + this.CssClass = "CommandButton"; + this.DisabledCssClass = "CommandButtonDisabled"; } #endregion @@ -37,11 +37,11 @@ public string ConfirmMessage { get { - return ViewState["ConfirmMessage"] == null ? string.Empty : ViewState["ConfirmMessage"].ToString(); + return this.ViewState["ConfirmMessage"] == null ? string.Empty : this.ViewState["ConfirmMessage"].ToString(); } set { - ViewState["ConfirmMessage"] = value; + this.ViewState["ConfirmMessage"] = value; } } @@ -53,11 +53,11 @@ public string ConfirmMessage { get { - return ViewState["DisabledCssClass"] == null ? string.Empty : ViewState["DisabledCssClass"].ToString(); + return this.ViewState["DisabledCssClass"] == null ? string.Empty : this.ViewState["DisabledCssClass"].ToString(); } set { - ViewState["DisabledCssClass"] = value; + this.ViewState["DisabledCssClass"] = value; } } @@ -69,26 +69,26 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if ((!Enabled)) + if ((!this.Enabled)) { - CssClass = DisabledCssClass; + this.CssClass = this.DisabledCssClass; } - if ((!string.IsNullOrEmpty(ConfirmMessage))) + if ((!string.IsNullOrEmpty(this.ConfirmMessage))) { - string msg = ConfirmMessage; - if ((Localize)) + string msg = this.ConfirmMessage; + if ((this.Localize)) { - msg = Utilities.GetLocalizedStringFromParent(ConfirmMessage, this); + msg = Utilities.GetLocalizedStringFromParent(this.ConfirmMessage, this); } //must be done before render - OnClientClick = Utilities.GetOnClientClickConfirm(this, msg); + this.OnClientClick = Utilities.GetOnClientClickConfirm(this, msg); } } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); base.Render(writer); } @@ -100,15 +100,15 @@ public bool Localize { get { - if (DesignMode) + if (this.DesignMode) { return false; } - return _Localize; + return this._Localize; } set { - _Localize = value; + this._Localize = value; } } @@ -116,28 +116,28 @@ public bool Localize public virtual void LocalizeStrings() { - if ((Localize)) + if ((this.Localize)) { - if ((!string.IsNullOrEmpty(ToolTip))) + if ((!string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Utilities.GetLocalizedStringFromParent(ToolTip, this); + this.ToolTip = Utilities.GetLocalizedStringFromParent(this.ToolTip, this); } - if ((!string.IsNullOrEmpty(Text))) + if ((!string.IsNullOrEmpty(this.Text))) { - string unlocalizedText = Text; - Text = Utilities.GetLocalizedStringFromParent(unlocalizedText, this); - if (String.IsNullOrEmpty(Text)) + string unlocalizedText = this.Text; + this.Text = Utilities.GetLocalizedStringFromParent(unlocalizedText, this); + if (String.IsNullOrEmpty(this.Text)) { - Text = unlocalizedText; + this.Text = unlocalizedText; } - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Utilities.GetLocalizedStringFromParent(unlocalizedText + ".ToolTip", this); - if (String.IsNullOrEmpty(ToolTip)) + this.ToolTip = Utilities.GetLocalizedStringFromParent(unlocalizedText + ".ToolTip", this); + if (String.IsNullOrEmpty(this.ToolTip)) { - ToolTip = unlocalizedText; + this.ToolTip = unlocalizedText; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnCheckBox.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnCheckBox.cs index 5c4adc18025..e797a1215d2 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnCheckBox.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnCheckBox.cs @@ -17,11 +17,11 @@ public string CommandArgument { get { - return Convert.ToString(ViewState["CommandArgument"]); + return Convert.ToString(this.ViewState["CommandArgument"]); } set { - ViewState["CommandArgument"] = value; + this.ViewState["CommandArgument"] = value; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnConfirmPasswordOptions.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnConfirmPasswordOptions.cs index 1066209bc91..45825a50104 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnConfirmPasswordOptions.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnConfirmPasswordOptions.cs @@ -34,8 +34,8 @@ public class DnnConfirmPasswordOptions public DnnConfirmPasswordOptions() { // all the Confirm Password related resources are located under the Website\App_GlobalResources\WebControls.resx - ConfirmPasswordUnmatchedText = Utilities.GetLocalizedString("ConfirmPasswordUnmatched"); - ConfirmPasswordMatchedText = Utilities.GetLocalizedString("ConfirmPasswordMatched"); + this.ConfirmPasswordUnmatchedText = Utilities.GetLocalizedString("ConfirmPasswordUnmatched"); + this.ConfirmPasswordMatchedText = Utilities.GetLocalizedString("ConfirmPasswordMatched"); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownList.cs index 1d21f8978cb..c2d03943be5 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownList.cs @@ -50,7 +50,7 @@ internal DnnDropDownListOptions Options { get { - return _options.Value; + return this._options.Value; } } @@ -58,8 +58,8 @@ protected DnnGenericHiddenField StateControl { get { - EnsureChildControls(); - return _stateControl; + this.EnsureChildControls(); + return this._stateControl; } } @@ -67,8 +67,8 @@ private HtmlAnchor SelectedValue { get { - EnsureChildControls(); - return _selectedValue; + this.EnsureChildControls(); + return this._selectedValue; } } @@ -76,11 +76,11 @@ private bool UseUndefinedItem { get { - return ViewState.GetValue("UseUndefinedItem", false); + return this.ViewState.GetValue("UseUndefinedItem", false); } set { - ViewState.SetValue("UseUndefinedItem", value, false); + this.ViewState.SetValue("UseUndefinedItem", value, false); } } @@ -95,11 +95,11 @@ public event EventHandler SelectionChanged { add { - Events.AddHandler(EventSelectionChanged, value); + this.Events.AddHandler(EventSelectionChanged, value); } remove { - Events.RemoveHandler(EventSelectionChanged, value); + this.Events.RemoveHandler(EventSelectionChanged, value); } } @@ -111,7 +111,7 @@ public override ControlCollection Controls { get { - EnsureChildControls(); + this.EnsureChildControls(); return base.Controls; } } @@ -123,15 +123,15 @@ public ListItem SelectedItem { get { - if (StateControl.TypedValue != null && StateControl.TypedValue.SelectedItem != null) + if (this.StateControl.TypedValue != null && this.StateControl.TypedValue.SelectedItem != null) { - return new ListItem { Text = StateControl.TypedValue.SelectedItem.Value, Value = StateControl.TypedValue.SelectedItem.Key }; + return new ListItem { Text = this.StateControl.TypedValue.SelectedItem.Value, Value = this.StateControl.TypedValue.SelectedItem.Key }; } return null; } set { - StateControl.TypedValueOrDefault.SelectedItem = (value == null) ? null : new SerializableKeyValuePair(value.Value, value.Text); + this.StateControl.TypedValueOrDefault.SelectedItem = (value == null) ? null : new SerializableKeyValuePair(value.Value, value.Text); } } @@ -144,10 +144,10 @@ public int SelectedItemValueAsInt { get { - if (SelectedItem != null && !string.IsNullOrEmpty(SelectedItem.Value)) + if (this.SelectedItem != null && !string.IsNullOrEmpty(this.SelectedItem.Value)) { int valueAsInt; - var parsed = Int32.TryParse(SelectedItem.Value, out valueAsInt); + var parsed = Int32.TryParse(this.SelectedItem.Value, out valueAsInt); return parsed ? valueAsInt : Null.NullInteger; } return Null.NullInteger; @@ -162,12 +162,12 @@ public ListItem UndefinedItem { get { - return FirstItem; + return this.FirstItem; } set { - FirstItem = value; - UseUndefinedItem = true; + this.FirstItem = value; + this.UseUndefinedItem = true; } } @@ -178,12 +178,12 @@ public ListItem FirstItem { get { - return (Options.ItemList.FirstItem == null) ? null : new ListItem(Options.ItemList.FirstItem.Value, Options.ItemList.FirstItem.Key); + return (this.Options.ItemList.FirstItem == null) ? null : new ListItem(this.Options.ItemList.FirstItem.Value, this.Options.ItemList.FirstItem.Key); } set { - Options.ItemList.FirstItem = (value == null) ? null : new SerializableKeyValuePair(value.Value, value.Text); - UseUndefinedItem = false; + this.Options.ItemList.FirstItem = (value == null) ? null : new SerializableKeyValuePair(value.Value, value.Text); + this.UseUndefinedItem = false; } } @@ -191,7 +191,7 @@ public ItemListServicesOptions Services { get { - return Options.Services; + return this.Options.Services; } } @@ -202,7 +202,7 @@ public string SelectItemDefaultText { set { - Options.SelectItemDefaultText = value; + this.Options.SelectItemDefaultText = value; } } @@ -222,11 +222,11 @@ public bool AutoPostBack { get { - return ViewState.GetValue("AutoPostBack", false); + return this.ViewState.GetValue("AutoPostBack", false); } set { - ViewState.SetValue("AutoPostBack", value, false); + this.ViewState.SetValue("AutoPostBack", value, false); } } @@ -237,11 +237,11 @@ public virtual bool CausesValidation { get { - return ViewState.GetValue("CausesValidation", false); + return this.ViewState.GetValue("CausesValidation", false); } set { - ViewState.SetValue("CausesValidation", value, false); + this.ViewState.SetValue("CausesValidation", value, false); } } @@ -252,11 +252,11 @@ public virtual string ValidationGroup { get { - return ViewState.GetValue("ValidationGroup", string.Empty); + return this.ViewState.GetValue("ValidationGroup", string.Empty); } set { - ViewState.SetValue("ValidationGroup", value, string.Empty); + this.ViewState.SetValue("ValidationGroup", value, string.Empty); } } @@ -267,7 +267,7 @@ public List OnClientSelectionChanged { get { - return Options.OnClientSelectionChanged; + return this.Options.OnClientSelectionChanged; } } @@ -279,11 +279,11 @@ public string ExpandPath { get { - return ClientAPI.GetClientVariable(Page, ClientID + "_expandPath"); + return ClientAPI.GetClientVariable(this.Page, this.ClientID + "_expandPath"); } set { - ClientAPI.RegisterClientVariable(Page, ClientID + "_expandPath", value, true); + ClientAPI.RegisterClientVariable(this.Page, this.ClientID + "_expandPath", value, true); } } @@ -293,43 +293,43 @@ public string ExpandPath protected override void CreateChildControls() { - Controls.Clear(); + this.Controls.Clear(); var selectedItemPanel = new Panel { CssClass = "selected-item" }; - _selectedValue = new HtmlAnchor { HRef = "javascript:void(0);", Title = LocalizeString("DropDownList.SelectedItemExpandTooltip") }; - _selectedValue.Attributes.Add(HtmlTextWriterAttribute.Class.ToString(), "selected-value"); - _selectedValue.ViewStateMode = ViewStateMode.Disabled; - selectedItemPanel.Controls.Add(_selectedValue); - Controls.Add(selectedItemPanel); + this._selectedValue = new HtmlAnchor { HRef = "javascript:void(0);", Title = LocalizeString("DropDownList.SelectedItemExpandTooltip") }; + this._selectedValue.Attributes.Add(HtmlTextWriterAttribute.Class.ToString(), "selected-value"); + this._selectedValue.ViewStateMode = ViewStateMode.Disabled; + selectedItemPanel.Controls.Add(this._selectedValue); + this.Controls.Add(selectedItemPanel); - _stateControl = new DnnGenericHiddenField { ID = "state" }; - _stateControl.ValueChanged += (sender, args) => OnSelectionChanged(EventArgs.Empty); - Controls.Add(_stateControl); + this._stateControl = new DnnGenericHiddenField { ID = "state" }; + this._stateControl.ValueChanged += (sender, args) => this.OnSelectionChanged(EventArgs.Empty); + this.Controls.Add(this._stateControl); } protected override void OnInit(EventArgs e) { base.OnInit(e); - StateControl.Value = ""; // for state persistence (stateControl) + this.StateControl.Value = ""; // for state persistence (stateControl) ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); } protected override void OnPreRender(EventArgs e) { - RegisterClientScript(Page, Skin); + RegisterClientScript(this.Page, this.Skin); this.AddCssClass("dnnDropDownList"); base.OnPreRender(e); - RegisterStartupScript(); + this.RegisterStartupScript(); } protected virtual void OnSelectionChanged(EventArgs e) { - var eventHandler = (EventHandler)Events[EventSelectionChanged]; + var eventHandler = (EventHandler)this.Events[EventSelectionChanged]; if (eventHandler == null) { return; @@ -368,66 +368,66 @@ internal static void RegisterClientScript(Page page, string skin) private string GetPostBackScript() { var script = string.Empty; - if (HasAttributes) + if (this.HasAttributes) { - script = Attributes["onchange"]; + script = this.Attributes["onchange"]; if (script != null) { - Attributes.Remove("onchange"); + this.Attributes.Remove("onchange"); } } var options = new PostBackOptions(this, string.Empty); - if (CausesValidation) + if (this.CausesValidation) { options.PerformValidation = true; - options.ValidationGroup = ValidationGroup; + options.ValidationGroup = this.ValidationGroup; } - if (Page.Form != null) + if (this.Page.Form != null) { options.AutoPostBack = true; options.TrackFocus = true; } - return script.Append(Page.ClientScript.GetPostBackEventReference(options), "; "); + return script.Append(this.Page.ClientScript.GetPostBackEventReference(options), "; "); } private void RegisterStartupScript() { - Options.InternalStateFieldId = StateControl.ClientID; + this.Options.InternalStateFieldId = this.StateControl.ClientID; - if (SelectedItem == null && UseUndefinedItem) + if (this.SelectedItem == null && this.UseUndefinedItem) { - SelectedItem = UndefinedItem; + this.SelectedItem = this.UndefinedItem; } - Options.InitialState = new DnnDropDownListState + this.Options.InitialState = new DnnDropDownListState { - SelectedItem = StateControl.TypedValue != null ? StateControl.TypedValue.SelectedItem : null + SelectedItem = this.StateControl.TypedValue != null ? this.StateControl.TypedValue.SelectedItem : null }; - SelectedValue.InnerText = (SelectedItem != null) ? SelectedItem.Text : Options.SelectItemDefaultText; + this.SelectedValue.InnerText = (this.SelectedItem != null) ? this.SelectedItem.Text : this.Options.SelectItemDefaultText; - Options.Disabled = !Enabled; + this.Options.Disabled = !this.Enabled; - var optionsAsJsonString = Json.Serialize(Options); + var optionsAsJsonString = Json.Serialize(this.Options); var methods = new JavaScriptObjectDictionary(); - if (AutoPostBack) + if (this.AutoPostBack) { - methods.AddMethodBody("onSelectionChangedBackScript", GetPostBackScript()); + methods.AddMethodBody("onSelectionChangedBackScript", this.GetPostBackScript()); } var methodsAsJsonString = methods.ToJsonString(); - var script = string.Format("dnn.createDropDownList('#{0}', {1}, {2});{3}", ClientID, optionsAsJsonString, methodsAsJsonString, Environment.NewLine); + var script = string.Format("dnn.createDropDownList('#{0}', {1}, {2});{3}", this.ClientID, optionsAsJsonString, methodsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), ClientID + "DnnDropDownList", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), this.ClientID + "DnnDropDownList", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), ClientID + "DnnDropDownList", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID + "DnnDropDownList", script, true); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownListOptions.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownListOptions.cs index 7344eb9e695..e42285f0996 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownListOptions.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnDropDownListOptions.cs @@ -33,7 +33,7 @@ public List OnClientSelectionChanged { get { - return _onClientSelectionChanged ?? (_onClientSelectionChanged = new List()); + return this._onClientSelectionChanged ?? (this._onClientSelectionChanged = new List()); } } @@ -45,10 +45,10 @@ public List OnClientSelectionChanged public DnnDropDownListOptions() { - SelectedItemCss = "selected-item"; - SelectItemDefaultText = ""; - Services = new ItemListServicesOptions(); - ItemList = new ItemListOptions(); + this.SelectedItemCss = "selected-item"; + this.SelectItemDefaultText = ""; + this.Services = new ItemListServicesOptions(); + this.ItemList = new ItemListOptions(); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLabel.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLabel.cs index 2fcacb78737..92f2e2dd6c7 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLabel.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLabel.cs @@ -9,7 +9,7 @@ public class DnnFieldLabel : DnnLabel public override void LocalizeStrings() { base.LocalizeStrings(); - Text = Text + Utilities.GetLocalizedString("FieldSuffix.Text"); + this.Text = this.Text + Utilities.GetLocalizedString("FieldSuffix.Text"); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLiteral.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLiteral.cs index 26353b3a3be..a202a9a469f 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLiteral.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFieldLiteral.cs @@ -9,7 +9,7 @@ public class DnnFieldLiteral : DnnLiteral public override void LocalizeStrings() { base.LocalizeStrings(); - Text = Text + Utilities.GetLocalizedString("FieldSuffix.Text"); + this.Text = this.Text + Utilities.GetLocalizedString("FieldSuffix.Text"); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileDropDownList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileDropDownList.cs index 612482ed99d..8108ffa19dc 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileDropDownList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileDropDownList.cs @@ -24,23 +24,23 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - SelectItemDefaultText = Localization.GetString("DropDownList.SelectFileDefaultText", Localization.SharedResourceFile); - Services.GetTreeMethod = "ItemListService/GetFiles"; - Services.SearchTreeMethod = "ItemListService/SearchFiles"; - Services.SortTreeMethod = "ItemListService/SortFiles"; - Services.ServiceRoot = "InternalServices"; - Options.ItemList.DisableUnspecifiedOrder = true; + this.SelectItemDefaultText = Localization.GetString("DropDownList.SelectFileDefaultText", Localization.SharedResourceFile); + this.Services.GetTreeMethod = "ItemListService/GetFiles"; + this.Services.SearchTreeMethod = "ItemListService/SearchFiles"; + this.Services.SortTreeMethod = "ItemListService/SortFiles"; + this.Services.ServiceRoot = "InternalServices"; + this.Options.ItemList.DisableUnspecifiedOrder = true; - FolderId = Null.NullInteger; + this.FolderId = Null.NullInteger; } protected override void OnPreRender(EventArgs e) { this.AddCssClass("file"); - if (IncludeNoneSpecificItem) + if (this.IncludeNoneSpecificItem) { - UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, Null.NullInteger.ToString(CultureInfo.InvariantCulture)); + this.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, Null.NullInteger.ToString(CultureInfo.InvariantCulture)); } base.OnPreRender(e); @@ -54,12 +54,12 @@ public IFileInfo SelectedFile { get { - var fileId = SelectedItemValueAsInt; + var fileId = this.SelectedItemValueAsInt; return (fileId == Null.NullInteger) ? null : FileManager.Instance.GetFile(fileId); } set { - SelectedItem = (value != null) ? new ListItem() { Text = value.FileName, Value = value.FileId.ToString(CultureInfo.InvariantCulture) } : null; + this.SelectedItem = (value != null) ? new ListItem() { Text = value.FileName, Value = value.FileId.ToString(CultureInfo.InvariantCulture) } : null; } } @@ -67,18 +67,18 @@ public int FolderId { get { - return Services.Parameters.ContainsKey("parentId") ? Convert.ToInt32(Services.Parameters["parentId"]) : Null.NullInteger; + return this.Services.Parameters.ContainsKey("parentId") ? Convert.ToInt32(this.Services.Parameters["parentId"]) : Null.NullInteger; } set { - Services.Parameters["parentId"] = value.ToString(); + this.Services.Parameters["parentId"] = value.ToString(); } } public string Filter { - get { return Services.Parameters.ContainsKey("filter") ? Services.Parameters["filter"] : string.Empty; } - set { Services.Parameters["filter"] = value; } + get { return this.Services.Parameters.ContainsKey("filter") ? this.Services.Parameters["filter"] : string.Empty; } + set { this.Services.Parameters["filter"] = value; } } public bool IncludeNoneSpecificItem { get; set; } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileEditControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileEditControl.cs index 154893969ec..31eb45b0f43 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileEditControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileEditControl.cs @@ -52,23 +52,23 @@ public class DnnFileEditControl : IntegerEditControl protected override void CreateChildControls() { //First clear the controls collection - Controls.Clear(); + this.Controls.Clear(); - var userControl = Page.LoadControl("~/controls/filepickeruploader.ascx"); - _fileControl = userControl as DnnFilePickerUploader; + var userControl = this.Page.LoadControl("~/controls/filepickeruploader.ascx"); + this._fileControl = userControl as DnnFilePickerUploader; - if (_fileControl != null) + if (this._fileControl != null) { - _fileControl.ID = string.Format("{0}FileControl", ID); - _fileControl.FileFilter = FileFilter; - _fileControl.FilePath = FilePath; - _fileControl.FileID = IntegerValue; - _fileControl.UsePersonalFolder = true; - _fileControl.User = User; - _fileControl.Required = true; + this._fileControl.ID = string.Format("{0}FileControl", this.ID); + this._fileControl.FileFilter = this.FileFilter; + this._fileControl.FilePath = this.FilePath; + this._fileControl.FileID = this.IntegerValue; + this._fileControl.UsePersonalFolder = true; + this._fileControl.User = this.User; + this._fileControl.Required = true; //Add table to Control - Controls.Add(_fileControl); + this.Controls.Add(this._fileControl); } base.CreateChildControls(); @@ -76,7 +76,7 @@ protected override void CreateChildControls() protected override void OnInit(EventArgs e) { - EnsureChildControls(); + this.EnsureChildControls(); base.OnInit(e); } @@ -89,11 +89,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - _fileControl.FileID = IntegerValue; + this._fileControl.FileID = this.IntegerValue; - if (Page != null) + if (this.Page != null) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -105,7 +105,7 @@ protected override void OnPreRender(EventArgs e) /// ----------------------------------------------------------------------------- protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } #endregion @@ -127,12 +127,12 @@ protected override void RenderEditMode(HtmlTextWriter writer) public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; //string postedValue = postCollection[string.Format("{0}FileControl$dnnFileUploadFileId", postDataKey)]; - string postedValue = _fileControl.FileID.ToString(); + string postedValue = this._fileControl.FileID.ToString(); if (!presentValue.Equals(postedValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } return dataChanged; diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePicker.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePicker.cs index 81d3b8ee0d7..29b786e995c 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePicker.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePicker.cs @@ -99,9 +99,9 @@ protected bool IsHost { get { - var isHost = Globals.IsHostTab(PortalSettings.ActiveTab.TabID); + var isHost = Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID); //if not host tab but current edit user is a host user, then return true - if(!isHost && User != null && User.IsSuperUser) + if(!isHost && this.User != null && this.User.IsSuperUser) { isHost = true; } @@ -114,11 +114,11 @@ public int MaxHeight { get { - return _maxHeight; + return this._maxHeight; } set { - _maxHeight = value; + this._maxHeight = value; } } @@ -126,11 +126,11 @@ public int MaxWidth { get { - return _maxWidth; + return this._maxWidth; } set { - _maxWidth = value; + this._maxWidth = value; } } @@ -145,11 +145,11 @@ protected FileControlMode Mode { get { - return ViewState["Mode"] == null ? FileControlMode.Normal : (FileControlMode) ViewState["Mode"]; + return this.ViewState["Mode"] == null ? FileControlMode.Normal : (FileControlMode) this.ViewState["Mode"]; } set { - ViewState["Mode"] = value; + this.ViewState["Mode"] = value; } } @@ -161,7 +161,7 @@ protected string ParentFolder { get { - return IsHost ? Globals.HostMapPath : PortalSettings.HomeDirectoryMapPath; + return this.IsHost ? Globals.HostMapPath : this.PortalSettings.HomeDirectoryMapPath; } } @@ -176,13 +176,13 @@ protected int PortalId { get { - if ((Page.Request.QueryString["pid"] != null) && (Globals.IsHostTab(PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) + if ((this.Page.Request.QueryString["pid"] != null) && (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) { - return Int32.Parse(Page.Request.QueryString["pid"]); + return Int32.Parse(this.Page.Request.QueryString["pid"]); } - if (!IsHost) + if (!this.IsHost) { - return PortalSettings.PortalId; + return this.PortalSettings.PortalId; } return Null.NullInteger; @@ -215,12 +215,12 @@ public string CommandCssClass { get { - var cssClass = Convert.ToString(ViewState["CommandCssClass"]); + var cssClass = Convert.ToString(this.ViewState["CommandCssClass"]); return string.IsNullOrEmpty(cssClass) ? "dnnSecondaryAction" : cssClass; } set { - ViewState["CommandCssClass"] = value; + this.ViewState["CommandCssClass"] = value; } } @@ -235,11 +235,11 @@ public string FileFilter { get { - return ViewState["FileFilter"] != null ? (string) ViewState["FileFilter"] : ""; + return this.ViewState["FileFilter"] != null ? (string) this.ViewState["FileFilter"] : ""; } set { - ViewState["FileFilter"] = value; + this.ViewState["FileFilter"] = value; } } @@ -251,29 +251,29 @@ public int FileID { get { - EnsureChildControls(); - if (ViewState["FileID"] == null) + this.EnsureChildControls(); + if (this.ViewState["FileID"] == null) { //Get FileId from the file combo var fileId = Null.NullInteger; - if (_cboFiles.SelectedItem != null) + if (this._cboFiles.SelectedItem != null) { - fileId = Int32.Parse(_cboFiles.SelectedItem.Value); + fileId = Int32.Parse(this._cboFiles.SelectedItem.Value); } - ViewState["FileID"] = fileId; + this.ViewState["FileID"] = fileId; } - return Convert.ToInt32(ViewState["FileID"]); + return Convert.ToInt32(this.ViewState["FileID"]); } set { - EnsureChildControls(); - ViewState["FileID"] = value; - if (string.IsNullOrEmpty(FilePath)) + this.EnsureChildControls(); + this.ViewState["FileID"] = value; + if (string.IsNullOrEmpty(this.FilePath)) { var fileInfo = FileManager.Instance.GetFile(value); if (fileInfo != null) { - SetFilePath(fileInfo.Folder + fileInfo.FileName); + this.SetFilePath(fileInfo.Folder + fileInfo.FileName); } } } @@ -287,11 +287,11 @@ public string FilePath { get { - return Convert.ToString(ViewState["FilePath"]); + return Convert.ToString(this.ViewState["FilePath"]); } set { - ViewState["FilePath"] = value; + this.ViewState["FilePath"] = value; } } @@ -306,11 +306,11 @@ public bool UsePersonalFolder { get { - return ViewState["UsePersonalFolder"] != null && Convert.ToBoolean(ViewState["UsePersonalFolder"]); + return this.ViewState["UsePersonalFolder"] != null && Convert.ToBoolean(this.ViewState["UsePersonalFolder"]); } set { - ViewState["UsePersonalFolder"] = value; + this.ViewState["UsePersonalFolder"] = value; } } @@ -322,12 +322,12 @@ public string LabelCssClass { get { - var cssClass = Convert.ToString(ViewState["LabelCssClass"]); + var cssClass = Convert.ToString(this.ViewState["LabelCssClass"]); return string.IsNullOrEmpty(cssClass) ? "" : cssClass; } set { - ViewState["LabelCssClass"] = value; + this.ViewState["LabelCssClass"] = value; } } @@ -335,12 +335,12 @@ public string Permissions { get { - var permissions = Convert.ToString(ViewState["Permissions"]); + var permissions = Convert.ToString(this.ViewState["Permissions"]); return string.IsNullOrEmpty(permissions) ? "BROWSE,ADD" : permissions; } set { - ViewState["Permissions"] = value; + this.ViewState["Permissions"] = value; } } @@ -355,11 +355,11 @@ public bool Required { get { - return ViewState["Required"] != null && Convert.ToBoolean(ViewState["Required"]); + return this.ViewState["Required"] != null && Convert.ToBoolean(this.ViewState["Required"]); } set { - ViewState["Required"] = value; + this.ViewState["Required"] = value; } } @@ -367,11 +367,11 @@ public bool ShowFolders { get { - return ViewState["ShowFolders"] == null || Convert.ToBoolean(ViewState["ShowFolders"]); + return this.ViewState["ShowFolders"] == null || Convert.ToBoolean(this.ViewState["ShowFolders"]); } set { - ViewState["ShowFolders"] = value; + this.ViewState["ShowFolders"] = value; } } @@ -386,11 +386,11 @@ public bool ShowUpLoad { get { - return ViewState["ShowUpLoad"] == null || Convert.ToBoolean(ViewState["ShowUpLoad"]); + return this.ViewState["ShowUpLoad"] == null || Convert.ToBoolean(this.ViewState["ShowUpLoad"]); } set { - ViewState["ShowUpLoad"] = value; + this.ViewState["ShowUpLoad"] = value; } } @@ -407,10 +407,10 @@ public bool ShowUpLoad private void AddButton(ref LinkButton button) { button = new LinkButton {EnableViewState = false, CausesValidation = false}; - button.ControlStyle.CssClass = CommandCssClass; + button.ControlStyle.CssClass = this.CommandCssClass; button.Visible = false; - _pnlButtons.Controls.Add(button); + this._pnlButtons.Controls.Add(button); } /// @@ -418,18 +418,18 @@ private void AddButton(ref LinkButton button) /// private void AddButtonArea() { - _pnlButtons = new Panel {Visible = false}; + this._pnlButtons = new Panel {Visible = false}; - AddButton(ref _cmdUpload); - _cmdUpload.Click += UploadFile; + this.AddButton(ref this._cmdUpload); + this._cmdUpload.Click += this.UploadFile; - AddButton(ref _cmdSave); - _cmdSave.Click += SaveFile; + this.AddButton(ref this._cmdSave); + this._cmdSave.Click += this.SaveFile; - AddButton(ref _cmdCancel); - _cmdCancel.Click += CancelUpload; + this.AddButton(ref this._cmdCancel); + this._cmdCancel.Click += this.CancelUpload; - _pnlLeftDiv.Controls.Add(_pnlButtons); + this._pnlLeftDiv.Controls.Add(this._pnlButtons); } /// @@ -438,28 +438,28 @@ private void AddButtonArea() private void AddFileAndUploadArea() { //Create Url Div - _pnlFile = new Panel {CssClass = "dnnFormItem"}; + this._pnlFile = new Panel {CssClass = "dnnFormItem"}; //Create File Label - _lblFile = new Label {EnableViewState = false}; - _pnlFile.Controls.Add(_lblFile); + this._lblFile = new Label {EnableViewState = false}; + this._pnlFile.Controls.Add(this._lblFile); //Create Files Combo - _cboFiles = new DropDownList {ID = "File", DataTextField = "Text", DataValueField = "Value", AutoPostBack = true}; - _cboFiles.SelectedIndexChanged += FileChanged; - _pnlFile.Controls.Add(_cboFiles); + this._cboFiles = new DropDownList {ID = "File", DataTextField = "Text", DataValueField = "Value", AutoPostBack = true}; + this._cboFiles.SelectedIndexChanged += this.FileChanged; + this._pnlFile.Controls.Add(this._cboFiles); - _pnlLeftDiv.Controls.Add(_pnlFile); + this._pnlLeftDiv.Controls.Add(this._pnlFile); //Create Upload Div - _pnlUpload = new Panel {CssClass = "dnnFormItem"}; + this._pnlUpload = new Panel {CssClass = "dnnFormItem"}; //Create Upload Box - _txtFile = new HtmlInputFile(); - _txtFile.Attributes.Add("size", "13"); - _pnlUpload.Controls.Add(_txtFile); + this._txtFile = new HtmlInputFile(); + this._txtFile.Attributes.Add("size", "13"); + this._pnlUpload.Controls.Add(this._txtFile); - _pnlLeftDiv.Controls.Add(_pnlUpload); + this._pnlLeftDiv.Controls.Add(this._pnlUpload); } /// @@ -468,22 +468,22 @@ private void AddFileAndUploadArea() private void AddFolderArea() { //Create Url Div - _pnlFolder = new Panel {CssClass = "dnnFormItem"}; + this._pnlFolder = new Panel {CssClass = "dnnFormItem"}; //Create Folder Label - _lblFolder = new Label {EnableViewState = false}; - _pnlFolder.Controls.Add(_lblFolder); + this._lblFolder = new Label {EnableViewState = false}; + this._pnlFolder.Controls.Add(this._lblFolder); //Create Folders Combo - _cboFolders = new DropDownList {ID = "Folder", AutoPostBack = true}; - _cboFolders.SelectedIndexChanged += FolderChanged; - _pnlFolder.Controls.Add(_cboFolders); + this._cboFolders = new DropDownList {ID = "Folder", AutoPostBack = true}; + this._cboFolders.SelectedIndexChanged += this.FolderChanged; + this._pnlFolder.Controls.Add(this._cboFolders); // add to left div - _pnlLeftDiv.Controls.Add(_pnlFolder); + this._pnlLeftDiv.Controls.Add(this._pnlFolder); //Load Folders - LoadFolders(); + this.LoadFolders(); } /// @@ -491,8 +491,8 @@ private void AddFolderArea() /// private void GeneratePreviewImage() { - _imgPreview = new Image(); - _pnlRightDiv.Controls.Add(_imgPreview); + this._imgPreview = new Image(); + this._pnlRightDiv.Controls.Add(this._imgPreview); } /// @@ -500,30 +500,30 @@ private void GeneratePreviewImage() /// private void AddMessageRow() { - _pnlMessage = new Panel {CssClass = "dnnFormMessage dnnFormWarning"}; + this._pnlMessage = new Panel {CssClass = "dnnFormMessage dnnFormWarning"}; //Create Label - _lblMessage = new Label {EnableViewState = false, Text = ""}; - _pnlMessage.Controls.Add(_lblMessage); + this._lblMessage = new Label {EnableViewState = false, Text = ""}; + this._pnlMessage.Controls.Add(this._lblMessage); - _pnlLeftDiv.Controls.Add(_pnlMessage); + this._pnlLeftDiv.Controls.Add(this._pnlMessage); } private bool IsUserFolder(string folderPath) { - UserInfo user = User ?? UserController.Instance.GetCurrentUserInfo(); + UserInfo user = this.User ?? UserController.Instance.GetCurrentUserInfo(); return (folderPath.StartsWith("users/", StringComparison.InvariantCultureIgnoreCase) && folderPath.EndsWith(string.Format("/{0}/", user.UserID))); } private void LoadFiles() { - int effectivePortalId = PortalId; - if (IsUserFolder(_cboFolders.SelectedItem.Value)) + int effectivePortalId = this.PortalId; + if (this.IsUserFolder(this._cboFolders.SelectedItem.Value)) { - effectivePortalId = PortalController.GetEffectivePortalId(PortalId); + effectivePortalId = PortalController.GetEffectivePortalId(this.PortalId); } - _cboFiles.DataSource = Globals.GetFileList(effectivePortalId, FileFilter, !Required, _cboFolders.SelectedItem.Value); - _cboFiles.DataBind(); + this._cboFiles.DataSource = Globals.GetFileList(effectivePortalId, this.FileFilter, !this.Required, this._cboFolders.SelectedItem.Value); + this._cboFiles.DataBind(); } /// @@ -531,14 +531,14 @@ private void LoadFiles() /// private void LoadFolders() { - UserInfo user = User ?? UserController.Instance.GetCurrentUserInfo(); - _cboFolders.Items.Clear(); + UserInfo user = this.User ?? UserController.Instance.GetCurrentUserInfo(); + this._cboFolders.Items.Clear(); //Add Personal Folder - if (UsePersonalFolder) + if (this.UsePersonalFolder) { var userFolder = FolderManager.Instance.GetUserFolder(user).FolderPath; - var userFolderItem = _cboFolders.Items.FindByValue(userFolder); + var userFolderItem = this._cboFolders.Items.FindByValue(userFolder); if (userFolderItem != null) { userFolderItem.Text = Utilities.GetLocalizedString("MyFolder"); @@ -546,12 +546,12 @@ private void LoadFolders() else { //Add DummyFolder - _cboFolders.Items.Add(new ListItem(Utilities.GetLocalizedString("MyFolder"), userFolder)); + this._cboFolders.Items.Add(new ListItem(Utilities.GetLocalizedString("MyFolder"), userFolder)); } } else { - var folders = FolderManager.Instance.GetFolders(PortalId, "READ,ADD", user.UserID); + var folders = FolderManager.Instance.GetFolders(this.PortalId, "READ,ADD", user.UserID); foreach (FolderInfo folder in folders) { var folderItem = new ListItem @@ -562,7 +562,7 @@ private void LoadFolders() : folder.DisplayPath, Value = folder.FolderPath }; - _cboFolders.Items.Add(folderItem); + this._cboFolders.Items.Add(folderItem); } } } @@ -575,7 +575,7 @@ private void LoadFolders() /// private void SetFilePath() { - SetFilePath(_cboFiles.SelectedItem.Text); + this.SetFilePath(this._cboFiles.SelectedItem.Text); } /// @@ -587,13 +587,13 @@ private void SetFilePath() /// The filename to use in setting the property private void SetFilePath(string fileName) { - if (string.IsNullOrEmpty(_cboFolders.SelectedItem.Value)) + if (string.IsNullOrEmpty(this._cboFolders.SelectedItem.Value)) { - FilePath = fileName; + this.FilePath = fileName; } else { - FilePath = (_cboFolders.SelectedItem.Value + "/") + fileName; + this.FilePath = (this._cboFolders.SelectedItem.Value + "/") + fileName; } } @@ -610,7 +610,7 @@ private void ShowButton(LinkButton button, string command) button.Text = Utilities.GetLocalizedString(command); } AJAX.RegisterPostBackControl(button); - _pnlButtons.Visible = true; + this._pnlButtons.Visible = true; } /// @@ -618,29 +618,29 @@ private void ShowButton(LinkButton button, string command) /// private void ShowImage() { - var image = (FileInfo)FileManager.Instance.GetFile(FileID); + var image = (FileInfo)FileManager.Instance.GetFile(this.FileID); if (image != null) { - _imgPreview.ImageUrl = FileManager.Instance.GetUrl(image); + this._imgPreview.ImageUrl = FileManager.Instance.GetUrl(image); try { - Utilities.CreateThumbnail(image, _imgPreview, MaxWidth, MaxHeight); + Utilities.CreateThumbnail(image, this._imgPreview, this.MaxWidth, this.MaxHeight); } catch (Exception) { Logger.WarnFormat("Unable to create thumbnail for {0}", image.PhysicalPath); - _pnlRightDiv.Visible = false; + this._pnlRightDiv.Visible = false; } } else { - _imgPreview.Visible = false; + this._imgPreview.Visible = false; Panel imageHolderPanel = new Panel { CssClass = "dnnFilePickerImageHolder" }; - _pnlRightDiv.Controls.Add(imageHolderPanel); - _pnlRightDiv.Visible = true; + this._pnlRightDiv.Controls.Add(imageHolderPanel); + this._pnlRightDiv.Visible = true; } } @@ -651,8 +651,8 @@ private void ShowImage() protected override void OnInit(EventArgs e) { base.OnInit(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); - EnsureChildControls(); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.EnsureChildControls(); } /// @@ -662,26 +662,26 @@ protected override void OnInit(EventArgs e) protected override void CreateChildControls() { //First clear the controls collection - Controls.Clear(); + this.Controls.Clear(); - _pnlContainer = new Panel {CssClass = "dnnFilePicker"}; + this._pnlContainer = new Panel {CssClass = "dnnFilePicker"}; - _pnlLeftDiv = new Panel {CssClass = "dnnLeft"}; + this._pnlLeftDiv = new Panel {CssClass = "dnnLeft"}; - AddFolderArea(); - AddFileAndUploadArea(); - AddButtonArea(); - AddMessageRow(); + this.AddFolderArea(); + this.AddFileAndUploadArea(); + this.AddButtonArea(); + this.AddMessageRow(); - _pnlContainer.Controls.Add(_pnlLeftDiv); + this._pnlContainer.Controls.Add(this._pnlLeftDiv); - _pnlRightDiv = new Panel {CssClass = "dnnLeft"}; + this._pnlRightDiv = new Panel {CssClass = "dnnLeft"}; - GeneratePreviewImage(); + this.GeneratePreviewImage(); - _pnlContainer.Controls.Add(_pnlRightDiv); + this._pnlContainer.Controls.Add(this._pnlRightDiv); - Controls.Add(_pnlContainer); + this.Controls.Add(this._pnlContainer); base.CreateChildControls(); } @@ -693,88 +693,88 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (_cboFolders.Items.Count > 0) + if (this._cboFolders.Items.Count > 0) { //Configure Labels - _lblFolder.Text = Utilities.GetLocalizedString("Folder"); - _lblFolder.CssClass = LabelCssClass; - _lblFile.Text = Utilities.GetLocalizedString("File"); - _lblFile.CssClass = LabelCssClass; + this._lblFolder.Text = Utilities.GetLocalizedString("Folder"); + this._lblFolder.CssClass = this.LabelCssClass; + this._lblFile.Text = Utilities.GetLocalizedString("File"); + this._lblFile.CssClass = this.LabelCssClass; //select folder string fileName; string folderPath; - if (!string.IsNullOrEmpty(FilePath)) + if (!string.IsNullOrEmpty(this.FilePath)) { - fileName = FilePath.Substring(FilePath.LastIndexOf("/") + 1); - folderPath = string.IsNullOrEmpty(fileName) ? FilePath : FilePath.Replace(fileName, ""); + fileName = this.FilePath.Substring(this.FilePath.LastIndexOf("/") + 1); + folderPath = string.IsNullOrEmpty(fileName) ? this.FilePath : this.FilePath.Replace(fileName, ""); } else { - fileName = FilePath; + fileName = this.FilePath; folderPath = string.Empty; } - if (_cboFolders.Items.FindByValue(folderPath) != null) + if (this._cboFolders.Items.FindByValue(folderPath) != null) { - _cboFolders.SelectedIndex = -1; - _cboFolders.Items.FindByValue(folderPath).Selected = true; + this._cboFolders.SelectedIndex = -1; + this._cboFolders.Items.FindByValue(folderPath).Selected = true; } //Get Files - LoadFiles(); - if (_cboFiles.Items.FindByText(fileName) != null) + this.LoadFiles(); + if (this._cboFiles.Items.FindByText(fileName) != null) { - _cboFiles.Items.FindByText(fileName).Selected = true; + this._cboFiles.Items.FindByText(fileName).Selected = true; } - if (_cboFiles.SelectedItem == null || string.IsNullOrEmpty(_cboFiles.SelectedItem.Value)) + if (this._cboFiles.SelectedItem == null || string.IsNullOrEmpty(this._cboFiles.SelectedItem.Value)) { - FileID = -1; + this.FileID = -1; } else { - FileID = Int32.Parse(_cboFiles.SelectedItem.Value); + this.FileID = Int32.Parse(this._cboFiles.SelectedItem.Value); } - if (_cboFolders.Items.Count > 1 && ShowFolders) + if (this._cboFolders.Items.Count > 1 && this.ShowFolders) { - _pnlFolder.Visible = true; + this._pnlFolder.Visible = true; } else { - _pnlFolder.Visible = false; + this._pnlFolder.Visible = false; } //Configure Mode - switch (Mode) + switch (this.Mode) { case FileControlMode.Normal: - _pnlFile.Visible = true; - _pnlUpload.Visible = false; - _pnlRightDiv.Visible = true; - ShowImage(); + this._pnlFile.Visible = true; + this._pnlUpload.Visible = false; + this._pnlRightDiv.Visible = true; + this.ShowImage(); - if ((FolderPermissionController.HasFolderPermission(PortalId, _cboFolders.SelectedItem.Value, "ADD") || IsUserFolder(_cboFolders.SelectedItem.Value)) && ShowUpLoad) + if ((FolderPermissionController.HasFolderPermission(this.PortalId, this._cboFolders.SelectedItem.Value, "ADD") || this.IsUserFolder(this._cboFolders.SelectedItem.Value)) && this.ShowUpLoad) { - ShowButton(_cmdUpload, "Upload"); + this.ShowButton(this._cmdUpload, "Upload"); } break; case FileControlMode.UpLoadFile: - _pnlFile.Visible = false; - _pnlUpload.Visible = true; - _pnlRightDiv.Visible = false; - ShowButton(_cmdSave, "Save"); - ShowButton(_cmdCancel, "Cancel"); + this._pnlFile.Visible = false; + this._pnlUpload.Visible = true; + this._pnlRightDiv.Visible = false; + this.ShowButton(this._cmdSave, "Save"); + this.ShowButton(this._cmdCancel, "Cancel"); break; } } else { - _lblMessage.Text = Utilities.GetLocalizedString("NoPermission"); + this._lblMessage.Text = Utilities.GetLocalizedString("NoPermission"); } //Show message Row - _pnlMessage.Visible = (!string.IsNullOrEmpty(_lblMessage.Text)); + this._pnlMessage.Visible = (!string.IsNullOrEmpty(this._lblMessage.Text)); } #endregion @@ -783,102 +783,102 @@ protected override void OnPreRender(EventArgs e) private void CancelUpload(object sender, EventArgs e) { - Mode = FileControlMode.Normal; + this.Mode = FileControlMode.Normal; } private void FileChanged(object sender, EventArgs e) { - SetFilePath(); + this.SetFilePath(); } private void FolderChanged(object sender, EventArgs e) { - LoadFiles(); - SetFilePath(); + this.LoadFiles(); + this.SetFilePath(); } private void SaveFile(object sender, EventArgs e) { //if file is selected exit - if (!string.IsNullOrEmpty(_txtFile.PostedFile.FileName)) + if (!string.IsNullOrEmpty(this._txtFile.PostedFile.FileName)) { - var extension = Path.GetExtension(_txtFile.PostedFile.FileName).Replace(".", ""); + var extension = Path.GetExtension(this._txtFile.PostedFile.FileName).Replace(".", ""); - if (!string.IsNullOrEmpty(FileFilter) && !FileFilter.ToLowerInvariant().Contains(extension.ToLowerInvariant())) + if (!string.IsNullOrEmpty(this.FileFilter) && !this.FileFilter.ToLowerInvariant().Contains(extension.ToLowerInvariant())) { // trying to upload a file not allowed for current filter - var localizedString = Localization.GetString("UploadError", LocalResourceFile); + var localizedString = Localization.GetString("UploadError", this.LocalResourceFile); if(String.IsNullOrEmpty(localizedString)) { localizedString = Utilities.GetLocalizedString("UploadError"); } - _lblMessage.Text = string.Format(localizedString, FileFilter, extension); + this._lblMessage.Text = string.Format(localizedString, this.FileFilter, extension); } else { var folderManager = FolderManager.Instance; - var folderPath = PathUtils.Instance.GetRelativePath(PortalId, ParentFolder) + _cboFolders.SelectedItem.Value; + var folderPath = PathUtils.Instance.GetRelativePath(this.PortalId, this.ParentFolder) + this._cboFolders.SelectedItem.Value; //Check if this is a User Folder IFolderInfo folder; - if (IsUserFolder(_cboFolders.SelectedItem.Value)) + if (this.IsUserFolder(this._cboFolders.SelectedItem.Value)) { //Make sure the user folder exists - folder = folderManager.GetFolder(PortalController.GetEffectivePortalId(PortalId), folderPath); + folder = folderManager.GetFolder(PortalController.GetEffectivePortalId(this.PortalId), folderPath); if (folder == null) { //Add User folder - var user = User ?? UserController.Instance.GetCurrentUserInfo(); + var user = this.User ?? UserController.Instance.GetCurrentUserInfo(); //fix user's portal id - user.PortalID = PortalId; + user.PortalID = this.PortalId; folder = ((FolderManager)folderManager).AddUserFolder(user); } } else { - folder = folderManager.GetFolder(PortalId, folderPath); + folder = folderManager.GetFolder(this.PortalId, folderPath); } - var fileName = Path.GetFileName(_txtFile.PostedFile.FileName); + var fileName = Path.GetFileName(this._txtFile.PostedFile.FileName); try { - FileManager.Instance.AddFile(folder, fileName, _txtFile.PostedFile.InputStream, true); + FileManager.Instance.AddFile(folder, fileName, this._txtFile.PostedFile.InputStream, true); } catch (PermissionsNotMetException) { - _lblMessage.Text += "
" + string.Format(Localization.GetString("InsufficientFolderPermission"), folder.FolderPath); + this._lblMessage.Text += "
" + string.Format(Localization.GetString("InsufficientFolderPermission"), folder.FolderPath); } catch (NoSpaceAvailableException) { - _lblMessage.Text += "
" + string.Format(Localization.GetString("DiskSpaceExceeded"), fileName); + this._lblMessage.Text += "
" + string.Format(Localization.GetString("DiskSpaceExceeded"), fileName); } catch (InvalidFileExtensionException) { - _lblMessage.Text += "
" + string.Format(Localization.GetString("RestrictedFileType"), fileName, Host.AllowedExtensionWhitelist.ToDisplayString()); + this._lblMessage.Text += "
" + string.Format(Localization.GetString("RestrictedFileType"), fileName, Host.AllowedExtensionWhitelist.ToDisplayString()); } catch (Exception ex) { Logger.Error(ex); - _lblMessage.Text += "
" + string.Format(Localization.GetString("SaveFileError"), fileName); + this._lblMessage.Text += "
" + string.Format(Localization.GetString("SaveFileError"), fileName); } } - if (string.IsNullOrEmpty(_lblMessage.Text)) + if (string.IsNullOrEmpty(this._lblMessage.Text)) { - var fileName = _txtFile.PostedFile.FileName.Substring(_txtFile.PostedFile.FileName.LastIndexOf("\\") + 1); - SetFilePath(fileName); + var fileName = this._txtFile.PostedFile.FileName.Substring(this._txtFile.PostedFile.FileName.LastIndexOf("\\") + 1); + this.SetFilePath(fileName); } } - Mode = FileControlMode.Normal; + this.Mode = FileControlMode.Normal; } private void UploadFile(object sender, EventArgs e) { - Mode = FileControlMode.UpLoadFile; + this.Mode = FileControlMode.UpLoadFile; } #endregion @@ -889,11 +889,11 @@ public bool Localize { get { - return _localize; + return this._localize; } set { - _localize = value; + this._localize = value; } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePickerUploader.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePickerUploader.cs index 88eb38ad8fa..5fe8461340d 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePickerUploader.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFilePickerUploader.cs @@ -85,12 +85,12 @@ public string FilePath { get { - EnsureChildControls(); + this.EnsureChildControls(); var path = string.Empty; - if (FoldersComboBox.SelectedFolder != null && FilesComboBox.SelectedFile != null) + if (this.FoldersComboBox.SelectedFolder != null && this.FilesComboBox.SelectedFile != null) { - path = FilesComboBox.SelectedFile.RelativePath; + path = this.FilesComboBox.SelectedFile.RelativePath; } return path; @@ -98,22 +98,22 @@ public string FilePath set { - EnsureChildControls(); + this.EnsureChildControls(); if (!string.IsNullOrEmpty(value)) { - var file = FileManager.Instance.GetFile(PortalId, value); + var file = FileManager.Instance.GetFile(this.PortalId, value); if (file != null) { - FoldersComboBox.SelectedFolder = FolderManager.Instance.GetFolder(file.FolderId); - FilesComboBox.SelectedFile = file; + this.FoldersComboBox.SelectedFolder = FolderManager.Instance.GetFolder(file.FolderId); + this.FilesComboBox.SelectedFile = file; } } else { - FoldersComboBox.SelectedFolder = null; - FilesComboBox.SelectedFile = null; + this.FoldersComboBox.SelectedFolder = null; + this.FilesComboBox.SelectedFile = null; - LoadFolders(); + this.LoadFolders(); } } } @@ -122,19 +122,19 @@ public int FileID { get { - EnsureChildControls(); + this.EnsureChildControls(); - return FilesComboBox.SelectedFile != null ? FilesComboBox.SelectedFile.FileId : Null.NullInteger; + return this.FilesComboBox.SelectedFile != null ? this.FilesComboBox.SelectedFile.FileId : Null.NullInteger; } set { - EnsureChildControls(); + this.EnsureChildControls(); var file = FileManager.Instance.GetFile(value); if (file != null) { - FoldersComboBox.SelectedFolder = FolderManager.Instance.GetFolder(file.FolderId); - FilesComboBox.SelectedFile = file; + this.FoldersComboBox.SelectedFolder = FolderManager.Instance.GetFolder(file.FolderId); + this.FilesComboBox.SelectedFile = file; } } } @@ -143,16 +143,16 @@ public string FolderPath { get { - return _folderPathSet - ? _folderPath - : FoldersComboBox.SelectedFolder != null - ? FoldersComboBox.SelectedFolder.FolderPath + return this._folderPathSet + ? this._folderPath + : this.FoldersComboBox.SelectedFolder != null + ? this.FoldersComboBox.SelectedFolder.FolderPath : string.Empty; } set { - _folderPath = value; - _folderPathSet = true; + this._folderPath = value; + this._folderPathSet = true; } } @@ -160,18 +160,18 @@ public string FileFilter { get { - return _fileFilter; + return this._fileFilter; } set { - _fileFilter = value; + this._fileFilter = value; if (!string.IsNullOrEmpty(value)) { - FileUploadControl.Options.Extensions = value.Split(',').ToList(); + this.FileUploadControl.Options.Extensions = value.Split(',').ToList(); } else { - FileUploadControl.Options.Extensions.RemoveAll(t => true); + this.FileUploadControl.Options.Extensions.RemoveAll(t => true); } } } @@ -184,18 +184,18 @@ public int PortalId { get { - return !_portalId.HasValue ? PortalSettings.Current.PortalId : _portalId.Value; + return !this._portalId.HasValue ? PortalSettings.Current.PortalId : this._portalId.Value; } set { - _portalId = value; + this._portalId = value; } } public bool SupportHost { - get { return FileUploadControl.SupportHost; } - set { FileUploadControl.SupportHost = value; } + get { return this.FileUploadControl.SupportHost; } + set { this.FileUploadControl.SupportHost = value; } } #endregion @@ -206,66 +206,66 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - FoldersComboBox.SelectItemDefaultText = (SupportHost && PortalSettings.Current.ActiveTab.IsSuperTab) ? DynamicSharedConstants.HostRootFolder : DynamicSharedConstants.RootFolder; - FoldersComboBox.OnClientSelectionChanged.Add("dnn.dnnFileUpload.Folders_Changed"); - FoldersComboBox.Options.Services.Parameters.Add("permission", "READ,ADD"); + this.FoldersComboBox.SelectItemDefaultText = (this.SupportHost && PortalSettings.Current.ActiveTab.IsSuperTab) ? DynamicSharedConstants.HostRootFolder : DynamicSharedConstants.RootFolder; + this.FoldersComboBox.OnClientSelectionChanged.Add("dnn.dnnFileUpload.Folders_Changed"); + this.FoldersComboBox.Options.Services.Parameters.Add("permission", "READ,ADD"); - FilesComboBox.OnClientSelectionChanged.Add("dnn.dnnFileUpload.Files_Changed"); - FilesComboBox.SelectItemDefaultText = DynamicSharedConstants.Unspecified; - FilesComboBox.IncludeNoneSpecificItem = true; - FilesComboBox.Filter = FileFilter; + this.FilesComboBox.OnClientSelectionChanged.Add("dnn.dnnFileUpload.Files_Changed"); + this.FilesComboBox.SelectItemDefaultText = DynamicSharedConstants.Unspecified; + this.FilesComboBox.IncludeNoneSpecificItem = true; + this.FilesComboBox.Filter = this.FileFilter; if (UrlUtils.InPopUp()) { - FileUploadControl.Width = 630; - FileUploadControl.Height = 400; + this.FileUploadControl.Width = 630; + this.FileUploadControl.Height = 400; } - LoadFolders(); - jQuery.RegisterFileUpload(Page); + this.LoadFolders(); + jQuery.RegisterFileUpload(this.Page); JavaScript.RequestRegistration(CommonJs.DnnPlugins); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); } protected override void OnPreRender(EventArgs e) { - if (FoldersComboBox.SelectedFolder != null && FoldersComboBox.SelectedFolder.FolderPath.StartsWith("Users/", StringComparison.InvariantCultureIgnoreCase)) + if (this.FoldersComboBox.SelectedFolder != null && this.FoldersComboBox.SelectedFolder.FolderPath.StartsWith("Users/", StringComparison.InvariantCultureIgnoreCase)) { - var userFolder = FolderManager.Instance.GetUserFolder(User ?? UserController.Instance.GetCurrentUserInfo()); - if (FoldersComboBox.SelectedFolder.FolderID == userFolder.FolderID) + var userFolder = FolderManager.Instance.GetUserFolder(this.User ?? UserController.Instance.GetCurrentUserInfo()); + if (this.FoldersComboBox.SelectedFolder.FolderID == userFolder.FolderID) { - FoldersComboBox.SelectedItem = new ListItem + this.FoldersComboBox.SelectedItem = new ListItem { Text = FolderManager.Instance.MyFolderName, Value = userFolder.FolderID.ToString(CultureInfo.InvariantCulture) }; } - else if (UsePersonalFolder) //if UserPersonalFolder is true, make sure the file is under the user folder. + else if (this.UsePersonalFolder) //if UserPersonalFolder is true, make sure the file is under the user folder. { - FoldersComboBox.SelectedItem = new ListItem + this.FoldersComboBox.SelectedItem = new ListItem { Text = FolderManager.Instance.MyFolderName, Value = userFolder.FolderID.ToString(CultureInfo.InvariantCulture) }; - FilesComboBox.SelectedFile = null; + this.FilesComboBox.SelectedFile = null; } } - FoldersLabel.Text = FolderManager.Instance.MyFolderName; + this.FoldersLabel.Text = FolderManager.Instance.MyFolderName; - FileUploadControl.Options.FolderPicker.Disabled = UsePersonalFolder; - if (FileUploadControl.Options.FolderPicker.Disabled && FoldersComboBox.SelectedFolder != null) + this.FileUploadControl.Options.FolderPicker.Disabled = this.UsePersonalFolder; + if (this.FileUploadControl.Options.FolderPicker.Disabled && this.FoldersComboBox.SelectedFolder != null) { var selectedItem = new SerializableKeyValuePair( - FoldersComboBox.SelectedItem.Value, FoldersComboBox.SelectedItem.Text); + this.FoldersComboBox.SelectedItem.Value, this.FoldersComboBox.SelectedItem.Text); - FileUploadControl.Options.FolderPicker.InitialState = new DnnDropDownListState + this.FileUploadControl.Options.FolderPicker.InitialState = new DnnDropDownListState { SelectedItem = selectedItem }; - FileUploadControl.Options.FolderPath = FoldersComboBox.SelectedFolder.FolderPath; + this.FileUploadControl.Options.FolderPath = this.FoldersComboBox.SelectedFolder.FolderPath; } base.OnPreRender(e); @@ -277,38 +277,38 @@ protected override void OnPreRender(EventArgs e) private void LoadFolders() { - if (UsePersonalFolder) + if (this.UsePersonalFolder) { - var user = User ?? UserController.Instance.GetCurrentUserInfo(); + var user = this.User ?? UserController.Instance.GetCurrentUserInfo(); var userFolder = FolderManager.Instance.GetUserFolder(user); - FoldersComboBox.SelectedFolder = userFolder; + this.FoldersComboBox.SelectedFolder = userFolder; } else { //select folder string fileName; string folderPath; - if (!string.IsNullOrEmpty(FilePath)) + if (!string.IsNullOrEmpty(this.FilePath)) { - fileName = FilePath.Substring(FilePath.LastIndexOf("/") + 1); - folderPath = string.IsNullOrEmpty(fileName) ? FilePath : FilePath.Replace(fileName, ""); + fileName = this.FilePath.Substring(this.FilePath.LastIndexOf("/") + 1); + folderPath = string.IsNullOrEmpty(fileName) ? this.FilePath : this.FilePath.Replace(fileName, ""); } else { - fileName = FilePath; - folderPath = FolderPath; + fileName = this.FilePath; + folderPath = this.FolderPath; } - FoldersComboBox.SelectedFolder = FolderManager.Instance.GetFolder(PortalId, folderPath); + this.FoldersComboBox.SelectedFolder = FolderManager.Instance.GetFolder(this.PortalId, folderPath); if (!string.IsNullOrEmpty(fileName)) { - FilesComboBox.SelectedFile = FileManager.Instance.GetFile(FoldersComboBox.SelectedFolder, fileName); + this.FilesComboBox.SelectedFile = FileManager.Instance.GetFile(this.FoldersComboBox.SelectedFolder, fileName); } } - FoldersComboBox.Enabled = !UsePersonalFolder; - FoldersLabel.Visible = UsePersonalFolder; + this.FoldersComboBox.Enabled = !this.UsePersonalFolder; + this.FoldersLabel.Visible = this.UsePersonalFolder; } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs index 99430123d35..de319babafc 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUpload.cs @@ -30,7 +30,7 @@ public DnnFileUploadOptions Options { get { - return _options.Value; + return this._options.Value; } } @@ -39,19 +39,19 @@ public int ModuleId set { var moduleIdString = value.ToString(CultureInfo.InvariantCulture); - Options.ModuleId = moduleIdString; - Options.FolderPicker.Services.ModuleId = moduleIdString; + this.Options.ModuleId = moduleIdString; + this.Options.FolderPicker.Services.ModuleId = moduleIdString; } } public string ParentClientId { - set { Options.ParentClientId = value; } + set { this.Options.ParentClientId = value; } } public bool ShowOnStartup { - set { Options.ShowOnStartup = value; } + set { this.Options.ShowOnStartup = value; } } public string Skin { get; set; } @@ -60,14 +60,14 @@ public bool ShowOnStartup public int Width { - get { return Options.Width; } - set { Options.Width = value; } + get { return this.Options.Width; } + set { this.Options.Width = value; } } public int Height { - get { return Options.Height; } - set { Options.Height = value; } + get { return this.Options.Height; } + set { this.Options.Height = value; } } public static DnnFileUpload GetCurrent(Page page) @@ -80,15 +80,15 @@ protected override void OnInit(EventArgs e) base.OnInit(e); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - jQuery.RegisterFileUpload(Page); + jQuery.RegisterFileUpload(this.Page); } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - RegisterClientScript(Page, Skin); - RegisterStartupScript(); + RegisterClientScript(this.Page, this.Skin); + this.RegisterStartupScript(); } private static void RegisterClientScript(Page page, string skin) @@ -110,55 +110,55 @@ private static void RegisterClientScript(Page page, string skin) private void RegisterStartupScript() { - Options.ClientId = ClientID; + this.Options.ClientId = this.ClientID; var portalSettings = PortalSettings.Current; - if (Options.FolderPicker.InitialState == null) + if (this.Options.FolderPicker.InitialState == null) { var folder = FolderManager.Instance.GetFolder(portalSettings.PortalId, string.Empty); - var rootFolder = (SupportHost && portalSettings.ActiveTab.IsSuperTab) ? DynamicSharedConstants.HostRootFolder : DynamicSharedConstants.RootFolder; + var rootFolder = (this.SupportHost && portalSettings.ActiveTab.IsSuperTab) ? DynamicSharedConstants.HostRootFolder : DynamicSharedConstants.RootFolder; - Options.FolderPicker.InitialState = new DnnDropDownListState + this.Options.FolderPicker.InitialState = new DnnDropDownListState { SelectedItem = (folder != null) ? new SerializableKeyValuePair(folder.FolderID.ToString(CultureInfo.InvariantCulture), rootFolder) : null }; } - if (Options.Extensions.Count > 0) + if (this.Options.Extensions.Count > 0) { - var extensionsText = Options.Extensions.Aggregate(string.Empty, (current, extension) => current.Append(extension, ", ")); - Options.Resources.InvalidFileExtensions = string.Format(Options.Resources.InvalidFileExtensions, extensionsText); + var extensionsText = this.Options.Extensions.Aggregate(string.Empty, (current, extension) => current.Append(extension, ", ")); + this.Options.Resources.InvalidFileExtensions = string.Format(this.Options.Resources.InvalidFileExtensions, extensionsText); } - if (Options.MaxFiles > 0) + if (this.Options.MaxFiles > 0) { - Options.Resources.TooManyFiles = string.Format(Options.Resources.TooManyFiles, Options.MaxFiles.ToString(CultureInfo.InvariantCulture)); + this.Options.Resources.TooManyFiles = string.Format(this.Options.Resources.TooManyFiles, this.Options.MaxFiles.ToString(CultureInfo.InvariantCulture)); } - if (!SupportHost) + if (!this.SupportHost) { - Options.FolderPicker.Services.Parameters["portalId"] = portalSettings.PortalId.ToString(); + this.Options.FolderPicker.Services.Parameters["portalId"] = portalSettings.PortalId.ToString(); } - Options.FolderPicker.Services.GetTreeMethod = "ItemListService/GetFolders"; - Options.FolderPicker.Services.GetNodeDescendantsMethod = "ItemListService/GetFolderDescendants"; - Options.FolderPicker.Services.SearchTreeMethod = "ItemListService/SearchFolders"; - Options.FolderPicker.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForFolder"; - Options.FolderPicker.Services.SortTreeMethod = "ItemListService/SortFolders"; - Options.FolderPicker.Services.ServiceRoot = "InternalServices"; + this.Options.FolderPicker.Services.GetTreeMethod = "ItemListService/GetFolders"; + this.Options.FolderPicker.Services.GetNodeDescendantsMethod = "ItemListService/GetFolderDescendants"; + this.Options.FolderPicker.Services.SearchTreeMethod = "ItemListService/SearchFolders"; + this.Options.FolderPicker.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForFolder"; + this.Options.FolderPicker.Services.SortTreeMethod = "ItemListService/SortFolders"; + this.Options.FolderPicker.Services.ServiceRoot = "InternalServices"; - var optionsAsJsonString = Json.Serialize(Options); + var optionsAsJsonString = Json.Serialize(this.Options); var script = string.Format("dnn.createFileUpload({0});{1}", optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), ClientID + "DnnFileUpload", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), this.ClientID + "DnnFileUpload", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), ClientID + "DnnFileUpload", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID + "DnnFileUpload", script, true); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUploadOptions.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUploadOptions.cs index 3f1a9c6a3b4..cf1df0a2364 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUploadOptions.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFileUploadOptions.cs @@ -135,7 +135,7 @@ public Dictionary Parameters { get { - return _parameters ?? (_parameters = new Dictionary()); + return this._parameters ?? (this._parameters = new Dictionary()); } } @@ -148,7 +148,7 @@ public string ValidationCode get { var portalSettings = PortalSettings.Current; - var parameters = new List(){Extensions}; + var parameters = new List(){this.Extensions}; if (portalSettings != null) { parameters.Add(portalSettings.PortalId); @@ -161,12 +161,12 @@ public string ValidationCode public DnnFileUploadOptions() { - FolderPicker = new DnnDropDownListOptions(); - MaxFileSize = (int)Config.GetMaxUploadSize(); - Extensions = new List(); - Width = DefaultWidth; - Height = DefaultHeight; - Resources = new DnnFileUploadResources + this.FolderPicker = new DnnDropDownListOptions(); + this.MaxFileSize = (int)Config.GetMaxUploadSize(); + this.Extensions = new List(); + this.Width = DefaultWidth; + this.Height = DefaultHeight; + this.Resources = new DnnFileUploadResources { Title = Utilities.GetLocalizedString("FileUpload.Title.Text"), DecompressLabel = Utilities.GetLocalizedString("FileUpload.DecompressLabel.Text"), @@ -177,7 +177,7 @@ public DnnFileUploadOptions() CloseButtonText = Utilities.GetLocalizedString("FileUpload.CloseButton.Text"), UploadFromWebButtonText = Utilities.GetLocalizedString("FileUpload.UploadFromWebButton.Text"), DecompressingFile = Utilities.GetLocalizedString("FileUpload.DecompressingFile.Text"), - FileIsTooLarge = string.Format(Utilities.GetLocalizedString("FileUpload.FileIsTooLarge.Error") + " Mb", (MaxFileSize / (1024 * 1024)).ToString(CultureInfo.InvariantCulture)), + FileIsTooLarge = string.Format(Utilities.GetLocalizedString("FileUpload.FileIsTooLarge.Error") + " Mb", (this.MaxFileSize / (1024 * 1024)).ToString(CultureInfo.InvariantCulture)), FileUploadCancelled = Utilities.GetLocalizedString("FileUpload.FileUploadCancelled.Error"), FileUploadFailed = Utilities.GetLocalizedString("FileUpload.FileUploadFailed.Error"), TooManyFiles = Utilities.GetLocalizedString("FileUpload.TooManyFiles.Error"), diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFolderDropDownList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFolderDropDownList.cs index e94b5e6d4b2..02ee6649adc 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFolderDropDownList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFolderDropDownList.cs @@ -26,15 +26,15 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - SelectItemDefaultText = Localization.GetString("DropDownList.SelectFolderDefaultText", Localization.SharedResourceFile); - Services.GetTreeMethod = "ItemListService/GetFolders"; - Services.GetNodeDescendantsMethod = "ItemListService/GetFolderDescendants"; - Services.SearchTreeMethod = "ItemListService/SearchFolders"; - Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForFolder"; - Services.SortTreeMethod = "ItemListService/SortFolders"; - Services.ServiceRoot = "InternalServices"; + this.SelectItemDefaultText = Localization.GetString("DropDownList.SelectFolderDefaultText", Localization.SharedResourceFile); + this.Services.GetTreeMethod = "ItemListService/GetFolders"; + this.Services.GetNodeDescendantsMethod = "ItemListService/GetFolderDescendants"; + this.Services.SearchTreeMethod = "ItemListService/SearchFolders"; + this.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForFolder"; + this.Services.SortTreeMethod = "ItemListService/SortFolders"; + this.Services.ServiceRoot = "InternalServices"; - Options.ItemList.DisableUnspecifiedOrder = true; + this.Options.ItemList.DisableUnspecifiedOrder = true; } protected override void OnPreRender(EventArgs e) @@ -43,7 +43,7 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); //add the selected folder's level path so that it can expand to the selected node in client side. - var selectedFolder = SelectedFolder; + var selectedFolder = this.SelectedFolder; if (selectedFolder != null && selectedFolder.ParentID > Null.NullInteger) { var folderLevel = string.Empty; @@ -54,7 +54,7 @@ protected override void OnPreRender(EventArgs e) parentFolder = (parentFolder.ParentID < 0) ? null : FolderManager.Instance.GetFolder(parentFolder.ParentID); } - ExpandPath = folderLevel.TrimEnd(','); + this.ExpandPath = folderLevel.TrimEnd(','); } } @@ -67,7 +67,7 @@ public IFolderInfo SelectedFolder { get { - var folderId = SelectedItemValueAsInt; + var folderId = this.SelectedItemValueAsInt; return (folderId == Null.NullInteger) ? null : FolderManager.Instance.GetFolder(folderId); } set @@ -78,7 +78,7 @@ public IFolderInfo SelectedFolder folderName = PortalSettings.Current.ActiveTab.IsSuperTab ? DynamicSharedConstants.HostRootFolder : DynamicSharedConstants.RootFolder; } - SelectedItem = (value != null) ? new ListItem() { Text = folderName, Value = value.FolderID.ToString(CultureInfo.InvariantCulture) } : null; + this.SelectedItem = (value != null) ? new ListItem() { Text = folderName, Value = value.FolderID.ToString(CultureInfo.InvariantCulture) } : null; } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditControlItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditControlItem.cs index 431c0690cb6..63f929906c8 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditControlItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditControlItem.cs @@ -23,30 +23,30 @@ public class DnnFormEditControlItem : DnnFormItemBase protected override WebControl CreateControlInternal(Control container) { - control = Reflection.CreateObject(ControlType, ControlType) as EditControl; + this.control = Reflection.CreateObject(this.ControlType, this.ControlType) as EditControl; - if (control != null) + if (this.control != null) { - control.ID = ID + "_Control"; - control.Name = ID; - control.EditMode = PropertyEditorMode.Edit; - control.Required = false; - control.Value = Value; - control.OldValue = Value; - control.ValueChanged += ValueChanged; - control.DataField = DataField; - - control.CssClass = "dnnFormInput"; - - container.Controls.Add(control); + this.control.ID = this.ID + "_Control"; + this.control.Name = this.ID; + this.control.EditMode = PropertyEditorMode.Edit; + this.control.Required = false; + this.control.Value = this.Value; + this.control.OldValue = this.Value; + this.control.ValueChanged += this.ValueChanged; + this.control.DataField = this.DataField; + + this.control.CssClass = "dnnFormInput"; + + container.Controls.Add(this.control); } - return control; + return this.control; } void ValueChanged(object sender, PropertyEditorEventArgs e) { - UpdateDataSource(Value, e.Value, DataField); + this.UpdateDataSource(this.Value, e.Value, this.DataField); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditor.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditor.cs index 0bf568b260c..30a2f9a0bf0 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditor.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormEditor.cs @@ -29,12 +29,12 @@ public class DnnFormEditor : WebControl, INamingContainer public DnnFormEditor() { - Items = new List(); - Sections = new List(); - Tabs = new List(); + this.Items = new List(); + this.Sections = new List(); + this.Tabs = new List(); - FormMode = DnnFormMode.Long; - ViewStateMode = ViewStateMode.Disabled; + this.FormMode = DnnFormMode.Long; + this.ViewStateMode = ViewStateMode.Disabled; } protected string LocalResourceFile @@ -57,16 +57,16 @@ public object DataSource { get { - return _dataSource; + return this._dataSource; } set { - if (_dataSource != value) + if (this._dataSource != value) { - _dataSource = value; - if (Page.IsPostBack) + this._dataSource = value; + if (this.Page.IsPostBack) { - DataBindItems(false); + this.DataBindItems(false); } } } @@ -81,7 +81,7 @@ public bool IsValid get { bool isValid = true; - foreach (var item in GetAllItems()) + foreach (var item in this.GetAllItems()) { item.CheckIsValid(); if(!item.IsValid) @@ -108,7 +108,7 @@ private List GetAllItems() var items = new List(); //iterate over pages - foreach (DnnFormTab page in Tabs) + foreach (DnnFormTab page in this.Tabs) { foreach (DnnFormSection section in page.Sections) { @@ -118,13 +118,13 @@ private List GetAllItems() } //iterate over section - foreach (DnnFormSection section in Sections) + foreach (DnnFormSection section in this.Sections) { items.AddRange(section.Items); } //Add base items - items.AddRange(Items); + items.AddRange(this.Items); return items; } @@ -164,23 +164,23 @@ private void SetUpSections(List sections, WebControl parentContr { resourceKey = section.ID; } - panel.Text = Localization.GetString(resourceKey, LocalResourceFile); + panel.Text = Localization.GetString(resourceKey, this.LocalResourceFile); panel.Expanded = section.Expanded; - SetUpItems(section.Items, panel, LocalResourceFile, EncryptIds); + SetUpItems(section.Items, panel, this.LocalResourceFile, this.EncryptIds); } } } private void SetUpTabs() { - if (Tabs.Count > 0) + if (this.Tabs.Count > 0) { var tabStrip = new DnnFormTabStrip {CssClass = "dnnAdminTabNav dnnClear"}; - Controls.Add(tabStrip); + this.Controls.Add(tabStrip); tabStrip.Items.Clear(); - foreach (DnnFormTab formTab in Tabs) + foreach (DnnFormTab formTab in this.Tabs) { var resourceKey = formTab.ResourceKey; if (String.IsNullOrEmpty(resourceKey)) @@ -189,7 +189,7 @@ private void SetUpTabs() } var tab = new Panel {CssClass = formTab.ID + " dnnClear", ID = "tab_" + formTab.ID}; - Controls.Add(tab); + this.Controls.Add(tab); if (formTab.IncludeExpandAll) { @@ -204,18 +204,18 @@ private void SetUpTabs() formTab.ExpandAllScript += "\t\t\t\ttargetArea: '#" + tab.ClientID + "' });\r\n"; } - tabStrip.Items.Add(new ListItem(Localization.GetString(resourceKey, LocalResourceFile), "#" + tab.ClientID)); + tabStrip.Items.Add(new ListItem(Localization.GetString(resourceKey, this.LocalResourceFile), "#" + tab.ClientID)); if (formTab.Sections.Count > 0) { - SetUpSections(formTab.Sections, tab); + this.SetUpSections(formTab.Sections, tab); } else { tab.CssClass += " dnnFormNoSections"; } - SetUpItems(formTab.Items, tab, LocalResourceFile, EncryptIds); + SetUpItems(formTab.Items, tab, this.LocalResourceFile, this.EncryptIds); } } } @@ -229,61 +229,61 @@ protected override void CreateChildControls() // CreateChildControls re-creates the children (the items) // using the saved view state. // First clear any existing child controls. - Controls.Clear(); + this.Controls.Clear(); // Create the items only if there is view state // corresponding to the children. - if (_itemCount > 0) + if (this._itemCount > 0) { - CreateControlHierarchy(false); + this.CreateControlHierarchy(false); } } private void DataBindItems(bool useDataSource) { - var items = GetAllItems(); + var items = this.GetAllItems(); foreach (DnnFormItemBase item in items) { if (String.IsNullOrEmpty(item.LocalResourceFile)) { - item.LocalResourceFile = LocalResourceFile; + item.LocalResourceFile = this.LocalResourceFile; } if (item.FormMode == DnnFormMode.Inherit) { - item.FormMode = FormMode; + item.FormMode = this.FormMode; } - if (DataSource != null) + if (this.DataSource != null) { - item.DataSource = DataSource; + item.DataSource = this.DataSource; item.DataBindItem(useDataSource); } } - _itemCount = GetAllItems().Count; + this._itemCount = this.GetAllItems().Count; } protected virtual void CreateControlHierarchy(bool useDataSource) { - CssClass = string.IsNullOrEmpty(CssClass) ? "dnnForm" : CssClass.Contains("dnnForm") ? CssClass : string.Format("dnnForm {0}", CssClass); + this.CssClass = string.IsNullOrEmpty(this.CssClass) ? "dnnForm" : this.CssClass.Contains("dnnForm") ? this.CssClass : string.Format("dnnForm {0}", this.CssClass); - SetUpTabs(); + this.SetUpTabs(); - SetUpSections(Sections, this); + this.SetUpSections(this.Sections, this); - SetUpItems(Items, this, LocalResourceFile, EncryptIds); + SetUpItems(this.Items, this, this.LocalResourceFile, this.EncryptIds); - DataBindItems(useDataSource); + this.DataBindItems(useDataSource); } public override void DataBind() { base.OnDataBinding(EventArgs.Empty); - Controls.Clear(); - ClearChildViewState(); - TrackViewState(); - CreateControlHierarchy(true); - ChildControlsCreated = true; + this.Controls.Clear(); + this.ClearChildViewState(); + this.TrackViewState(); + this.CreateControlHierarchy(true); + this.ChildControlsCreated = true; } #endregion @@ -294,13 +294,13 @@ protected override void LoadControlState(object state) { if (state != null) { - _itemCount = (int) state; + this._itemCount = (int) state; } } protected override void OnInit(EventArgs e) { - Page.RegisterRequiresControlState(this); + this.Page.RegisterRequiresControlState(this); JavaScript.RequestRegistration(CommonJs.DnnPlugins); base.OnInit(e); } @@ -309,21 +309,21 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if(Tabs.Count > 0) + if(this.Tabs.Count > 0) { const string scriptName = "FormEditorjQuery"; - ClientScriptManager cs = Page.ClientScript; + ClientScriptManager cs = this.Page.ClientScript; - if (!cs.IsClientScriptBlockRegistered(GetType(), scriptName)) + if (!cs.IsClientScriptBlockRegistered(this.GetType(), scriptName)) { //Render Script var scriptBuilder = new StringBuilder(); scriptBuilder.Append("\r\n"); - cs.RegisterClientScriptBlock(GetType(), scriptName, scriptBuilder.ToString()); + cs.RegisterClientScriptBlock(this.GetType(), scriptName, scriptBuilder.ToString()); } } } protected override object SaveControlState() { - return _itemCount > 0 ? (object) _itemCount : null; + return this._itemCount > 0 ? (object) this._itemCount : null; } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormItemBase.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormItemBase.cs index 830df4f0bb0..d734f4a7a4f 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormItemBase.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormItemBase.cs @@ -30,10 +30,10 @@ public abstract class DnnFormItemBase : WebControl, INamingContainer protected DnnFormItemBase() { - FormMode = DnnFormMode.Inherit; - IsValid = true; + this.FormMode = DnnFormMode.Inherit; + this.IsValid = true; - Validators = new List(); + this.Validators = new List(); } #region Protected Properties @@ -42,9 +42,9 @@ protected PropertyInfo ChildProperty { get { - Type type = Property.PropertyType; + Type type = this.Property.PropertyType; IList props = new List(type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)); - return props.SingleOrDefault(p => p.Name == DataField); + return props.SingleOrDefault(p => p.Name == this.DataField); } } @@ -57,11 +57,11 @@ protected PropertyInfo Property { get { - Type type = DataSource.GetType(); + Type type = this.DataSource.GetType(); IList props = new List(type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static)); - return !String.IsNullOrEmpty(DataMember) - ? props.SingleOrDefault(p => p.Name == DataMember) - : props.SingleOrDefault(p => p.Name == DataField); + return !String.IsNullOrEmpty(this.DataMember) + ? props.SingleOrDefault(p => p.Name == this.DataMember) + : props.SingleOrDefault(p => p.Name == this.DataField); } } @@ -75,8 +75,8 @@ protected override HtmlTextWriterTag TagKey public object Value { - get { return _value; } - set { _value = value; } + get { return this._value; } + set { this._value = value; } } #endregion @@ -105,11 +105,11 @@ public string RequiredMessageSuffix { get { - return _requiredMessageSuffix; + return this._requiredMessageSuffix; } set { - _requiredMessageSuffix = value; + this._requiredMessageSuffix = value; } } @@ -117,11 +117,11 @@ public string ValidationMessageSuffix { get { - return _validationMessageSuffix; + return this._validationMessageSuffix; } set { - _validationMessageSuffix = value; + this._validationMessageSuffix = value; } } @@ -136,58 +136,58 @@ public string ValidationMessageSuffix private void AddValidators(string controlId) { - var value = Value as String; - Validators.Clear(); + var value = this.Value as String; + this.Validators.Clear(); //Add Validators - if (Required) + if (this.Required) { var requiredValidator = new RequiredFieldValidator { - ID = ID + "_Required", - ErrorMessage = ResourceKey + RequiredMessageSuffix + ID = this.ID + "_Required", + ErrorMessage = this.ResourceKey + this.RequiredMessageSuffix }; - Validators.Add(requiredValidator); + this.Validators.Add(requiredValidator); } - if (!String.IsNullOrEmpty(ValidationExpression)) + if (!String.IsNullOrEmpty(this.ValidationExpression)) { var regexValidator = new RegularExpressionValidator { - ID = ID + "_RegEx", - ErrorMessage = ResourceKey + ValidationMessageSuffix, - ValidationExpression = ValidationExpression + ID = this.ID + "_RegEx", + ErrorMessage = this.ResourceKey + this.ValidationMessageSuffix, + ValidationExpression = this.ValidationExpression }; if (!String.IsNullOrEmpty(value)) { - regexValidator.IsValid = Regex.IsMatch(value, ValidationExpression); - IsValid = regexValidator.IsValid; + regexValidator.IsValid = Regex.IsMatch(value, this.ValidationExpression); + this.IsValid = regexValidator.IsValid; } - Validators.Add(regexValidator); + this.Validators.Add(regexValidator); } - if (Validators.Count > 0) + if (this.Validators.Count > 0) { - foreach (BaseValidator validator in Validators) + foreach (BaseValidator validator in this.Validators) { validator.ControlToValidate = controlId; validator.Display = ValidatorDisplay.Dynamic; - validator.ErrorMessage = LocalizeString(validator.ErrorMessage); + validator.ErrorMessage = this.LocalizeString(validator.ErrorMessage); validator.CssClass = "dnnFormMessage dnnFormError"; - Controls.Add(validator); + this.Controls.Add(validator); } } } public void CheckIsValid() { - IsValid = true; - foreach (BaseValidator validator in Validators) + this.IsValid = true; + foreach (BaseValidator validator in this.Validators) { validator.Validate(); if (!validator.IsValid) { - IsValid = false; + this.IsValid = false; break; } } @@ -196,33 +196,33 @@ public void CheckIsValid() protected virtual void CreateControlHierarchy() { //Load Item Style - CssClass = "dnnFormItem"; - CssClass += (FormMode == DnnFormMode.Long) ? "" : " dnnFormShort"; + this.CssClass = "dnnFormItem"; + this.CssClass += (this.FormMode == DnnFormMode.Long) ? "" : " dnnFormShort"; - if (String.IsNullOrEmpty(ResourceKey)) + if (String.IsNullOrEmpty(this.ResourceKey)) { - ResourceKey = DataField; + this.ResourceKey = this.DataField; } //Add Label var label = new DnnFormLabel { - LocalResourceFile = LocalResourceFile, - ResourceKey = ResourceKey + ".Text", - ToolTipKey = ResourceKey + ".Help", + LocalResourceFile = this.LocalResourceFile, + ResourceKey = this.ResourceKey + ".Text", + ToolTipKey = this.ResourceKey + ".Help", ViewStateMode = ViewStateMode.Disabled }; - if (Required) { + if (this.Required) { label.RequiredField = true; } - Controls.Add(label); + this.Controls.Add(label); - WebControl inputControl = CreateControlInternal(this); + WebControl inputControl = this.CreateControlInternal(this); label.AssociatedControlID = inputControl.ID; - AddValidators(inputControl.ID); + this.AddValidators(inputControl.ID); } /// @@ -240,14 +240,14 @@ protected override void CreateChildControls() // CreateChildControls re-creates the children (the items) // using the saved view state. // First clear any existing child controls. - Controls.Clear(); + this.Controls.Clear(); - CreateControlHierarchy(); + this.CreateControlHierarchy(); } protected void DataBindInternal(string dataField, ref object value) { - var dictionary = DataSource as IDictionary; + var dictionary = this.DataSource as IDictionary; if (dictionary != null) { if (!String.IsNullOrEmpty(dataField) && dictionary.Contains(dataField)) @@ -259,24 +259,24 @@ protected void DataBindInternal(string dataField, ref object value) { if (!String.IsNullOrEmpty(dataField)) { - if (String.IsNullOrEmpty(DataMember)) + if (String.IsNullOrEmpty(this.DataMember)) { - if (Property != null && Property.GetValue(DataSource, null) != null) + if (this.Property != null && this.Property.GetValue(this.DataSource, null) != null) { // ReSharper disable PossibleNullReferenceException - value = Property.GetValue(DataSource, null); + value = this.Property.GetValue(this.DataSource, null); // ReSharper restore PossibleNullReferenceException } } else { - if (Property != null && Property.GetValue(DataSource, null) != null) + if (this.Property != null && this.Property.GetValue(this.DataSource, null) != null) { // ReSharper disable PossibleNullReferenceException - object parentValue = Property.GetValue(DataSource, null); - if (ChildProperty != null && ChildProperty.GetValue(parentValue, null) != null) + object parentValue = this.Property.GetValue(this.DataSource, null); + if (this.ChildProperty != null && this.ChildProperty.GetValue(parentValue, null) != null) { - value = ChildProperty.GetValue(parentValue, null); + value = this.ChildProperty.GetValue(parentValue, null); } // ReSharper restore PossibleNullReferenceException } @@ -287,7 +287,7 @@ protected void DataBindInternal(string dataField, ref object value) protected virtual void DataBindInternal() { - DataBindInternal(DataField, ref _value); + this.DataBindInternal(this.DataField, ref this._value); } public void DataBindItem(bool useDataSource) @@ -295,65 +295,65 @@ public void DataBindItem(bool useDataSource) if (useDataSource) { base.OnDataBinding(EventArgs.Empty); - Controls.Clear(); - ClearChildViewState(); - TrackViewState(); + this.Controls.Clear(); + this.ClearChildViewState(); + this.TrackViewState(); - DataBindInternal(); + this.DataBindInternal(); - CreateControlHierarchy(); - ChildControlsCreated = true; + this.CreateControlHierarchy(); + this.ChildControlsCreated = true; } else { - if (!String.IsNullOrEmpty(DataField)) + if (!String.IsNullOrEmpty(this.DataField)) { - UpdateDataSourceInternal(null, _value, DataField); + this.UpdateDataSourceInternal(null, this._value, this.DataField); } } } private void UpdateDataSourceInternal(object oldValue, object newValue, string dataField) { - if (DataSource != null) + if (this.DataSource != null) { - if (DataSource is IDictionary) + if (this.DataSource is IDictionary) { - var dictionary = DataSource as IDictionary; + var dictionary = this.DataSource as IDictionary; if (dictionary.ContainsKey(dataField) && !ReferenceEquals(newValue, oldValue)) { dictionary[dataField] = newValue as string; } } - else if(DataSource is IIndexable) + else if(this.DataSource is IIndexable) { - var indexer = DataSource as IIndexable; + var indexer = this.DataSource as IIndexable; indexer[dataField] = newValue; } else { - if (String.IsNullOrEmpty(DataMember)) + if (String.IsNullOrEmpty(this.DataMember)) { - if (Property != null) + if (this.Property != null) { if (!ReferenceEquals(newValue, oldValue)) { - if (Property.PropertyType.IsEnum) + if (this.Property.PropertyType.IsEnum) { - Property.SetValue(DataSource, Enum.Parse(Property.PropertyType, newValue.ToString()), null); + this.Property.SetValue(this.DataSource, Enum.Parse(this.Property.PropertyType, newValue.ToString()), null); } else { - Property.SetValue(DataSource, Convert.ChangeType(newValue, Property.PropertyType), null); + this.Property.SetValue(this.DataSource, Convert.ChangeType(newValue, this.Property.PropertyType), null); } } } } else { - if (Property != null) + if (this.Property != null) { - object parentValue = Property.GetValue(DataSource, null); + object parentValue = this.Property.GetValue(this.DataSource, null); if (parentValue != null) { if (parentValue is IDictionary) @@ -369,15 +369,15 @@ private void UpdateDataSourceInternal(object oldValue, object newValue, string d var indexer = parentValue as IIndexable; indexer[dataField] = newValue; } - else if (ChildProperty != null) + else if (this.ChildProperty != null) { - if (Property.PropertyType.IsEnum) + if (this.Property.PropertyType.IsEnum) { - ChildProperty.SetValue(parentValue, Enum.Parse(ChildProperty.PropertyType, newValue.ToString()), null); + this.ChildProperty.SetValue(parentValue, Enum.Parse(this.ChildProperty.PropertyType, newValue.ToString()), null); } else { - ChildProperty.SetValue(parentValue, Convert.ChangeType(newValue, ChildProperty.PropertyType), null); + this.ChildProperty.SetValue(parentValue, Convert.ChangeType(newValue, this.ChildProperty.PropertyType), null); } } } @@ -389,11 +389,11 @@ private void UpdateDataSourceInternal(object oldValue, object newValue, string d protected void UpdateDataSource(object oldValue, object newValue, string dataField) { - CheckIsValid(); + this.CheckIsValid(); - _value = newValue; + this._value = newValue; - UpdateDataSourceInternal(oldValue, newValue, dataField); + this.UpdateDataSourceInternal(oldValue, newValue, dataField); } #endregion @@ -402,23 +402,23 @@ protected void UpdateDataSource(object oldValue, object newValue, string dataFie protected override void LoadControlState(object state) { - _value = state; + this._value = state; } protected string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } protected override void OnInit(EventArgs e) { - Page.RegisterRequiresControlState(this); + this.Page.RegisterRequiresControlState(this); base.OnInit(e); } protected override object SaveControlState() { - return _value; + return this._value; } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLabel.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLabel.cs index 7733d0d87db..0602ced3e23 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLabel.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLabel.cs @@ -32,12 +32,12 @@ public class DnnFormLabel : Panel protected override void CreateChildControls() { - string toolTipText = LocalizeString(ToolTipKey); - if (string.IsNullOrEmpty(CssClass)) - CssClass = "dnnLabel"; + string toolTipText = this.LocalizeString(this.ToolTipKey); + if (string.IsNullOrEmpty(this.CssClass)) + this.CssClass = "dnnLabel"; - else if (!CssClass.Contains("dnnLabel")) - CssClass += " dnnLabel"; + else if (!this.CssClass.Contains("dnnLabel")) + this.CssClass += " dnnLabel"; //var outerPanel = new Panel(); @@ -45,10 +45,10 @@ protected override void CreateChildControls() //Controls.Add(outerPanel); var outerLabel = new System.Web.UI.HtmlControls.HtmlGenericControl { TagName = "label" }; - Controls.Add(outerLabel); + this.Controls.Add(outerLabel); - var label = new Label { ID = "Label", Text = LocalizeString(ResourceKey) }; - if (RequiredField) + var label = new Label { ID = "Label", Text = this.LocalizeString(this.ResourceKey) }; + if (this.RequiredField) { label.CssClass += " dnnFormRequired"; } @@ -56,19 +56,19 @@ protected override void CreateChildControls() var link = new LinkButton { ID = "Link", CssClass = "dnnFormHelp", TabIndex = -1 }; link.Attributes.Add("aria-label", "Help"); - Controls.Add(link); + this.Controls.Add(link); if (!String.IsNullOrEmpty(toolTipText)) { //CssClass += "dnnLabel"; var tooltipPanel = new Panel() { CssClass = "dnnTooltip"}; - Controls.Add(tooltipPanel); + this.Controls.Add(tooltipPanel); var panel = new Panel { ID = "Help", CssClass = "dnnFormHelpContent dnnClear" }; tooltipPanel.Controls.Add(panel); - var helpLabel = new Label { ID = "Text", CssClass="dnnHelpText", Text = LocalizeString(ToolTipKey) }; + var helpLabel = new Label { ID = "Text", CssClass="dnnHelpText", Text = this.LocalizeString(this.ToolTipKey) }; panel.Controls.Add(helpLabel); var pinLink = new HyperLink { CssClass = "pinHelp"}; @@ -76,7 +76,7 @@ protected override void CreateChildControls() pinLink.Attributes.Add("aria-label", "Pin"); panel.Controls.Add(pinLink); - JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn); + JavaScript.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn); JavaScript.RequestRegistration(CommonJs.DnnPlugins); //ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Scripts/initTooltips.js"); } @@ -84,7 +84,7 @@ protected override void CreateChildControls() protected string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormListItemBase.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormListItemBase.cs index 059313310c2..e0a9ac192bd 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormListItemBase.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormListItemBase.cs @@ -20,15 +20,15 @@ public IEnumerable ListSource { get { - return _listSource; + return this._listSource; } set { - var changed = !Equals(_listSource, value); + var changed = !Equals(this._listSource, value); if (changed) { - _listSource = value; - BindList(); + this._listSource = value; + this.BindList(); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLiteralItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLiteralItem.cs index 405b58bb3c6..eb367cbbb6b 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLiteralItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormLiteralItem.cs @@ -16,12 +16,12 @@ public class DnnFormLiteralItem : DnnFormItemBase { public DnnFormLiteralItem() : base() { - ViewStateMode = ViewStateMode.Disabled; + this.ViewStateMode = ViewStateMode.Disabled; } protected override WebControl CreateControlInternal(Control container) { - var literal = new Label {ID = ID + "_Label", Text = Convert.ToString(Value)}; + var literal = new Label {ID = this.ID + "_Label", Text = Convert.ToString(this.Value)}; container.Controls.Add(literal); return literal; } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPanel.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPanel.cs index cf175fb953d..c88cdf1b38f 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPanel.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPanel.cs @@ -17,22 +17,22 @@ public class DnnFormPanel : WebControl protected override void Render(HtmlTextWriter writer) { - writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClass); + writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass); writer.RenderBeginTag(HtmlTextWriterTag.H2); - if (Expanded) + if (this.Expanded) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "dnnSectionExpanded"); } writer.RenderBeginTag(HtmlTextWriterTag.A); - writer.Write(Text); + writer.Write(this.Text); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Fieldset); - RenderChildren(writer); + this.RenderChildren(writer); writer.RenderEndTag(); } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPasswordItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPasswordItem.cs index 103a1b9d080..522426d65fb 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPasswordItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormPasswordItem.cs @@ -25,11 +25,11 @@ public string TextBoxCssClass { get { - return ViewState.GetValue("TextBoxCssClass", string.Empty); + return this.ViewState.GetValue("TextBoxCssClass", string.Empty); } set { - ViewState.SetValue("TextBoxCssClass", value, string.Empty); + this.ViewState.SetValue("TextBoxCssClass", value, string.Empty); } } @@ -37,17 +37,17 @@ public string ContainerCssClass { get { - return ViewState.GetValue("ContainerCssClass", string.Empty); + return this.ViewState.GetValue("ContainerCssClass", string.Empty); } set { - ViewState.SetValue("ContainerCssClass", value, string.Empty); + this.ViewState.SetValue("ContainerCssClass", value, string.Empty); } } private void TextChanged(object sender, EventArgs e) { - UpdateDataSource(Value, _password.Text, DataField); + this.UpdateDataSource(this.Value, this._password.Text, this.DataField); } /// @@ -57,37 +57,37 @@ private void TextChanged(object sender, EventArgs e) /// An "input" control that can be used for attaching validators protected override WebControl CreateControlInternal(Control container) { - _password = new TextBox() + this._password = new TextBox() { - ID = ID + "_TextBox", + ID = this.ID + "_TextBox", TextMode = TextBoxMode.Password, - CssClass = TextBoxCssClass, + CssClass = this.TextBoxCssClass, MaxLength = 39, //ensure password cannot be cut if too long - Text = Convert.ToString(Value) // Load from ControlState + Text = Convert.ToString(this.Value) // Load from ControlState }; - _password.Attributes.Add("autocomplete", "off"); - _password.Attributes.Add("aria-label", DataField); - _password.TextChanged += TextChanged; + this._password.Attributes.Add("autocomplete", "off"); + this._password.Attributes.Add("aria-label", this.DataField); + this._password.TextChanged += this.TextChanged; - var passwordContainer = new Panel() { ID = "passwordContainer", CssClass = ContainerCssClass }; + var passwordContainer = new Panel() { ID = "passwordContainer", CssClass = this.ContainerCssClass }; // add control hierarchy to the container container.Controls.Add(passwordContainer); - passwordContainer.Controls.Add(_password); + passwordContainer.Controls.Add(this._password); // return input control that can be used for validation - return _password; + return this._password; } protected override void OnInit(EventArgs e) { base.OnInit(e); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); JavaScript.RequestRegistration(CommonJs.DnnPlugins); } @@ -99,16 +99,16 @@ protected override void OnPreRender(EventArgs e) var options = new DnnPaswordStrengthOptions(); var optionsAsJsonString = Json.Serialize(options); var script = string.Format("dnn.initializePasswordStrength('.{0}', {1});{2}", - TextBoxCssClass, optionsAsJsonString, Environment.NewLine); + this.TextBoxCssClass, optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "PasswordStrength", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "PasswordStrength", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "PasswordStrength", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "PasswordStrength", script, true); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormRadioButtonListItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormRadioButtonListItem.cs index 904e7e9ad9f..da1f53410b6 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormRadioButtonListItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormRadioButtonListItem.cs @@ -19,59 +19,59 @@ public class DnnFormRadioButtonListItem : DnnFormListItemBase protected override void BindList() { - if (_radioButtonList != null) + if (this._radioButtonList != null) { - string selectedValue = !_radioButtonList.Page.IsPostBack ? Convert.ToString(Value) : _radioButtonList.Page.Request.Form[_radioButtonList.UniqueID]; + string selectedValue = !this._radioButtonList.Page.IsPostBack ? Convert.ToString(this.Value) : this._radioButtonList.Page.Request.Form[this._radioButtonList.UniqueID]; - if (ListSource is Dictionary) + if (this.ListSource is Dictionary) { - var items = ListSource as Dictionary; + var items = this.ListSource as Dictionary; foreach (var item in items) { var listItem = new ListItem(item.Key, item.Value); - listItem.Attributes.Add("onClick", OnClientClicked); + listItem.Attributes.Add("onClick", this.OnClientClicked); - _radioButtonList.Items.Add(listItem); + this._radioButtonList.Items.Add(listItem); } } else { - _radioButtonList.DataTextField = ListTextField; - _radioButtonList.DataValueField = ListValueField; - _radioButtonList.DataSource = ListSource; + this._radioButtonList.DataTextField = this.ListTextField; + this._radioButtonList.DataValueField = this.ListValueField; + this._radioButtonList.DataSource = this.ListSource; - _radioButtonList.DataBind(); + this._radioButtonList.DataBind(); } if (String.IsNullOrEmpty(selectedValue)) { - selectedValue = DefaultValue; + selectedValue = this.DefaultValue; } //Reset SelectedValue - if (_radioButtonList.Items.FindByValue(selectedValue) != null) + if (this._radioButtonList.Items.FindByValue(selectedValue) != null) { - _radioButtonList.Items.FindByValue(selectedValue).Selected = true; + this._radioButtonList.Items.FindByValue(selectedValue).Selected = true; } - if (selectedValue != Convert.ToString(Value)) + if (selectedValue != Convert.ToString(this.Value)) { - UpdateDataSource(Value, selectedValue, DataField); + this.UpdateDataSource(this.Value, selectedValue, this.DataField); } } } protected override WebControl CreateControlInternal(Control container) { - _radioButtonList = new RadioButtonList { ID = ID + "_RadioButtonList", RepeatColumns = 1, RepeatDirection = RepeatDirection.Vertical, RepeatLayout = RepeatLayout.Flow}; + this._radioButtonList = new RadioButtonList { ID = this.ID + "_RadioButtonList", RepeatColumns = 1, RepeatDirection = RepeatDirection.Vertical, RepeatLayout = RepeatLayout.Flow}; - container.Controls.Add(_radioButtonList); + container.Controls.Add(this._radioButtonList); - if (ListSource != null) + if (this.ListSource != null) { - BindList(); + this.BindList(); } - return _radioButtonList; + return this._radioButtonList; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSection.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSection.cs index ae4b199f817..775afb2ee84 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSection.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSection.cs @@ -18,7 +18,7 @@ public class DnnFormSection : WebControl, INamingContainer { public DnnFormSection() { - Items = new List(); + this.Items = new List(); } public bool Expanded { get; set; } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSectionTemplate.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSectionTemplate.cs index 2e0f1b1692f..1b9b826acce 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSectionTemplate.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormSectionTemplate.cs @@ -16,7 +16,7 @@ internal class DnnFormSectionTemplate : ITemplate { public DnnFormSectionTemplate() { - Items = new List(); + this.Items = new List(); } public List Items { get; private set; } @@ -30,7 +30,7 @@ public void InstantiateIn(Control container) var webControl = container as WebControl; if (webControl != null) { - DnnFormEditor.SetUpItems(Items, webControl, LocalResourceFile, false); + DnnFormEditor.SetUpItems(this.Items, webControl, this.LocalResourceFile, false); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTab.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTab.cs index 13f5f891876..1a9d5302cab 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTab.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTab.cs @@ -18,8 +18,8 @@ public class DnnFormTab : WebControl, INamingContainer { public DnnFormTab() { - Sections = new List(); - Items = new List(); + this.Sections = new List(); + this.Items = new List(); } public bool IncludeExpandAll { get; set; } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTabStrip.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTabStrip.cs index bc6fa9378a4..2810e317345 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTabStrip.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTabStrip.cs @@ -13,10 +13,10 @@ public class DnnFormTabStrip : ListControl protected override void Render(HtmlTextWriter writer) { - writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClass); + writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass); writer.RenderBeginTag(HtmlTextWriterTag.Ul); - foreach (ListItem item in Items) + foreach (ListItem item in this.Items) { writer.RenderBeginTag(HtmlTextWriterTag.Li); diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTemplateItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTemplateItem.cs index 03a17409c07..51acdbe1dc5 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTemplateItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTemplateItem.cs @@ -20,12 +20,12 @@ public class DnnFormTemplateItem : DnnFormItemBase protected override void CreateControlHierarchy() { - CssClass += " dnnFormItem"; - CssClass += (FormMode == DnnFormMode.Long) ? " dnnFormLong" : " dnnFormShort"; + this.CssClass += " dnnFormItem"; + this.CssClass += (this.FormMode == DnnFormMode.Long) ? " dnnFormLong" : " dnnFormShort"; var template = new DnnFormEmptyTemplate(); - ItemTemplate.InstantiateIn(template); - Controls.Add(template); + this.ItemTemplate.InstantiateIn(template); + this.Controls.Add(template); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTextBoxItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTextBoxItem.cs index 4a15ef09ed3..95b94ce503e 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTextBoxItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnFormTextBoxItem.cs @@ -30,11 +30,11 @@ public string TextBoxCssClass { get { - return ViewState.GetValue("TextBoxCssClass", string.Empty); + return this.ViewState.GetValue("TextBoxCssClass", string.Empty); } set { - ViewState.SetValue("TextBoxCssClass", value, string.Empty); + this.ViewState.SetValue("TextBoxCssClass", value, string.Empty); } } @@ -47,45 +47,45 @@ public string TextBoxCssClass private void TextChanged(object sender, EventArgs e) { - UpdateDataSource(Value, _textBox.Text, DataField); + this.UpdateDataSource(this.Value, this._textBox.Text, this.DataField); } protected override WebControl CreateControlInternal(Control container) { - _textBox = new TextBox { ID = ID + "_TextBox" }; + this._textBox = new TextBox { ID = this.ID + "_TextBox" }; - _textBox.Rows = Rows; - _textBox.Columns = Columns; - _textBox.TextMode = TextMode; - _textBox.CssClass = TextBoxCssClass; - _textBox.AutoCompleteType = AutoCompleteType; - _textBox.TextChanged += TextChanged; - _textBox.Attributes.Add("aria-label", DataField); + this._textBox.Rows = this.Rows; + this._textBox.Columns = this.Columns; + this._textBox.TextMode = this.TextMode; + this._textBox.CssClass = this.TextBoxCssClass; + this._textBox.AutoCompleteType = this.AutoCompleteType; + this._textBox.TextChanged += this.TextChanged; + this._textBox.Attributes.Add("aria-label", this.DataField); //Load from ControlState - _textBox.Text = Convert.ToString(Value); - if (TextMode == TextBoxMode.Password) + this._textBox.Text = Convert.ToString(this.Value); + if (this.TextMode == TextBoxMode.Password) { - _textBox.Attributes.Add("autocomplete", "off"); + this._textBox.Attributes.Add("autocomplete", "off"); } - if (MaxLength > 0) + if (this.MaxLength > 0) { - _textBox.MaxLength = MaxLength; + this._textBox.MaxLength = this.MaxLength; } - container.Controls.Add(_textBox); + container.Controls.Add(this._textBox); - return _textBox; + return this._textBox; } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (TextMode == TextBoxMode.Password && !ClearContentInPasswordMode) + if (this.TextMode == TextBoxMode.Password && !this.ClearContentInPasswordMode) { - _textBox.Attributes.Add("value", Convert.ToString(Value)); + this._textBox.Attributes.Add("value", Convert.ToString(this.Value)); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnGenericHiddenField.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnGenericHiddenField.cs index b003125a5c4..bdbf7ac8ce3 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnGenericHiddenField.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnGenericHiddenField.cs @@ -21,12 +21,12 @@ public T TypedValue { get { - return _typedValue; + return this._typedValue; } set { - _typedValue = value; - _isValueSerialized = false; + this._typedValue = value; + this._isValueSerialized = false; } } @@ -34,25 +34,25 @@ public T TypedValueOrDefault { get { - return TypedValue ?? (TypedValue = new T()); + return this.TypedValue ?? (this.TypedValue = new T()); } } public bool HasValue { - get { return _typedValue != null; } + get { return this._typedValue != null; } } protected override object SaveViewState() { - EnsureValue(); + this.EnsureValue(); return base.SaveViewState(); } protected override void LoadViewState(object savedState) { base.LoadViewState(savedState); - SetTypedValue(); + this.SetTypedValue(); } protected override bool LoadPostData(string postDataKey, NameValueCollection postCollection) @@ -60,39 +60,39 @@ protected override bool LoadPostData(string postDataKey, NameValueCollection pos var controlsStateChanged = base.LoadPostData(postDataKey, postCollection); if (controlsStateChanged) { - SetTypedValue(); + this.SetTypedValue(); } return controlsStateChanged; } private void SetTypedValue() { - _typedValue = string.IsNullOrEmpty(Value) ? null : Json.Deserialize(Value); + this._typedValue = string.IsNullOrEmpty(this.Value) ? null : Json.Deserialize(this.Value); } private void EnsureValue() { - if (!_isValueSerialized) + if (!this._isValueSerialized) { - SerializeValue(); + this.SerializeValue(); } } private void SerializeValue() { - Value = _typedValue == null ? string.Empty : Json.Serialize(_typedValue); - _isValueSerialized = true; + this.Value = this._typedValue == null ? string.Empty : Json.Serialize(this._typedValue); + this._isValueSerialized = true; } protected override void TrackViewState() { - EnsureValue(); + this.EnsureValue(); base.TrackViewState(); } public override void RenderControl(HtmlTextWriter writer) { - EnsureValue(); + this.EnsureValue(); base.RenderControl(writer); } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImage.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImage.cs index 700f3ad8fb9..d9d70400c4c 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImage.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImage.cs @@ -29,8 +29,8 @@ public class DnnImage : Image protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (string.IsNullOrEmpty(ImageUrl)) - ImageUrl = Entities.Icons.IconController.IconURL(IconKey, IconSize, IconStyle); + if (string.IsNullOrEmpty(this.ImageUrl)) + this.ImageUrl = Entities.Icons.IconController.IconURL(this.IconKey, this.IconSize, this.IconStyle); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageButton.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageButton.cs index 924a615ca8e..dd26db0509e 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageButton.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageButton.cs @@ -29,8 +29,8 @@ public class DnnImageButton : ImageButton protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (string.IsNullOrEmpty(ImageUrl)) - ImageUrl = Entities.Icons.IconController.IconURL(IconKey, IconSize, IconStyle); + if (string.IsNullOrEmpty(this.ImageUrl)) + this.ImageUrl = Entities.Icons.IconController.IconURL(this.IconKey, this.IconSize, this.IconStyle); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageEditControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageEditControl.cs index 6859fe16914..5cf55b7785e 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageEditControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnImageEditControl.cs @@ -10,7 +10,7 @@ public class DnnImageEditControl : DnnFileEditControl { public DnnImageEditControl() { - FileFilter = Globals.glbImageFileTypes; + this.FileFilter = Globals.glbImageFileTypes; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLabel.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLabel.cs index 87d63248957..d750ee780ec 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLabel.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLabel.cs @@ -23,7 +23,7 @@ public class DnnLabel : Label, ILocalizable public DnnLabel() { - CssClass = "dnnFormLabel"; + this.CssClass = "dnnFormLabel"; } #endregion @@ -33,12 +33,12 @@ public DnnLabel() protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); base.Render(writer); } @@ -50,11 +50,11 @@ public bool Localize { get { - return !DesignMode && _localize; + return !this.DesignMode && this._localize; } set { - _localize = value; + this._localize = value; } } @@ -62,22 +62,22 @@ public bool Localize public virtual void LocalizeStrings() { - if (Localize) + if (this.Localize) { - if (!string.IsNullOrEmpty(ToolTip)) + if (!string.IsNullOrEmpty(this.ToolTip)) { - ToolTip = Localization.GetString(ToolTip, LocalResourceFile); + this.ToolTip = Localization.GetString(this.ToolTip, this.LocalResourceFile); } - if (!string.IsNullOrEmpty(Text)) + if (!string.IsNullOrEmpty(this.Text)) { - var unLocalized = Text; + var unLocalized = this.Text; - Text = Localization.GetString(unLocalized, LocalResourceFile); + this.Text = Localization.GetString(unLocalized, this.LocalResourceFile); - if (string.IsNullOrEmpty(ToolTip)) + if (string.IsNullOrEmpty(this.ToolTip)) { - ToolTip = Localization.GetString(unLocalized + ".ToolTip", LocalResourceFile); + this.ToolTip = Localization.GetString(unLocalized + ".ToolTip", this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLanguageLabel.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLanguageLabel.cs index 3082e28354c..c0081a90028 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLanguageLabel.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLanguageLabel.cs @@ -29,7 +29,7 @@ public class DnnLanguageLabel : CompositeControl, ILocalizable public DnnLanguageLabel() { - Localize = true; + this.Localize = true; } #region Public Properties @@ -40,11 +40,11 @@ public string Language { get { - return (string) ViewState["Language"]; + return (string) this.ViewState["Language"]; } set { - ViewState["Language"] = value; + this.ViewState["Language"] = value; } } @@ -55,7 +55,7 @@ public string Language protected override void OnInit(EventArgs e) { base.OnInit(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } /// ----------------------------------------------------------------------------- @@ -67,16 +67,16 @@ protected override void OnInit(EventArgs e) protected override void CreateChildControls() { //First clear the controls collection - Controls.Clear(); + this.Controls.Clear(); - _Flag = new Image {ViewStateMode = ViewStateMode.Disabled}; - Controls.Add(_Flag); + this._Flag = new Image {ViewStateMode = ViewStateMode.Disabled}; + this.Controls.Add(this._Flag); - Controls.Add(new LiteralControl(" ")); + this.Controls.Add(new LiteralControl(" ")); - _Label = new Label(); - _Label.ViewStateMode = ViewStateMode.Disabled; - Controls.Add(_Label); + this._Label = new Label(); + this._Label.ViewStateMode = ViewStateMode.Disabled; + this.Controls.Add(this._Label); //Call base class's method @@ -92,16 +92,16 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (string.IsNullOrEmpty(Language)) + if (string.IsNullOrEmpty(this.Language)) { - _Flag.ImageUrl = "~/images/Flags/none.gif"; + this._Flag.ImageUrl = "~/images/Flags/none.gif"; } else { - _Flag.ImageUrl = string.Format("~/images/Flags/{0}.gif", Language); + this._Flag.ImageUrl = string.Format("~/images/Flags/{0}.gif", this.Language); } - if (DisplayType == 0) + if (this.DisplayType == 0) { PortalSettings _PortalSettings = PortalController.Instance.GetCurrentPortalSettings(); string _ViewTypePersonalizationKey = "ViewType" + _PortalSettings.PortalId; @@ -109,28 +109,28 @@ protected override void OnPreRender(EventArgs e) switch (_ViewType) { case "NATIVE": - DisplayType = CultureDropDownTypes.NativeName; + this.DisplayType = CultureDropDownTypes.NativeName; break; case "ENGLISH": - DisplayType = CultureDropDownTypes.EnglishName; + this.DisplayType = CultureDropDownTypes.EnglishName; break; default: - DisplayType = CultureDropDownTypes.DisplayName; + this.DisplayType = CultureDropDownTypes.DisplayName; break; } } string localeName = null; - if (string.IsNullOrEmpty(Language)) + if (string.IsNullOrEmpty(this.Language)) { localeName = Localization.GetString("NeutralCulture", Localization.GlobalResourceFile); } else { - localeName = Localization.GetLocaleName(Language, DisplayType); + localeName = Localization.GetLocaleName(this.Language, this.DisplayType); } - _Label.Text = localeName; - _Flag.AlternateText = localeName; + this._Label.Text = localeName; + this._Flag.AlternateText = localeName; } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLiteral.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLiteral.cs index 359b46c5b07..668bc017a46 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLiteral.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnLiteral.cs @@ -23,12 +23,12 @@ public class DnnLiteral : Literal, ILocalizable protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); base.Render(writer); } @@ -40,11 +40,11 @@ public bool Localize { get { - return _Localize; + return this._Localize; } set { - _Localize = value; + this._Localize = value; } } @@ -52,11 +52,11 @@ public bool Localize public virtual void LocalizeStrings() { - if ((Localize)) + if ((this.Localize)) { - if ((!string.IsNullOrEmpty(Text))) + if ((!string.IsNullOrEmpty(this.Text))) { - Text = Localization.GetString(Text, LocalResourceFile); + this.Text = Localization.GetString(this.Text, this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnMemberListControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnMemberListControl.cs index 7efd6be4c93..bc3a5ce0577 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnMemberListControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnMemberListControl.cs @@ -137,31 +137,31 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - _currentUser = UserController.Instance.GetCurrentUserInfo(); - _relationshipController = new RelationshipController(); + this._currentUser = UserController.Instance.GetCurrentUserInfo(); + this._relationshipController = new RelationshipController(); } protected override void Render(HtmlTextWriter writer) { - if (ItemTemplate == "") return; + if (this.ItemTemplate == "") return; - writer.Write(HeaderTemplate); + writer.Write(this.HeaderTemplate); // Filters - if (Filters == null) Filters = new Dictionary(); + if (this.Filters == null) this.Filters = new Dictionary(); var additionalFilters = new Dictionary(); - additionalFilters.Add("Records", PageSize.ToString()); - additionalFilters.Add("PageIndex", PageIndex.ToString()); - additionalFilters.Add("Rowsize", RowSize.ToString()); - additionalFilters.Add("SortBy", SortBy); - additionalFilters.Add("SortAscending", SortAscending.ToString()); + additionalFilters.Add("Records", this.PageSize.ToString()); + additionalFilters.Add("PageIndex", this.PageIndex.ToString()); + additionalFilters.Add("Rowsize", this.RowSize.ToString()); + additionalFilters.Add("SortBy", this.SortBy); + additionalFilters.Add("SortAscending", this.SortAscending.ToString()); // Currently Not Used by the SPROC - var filterUser = Filters.ContainsKey("UserId") && Filters["UserId"] != null ? new UserInfo() { UserID = int.Parse(Filters["UserId"]) } : new UserInfo() { PortalID = _currentUser.PortalID }; - var role = Filters.ContainsKey("RoleId") && Filters["RoleId"] != null ? new UserRoleInfo() { RoleID = int.Parse(Filters["RoleId"]) } : null; - var relationship = Filters.ContainsKey("RelationshipTypeId") && Filters["RelationshipTypeId"] != null ? new RelationshipType() { RelationshipTypeId = int.Parse(Filters["RelationshipTypeId"]) } : null; + var filterUser = this.Filters.ContainsKey("UserId") && this.Filters["UserId"] != null ? new UserInfo() { UserID = int.Parse(this.Filters["UserId"]) } : new UserInfo() { PortalID = this._currentUser.PortalID }; + var role = this.Filters.ContainsKey("RoleId") && this.Filters["RoleId"] != null ? new UserRoleInfo() { RoleID = int.Parse(this.Filters["RoleId"]) } : null; + var relationship = this.Filters.ContainsKey("RelationshipTypeId") && this.Filters["RelationshipTypeId"] != null ? new RelationshipType() { RelationshipTypeId = int.Parse(this.Filters["RelationshipTypeId"]) } : null; - foreach (var filter in Filters.Where(filter => !additionalFilters.ContainsKey(filter.Key))) + foreach (var filter in this.Filters.Where(filter => !additionalFilters.ContainsKey(filter.Key))) { additionalFilters.Add(filter.Key, filter.Value); } @@ -176,7 +176,7 @@ protected override void Render(HtmlTextWriter writer) foreach (DataRow user in users.Rows) { //Row Header - writer.Write(string.IsNullOrEmpty(AlternatingRowHeaderTemplate) || row%2 == 0 ? RowHeaderTemplate : AlternatingRowHeaderTemplate); + writer.Write(string.IsNullOrEmpty(this.AlternatingRowHeaderTemplate) || row%2 == 0 ? this.RowHeaderTemplate : this.AlternatingRowHeaderTemplate); var tokenReplace = new TokenReplace(); var tokenKeyValues = new Dictionary(); @@ -186,18 +186,18 @@ protected override void Render(HtmlTextWriter writer) tokenKeyValues.Add(col.ColumnName, user[col.ColumnName].ToString()); } - var listItem = string.IsNullOrEmpty(AlternatingItemTemplate) || row%2 == 0 ? ItemTemplate : AlternatingItemTemplate; + var listItem = string.IsNullOrEmpty(this.AlternatingItemTemplate) || row%2 == 0 ? this.ItemTemplate : this.AlternatingItemTemplate; listItem = tokenReplace.ReplaceEnvironmentTokens(listItem, tokenKeyValues, "Member"); writer.Write(listItem); //Row Footer - writer.Write(string.IsNullOrEmpty(AlternatingRowFooterTemplate) || row%2 == 0 ? RowFooterTemplate : AlternatingRowFooterTemplate); + writer.Write(string.IsNullOrEmpty(this.AlternatingRowFooterTemplate) || row%2 == 0 ? this.RowFooterTemplate : this.AlternatingRowFooterTemplate); row++; } } - writer.Write(FooterTemplate); + writer.Write(this.FooterTemplate); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPageDropDownList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPageDropDownList.cs index ca25309cf13..575184fa816 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPageDropDownList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPageDropDownList.cs @@ -27,47 +27,47 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - Roles = new List(); - - SelectItemDefaultText = Localization.GetString("DropDownList.SelectWebPageDefaultText", Localization.SharedResourceFile); - Services.GetTreeMethod = "ItemListService/GetPages"; - Services.GetNodeDescendantsMethod = "ItemListService/GetPageDescendants"; - Services.SearchTreeMethod = "ItemListService/SearchPages"; - Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForPage"; - Services.ServiceRoot = "InternalServices"; - Services.SortTreeMethod = "ItemListService/SortPages"; + this.Roles = new List(); + + this.SelectItemDefaultText = Localization.GetString("DropDownList.SelectWebPageDefaultText", Localization.SharedResourceFile); + this.Services.GetTreeMethod = "ItemListService/GetPages"; + this.Services.GetNodeDescendantsMethod = "ItemListService/GetPageDescendants"; + this.Services.SearchTreeMethod = "ItemListService/SearchPages"; + this.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForPage"; + this.Services.ServiceRoot = "InternalServices"; + this.Services.SortTreeMethod = "ItemListService/SortPages"; } protected override void OnPreRender(EventArgs e) { this.AddCssClass("page"); - if (InternalPortalId.HasValue) + if (this.InternalPortalId.HasValue) { - Services.Parameters.Add("PortalId", InternalPortalId.Value.ToString(CultureInfo.InvariantCulture)); + this.Services.Parameters.Add("PortalId", this.InternalPortalId.Value.ToString(CultureInfo.InvariantCulture)); } - Services.Parameters.Add("includeDisabled", IncludeDisabledTabs.ToString().ToLowerInvariant()); - Services.Parameters.Add("includeAllTypes", IncludeAllTabTypes.ToString().ToLowerInvariant()); - Services.Parameters.Add("includeActive", IncludeActiveTab.ToString().ToLowerInvariant()); - Services.Parameters.Add("disabledNotSelectable", DisabledNotSelectable.ToString().ToLowerInvariant()); - Services.Parameters.Add("includeHostPages", (IncludeHostPages && UserController.Instance.GetCurrentUserInfo().IsSuperUser).ToString().ToLowerInvariant()); - Services.Parameters.Add("roles", string.Join(";", Roles.ToArray())); + this.Services.Parameters.Add("includeDisabled", this.IncludeDisabledTabs.ToString().ToLowerInvariant()); + this.Services.Parameters.Add("includeAllTypes", this.IncludeAllTabTypes.ToString().ToLowerInvariant()); + this.Services.Parameters.Add("includeActive", this.IncludeActiveTab.ToString().ToLowerInvariant()); + this.Services.Parameters.Add("disabledNotSelectable", this.DisabledNotSelectable.ToString().ToLowerInvariant()); + this.Services.Parameters.Add("includeHostPages", (this.IncludeHostPages && UserController.Instance.GetCurrentUserInfo().IsSuperUser).ToString().ToLowerInvariant()); + this.Services.Parameters.Add("roles", string.Join(";", this.Roles.ToArray())); base.OnPreRender(e); //add the selected folder's level path so that it can expand to the selected node in client side. - var selectedPage = SelectedPage; + var selectedPage = this.SelectedPage; if (selectedPage != null && selectedPage.ParentId > Null.NullInteger) { var tabLevel = string.Empty; - var parentTab = TabController.Instance.GetTab(selectedPage.ParentId, PortalId, false); + var parentTab = TabController.Instance.GetTab(selectedPage.ParentId, this.PortalId, false); while (parentTab != null) { tabLevel = string.Format("{0},{1}", parentTab.TabID, tabLevel); - parentTab = TabController.Instance.GetTab(parentTab.ParentId, PortalId, false); + parentTab = TabController.Instance.GetTab(parentTab.ParentId, this.PortalId, false); } - ExpandPath = tabLevel.TrimEnd(','); + this.ExpandPath = tabLevel.TrimEnd(','); } } @@ -101,15 +101,15 @@ public int PortalId { get { - if (InternalPortalId.HasValue) + if (this.InternalPortalId.HasValue) { - return InternalPortalId.Value; + return this.InternalPortalId.Value; } return PortalSettings.Current.ActiveTab.IsSuperTab ? -1 : PortalSettings.Current.PortalId; } set { - InternalPortalId = value; + this.InternalPortalId = value; } } @@ -117,11 +117,11 @@ private int? InternalPortalId { get { - return ViewState.GetValue("PortalId", null); + return this.ViewState.GetValue("PortalId", null); } set { - ViewState.SetValue("PortalId", value, null); + this.ViewState.SetValue("PortalId", value, null); } } @@ -133,12 +133,12 @@ public TabInfo SelectedPage { get { - var pageId = SelectedItemValueAsInt; - return (pageId == Null.NullInteger) ? null : TabController.Instance.GetTab(pageId, PortalId, false); + var pageId = this.SelectedItemValueAsInt; + return (pageId == Null.NullInteger) ? null : TabController.Instance.GetTab(pageId, this.PortalId, false); } set { - SelectedItem = (value != null) ? new ListItem() { Text = value.IndentedTabName, Value = value.TabID.ToString(CultureInfo.InvariantCulture) } : null; + this.SelectedItem = (value != null) ? new ListItem() { Text = value.IndentedTabName, Value = value.TabID.ToString(CultureInfo.InvariantCulture) } : null; } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPaswordStrengthOptions.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPaswordStrengthOptions.cs index 561f08920de..6a3fa78557e 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPaswordStrengthOptions.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPaswordStrengthOptions.cs @@ -64,23 +64,23 @@ public class DnnPaswordStrengthOptions public DnnPaswordStrengthOptions() { // all the PasswordStrength related resources are located under the Website\App_GlobalResources\WebControls.resx - MinLengthText = Utilities.GetLocalizedString("PasswordStrengthMinLength"); - WeakText = Utilities.GetLocalizedString("PasswordStrengthWeak"); - FairText = Utilities.GetLocalizedString("PasswordStrengthFair"); ; - StrongText = Utilities.GetLocalizedString("PasswordStrengthStrong"); ; - - CriteriaAtLeastNCharsText = Utilities.GetLocalizedString("CriteriaAtLeastNChars"); - CriteriaAtLeastNSpecialCharsText = Utilities.GetLocalizedString("CriteriaAtLeastNSpecialChars"); - CriteriaValidationExpressionText = Utilities.GetLocalizedString("CriteriaValidationExpression"); + this.MinLengthText = Utilities.GetLocalizedString("PasswordStrengthMinLength"); + this.WeakText = Utilities.GetLocalizedString("PasswordStrengthWeak"); + this.FairText = Utilities.GetLocalizedString("PasswordStrengthFair"); ; + this.StrongText = Utilities.GetLocalizedString("PasswordStrengthStrong"); ; + + this.CriteriaAtLeastNCharsText = Utilities.GetLocalizedString("CriteriaAtLeastNChars"); + this.CriteriaAtLeastNSpecialCharsText = Utilities.GetLocalizedString("CriteriaAtLeastNSpecialChars"); + this.CriteriaValidationExpressionText = Utilities.GetLocalizedString("CriteriaValidationExpression"); - PasswordRulesHeadText = Utilities.GetLocalizedString("PasswordRulesHeadText"); + this.PasswordRulesHeadText = Utilities.GetLocalizedString("PasswordRulesHeadText"); - WeakColor = "#ed1e24"; - FairColor = "#f6d50a"; - StrongColor = "#69bd44"; + this.WeakColor = "#ed1e24"; + this.FairColor = "#f6d50a"; + this.StrongColor = "#69bd44"; - LabelCss = "min-length-text"; - MeterCss = "meter"; + this.LabelCss = "min-length-text"; + this.MeterCss = "meter"; } /// @@ -93,14 +93,14 @@ public void OnSerializing(StreamingContext context) int portalId = (PortalController.Instance.GetCurrentPortalSettings()) != null ? (PortalController.Instance.GetCurrentPortalSettings().PortalId) : -1; var settings = new MembershipPasswordSettings(portalId); - MinLength = settings.MinPasswordLength; - CriteriaAtLeastNCharsText = string.Format(CriteriaAtLeastNCharsText, MinLength); + this.MinLength = settings.MinPasswordLength; + this.CriteriaAtLeastNCharsText = string.Format(this.CriteriaAtLeastNCharsText, this.MinLength); - MinNumberOfSpecialChars = settings.MinNonAlphanumericCharacters; - CriteriaAtLeastNSpecialCharsText = string.Format(CriteriaAtLeastNSpecialCharsText, MinNumberOfSpecialChars); + this.MinNumberOfSpecialChars = settings.MinNonAlphanumericCharacters; + this.CriteriaAtLeastNSpecialCharsText = string.Format(this.CriteriaAtLeastNSpecialCharsText, this.MinNumberOfSpecialChars); - ValidationExpression = settings.ValidationExpression; - CriteriaValidationExpressionText = string.Format(CriteriaValidationExpressionText, ValidationExpression); + this.ValidationExpression = settings.ValidationExpression; + this.CriteriaValidationExpressionText = string.Format(this.CriteriaValidationExpressionText, this.ValidationExpression); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPortalPageDropDownList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPortalPageDropDownList.cs index f4c2156d62c..53db1dbecee 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPortalPageDropDownList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnPortalPageDropDownList.cs @@ -25,13 +25,13 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - SelectItemDefaultText = Localization.GetString("DropDownList.SelectWebPageDefaultText", Localization.SharedResourceFile); - Services.GetTreeMethod = "ItemListService/GetPagesInPortalGroup"; - Services.GetNodeDescendantsMethod = "ItemListService/GetPageDescendantsInPortalGroup"; - Services.SearchTreeMethod = "ItemListService/SearchPagesInPortalGroup"; - Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForPageInPortalGroup"; - Services.SortTreeMethod = "ItemListService/SortPagesInPortalGroup"; - Services.ServiceRoot = "InternalServices"; + this.SelectItemDefaultText = Localization.GetString("DropDownList.SelectWebPageDefaultText", Localization.SharedResourceFile); + this.Services.GetTreeMethod = "ItemListService/GetPagesInPortalGroup"; + this.Services.GetNodeDescendantsMethod = "ItemListService/GetPageDescendantsInPortalGroup"; + this.Services.SearchTreeMethod = "ItemListService/SearchPagesInPortalGroup"; + this.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForPageInPortalGroup"; + this.Services.SortTreeMethod = "ItemListService/SortPagesInPortalGroup"; + this.Services.ServiceRoot = "InternalServices"; } protected override void OnPreRender(EventArgs e) @@ -48,12 +48,12 @@ public TabInfo SelectedPage { get { - var pageId = SelectedItemValueAsInt; - return (pageId == Null.NullInteger) ? null : TabController.Instance.GetTab(pageId, _portalId.Value, false); + var pageId = this.SelectedItemValueAsInt; + return (pageId == Null.NullInteger) ? null : TabController.Instance.GetTab(pageId, this._portalId.Value, false); } set { - SelectedItem = (value != null) ? new ListItem() { Text = value.IndentedTabName, Value = value.TabID.ToString(CultureInfo.InvariantCulture) } : null; + this.SelectedItem = (value != null) ? new ListItem() { Text = value.IndentedTabName, Value = value.TabID.ToString(CultureInfo.InvariantCulture) } : null; } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRadioButton.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRadioButton.cs index ca644b65559..50907516e4f 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRadioButton.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRadioButton.cs @@ -22,7 +22,7 @@ public class DnnRadioButton : RadioButton, ILocalizable public DnnRadioButton() { - CssClass = "SubHead dnnLabel"; + this.CssClass = "SubHead dnnLabel"; } #endregion @@ -32,12 +32,12 @@ public DnnRadioButton() protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); base.Render(writer); } @@ -49,11 +49,11 @@ public bool Localize { get { - return _Localize; + return this._Localize; } set { - _Localize = value; + this._Localize = value; } } @@ -61,20 +61,20 @@ public bool Localize public virtual void LocalizeStrings() { - if ((Localize)) + if ((this.Localize)) { - if ((!string.IsNullOrEmpty(ToolTip))) + if ((!string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(ToolTip, LocalResourceFile); + this.ToolTip = Localization.GetString(this.ToolTip, this.LocalResourceFile); } - if ((!string.IsNullOrEmpty(Text))) + if ((!string.IsNullOrEmpty(this.Text))) { - Text = Localization.GetString(Text, LocalResourceFile); + this.Text = Localization.GetString(this.Text, this.LocalResourceFile); - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(Text + ".ToolTip", LocalResourceFile); + this.ToolTip = Localization.GetString(this.Text + ".ToolTip", this.LocalResourceFile); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBar.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBar.cs index 1ba27d42b51..a794fb3c996 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBar.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBar.cs @@ -19,7 +19,7 @@ public class DnnRibbonBar : WebControl { public DnnRibbonBar() : base("div") { - CssClass = "dnnRibbon"; + this.CssClass = "dnnRibbon"; Control control = this; Utilities.ApplySkin(control, "", "RibbonBar", "RibbonBar"); } @@ -29,7 +29,7 @@ public DnnRibbonBarGroupCollection Groups { get { - return (DnnRibbonBarGroupCollection) Controls; + return (DnnRibbonBarGroupCollection) this.Controls; } } @@ -53,7 +53,7 @@ protected override ControlCollection CreateControlCollection() protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Visible) + if (this.Visible) { Utilities.ApplySkin(this, "", "RibbonBar", "RibbonBar"); } @@ -61,10 +61,10 @@ protected override void OnPreRender(EventArgs e) protected override void Render(HtmlTextWriter writer) { - if ((Groups.Count > 0)) + if ((this.Groups.Count > 0)) { - Groups[0].CssClass = Groups[0].CssClass + " " + Groups[0].CssClass.Trim() + "First"; - Groups[Groups.Count - 1].CssClass = Groups[Groups.Count - 1].CssClass + " " + Groups[Groups.Count - 1].CssClass.Trim() + "Last"; + this.Groups[0].CssClass = this.Groups[0].CssClass + " " + this.Groups[0].CssClass.Trim() + "First"; + this.Groups[this.Groups.Count - 1].CssClass = this.Groups[this.Groups.Count - 1].CssClass + " " + this.Groups[this.Groups.Count - 1].CssClass.Trim() + "Last"; } base.RenderBeginTag(writer); @@ -78,7 +78,7 @@ protected override void Render(HtmlTextWriter writer) writer.RenderBeginTag("table"); writer.RenderBeginTag("tr"); - foreach (DnnRibbonBarGroup grp in Groups) + foreach (DnnRibbonBarGroup grp in this.Groups) { if ((grp.Visible)) { diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarGroup.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarGroup.cs index 6fe115081bc..dbd70a7b7e9 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarGroup.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarGroup.cs @@ -20,14 +20,14 @@ public class DnnRibbonBarGroup : WebControl public DnnRibbonBarGroup() : base("div") { - CssClass = "dnnRibbonGroup"; + this.CssClass = "dnnRibbonGroup"; } public override ControlCollection Controls { get { - EnsureChildControls(); + this.EnsureChildControls(); return base.Controls; } } @@ -42,17 +42,17 @@ public virtual bool CheckToolVisibility { get { - return _CheckToolVisibility; + return this._CheckToolVisibility; } set { - _CheckToolVisibility = value; + this._CheckToolVisibility = value; } } protected override void CreateChildControls() { - Controls.Clear(); + this.Controls.Clear(); HtmlGenericControl topLeft = new HtmlGenericControl("div"); topLeft.Attributes.Add("class", "topLeft"); @@ -64,39 +64,39 @@ protected override void CreateChildControls() HtmlGenericControl bottomRight = new HtmlGenericControl("div"); bottomRight.Attributes.Add("class", "bottomRight"); - _contentContainer = new HtmlGenericControl("div"); - _contentContainer.Attributes.Add("class", "content"); + this._contentContainer = new HtmlGenericControl("div"); + this._contentContainer.Attributes.Add("class", "content"); HtmlGenericControl footerContainer = new HtmlGenericControl("div"); footerContainer.Attributes.Add("class", "footer"); - Controls.Add(topLeft); - Controls.Add(topRight); - Controls.Add(_contentContainer); - Controls.Add(footerContainer); - Controls.Add(bottomLeft); - Controls.Add(bottomRight); + this.Controls.Add(topLeft); + this.Controls.Add(topRight); + this.Controls.Add(this._contentContainer); + this.Controls.Add(footerContainer); + this.Controls.Add(bottomLeft); + this.Controls.Add(bottomRight); - if (Content != null) + if (this.Content != null) { - Content.InstantiateIn(_contentContainer); + this.Content.InstantiateIn(this._contentContainer); } - if (Footer != null) + if (this.Footer != null) { - Footer.InstantiateIn(footerContainer); + this.Footer.InstantiateIn(footerContainer); } } private bool CheckVisibility() { bool returnValue = true; - if ((Visible && CheckToolVisibility)) + if ((this.Visible && this.CheckToolVisibility)) { //Hide group if all tools are invisible bool foundTool = false; - ControlCollection controls = _contentContainer.Controls; - returnValue = AreChildToolsVisible(ref controls, ref foundTool); + ControlCollection controls = this._contentContainer.Controls; + returnValue = this.AreChildToolsVisible(ref controls, ref foundTool); } return returnValue; } @@ -119,7 +119,7 @@ private bool AreChildToolsVisible(ref ControlCollection children, ref bool found else { ControlCollection controls = ctrl.Controls; - if ((AreChildToolsVisible(ref controls, ref foundTool))) + if ((this.AreChildToolsVisible(ref controls, ref foundTool))) { if ((foundTool)) { @@ -140,13 +140,13 @@ private bool AreChildToolsVisible(ref ControlCollection children, ref bool found public override Control FindControl(string id) { - EnsureChildControls(); + this.EnsureChildControls(); return base.FindControl(id); } public override void RenderControl(HtmlTextWriter writer) { - if ((CheckVisibility())) + if ((this.CheckVisibility())) { base.RenderBeginTag(writer); base.RenderChildren(writer); diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs index f20f77b1552..c5e097219ec 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnRibbonBarTool.cs @@ -35,7 +35,7 @@ public class DnnRibbonBarTool : Control, IDnnRibbonBarTool protected INavigationManager NavigationManager { get; } public DnnRibbonBarTool() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Properties @@ -48,15 +48,15 @@ public virtual RibbonBarToolInfo ToolInfo { get { - if ((ViewState["ToolInfo"] == null)) + if ((this.ViewState["ToolInfo"] == null)) { - ViewState.Add("ToolInfo", new RibbonBarToolInfo()); + this.ViewState.Add("ToolInfo", new RibbonBarToolInfo()); } - return (RibbonBarToolInfo) ViewState["ToolInfo"]; + return (RibbonBarToolInfo) this.ViewState["ToolInfo"]; } set { - ViewState["ToolInfo"] = value; + this.ViewState["ToolInfo"] = value; } } @@ -64,11 +64,11 @@ public virtual string NavigateUrl { get { - return Utilities.GetViewStateAsString(ViewState["NavigateUrl"], Null.NullString); + return Utilities.GetViewStateAsString(this.ViewState["NavigateUrl"], Null.NullString); } set { - ViewState["NavigateUrl"] = value; + this.ViewState["NavigateUrl"] = value; } } @@ -76,11 +76,11 @@ public virtual string ToolCssClass { get { - return Utilities.GetViewStateAsString(ViewState["ToolCssClass"], Null.NullString); + return Utilities.GetViewStateAsString(this.ViewState["ToolCssClass"], Null.NullString); } set { - ViewState["ToolCssClass"] = value; + this.ViewState["ToolCssClass"] = value; } } @@ -88,11 +88,11 @@ public virtual string Text { get { - return Utilities.GetViewStateAsString(ViewState["Text"], Null.NullString); + return Utilities.GetViewStateAsString(this.ViewState["Text"], Null.NullString); } set { - ViewState["Text"] = value; + this.ViewState["Text"] = value; } } @@ -100,11 +100,11 @@ public virtual string ToolTip { get { - return Utilities.GetViewStateAsString(ViewState["ToolTip"], Null.NullString); + return Utilities.GetViewStateAsString(this.ViewState["ToolTip"], Null.NullString); } set { - ViewState["ToolTip"] = value; + this.ViewState["ToolTip"] = value; } } @@ -112,12 +112,12 @@ protected virtual DnnTextButton DnnLinkButton { get { - if ((_dnnLinkButton == null)) + if ((this._dnnLinkButton == null)) { // Appending _CPCommandBtn is also assumed in the RibbonBar.ascx. If changed, one would need to change in both places. - _dnnLinkButton = new DnnTextButton {ID = ID + "_CPCommandBtn"}; + this._dnnLinkButton = new DnnTextButton {ID = this.ID + "_CPCommandBtn"}; } - return _dnnLinkButton; + return this._dnnLinkButton; } } @@ -125,11 +125,11 @@ protected virtual DnnTextLink DnnLink { get { - if ((_dnnLink == null)) + if ((this._dnnLink == null)) { - _dnnLink = new DnnTextLink(); + this._dnnLink = new DnnTextLink(); } - return _dnnLink; + return this._dnnLink; } } @@ -137,9 +137,9 @@ protected virtual IDictionary AllTools { get { - if (_allTools == null) + if (this._allTools == null) { - _allTools = new Dictionary + this._allTools = new Dictionary { //Framework {"PageSettings", new RibbonBarToolInfo("PageSettings", false, false, "", "", "", true)}, @@ -162,7 +162,7 @@ protected virtual IDictionary AllTools }; } - return _allTools; + return this._allTools; } } @@ -178,13 +178,13 @@ public virtual string ToolName { get { - return ToolInfo.ToolName; + return this.ToolInfo.ToolName; } set { - if ((AllTools.ContainsKey(value))) + if ((this.AllTools.ContainsKey(value))) { - ToolInfo = AllTools[value]; + this.ToolInfo = this.AllTools[value]; } else { @@ -199,62 +199,62 @@ public virtual string ToolName protected override void CreateChildControls() { - Controls.Clear(); - Controls.Add(DnnLinkButton); - Controls.Add(DnnLink); + this.Controls.Clear(); + this.Controls.Add(this.DnnLinkButton); + this.Controls.Add(this.DnnLink); } protected override void OnInit(EventArgs e) { - EnsureChildControls(); - DnnLinkButton.Click += ControlPanelTool_OnClick; + this.EnsureChildControls(); + this.DnnLinkButton.Click += this.ControlPanelTool_OnClick; } protected override void OnPreRender(EventArgs e) { - ProcessTool(); - Visible = (DnnLink.Visible || DnnLinkButton.Visible); + this.ProcessTool(); + this.Visible = (this.DnnLink.Visible || this.DnnLinkButton.Visible); base.OnPreRender(e); } public virtual void ControlPanelTool_OnClick(object sender, EventArgs e) { - switch (ToolInfo.ToolName) + switch (this.ToolInfo.ToolName) { case "DeletePage": - if ((HasToolPermissions("DeletePage"))) + if ((this.HasToolPermissions("DeletePage"))) { string url = TestableGlobals.Instance.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); - Page.Response.Redirect(url, true); + this.Page.Response.Redirect(url, true); } break; case "CopyPermissionsToChildren": - if ((HasToolPermissions("CopyPermissionsToChildren"))) + if ((this.HasToolPermissions("CopyPermissionsToChildren"))) { TabController.CopyPermissionsToChildren(PortalSettings.ActiveTab, PortalSettings.ActiveTab.TabPermissions); - Page.Response.Redirect(Page.Request.RawUrl); + this.Page.Response.Redirect(this.Page.Request.RawUrl); } break; case "CopyDesignToChildren": - if ((HasToolPermissions("CopyDesignToChildren"))) + if ((this.HasToolPermissions("CopyDesignToChildren"))) { TabController.CopyDesignToChildren(PortalSettings.ActiveTab, PortalSettings.ActiveTab.SkinSrc, PortalSettings.ActiveTab.ContainerSrc); - Page.Response.Redirect(Page.Request.RawUrl); + this.Page.Response.Redirect(this.Page.Request.RawUrl); } break; case "ClearCache": - if ((HasToolPermissions("ClearCache"))) + if ((this.HasToolPermissions("ClearCache"))) { - ClearCache(); + this.ClearCache(); ClientResourceManager.ClearCache(); - Page.Response.Redirect(Page.Request.RawUrl); + this.Page.Response.Redirect(this.Page.Request.RawUrl); } break; case "RecycleApp": - if ((HasToolPermissions("RecycleApp"))) + if ((this.HasToolPermissions("RecycleApp"))) { - RestartApplication(); - Page.Response.Redirect(Page.Request.RawUrl); + this.RestartApplication(); + this.Page.Response.Redirect(this.Page.Request.RawUrl); } break; } @@ -266,62 +266,62 @@ public virtual void ControlPanelTool_OnClick(object sender, EventArgs e) protected virtual void ProcessTool() { - DnnLink.Visible = false; - DnnLinkButton.Visible = false; + this.DnnLink.Visible = false; + this.DnnLinkButton.Visible = false; - if ((!string.IsNullOrEmpty(ToolInfo.ToolName))) + if ((!string.IsNullOrEmpty(this.ToolInfo.ToolName))) { - if ((ToolInfo.UseButton)) + if ((this.ToolInfo.UseButton)) { - DnnLinkButton.Visible = HasToolPermissions(ToolInfo.ToolName); - DnnLinkButton.Enabled = EnableTool(); - DnnLinkButton.Localize = false; + this.DnnLinkButton.Visible = this.HasToolPermissions(this.ToolInfo.ToolName); + this.DnnLinkButton.Enabled = this.EnableTool(); + this.DnnLinkButton.Localize = false; - DnnLinkButton.CssClass = ToolCssClass; - DnnLinkButton.DisabledCssClass = ToolCssClass + " dnnDisabled"; + this.DnnLinkButton.CssClass = this.ToolCssClass; + this.DnnLinkButton.DisabledCssClass = this.ToolCssClass + " dnnDisabled"; - DnnLinkButton.Text = GetText(); - DnnLinkButton.ToolTip = GetToolTip(); + this.DnnLinkButton.Text = this.GetText(); + this.DnnLinkButton.ToolTip = this.GetToolTip(); } else { - DnnLink.Visible = HasToolPermissions(ToolInfo.ToolName); - DnnLink.Enabled = EnableTool(); - DnnLink.Localize = false; + this.DnnLink.Visible = this.HasToolPermissions(this.ToolInfo.ToolName); + this.DnnLink.Enabled = this.EnableTool(); + this.DnnLink.Localize = false; - if ((DnnLink.Enabled)) + if ((this.DnnLink.Enabled)) { - DnnLink.NavigateUrl = BuildToolUrl(); + this.DnnLink.NavigateUrl = this.BuildToolUrl(); //can't find the page, disable it? - if ((string.IsNullOrEmpty(DnnLink.NavigateUrl))) + if ((string.IsNullOrEmpty(this.DnnLink.NavigateUrl))) { - DnnLink.Enabled = false; + this.DnnLink.Enabled = false; } //create popup event - else if (ToolInfo.ShowAsPopUp && PortalSettings.EnablePopUps) + else if (this.ToolInfo.ShowAsPopUp && PortalSettings.EnablePopUps) { // Prevent PageSettings in a popup if SSL is enabled and enforced, which causes redirection/javascript broswer security issues. - if (ToolInfo.ToolName == "PageSettings" || ToolInfo.ToolName == "CopyPage" || ToolInfo.ToolName == "NewPage") + if (this.ToolInfo.ToolName == "PageSettings" || this.ToolInfo.ToolName == "CopyPage" || this.ToolInfo.ToolName == "NewPage") { if (!(PortalSettings.SSLEnabled && PortalSettings.SSLEnforced)) { - DnnLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(DnnLink.NavigateUrl, this, PortalSettings, true, false)); + this.DnnLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(this.DnnLink.NavigateUrl, this, PortalSettings, true, false)); } } else { - DnnLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(DnnLink.NavigateUrl, this, PortalSettings, true, false)); + this.DnnLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(this.DnnLink.NavigateUrl, this, PortalSettings, true, false)); } } } - DnnLink.CssClass = ToolCssClass; - DnnLink.DisabledCssClass = ToolCssClass + " dnnDisabled"; + this.DnnLink.CssClass = this.ToolCssClass; + this.DnnLink.DisabledCssClass = this.ToolCssClass + " dnnDisabled"; - DnnLink.Text = GetText(); - DnnLink.ToolTip = GetToolTip(); - DnnLink.Target = ToolInfo.LinkWindowTarget; + this.DnnLink.Text = this.GetText(); + this.DnnLink.ToolTip = this.GetToolTip(); + this.DnnLink.Target = this.ToolInfo.LinkWindowTarget; } } } @@ -330,7 +330,7 @@ protected virtual bool EnableTool() { bool returnValue = true; - switch (ToolInfo.ToolName) + switch (this.ToolInfo.ToolName) { case "DeletePage": if ((TabController.IsSpecialTab(TabController.CurrentPage.TabID, PortalSettings.PortalId))) @@ -340,8 +340,8 @@ protected virtual bool EnableTool() break; case "CopyDesignToChildren": case "CopyPermissionsToChildren": - returnValue = ActiveTabHasChildren(); - if ((returnValue && ToolInfo.ToolName == "CopyPermissionsToChildren")) + returnValue = this.ActiveTabHasChildren(); + if ((returnValue && this.ToolInfo.ToolName == "CopyPermissionsToChildren")) { if ((PortalSettings.ActiveTab.IsSuperTab)) { @@ -357,13 +357,13 @@ protected virtual bool EnableTool() protected virtual bool HasToolPermissions(string toolName) { bool isHostTool = false; - if ((ToolInfo.ToolName == toolName)) + if ((this.ToolInfo.ToolName == toolName)) { - isHostTool = ToolInfo.IsHostTool; + isHostTool = this.ToolInfo.IsHostTool; } - else if ((AllTools.ContainsKey(toolName))) + else if ((this.AllTools.ContainsKey(toolName))) { - isHostTool = AllTools[toolName].IsHostTool; + isHostTool = this.AllTools[toolName].IsHostTool; } if ((isHostTool && !UserController.Instance.GetCurrentUserInfo().IsSuperUser)) @@ -409,13 +409,13 @@ protected virtual bool HasToolPermissions(string toolName) //if it has a module definition, look it up and check permissions //if it doesn't exist, assume no permission string friendlyName = ""; - if ((ToolInfo.ToolName == toolName)) + if ((this.ToolInfo.ToolName == toolName)) { - friendlyName = ToolInfo.ModuleFriendlyName; + friendlyName = this.ToolInfo.ModuleFriendlyName; } - else if ((AllTools.ContainsKey(toolName))) + else if ((this.AllTools.ContainsKey(toolName))) { - friendlyName = AllTools[toolName].ModuleFriendlyName; + friendlyName = this.AllTools[toolName].ModuleFriendlyName; } if ((!string.IsNullOrEmpty(friendlyName))) @@ -445,18 +445,18 @@ protected virtual bool HasToolPermissions(string toolName) protected virtual string BuildToolUrl() { - if ((ToolInfo.IsHostTool && !UserController.Instance.GetCurrentUserInfo().IsSuperUser)) + if ((this.ToolInfo.IsHostTool && !UserController.Instance.GetCurrentUserInfo().IsSuperUser)) { return "javascript:void(0);"; } - if ((!string.IsNullOrEmpty(NavigateUrl))) + if ((!string.IsNullOrEmpty(this.NavigateUrl))) { - return NavigateUrl; + return this.NavigateUrl; } string returnValue = "javascript:void(0);"; - switch (ToolInfo.ToolName) + switch (this.ToolInfo.ToolName) { case "PageSettings": returnValue = TestableGlobals.Instance.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit"); @@ -475,7 +475,7 @@ protected virtual string BuildToolUrl() break; case "ExportPage": - returnValue = NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = this.NavigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); break; case "NewPage": @@ -493,10 +493,10 @@ protected virtual string BuildToolUrl() returnValue = TestableGlobals.Instance.NavigateURL(PortalSettings.ActiveTab.TabID, "WebUpload"); break; default: - if ((!string.IsNullOrEmpty(ToolInfo.ModuleFriendlyName))) + if ((!string.IsNullOrEmpty(this.ToolInfo.ModuleFriendlyName))) { var additionalParams = new List(); - returnValue = GetTabURL(additionalParams); + returnValue = this.GetTabURL(additionalParams); } break; } @@ -505,40 +505,40 @@ protected virtual string BuildToolUrl() protected virtual string GetText() { - if ((string.IsNullOrEmpty(Text))) + if ((string.IsNullOrEmpty(this.Text))) { - return GetString(string.Format("Tool.{0}.Text", ToolInfo.ToolName)); + return this.GetString(string.Format("Tool.{0}.Text", this.ToolInfo.ToolName)); } - return Text; + return this.Text; } protected virtual string GetToolTip() { - if ((ToolInfo.ToolName == "DeletePage")) + if ((this.ToolInfo.ToolName == "DeletePage")) { if ((TabController.IsSpecialTab(TabController.CurrentPage.TabID, PortalSettings.PortalId))) { - return GetString("Tool.DeletePage.Special.ToolTip"); + return this.GetString("Tool.DeletePage.Special.ToolTip"); } } - if ((string.IsNullOrEmpty(Text))) + if ((string.IsNullOrEmpty(this.Text))) { - string tip = GetString(string.Format("Tool.{0}.ToolTip", ToolInfo.ToolName)); + string tip = this.GetString(string.Format("Tool.{0}.ToolTip", this.ToolInfo.ToolName)); if ((string.IsNullOrEmpty(tip))) { - tip = GetString(string.Format("Tool.{0}.Text", ToolInfo.ToolName)); + tip = this.GetString(string.Format("Tool.{0}.Text", this.ToolInfo.ToolName)); } return tip; } - return ToolTip; + return this.ToolTip; } protected virtual string GetTabURL(List additionalParams) { - int portalId = (ToolInfo.IsHostTool) ? Null.NullInteger : PortalSettings.PortalId; + int portalId = (this.ToolInfo.IsHostTool) ? Null.NullInteger : PortalSettings.PortalId; string strURL = string.Empty; @@ -547,22 +547,22 @@ protected virtual string GetTabURL(List additionalParams) additionalParams = new List(); } - var moduleInfo = ModuleController.Instance.GetModuleByDefinition(portalId, ToolInfo.ModuleFriendlyName); + var moduleInfo = ModuleController.Instance.GetModuleByDefinition(portalId, this.ToolInfo.ModuleFriendlyName); if (((moduleInfo != null))) { bool isHostPage = (portalId == Null.NullInteger); - if ((!string.IsNullOrEmpty(ToolInfo.ControlKey))) + if ((!string.IsNullOrEmpty(this.ToolInfo.ControlKey))) { additionalParams.Insert(0, "mid=" + moduleInfo.ModuleID); - if (ToolInfo.ShowAsPopUp && PortalSettings.EnablePopUps) + if (this.ToolInfo.ShowAsPopUp && PortalSettings.EnablePopUps) { additionalParams.Add("popUp=true"); } } string currentCulture = Thread.CurrentThread.CurrentCulture.Name; - strURL = NavigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, ToolInfo.ControlKey, currentCulture, additionalParams.ToArray()); + strURL = this.NavigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, this.ToolInfo.ControlKey, currentCulture, additionalParams.ToArray()); } return strURL; @@ -598,7 +598,7 @@ protected virtual void ClearCache() protected virtual void RestartApplication() { var log = new LogInfo { BypassBuffering = true, LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString() }; - log.AddProperty("Message", GetString("UserRestart")); + log.AddProperty("Message", this.GetString("UserRestart")); LogController.Instance.AddLog(log); Config.Touch(); } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTab.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTab.cs index 8f27a5412a5..6cf34041954 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTab.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTab.cs @@ -22,7 +22,7 @@ public override ControlCollection Controls { get { - EnsureChildControls(); + this.EnsureChildControls(); return base.Controls; } } @@ -35,17 +35,17 @@ public override ControlCollection Controls protected override void CreateChildControls() { - Controls.Clear(); + this.Controls.Clear(); - if (Content != null) + if (this.Content != null) { - Content.InstantiateIn(this); + this.Content.InstantiateIn(this); } } public override Control FindControl(string id) { - EnsureChildControls(); + this.EnsureChildControls(); return base.FindControl(id); } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextButton.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextButton.cs index 518a095abf3..3b971157e87 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextButton.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextButton.cs @@ -28,11 +28,11 @@ public string ConfirmMessage { get { - return ViewState["ConfirmMessage"] == null ? string.Empty : (string) ViewState["ConfirmMessage"]; + return this.ViewState["ConfirmMessage"] == null ? string.Empty : (string) this.ViewState["ConfirmMessage"]; } set { - ViewState["ConfirmMessage"] = value; + this.ViewState["ConfirmMessage"] = value; } } @@ -44,11 +44,11 @@ public override string CssClass { get { - return ViewState["CssClass"] == null ? string.Empty : (string) ViewState["CssClass"]; + return this.ViewState["CssClass"] == null ? string.Empty : (string) this.ViewState["CssClass"]; } set { - ViewState["CssClass"] = value; + this.ViewState["CssClass"] = value; } } @@ -60,11 +60,11 @@ public override string CssClass { get { - return ViewState["DisabledCssClass"] == null ? string.Empty : (string) ViewState["DisabledCssClass"]; + return this.ViewState["DisabledCssClass"] == null ? string.Empty : (string) this.ViewState["DisabledCssClass"]; } set { - ViewState["DisabledCssClass"] = value; + this.ViewState["DisabledCssClass"] = value; } } @@ -76,11 +76,11 @@ public override string CssClass { get { - return ViewState["Text"] == null ? string.Empty : (string) ViewState["Text"]; + return this.ViewState["Text"] == null ? string.Empty : (string) this.ViewState["Text"]; } set { - ViewState["Text"] = value; + this.ViewState["Text"] = value; } } @@ -90,17 +90,17 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); - if (!Enabled && !string.IsNullOrEmpty(DisabledCssClass)) + this.LocalizeStrings(); + if (!this.Enabled && !string.IsNullOrEmpty(this.DisabledCssClass)) { - CssClass = DisabledCssClass; + this.CssClass = this.DisabledCssClass; } - writer.AddAttribute("class", CssClass.Trim()); + writer.AddAttribute("class", this.CssClass.Trim()); base.Render(writer); } @@ -110,11 +110,11 @@ public bool Localize { get { - return _localize; + return this._localize; } set { - _localize = value; + this._localize = value; } } @@ -122,25 +122,25 @@ public bool Localize public virtual void LocalizeStrings() { - if ((Localize)) + if ((this.Localize)) { - if ((!string.IsNullOrEmpty(ToolTip))) + if ((!string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(ToolTip, LocalResourceFile); + this.ToolTip = Localization.GetString(this.ToolTip, this.LocalResourceFile); } - if ((!string.IsNullOrEmpty(Text))) + if ((!string.IsNullOrEmpty(this.Text))) { - Text = Localization.GetString(Text, LocalResourceFile); + this.Text = Localization.GetString(this.Text, this.LocalResourceFile); - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(string.Format("{0}.ToolTip", Text), LocalResourceFile); + this.ToolTip = Localization.GetString(string.Format("{0}.ToolTip", this.Text), this.LocalResourceFile); } - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Text; + this.ToolTip = this.Text; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextLink.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextLink.cs index f5927c0dc56..573f9d9c2df 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextLink.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTextLink.cs @@ -21,8 +21,8 @@ public class DnnTextLink : WebControl, ILocalizable public DnnTextLink() : base("span") { - CssClass = "dnnTextLink"; - DisabledCssClass = "dnnTextLink disabled"; + this.CssClass = "dnnTextLink"; + this.DisabledCssClass = "dnnTextLink disabled"; } [Bindable(true)] @@ -33,11 +33,11 @@ public string Text { get { - return TextHyperlinkControl.Text; + return this.TextHyperlinkControl.Text; } set { - TextHyperlinkControl.Text = value; + this.TextHyperlinkControl.Text = value; } } @@ -49,11 +49,11 @@ public override string ToolTip { get { - return TextHyperlinkControl.ToolTip; + return this.TextHyperlinkControl.ToolTip; } set { - TextHyperlinkControl.ToolTip = value; + this.TextHyperlinkControl.ToolTip = value; } } @@ -65,11 +65,11 @@ public string NavigateUrl { get { - return TextHyperlinkControl.NavigateUrl; + return this.TextHyperlinkControl.NavigateUrl; } set { - TextHyperlinkControl.NavigateUrl = value; + this.TextHyperlinkControl.NavigateUrl = value; } } @@ -81,11 +81,11 @@ public string Target { get { - return TextHyperlinkControl.Target; + return this.TextHyperlinkControl.Target; } set { - TextHyperlinkControl.Target = value; + this.TextHyperlinkControl.Target = value; } } @@ -97,11 +97,11 @@ public string Target { get { - return ViewState["DisabledCssClass"] == null ? string.Empty : (string) ViewState["DisabledCssClass"]; + return this.ViewState["DisabledCssClass"] == null ? string.Empty : (string) this.ViewState["DisabledCssClass"]; } set { - ViewState["DisabledCssClass"] = value; + this.ViewState["DisabledCssClass"] = value; } } @@ -109,18 +109,18 @@ private HyperLink TextHyperlinkControl { get { - if (_textHyperlinkControl == null) + if (this._textHyperlinkControl == null) { - _textHyperlinkControl = new HyperLink(); + this._textHyperlinkControl = new HyperLink(); } - return _textHyperlinkControl; + return this._textHyperlinkControl; } } protected override void CreateChildControls() { - Controls.Clear(); - Controls.Add(TextHyperlinkControl); + this.Controls.Clear(); + this.Controls.Add(this.TextHyperlinkControl); } #region "Protected Methods" @@ -128,20 +128,20 @@ protected override void CreateChildControls() protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LocalResourceFile = Utilities.GetLocalResourceFile(this); + this.LocalResourceFile = Utilities.GetLocalResourceFile(this); } protected override void Render(HtmlTextWriter writer) { - LocalizeStrings(); + this.LocalizeStrings(); - if ((!Enabled)) + if ((!this.Enabled)) { - if ((!string.IsNullOrEmpty(DisabledCssClass))) + if ((!string.IsNullOrEmpty(this.DisabledCssClass))) { - CssClass = DisabledCssClass; + this.CssClass = this.DisabledCssClass; } - NavigateUrl = "javascript:void(0);"; + this.NavigateUrl = "javascript:void(0);"; } base.RenderBeginTag(writer); @@ -157,11 +157,11 @@ public bool Localize { get { - return _localize; + return this._localize; } set { - _localize = value; + this._localize = value; } } @@ -169,25 +169,25 @@ public bool Localize public virtual void LocalizeStrings() { - if ((Localize)) + if ((this.Localize)) { - if ((!string.IsNullOrEmpty(ToolTip))) + if ((!string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(ToolTip, LocalResourceFile); + this.ToolTip = Localization.GetString(this.ToolTip, this.LocalResourceFile); } - if ((!string.IsNullOrEmpty(Text))) + if ((!string.IsNullOrEmpty(this.Text))) { - Text = Localization.GetString(Text, LocalResourceFile); + this.Text = Localization.GetString(this.Text, this.LocalResourceFile); - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Localization.GetString(string.Format("{0}.ToolTip", Text), LocalResourceFile); + this.ToolTip = Localization.GetString(string.Format("{0}.ToolTip", this.Text), this.LocalResourceFile); } - if ((string.IsNullOrEmpty(ToolTip))) + if ((string.IsNullOrEmpty(this.ToolTip))) { - ToolTip = Text; + this.ToolTip = this.Text; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTimeZoneEditControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTimeZoneEditControl.cs index d60d8cfe808..945d573f59d 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTimeZoneEditControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnTimeZoneEditControl.cs @@ -30,8 +30,8 @@ public override string EditControlClientId { get { - EnsureChildControls(); - return TimeZones.ClientID; + this.EnsureChildControls(); + return this.TimeZones.ClientID; } } @@ -39,11 +39,11 @@ public override string EditControlClientId protected override void CreateChildControls() { - TimeZones = new DnnTimeZoneComboBox(); - TimeZones.ViewStateMode = ViewStateMode.Disabled; + this.TimeZones = new DnnTimeZoneComboBox(); + this.TimeZones.ViewStateMode = ViewStateMode.Disabled; - Controls.Clear(); - Controls.Add(TimeZones); + this.Controls.Clear(); + this.Controls.Add(this.TimeZones); base.CreateChildControls(); } @@ -51,11 +51,11 @@ protected override void CreateChildControls() public override bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection) { bool dataChanged = false; - string presentValue = StringValue; - string postedValue = TimeZones.SelectedValue; + string presentValue = this.StringValue; + string postedValue = this.TimeZones.SelectedValue; if (!presentValue.Equals(postedValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } @@ -64,10 +64,10 @@ public override bool LoadPostData(string postDataKey, System.Collections.Special protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = TimeZoneInfo.FindSystemTimeZoneById(StringValue); - args.OldValue = OldStringValue; - args.StringValue = StringValue; + var args = new PropertyEditorEventArgs(this.Name); + args.Value = TimeZoneInfo.FindSystemTimeZoneById(this.StringValue); + args.OldValue = this.OldStringValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -81,9 +81,9 @@ protected override void OnPreRender(System.EventArgs e) { base.OnPreRender(e); - TimeZones.DataBind(StringValue); + this.TimeZones.DataBind(this.StringValue); - if ((Page != null) && this.EditMode == PropertyEditorMode.Edit) + if ((this.Page != null) && this.EditMode == PropertyEditorMode.Edit) { this.Page.RegisterRequiresPostBack(this); } @@ -97,7 +97,7 @@ protected override void RenderEditMode(System.Web.UI.HtmlTextWriter writer) protected override void RenderViewMode(System.Web.UI.HtmlTextWriter writer) { string propValue = this.Page.Server.HtmlDecode(Convert.ToString(this.Value)); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(propValue); writer.RenderEndTag(); diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedList.cs index b8621acb335..857b60c6ca0 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedList.cs @@ -36,16 +36,16 @@ public virtual UniformControlCollection Li { get { - return _listItems ?? (_listItems = new UniformControlCollection(this)); + return this._listItems ?? (this._listItems = new UniformControlCollection(this)); } } protected override void AddAttributesToRender(HtmlTextWriter writer) { - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); - if (!string.IsNullOrEmpty(CssClass)) + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); + if (!string.IsNullOrEmpty(this.CssClass)) { - writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClass); + writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass); } } @@ -59,7 +59,7 @@ public void AddListItem(params Control[] listItemControls) { var listItem = new DnnUnsortedListItem(); listItem.AddControls(listItemControls); - ListItems.Add(listItem); + this.ListItems.Add(listItem); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedListItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedListItem.cs index 19b7515e1a0..d6a843dabb0 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedListItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUnsortedListItem.cs @@ -26,21 +26,21 @@ public void AddControls(params Control[] childControls) { if (childControl != null) { - Controls.Add(childControl); + this.Controls.Add(childControl); } } } protected override void AddAttributesToRender(HtmlTextWriter writer) { - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); - if (!string.IsNullOrEmpty(CssClass)) + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); + if (!string.IsNullOrEmpty(this.CssClass)) { - writer.AddAttribute(HtmlTextWriterAttribute.Class, CssClass); + writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass); } - if (!string.IsNullOrEmpty(ToolTip)) + if (!string.IsNullOrEmpty(this.ToolTip)) { - writer.AddAttribute(HtmlTextWriterAttribute.Title, ToolTip); + writer.AddAttribute(HtmlTextWriterAttribute.Title, this.ToolTip); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUrlControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUrlControl.cs index f360bf3d191..0066807362d 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUrlControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/DnnUrlControl.cs @@ -72,16 +72,16 @@ public string FileFilter { get { - if (ViewState["FileFilter"] != null) + if (this.ViewState["FileFilter"] != null) { - return ViewState["FileFilter"].ToString(); + return this.ViewState["FileFilter"].ToString(); } return string.Empty; } set { - ViewState["FileFilter"] = value; + this.ViewState["FileFilter"] = value; } } @@ -89,9 +89,9 @@ public bool IncludeActiveTab { get { - if (ViewState["IncludeActiveTab"] != null) + if (this.ViewState["IncludeActiveTab"] != null) { - return Convert.ToBoolean(ViewState["IncludeActiveTab"]); + return Convert.ToBoolean(this.ViewState["IncludeActiveTab"]); } else { @@ -100,10 +100,10 @@ public bool IncludeActiveTab } set { - ViewState["IncludeActiveTab"] = value; - if (IsTrackingViewState) + this.ViewState["IncludeActiveTab"] = value; + if (this.IsTrackingViewState) { - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } } } @@ -113,19 +113,19 @@ public string LocalResourceFile get { string fileRoot; - if (String.IsNullOrEmpty(_localResourceFile)) + if (String.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/URLControl.ascx"; + fileRoot = this.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/URLControl.ascx"; } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -133,9 +133,9 @@ public bool Log { get { - if (chkLog.Visible) + if (this.chkLog.Visible) { - return chkLog.Checked; + return this.chkLog.Checked; } else { @@ -149,19 +149,19 @@ public int ModuleID get { int myMid = -2; - if (ViewState["ModuleId"] != null) + if (this.ViewState["ModuleId"] != null) { - myMid = Convert.ToInt32(ViewState["ModuleId"]); + myMid = Convert.ToInt32(this.ViewState["ModuleId"]); } - else if (Request.QueryString["mid"] != null) + else if (this.Request.QueryString["mid"] != null) { - Int32.TryParse(Request.QueryString["mid"], out myMid); + Int32.TryParse(this.Request.QueryString["mid"], out myMid); } return myMid; } set { - ViewState["ModuleId"] = value; + this.ViewState["ModuleId"] = value; } } @@ -169,11 +169,11 @@ public bool NewWindow { get { - return chkNewWindow.Visible && chkNewWindow.Checked; + return this.chkNewWindow.Visible && this.chkNewWindow.Checked; } set { - chkNewWindow.Checked = chkNewWindow.Visible && value; + this.chkNewWindow.Checked = this.chkNewWindow.Visible && value; } } @@ -181,9 +181,9 @@ public bool Required { get { - if (ViewState["Required"] != null) + if (this.ViewState["Required"] != null) { - return Convert.ToBoolean(ViewState["Required"]); + return Convert.ToBoolean(this.ViewState["Required"]); } else { @@ -192,10 +192,10 @@ public bool Required } set { - ViewState["Required"] = value; - if (IsTrackingViewState) + this.ViewState["Required"] = value; + if (this.IsTrackingViewState) { - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } } } @@ -204,9 +204,9 @@ public bool ShowFiles { get { - if (ViewState["ShowFiles"] != null) + if (this.ViewState["ShowFiles"] != null) { - return Convert.ToBoolean(ViewState["ShowFiles"]); + return Convert.ToBoolean(this.ViewState["ShowFiles"]); } else { @@ -215,10 +215,10 @@ public bool ShowFiles } set { - ViewState["ShowFiles"] = value; - if (IsTrackingViewState) + this.ViewState["ShowFiles"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -227,9 +227,9 @@ public bool ShowImages { get { - if (ViewState["ShowImages"] != null) + if (this.ViewState["ShowImages"] != null) { - return Convert.ToBoolean(ViewState["ShowImages"]); + return Convert.ToBoolean(this.ViewState["ShowImages"]); } else { @@ -238,10 +238,10 @@ public bool ShowImages } set { - ViewState["ShowImages"] = value; - if (IsTrackingViewState) + this.ViewState["ShowImages"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -250,11 +250,11 @@ public bool ShowLog { get { - return chkLog.Visible; + return this.chkLog.Visible; } set { - chkLog.Visible = value; + this.chkLog.Visible = value; } } @@ -262,11 +262,11 @@ public bool ShowNewWindow { get { - return chkNewWindow.Visible; + return this.chkNewWindow.Visible; } set { - chkNewWindow.Visible = value; + this.chkNewWindow.Visible = value; } } @@ -274,9 +274,9 @@ public bool ShowNone { get { - if (ViewState["ShowNone"] != null) + if (this.ViewState["ShowNone"] != null) { - return Convert.ToBoolean(ViewState["ShowNone"]); + return Convert.ToBoolean(this.ViewState["ShowNone"]); } else { @@ -285,10 +285,10 @@ public bool ShowNone } set { - ViewState["ShowNone"] = value; - if (IsTrackingViewState) + this.ViewState["ShowNone"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -297,9 +297,9 @@ public bool ShowTabs { get { - if (ViewState["ShowTabs"] != null) + if (this.ViewState["ShowTabs"] != null) { - return Convert.ToBoolean(ViewState["ShowTabs"]); + return Convert.ToBoolean(this.ViewState["ShowTabs"]); } else { @@ -308,10 +308,10 @@ public bool ShowTabs } set { - ViewState["ShowTabs"] = value; - if (IsTrackingViewState) + this.ViewState["ShowTabs"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -320,11 +320,11 @@ public bool ShowTrack { get { - return chkTrack.Visible; + return this.chkTrack.Visible; } set { - chkTrack.Visible = value; + this.chkTrack.Visible = value; } } @@ -332,9 +332,9 @@ public bool ShowUpLoad { get { - if (ViewState["ShowUpLoad"] != null) + if (this.ViewState["ShowUpLoad"] != null) { - return Convert.ToBoolean(ViewState["ShowUpLoad"]); + return Convert.ToBoolean(this.ViewState["ShowUpLoad"]); } else { @@ -343,10 +343,10 @@ public bool ShowUpLoad } set { - ViewState["ShowUpLoad"] = value; - if (IsTrackingViewState) + this.ViewState["ShowUpLoad"] = value; + if (this.IsTrackingViewState) { - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } } } @@ -355,9 +355,9 @@ public bool ShowUrls { get { - if (ViewState["ShowUrls"] != null) + if (this.ViewState["ShowUrls"] != null) { - return Convert.ToBoolean(ViewState["ShowUrls"]); + return Convert.ToBoolean(this.ViewState["ShowUrls"]); } else { @@ -366,10 +366,10 @@ public bool ShowUrls } set { - ViewState["ShowUrls"] = value; - if (IsTrackingViewState) + this.ViewState["ShowUrls"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -378,9 +378,9 @@ public bool ShowUsers { get { - if (ViewState["ShowUsers"] != null) + if (this.ViewState["ShowUsers"] != null) { - return Convert.ToBoolean(ViewState["ShowUsers"]); + return Convert.ToBoolean(this.ViewState["ShowUsers"]); } else { @@ -389,10 +389,10 @@ public bool ShowUsers } set { - ViewState["ShowUsers"] = value; - if (IsTrackingViewState) + this.ViewState["ShowUsers"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -401,9 +401,9 @@ public bool Track { get { - if (chkTrack.Visible) + if (this.chkTrack.Visible) { - return chkTrack.Checked; + return this.chkTrack.Checked; } else { @@ -418,30 +418,30 @@ public string Url { string r = ""; string strCurrentType = ""; - if (optType.Items.Count > 0 && optType.SelectedIndex >= 0) + if (this.optType.Items.Count > 0 && this.optType.SelectedIndex >= 0) { - strCurrentType = optType.SelectedItem.Value; + strCurrentType = this.optType.SelectedItem.Value; } switch (strCurrentType) { case "I": - if (cboImages.SelectedItem != null) + if (this.cboImages.SelectedItem != null) { - r = cboImages.SelectedItem.Value; + r = this.cboImages.SelectedItem.Value; } break; case "U": - if (cboUrls.Visible) + if (this.cboUrls.Visible) { - if (cboUrls.SelectedItem != null) + if (this.cboUrls.SelectedItem != null) { - r = cboUrls.SelectedItem.Value; - txtUrl.Text = r; + r = this.cboUrls.SelectedItem.Value; + this.txtUrl.Text = r; } } else { - string mCustomUrl = txtUrl.Text; + string mCustomUrl = this.txtUrl.Text; if (mCustomUrl.Equals("http://", StringComparison.InvariantCultureIgnoreCase)) { r = ""; @@ -454,9 +454,9 @@ public string Url break; case "T": string strTab = ""; - if (cboTabs.SelectedItem != null) + if (this.cboTabs.SelectedItem != null) { - strTab = cboTabs.SelectedItem.Value; + strTab = this.cboTabs.SelectedItem.Value; int id; if (int.TryParse(strTab,out id) && id >= 0) { @@ -465,9 +465,9 @@ public string Url } break; case "F": - if (ctlFile.FileID > Null.NullInteger) + if (this.ctlFile.FileID > Null.NullInteger) { - r = "FileID=" + ctlFile.FileID; + r = "FileID=" + this.ctlFile.FileID; } else { @@ -475,18 +475,18 @@ public string Url } break; case "M": - if (!String.IsNullOrEmpty(txtUser.Text)) + if (!String.IsNullOrEmpty(this.txtUser.Text)) { - UserInfo objUser = UserController.GetCachedUser(_objPortal.PortalID, txtUser.Text); + UserInfo objUser = UserController.GetCachedUser(this._objPortal.PortalID, this.txtUser.Text); if (objUser != null) { r = "UserID=" + objUser.UserID; } else { - lblMessage.Text = Localization.GetString("NoUser", LocalResourceFile); - ErrorRow.Visible = true; - txtUser.Text = ""; + this.lblMessage.Text = Localization.GetString("NoUser", this.LocalResourceFile); + this.ErrorRow.Visible = true; + this.txtUser.Text = ""; } } break; @@ -495,12 +495,12 @@ public string Url } set { - ViewState["Url"] = value; - txtUrl.Text = string.Empty; + this.ViewState["Url"] = value; + this.txtUrl.Text = string.Empty; - if (IsTrackingViewState) + if (this.IsTrackingViewState) { - _doChangeURL = true; + this._doChangeURL = true; } } } @@ -509,16 +509,16 @@ public string UrlType { get { - return Convert.ToString(ViewState["UrlType"]); + return Convert.ToString(this.ViewState["UrlType"]); } set { if (value != null && !String.IsNullOrEmpty(value.Trim())) { - ViewState["UrlType"] = value; - if (IsTrackingViewState) + this.ViewState["UrlType"] = value; + if (this.IsTrackingViewState) { - _doChangeURL = true; + this._doChangeURL = true; } } } @@ -528,18 +528,18 @@ public string Width { get { - return Convert.ToString(ViewState["SkinControlWidth"]); + return Convert.ToString(this.ViewState["SkinControlWidth"]); } set { if (!String.IsNullOrEmpty(value)) { - cboUrls.Width = Unit.Parse(value); - txtUrl.Width = Unit.Parse(value); - cboImages.Width = Unit.Parse(value); - cboTabs.Width = Unit.Parse(value); - txtUser.Width = Unit.Parse(value); - ViewState["SkinControlWidth"] = value; + this.cboUrls.Width = Unit.Parse(value); + this.txtUrl.Width = Unit.Parse(value); + this.cboImages.Width = Unit.Parse(value); + this.cboTabs.Width = Unit.Parse(value); + this.txtUser.Width = Unit.Parse(value); + this.ViewState["SkinControlWidth"] = value; } } } @@ -551,26 +551,26 @@ public string Width private void LoadUrls() { var objUrls = new UrlController(); - cboUrls.Items.Clear(); - cboUrls.DataSource = objUrls.GetUrls(_objPortal.PortalID); - cboUrls.DataBind(); + this.cboUrls.Items.Clear(); + this.cboUrls.DataSource = objUrls.GetUrls(this._objPortal.PortalID); + this.cboUrls.DataBind(); } private void DoChangeURL() { - string _Url = Convert.ToString(ViewState["Url"]); - string _Urltype = Convert.ToString(ViewState["UrlType"]); + string _Url = Convert.ToString(this.ViewState["Url"]); + string _Urltype = Convert.ToString(this.ViewState["UrlType"]); if (!String.IsNullOrEmpty(_Url)) { var objUrls = new UrlController(); string TrackingUrl = _Url; _Urltype = Globals.GetURLType(_Url).ToString("g").Substring(0, 1); - if (_Urltype == "U" && (_Url.StartsWith("~/" + PortalSettings.DefaultIconLocation, StringComparison.InvariantCultureIgnoreCase))) + if (_Urltype == "U" && (_Url.StartsWith("~/" + this.PortalSettings.DefaultIconLocation, StringComparison.InvariantCultureIgnoreCase))) { _Urltype = "I"; } - ViewState["UrlType"] = _Urltype; + this.ViewState["UrlType"] = _Urltype; if (_Urltype == "F") { if (_Url.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase)) @@ -587,7 +587,7 @@ private void DoChangeURL() //to handle legacy scenarios before the introduction of the FileServerHandler var fileName = Path.GetFileName(_Url); var folderPath = _Url.Substring(0, _Url.LastIndexOf(fileName)); - var folder = FolderManager.Instance.GetFolder(_objPortal.PortalID, folderPath); + var folder = FolderManager.Instance.GetFolder(this._objPortal.PortalID, folderPath); var fileId = -1; if (folder != null) { @@ -604,241 +604,241 @@ private void DoChangeURL() { if (_Url.StartsWith("userid=", StringComparison.InvariantCultureIgnoreCase)) { - UserInfo objUser = UserController.GetUserById(_objPortal.PortalID, int.Parse(_Url.Substring(7))); + UserInfo objUser = UserController.GetUserById(this._objPortal.PortalID, int.Parse(_Url.Substring(7))); if (objUser != null) { _Url = objUser.Username; } } } - UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(_objPortal.PortalID, TrackingUrl, ModuleID); + UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(this._objPortal.PortalID, TrackingUrl, this.ModuleID); if (objUrlTracking != null) { - chkNewWindow.Checked = objUrlTracking.NewWindow; - chkTrack.Checked = objUrlTracking.TrackClicks; - chkLog.Checked = objUrlTracking.LogActivity; + this.chkNewWindow.Checked = objUrlTracking.NewWindow; + this.chkTrack.Checked = objUrlTracking.TrackClicks; + this.chkLog.Checked = objUrlTracking.LogActivity; } else //the url does not exist in the tracking table { - chkTrack.Checked = false; - chkLog.Checked = false; + this.chkTrack.Checked = false; + this.chkLog.Checked = false; } - ViewState["Url"] = _Url; + this.ViewState["Url"] = _Url; } else { if (!String.IsNullOrEmpty(_Urltype)) { - optType.ClearSelection(); - if (optType.Items.FindByValue(_Urltype) != null) + this.optType.ClearSelection(); + if (this.optType.Items.FindByValue(_Urltype) != null) { - optType.Items.FindByValue(_Urltype).Selected = true; + this.optType.Items.FindByValue(_Urltype).Selected = true; } else { - optType.Items[0].Selected = true; + this.optType.Items[0].Selected = true; } } else { - if (optType.Items.Count > 0) + if (this.optType.Items.Count > 0) { - optType.ClearSelection(); - optType.Items[0].Selected = true; + this.optType.ClearSelection(); + this.optType.Items[0].Selected = true; } } - chkNewWindow.Checked = false; //Need check - chkTrack.Checked = false; //Need check - chkLog.Checked = false; //Need check + this.chkNewWindow.Checked = false; //Need check + this.chkTrack.Checked = false; //Need check + this.chkLog.Checked = false; //Need check } //Url type changed, then we must draw the controlos for that type - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } private void DoRenderTypes() { //We must clear the list to keep the same item order string strCurrent = ""; - if (optType.SelectedIndex >= 0) + if (this.optType.SelectedIndex >= 0) { - strCurrent = optType.SelectedItem.Value; //Save current selected value + strCurrent = this.optType.SelectedItem.Value; //Save current selected value } - optType.Items.Clear(); - if (ShowNone) + this.optType.Items.Clear(); + if (this.ShowNone) { - if (optType.Items.FindByValue("N") == null) + if (this.optType.Items.FindByValue("N") == null) { - optType.Items.Add(new ListItem(Localization.GetString("NoneType", LocalResourceFile), "N")); + this.optType.Items.Add(new ListItem(Localization.GetString("NoneType", this.LocalResourceFile), "N")); } } else { - if (optType.Items.FindByValue("N") != null) + if (this.optType.Items.FindByValue("N") != null) { - optType.Items.Remove(optType.Items.FindByValue("N")); + this.optType.Items.Remove(this.optType.Items.FindByValue("N")); } } - if (ShowUrls) + if (this.ShowUrls) { - if (optType.Items.FindByValue("U") == null) + if (this.optType.Items.FindByValue("U") == null) { - optType.Items.Add(new ListItem(Localization.GetString("URLType", LocalResourceFile), "U")); + this.optType.Items.Add(new ListItem(Localization.GetString("URLType", this.LocalResourceFile), "U")); } } else { - if (optType.Items.FindByValue("U") != null) + if (this.optType.Items.FindByValue("U") != null) { - optType.Items.Remove(optType.Items.FindByValue("U")); + this.optType.Items.Remove(this.optType.Items.FindByValue("U")); } } - if (ShowTabs) + if (this.ShowTabs) { - if (optType.Items.FindByValue("T") == null) + if (this.optType.Items.FindByValue("T") == null) { - optType.Items.Add(new ListItem(Localization.GetString("TabType", LocalResourceFile), "T")); + this.optType.Items.Add(new ListItem(Localization.GetString("TabType", this.LocalResourceFile), "T")); } } else { - if (optType.Items.FindByValue("T") != null) + if (this.optType.Items.FindByValue("T") != null) { - optType.Items.Remove(optType.Items.FindByValue("T")); + this.optType.Items.Remove(this.optType.Items.FindByValue("T")); } } - if (ShowFiles) + if (this.ShowFiles) { - if (optType.Items.FindByValue("F") == null) + if (this.optType.Items.FindByValue("F") == null) { - optType.Items.Add(new ListItem(Localization.GetString("FileType", LocalResourceFile), "F")); + this.optType.Items.Add(new ListItem(Localization.GetString("FileType", this.LocalResourceFile), "F")); } } else { - if (optType.Items.FindByValue("F") != null) + if (this.optType.Items.FindByValue("F") != null) { - optType.Items.Remove(optType.Items.FindByValue("F")); + this.optType.Items.Remove(this.optType.Items.FindByValue("F")); } } - if (ShowImages) + if (this.ShowImages) { - if (optType.Items.FindByValue("I") == null) + if (this.optType.Items.FindByValue("I") == null) { - optType.Items.Add(new ListItem(Localization.GetString("ImageType", LocalResourceFile), "I")); + this.optType.Items.Add(new ListItem(Localization.GetString("ImageType", this.LocalResourceFile), "I")); } } else { - if (optType.Items.FindByValue("I") != null) + if (this.optType.Items.FindByValue("I") != null) { - optType.Items.Remove(optType.Items.FindByValue("I")); + this.optType.Items.Remove(this.optType.Items.FindByValue("I")); } } - if (ShowUsers) + if (this.ShowUsers) { - if (optType.Items.FindByValue("M") == null) + if (this.optType.Items.FindByValue("M") == null) { - optType.Items.Add(new ListItem(Localization.GetString("UserType", LocalResourceFile), "M")); + this.optType.Items.Add(new ListItem(Localization.GetString("UserType", this.LocalResourceFile), "M")); } } else { - if (optType.Items.FindByValue("M") != null) + if (this.optType.Items.FindByValue("M") != null) { - optType.Items.Remove(optType.Items.FindByValue("M")); + this.optType.Items.Remove(this.optType.Items.FindByValue("M")); } } - if (optType.Items.Count > 0) + if (this.optType.Items.Count > 0) { if (!String.IsNullOrEmpty(strCurrent)) { - if (optType.Items.FindByValue(strCurrent) != null) + if (this.optType.Items.FindByValue(strCurrent) != null) { - optType.Items.FindByValue(strCurrent).Selected = true; + this.optType.Items.FindByValue(strCurrent).Selected = true; } else { - optType.Items[0].Selected = true; - _doRenderTypeControls = true; //Type changed, re-draw + this.optType.Items[0].Selected = true; + this._doRenderTypeControls = true; //Type changed, re-draw } } else { - optType.Items[0].Selected = true; - _doRenderTypeControls = true; //Type changed, re-draw + this.optType.Items[0].Selected = true; + this._doRenderTypeControls = true; //Type changed, re-draw } - TypeRow.Visible = optType.Items.Count > 1; + this.TypeRow.Visible = this.optType.Items.Count > 1; } else { - TypeRow.Visible = false; + this.TypeRow.Visible = false; } } private void DoCorrectRadioButtonList() { - string _Urltype = Convert.ToString(ViewState["UrlType"]); + string _Urltype = Convert.ToString(this.ViewState["UrlType"]); - if (optType.Items.Count > 0) + if (this.optType.Items.Count > 0) { - optType.ClearSelection(); + this.optType.ClearSelection(); if (!String.IsNullOrEmpty(_Urltype)) { - if (optType.Items.FindByValue(_Urltype) != null) + if (this.optType.Items.FindByValue(_Urltype) != null) { - optType.Items.FindByValue(_Urltype).Selected = true; + this.optType.Items.FindByValue(_Urltype).Selected = true; } else { - optType.Items[0].Selected = true; - _Urltype = optType.Items[0].Value; - ViewState["UrlType"] = _Urltype; + this.optType.Items[0].Selected = true; + _Urltype = this.optType.Items[0].Value; + this.ViewState["UrlType"] = _Urltype; } } else { - optType.Items[0].Selected = true; - _Urltype = optType.Items[0].Value; - ViewState["UrlType"] = _Urltype; + this.optType.Items[0].Selected = true; + _Urltype = this.optType.Items[0].Value; + this.ViewState["UrlType"] = _Urltype; } } } private void DoRenderTypeControls() { - string _Url = Convert.ToString(ViewState["Url"]); - string _Urltype = Convert.ToString(ViewState["UrlType"]); + string _Url = Convert.ToString(this.ViewState["Url"]); + string _Urltype = Convert.ToString(this.ViewState["UrlType"]); var objUrls = new UrlController(); if (!String.IsNullOrEmpty(_Urltype)) { //load listitems - switch (optType.SelectedItem.Value) + switch (this.optType.SelectedItem.Value) { case "N": //None - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = false; + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; break; case "I": //System Image - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = true; + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = true; - cboImages.Items.Clear(); + this.cboImages.Items.Clear(); - string strImagesFolder = Path.Combine(Globals.ApplicationMapPath, PortalSettings.DefaultIconLocation.Replace('/', '\\')); + string strImagesFolder = Path.Combine(Globals.ApplicationMapPath, this.PortalSettings.DefaultIconLocation.Replace('/', '\\')); foreach (string strImage in Directory.GetFiles(strImagesFolder)) { string img = strImage.Replace(strImagesFolder, "").Trim('/').Trim('\\'); - cboImages.Items.Add(new ListItem(img, string.Format("~/{0}/{1}", PortalSettings.DefaultIconLocation, img).ToLowerInvariant())); + this.cboImages.Items.Add(new ListItem(img, string.Format("~/{0}/{1}", this.PortalSettings.DefaultIconLocation, img).ToLowerInvariant())); } - ListItem selecteItem = cboImages.Items.FindByValue(_Url.ToLowerInvariant()); + ListItem selecteItem = this.cboImages.Items.FindByValue(_Url.ToLowerInvariant()); if (selecteItem != null) { selecteItem.Selected = true; @@ -846,54 +846,54 @@ private void DoRenderTypeControls() break; case "U": //Url - URLRow.Visible = true; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = false; - if (String.IsNullOrEmpty(txtUrl.Text)) + this.URLRow.Visible = true; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; + if (String.IsNullOrEmpty(this.txtUrl.Text)) { - txtUrl.Text = _Url; + this.txtUrl.Text = _Url; } - if (String.IsNullOrEmpty(txtUrl.Text)) + if (String.IsNullOrEmpty(this.txtUrl.Text)) { - txtUrl.Text = "http://"; + this.txtUrl.Text = "http://"; } - txtUrl.Visible = true; + this.txtUrl.Visible = true; - cmdSelect.Visible = true; + this.cmdSelect.Visible = true; - cboUrls.Visible = false; - cmdAdd.Visible = false; - cmdDelete.Visible = false; + this.cboUrls.Visible = false; + this.cmdAdd.Visible = false; + this.cmdDelete.Visible = false; break; case "T": //tab - URLRow.Visible = false; - TabRow.Visible = true; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = false; - - cboTabs.IncludeAllTabTypes = false; - cboTabs.IncludeActiveTab = IncludeActiveTab; - cboTabs.IncludeDisabledTabs = true; - cboTabs.DisabledNotSelectable = true; - cboTabs.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty); + this.URLRow.Visible = false; + this.TabRow.Visible = true; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; + + this.cboTabs.IncludeAllTabTypes = false; + this.cboTabs.IncludeActiveTab = this.IncludeActiveTab; + this.cboTabs.IncludeDisabledTabs = true; + this.cboTabs.DisabledNotSelectable = true; + this.cboTabs.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty); if (!string.IsNullOrEmpty(_Url)) { PortalSettings _settings = PortalController.Instance.GetCurrentPortalSettings(); var tabId = Int32.Parse(_Url); var page = TabController.Instance.GetTab(tabId, _settings.PortalId); - cboTabs.SelectedPage = page; + this.cboTabs.SelectedPage = page; } break; case "F": //file - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = true; - UserRow.Visible = false; - ImagesRow.Visible = false; + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = true; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; //select folder //We Must check if selected folder has changed because of a property change (Secure, Database) @@ -902,13 +902,13 @@ private void DoRenderTypeControls() string LastFileName = string.Empty; string LastFolderPath = string.Empty; //Let's try to remember last selection - if (ViewState["LastFolderPath"] != null) + if (this.ViewState["LastFolderPath"] != null) { - LastFolderPath = Convert.ToString(ViewState["LastFolderPath"]); + LastFolderPath = Convert.ToString(this.ViewState["LastFolderPath"]); } - if (ViewState["LastFileName"] != null) + if (this.ViewState["LastFileName"] != null) { - LastFileName = Convert.ToString(ViewState["LastFileName"]); + LastFileName = Convert.ToString(this.ViewState["LastFileName"]); } if (_Url != string.Empty) { @@ -923,30 +923,30 @@ private void DoRenderTypeControls() FolderPath = LastFolderPath; } - ctlFile.FilePath = FolderPath + FileName; + this.ctlFile.FilePath = FolderPath + FileName; - txtUrl.Visible = false; + this.txtUrl.Visible = false; break; case "M": //membership users - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = true; - ImagesRow.Visible = false; - if (String.IsNullOrEmpty(txtUser.Text)) + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = true; + this.ImagesRow.Visible = false; + if (String.IsNullOrEmpty(this.txtUser.Text)) { - txtUser.Text = _Url; + this.txtUser.Text = _Url; } break; } } else { - URLRow.Visible = false; - ImagesRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; + this.URLRow.Visible = false; + this.ImagesRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; } } @@ -959,9 +959,9 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //prevent unauthorized access - if (Request.IsAuthenticated == false) + if (this.Request.IsAuthenticated == false) { - Visible = false; + this.Visible = false; } ClientResourceManager.EnableAsyncPostBackHandler(); @@ -971,32 +971,32 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - optType.SelectedIndexChanged += optType_SelectedIndexChanged; - cmdAdd.Click += cmdAdd_Click; - cmdDelete.Click += cmdDelete_Click; - cmdSelect.Click += cmdSelect_Click; + this.optType.SelectedIndexChanged += this.optType_SelectedIndexChanged; + this.cmdAdd.Click += this.cmdAdd_Click; + this.cmdDelete.Click += this.cmdDelete_Click; + this.cmdSelect.Click += this.cmdSelect_Click; - ErrorRow.Visible = false; + this.ErrorRow.Visible = false; try { - if ((Request.QueryString["pid"] != null) && (Globals.IsHostTab(PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) + if ((this.Request.QueryString["pid"] != null) && (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) { - _objPortal = PortalController.Instance.GetPortal(Int32.Parse(Request.QueryString["pid"])); + this._objPortal = PortalController.Instance.GetPortal(Int32.Parse(this.Request.QueryString["pid"])); } else { - _objPortal = PortalController.Instance.GetPortal(PortalSettings.PortalId); + this._objPortal = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); } - if (ViewState["IsUrlControlLoaded"] == null) + if (this.ViewState["IsUrlControlLoaded"] == null) { //If Not Page.IsPostBack Then //let's make at least an initialization //The type radio button must be initialized //The url must be initialized no matter its value - _doRenderTypes = true; - _doChangeURL = true; - ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem")); + this._doRenderTypes = true; + this._doChangeURL = true; + ClientAPI.AddButtonConfirm(this.cmdDelete, Localization.GetString("DeleteItem")); //The following line was mover to the pre-render event to ensure render for the first time //ViewState("IsUrlControlLoaded") = "Loaded" } @@ -1013,24 +1013,24 @@ protected override void OnPreRender(EventArgs e) try { - if (_doRenderTypes) + if (this._doRenderTypes) { - DoRenderTypes(); + this.DoRenderTypes(); } - if (_doChangeURL) + if (this._doChangeURL) { - DoChangeURL(); + this.DoChangeURL(); } - DoCorrectRadioButtonList(); + this.DoCorrectRadioButtonList(); - if (_doRenderTypeControls) + if (this._doRenderTypeControls) { - DoRenderTypeControls(); + this.DoRenderTypeControls(); } - ViewState["Url"] = null; - ViewState["IsUrlControlLoaded"] = "Loaded"; + this.ViewState["Url"] = null; + this.ViewState["IsUrlControlLoaded"] = "Loaded"; - ctlFile.FileFilter = FileFilter; + this.ctlFile.FileFilter = this.FileFilter; } catch (Exception exc) { @@ -1041,52 +1041,52 @@ protected override void OnPreRender(EventArgs e) protected void cmdAdd_Click(object sender, EventArgs e) { - cboUrls.Visible = false; - cmdSelect.Visible = true; - txtUrl.Visible = true; - cmdAdd.Visible = false; - cmdDelete.Visible = false; - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; + this.cboUrls.Visible = false; + this.cmdSelect.Visible = true; + this.txtUrl.Visible = true; + this.cmdAdd.Visible = false; + this.cmdDelete.Visible = false; + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; } protected void cmdDelete_Click(object sender, EventArgs e) { - if (cboUrls.SelectedItem != null) + if (this.cboUrls.SelectedItem != null) { var objUrls = new UrlController(); - objUrls.DeleteUrl(_objPortal.PortalID, cboUrls.SelectedItem.Value); - LoadUrls(); //we must reload the url list + objUrls.DeleteUrl(this._objPortal.PortalID, this.cboUrls.SelectedItem.Value); + this.LoadUrls(); //we must reload the url list } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; } protected void cmdSelect_Click(object sender, EventArgs e) { - cboUrls.Visible = true; - cmdSelect.Visible = false; - txtUrl.Visible = false; - cmdAdd.Visible = true; - cmdDelete.Visible = PortalSecurity.IsInRole(_objPortal.AdministratorRoleName); - LoadUrls(); - if (cboUrls.Items.FindByValue(txtUrl.Text) != null) - { - cboUrls.ClearSelection(); - cboUrls.Items.FindByValue(txtUrl.Text).Selected = true; - } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; + this.cboUrls.Visible = true; + this.cmdSelect.Visible = false; + this.txtUrl.Visible = false; + this.cmdAdd.Visible = true; + this.cmdDelete.Visible = PortalSecurity.IsInRole(this._objPortal.AdministratorRoleName); + this.LoadUrls(); + if (this.cboUrls.Items.FindByValue(this.txtUrl.Text) != null) + { + this.cboUrls.ClearSelection(); + this.cboUrls.Items.FindByValue(this.txtUrl.Text).Selected = true; + } + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; } protected void optType_SelectedIndexChanged(Object sender, EventArgs e) { //Type changed, render the correct control set - ViewState["UrlType"] = optType.SelectedItem.Value; - _doRenderTypeControls = true; + this.ViewState["UrlType"] = this.optType.SelectedItem.Value; + this._doRenderTypeControls = true; } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnCheckBoxList.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnCheckBoxList.cs index ab47fe5e68f..7ef103ad125 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnCheckBoxList.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnCheckBoxList.cs @@ -24,7 +24,7 @@ public class DnnCheckBoxList : CheckBoxList { protected override void OnInit(EventArgs e) { - RepeatColumns = 1; + this.RepeatColumns = 1; base.OnInit(e); } @@ -40,7 +40,7 @@ public override string SelectedValue { if (this.RequiresDataBinding) { - _initValue = value; + this._initValue = value; } else { @@ -52,16 +52,16 @@ public override string SelectedValue protected override void OnPreRender(EventArgs e) { Utilities.ApplySkin(this); - RegisterRequestResources(); + this.RegisterRequestResources(); base.OnPreRender(e); } public override void DataBind() { - if (!string.IsNullOrEmpty(_initValue)) + if (!string.IsNullOrEmpty(this._initValue)) { - DataBind(_initValue); + this.DataBind(this._initValue); } else { @@ -71,57 +71,57 @@ public override void DataBind() public void AddItem(string text, string value) { - Items.Add(new ListItem(text, value)); + this.Items.Add(new ListItem(text, value)); } public void InsertItem(int index, string text, string value) { - Items.Insert(index, new ListItem(text, value)); + this.Items.Insert(index, new ListItem(text, value)); } public void DataBind(string initialValue) { - DataBind(initialValue, false); + this.DataBind(initialValue, false); } public void DataBind(string initial, bool findByText) { base.DataBind(); - Select(initial, findByText); + this.Select(initial, findByText); } public void Select(string initial, bool findByText) { if (findByText) { - if (FindItemByText(initial, true) != null) + if (this.FindItemByText(initial, true) != null) { - FindItemByText(initial, true).Selected = true; + this.FindItemByText(initial, true).Selected = true; } } else { - if (FindItemByValue(initial, true) != null) + if (this.FindItemByValue(initial, true) != null) { - FindItemByValue(initial, true).Selected = true; + this.FindItemByValue(initial, true).Selected = true; } } } public ListItem FindItemByText(string text, bool ignoreCase = false) { - return ignoreCase ? Items.FindByText(text) : Items.FindByTextWithIgnoreCase(text); + return ignoreCase ? this.Items.FindByText(text) : this.Items.FindByTextWithIgnoreCase(text); } public ListItem FindItemByValue(string value, bool ignoreCase = false) { - return ignoreCase ? Items.FindByValue(value) : Items.FindByValueWithIgnoreCase(value); + return ignoreCase ? this.Items.FindByValue(value) : this.Items.FindByValueWithIgnoreCase(value); } public int FindItemIndexByValue(string value) { - return Items.IndexOf(FindItemByValue(value)); + return this.Items.IndexOf(this.FindItemByValue(value)); } private void RegisterRequestResources() @@ -137,12 +137,12 @@ private void RegisterRequestResources() var libraryPath = $"~/Resources/Libraries/{package.LibraryName}/{Globals.FormatVersion(package.Version, "00", 3, "_")}/"; - ClientResourceManager.RegisterStyleSheet(Page, $"{libraryPath}selectize.css"); - ClientResourceManager.RegisterStyleSheet(Page, $"{libraryPath}selectize.default.css"); + ClientResourceManager.RegisterStyleSheet(this.Page, $"{libraryPath}selectize.css"); + ClientResourceManager.RegisterStyleSheet(this.Page, $"{libraryPath}selectize.default.css"); - var initScripts = $"$('#{ClientID}').selectize({{}});"; + var initScripts = $"$('#{this.ClientID}').selectize({{}});"; - Page.ClientScript.RegisterStartupScript(Page.GetType(), $"{ClientID}Sctipts", initScripts, true); + this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), $"{this.ClientID}Sctipts", initScripts, true); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBox.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBox.cs index 39c23fb1bcd..77895ac781c 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBox.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBox.cs @@ -45,10 +45,10 @@ public override string SelectedValue { if (this.RequiresDataBinding) { - _initValue = value; + this._initValue = value; } - if (Items.Cast().Any(i => i.Value == value)) + if (this.Items.Cast().Any(i => i.Value == value)) { base.SelectedValue = value; } @@ -65,22 +65,22 @@ public string Value { get { - if (TagKey == HtmlTextWriterTag.Input) + if (this.TagKey == HtmlTextWriterTag.Input) { - return _multipleValue ?? string.Empty; + return this._multipleValue ?? string.Empty; } - return SelectedValue ?? string.Empty; + return this.SelectedValue ?? string.Empty; } set { - if (TagKey == HtmlTextWriterTag.Input) + if (this.TagKey == HtmlTextWriterTag.Input) { - Attributes.Remove("value"); - Attributes.Add("value", value); + this.Attributes.Remove("value"); + this.Attributes.Add("value", value); } - SelectedValue = value; + this.SelectedValue = value; } } @@ -88,7 +88,7 @@ protected override HtmlTextWriterTag TagKey { get { - return MultipleSelect || CheckBoxes ? HtmlTextWriterTag.Input : HtmlTextWriterTag.Select; + return this.MultipleSelect || this.CheckBoxes ? HtmlTextWriterTag.Input : HtmlTextWriterTag.Select; } } @@ -103,7 +103,7 @@ protected override bool LoadPostData(string postDataKey, NameValueCollection pos var postData = postCollection[postDataKey]; if (!string.IsNullOrEmpty(postData)) { - _multipleValue = postData; + this._multipleValue = postData; } return base.LoadPostData(postDataKey, postCollection); @@ -111,7 +111,7 @@ protected override bool LoadPostData(string postDataKey, NameValueCollection pos protected override void RenderContents(HtmlTextWriter writer) { - if (TagKey == HtmlTextWriterTag.Select) + if (this.TagKey == HtmlTextWriterTag.Select) { base.RenderContents(writer); } @@ -121,41 +121,41 @@ protected override void OnPreRender(EventArgs e) { Utilities.ApplySkin(this); - if (TagKey == HtmlTextWriterTag.Input) + if (this.TagKey == HtmlTextWriterTag.Input) { - Options.Items = Items.Cast(); - Value = string.Join(",", Options.Items.Where(i => i.Selected).Select(i => i.Value)); + this.Options.Items = this.Items.Cast(); + this.Value = string.Join(",", this.Options.Items.Where(i => i.Selected).Select(i => i.Value)); } else { - if (Items.Cast().Any(i => string.IsNullOrEmpty(i.Value))) + if (this.Items.Cast().Any(i => string.IsNullOrEmpty(i.Value))) { - Options.AllowEmptyOption = true; + this.Options.AllowEmptyOption = true; } } - if (!Options.Localization.ContainsKey("ItemsChecked")) + if (!this.Options.Localization.ContainsKey("ItemsChecked")) { - Options.Localization.Add("ItemsChecked", Utilities.GetLocalizedString("ItemsCheckedString")); + this.Options.Localization.Add("ItemsChecked", Utilities.GetLocalizedString("ItemsCheckedString")); } - if (!Options.Localization.ContainsKey("AllItemsChecked")) + if (!this.Options.Localization.ContainsKey("AllItemsChecked")) { - Options.Localization.Add("AllItemsChecked", Utilities.GetLocalizedString("AllItemsCheckedString")); + this.Options.Localization.Add("AllItemsChecked", Utilities.GetLocalizedString("AllItemsCheckedString")); } - Options.Checkbox = CheckBoxes; - Options.OnChangeEvent = OnClientSelectedIndexChanged; + this.Options.Checkbox = this.CheckBoxes; + this.Options.OnChangeEvent = this.OnClientSelectedIndexChanged; - RegisterRequestResources(); + this.RegisterRequestResources(); base.OnPreRender(e); } public override void DataBind() { - if (!string.IsNullOrEmpty(_initValue)) + if (!string.IsNullOrEmpty(this._initValue)) { - DataBind(_initValue); + this.DataBind(this._initValue); } else { @@ -169,57 +169,57 @@ public override void DataBind() public void AddItem(string text, string value) { - Items.Add(new ListItem(text, value)); + this.Items.Add(new ListItem(text, value)); } public void InsertItem(int index, string text, string value) { - Items.Insert(index, new ListItem(text, value)); + this.Items.Insert(index, new ListItem(text, value)); } public void DataBind(string initialValue) { - DataBind(initialValue, false); + this.DataBind(initialValue, false); } public void DataBind(string initial, bool findByText) { base.DataBind(); - Select(initial, findByText); + this.Select(initial, findByText); } public void Select(string initial, bool findByText) { if (findByText) { - if (FindItemByText(initial, true) != null) + if (this.FindItemByText(initial, true) != null) { - FindItemByText(initial, true).Selected = true; + this.FindItemByText(initial, true).Selected = true; } } else { - if (FindItemByValue(initial, true) != null) + if (this.FindItemByValue(initial, true) != null) { - FindItemByValue(initial, true).Selected = true; + this.FindItemByValue(initial, true).Selected = true; } } } public ListItem FindItemByText(string text, bool ignoreCase = false) { - return ignoreCase ? Items.FindByText(text) : Items.FindByTextWithIgnoreCase(text); + return ignoreCase ? this.Items.FindByText(text) : this.Items.FindByTextWithIgnoreCase(text); } public ListItem FindItemByValue(string value, bool ignoreCase = false) { - return ignoreCase ? Items.FindByValue(value) : Items.FindByValueWithIgnoreCase(value); + return ignoreCase ? this.Items.FindByValue(value) : this.Items.FindByValueWithIgnoreCase(value); } public int FindItemIndexByValue(string value) { - return Items.IndexOf(FindItemByValue(value)); + return this.Items.IndexOf(this.FindItemByValue(value)); } #endregion @@ -240,19 +240,19 @@ private void RegisterRequestResources() var libraryPath = $"~/Resources/Libraries/{package.LibraryName}/{Globals.FormatVersion(package.Version, "00", 3, "_")}/"; - ClientResourceManager.RegisterScript(Page, $"{libraryPath}dnn.combobox.js"); - ClientResourceManager.RegisterStyleSheet(Page, $"{libraryPath}selectize.css"); - ClientResourceManager.RegisterStyleSheet(Page, $"{libraryPath}selectize.default.css"); + ClientResourceManager.RegisterScript(this.Page, $"{libraryPath}dnn.combobox.js"); + ClientResourceManager.RegisterStyleSheet(this.Page, $"{libraryPath}selectize.css"); + ClientResourceManager.RegisterStyleSheet(this.Page, $"{libraryPath}selectize.default.css"); - var options = JsonConvert.SerializeObject(Options, Formatting.None, + var options = JsonConvert.SerializeObject(this.Options, Formatting.None, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); - var initScripts = $"$('#{ClientID}').dnnComboBox({options});"; + var initScripts = $"$('#{this.ClientID}').dnnComboBox({options});"; - ScriptManager.RegisterStartupScript(Page, Page.GetType(), $"{ClientID}Sctipts", initScripts, true); + ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), $"{this.ClientID}Sctipts", initScripts, true); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBoxOption.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBoxOption.cs index 545eb793661..c0bc4452fab 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBoxOption.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnComboBoxOption.cs @@ -64,7 +64,7 @@ public class DnnComboBoxOption [DataMember(Name = "options")] public IEnumerable Options { - get { return Items?.Select(i => new OptionItem {Text = i.Text, Value = i.Value, Selected = i.Selected}); } + get { return this.Items?.Select(i => new OptionItem {Text = i.Text, Value = i.Value, Selected = i.Selected}); } } [DataMember(Name = "localization")] diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnDatePicker.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnDatePicker.cs index 1a32a626c70..8f4c65a2220 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnDatePicker.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnDatePicker.cs @@ -29,7 +29,7 @@ public DateTime? SelectedDate { get { DateTime value; - if (!string.IsNullOrEmpty(Text) && DateTime.TryParse(Text, out value)) + if (!string.IsNullOrEmpty(this.Text) && DateTime.TryParse(this.Text, out value)) { return value; } @@ -38,7 +38,7 @@ public DateTime? SelectedDate { } set { - Text = value?.ToString(Format) ?? string.Empty; + this.Text = value?.ToString(this.Format) ?? string.Empty; } } @@ -53,31 +53,31 @@ protected override void OnPreRender(EventArgs e) JavaScript.RequestRegistration(CommonJs.jQuery); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/components/DatePicker/moment.min.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/components/DatePicker/pikaday.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/components/DatePicker/pikaday.jquery.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/moment.min.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.jquery.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/components/DatePicker/pikaday.css"); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/components/DatePicker/pikaday.css"); - RegisterClientResources(); + this.RegisterClientResources(); } protected virtual IDictionary GetSettings() { return new Dictionary { - {"minDate", MinDate > DateTime.MinValue ? $"$new Date('{MinDate.ToString(Format, CultureInfo.InvariantCulture)}')$" : ""}, - {"maxDate", MaxDate > DateTime.MinValue ? $"$new Date('{MaxDate.ToString(Format, CultureInfo.InvariantCulture)}')$" : ""}, - {"format", ClientFormat } + {"minDate", this.MinDate > DateTime.MinValue ? $"$new Date('{this.MinDate.ToString(this.Format, CultureInfo.InvariantCulture)}')$" : ""}, + {"maxDate", this.MaxDate > DateTime.MinValue ? $"$new Date('{this.MaxDate.ToString(this.Format, CultureInfo.InvariantCulture)}')$" : ""}, + {"format", this.ClientFormat } }; } private void RegisterClientResources() { - var settings = Json.Serialize(GetSettings()).Replace("\"$", "").Replace("$\"", ""); - var script = $"$('#{ClientID}').pikaday({settings});"; + var settings = Json.Serialize(this.GetSettings()).Replace("\"$", "").Replace("$\"", ""); + var script = $"$('#{this.ClientID}').pikaday({settings});"; - ScriptManager.RegisterStartupScript(Page, Page.GetType(), "DnnDatePicker" + ClientID, script, true); + ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "DnnDatePicker" + this.ClientID, script, true); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormComboBoxItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormComboBoxItem.cs index 33b3b86e7ad..431da94330f 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormComboBoxItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormComboBoxItem.cs @@ -25,12 +25,12 @@ public class DnnFormComboBoxItem : DnnFormListItemBase private void IndexChanged(object sender, EventArgs e) { - UpdateDataSource(Value, ComboBox.SelectedValue, DataField); + this.UpdateDataSource(this.Value, this.ComboBox.SelectedValue, this.DataField); } protected override void BindList() { - BindListInternal(ComboBox, Value, ListSource, ListTextField, ListValueField); + BindListInternal(this.ComboBox, this.Value, this.ListSource, this.ListTextField, this.ListValueField); } //internal static void BindListInternal(DropDownList comboBox, object value, IEnumerable listSource, string textField, string valueField) @@ -69,16 +69,16 @@ internal static void BindListInternal(DnnComboBox comboBox, object value, IEnume protected override WebControl CreateControlInternal(Control container) { //ComboBox = new DropDownList { ID = ID + "_ComboBox" }; - ComboBox = new DnnComboBox { ID = ID + "_ComboBox" }; - ComboBox.SelectedIndexChanged += IndexChanged; - container.Controls.Add(ComboBox); + this.ComboBox = new DnnComboBox { ID = this.ID + "_ComboBox" }; + this.ComboBox.SelectedIndexChanged += this.IndexChanged; + container.Controls.Add(this.ComboBox); - if (ListSource != null) + if (this.ListSource != null) { - BindList(); + this.BindList(); } - return ComboBox; + return this.ComboBox; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormToggleButtonItem.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormToggleButtonItem.cs index 124dd2ff681..81440d94fbc 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormToggleButtonItem.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnFormToggleButtonItem.cs @@ -34,7 +34,7 @@ public enum CheckBoxMode public DnnFormToggleButtonItem() { - Mode = CheckBoxMode.TrueFalse; + this.Mode = CheckBoxMode.TrueFalse; } public CheckBoxMode Mode { get; set; } @@ -42,56 +42,56 @@ public DnnFormToggleButtonItem() private void CheckedChanged(object sender, EventArgs e) { string newValue; - switch (Mode) + switch (this.Mode) { case CheckBoxMode.YN: - newValue = (_checkBox.Checked) ? "Y" : "N"; + newValue = (this._checkBox.Checked) ? "Y" : "N"; break; case CheckBoxMode.YesNo: - newValue = (_checkBox.Checked) ? "Yes" : "No"; + newValue = (this._checkBox.Checked) ? "Yes" : "No"; break; default: - newValue = (_checkBox.Checked) ? "true" : "false"; + newValue = (this._checkBox.Checked) ? "true" : "false"; break; } - UpdateDataSource(Value, newValue, DataField); + this.UpdateDataSource(this.Value, newValue, this.DataField); } protected override WebControl CreateControlInternal(Control container) { //_checkBox = new DnnRadButton {ID = ID + "_CheckBox", ButtonType = RadButtonType.ToggleButton, ToggleType = ButtonToggleType.CheckBox, AutoPostBack = false}; - _checkBox = new CheckBox{ ID = ID + "_CheckBox", AutoPostBack = false }; + this._checkBox = new CheckBox{ ID = this.ID + "_CheckBox", AutoPostBack = false }; - _checkBox.CheckedChanged += CheckedChanged; - container.Controls.Add(_checkBox); + this._checkBox.CheckedChanged += this.CheckedChanged; + container.Controls.Add(this._checkBox); //Load from ControlState - if (!_checkBox.Page.IsPostBack) + if (!this._checkBox.Page.IsPostBack) { } - switch (Mode) + switch (this.Mode) { case CheckBoxMode.YN: case CheckBoxMode.YesNo: - var stringValue = Value as string; + var stringValue = this.Value as string; if (stringValue != null) { - _checkBox.Checked = stringValue.StartsWith("Y", StringComparison.InvariantCultureIgnoreCase); + this._checkBox.Checked = stringValue.StartsWith("Y", StringComparison.InvariantCultureIgnoreCase); } break; default: - _checkBox.Checked = Convert.ToBoolean(Value); + this._checkBox.Checked = Convert.ToBoolean(this.Value); break; } - return _checkBox; + return this._checkBox; } protected override void OnInit(EventArgs e) { base.OnInit(e); - FormMode = DnnFormMode.Short; + this.FormMode = DnnFormMode.Short; } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnGrid.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnGrid.cs index b396db01670..4d261001dc2 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnGrid.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnGrid.cs @@ -27,16 +27,16 @@ public int CurrentPageIndex { get { - return PageIndex; + return this.PageIndex; } - set { PageIndex = value; } + set { this.PageIndex = value; } } - public TableItemStyle ItemStyle => RowStyle; - public TableItemStyle AlternatingItemStyle => AlternatingRowStyle; - public TableItemStyle EditItemStyle => EditRowStyle; - public TableItemStyle SelectedItemStyle => SelectedRowStyle; + public TableItemStyle ItemStyle => this.RowStyle; + public TableItemStyle AlternatingItemStyle => this.AlternatingRowStyle; + public TableItemStyle EditItemStyle => this.EditRowStyle; + public TableItemStyle SelectedItemStyle => this.SelectedRowStyle; #endregion @@ -53,8 +53,8 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - AlternatingRowStyle.CssClass = "alter-row"; - Style.Remove("border-collapse"); + this.AlternatingRowStyle.CssClass = "alter-row"; + this.Style.Remove("border-collapse"); } } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnModuleComboBox.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnModuleComboBox.cs index 1478b4e75cf..a060e711fee 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnModuleComboBox.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnModuleComboBox.cs @@ -40,7 +40,7 @@ public int ItemCount { get { - return _moduleCombo.Items.Count; + return this._moduleCombo.Items.Count; } } @@ -48,7 +48,7 @@ public override string SelectedValue { get { - return _moduleCombo.SelectedValue; + return this._moduleCombo.SelectedValue; } } @@ -56,18 +56,18 @@ public string RadComboBoxClientId { get { - return _moduleCombo.ClientID; + return this._moduleCombo.ClientID; } } public override bool Enabled { get { - return _moduleCombo.Enabled; + return this._moduleCombo.Enabled; } set { - _moduleCombo.Enabled = value; + this._moduleCombo.Enabled = value; } } @@ -78,7 +78,7 @@ public override bool Enabled { private Dictionary GetPortalDesktopModules() { IOrderedEnumerable> portalModulesList; - if (Filter == null) + if (this.Filter == null) { portalModulesList = DesktopModuleController.GetPortalDesktopModules(PortalSettings.Current.PortalId) .Where((kvp) => kvp.Value.DesktopModule.Category == "Uncategorised" || String.IsNullOrEmpty(kvp.Value.DesktopModule.Category)) @@ -87,7 +87,7 @@ private Dictionary GetPortalDesktopModules() else { portalModulesList = DesktopModuleController.GetPortalDesktopModules(PortalSettings.Current.PortalId) - .Where(Filter) + .Where(this.Filter) .OrderBy(c => c.Key); } @@ -163,34 +163,34 @@ private void BindTabModuleImages(int tabID) protected override void OnInit(EventArgs e) { base.OnInit(e); - _moduleCombo = new DnnComboBox(); - _moduleCombo.DataValueField = "key"; - _moduleCombo.DataTextField = "value"; - Controls.Add(_moduleCombo); + this._moduleCombo = new DnnComboBox(); + this._moduleCombo.DataValueField = "key"; + this._moduleCombo.DataTextField = "value"; + this.Controls.Add(this._moduleCombo); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - _originalValue = SelectedValue; + this._originalValue = this.SelectedValue; } protected virtual void OnItemChanged() { - if (ItemChanged != null) + if (this.ItemChanged != null) { - ItemChanged(this, new EventArgs()); + this.ItemChanged(this, new EventArgs()); } } protected override void OnPreRender(EventArgs e) { - if (_moduleCombo.FindItemByValue(_originalValue) != null) + if (this._moduleCombo.FindItemByValue(this._originalValue) != null) { - _moduleCombo.FindItemByValue(_originalValue).Selected = true; + this._moduleCombo.FindItemByValue(this._originalValue).Selected = true; } - _moduleCombo.Width = Width; + this._moduleCombo.Width = this.Width; base.OnPreRender(e); } @@ -200,23 +200,23 @@ protected override void OnPreRender(EventArgs e) public void BindAllPortalDesktopModules() { - _moduleCombo.SelectedValue = null; - _moduleCombo.DataSource = GetPortalDesktopModules(); - _moduleCombo.DataBind(); - BindPortalDesktopModuleImages(); + this._moduleCombo.SelectedValue = null; + this._moduleCombo.DataSource = this.GetPortalDesktopModules(); + this._moduleCombo.DataBind(); + this.BindPortalDesktopModuleImages(); } public void BindTabModulesByTabID(int tabID) { - _moduleCombo.SelectedValue = null; - _moduleCombo.DataSource = GetTabModules(tabID); - _moduleCombo.DataBind(); - BindTabModuleImages(tabID); + this._moduleCombo.SelectedValue = null; + this._moduleCombo.DataSource = GetTabModules(tabID); + this._moduleCombo.DataBind(); + this.BindTabModuleImages(tabID); } public void SetModule(string code) { - _moduleCombo.SelectedIndex = _moduleCombo.FindItemIndexByValue(code); + this._moduleCombo.SelectedIndex = this._moduleCombo.FindItemIndexByValue(code); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnScriptBlock.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnScriptBlock.cs index 4c210a5c4f4..5c47165f82a 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnScriptBlock.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnScriptBlock.cs @@ -17,14 +17,14 @@ public class DnnScriptBlock : Control { protected override void Render(HtmlTextWriter writer) { - if (!DesignMode) + if (!this.DesignMode) { - ScriptManager scriptManager = AJAX.GetScriptManager(Page); + ScriptManager scriptManager = AJAX.GetScriptManager(this.Page); if (scriptManager.IsInAsyncPostBack) { StringBuilder scriBuilder = new StringBuilder(); base.Render(new HtmlTextWriter(new StringWriter(scriBuilder))); - ScriptManager.RegisterClientScriptBlock(Page, typeof (Page), this.UniqueID, scriBuilder.ToString(), + ScriptManager.RegisterClientScriptBlock(this.Page, typeof (Page), this.UniqueID, scriBuilder.ToString(), false); } else diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnSkinComboBox.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnSkinComboBox.cs index 957ffea2af5..bd452ffe411 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnSkinComboBox.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/DnnSkinComboBox.cs @@ -38,7 +38,7 @@ public class DnnSkinComboBox : DnnComboBox private PortalInfo Portal { - get { return PortalId == Null.NullInteger ? null : PortalController.Instance.GetPortal(PortalId); } + get { return this.PortalId == Null.NullInteger ? null : PortalController.Instance.GetPortal(this.PortalId); } } #endregion @@ -47,7 +47,7 @@ private PortalInfo Portal public DnnSkinComboBox() { - PortalId = Null.NullInteger; + this.PortalId = Null.NullInteger; } #endregion @@ -58,41 +58,41 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - DataTextField = "Key"; - DataValueField = "Value"; + this.DataTextField = "Key"; + this.DataValueField = "Value"; - if (!Page.IsPostBack && !string.IsNullOrEmpty(RootPath)) + if (!this.Page.IsPostBack && !string.IsNullOrEmpty(this.RootPath)) { - DataSource = SkinController.GetSkins(Portal, RootPath, Scope) + this.DataSource = SkinController.GetSkins(this.Portal, this.RootPath, this.Scope) .ToDictionary(skin => skin.Key, skin => skin.Value); - if (string.IsNullOrEmpty(SelectedValue)) + if (string.IsNullOrEmpty(this.SelectedValue)) { - DataBind(); + this.DataBind(); } else { - DataBind(SelectedValue); + this.DataBind(this.SelectedValue); } - if (IncludeNoneSpecificItem) + if (this.IncludeNoneSpecificItem) { - InsertItem(0, NoneSpecificText, string.Empty); + this.InsertItem(0, this.NoneSpecificText, string.Empty); } } - AttachEvents(); + this.AttachEvents(); } protected override void PerformDataBinding(IEnumerable dataSource) { //do not select item during data binding, item will select later - var selectedValue = SelectedValue; - SelectedValue = null; + var selectedValue = this.SelectedValue; + this.SelectedValue = null; base.PerformDataBinding(dataSource); - SelectedValue = selectedValue; + this.SelectedValue = selectedValue; } #endregion @@ -106,8 +106,8 @@ private void AttachEvents() return; } - Attributes.Add("PortalPath", Portal != null ? Portal.HomeDirectory : string.Empty); - Attributes.Add("HostPath", Globals.HostPath); + this.Attributes.Add("PortalPath", this.Portal != null ? this.Portal.HomeDirectory : string.Empty); + this.Attributes.Add("HostPath", Globals.HostPath); //OnClientSelectedIndexChanged = "selectedIndexChangedMethod"; var indexChangedMethod = @"function selectedIndexChangedMethod(sender, eventArgs){ @@ -116,7 +116,7 @@ private void AttachEvents() value = value.replace('[G]', sender.get_attributes().getAttribute('HostPath')); sender.get_inputDomElement().title = value; }"; - Page.ClientScript.RegisterClientScriptBlock(GetType(), "OnClientSelectedIndexChanged", indexChangedMethod, true); + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "OnClientSelectedIndexChanged", indexChangedMethod, true); //foreach (var item in Items) //{ diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateEditControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateEditControl.cs index 67e012c155e..0ba5ff46944 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateEditControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateEditControl.cs @@ -47,7 +47,7 @@ protected DateTime DateValue DateTime dteValue = Null.NullDate; try { - var dteString = Convert.ToString(Value); + var dteString = Convert.ToString(this.Value); DateTime.TryParse(dteString, CultureInfo.InvariantCulture, DateTimeStyles.None, out dteValue); } catch (Exception exc) @@ -86,10 +86,10 @@ protected virtual string Format { get { - string _Format = DefaultFormat; - if (CustomAttributes != null) + string _Format = this.DefaultFormat; + if (this.CustomAttributes != null) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is FormatAttribute) { @@ -117,7 +117,7 @@ protected DateTime OldDateValue try { //Try and cast the value to an DateTime - var dteString = OldValue as string; + var dteString = this.OldValue as string; if (!string.IsNullOrEmpty(dteString)) { dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture); @@ -140,15 +140,15 @@ protected override string StringValue get { string _StringValue = Null.NullString; - if ((DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && DateValue != Null.NullDate)) + if ((this.DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && this.DateValue != Null.NullDate)) { - _StringValue = DateValue.ToString(Format); + _StringValue = this.DateValue.ToString(this.Format); } return _StringValue; } set { - Value = DateTime.Parse(value); + this.Value = DateTime.Parse(value); } } @@ -172,8 +172,8 @@ public override string EditControlClientId { get { - EnsureChildControls(); - return DateControl.ClientID; + this.EnsureChildControls(); + return this.DateControl.ClientID; } } @@ -186,12 +186,12 @@ private DnnDatePicker DateControl { get { - if (_dateControl == null) + if (this._dateControl == null) { - _dateControl = new DnnDatePicker(); + this._dateControl = new DnnDatePicker(); } - return _dateControl; + return this._dateControl; } } @@ -202,40 +202,40 @@ protected override void CreateChildControls() base.CreateChildControls(); - DateControl.ControlStyle.CopyFrom(ControlStyle); - DateControl.ID = base.ID + "_control"; + this.DateControl.ControlStyle.CopyFrom(this.ControlStyle); + this.DateControl.ID = base.ID + "_control"; - Controls.Add(DateControl); + this.Controls.Add(this.DateControl); } protected virtual void LoadDateControls() { - if (DateValue != Null.NullDate) + if (this.DateValue != Null.NullDate) { - DateControl.SelectedDate = DateValue.Date; + this.DateControl.SelectedDate = this.DateValue.Date; } } public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - EnsureChildControls(); + this.EnsureChildControls(); bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "_control"]; if (!presentValue.Equals(postedValue)) { if (string.IsNullOrEmpty(postedValue)) { - Value = Null.NullDate; + this.Value = Null.NullDate; dataChanged = true; } else { - Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture); + this.Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture); dataChanged = true; } } - LoadDateControls(); + this.LoadDateControls(); return dataChanged; } @@ -245,10 +245,10 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo /// An EventArgs object protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = DateValue; - args.OldValue = OldDateValue; - args.StringValue = DateValue.ToString(CultureInfo.InvariantCulture); + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DateValue; + args.OldValue = this.OldDateValue; + args.StringValue = this.DateValue.ToString(CultureInfo.InvariantCulture); base.OnValueChanged(args); } @@ -256,11 +256,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LoadDateControls(); + this.LoadDateControls(); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -270,7 +270,7 @@ protected override void OnPreRender(EventArgs e) /// protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } /// ----------------------------------------------------------------------------- @@ -281,9 +281,9 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - writer.Write(StringValue); + writer.Write(this.StringValue); writer.RenderEndTag(); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateTimeEditControl.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateTimeEditControl.cs index 4ceb0937b21..16467337757 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateTimeEditControl.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/PropertyEditorControls/DateTimeEditControl.cs @@ -51,7 +51,7 @@ protected DateTime DateValue DateTime dteValue = Null.NullDate; try { - var dteString = Convert.ToString(Value); + var dteString = Convert.ToString(this.Value); DateTime.TryParse(dteString, CultureInfo.InvariantCulture, DateTimeStyles.None, out dteValue); } catch (Exception exc) @@ -90,10 +90,10 @@ protected virtual string Format { get { - string _Format = DefaultFormat; - if (CustomAttributes != null) + string _Format = this.DefaultFormat; + if (this.CustomAttributes != null) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is FormatAttribute) { @@ -121,7 +121,7 @@ protected DateTime OldDateValue try { //Try and cast the value to an DateTime - var dteString = OldValue as string; + var dteString = this.OldValue as string; if (!string.IsNullOrEmpty(dteString)) { dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture); @@ -144,15 +144,15 @@ protected override string StringValue get { string _StringValue = Null.NullString; - if ((DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && DateValue != Null.NullDate)) + if ((this.DateValue.ToUniversalTime().Date != (DateTime)SqlDateTime.MinValue && this.DateValue != Null.NullDate)) { - _StringValue = DateValue.ToString(Format); + _StringValue = this.DateValue.ToString(this.Format); } return _StringValue; } set { - Value = DateTime.Parse(value); + this.Value = DateTime.Parse(value); } } @@ -180,12 +180,12 @@ private DnnDateTimePicker DateControl { get { - if (_dateControl == null) + if (this._dateControl == null) { - _dateControl = new DnnDateTimePicker(); + this._dateControl = new DnnDateTimePicker(); } - return _dateControl; + return this._dateControl; } } @@ -195,31 +195,31 @@ protected override void CreateChildControls() { base.CreateChildControls(); - DateControl.ControlStyle.CopyFrom(ControlStyle); - DateControl.ID = base.ID + "_control"; + this.DateControl.ControlStyle.CopyFrom(this.ControlStyle); + this.DateControl.ID = base.ID + "_control"; - Controls.Add(DateControl); + this.Controls.Add(this.DateControl); } protected virtual void LoadDateControls() { - if (DateValue != Null.NullDate) + if (this.DateValue != Null.NullDate) { - DateControl.SelectedDate = DateValue; + this.DateControl.SelectedDate = this.DateValue; } } public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - EnsureChildControls(); + this.EnsureChildControls(); bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "_control"]; if (!presentValue.Equals(postedValue)) { if (string.IsNullOrEmpty(postedValue)) { - Value = Null.NullDate; + this.Value = Null.NullDate; dataChanged = true; } else @@ -228,12 +228,12 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo if (DateTime.TryParseExact(postedValue, "yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture, DateTimeStyles.None, out value)) { - Value = value; + this.Value = value; dataChanged = true; } } } - LoadDateControls(); + this.LoadDateControls(); return dataChanged; } @@ -243,10 +243,10 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo /// An EventArgs object protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = DateValue; - args.OldValue = OldDateValue; - args.StringValue = DateValue.ToString(CultureInfo.InvariantCulture); + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DateValue; + args.OldValue = this.OldDateValue; + args.StringValue = this.DateValue.ToString(CultureInfo.InvariantCulture); base.OnValueChanged(args); } @@ -254,11 +254,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LoadDateControls(); + this.LoadDateControls(); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -268,7 +268,7 @@ protected override void OnPreRender(EventArgs e) /// protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } /// ----------------------------------------------------------------------------- @@ -279,9 +279,9 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - writer.Write(StringValue); + writer.Write(this.StringValue); writer.RenderEndTag(); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/TermsSelector.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/TermsSelector.cs index f77e1ecdf3f..a4b04d194ec 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/TermsSelector.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Internal/TermsSelector.cs @@ -36,11 +36,11 @@ public List Terms get { var terms = new List(); - if (!string.IsNullOrEmpty(Value)) + if (!string.IsNullOrEmpty(this.Value)) { var termRep = Util.GetTermController(); - var termIds = Value.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries); + var termIds = this.Value.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries); foreach (var i in termIds) { if (!string.IsNullOrEmpty(i.Trim())) @@ -59,10 +59,10 @@ public List Terms } set { - Value = string.Join(",", value.Select(t => t.TermId.ToString())); + this.Value = string.Join(",", value.Select(t => t.TermId.ToString())); - Items.Clear(); - value.Select(t => new ListItem(t.Name, t.TermId.ToString()) {Selected = true}).ToList().ForEach(Items.Add); + this.Items.Clear(); + value.Select(t => new ListItem(t.Name, t.TermId.ToString()) {Selected = true}).ToList().ForEach(this.Items.Add); } } @@ -76,27 +76,27 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (!string.IsNullOrEmpty(CssClass)) + if (!string.IsNullOrEmpty(this.CssClass)) { - CssClass = string.Format("{0} TermsSelector", CssClass); + this.CssClass = string.Format("{0} TermsSelector", this.CssClass); } else { - CssClass = "TermsSelector"; + this.CssClass = "TermsSelector"; } - var includeSystem = IncludeSystemVocabularies.ToString().ToLowerInvariant(); - var includeTags = IncludeTags.ToString().ToLowerInvariant(); + var includeSystem = this.IncludeSystemVocabularies.ToString().ToLowerInvariant(); + var includeTags = this.IncludeTags.ToString().ToLowerInvariant(); var apiPath = Globals.ResolveUrl($"~/API/InternalServices/ItemListService/GetTerms?includeSystem={includeSystem}&includeTags={includeTags}&q="); - Options.Preload = "focus"; - Options.Plugins.Add("remove_button"); - Options.Render = new RenderOption + this.Options.Preload = "focus"; + this.Options.Plugins.Add("remove_button"); + this.Options.Render = new RenderOption { Option = "function(item, escape) {return '
' + item.text + '
';}" }; - Options.Load = $@"function(query, callback) {{ + this.Options.Load = $@"function(query, callback) {{ $.ajax({{ url: '{apiPath}' + encodeURIComponent(query), type: 'GET', diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListOptions.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListOptions.cs index 3acdc276d49..39117ae191d 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListOptions.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListOptions.cs @@ -56,17 +56,17 @@ public class ItemListOptions public ItemListOptions() { // all the resources are located under the Website\App_GlobalResources\SharedResources.resx - SortAscendingButtonTitle = Localization.GetString("DropDownList.SortAscendingButtonTitle", Localization.SharedResourceFile); - UnsortedOrderButtonTooltip = Localization.GetString("DropDownList.UnsortedOrderButtonTooltip", Localization.SharedResourceFile); - SortAscendingButtonTooltip = Localization.GetString("DropDownList.SortAscendingButtonTooltip", Localization.SharedResourceFile); - SortDescendingButtonTooltip = Localization.GetString("DropDownList.SortDescendingButtonTooltip", Localization.SharedResourceFile); - SelectedItemExpandTooltip = Localization.GetString("DropDownList.SelectedItemExpandTooltip", Localization.SharedResourceFile); - SelectedItemCollapseTooltip = Localization.GetString("DropDownList.SelectedItemCollapseTooltip", Localization.SharedResourceFile); - SearchInputPlaceHolder = Localization.GetString("DropDownList.SearchInputPlaceHolder", Localization.SharedResourceFile); - ClearButtonTooltip = Localization.GetString("DropDownList.ClearButtonTooltip", Localization.SharedResourceFile); - SearchButtonTooltip = Localization.GetString("DropDownList.SearchButtonTooltip", Localization.SharedResourceFile); - LoadingResultText = Localization.GetString("DropDownList.LoadingResultText", Localization.SharedResourceFile); - ResultsText = Localization.GetString("DropDownList.Results", Localization.SharedResourceFile); + this.SortAscendingButtonTitle = Localization.GetString("DropDownList.SortAscendingButtonTitle", Localization.SharedResourceFile); + this.UnsortedOrderButtonTooltip = Localization.GetString("DropDownList.UnsortedOrderButtonTooltip", Localization.SharedResourceFile); + this.SortAscendingButtonTooltip = Localization.GetString("DropDownList.SortAscendingButtonTooltip", Localization.SharedResourceFile); + this.SortDescendingButtonTooltip = Localization.GetString("DropDownList.SortDescendingButtonTooltip", Localization.SharedResourceFile); + this.SelectedItemExpandTooltip = Localization.GetString("DropDownList.SelectedItemExpandTooltip", Localization.SharedResourceFile); + this.SelectedItemCollapseTooltip = Localization.GetString("DropDownList.SelectedItemCollapseTooltip", Localization.SharedResourceFile); + this.SearchInputPlaceHolder = Localization.GetString("DropDownList.SearchInputPlaceHolder", Localization.SharedResourceFile); + this.ClearButtonTooltip = Localization.GetString("DropDownList.ClearButtonTooltip", Localization.SharedResourceFile); + this.SearchButtonTooltip = Localization.GetString("DropDownList.SearchButtonTooltip", Localization.SharedResourceFile); + this.LoadingResultText = Localization.GetString("DropDownList.LoadingResultText", Localization.SharedResourceFile); + this.ResultsText = Localization.GetString("DropDownList.Results", Localization.SharedResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListServicesOptions.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListServicesOptions.cs index 5bee06b3308..0b6ea20c9ca 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListServicesOptions.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/ItemListServicesOptions.cs @@ -39,7 +39,7 @@ public Dictionary Parameters { get { - return _parameters ?? (_parameters = new Dictionary()); + return this._parameters ?? (this._parameters = new Dictionary()); } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/RibbonBarToolInfo.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/RibbonBarToolInfo.cs index ce59500ab3f..8fc87c73c69 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/RibbonBarToolInfo.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/RibbonBarToolInfo.cs @@ -15,21 +15,21 @@ public class RibbonBarToolInfo { public RibbonBarToolInfo() { - ControlKey = ""; - ModuleFriendlyName = ""; - LinkWindowTarget = ""; - ToolName = ""; + this.ControlKey = ""; + this.ModuleFriendlyName = ""; + this.LinkWindowTarget = ""; + this.ToolName = ""; } public RibbonBarToolInfo(string toolName, bool isHostTool, bool useButton, string linkWindowTarget, string moduleFriendlyName, string controlKey, bool showAsPopUp) { - ToolName = toolName; - IsHostTool = isHostTool; - UseButton = useButton; - LinkWindowTarget = linkWindowTarget; - ModuleFriendlyName = moduleFriendlyName; - ControlKey = controlKey; - ShowAsPopUp = showAsPopUp; + this.ToolName = toolName; + this.IsHostTool = isHostTool; + this.UseButton = useButton; + this.LinkWindowTarget = linkWindowTarget; + this.ModuleFriendlyName = moduleFriendlyName; + this.ControlKey = controlKey; + this.ShowAsPopUp = showAsPopUp; } public string ControlKey { get; set; } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/Tags.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/Tags.cs index 902199d0939..7f07ecd9881 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/Tags.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/Tags.cs @@ -54,15 +54,15 @@ public bool IsEditMode get { bool _IsEditMode = false; - if (ViewState["IsEditMode"] != null) + if (this.ViewState["IsEditMode"] != null) { - _IsEditMode = Convert.ToBoolean(ViewState["IsEditMode"]); + _IsEditMode = Convert.ToBoolean(this.ViewState["IsEditMode"]); } return _IsEditMode; } set { - ViewState["IsEditMode"] = value; + this.ViewState["IsEditMode"] = value; } } @@ -72,11 +72,11 @@ public string RepeatDirection { get { - return _RepeatDirection; + return this._RepeatDirection; } set { - _RepeatDirection = value; + this._RepeatDirection = value; } } @@ -86,11 +86,11 @@ public string Separator { get { - return _Separator; + return this._Separator; } set { - _Separator = value; + this._Separator = value; } } @@ -119,25 +119,25 @@ private string LocalizeString(string key) private void RenderButton(HtmlTextWriter writer, string buttonType, string imageUrl) { - writer.AddAttribute(HtmlTextWriterAttribute.Title, LocalizeString(string.Format("{0}.ToolTip", buttonType))); - writer.AddAttribute(HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink(this, buttonType)); + writer.AddAttribute(HtmlTextWriterAttribute.Title, this.LocalizeString(string.Format("{0}.ToolTip", buttonType))); + writer.AddAttribute(HtmlTextWriterAttribute.Href, this.Page.ClientScript.GetPostBackClientHyperlink(this, buttonType)); writer.RenderBeginTag(HtmlTextWriterTag.A); //Image if (!string.IsNullOrEmpty(imageUrl)) { - writer.AddAttribute(HtmlTextWriterAttribute.Src, ResolveUrl(imageUrl)); + writer.AddAttribute(HtmlTextWriterAttribute.Src, this.ResolveUrl(imageUrl)); writer.RenderBeginTag(HtmlTextWriterTag.Img); writer.RenderEndTag(); } - writer.Write(LocalizeString(buttonType)); + writer.Write(this.LocalizeString(buttonType)); writer.RenderEndTag(); } private void RenderTerm(HtmlTextWriter writer, Term term, bool renderSeparator) { - writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Format(NavigateUrlFormatString, term.Name)); + writer.AddAttribute(HtmlTextWriterAttribute.Href, string.Format(this.NavigateUrlFormatString, term.Name)); writer.AddAttribute(HtmlTextWriterAttribute.Title, term.Name); writer.AddAttribute(HtmlTextWriterAttribute.Rel, "tag"); writer.RenderBeginTag(HtmlTextWriterTag.A); @@ -146,13 +146,13 @@ private void RenderTerm(HtmlTextWriter writer, Term term, bool renderSeparator) if (renderSeparator) { - writer.Write(Separator); + writer.Write(this.Separator); } } private void SaveTags() { - string tags = _Tags; + string tags = this._Tags; if (!string.IsNullOrEmpty(tags)) { @@ -161,35 +161,35 @@ private void SaveTags() if (!string.IsNullOrEmpty(t)) { string tagName = t.Trim(' '); - Term existingTerm = (from term in ContentItem.Terms.AsQueryable() where term.Name.Equals(tagName, StringComparison.CurrentCultureIgnoreCase) select term).SingleOrDefault(); + Term existingTerm = (from term in this.ContentItem.Terms.AsQueryable() where term.Name.Equals(tagName, StringComparison.CurrentCultureIgnoreCase) select term).SingleOrDefault(); if (existingTerm == null) { //Not tagged TermController termController = new TermController(); Term term = - (from te in termController.GetTermsByVocabulary(TagVocabulary.VocabularyId) where te.Name.Equals(tagName, StringComparison.CurrentCultureIgnoreCase) select te). + (from te in termController.GetTermsByVocabulary(this.TagVocabulary.VocabularyId) where te.Name.Equals(tagName, StringComparison.CurrentCultureIgnoreCase) select te). SingleOrDefault(); if (term == null) { //Add term - term = new Term(TagVocabulary.VocabularyId); + term = new Term(this.TagVocabulary.VocabularyId); term.Name = tagName; termController.AddTerm(term); } //Add term to content - ContentItem.Terms.Add(term); - termController.AddTermToContent(term, ContentItem); + this.ContentItem.Terms.Add(term); + termController.AddTermToContent(term, this.ContentItem); } } } } - IsEditMode = false; + this.IsEditMode = false; //Raise the Tags Updated Event - OnTagsUpdate(EventArgs.Empty); + this.OnTagsUpdate(EventArgs.Empty); } #endregion @@ -198,9 +198,9 @@ private void SaveTags() protected void OnTagsUpdate(EventArgs e) { - if (TagsUpdated != null) + if (this.TagsUpdated != null) { - TagsUpdated(this, e); + this.TagsUpdated(this, e); } } @@ -210,7 +210,7 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if ((!Page.ClientScript.IsClientScriptBlockRegistered(UniqueID))) + if ((!this.Page.ClientScript.IsClientScriptBlockRegistered(this.UniqueID))) { StringBuilder sb = new StringBuilder(); @@ -227,7 +227,7 @@ protected override void OnPreRender(EventArgs e) sb.Append("}"); sb.Append(""); - Page.ClientScript.RegisterClientScriptBlock(GetType(), UniqueID, sb.ToString()); + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), this.UniqueID, sb.ToString()); } } @@ -235,19 +235,19 @@ protected override void OnPreRender(EventArgs e) public override void RenderControl(HtmlTextWriter writer) { //Render Outer Div - writer.AddAttribute(HtmlTextWriterAttribute.Class, RepeatDirection.ToLowerInvariant()); + writer.AddAttribute(HtmlTextWriterAttribute.Class, this.RepeatDirection.ToLowerInvariant()); writer.RenderBeginTag(HtmlTextWriterTag.Div); //Render Categories - if (ShowCategories) + if (this.ShowCategories) { //Render UL writer.AddAttribute(HtmlTextWriterAttribute.Class, "categories"); - writer.AddAttribute(HtmlTextWriterAttribute.Title, LocalizeString("Category.ToolTip")); + writer.AddAttribute(HtmlTextWriterAttribute.Title, this.LocalizeString("Category.ToolTip")); writer.RenderBeginTag(HtmlTextWriterTag.Ul); //Render Category Links - var categories = (from cat in ContentItem.Terms where cat.VocabularyId != TagVocabulary.VocabularyId select cat); + var categories = (from cat in this.ContentItem.Terms where cat.VocabularyId != this.TagVocabulary.VocabularyId select cat); for (int i = 0; i <= categories.Count() - 1; i++) { @@ -263,7 +263,7 @@ public override void RenderControl(HtmlTextWriter writer) } writer.RenderBeginTag(HtmlTextWriterTag.Li); - RenderTerm(writer, categories.ToList()[i], i < categories.Count() - 1 && RepeatDirection.ToLowerInvariant() == "horizontal"); + this.RenderTerm(writer, categories.ToList()[i], i < categories.Count() - 1 && this.RepeatDirection.ToLowerInvariant() == "horizontal"); writer.RenderEndTag(); } @@ -271,15 +271,15 @@ public override void RenderControl(HtmlTextWriter writer) writer.RenderEndTag(); } - if (ShowTags) + if (this.ShowTags) { //Render UL writer.AddAttribute(HtmlTextWriterAttribute.Class, "tags"); - writer.AddAttribute(HtmlTextWriterAttribute.Title, LocalizeString("Tag.ToolTip")); + writer.AddAttribute(HtmlTextWriterAttribute.Title, this.LocalizeString("Tag.ToolTip")); writer.RenderBeginTag(HtmlTextWriterTag.Ul); //Render Tag Links - var tags = (from cat in ContentItem.Terms where cat.VocabularyId == TagVocabulary.VocabularyId select cat); + var tags = (from cat in this.ContentItem.Terms where cat.VocabularyId == this.TagVocabulary.VocabularyId select cat); for (int i = 0; i <= tags.Count() - 1; i++) { @@ -295,20 +295,20 @@ public override void RenderControl(HtmlTextWriter writer) } writer.RenderBeginTag(HtmlTextWriterTag.Li); - RenderTerm(writer, tags.ToList()[i], i < tags.Count() - 1 && RepeatDirection.ToLowerInvariant() == "horizontal"); + this.RenderTerm(writer, tags.ToList()[i], i < tags.Count() - 1 && this.RepeatDirection.ToLowerInvariant() == "horizontal"); writer.RenderEndTag(); } - if (AllowTagging) + if (this.AllowTagging) { writer.RenderBeginTag(HtmlTextWriterTag.Li); - if (IsEditMode) + if (this.IsEditMode) { writer.Write("  "); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.AddAttribute("OnKeyPress", "return disableEnterKey(event)"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); @@ -316,19 +316,19 @@ public override void RenderControl(HtmlTextWriter writer) writer.Write("  "); //Render Save Button - RenderButton(writer, "Save", SaveImageUrl); + this.RenderButton(writer, "Save", this.SaveImageUrl); writer.Write("  "); //Render Add Button - RenderButton(writer, "Cancel", CancelImageUrl); + this.RenderButton(writer, "Cancel", this.CancelImageUrl); } else { writer.Write("  "); //Render Add Button - RenderButton(writer, "Add", AddImageUrl); + this.RenderButton(writer, "Add", this.AddImageUrl); } writer.RenderEndTag(); @@ -346,7 +346,7 @@ public override void RenderControl(HtmlTextWriter writer) public bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - _Tags = postCollection[postDataKey]; + this._Tags = postCollection[postDataKey]; return true; } @@ -365,16 +365,16 @@ public void RaisePostBackEvent(string eventArgument) switch (eventArgument) { case "Add": - IsEditMode = true; + this.IsEditMode = true; break; case "Cancel": - IsEditMode = false; + this.IsEditMode = false; break; case "Save": - SaveTags(); + this.SaveTags(); break; default: - IsEditMode = false; + this.IsEditMode = false; break; } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/TermsEventArgs.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/TermsEventArgs.cs index 1f912455230..c2516023d78 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/TermsEventArgs.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/TermsEventArgs.cs @@ -20,7 +20,7 @@ public class TermsEventArgs : EventArgs public TermsEventArgs(Term selectedTerm) { - _SelectedTerm = selectedTerm; + this._SelectedTerm = selectedTerm; } #endregion @@ -31,7 +31,7 @@ public Term SelectedTerm { get { - return _SelectedTerm; + return this._SelectedTerm; } } diff --git a/DNN Platform/DotNetNuke.Web/UI/WebControls/UniformControlCollection.cs b/DNN Platform/DotNetNuke.Web/UI/WebControls/UniformControlCollection.cs index b0a5c88f1ac..1ede2bdd631 100644 --- a/DNN Platform/DotNetNuke.Web/UI/WebControls/UniformControlCollection.cs +++ b/DNN Platform/DotNetNuke.Web/UI/WebControls/UniformControlCollection.cs @@ -18,12 +18,12 @@ public sealed class UniformControlCollection : IList @@ -37,7 +37,7 @@ public void AddAt(int index, TChildren childControl) /// public int IndexOf(TChildren item) { - return _owner.Controls.IndexOf(item); + return this._owner.Controls.IndexOf(item); } /// @@ -56,7 +56,7 @@ public int IndexOf(TChildren item) /// public void Insert(int index, TChildren item) { - _owner.Controls.AddAt(index, item); + this._owner.Controls.AddAt(index, item); } /// @@ -72,7 +72,7 @@ public void Insert(int index, TChildren item) /// public void RemoveAt(int index) { - _owner.Controls.RemoveAt(index); + this._owner.Controls.RemoveAt(index); } /// @@ -93,12 +93,12 @@ public TChildren this[int index] { get { - return _owner.Controls[index] as TChildren; + return this._owner.Controls[index] as TChildren; } set { - RemoveAt(index); - AddAt(index, value); + this.RemoveAt(index); + this.AddAt(index, value); } } @@ -112,7 +112,7 @@ public int Count { get { - return _owner.HasControls() ? _owner.Controls.Count : 0; + return this._owner.HasControls() ? this._owner.Controls.Count : 0; } } @@ -130,7 +130,7 @@ public int Count /// public bool Remove(TChildren item) { - _owner.Controls.Remove(item); + this._owner.Controls.Remove(item); return true; } @@ -157,7 +157,7 @@ public bool IsReadOnly ///1 public IEnumerator GetEnumerator() { - var enumerator = _owner.Controls.GetEnumerator(); + var enumerator = this._owner.Controls.GetEnumerator(); while (enumerator.MoveNext()) { yield return enumerator.Current as TChildren; @@ -172,9 +172,9 @@ public IEnumerator GetEnumerator() /// public void Clear() { - if (_owner.HasControls()) + if (this._owner.HasControls()) { - _owner.Controls.Clear(); + this._owner.Controls.Clear(); } } @@ -189,7 +189,7 @@ public void Clear() /// public void Add(TChildren item) { - _owner.Controls.Add(item); + this._owner.Controls.Add(item); } /// @@ -215,7 +215,7 @@ public void Add(TChildren item) /// public void CopyTo(TChildren[] array, int arrayIndex) { - var enumerator = GetEnumerator(); + var enumerator = this.GetEnumerator(); while (enumerator.MoveNext()) { array.SetValue(enumerator.Current, Math.Max(Interlocked.Increment(ref arrayIndex), arrayIndex - 1)); @@ -233,7 +233,7 @@ public void CopyTo(TChildren[] array, int arrayIndex) /// public bool Contains(TChildren item) { - return _owner.Controls.Contains(item); + return this._owner.Controls.Contains(item); } /// @@ -245,12 +245,12 @@ public bool Contains(TChildren item) ///2 private IEnumerator EnumerableGetEnumerator() { - return _owner.Controls.GetEnumerator(); + return this._owner.Controls.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return EnumerableGetEnumerator(); + return this.EnumerableGetEnumerator(); } } diff --git a/DNN Platform/DotNetNuke.Web/Validators/AttributeBasedObjectValidator.cs b/DNN Platform/DotNetNuke.Web/Validators/AttributeBasedObjectValidator.cs index cdd656108e7..706fcfc5517 100644 --- a/DNN Platform/DotNetNuke.Web/Validators/AttributeBasedObjectValidator.cs +++ b/DNN Platform/DotNetNuke.Web/Validators/AttributeBasedObjectValidator.cs @@ -18,7 +18,7 @@ protected override ValidationResult ValidateProperty(object target, PropertyInfo { return targetProperty.GetCustomAttributes(true).OfType().Aggregate(ValidationResult.Successful, (result, attribute) => - result.CombineWith(ValidateAttribute(target, targetProperty, attribute) ?? ValidationResult.Successful)); + result.CombineWith(this.ValidateAttribute(target, targetProperty, attribute) ?? ValidationResult.Successful)); } diff --git a/DNN Platform/DotNetNuke.Web/Validators/DataAnnotationsObjectValidator.cs b/DNN Platform/DotNetNuke.Web/Validators/DataAnnotationsObjectValidator.cs index d7e0917d873..ea201693231 100644 --- a/DNN Platform/DotNetNuke.Web/Validators/DataAnnotationsObjectValidator.cs +++ b/DNN Platform/DotNetNuke.Web/Validators/DataAnnotationsObjectValidator.cs @@ -15,7 +15,7 @@ public class DataAnnotationsObjectValidator : AttributeBasedObjectValidator result.CombineWith(ValidateProperty(target, member) ?? ValidationResult.Successful)); + return target.GetType().GetProperties().Aggregate(ValidationResult.Successful, (result, member) => result.CombineWith(this.ValidateProperty(target, member) ?? ValidationResult.Successful)); } protected abstract ValidationResult ValidateProperty(object target, PropertyInfo targetProperty); diff --git a/DNN Platform/DotNetNuke.Web/Validators/ValidationResult.cs b/DNN Platform/DotNetNuke.Web/Validators/ValidationResult.cs index 0b31dd145ae..197d45e0933 100644 --- a/DNN Platform/DotNetNuke.Web/Validators/ValidationResult.cs +++ b/DNN Platform/DotNetNuke.Web/Validators/ValidationResult.cs @@ -22,13 +22,13 @@ public class ValidationResult public ValidationResult() { - _Errors = Enumerable.Empty(); + this._Errors = Enumerable.Empty(); } public ValidationResult(IEnumerable errors) { Requires.NotNull("errors", errors); - _Errors = errors; + this._Errors = errors; } #endregion @@ -39,7 +39,7 @@ public IEnumerable Errors { get { - return _Errors; + return this._Errors; } } @@ -47,7 +47,7 @@ public bool IsValid { get { - return (_Errors.Count() == 0); + return (this._Errors.Count() == 0); } } @@ -68,7 +68,7 @@ public ValidationResult CombineWith(ValidationResult other) Requires.NotNull("other", other); //Just concatenate the errors collection - return new ValidationResult(_Errors.Concat(other.Errors)); + return new ValidationResult(this._Errors.Concat(other.Errors)); } #endregion diff --git a/DNN Platform/DotNetNuke.Web/Validators/Validator.cs b/DNN Platform/DotNetNuke.Web/Validators/Validator.cs index 3a7d023df9e..0939d2f934c 100644 --- a/DNN Platform/DotNetNuke.Web/Validators/Validator.cs +++ b/DNN Platform/DotNetNuke.Web/Validators/Validator.cs @@ -17,25 +17,25 @@ public class Validator public Validator() { - _Validators = new List(); + this._Validators = new List(); } public Validator(ObjectValidator validator) : this() { - _Validators.Add(validator); + this._Validators.Add(validator); } public IList Validators { get { - return _Validators; + return this._Validators; } } public ValidationResult ValidateObject(object target) { - return _Validators.Aggregate(ValidationResult.Successful, (result, validator) => result.CombineWith(validator.ValidateObject(target) ?? ValidationResult.Successful)); + return this._Validators.Aggregate(ValidationResult.Successful, (result, validator) => result.CombineWith(validator.ValidateObject(target) ?? ValidationResult.Successful)); } } } diff --git a/DNN Platform/DotNetNuke.Web/packages.config b/DNN Platform/DotNetNuke.Web/packages.config index 4a7bf694062..211aecc063e 100644 --- a/DNN Platform/DotNetNuke.Web/packages.config +++ b/DNN Platform/DotNetNuke.Web/packages.config @@ -11,5 +11,6 @@ + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.WebUtility/DotNetNuke.WebUtility.vbproj b/DNN Platform/DotNetNuke.WebUtility/DotNetNuke.WebUtility.vbproj index 8571765076b..bfb46c577e7 100644 --- a/DNN Platform/DotNetNuke.WebUtility/DotNetNuke.WebUtility.vbproj +++ b/DNN Platform/DotNetNuke.WebUtility/DotNetNuke.WebUtility.vbproj @@ -170,7 +170,11 @@ + + stylecop.json + + diff --git a/DNN Platform/DotNetNuke.WebUtility/packages.config b/DNN Platform/DotNetNuke.WebUtility/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/DotNetNuke.WebUtility/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj index b5b35e0cb6e..9f01bc47c74 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj +++ b/DNN Platform/DotNetNuke.Website.Deprecated/DotNetNuke.Website.Deprecated.csproj @@ -1,214 +1,221 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {19EAE090-9D06-43BE-A62E-D6217E813AD1} - Library - DotNetNuke.Website - DotNetNuke.Website.Deprecated - 512 - WebControl - v4.7.2 - true - On - Binary - Off - On - - - 4.0 - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - ..\..\ - true - - - true - full - true - true - bin\ - bin\DotNetNuke.Website.Deprecated.xml - 1591 - AllRules.ruleset - 7 - false - - - pdbonly - false - true - true - bin\ - bin\DotNetNuke.Website.Deprecated.xml - 1591 - AllRules.ruleset - false - 7 - - - 1591 - AllRules.ruleset - false - - - AllRules.ruleset - false - - - - - ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - - - - - - - - - - - - ..\Components\Telerik\bin\Telerik.Web.UI.dll - True - - - ..\Components\Telerik\bin\Telerik.Web.UI.Skins.dll - - - - - SolutionInfo.cs - - - ASPXCodeBehind - - - AddModule.ascx.cs - - - ASPXCodeBehind - - - AddPage.ascx.cs - - - ASPXCodeBehind - - - ControlBar.ascx.cs - - - ASPXCodeBehind - - - RibbonBar.ascx.cs - - - ASPXCodeBehind - - - SwitchSite.ascx.cs - - - ASPXCodeBehind - - - UpdatePage.ascx.cs - - - ASPXCodeBehind - - - WebUpload.ascx.cs - - - - - - - - - - - - - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - - - {ddf18e36-41a0-4ca7-a098-78ca6e6f41c1} - DotNetNuke.Instrumentation - - - {537b45eb-2ec3-4849-bc6b-d761f43674a5} - DotNetNuke.Web.Client - - - {9ba59b3d-9ffb-4a9e-bd7d-8b58d08b3a33} - DotNetNuke.Web.Deprecated - - - {4912f062-f8a8-4f9d-8f8e-244ebee1acbd} - DotNetNuke.WebUtility - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {a86ebc44-2bc8-4c4a-997b-2708e4aac345} - DotNetNuke.Modules.DDRMenu - - - - - Designer - - - Designer - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {19EAE090-9D06-43BE-A62E-D6217E813AD1} + Library + DotNetNuke.Website + DotNetNuke.Website.Deprecated + 512 + WebControl + v4.7.2 + true + On + Binary + Off + On + + + 4.0 + + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + ..\..\ + true + + + true + full + true + true + bin\ + bin\DotNetNuke.Website.Deprecated.xml + 1591 + AllRules.ruleset + 7 + false + + + pdbonly + false + true + true + bin\ + bin\DotNetNuke.Website.Deprecated.xml + 1591 + AllRules.ruleset + false + 7 + + + 1591 + AllRules.ruleset + false + + + AllRules.ruleset + false + + + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + + + + + + + + + + + + ..\Components\Telerik\bin\Telerik.Web.UI.dll + True + + + ..\Components\Telerik\bin\Telerik.Web.UI.Skins.dll + + + + + SolutionInfo.cs + + + ASPXCodeBehind + + + AddModule.ascx.cs + + + ASPXCodeBehind + + + AddPage.ascx.cs + + + ASPXCodeBehind + + + ControlBar.ascx.cs + + + ASPXCodeBehind + + + RibbonBar.ascx.cs + + + ASPXCodeBehind + + + SwitchSite.ascx.cs + + + ASPXCodeBehind + + + UpdatePage.ascx.cs + + + ASPXCodeBehind + + + WebUpload.ascx.cs + + + + + + + + + + + + + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + + + {ddf18e36-41a0-4ca7-a098-78ca6e6f41c1} + DotNetNuke.Instrumentation + + + {537b45eb-2ec3-4849-bc6b-d761f43674a5} + DotNetNuke.Web.Client + + + {9ba59b3d-9ffb-4a9e-bd7d-8b58d08b3a33} + DotNetNuke.Web.Deprecated + + + {4912f062-f8a8-4f9d-8f8e-244ebee1acbd} + DotNetNuke.WebUtility + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {a86ebc44-2bc8-4c4a-997b-2708e4aac345} + DotNetNuke.Modules.DDRMenu + + + + + stylecop.json + + + Designer + + + Designer + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs index fff726f2bb8..cd95a2c50ed 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddModule.ascx.cs @@ -50,7 +50,7 @@ public partial class AddModule : UserControlBase, IDnnRibbonBarTool public AddModule() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } /// @@ -66,14 +66,14 @@ private PortalSettings SelectedPortalSettings try { - if (SiteListPanel.Visible && SiteList.SelectedItem != null) + if (this.SiteListPanel.Visible && this.SiteList.SelectedItem != null) { - if (!string.IsNullOrEmpty(SiteList.SelectedItem.Value)) + if (!string.IsNullOrEmpty(this.SiteList.SelectedItem.Value)) { - var selectedPortalId = int.Parse(SiteList.SelectedItem.Value); - if (PortalSettings.PortalId != selectedPortalId) + var selectedPortalId = int.Parse(this.SiteList.SelectedItem.Value); + if (this.PortalSettings.PortalId != selectedPortalId) { - portalSettings = new PortalSettings(int.Parse(SiteList.SelectedItem.Value)); + portalSettings = new PortalSettings(int.Parse(this.SiteList.SelectedItem.Value)); } } } @@ -92,23 +92,23 @@ private PortalSettings SelectedPortalSettings protected void AddNewOrExisting_OnClick(Object sender, EventArgs e) { - LoadAllLists(); + this.LoadAllLists(); } protected void PaneLstSelectedIndexChanged(Object sender, EventArgs e) { - LoadPositionList(); - LoadPaneModulesList(); + this.LoadPositionList(); + this.LoadPaneModulesList(); } protected void PageLstSelectedIndexChanged(Object sender, EventArgs e) { - LoadModuleList(); + this.LoadModuleList(); } protected void PositionLstSelectedIndexChanged(Object sender, EventArgs e) { - PaneModulesLst.Enabled = PositionLst.SelectedValue == "ABOVE" || PositionLst.SelectedValue == "BELOW"; + this.PaneModulesLst.Enabled = this.PositionLst.SelectedValue == "ABOVE" || this.PositionLst.SelectedValue == "BELOW"; } protected override void OnLoad(EventArgs e) @@ -116,34 +116,34 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); // Is there more than one site in this group? - var multipleSites = GetCurrentPortalsGroup().Count() > 1; - ClientAPI.RegisterClientVariable(Page, "moduleSharing", multipleSites.ToString().ToLowerInvariant(), true); + var multipleSites = this.GetCurrentPortalsGroup().Count() > 1; + ClientAPI.RegisterClientVariable(this.Page, "moduleSharing", multipleSites.ToString().ToLowerInvariant(), true); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - cmdAddModule.Click += CmdAddModuleClick; - AddNewModule.CheckedChanged += AddNewOrExisting_OnClick; - AddExistingModule.CheckedChanged += AddNewOrExisting_OnClick; - SiteList.SelectedIndexChanged += SiteList_SelectedIndexChanged; - CategoryList.SelectedIndexChanged += CategoryListSelectedIndexChanged; - PageLst.SelectedIndexChanged += PageLstSelectedIndexChanged; - PaneLst.SelectedIndexChanged += PaneLstSelectedIndexChanged; - PositionLst.SelectedIndexChanged += PositionLstSelectedIndexChanged; + this.cmdAddModule.Click += this.CmdAddModuleClick; + this.AddNewModule.CheckedChanged += this.AddNewOrExisting_OnClick; + this.AddExistingModule.CheckedChanged += this.AddNewOrExisting_OnClick; + this.SiteList.SelectedIndexChanged += this.SiteList_SelectedIndexChanged; + this.CategoryList.SelectedIndexChanged += this.CategoryListSelectedIndexChanged; + this.PageLst.SelectedIndexChanged += this.PageLstSelectedIndexChanged; + this.PaneLst.SelectedIndexChanged += this.PaneLstSelectedIndexChanged; + this.PositionLst.SelectedIndexChanged += this.PositionLstSelectedIndexChanged; try { - if ((Visible)) + if ((this.Visible)) { - cmdAddModule.Enabled = Enabled; - AddExistingModule.Enabled = Enabled; - AddNewModule.Enabled = Enabled; - Title.Enabled = Enabled; - PageLst.Enabled = Enabled; - ModuleLst.Enabled = Enabled; - VisibilityLst.Enabled = Enabled; - PaneLst.Enabled = Enabled; - PositionLst.Enabled = Enabled; - PaneModulesLst.Enabled = Enabled; + this.cmdAddModule.Enabled = this.Enabled; + this.AddExistingModule.Enabled = this.Enabled; + this.AddNewModule.Enabled = this.Enabled; + this.Title.Enabled = this.Enabled; + this.PageLst.Enabled = this.Enabled; + this.ModuleLst.Enabled = this.Enabled; + this.VisibilityLst.Enabled = this.Enabled; + this.PaneLst.Enabled = this.Enabled; + this.PositionLst.Enabled = this.Enabled; + this.PaneModulesLst.Enabled = this.Enabled; UserInfo objUser = UserController.Instance.GetCurrentUserInfo(); if ((objUser != null)) @@ -153,23 +153,23 @@ protected override void OnLoad(EventArgs e) var objModule = ModuleController.Instance.GetModuleByDefinition(-1, "Extensions"); if (objModule != null) { - var strURL = _navigationManager.NavigateURL(objModule.TabID, true); - hlMoreExtensions.NavigateUrl = strURL + "#moreExtensions"; + var strURL = this._navigationManager.NavigateURL(objModule.TabID, true); + this.hlMoreExtensions.NavigateUrl = strURL + "#moreExtensions"; } else { - hlMoreExtensions.Enabled = false; + this.hlMoreExtensions.Enabled = false; } - hlMoreExtensions.Text = GetString("hlMoreExtensions"); - hlMoreExtensions.Visible = true; + this.hlMoreExtensions.Text = this.GetString("hlMoreExtensions"); + this.hlMoreExtensions.Visible = true; } } } - if ((!IsPostBack && Visible && Enabled)) + if ((!this.IsPostBack && this.Visible && this.Enabled)) { - AddNewModule.Checked = true; - LoadAllLists(); + this.AddNewModule.Checked = true; + this.LoadAllLists(); } } catch (Exception exc) @@ -180,28 +180,28 @@ protected override void OnLoad(EventArgs e) private void CmdConfirmAddModuleClick(object sender, EventArgs e) { - CmdAddModuleClick(sender, e); + this.CmdAddModuleClick(sender, e); } void SiteList_SelectedIndexChanged(object sender, EventArgs e) { - LoadModuleList(); - LoadPageList(); + this.LoadModuleList(); + this.LoadPageList(); } private void CategoryListSelectedIndexChanged(object sender, EventArgs e) { - LoadModuleList(); + this.LoadModuleList(); } protected void CmdAddModuleClick(object sender, EventArgs e) { - if (TabPermissionController.CanAddContentToPage() && CanAddModuleToPage()) + if (TabPermissionController.CanAddContentToPage() && this.CanAddModuleToPage()) { int permissionType; try { - permissionType = int.Parse(VisibilityLst.SelectedValue); + permissionType = int.Parse(this.VisibilityLst.SelectedValue); } catch (Exception exc) { @@ -211,17 +211,17 @@ protected void CmdAddModuleClick(object sender, EventArgs e) } int position = -1; - switch (PositionLst.SelectedValue) + switch (this.PositionLst.SelectedValue) { case "TOP": position = 0; break; case "ABOVE": - if (!string.IsNullOrEmpty(PaneModulesLst.SelectedValue)) + if (!string.IsNullOrEmpty(this.PaneModulesLst.SelectedValue)) { try { - position = int.Parse(PaneModulesLst.SelectedValue) - 1; + position = int.Parse(this.PaneModulesLst.SelectedValue) - 1; } catch (Exception exc) { @@ -236,11 +236,11 @@ protected void CmdAddModuleClick(object sender, EventArgs e) } break; case "BELOW": - if (!string.IsNullOrEmpty(PaneModulesLst.SelectedValue)) + if (!string.IsNullOrEmpty(this.PaneModulesLst.SelectedValue)) { try { - position = int.Parse(PaneModulesLst.SelectedValue) + 1; + position = int.Parse(this.PaneModulesLst.SelectedValue) + 1; } catch (Exception exc) { @@ -262,7 +262,7 @@ protected void CmdAddModuleClick(object sender, EventArgs e) int moduleLstID; try { - moduleLstID = int.Parse(ModuleLst.SelectedValue); + moduleLstID = int.Parse(this.ModuleLst.SelectedValue); } catch (Exception exc) { @@ -273,12 +273,12 @@ protected void CmdAddModuleClick(object sender, EventArgs e) if ((moduleLstID > -1)) { - if ((AddExistingModule.Checked)) + if ((this.AddExistingModule.Checked)) { int pageID; try { - pageID = int.Parse(PageLst.SelectedValue); + pageID = int.Parse(this.PageLst.SelectedValue); } catch (Exception exc) { @@ -289,21 +289,21 @@ protected void CmdAddModuleClick(object sender, EventArgs e) if ((pageID > -1)) { - DoAddExistingModule(moduleLstID, pageID, PaneLst.SelectedValue, position, "", chkCopyModule.Checked); + this.DoAddExistingModule(moduleLstID, pageID, this.PaneLst.SelectedValue, position, "", this.chkCopyModule.Checked); } } else { - DoAddNewModule(Title.Text, moduleLstID, PaneLst.SelectedValue, position, permissionType, ""); + DoAddNewModule(this.Title.Text, moduleLstID, this.PaneLst.SelectedValue, position, permissionType, ""); } } //set view mode to edit after add module. - if (PortalSettings.UserMode != PortalSettings.Mode.Edit) + if (this.PortalSettings.UserMode != PortalSettings.Mode.Edit) { - Personalization.SetProfile("Usability", "UserMode" + PortalSettings.PortalId, "EDIT"); + Personalization.SetProfile("Usability", "UserMode" + this.PortalSettings.PortalId, "EDIT"); } - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } } @@ -327,11 +327,11 @@ public bool Enabled { get { - return _enabled && CanAddModuleToPage(); + return this._enabled && this.CanAddModuleToPage(); } set { - _enabled = value; + this._enabled = value; } } @@ -352,18 +352,18 @@ protected DesktopModuleInfo SelectedModule { get { - if (AddExistingModule.Checked) + if (this.AddExistingModule.Checked) { var tabId = -1; - if (!string.IsNullOrEmpty(PageLst.SelectedValue)) - tabId = int.Parse(PageLst.SelectedValue); + if (!string.IsNullOrEmpty(this.PageLst.SelectedValue)) + tabId = int.Parse(this.PageLst.SelectedValue); if (tabId < 0) tabId = PortalSettings.Current.ActiveTab.TabID; - if (!string.IsNullOrEmpty(ModuleLst.SelectedValue)) + if (!string.IsNullOrEmpty(this.ModuleLst.SelectedValue)) { - var moduleId = int.Parse(ModuleLst.SelectedValue); + var moduleId = int.Parse(this.ModuleLst.SelectedValue); if (moduleId >= 0) { return ModuleController.Instance.GetModule(moduleId, tabId, false).DesktopModule; @@ -374,13 +374,13 @@ protected DesktopModuleInfo SelectedModule { var portalId = -1; - if (SiteListPanel.Visible) portalId = int.Parse(SiteList.SelectedValue); + if (this.SiteListPanel.Visible) portalId = int.Parse(this.SiteList.SelectedValue); if (portalId < 0) portalId = PortalSettings.Current.PortalId; - if (!string.IsNullOrEmpty(ModuleLst.SelectedValue)) + if (!string.IsNullOrEmpty(this.ModuleLst.SelectedValue)) { - var moduleId = int.Parse(ModuleLst.SelectedValue); + var moduleId = int.Parse(this.ModuleLst.SelectedValue); if (moduleId >= 0) { return DesktopModuleController.GetDesktopModule(moduleId, portalId); @@ -422,7 +422,7 @@ private void DoAddExistingModule(int moduleId, int tabId, string paneName, int p ModuleInfo moduleInfo = ModuleController.Instance.GetModule(moduleId, tabId, false); int userID = -1; - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { UserInfo user = UserController.Instance.GetCurrentUserInfo(); if (((user != null))) @@ -655,105 +655,105 @@ private static bool GetIsPortable(string moduleID, string tabID) protected string GetString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } private void LoadAllLists() { - LoadSiteList(); - LoadCategoryList(); - LoadPageList(); - LoadModuleList(); - LoadVisibilityList(); - LoadPaneList(); - LoadPositionList(); - LoadPaneModulesList(); + this.LoadSiteList(); + this.LoadCategoryList(); + this.LoadPageList(); + this.LoadModuleList(); + this.LoadVisibilityList(); + this.LoadPaneList(); + this.LoadPositionList(); + this.LoadPaneModulesList(); } private void LoadCategoryList() { - CategoryListPanel.Visible = !AddExistingModule.Checked; + this.CategoryListPanel.Visible = !this.AddExistingModule.Checked; ITermController termController = Util.GetTermController(); - CategoryList.DataSource = termController.GetTermsByVocabulary("Module_Categories").OrderBy(t => t.Weight).Where(t => t.Name != "< None >").ToList(); - CategoryList.DataBind(); + this.CategoryList.DataSource = termController.GetTermsByVocabulary("Module_Categories").OrderBy(t => t.Weight).Where(t => t.Name != "< None >").ToList(); + this.CategoryList.DataBind(); //CategoryList.Items.Add(new ListItem(Localization.GetString("AllCategories", LocalResourceFile), "All")); - CategoryList.AddItem(Localization.GetString("AllCategories", LocalResourceFile), "All"); - if (!IsPostBack) + this.CategoryList.AddItem(Localization.GetString("AllCategories", this.LocalResourceFile), "All"); + if (!this.IsPostBack) { - CategoryList.Select("Common", false); + this.CategoryList.Select("Common", false); } } private void LoadModuleList() { - if (AddExistingModule.Checked) + if (this.AddExistingModule.Checked) { //Get list of modules for the selected tab - if (!string.IsNullOrEmpty(PageLst.SelectedValue)) + if (!string.IsNullOrEmpty(this.PageLst.SelectedValue)) { - var tabId = int.Parse(PageLst.SelectedValue); + var tabId = int.Parse(this.PageLst.SelectedValue); if (tabId >= 0) { - ModuleLst.BindTabModulesByTabID(tabId); + this.ModuleLst.BindTabModulesByTabID(tabId); } - if ((ModuleLst.ItemCount > 0)) + if ((this.ModuleLst.ItemCount > 0)) { - chkCopyModule.Visible = true; - SetCopyModuleMessage(GetIsPortable(ModuleLst.SelectedValue, PageLst.SelectedValue)); + this.chkCopyModule.Visible = true; + this.SetCopyModuleMessage(GetIsPortable(this.ModuleLst.SelectedValue, this.PageLst.SelectedValue)); } } } else { - ModuleLst.Filter = CategoryList.SelectedValue == "All" + this.ModuleLst.Filter = this.CategoryList.SelectedValue == "All" ? (kvp => true) - : (Func, bool>)(kvp => kvp.Value.DesktopModule.Category == CategoryList.SelectedValue); - ModuleLst.BindAllPortalDesktopModules(); + : (Func, bool>)(kvp => kvp.Value.DesktopModule.Category == this.CategoryList.SelectedValue); + this.ModuleLst.BindAllPortalDesktopModules(); } - ModuleLst.Enabled = ModuleLst.ItemCount > 0; + this.ModuleLst.Enabled = this.ModuleLst.ItemCount > 0; } private void LoadPageList() { - PageListPanel.Visible = AddExistingModule.Checked; - TitlePanel.Enabled = !AddExistingModule.Checked; - chkCopyModule.Visible = AddExistingModule.Checked; + this.PageListPanel.Visible = this.AddExistingModule.Checked; + this.TitlePanel.Enabled = !this.AddExistingModule.Checked; + this.chkCopyModule.Visible = this.AddExistingModule.Checked; - if ((AddExistingModule.Checked)) + if ((this.AddExistingModule.Checked)) { - chkCopyModule.Text = Localization.GetString("CopyModuleDefault.Text", LocalResourceFile); + this.chkCopyModule.Text = Localization.GetString("CopyModuleDefault.Text", this.LocalResourceFile); } - var portalSettings = SelectedPortalSettings; + var portalSettings = this.SelectedPortalSettings; - PageLst.Items.Clear(); + this.PageLst.Items.Clear(); - if (PageListPanel.Visible) + if (this.PageListPanel.Visible) { - PageLst.DataValueField = "TabID"; - PageLst.DataTextField = "IndentedTabName"; - if(PortalSettings.PortalId == SelectedPortalSettings.PortalId) + this.PageLst.DataValueField = "TabID"; + this.PageLst.DataTextField = "IndentedTabName"; + if(this.PortalSettings.PortalId == this.SelectedPortalSettings.PortalId) { - PageLst.DataSource = TabController.GetPortalTabs(portalSettings.PortalId, portalSettings.ActiveTab.TabID, true, string.Empty, true, false, false, false, true); + this.PageLst.DataSource = TabController.GetPortalTabs(portalSettings.PortalId, portalSettings.ActiveTab.TabID, true, string.Empty, true, false, false, false, true); } else { - PageLst.DataSource = TabController.GetPortalTabs(portalSettings.PortalId, Null.NullInteger, true, string.Empty, true, false, false, false, true); + this.PageLst.DataSource = TabController.GetPortalTabs(portalSettings.PortalId, Null.NullInteger, true, string.Empty, true, false, false, false, true); } - PageLst.DataBind(); + this.PageLst.DataBind(); } } private void LoadPaneList() { - PaneLst.Items.Clear(); - PaneLst.DataSource = PortalSettings.Current.ActiveTab.Panes; - PaneLst.DataBind(); + this.PaneLst.Items.Clear(); + this.PaneLst.DataSource = PortalSettings.Current.ActiveTab.Panes; + this.PaneLst.DataBind(); if ((PortalSettings.Current.ActiveTab.Panes.Contains(Globals.glbDefaultPane))) { - PaneLst.SelectedValue = Globals.glbDefaultPane; + this.PaneLst.SelectedValue = Globals.glbDefaultPane; } } @@ -769,7 +769,7 @@ private void LoadPaneModulesList() //modules which are displayed on all tabs should not be displayed on the Admin or Super tabs if (!m.AllTabs || !PortalSettings.Current.ActiveTab.IsSuperTab) { - if (m.PaneName == PaneLst.SelectedValue) + if (m.PaneName == this.PaneLst.SelectedValue) { int moduleOrder = m.ModuleOrder; @@ -783,31 +783,31 @@ private void LoadPaneModulesList() } } - PaneModulesLst.Enabled = true; - PaneModulesLst.Items.Clear(); - PaneModulesLst.DataValueField = "key"; - PaneModulesLst.DataTextField = "value"; - PaneModulesLst.DataSource = items; - PaneModulesLst.DataBind(); + this.PaneModulesLst.Enabled = true; + this.PaneModulesLst.Items.Clear(); + this.PaneModulesLst.DataValueField = "key"; + this.PaneModulesLst.DataTextField = "value"; + this.PaneModulesLst.DataSource = items; + this.PaneModulesLst.DataBind(); - if ((PaneModulesLst.Items.Count <= 1)) + if ((this.PaneModulesLst.Items.Count <= 1)) { - var listItem = PositionLst.FindItemByValue("ABOVE"); + var listItem = this.PositionLst.FindItemByValue("ABOVE"); if (((listItem != null))) { - PositionLst.Items.Remove(listItem); + this.PositionLst.Items.Remove(listItem); } - listItem = PositionLst.FindItemByValue("BELOW"); + listItem = this.PositionLst.FindItemByValue("BELOW"); if (((listItem != null))) { - PositionLst.Items.Remove(listItem); + this.PositionLst.Items.Remove(listItem); } - PaneModulesLst.Enabled = false; + this.PaneModulesLst.Enabled = false; } - if ((PositionLst.SelectedValue == "TOP" || PositionLst.SelectedValue == "BOTTOM")) + if ((this.PositionLst.SelectedValue == "TOP" || this.PositionLst.SelectedValue == "BOTTOM")) { - PaneModulesLst.Enabled = false; + this.PaneModulesLst.Enabled = false; } } @@ -815,52 +815,52 @@ private void LoadPositionList() { var items = new Dictionary { - {"TOP", GetString("Top")}, - {"ABOVE", GetString("Above")}, - {"BELOW", GetString("Below")}, - {"BOTTOM", GetString("Bottom")} + {"TOP", this.GetString("Top")}, + {"ABOVE", this.GetString("Above")}, + {"BELOW", this.GetString("Below")}, + {"BOTTOM", this.GetString("Bottom")} }; - PositionLst.Items.Clear(); - PositionLst.DataValueField = "key"; - PositionLst.DataTextField = "value"; - PositionLst.DataSource = items; - PositionLst.DataBind(); - PositionLst.SelectedValue = "BOTTOM"; + this.PositionLst.Items.Clear(); + this.PositionLst.DataValueField = "key"; + this.PositionLst.DataTextField = "value"; + this.PositionLst.DataSource = items; + this.PositionLst.DataBind(); + this.PositionLst.SelectedValue = "BOTTOM"; } private void LoadSiteList() { // Is there more than one site in this group? - var multipleSites = GetCurrentPortalsGroup().Count() > 1; + var multipleSites = this.GetCurrentPortalsGroup().Count() > 1; - SiteListPanel.Visible = multipleSites && AddExistingModule.Checked; + this.SiteListPanel.Visible = multipleSites && this.AddExistingModule.Checked; - if (SiteListPanel.Visible) + if (this.SiteListPanel.Visible) { // Get a list of portals in this SiteGroup. var portals = PortalController.Instance.GetPortals().Cast().ToArray(); - SiteList.DataSource = portals.Select( + this.SiteList.DataSource = portals.Select( x => new {Value = x.PortalID, Name = x.PortalName, GroupID = x.PortalGroupID}).ToList(); - SiteList.DataTextField = "Name"; - SiteList.DataValueField = "Value"; - SiteList.DataBind(); + this.SiteList.DataTextField = "Name"; + this.SiteList.DataValueField = "Value"; + this.SiteList.DataBind(); } } private void LoadVisibilityList() { - VisibilityLst.Enabled = !AddExistingModule.Checked; - if ((VisibilityLst.Enabled)) + this.VisibilityLst.Enabled = !this.AddExistingModule.Checked; + if ((this.VisibilityLst.Enabled)) { - var items = new Dictionary {{"0", GetString("PermissionView")}, {"1", GetString("PermissionEdit")}}; + var items = new Dictionary {{"0", this.GetString("PermissionView")}, {"1", this.GetString("PermissionEdit")}}; - VisibilityLst.Items.Clear(); - VisibilityLst.DataValueField = "key"; - VisibilityLst.DataTextField = "value"; - VisibilityLst.DataSource = items; - VisibilityLst.DataBind(); + this.VisibilityLst.Items.Clear(); + this.VisibilityLst.DataValueField = "key"; + this.VisibilityLst.DataTextField = "value"; + this.VisibilityLst.DataSource = items; + this.VisibilityLst.DataBind(); } } @@ -868,7 +868,7 @@ private string LocalResourceFile { get { - return string.Format("{0}/{1}/{2}.ascx.resx", TemplateSourceDirectory, Localization.LocalResourceDirectory, GetType().BaseType.Name); + return string.Format("{0}/{1}/{2}.ascx.resx", this.TemplateSourceDirectory, Localization.LocalResourceDirectory, this.GetType().BaseType.Name); } } @@ -876,13 +876,13 @@ private void SetCopyModuleMessage(bool isPortable) { if ((isPortable)) { - chkCopyModule.Text = Localization.GetString("CopyModuleWcontent", LocalResourceFile); - chkCopyModule.ToolTip = Localization.GetString("CopyModuleWcontent.ToolTip", LocalResourceFile); + this.chkCopyModule.Text = Localization.GetString("CopyModuleWcontent", this.LocalResourceFile); + this.chkCopyModule.ToolTip = Localization.GetString("CopyModuleWcontent.ToolTip", this.LocalResourceFile); } else { - chkCopyModule.Text = Localization.GetString("CopyModuleWOcontent", LocalResourceFile); - chkCopyModule.ToolTip = Localization.GetString("CopyModuleWOcontent.ToolTip", LocalResourceFile); + this.chkCopyModule.Text = Localization.GetString("CopyModuleWOcontent", this.LocalResourceFile); + this.chkCopyModule.ToolTip = Localization.GetString("CopyModuleWOcontent.ToolTip", this.LocalResourceFile); } } diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs index 4cf7899fd04..f9d64a857ed 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/AddPage.ascx.cs @@ -34,7 +34,7 @@ public partial class AddPage : UserControl, IDnnRibbonBarTool private readonly INavigationManager _navigationManager; public AddPage() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Event Handlers" @@ -43,24 +43,24 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdAddPage.Click += CmdAddPageClick; + this.cmdAddPage.Click += this.CmdAddPageClick; try { if (PortalSettings.Pages < PortalSettings.PageQuota || UserController.Instance.GetCurrentUserInfo().IsSuperUser || PortalSettings.PageQuota == 0) { - cmdAddPage.Enabled = true; + this.cmdAddPage.Enabled = true; } else { - cmdAddPage.Enabled = false; - cmdAddPage.ToolTip = Localization.GetString("ExceededQuota", LocalResourceFile); + this.cmdAddPage.Enabled = false; + this.cmdAddPage.ToolTip = Localization.GetString("ExceededQuota", this.LocalResourceFile); } - if (!IsPostBack) + if (!this.IsPostBack) { - if ((Visible)) + if ((this.Visible)) { - LoadAllLists(); + this.LoadAllLists(); } } } @@ -72,23 +72,23 @@ protected override void OnLoad(EventArgs e) protected void CmdAddPageClick(object sender, EventArgs e) { - int selectedTabID = Int32.Parse(PageLst.SelectedValue); + int selectedTabID = Int32.Parse(this.PageLst.SelectedValue); TabInfo selectedTab = TabController.Instance.GetTab(selectedTabID, PortalSettings.ActiveTab.PortalID, false); - var tabLocation = (TabRelativeLocation) Enum.Parse(typeof (TabRelativeLocation), LocationLst.SelectedValue); + var tabLocation = (TabRelativeLocation) Enum.Parse(typeof (TabRelativeLocation), this.LocationLst.SelectedValue); TabInfo newTab = RibbonBarManager.InitTabInfoObject(selectedTab, tabLocation); - newTab.TabName = Name.Text; - newTab.IsVisible = IncludeInMenu.Checked; + newTab.TabName = this.Name.Text; + newTab.IsVisible = this.IncludeInMenu.Checked; string errMsg = string.Empty; try { - RibbonBarManager.SaveTabInfoObject(newTab, selectedTab, tabLocation, TemplateLst.SelectedValue); + RibbonBarManager.SaveTabInfoObject(newTab, selectedTab, tabLocation, this.TemplateLst.SelectedValue); } catch (DotNetNukeException ex) { Exceptions.LogException(ex); - errMsg = (ex.ErrorCode != DotNetNukeErrorCode.NotSet) ? GetString("Err." + ex.ErrorCode) : ex.Message; + errMsg = (ex.ErrorCode != DotNetNukeErrorCode.NotSet) ? this.GetString("Err." + ex.ErrorCode) : ex.Message; } catch (Exception ex) { @@ -108,12 +108,12 @@ protected void CmdAddPageClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(_navigationManager.NavigateURL(newTab.TabID)); + this.Response.Redirect(this._navigationManager.NavigateURL(newTab.TabID)); } else { - errMsg = string.Format("

{0}

{1}

", GetString("Err.Header"), errMsg); - Web.UI.Utilities.RegisterAlertOnPageLoad(this, new MessageWindowParameters(errMsg) { Title = GetString("Err.Title")}); + errMsg = string.Format("

{0}

{1}

", this.GetString("Err.Header"), errMsg); + Web.UI.Utilities.RegisterAlertOnPageLoad(this, new MessageWindowParameters(errMsg) { Title = this.GetString("Err.Title")}); } } @@ -155,11 +155,11 @@ protected TabInfo NewTabObject { get { - if (((_newTabObject == null))) + if (((this._newTabObject == null))) { - _newTabObject = RibbonBarManager.InitTabInfoObject(PortalSettings.ActiveTab); + this._newTabObject = RibbonBarManager.InitTabInfoObject(PortalSettings.ActiveTab); } - return _newTabObject; + return this._newTabObject; } } @@ -167,7 +167,7 @@ private string LocalResourceFile { get { - return string.Format("{0}/{1}/{2}.ascx.resx", TemplateSourceDirectory, Localization.LocalResourceDirectory, GetType().BaseType.Name); + return string.Format("{0}/{1}/{2}.ascx.resx", this.TemplateSourceDirectory, Localization.LocalResourceDirectory, this.GetType().BaseType.Name); } } @@ -181,58 +181,58 @@ private static PortalSettings PortalSettings private void LoadAllLists() { - LoadLocationList(); - LoadTemplateList(); - LoadPageList(); + this.LoadLocationList(); + this.LoadTemplateList(); + this.LoadPageList(); } private void LoadTemplateList() { - TemplateLst.ClearSelection(); - TemplateLst.Items.Clear(); + this.TemplateLst.ClearSelection(); + this.TemplateLst.Items.Clear(); //Get Templates Folder ArrayList templateFiles = Globals.GetFileList(PortalSettings.PortalId, "page.template", false, "Templates/"); foreach (FileItem dnnFile in templateFiles) { var item = new DnnComboBoxItem(dnnFile.Text.Replace(".page.template", ""), dnnFile.Value); - TemplateLst.Items.Add(item); + this.TemplateLst.Items.Add(item); if (item.Text == "Default") { item.Selected = true; } } - TemplateLst.InsertItem(0, GetString("NoTemplate"), ""); + this.TemplateLst.InsertItem(0, this.GetString("NoTemplate"), ""); } private void LoadLocationList() { - LocationLst.ClearSelection(); - LocationLst.Items.Clear(); + this.LocationLst.ClearSelection(); + this.LocationLst.Items.Clear(); //LocationLst.Items.Add(new ListItem(GetString("Before"), "BEFORE")); //LocationLst.Items.Add(new ListItem(GetString("After"), "AFTER")); //LocationLst.Items.Add(new ListItem(GetString("Child"), "CHILD")); - LocationLst.AddItem(GetString("Before"), "BEFORE"); - LocationLst.AddItem(GetString("After"), "AFTER"); - LocationLst.AddItem(GetString("Child"), "CHILD"); + this.LocationLst.AddItem(this.GetString("Before"), "BEFORE"); + this.LocationLst.AddItem(this.GetString("After"), "AFTER"); + this.LocationLst.AddItem(this.GetString("Child"), "CHILD"); - LocationLst.SelectedIndex = (!PortalSecurity.IsInRole("Administrators")) ? 2 : 1; + this.LocationLst.SelectedIndex = (!PortalSecurity.IsInRole("Administrators")) ? 2 : 1; } private void LoadPageList() { - PageLst.ClearSelection(); - PageLst.Items.Clear(); + this.PageLst.ClearSelection(); + this.PageLst.Items.Clear(); - PageLst.DataTextField = "IndentedTabName"; - PageLst.DataValueField = "TabID"; - PageLst.DataSource = RibbonBarManager.GetPagesList(); - PageLst.DataBind(); + this.PageLst.DataTextField = "IndentedTabName"; + this.PageLst.DataValueField = "TabID"; + this.PageLst.DataSource = RibbonBarManager.GetPagesList(); + this.PageLst.DataBind(); - var item = PageLst.FindItemByValue(PortalSettings.ActiveTab.TabID.ToString()); + var item = this.PageLst.FindItemByValue(PortalSettings.ActiveTab.TabID.ToString()); if (((item != null))) { item.Selected = true; @@ -241,7 +241,7 @@ private void LoadPageList() private string GetString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } #endregion diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs index 50444fce817..10ca616274a 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/ControlBar.ascx.cs @@ -49,7 +49,7 @@ public partial class ControlBar : ControlPanelBase private readonly INavigationManager _navigationManager; public ControlBar() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } private readonly IList _adminCommonTabs = new List { "Site Settings", @@ -79,7 +79,7 @@ protected string BookmarkModuleCategory { get { - return ControlBarController.Instance.GetBookmarkCategory(PortalSettings.PortalId); + return ControlBarController.Instance.GetBookmarkCategory(this.PortalSettings.PortalId); } } @@ -87,7 +87,7 @@ protected string BookmarkedModuleKeys { get { - var bookmarkModules = Personalization.GetProfile("ControlBar", "module" + PortalSettings.PortalId); + var bookmarkModules = Personalization.GetProfile("ControlBar", "module" + this.PortalSettings.PortalId); if (bookmarkModules == null) { return string.Empty; @@ -102,7 +102,7 @@ public override bool IncludeInControlHierarchy { get { - return base.IncludeInControlHierarchy && (IsPageAdmin() || IsModuleAdmin()); + return base.IncludeInControlHierarchy && (this.IsPageAdmin() || this.IsModuleAdmin()); } } @@ -113,14 +113,14 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //page will be null if the control panel initial twice, it will be removed in the second time. - if (Page != null) + if (this.Page != null) { - ID = "ControlBar"; + this.ID = "ControlBar"; - FileUploader = new DnnFileUpload {ID = "fileUploader", SupportHost = false}; - Page.Form.Controls.Add(FileUploader); + this.FileUploader = new DnnFileUpload {ID = "fileUploader", SupportHost = false}; + this.Page.Form.Controls.Add(this.FileUploader); - LoadCustomMenuItems(); + this.LoadCustomMenuItems(); } } @@ -128,43 +128,43 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (PortalSettings.EnablePopUps && Host.EnableModuleOnLineHelp) + if (this.PortalSettings.EnablePopUps && Host.EnableModuleOnLineHelp) { - helpLink.Text = string.Format(@"
  • {1}
  • ", UrlUtils.PopUpUrl(Host.HelpURL, this, PortalSettings, false, false), GetString("Tool.Help.ToolTip")); + this.helpLink.Text = string.Format(@"
  • {1}
  • ", UrlUtils.PopUpUrl(Host.HelpURL, this, this.PortalSettings, false, false), this.GetString("Tool.Help.ToolTip")); } else if (Host.EnableModuleOnLineHelp) { - helpLink.Text = string.Format(@"
  • {1}
  • ", Host.HelpURL, GetString("Tool.Help.ToolTip")); + this.helpLink.Text = string.Format(@"
  • {1}
  • ", Host.HelpURL, this.GetString("Tool.Help.ToolTip")); } - LoginUrl = ResolveClientUrl(@"~/Login.aspx"); + this.LoginUrl = this.ResolveClientUrl(@"~/Login.aspx"); - if (ControlPanel.Visible && IncludeInControlHierarchy) + if (this.ControlPanel.Visible && this.IncludeInControlHierarchy) { - ClientResourceManager.RegisterStyleSheet(Page, "~/admin/ControlPanel/ControlBar.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/admin/ControlPanel/ControlBar.css", FileOrder.Css.ResourceCss); JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ClientResourceManager.RegisterScript(Page, "~/resources/shared/scripts/dnn.controlBar.js"); + ClientResourceManager.RegisterScript(this.Page, "~/resources/shared/scripts/dnn.controlBar.js"); // Is there more than one site in this group? var multipleSites = GetCurrentPortalsGroup().Count() > 1; - ClientAPI.RegisterClientVariable(Page, "moduleSharing", multipleSites.ToString().ToLowerInvariant(), true); + ClientAPI.RegisterClientVariable(this.Page, "moduleSharing", multipleSites.ToString().ToLowerInvariant(), true); } ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); var multipleSite = false; - conrolbar_logo.ImageUrl = ControlBarController.Instance.GetControlBarLogoURL(); - if (!IsPostBack) + this.conrolbar_logo.ImageUrl = ControlBarController.Instance.GetControlBarLogoURL(); + if (!this.IsPostBack) { - LoadCategoryList(); - multipleSite = LoadSiteList(); - LoadVisibilityList(); - AutoSetUserMode(); - BindPortalsList(); - BindLanguagesList(); + this.LoadCategoryList(); + multipleSite = this.LoadSiteList(); + this.LoadVisibilityList(); + this.AutoSetUserMode(); + this.BindPortalsList(); + this.BindLanguagesList(); } - LoadTabModuleMessage = multipleSite ? GetString("LoadingTabModuleCE.Text") : GetString("LoadingTabModule.Text"); + this.LoadTabModuleMessage = multipleSite ? this.GetString("LoadingTabModuleCE.Text") : this.GetString("LoadingTabModule.Text"); } #endregion @@ -174,7 +174,7 @@ protected override void OnLoad(EventArgs e) protected bool CheckPageQuota() { UserInfo objUser = UserController.Instance.GetCurrentUserInfo(); - return (objUser != null && objUser.IsSuperUser) || PortalSettings.PageQuota == 0 || PortalSettings.Pages < PortalSettings.PageQuota; + return (objUser != null && objUser.IsSuperUser) || this.PortalSettings.PageQuota == 0 || this.PortalSettings.Pages < this.PortalSettings.PageQuota; } protected string GetUpgradeIndicator() @@ -184,12 +184,12 @@ protected string GetUpgradeIndicator() if (objUser != null && objUser.IsSuperUser) { var upgradeIndicator = ControlBarController.Instance.GetUpgradeIndicator(DotNetNukeContext.Current.Application.Version, - Request.IsLocal, Request.IsSecureConnection); + this.Request.IsLocal, this.Request.IsSecureConnection); if (upgradeIndicator == null) { return String.Empty; } - return GetUpgradeIndicatorButton(upgradeIndicator); + return this.GetUpgradeIndicatorButton(upgradeIndicator); } return string.Empty; @@ -202,31 +202,31 @@ private void LoadCustomMenuItems() var liElement = new HtmlGenericControl("li"); liElement.Attributes.Add("id", menuItem.ID + "_tab"); - var control = Page.LoadControl(menuItem.Source); + var control = this.Page.LoadControl(menuItem.Source); control.ID = menuItem.ID; liElement.Controls.Add(control); - CustomMenuItems.Controls.Add(liElement); + this.CustomMenuItems.Controls.Add(liElement); } } private string GetUpgradeIndicatorButton(UpgradeIndicatorViewModel upgradeIndicator) { return string.Format("\"{4}\"", - upgradeIndicator.ID, upgradeIndicator.WebAction, upgradeIndicator.CssClass, ResolveClientUrl(upgradeIndicator.ImageUrl), upgradeIndicator.AltText, upgradeIndicator.ToolTip); + upgradeIndicator.ID, upgradeIndicator.WebAction, upgradeIndicator.CssClass, this.ResolveClientUrl(upgradeIndicator.ImageUrl), upgradeIndicator.AltText, upgradeIndicator.ToolTip); } protected string PreviewPopup() { var previewUrl = string.Format("{0}/Default.aspx?ctl={1}&previewTab={2}&TabID={2}", - Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias), + Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias), "MobilePreview", - PortalSettings.ActiveTab.TabID); + this.PortalSettings.ActiveTab.TabID); - if(PortalSettings.EnablePopUps) + if(this.PortalSettings.EnablePopUps) { - return UrlUtils.PopUpUrl(previewUrl, this, PortalSettings, true, false, 660, 800); + return UrlUtils.PopUpUrl(previewUrl, this, this.PortalSettings, true, false, 660, 800); } return string.Format("location.href = \"{0}\"", previewUrl); @@ -242,13 +242,13 @@ protected IEnumerable LoadPaneList() foreach (var p in panes) { var topPane = new[]{ - string.Format(GetString("Pane.AddTop.Text"), p), + string.Format(this.GetString("Pane.AddTop.Text"), p), p.ToString(), "TOP" }; var botPane = new[]{ - string.Format(GetString("Pane.AddBottom.Text"), p), + string.Format(this.GetString("Pane.AddBottom.Text"), p), p.ToString(), "BOTTOM" }; @@ -263,7 +263,7 @@ protected IEnumerable LoadPaneList() { var botPane = new[]{ - string.Format(GetString("Pane.Add.Text"), p), + string.Format(this.GetString("Pane.Add.Text"), p), p.ToString(), "BOTTOM" }; @@ -278,7 +278,7 @@ protected IEnumerable LoadPaneList() protected string GetString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFriendlyName, @@ -300,68 +300,68 @@ protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFri case "PageSettings": if (TabPermissionController.CanManagePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=settingTab"); } break; case "CopyPage": if (TabPermissionController.CanCopyPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Tab", "action=copy&activeTab=copyTab"); } break; case "DeletePage": if (TabPermissionController.CanDeletePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Tab", "action=delete"); } break; case "PageTemplate": if (TabPermissionController.CanManagePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=advancedTab"); } break; case "PageLocalization": if (TabPermissionController.CanManagePage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=localizationTab"); } break; case "PagePermission": if (TabPermissionController.CanAdminPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Tab", "action=edit&activeTab=permissionsTab"); } break; case "ImportPage": if (TabPermissionController.CanImportPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "ImportTab"); } break; case "ExportPage": if (TabPermissionController.CanExportPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab"); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "ExportTab"); } break; case "NewPage": if (TabPermissionController.CanAddPage()) { - returnValue = _navigationManager.NavigateURL("Tab", "activeTab=settingTab"); + returnValue = this._navigationManager.NavigateURL("Tab", "activeTab=settingTab"); } break; case "PublishPage": if (TabPermissionController.CanAdminPage()) { - returnValue = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID); + returnValue = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID); } break; default: if (!string.IsNullOrEmpty(moduleFriendlyName)) { var additionalParams = new List(); - returnValue = GetTabURL(additionalParams, toolName, isHostTool, + returnValue = this.GetTabURL(additionalParams, toolName, isHostTool, moduleFriendlyName, controlKey, showAsPopUp); } break; @@ -372,7 +372,7 @@ protected string BuildToolUrl(string toolName, bool isHostTool, string moduleFri protected string GetTabURL(List additionalParams, string toolName, bool isHostTool, string moduleFriendlyName, string controlKey, bool showAsPopUp) { - int portalId = isHostTool ? Null.NullInteger : PortalSettings.PortalId; + int portalId = isHostTool ? Null.NullInteger : this.PortalSettings.PortalId; string strURL = string.Empty; @@ -389,14 +389,14 @@ protected string GetTabURL(List additionalParams, string toolName, bool if (!string.IsNullOrEmpty(controlKey)) { additionalParams.Insert(0, "mid=" + moduleInfo.ModuleID); - if (showAsPopUp && PortalSettings.EnablePopUps) + if (showAsPopUp && this.PortalSettings.EnablePopUps) { additionalParams.Add("popUp=true"); } } string currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; - strURL = _navigationManager.NavigateURL(moduleInfo.TabID, isHostPage, PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); + strURL = this._navigationManager.NavigateURL(moduleInfo.TabID, isHostPage, this.PortalSettings, controlKey, currentCulture, additionalParams.ToArray()); } return strURL; @@ -404,7 +404,7 @@ protected string GetTabURL(List additionalParams, string toolName, bool protected string GetTabURL(string tabName, bool isHostTool) { - return GetTabURL(tabName, isHostTool, null); + return this.GetTabURL(tabName, isHostTool, null); } protected string GetTabURL(string tabName, bool isHostTool, int? parentId) @@ -414,8 +414,8 @@ protected string GetTabURL(string tabName, bool isHostTool, int? parentId) return "javascript:void(0);"; } - int portalId = isHostTool ? Null.NullInteger : PortalSettings.PortalId; - return GetTabURL(tabName, portalId, parentId); + int portalId = isHostTool ? Null.NullInteger : this.PortalSettings.PortalId; + return this.GetTabURL(tabName, portalId, parentId); } protected string GetTabURL(string tabName, int portalId, int? parentId) @@ -432,28 +432,28 @@ protected string GetTabURL(string tabName, int portalId, int? parentId) protected string GetTabPublishing() { - return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, PortalSettings.PortalId) ? "true" : "false"; + return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, this.PortalSettings.PortalId) ? "true" : "false"; } protected string GetPublishActionText() { - return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, PortalSettings.PortalId) - ? ClientAPI.GetSafeJSString(GetString("Tool.UnpublishPage.Text")) - : ClientAPI.GetSafeJSString(GetString("Tool.PublishPage.Text")); + return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, this.PortalSettings.PortalId) + ? ClientAPI.GetSafeJSString(this.GetString("Tool.UnpublishPage.Text")) + : ClientAPI.GetSafeJSString(this.GetString("Tool.PublishPage.Text")); } protected string GetPublishConfirmText() { - return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, PortalSettings.PortalId) - ? GetButtonConfirmMessage("UnpublishPage") - : GetButtonConfirmMessage("PublishPage"); + return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, this.PortalSettings.PortalId) + ? this.GetButtonConfirmMessage("UnpublishPage") + : this.GetButtonConfirmMessage("PublishPage"); } protected string GetPublishConfirmHeader() { - return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, PortalSettings.PortalId) - ? GetButtonConfirmHeader("UnpublishPage") - : GetButtonConfirmHeader("PublishPage"); + return TabPublishingController.Instance.IsTabPublished(TabController.CurrentPage.TabID, this.PortalSettings.PortalId) + ? this.GetButtonConfirmHeader("UnpublishPage") + : this.GetButtonConfirmHeader("PublishPage"); } protected string GetMenuItem(string tabName, bool isHostTool) { @@ -465,17 +465,17 @@ protected string GetMenuItem(string tabName, bool isHostTool) List tabList; if(isHostTool) { - if(_hostTabs == null) GetHostTabs(); - tabList = _hostTabs; + if(this._hostTabs == null) this.GetHostTabs(); + tabList = this._hostTabs; } else { - if(_adminTabs == null) GetAdminTabs(); - tabList = _adminTabs; + if(this._adminTabs == null) this.GetAdminTabs(); + tabList = this._adminTabs; } var tab = tabList?.SingleOrDefault(t => t.TabName == tabName); - return GetMenuItem(tab); + return this.GetMenuItem(tab); } protected string GetMenuItem(string tabName, bool isHostTool, bool isRemoveBookmark, bool isHideBookmark = false) @@ -488,17 +488,17 @@ protected string GetMenuItem(string tabName, bool isHostTool, bool isRemoveBookm List tabList; if (isHostTool) { - if (_hostTabs == null) GetHostTabs(); - tabList = _hostTabs; + if (this._hostTabs == null) this.GetHostTabs(); + tabList = this._hostTabs; } else { - if (_adminTabs == null) GetAdminTabs(); - tabList = _adminTabs; + if (this._adminTabs == null) this.GetAdminTabs(); + tabList = this._adminTabs; } var tab = tabList?.SingleOrDefault(t => t.TabName == tabName); - return GetMenuItem(tab, isRemoveBookmark, isHideBookmark); + return this.GetMenuItem(tab, isRemoveBookmark, isHideBookmark); } protected string GetMenuItem(TabInfo tab, bool isRemoveBookmark = false, bool isHideBookmark = false) @@ -514,14 +514,14 @@ protected string GetMenuItem(TabInfo tab, bool isRemoveBookmark = false, bool is return string.Format("
  • {1}
  • ", tab.FullUrl, name, - ClientAPI.GetSafeJSString(GetString("Tool.AddToBookmarks.ToolTip")), + ClientAPI.GetSafeJSString(this.GetString("Tool.AddToBookmarks.ToolTip")), ClientAPI.GetSafeJSString(tab.TabName), linkClass); else return string.Format("
  • {1}
  • ", tab.FullUrl, name, - ClientAPI.GetSafeJSString(GetString("Tool.AddToBookmarks.ToolTip")), + ClientAPI.GetSafeJSString(this.GetString("Tool.AddToBookmarks.ToolTip")), ClientAPI.GetSafeJSString(tab.TabName), linkClass); } @@ -529,7 +529,7 @@ protected string GetMenuItem(TabInfo tab, bool isRemoveBookmark = false, bool is return string.Format("
  • {1}
  • ", tab.FullUrl, name, - ClientAPI.GetSafeJSString(GetString("Tool.RemoveFromBookmarks.ToolTip")), + ClientAPI.GetSafeJSString(this.GetString("Tool.RemoveFromBookmarks.ToolTip")), ClientAPI.GetSafeJSString(tab.TabName), linkClass); } @@ -539,12 +539,12 @@ protected string GetMenuItem(TabInfo tab, bool isRemoveBookmark = false, bool is protected string GetAdminBaseMenu() { - var tabs = AdminBaseTabs; + var tabs = this.AdminBaseTabs; var sb = new StringBuilder(); foreach(var tab in tabs) { - var hideBookmark = AdminBookmarkItems.Contains(tab.TabName); - sb.Append(GetMenuItem(tab, false, hideBookmark)); + var hideBookmark = this.AdminBookmarkItems.Contains(tab.TabName); + sb.Append(this.GetMenuItem(tab, false, hideBookmark)); } return sb.ToString(); @@ -552,12 +552,12 @@ protected string GetAdminBaseMenu() protected string GetAdminAdvancedMenu() { - var tabs = AdminAdvancedTabs; + var tabs = this.AdminAdvancedTabs; var sb = new StringBuilder(); foreach (var tab in tabs) { - var hideBookmark = AdminBookmarkItems.Contains(tab.TabName); - sb.Append(GetMenuItem(tab, false, hideBookmark)); + var hideBookmark = this.AdminBookmarkItems.Contains(tab.TabName); + sb.Append(this.GetMenuItem(tab, false, hideBookmark)); } return sb.ToString(); @@ -565,13 +565,13 @@ protected string GetAdminAdvancedMenu() protected string GetHostBaseMenu() { - var tabs = HostBaseTabs; + var tabs = this.HostBaseTabs; var sb = new StringBuilder(); foreach (var tab in tabs) { - var hideBookmark = HostBookmarkItems.Contains(tab.TabName); - sb.Append(GetMenuItem(tab, false, hideBookmark)); + var hideBookmark = this.HostBookmarkItems.Contains(tab.TabName); + sb.Append(this.GetMenuItem(tab, false, hideBookmark)); } return sb.ToString(); @@ -579,12 +579,12 @@ protected string GetHostBaseMenu() protected string GetHostAdvancedMenu() { - var tabs = HostAdvancedTabs; + var tabs = this.HostAdvancedTabs; var sb = new StringBuilder(); foreach (var tab in tabs) { - var hideBookmark = HostBookmarkItems.Contains(tab.TabName); - sb.Append(GetMenuItem(tab, false, hideBookmark)); + var hideBookmark = this.HostBookmarkItems.Contains(tab.TabName); + sb.Append(this.GetMenuItem(tab, false, hideBookmark)); } return sb.ToString(); @@ -593,14 +593,14 @@ protected string GetHostAdvancedMenu() protected string GetBookmarkItems(string title) { var isHostTool = title == "host"; - var bookmarkItems = isHostTool ? HostBookmarkItems : AdminBookmarkItems; + var bookmarkItems = isHostTool ? this.HostBookmarkItems : this.AdminBookmarkItems; if(bookmarkItems != null && bookmarkItems.Any()) { var sb = new StringBuilder(); foreach(var itemKey in bookmarkItems) { - sb.Append(GetMenuItem(itemKey, isHostTool, true)); + sb.Append(this.GetMenuItem(itemKey, isHostTool, true)); } return sb.ToString(); } @@ -610,12 +610,12 @@ protected string GetBookmarkItems(string title) protected string GetButtonConfirmMessage(string toolName) { - return ClientAPI.GetSafeJSString(Localization.GetString("Tool."+toolName+".ConfirmText", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool."+toolName+".ConfirmText", this.LocalResourceFile)); } protected string GetButtonConfirmHeader(string toolName) { - return ClientAPI.GetSafeJSString(Localization.GetString("Tool." + toolName + ".ConfirmHeader", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool." + toolName + ".ConfirmHeader", this.LocalResourceFile)); } protected IEnumerable LoadPortalsList() @@ -646,29 +646,29 @@ protected IEnumerable LoadLanguagesList() { var result = new List(); - if (PortalSettings.AllowUserUICulture) + if (this.PortalSettings.AllowUserUICulture) { - if(CurrentUICulture == null) + if(this.CurrentUICulture == null) { object oCulture = Personalization.GetProfile("Usability", "UICulture"); if (oCulture != null) { - CurrentUICulture = oCulture.ToString(); + this.CurrentUICulture = oCulture.ToString(); } else { var l = new Localization(); - CurrentUICulture = l.CurrentUICulture; - SetLanguage(true, CurrentUICulture); + this.CurrentUICulture = l.CurrentUICulture; + this.SetLanguage(true, this.CurrentUICulture); } } - IEnumerable cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, CurrentUICulture, "", false); + IEnumerable cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, this.CurrentUICulture, "", false); foreach (var cultureItem in cultureListItems) { - var selected = cultureItem.Value == CurrentUICulture ? "true" : "false"; + var selected = cultureItem.Value == this.CurrentUICulture ? "true" : "false"; string[] p = new string[] { cultureItem.Text, @@ -684,24 +684,24 @@ protected IEnumerable LoadLanguagesList() protected bool ShowSwitchLanguagesPanel() { - if (PortalSettings.AllowUserUICulture && PortalSettings.ContentLocalizationEnabled) + if (this.PortalSettings.AllowUserUICulture && this.PortalSettings.ContentLocalizationEnabled) { - if (CurrentUICulture == null) + if (this.CurrentUICulture == null) { object oCulture = Personalization.GetProfile("Usability", "UICulture"); if (oCulture != null) { - CurrentUICulture = oCulture.ToString(); + this.CurrentUICulture = oCulture.ToString(); } else { var l = new Localization(); - CurrentUICulture = l.CurrentUICulture; + this.CurrentUICulture = l.CurrentUICulture; } } - IEnumerable cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, CurrentUICulture, "", false); + IEnumerable cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, this.CurrentUICulture, "", false); return cultureListItems.Count() > 1; } @@ -711,19 +711,19 @@ protected bool ShowSwitchLanguagesPanel() protected string CheckedWhenInLayoutMode() { - return UserMode == PortalSettings.Mode.Layout ? "checked='checked'" : string.Empty; + return this.UserMode == PortalSettings.Mode.Layout ? "checked='checked'" : string.Empty; } protected string CheckedWhenStayInEditMode() { string checkboxState = string.Empty; - var cookie = Request.Cookies["StayInEditMode"]; + var cookie = this.Request.Cookies["StayInEditMode"]; if(cookie != null && cookie.Value == "YES") { checkboxState = "checked='checked'"; } - if(UserMode == PortalSettings.Mode.Layout) + if(this.UserMode == PortalSettings.Mode.Layout) { checkboxState += " disabled='disabled'"; } @@ -733,22 +733,22 @@ protected string CheckedWhenStayInEditMode() protected string SpecialClassWhenNotInViewMode() { - return UserMode == PortalSettings.Mode.View ? string.Empty : "controlBar_editPageInEditMode"; + return this.UserMode == PortalSettings.Mode.View ? string.Empty : "controlBar_editPageInEditMode"; } protected string GetModeForAttribute() { - return UserMode.ToString().ToUpperInvariant(); + return this.UserMode.ToString().ToUpperInvariant(); } protected string GetEditButtonLabel() { - return UserMode == PortalSettings.Mode.Edit ? GetString("Tool.CloseEditMode.Text") : GetString("Tool.EditThisPage.Text"); + return this.UserMode == PortalSettings.Mode.Edit ? this.GetString("Tool.CloseEditMode.Text") : this.GetString("Tool.EditThisPage.Text"); } protected virtual bool ActiveTabHasChildren() { - var children = TabController.GetTabsByParent(PortalSettings.ActiveTab.TabID, PortalSettings.ActiveTab.PortalID); + var children = TabController.GetTabsByParent(this.PortalSettings.ActiveTab.TabID, this.PortalSettings.ActiveTab.PortalID); if ((children == null) || children.Count < 1) { @@ -771,7 +771,7 @@ protected bool IsLanguageModuleInstalled() { get { - return string.Format("{0}/{1}/{2}.ascx.resx", TemplateSourceDirectory, Localization.LocalResourceDirectory, GetType().BaseType?.Name); + return string.Format("{0}/{1}/{2}.ascx.resx", this.TemplateSourceDirectory, Localization.LocalResourceDirectory, this.GetType().BaseType?.Name); } } @@ -779,13 +779,13 @@ private void LoadCategoryList() { ITermController termController = Util.GetTermController(); var terms = termController.GetTermsByVocabulary("Module_Categories").OrderBy(t => t.Weight).Where(t => t.Name != "< None >").ToList(); - var allTerm = new Term("All", Localization.GetString("AllCategories", LocalResourceFile)); + var allTerm = new Term("All", Localization.GetString("AllCategories", this.LocalResourceFile)); terms.Add(allTerm); - CategoryList.DataSource = terms; - CategoryList.DataBind(); - if (!IsPostBack) + this.CategoryList.DataSource = terms; + this.CategoryList.DataBind(); + if (!this.IsPostBack) { - CategoryList.Select(!String.IsNullOrEmpty(BookmarkedModuleKeys) ? BookmarkModuleCategory : "All", false); + this.CategoryList.Select(!String.IsNullOrEmpty(this.BookmarkedModuleKeys) ? this.BookmarkModuleCategory : "All", false); } } @@ -795,27 +795,27 @@ private bool LoadSiteList() var multipleSites = GetCurrentPortalsGroup().Count() > 1; if (multipleSites) { - PageList.Services.GetTreeMethod = "ItemListService/GetPagesInPortalGroup"; - PageList.Services.GetNodeDescendantsMethod = "ItemListService/GetPageDescendantsInPortalGroup"; - PageList.Services.SearchTreeMethod = "ItemListService/SearchPagesInPortalGroup"; - PageList.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForPageInPortalGroup"; - PageList.Services.SortTreeMethod = "ItemListService/SortPagesInPortalGroup"; + this.PageList.Services.GetTreeMethod = "ItemListService/GetPagesInPortalGroup"; + this.PageList.Services.GetNodeDescendantsMethod = "ItemListService/GetPageDescendantsInPortalGroup"; + this.PageList.Services.SearchTreeMethod = "ItemListService/SearchPagesInPortalGroup"; + this.PageList.Services.GetTreeWithNodeMethod = "ItemListService/GetTreePathForPageInPortalGroup"; + this.PageList.Services.SortTreeMethod = "ItemListService/SortPagesInPortalGroup"; } - PageList.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty); - PageList.OnClientSelectionChanged.Add("dnn.controlBar.ControlBar_Module_PageList_Changed"); + this.PageList.UndefinedItem = new ListItem(DynamicSharedConstants.Unspecified, string.Empty); + this.PageList.OnClientSelectionChanged.Add("dnn.controlBar.ControlBar_Module_PageList_Changed"); return multipleSites; } private void LoadVisibilityList() { - var items = new Dictionary { { "0", GetString("PermissionView") }, { "1", GetString("PermissionEdit") } }; + var items = new Dictionary { { "0", this.GetString("PermissionView") }, { "1", this.GetString("PermissionEdit") } }; - VisibilityLst.Items.Clear(); - VisibilityLst.DataValueField = "key"; - VisibilityLst.DataTextField = "value"; - VisibilityLst.DataSource = items; - VisibilityLst.DataBind(); + this.VisibilityLst.Items.Clear(); + this.VisibilityLst.DataValueField = "key"; + this.VisibilityLst.DataTextField = "value"; + this.VisibilityLst.DataSource = items; + this.VisibilityLst.DataBind(); } private static IEnumerable GetCurrentPortalsGroup() @@ -839,52 +839,52 @@ where portals.Any(x => x.PortalID == PortalSettings.Current.PortalId) private void AutoSetUserMode() { - int tabId = PortalSettings.ActiveTab.TabID; + int tabId = this.PortalSettings.ActiveTab.TabID; int portalId = PortalSettings.Current.PortalId; string pageId = string.Format("{0}:{1}", portalId, tabId); - HttpCookie cookie = Request.Cookies["StayInEditMode"]; + HttpCookie cookie = this.Request.Cookies["StayInEditMode"]; if (cookie != null && cookie.Value == "YES") { if (PortalSettings.Current.UserMode != PortalSettings.Mode.Edit) { - SetUserMode("EDIT"); - SetLastPageHistory(pageId); - Response.Redirect(Request.RawUrl, true); + this.SetUserMode("EDIT"); + this.SetLastPageHistory(pageId); + this.Response.Redirect(this.Request.RawUrl, true); } return; } - string lastPageId = GetLastPageHistory(); - var isShowAsCustomError = Request.QueryString.AllKeys.Contains("aspxerrorpath"); + string lastPageId = this.GetLastPageHistory(); + var isShowAsCustomError = this.Request.QueryString.AllKeys.Contains("aspxerrorpath"); if (lastPageId != pageId && !isShowAsCustomError) { // navigate between pages if (PortalSettings.Current.UserMode != PortalSettings.Mode.View) { - SetUserMode("VIEW"); - SetLastPageHistory(pageId); - Response.Redirect(Request.RawUrl, true); + this.SetUserMode("VIEW"); + this.SetLastPageHistory(pageId); + this.Response.Redirect(this.Request.RawUrl, true); } } if (!isShowAsCustomError) { - SetLastPageHistory(pageId); + this.SetLastPageHistory(pageId); } } private void SetLastPageHistory(string pageId) { - Response.Cookies.Add(new HttpCookie("LastPageId", pageId) { Path = !string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/" }); + this.Response.Cookies.Add(new HttpCookie("LastPageId", pageId) { Path = !string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/" }); } private string GetLastPageHistory() { - var cookie = Request.Cookies["LastPageId"]; + var cookie = this.Request.Cookies["LastPageId"]; if (cookie != null) return cookie.Value; @@ -901,18 +901,18 @@ private void SetLanguage(bool update, string currentCulture) private void BindPortalsList() { - foreach (var portal in LoadPortalsList()) + foreach (var portal in this.LoadPortalsList()) { - controlBar_SwitchSite.Items.Add(new DnnComboBoxItem(portal[0], portal[1])); + this.controlBar_SwitchSite.Items.Add(new DnnComboBoxItem(portal[0], portal[1])); } } private void BindLanguagesList() { - if (ShowSwitchLanguagesPanel()) + if (this.ShowSwitchLanguagesPanel()) { const string FlagImageUrlFormatString = "~/images/Flags/{0}.gif"; - foreach (var lang in LoadLanguagesList()) + foreach (var lang in this.LoadLanguagesList()) { var item = new DnnComboBoxItem(lang[0], lang[1]); item.ImageUrl = string.Format(FlagImageUrlFormatString, item.Value); @@ -921,7 +921,7 @@ private void BindLanguagesList() item.Selected = true; } - controlBar_SwitchLanguage.Items.Add(item); + this.controlBar_SwitchLanguage.Items.Add(item); } } @@ -936,16 +936,16 @@ protected List AdminBookmarkItems { get { - if (_adminBookmarkItems == null) + if (this._adminBookmarkItems == null) { - var bookmarkItems = Personalization.GetProfile("ControlBar", "admin" + PortalSettings.PortalId); + var bookmarkItems = Personalization.GetProfile("ControlBar", "admin" + this.PortalSettings.PortalId); - _adminBookmarkItems = bookmarkItems != null + this._adminBookmarkItems = bookmarkItems != null ? bookmarkItems.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() : new List(); } - return _adminBookmarkItems; + return this._adminBookmarkItems; } } @@ -954,16 +954,16 @@ protected List HostBookmarkItems { get { - if(_hostBookmarkItems == null) + if(this._hostBookmarkItems == null) { - var bookmarkItems = Personalization.GetProfile("ControlBar", "host" + PortalSettings.PortalId); + var bookmarkItems = Personalization.GetProfile("ControlBar", "host" + this.PortalSettings.PortalId); - _hostBookmarkItems = bookmarkItems != null + this._hostBookmarkItems = bookmarkItems != null ? bookmarkItems.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() : new List(); } - return _hostBookmarkItems; + return this._hostBookmarkItems; } } @@ -978,11 +978,11 @@ protected List AdminBaseTabs { get { - if (_adminBaseTabs == null) + if (this._adminBaseTabs == null) { - GetAdminTabs(); + this.GetAdminTabs(); } - return _adminBaseTabs; + return this._adminBaseTabs; } } @@ -990,11 +990,11 @@ protected List AdminAdvancedTabs { get { - if (_adminAdvancedTabs == null) + if (this._adminAdvancedTabs == null) { - GetAdminTabs(); + this.GetAdminTabs(); } - return _adminAdvancedTabs; + return this._adminAdvancedTabs; } } @@ -1002,11 +1002,11 @@ protected List HostBaseTabs { get { - if (_hostBaseTabs == null) + if (this._hostBaseTabs == null) { - GetHostTabs(); + this.GetHostTabs(); } - return _hostBaseTabs; + return this._hostBaseTabs; } } @@ -1014,11 +1014,11 @@ protected List HostAdvancedTabs { get { - if (_hostAdvancedTabs == null) + if (this._hostAdvancedTabs == null) { - GetHostTabs(); + this.GetHostTabs(); } - return _hostAdvancedTabs; + return this._hostAdvancedTabs; } } @@ -1032,44 +1032,44 @@ private void GetHostTabs() ? TabController.GetTabsByParent(professionalTab.TabID, -1) : new List(); - _hostTabs = new List(); - _hostTabs.AddRange(hosts); - _hostTabs.AddRange(professionalTabs); - _hostTabs = _hostTabs.OrderBy(t => t.LocalizedTabName).ToList(); + this._hostTabs = new List(); + this._hostTabs.AddRange(hosts); + this._hostTabs.AddRange(professionalTabs); + this._hostTabs = this._hostTabs.OrderBy(t => t.LocalizedTabName).ToList(); - _hostBaseTabs = new List(); - _hostAdvancedTabs = new List(); + this._hostBaseTabs = new List(); + this._hostAdvancedTabs = new List(); - foreach (var tabInfo in _hostTabs) + foreach (var tabInfo in this._hostTabs) { - if (IsCommonTab(tabInfo, true)) + if (this.IsCommonTab(tabInfo, true)) { - _hostBaseTabs.Add(tabInfo); + this._hostBaseTabs.Add(tabInfo); } else { - _hostAdvancedTabs.Add(tabInfo); + this._hostAdvancedTabs.Add(tabInfo); } } } private void GetAdminTabs() { - var adminTab = TabController.GetTabByTabPath(PortalSettings.PortalId, "//Admin", string.Empty); - _adminTabs = TabController.GetTabsByParent(adminTab, PortalSettings.PortalId).OrderBy(t => t.LocalizedTabName).ToList(); + var adminTab = TabController.GetTabByTabPath(this.PortalSettings.PortalId, "//Admin", string.Empty); + this._adminTabs = TabController.GetTabsByParent(adminTab, this.PortalSettings.PortalId).OrderBy(t => t.LocalizedTabName).ToList(); - _adminBaseTabs = new List(); - _adminAdvancedTabs = new List(); + this._adminBaseTabs = new List(); + this._adminAdvancedTabs = new List(); - foreach (var tabInfo in _adminTabs) + foreach (var tabInfo in this._adminTabs) { - if (IsCommonTab(tabInfo)) + if (this.IsCommonTab(tabInfo)) { - _adminBaseTabs.Add(tabInfo); + this._adminBaseTabs.Add(tabInfo); } else { - _adminAdvancedTabs.Add(tabInfo); + this._adminAdvancedTabs.Add(tabInfo); } } @@ -1084,7 +1084,7 @@ private bool IsCommonTab(TabInfo tab, bool isHost = false) } - return isHost ? _hostCommonTabs.Contains(tab.TabName) : _adminCommonTabs.Contains(tab.TabName); + return isHost ? this._hostCommonTabs.Contains(tab.TabName) : this._adminCommonTabs.Contains(tab.TabName); } #endregion @@ -1095,7 +1095,7 @@ protected string GetBeaconUrl() { var beaconService = BeaconService.Instance; var user = UserController.Instance.GetCurrentUserInfo(); - var path = PortalSettings.ActiveTab.TabPath; + var path = this.PortalSettings.ActiveTab.TabPath; return beaconService.GetBeaconUrl(user, path); } diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/RibbonBar.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/RibbonBar.ascx.cs index 90c816e3ada..851e656643f 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/RibbonBar.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/RibbonBar.ascx.cs @@ -41,7 +41,7 @@ public override bool IncludeInControlHierarchy { get { - return base.IncludeInControlHierarchy && (IsPageAdmin() || IsModuleAdmin()); + return base.IncludeInControlHierarchy && (this.IsPageAdmin() || this.IsModuleAdmin()); } } @@ -51,12 +51,12 @@ public override bool IncludeInControlHierarchy private void Localize() { - Control ctrl = AdminPanel.FindControl("SiteNewPage"); + Control ctrl = this.AdminPanel.FindControl("SiteNewPage"); if (((ctrl != null) && ctrl is DnnRibbonBarTool)) { var toolCtrl = (DnnRibbonBarTool)ctrl; - toolCtrl.Text = Localization.GetString("SiteNewPage", LocalResourceFile); - toolCtrl.ToolTip = Localization.GetString("SiteNewPage.ToolTip", LocalResourceFile); + toolCtrl.Text = Localization.GetString("SiteNewPage", this.LocalResourceFile); + toolCtrl.ToolTip = Localization.GetString("SiteNewPage.ToolTip", this.LocalResourceFile); } } @@ -65,39 +65,39 @@ private void SetMode(bool update) { if (update) { - SetUserMode(ddlMode.SelectedValue); + this.SetUserMode(this.ddlMode.SelectedValue); } if (!TabPermissionController.CanAddContentToPage()) { - RemoveModeDropDownItem("LAYOUT"); + this.RemoveModeDropDownItem("LAYOUT"); } if (!(new PreviewProfileController().GetProfilesByPortal(this.PortalSettings.PortalId).Count > 0)) { - RemoveModeDropDownItem("PREVIEW"); + this.RemoveModeDropDownItem("PREVIEW"); } - switch (UserMode) + switch (this.UserMode) { case PortalSettings.Mode.View: - ddlMode.FindItemByValue("VIEW").Selected = true; + this.ddlMode.FindItemByValue("VIEW").Selected = true; break; case PortalSettings.Mode.Edit: - ddlMode.FindItemByValue("EDIT").Selected = true; + this.ddlMode.FindItemByValue("EDIT").Selected = true; break; case PortalSettings.Mode.Layout: - ddlMode.FindItemByValue("LAYOUT").Selected = true; + this.ddlMode.FindItemByValue("LAYOUT").Selected = true; break; } } private void RemoveModeDropDownItem(string value) { - var item = ddlMode.FindItemByValue(value); + var item = this.ddlMode.FindItemByValue(value); if (item != null) { - ddlMode.Items.Remove(item); + this.ddlMode.Items.Remove(item); } } @@ -105,7 +105,7 @@ private void SetLanguage(bool update) { if (update) { - DotNetNuke.Services.Personalization.Personalization.SetProfile("Usability", "UICulture", ddlUICulture.SelectedValue); + DotNetNuke.Services.Personalization.Personalization.SetProfile("Usability", "UICulture", this.ddlUICulture.SelectedValue); } } @@ -113,27 +113,27 @@ protected string GetButtonConfirmMessage(string toolName) { if (toolName == "DeletePage") { - return ClientAPI.GetSafeJSString(Localization.GetString("Tool.DeletePage.Confirm", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool.DeletePage.Confirm", this.LocalResourceFile)); } if (toolName == "CopyPermissionsToChildren") { if (PortalSecurity.IsInRole("Administrators")) { - return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyPermissionsToChildren.Confirm", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyPermissionsToChildren.Confirm", this.LocalResourceFile)); } - return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyPermissionsToChildrenPageEditor.Confirm", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyPermissionsToChildrenPageEditor.Confirm", this.LocalResourceFile)); } if (toolName == "CopyDesignToChildren") { if (PortalSecurity.IsInRole("Administrators")) { - return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyDesignToChildren.Confirm", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyDesignToChildren.Confirm", this.LocalResourceFile)); } - return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyDesignToChildrenPageEditor.Confirm", LocalResourceFile)); + return ClientAPI.GetSafeJSString(Localization.GetString("Tool.CopyDesignToChildrenPageEditor.Confirm", this.LocalResourceFile)); } return string.Empty; @@ -142,8 +142,8 @@ protected string GetButtonConfirmMessage(string toolName) protected void DetermineNodesToInclude(object sender, EventArgs e) { var skinObject = (Web.DDRMenu.SkinObject)sender; - string admin = StripLocalizationPrefix(Localization.GetString("//Admin.String", Localization.GlobalResourceFile)).Trim(); - string host = StripLocalizationPrefix(Localization.GetString("//Host.String", Localization.GlobalResourceFile)).Trim(); + string admin = this.StripLocalizationPrefix(Localization.GetString("//Admin.String", Localization.GlobalResourceFile)).Trim(); + string host = this.StripLocalizationPrefix(Localization.GetString("//Host.String", Localization.GlobalResourceFile)).Trim(); skinObject.IncludeNodes = admin + ", " + host; @@ -169,22 +169,22 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - ID = "RibbonBar"; + this.ID = "RibbonBar"; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - ddlMode.SelectedIndexChanged += ddlMode_SelectedIndexChanged; - ddlUICulture.SelectedIndexChanged += ddlUICulture_SelectedIndexChanged; + this.ddlMode.SelectedIndexChanged += this.ddlMode_SelectedIndexChanged; + this.ddlUICulture.SelectedIndexChanged += this.ddlUICulture_SelectedIndexChanged; try { - AdminPanel.Visible = false; - AdvancedToolsPanel.Visible = false; + this.AdminPanel.Visible = false; + this.AdvancedToolsPanel.Visible = false; - if (ControlPanel.Visible && IncludeInControlHierarchy) + if (this.ControlPanel.Visible && this.IncludeInControlHierarchy) { ClientResourceManager.RegisterStyleSheet(this.Page, "~/admin/ControlPanel/module.css"); ClientResourceManager.RegisterScript(this.Page, "~/Resources/ControlPanel/ControlPanel.debug.js"); @@ -192,74 +192,74 @@ protected override void OnLoad(EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); - Control copyPageButton = CurrentPagePanel.FindControl("CopyPage"); + Control copyPageButton = this.CurrentPagePanel.FindControl("CopyPage"); if ((copyPageButton != null)) { - copyPageButton.Visible = LocaleController.Instance.IsDefaultLanguage(LocaleController.Instance.GetCurrentLocale(PortalSettings.PortalId).Code); + copyPageButton.Visible = LocaleController.Instance.IsDefaultLanguage(LocaleController.Instance.GetCurrentLocale(this.PortalSettings.PortalId).Code); } - if ((Request.IsAuthenticated)) + if ((this.Request.IsAuthenticated)) { UserInfo user = UserController.Instance.GetCurrentUserInfo(); if (((user != null))) { bool isAdmin = user.IsInRole(PortalSettings.Current.AdministratorRoleName); - AdminPanel.Visible = isAdmin; + this.AdminPanel.Visible = isAdmin; } } - if (IsPageAdmin()) + if (this.IsPageAdmin()) { - ControlPanel.Visible = true; - BodyPanel.Visible = true; + this.ControlPanel.Visible = true; + this.BodyPanel.Visible = true; if ((DotNetNukeContext.Current.Application.Name == "DNNCORP.CE")) { //Hide Support icon in CE - AdminPanel.FindControl("SupportTickets").Visible = false; + this.AdminPanel.FindControl("SupportTickets").Visible = false; } else { //Show PE/XE tools - AdvancedToolsPanel.Visible = true; + this.AdvancedToolsPanel.Visible = true; } - Localize(); + this.Localize(); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { UserInfo objUser = UserController.Instance.GetCurrentUserInfo(); if ((objUser != null)) { if (objUser.IsSuperUser) { - hypMessage.ImageUrl = Upgrade.UpgradeIndicator(DotNetNukeContext.Current.Application.Version, Request.IsLocal, Request.IsSecureConnection); - if (!string.IsNullOrEmpty(hypMessage.ImageUrl)) + this.hypMessage.ImageUrl = Upgrade.UpgradeIndicator(DotNetNukeContext.Current.Application.Version, this.Request.IsLocal, this.Request.IsSecureConnection); + if (!string.IsNullOrEmpty(this.hypMessage.ImageUrl)) { - hypMessage.ToolTip = Localization.GetString("hypUpgrade.Text", LocalResourceFile); - hypMessage.NavigateUrl = Upgrade.UpgradeRedirect(); + this.hypMessage.ToolTip = Localization.GetString("hypUpgrade.Text", this.LocalResourceFile); + this.hypMessage.NavigateUrl = Upgrade.UpgradeRedirect(); } } else { - if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) && Host.DisplayCopyright) + if (PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName) && Host.DisplayCopyright) { - hypMessage.ImageUrl = "~/images/branding/iconbar_logo.png"; - hypMessage.ToolTip = DotNetNukeContext.Current.Application.Description; - hypMessage.NavigateUrl = Localization.GetString("hypMessageUrl.Text", LocalResourceFile); + this.hypMessage.ImageUrl = "~/images/branding/iconbar_logo.png"; + this.hypMessage.ToolTip = DotNetNukeContext.Current.Application.Description; + this.hypMessage.NavigateUrl = Localization.GetString("hypMessageUrl.Text", this.LocalResourceFile); } else { - hypMessage.Visible = false; + this.hypMessage.Visible = false; } if (!TabPermissionController.CanAddContentToPage()) { - CommonTasksPanel.Visible = false; + this.CommonTasksPanel.Visible = false; } } - if (PortalSettings.AllowUserUICulture) + if (this.PortalSettings.AllowUserUICulture) { object oCulture = DotNetNuke.Services.Personalization.Personalization.GetProfile("Usability", "UICulture"); string currentCulture; @@ -276,44 +276,44 @@ protected override void OnLoad(EventArgs e) IEnumerable cultureListItems = Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, currentCulture, "", false); foreach (var cultureItem in cultureListItems) { - ddlUICulture.AddItem(cultureItem.Text, cultureItem.Value); + this.ddlUICulture.AddItem(cultureItem.Text, cultureItem.Value); } - var selectedCultureItem = ddlUICulture.FindItemByValue(currentCulture); + var selectedCultureItem = this.ddlUICulture.FindItemByValue(currentCulture); if (selectedCultureItem != null) { selectedCultureItem.Selected = true; } //only show language selector if more than one language - if (ddlUICulture.Items.Count > 1) + if (this.ddlUICulture.Items.Count > 1) { - lblUILanguage.Visible = true; - ddlUICulture.Visible = true; + this.lblUILanguage.Visible = true; + this.ddlUICulture.Visible = true; if (oCulture == null) { - SetLanguage(true); + this.SetLanguage(true); } } } } - SetMode(false); + this.SetMode(false); } } - else if (IsModuleAdmin()) + else if (this.IsModuleAdmin()) { - ControlPanel.Visible = true; - BodyPanel.Visible = false; - adminMenus.Visible = false; - if (!Page.IsPostBack) + this.ControlPanel.Visible = true; + this.BodyPanel.Visible = false; + this.adminMenus.Visible = false; + if (!this.Page.IsPostBack) { - SetMode(false); + this.SetMode(false); } } else { - ControlPanel.Visible = false; + this.ControlPanel.Visible = false; } } catch (Exception exc) @@ -324,22 +324,22 @@ protected override void OnLoad(EventArgs e) protected void ddlMode_SelectedIndexChanged(object sender, EventArgs e) { - if (Page.IsCallback) + if (this.Page.IsCallback) { return; } - SetMode(true); - Response.Redirect(Request.RawUrl, true); + this.SetMode(true); + this.Response.Redirect(this.Request.RawUrl, true); } private void ddlUICulture_SelectedIndexChanged(object sender, EventArgs e) { - if (Page.IsCallback) + if (this.Page.IsCallback) { return; } - SetLanguage(true); - Response.Redirect(Request.RawUrl, true); + this.SetLanguage(true); + this.Response.Redirect(this.Request.RawUrl, true); } #endregion @@ -349,13 +349,13 @@ private void ddlUICulture_SelectedIndexChanged(object sender, EventArgs e) protected string PreviewPopup() { var previewUrl = string.Format("{0}/Default.aspx?ctl={1}&previewTab={2}&TabID={2}", - Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias), + Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias), "MobilePreview", - PortalSettings.ActiveTab.TabID); + this.PortalSettings.ActiveTab.TabID); - if(PortalSettings.EnablePopUps) + if(this.PortalSettings.EnablePopUps) { - return UrlUtils.PopUpUrl(previewUrl, this, PortalSettings, true, false, 660, 800); + return UrlUtils.PopUpUrl(previewUrl, this, this.PortalSettings, true, false, 660, 800); } else { diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/SwitchSite.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/SwitchSite.ascx.cs index d825ce7e37b..34d1ddef6ed 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/SwitchSite.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/SwitchSite.ascx.cs @@ -30,13 +30,13 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdSwitch.Click += CmdSwitchClick; + this.cmdSwitch.Click += this.CmdSwitchClick; try { - if (Visible && !IsPostBack) + if (this.Visible && !this.IsPostBack) { - LoadPortalsList(); + this.LoadPortalsList(); } } catch (Exception exc) @@ -49,14 +49,14 @@ protected void CmdSwitchClick(object sender, EventArgs e) { try { - if ((!string.IsNullOrEmpty(SitesLst.SelectedValue))) + if ((!string.IsNullOrEmpty(this.SitesLst.SelectedValue))) { - int selectedPortalID = int.Parse(SitesLst.SelectedValue); + int selectedPortalID = int.Parse(this.SitesLst.SelectedValue); var portalAliases = PortalAliasController.Instance.GetPortalAliasesByPortalId(selectedPortalID).ToList(); if ((portalAliases.Count > 0 && (portalAliases[0] != null))) { - Response.Redirect(Globals.AddHTTP(((PortalAliasInfo) portalAliases[0]).HTTPAlias)); + this.Response.Redirect(Globals.AddHTTP(((PortalAliasInfo) portalAliases[0]).HTTPAlias)); } } } @@ -110,16 +110,16 @@ private void LoadPortalsList() { var portals = PortalController.Instance.GetPortals(); - SitesLst.ClearSelection(); - SitesLst.Items.Clear(); + this.SitesLst.ClearSelection(); + this.SitesLst.Items.Clear(); - SitesLst.DataSource = portals; - SitesLst.DataTextField = "PortalName"; - SitesLst.DataValueField = "PortalID"; - SitesLst.DataBind(); + this.SitesLst.DataSource = portals; + this.SitesLst.DataTextField = "PortalName"; + this.SitesLst.DataValueField = "PortalID"; + this.SitesLst.DataBind(); //SitesLst.Items.Insert(0, new ListItem(string.Empty)); - SitesLst.InsertItem(0, string.Empty, string.Empty); + this.SitesLst.InsertItem(0, string.Empty, string.Empty); } #endregion diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs index 1324fbea63c..05234170b28 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/UpdatePage.ascx.cs @@ -36,7 +36,7 @@ public partial class UpdatePage : UserControl, IDnnRibbonBarTool private readonly INavigationManager _navigationManager; public UpdatePage() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Event Handlers" @@ -45,19 +45,19 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdUpdate.Click += CmdUpdateClick; + this.cmdUpdate.Click += this.CmdUpdateClick; try { - if (Visible && !IsPostBack) + if (this.Visible && !this.IsPostBack) { - Name.Text = CurrentTab.TabName; - IncludeInMenu.Checked = CurrentTab.IsVisible; - IsDisabled.Checked = CurrentTab.DisableLink; - IsSecurePanel.Visible = PortalSettings.SSLEnabled; - IsSecure.Enabled = PortalSettings.SSLEnabled; - IsSecure.Checked = CurrentTab.IsSecure; - LoadAllLists(); + this.Name.Text = this.CurrentTab.TabName; + this.IncludeInMenu.Checked = this.CurrentTab.IsVisible; + this.IsDisabled.Checked = this.CurrentTab.DisableLink; + this.IsSecurePanel.Visible = PortalSettings.SSLEnabled; + this.IsSecure.Enabled = PortalSettings.SSLEnabled; + this.IsSecure.Checked = this.CurrentTab.IsSecure; + this.LoadAllLists(); } } catch (Exception exc) @@ -71,25 +71,25 @@ protected void CmdUpdateClick(object sender, EventArgs e) if ((TabPermissionController.CanManagePage())) { TabInfo selectedTab = null; - if ((!string.IsNullOrEmpty(PageLst.SelectedValue))) + if ((!string.IsNullOrEmpty(this.PageLst.SelectedValue))) { - int selectedTabID = Int32.Parse(PageLst.SelectedValue); + int selectedTabID = Int32.Parse(this.PageLst.SelectedValue); selectedTab = TabController.Instance.GetTab(selectedTabID, PortalSettings.ActiveTab.PortalID, false); } TabRelativeLocation tabLocation = TabRelativeLocation.NOTSET; - if ((!string.IsNullOrEmpty(LocationLst.SelectedValue))) + if ((!string.IsNullOrEmpty(this.LocationLst.SelectedValue))) { - tabLocation = (TabRelativeLocation) Enum.Parse(typeof (TabRelativeLocation), LocationLst.SelectedValue); + tabLocation = (TabRelativeLocation) Enum.Parse(typeof (TabRelativeLocation), this.LocationLst.SelectedValue); } - TabInfo tab = CurrentTab; + TabInfo tab = this.CurrentTab; - tab.TabName = Name.Text; - tab.IsVisible = IncludeInMenu.Checked; - tab.DisableLink = IsDisabled.Checked; - tab.IsSecure = IsSecure.Checked; - tab.SkinSrc = SkinLst.SelectedValue; + tab.TabName = this.Name.Text; + tab.IsVisible = this.IncludeInMenu.Checked; + tab.DisableLink = this.IsDisabled.Checked; + tab.IsSecure = this.IsSecure.Checked; + tab.SkinSrc = this.SkinLst.SelectedValue; string errMsg = ""; try @@ -99,7 +99,7 @@ protected void CmdUpdateClick(object sender, EventArgs e) catch (DotNetNukeException ex) { Exceptions.LogException(ex); - errMsg = (ex.ErrorCode != DotNetNukeErrorCode.NotSet) ? GetString("Err." + ex.ErrorCode) : ex.Message; + errMsg = (ex.ErrorCode != DotNetNukeErrorCode.NotSet) ? this.GetString("Err." + ex.ErrorCode) : ex.Message; } catch (Exception ex) { @@ -119,12 +119,12 @@ protected void CmdUpdateClick(object sender, EventArgs e) if ((string.IsNullOrEmpty(errMsg))) { - Response.Redirect(_navigationManager.NavigateURL(tab.TabID)); + this.Response.Redirect(this._navigationManager.NavigateURL(tab.TabID)); } else { - errMsg = string.Format("

    {0}

    {1}

    ", GetString("Err.Header"), errMsg); - Web.UI.Utilities.RegisterAlertOnPageLoad(this, new MessageWindowParameters(errMsg) { Title = GetString("Err.Title") }); + errMsg = string.Format("

    {0}

    {1}

    ", this.GetString("Err.Header"), errMsg); + Web.UI.Utilities.RegisterAlertOnPageLoad(this, new MessageWindowParameters(errMsg) { Title = this.GetString("Err.Title") }); } } } @@ -168,11 +168,11 @@ private TabInfo CurrentTab get { //Weird - but the activetab has different skin src value than getting from the db - if (((_currentTab == null))) + if (((this._currentTab == null))) { - _currentTab = TabController.Instance.GetTab(PortalSettings.ActiveTab.TabID, PortalSettings.ActiveTab.PortalID, false); + this._currentTab = TabController.Instance.GetTab(PortalSettings.ActiveTab.TabID, PortalSettings.ActiveTab.PortalID, false); } - return _currentTab; + return this._currentTab; } } @@ -180,7 +180,7 @@ private string LocalResourceFile { get { - return string.Format("{0}/{1}/{2}.ascx.resx", TemplateSourceDirectory, Localization.LocalResourceDirectory, GetType().BaseType.Name); + return string.Format("{0}/{1}/{2}.ascx.resx", this.TemplateSourceDirectory, Localization.LocalResourceDirectory, this.GetType().BaseType.Name); } } @@ -194,26 +194,26 @@ private static PortalSettings PortalSettings private void LoadAllLists() { - LocationLst.Enabled = RibbonBarManager.CanMovePage(); - PageLst.Enabled = RibbonBarManager.CanMovePage(); - if ((LocationLst.Enabled)) + this.LocationLst.Enabled = RibbonBarManager.CanMovePage(); + this.PageLst.Enabled = RibbonBarManager.CanMovePage(); + if ((this.LocationLst.Enabled)) { - LoadLocationList(); - LoadPageList(); + this.LoadLocationList(); + this.LoadPageList(); } - LoadSkinList(); + this.LoadSkinList(); } private void LoadSkinList() { - SkinLst.ClearSelection(); - SkinLst.Items.Clear(); - SkinLst.Items.Add(new RadComboBoxItem(GetString("DefaultSkin"), string.Empty)); + this.SkinLst.ClearSelection(); + this.SkinLst.Items.Clear(); + this.SkinLst.Items.Add(new RadComboBoxItem(this.GetString("DefaultSkin"), string.Empty)); // load portal skins - var portalSkinsHeader = new RadComboBoxItem(GetString("PortalSkins"), string.Empty) {Enabled = false, CssClass = "SkinListHeader"}; - SkinLst.Items.Add(portalSkinsHeader); + var portalSkinsHeader = new RadComboBoxItem(this.GetString("PortalSkins"), string.Empty) {Enabled = false, CssClass = "SkinListHeader"}; + this.SkinLst.Items.Add(portalSkinsHeader); string[] arrFolders; string[] arrFiles; @@ -232,25 +232,25 @@ private void LoadSkinList() { if (!string.IsNullOrEmpty(strLastFolder)) { - SkinLst.Items.Add(GetSeparatorItem()); + this.SkinLst.Items.Add(this.GetSeparatorItem()); } strLastFolder = folder; } - SkinLst.Items.Add(new RadComboBoxItem(FormatSkinName(folder, Path.GetFileNameWithoutExtension(strFile)), + this.SkinLst.Items.Add(new RadComboBoxItem(FormatSkinName(folder, Path.GetFileNameWithoutExtension(strFile)), "[L]" + SkinController.RootSkin + "/" + folder + "/" + Path.GetFileName(strFile))); } } } //No portal skins added, remove the header - if ((SkinLst.Items.Count == 2)) + if ((this.SkinLst.Items.Count == 2)) { - SkinLst.Items.Remove(1); + this.SkinLst.Items.Remove(1); } //load host skins - var hostSkinsHeader = new RadComboBoxItem(GetString("HostSkins"), string.Empty) {Enabled = false, CssClass = "SkinListHeader"}; - SkinLst.Items.Add(hostSkinsHeader); + var hostSkinsHeader = new RadComboBoxItem(this.GetString("HostSkins"), string.Empty) {Enabled = false, CssClass = "SkinListHeader"}; + this.SkinLst.Items.Add(hostSkinsHeader); strRoot = Globals.HostMapPath + SkinController.RootSkin; if (Directory.Exists(strRoot)) @@ -268,11 +268,11 @@ private void LoadSkinList() { if (!string.IsNullOrEmpty(strLastFolder)) { - SkinLst.Items.Add(GetSeparatorItem()); + this.SkinLst.Items.Add(this.GetSeparatorItem()); } strLastFolder = folder; } - SkinLst.Items.Add(new RadComboBoxItem(FormatSkinName(folder, Path.GetFileNameWithoutExtension(strFile)), + this.SkinLst.Items.Add(new RadComboBoxItem(FormatSkinName(folder, Path.GetFileNameWithoutExtension(strFile)), "[G]" + SkinController.RootSkin + "/" + folder + "/" + Path.GetFileName(strFile))); } } @@ -280,10 +280,10 @@ private void LoadSkinList() } //Set the selected item - SkinLst.SelectedIndex = 0; - if ((!string.IsNullOrEmpty(CurrentTab.SkinSrc))) + this.SkinLst.SelectedIndex = 0; + if ((!string.IsNullOrEmpty(this.CurrentTab.SkinSrc))) { - RadComboBoxItem selectItem = SkinLst.FindItemByValue(CurrentTab.SkinSrc); + RadComboBoxItem selectItem = this.SkinLst.FindItemByValue(this.CurrentTab.SkinSrc); if (((selectItem != null))) { selectItem.Selected = true; @@ -293,7 +293,7 @@ private void LoadSkinList() private RadComboBoxItem GetSeparatorItem() { - return new RadComboBoxItem(GetString("SkinLstSeparator"), string.Empty) {CssClass = "SkinLstSeparator", Enabled = false}; + return new RadComboBoxItem(this.GetString("SkinLstSeparator"), string.Empty) {CssClass = "SkinLstSeparator", Enabled = false}; } private static string FormatSkinName(string strSkinFolder, string strSkinFile) @@ -315,40 +315,40 @@ private static string FormatSkinName(string strSkinFolder, string strSkinFile) private void LoadLocationList() { - LocationLst.ClearSelection(); - LocationLst.Items.Clear(); + this.LocationLst.ClearSelection(); + this.LocationLst.Items.Clear(); //LocationLst.Items.Add(new ListItem(GetString("NoLocationSelection"), "")); //LocationLst.Items.Add(new ListItem(GetString("Before"), "BEFORE")); //LocationLst.Items.Add(new ListItem(GetString("After"), "AFTER")); //LocationLst.Items.Add(new ListItem(GetString("Child"), "CHILD")); - LocationLst.AddItem(GetString("NoLocationSelection"), ""); - LocationLst.AddItem(GetString("Before"), "BEFORE"); - LocationLst.AddItem(GetString("After"), "AFTER"); - LocationLst.AddItem(GetString("Child"), "CHILD"); + this.LocationLst.AddItem(this.GetString("NoLocationSelection"), ""); + this.LocationLst.AddItem(this.GetString("Before"), "BEFORE"); + this.LocationLst.AddItem(this.GetString("After"), "AFTER"); + this.LocationLst.AddItem(this.GetString("Child"), "CHILD"); - LocationLst.SelectedIndex = 0; + this.LocationLst.SelectedIndex = 0; } private void LoadPageList() { - PageLst.ClearSelection(); - PageLst.Items.Clear(); + this.PageLst.ClearSelection(); + this.PageLst.Items.Clear(); - PageLst.DataTextField = "IndentedTabName"; - PageLst.DataValueField = "TabID"; - PageLst.DataSource = RibbonBarManager.GetPagesList().Where(t => !IsParentTab(t, CurrentTab.TabID)); - PageLst.DataBind(); + this.PageLst.DataTextField = "IndentedTabName"; + this.PageLst.DataValueField = "TabID"; + this.PageLst.DataSource = RibbonBarManager.GetPagesList().Where(t => !this.IsParentTab(t, this.CurrentTab.TabID)); + this.PageLst.DataBind(); //PageLst.Items.Insert(0, new ListItem(GetString("NoPageSelection"), string.Empty)); - PageLst.InsertItem(0, GetString("NoPageSelection"), string.Empty); - PageLst.SelectedIndex = 0; + this.PageLst.InsertItem(0, this.GetString("NoPageSelection"), string.Empty); + this.PageLst.SelectedIndex = 0; } private string GetString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } private bool IsParentTab(TabInfo tab, int parentTabId) diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs index 805034c1e56..038f6827f2e 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs +++ b/DNN Platform/DotNetNuke.Website.Deprecated/admin/ControlPanel/WebUpload.ascx.cs @@ -49,7 +49,7 @@ public partial class WebUpload : PortalModuleBase private readonly INavigationManager _navigationManager; public WebUpload() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region "Members" @@ -67,15 +67,15 @@ public string DestinationFolder { get { - if (_DestinationFolder == null) + if (this._DestinationFolder == null) { - _DestinationFolder = string.Empty; - if ((Request.QueryString["dest"] != null)) + this._DestinationFolder = string.Empty; + if ((this.Request.QueryString["dest"] != null)) { - _DestinationFolder = Globals.QueryStringDecode(Request.QueryString["dest"]); + this._DestinationFolder = Globals.QueryStringDecode(this.Request.QueryString["dest"]); } } - return PathUtils.Instance.RemoveTrailingSlash(_DestinationFolder.Replace("\\", "/")); + return PathUtils.Instance.RemoveTrailingSlash(this._DestinationFolder.Replace("\\", "/")); } } @@ -83,18 +83,18 @@ public UploadType FileType { get { - _FileType = UploadType.File; - if ((Request.QueryString["ftype"] != null)) + this._FileType = UploadType.File; + if ((this.Request.QueryString["ftype"] != null)) { //The select statement ensures that the parameter can be converted to UploadType - switch (Request.QueryString["ftype"].ToLowerInvariant()) + switch (this.Request.QueryString["ftype"].ToLowerInvariant()) { case "file": - _FileType = (UploadType) Enum.Parse(typeof (UploadType), Request.QueryString["ftype"]); + this._FileType = (UploadType) Enum.Parse(typeof (UploadType), this.Request.QueryString["ftype"]); break; } } - return _FileType; + return this._FileType; } } @@ -102,11 +102,11 @@ public string FileTypeName { get { - if (_FileTypeName == null) + if (this._FileTypeName == null) { - _FileTypeName = Localization.GetString(FileType.ToString(), LocalResourceFile); + this._FileTypeName = Localization.GetString(this.FileType.ToString(), this.LocalResourceFile); } - return _FileTypeName; + return this._FileTypeName; } } @@ -114,13 +114,13 @@ public int FolderPortalID { get { - if (IsHostMenu) + if (this.IsHostMenu) { return Null.NullInteger; } else { - return PortalId; + return this.PortalId; } } } @@ -129,18 +129,18 @@ public string RootFolder { get { - if (_RootFolder == null) + if (this._RootFolder == null) { - if (IsHostMenu) + if (this.IsHostMenu) { - _RootFolder = Globals.HostMapPath; + this._RootFolder = Globals.HostMapPath; } else { - _RootFolder = PortalSettings.HomeDirectoryMapPath; + this._RootFolder = this.PortalSettings.HomeDirectoryMapPath; } } - return _RootFolder; + return this._RootFolder; } } @@ -148,16 +148,16 @@ public string UploadRoles { get { - if (_UploadRoles == null) + if (this._UploadRoles == null) { - _UploadRoles = string.Empty; + this._UploadRoles = string.Empty; - if (Convert.ToString(Settings["uploadroles"]) != null) + if (Convert.ToString(this.Settings["uploadroles"]) != null) { - _UploadRoles = Convert.ToString(Settings["uploadroles"]); + this._UploadRoles = Convert.ToString(this.Settings["uploadroles"]); } } - return _UploadRoles; + return this._UploadRoles; } } @@ -174,9 +174,9 @@ public string UploadRoles /// ----------------------------------------------------------------------------- private void CheckSecurity() { - if (!ModulePermissionController.HasModulePermission(ModuleConfiguration.ModulePermissions, "CONTENT,EDIT") && !UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators")) + if (!ModulePermissionController.HasModulePermission(this.ModuleConfiguration.ModulePermissions, "CONTENT,EDIT") && !UserController.Instance.GetCurrentUserInfo().IsInRole("Administrators")) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } } @@ -192,18 +192,18 @@ private void LoadFolders() { var user = UserController.Instance.GetCurrentUserInfo(); - var folders = FolderManager.Instance.GetFolders(FolderPortalID, "ADD", user.UserID); - ddlFolders.Services.Parameters.Add("permission", "ADD"); - if (!String.IsNullOrEmpty(DestinationFolder)) + var folders = FolderManager.Instance.GetFolders(this.FolderPortalID, "ADD", user.UserID); + this.ddlFolders.Services.Parameters.Add("permission", "ADD"); + if (!String.IsNullOrEmpty(this.DestinationFolder)) { - ddlFolders.SelectedFolder = folders.SingleOrDefault(f => f.FolderPath == DestinationFolder); + this.ddlFolders.SelectedFolder = folders.SingleOrDefault(f => f.FolderPath == this.DestinationFolder); } else { var rootFolder = folders.SingleOrDefault(f => f.FolderPath == ""); if (rootFolder != null) { - ddlFolders.SelectedItem = new ListItem() { Text = DynamicSharedConstants.RootFolder, Value = rootFolder.FolderID.ToString() }; + this.ddlFolders.SelectedItem = new ListItem() { Text = DynamicSharedConstants.RootFolder, Value = rootFolder.FolderID.ToString() }; } } } @@ -221,13 +221,13 @@ private void LoadFolders() /// ----------------------------------------------------------------------------- public string ReturnURL() { - int TabID = PortalSettings.HomeTabId; + int TabID = this.PortalSettings.HomeTabId; - if (Request.Params["rtab"] != null) + if (this.Request.Params["rtab"] != null) { - TabID = int.Parse(Request.Params["rtab"]); + TabID = int.Parse(this.Request.Params["rtab"]); } - return _navigationManager.NavigateURL(TabID); + return this._navigationManager.NavigateURL(TabID); } protected override void OnInit(EventArgs e) @@ -235,7 +235,7 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //Customise the Control Title - ModuleConfiguration.ModuleTitle = Localization.GetString("UploadType" + FileType, LocalResourceFile); + this.ModuleConfiguration.ModuleTitle = Localization.GetString("UploadType" + this.FileType, this.LocalResourceFile); } /// ----------------------------------------------------------------------------- @@ -250,42 +250,42 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdAdd.Click += cmdAdd_Click; - cmdReturn1.Click += cmdReturn_Click; - cmdReturn2.Click += cmdReturn_Click; + this.cmdAdd.Click += this.cmdAdd_Click; + this.cmdReturn1.Click += this.cmdReturn_Click; + this.cmdReturn2.Click += this.cmdReturn_Click; try { - CheckSecurity(); + this.CheckSecurity(); //Get localized Strings - string strHost = Localization.GetString("HostRoot", LocalResourceFile); - string strPortal = Localization.GetString("PortalRoot", LocalResourceFile); + string strHost = Localization.GetString("HostRoot", this.LocalResourceFile); + string strPortal = Localization.GetString("PortalRoot", this.LocalResourceFile); - maxSizeWarningLabel.Text = String.Format(Localization.GetString("FileSizeRestriction", LocalResourceFile), (Config.GetMaxUploadSize()/(1024 *1024))); + this.maxSizeWarningLabel.Text = String.Format(Localization.GetString("FileSizeRestriction", this.LocalResourceFile), (Config.GetMaxUploadSize()/(1024 *1024))); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - cmdAdd.Text = Localization.GetString("UploadType" + FileType, LocalResourceFile); - if (FileType == UploadType.File) + this.cmdAdd.Text = Localization.GetString("UploadType" + this.FileType, this.LocalResourceFile); + if (this.FileType == UploadType.File) { - foldersRow.Visible = true; - rootRow.Visible = true; - unzipRow.Visible = true; + this.foldersRow.Visible = true; + this.rootRow.Visible = true; + this.unzipRow.Visible = true; - if (IsHostMenu) + if (this.IsHostMenu) { - lblRootType.Text = strHost + ":"; - lblRootFolder.Text = RootFolder; + this.lblRootType.Text = strHost + ":"; + this.lblRootFolder.Text = this.RootFolder; } else { - lblRootType.Text = strPortal + ":"; - lblRootFolder.Text = RootFolder; + this.lblRootType.Text = strPortal + ":"; + this.lblRootFolder.Text = this.RootFolder; } - LoadFolders(); + this.LoadFolders(); } - chkUnzip.Checked = false; + this.chkUnzip.Checked = false; } } catch (Exception exc) //Module failed to load @@ -307,25 +307,25 @@ private void cmdAdd_Click(object sender, EventArgs e) { try { - CheckSecurity(); + this.CheckSecurity(); var strMessage = ""; - var postedFile = cmdBrowse.PostedFile; + var postedFile = this.cmdBrowse.PostedFile; //Get localized Strings - Localization.GetString("InvalidExt", LocalResourceFile); + Localization.GetString("InvalidExt", this.LocalResourceFile); var strFileName = Path.GetFileName(postedFile.FileName); if (!String.IsNullOrEmpty(postedFile.FileName)) { - switch (FileType) + switch (this.FileType) { case UploadType.File: //content files try { - var folder = FolderManager.Instance.GetFolder(ddlFolders.SelectedItemValueAsInt); + var folder = FolderManager.Instance.GetFolder(this.ddlFolders.SelectedItemValueAsInt); var fileManager = Services.FileSystem.FileManager.Instance; var file = fileManager.AddFile(folder, strFileName, postedFile.InputStream, true, true, postedFile.ContentType); - if (chkUnzip.Checked && file.Extension == "zip") + if (this.chkUnzip.Checked && file.Extension == "zip") { fileManager.UnzipFile(file, folder); } @@ -333,7 +333,7 @@ private void cmdAdd_Click(object sender, EventArgs e) catch (PermissionsNotMetException exc) { Logger.Warn(exc); - strMessage += "
    " + string.Format(Localization.GetString("InsufficientFolderPermission"), ddlFolders.SelectedItemValueAsInt); + strMessage += "
    " + string.Format(Localization.GetString("InsufficientFolderPermission"), this.ddlFolders.SelectedItemValueAsInt); } catch (NoSpaceAvailableException exc) { @@ -355,19 +355,19 @@ private void cmdAdd_Click(object sender, EventArgs e) } else { - strMessage = Localization.GetString("NoFile", LocalResourceFile); + strMessage = Localization.GetString("NoFile", this.LocalResourceFile); } - if (phPaLogs.Controls.Count > 0) + if (this.phPaLogs.Controls.Count > 0) { - tblLogs.Visible = true; + this.tblLogs.Visible = true; } else if (String.IsNullOrEmpty(strMessage)) { - Skin.AddModuleMessage(this, String.Format(Localization.GetString("FileUploadSuccess", LocalResourceFile), strFileName), ModuleMessage.ModuleMessageType.GreenSuccess); + Skin.AddModuleMessage(this, String.Format(Localization.GetString("FileUploadSuccess", this.LocalResourceFile), strFileName), ModuleMessage.ModuleMessageType.GreenSuccess); } else { - lblMessage.Text = strMessage; + this.lblMessage.Text = strMessage; } } catch (Exception exc) //Module failed to load @@ -387,7 +387,7 @@ private void cmdAdd_Click(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cmdReturn_Click(Object sender, EventArgs e) { - Response.Redirect(ReturnURL(), true); + this.Response.Redirect(this.ReturnURL(), true); } #endregion diff --git a/DNN Platform/DotNetNuke.Website.Deprecated/packages.config b/DNN Platform/DotNetNuke.Website.Deprecated/packages.config index 015e7e36813..4fca05e5f8c 100644 --- a/DNN Platform/DotNetNuke.Website.Deprecated/packages.config +++ b/DNN Platform/DotNetNuke.Website.Deprecated/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngine.cs b/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngine.cs index a75d83a3511..a5b73499498 100644 --- a/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngine.cs +++ b/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngine.cs @@ -22,11 +22,11 @@ public string EngineType { get { - return _engineType; + return this._engineType; } set { - _engineType = value; + this._engineType = value; } } @@ -34,11 +34,11 @@ public string ScriptTemplate { get { - return _scriptTemplate; + return this._scriptTemplate; } set { - _scriptTemplate = value; + this._scriptTemplate = value; } } @@ -46,11 +46,11 @@ public string ElementId { get { - return _elementId; + return this._elementId; } set { - _elementId = value; + this._elementId = value; } } @@ -58,11 +58,11 @@ public bool InjectTop { get { - return _injectTop; + return this._injectTop; } set { - _injectTop = value; + this._injectTop = value; } } } diff --git a/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineCollection.cs b/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineCollection.cs index 83786e35d04..39fcc266d54 100644 --- a/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineCollection.cs +++ b/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineCollection.cs @@ -28,7 +28,7 @@ public virtual AnalyticsEngine this[int index] public void Add(AnalyticsEngine a) { - InnerList.Add(a); + this.InnerList.Add(a); } } } diff --git a/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineConfiguration.cs b/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineConfiguration.cs index 42f820fa3f8..060ff80265a 100644 --- a/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineConfiguration.cs +++ b/DNN Platform/HttpModules/Analytics/Config/AnalyticsEngineConfiguration.cs @@ -40,11 +40,11 @@ public AnalyticsEngineCollection AnalyticsEngines { get { - return _analyticsEngines; + return this._analyticsEngines; } set { - _analyticsEngines = value; + this._analyticsEngines = value; } } diff --git a/DNN Platform/HttpModules/Compression/Config/Settings.cs b/DNN Platform/HttpModules/Compression/Config/Settings.cs index 5490344640c..837de4d7db6 100644 --- a/DNN Platform/HttpModules/Compression/Config/Settings.cs +++ b/DNN Platform/HttpModules/Compression/Config/Settings.cs @@ -29,8 +29,8 @@ public class Settings private Settings() { - _preferredAlgorithm = Algorithms.None; - _excludedPaths = new StringCollection(); + this._preferredAlgorithm = Algorithms.None; + this._excludedPaths = new StringCollection(); } /// @@ -51,7 +51,7 @@ public Algorithms PreferredAlgorithm { get { - return _preferredAlgorithm; + return this._preferredAlgorithm; } } @@ -102,7 +102,7 @@ public static Settings GetSettings() public bool IsExcludedPath(string relUrl) { bool match = false; - foreach (string path in _excludedPaths) + foreach (string path in this._excludedPaths) { if (relUrl.ToLowerInvariant().Contains(path)) { diff --git a/DNN Platform/HttpModules/Compression/Filters/CompressingFilter.cs b/DNN Platform/HttpModules/Compression/Filters/CompressingFilter.cs index e7704e8fe6f..32537bdafe6 100644 --- a/DNN Platform/HttpModules/Compression/Filters/CompressingFilter.cs +++ b/DNN Platform/HttpModules/Compression/Filters/CompressingFilter.cs @@ -48,7 +48,7 @@ protected bool HasWrittenHeaders { get { - return _HasWrittenHeaders; + return this._HasWrittenHeaders; } } @@ -60,9 +60,9 @@ internal void WriteHeaders() //this is dangerous. if Response.End is called before the filter is used, directly or indirectly, //the content will not pass through the filter. However, this header will still be appended. //Look for handling cases in PreRequestSendHeaders and Pre - HttpContext.Current.Response.AppendHeader("Content-Encoding", ContentEncoding); + HttpContext.Current.Response.AppendHeader("Content-Encoding", this.ContentEncoding); HttpContext.Current.Response.AppendHeader("X-Compressed-By", "DotNetNuke-Compression"); - _HasWrittenHeaders = true; + this._HasWrittenHeaders = true; } } } diff --git a/DNN Platform/HttpModules/Compression/Filters/DeflateFilter.cs b/DNN Platform/HttpModules/Compression/Filters/DeflateFilter.cs index d51dd675e50..25b8d04c6a3 100644 --- a/DNN Platform/HttpModules/Compression/Filters/DeflateFilter.cs +++ b/DNN Platform/HttpModules/Compression/Filters/DeflateFilter.cs @@ -20,7 +20,7 @@ public class DeflateFilter : CompressingFilter public DeflateFilter(Stream baseStream) : base(baseStream) { - m_stream = new DeflateStream(baseStream, CompressionMode.Compress); + this.m_stream = new DeflateStream(baseStream, CompressionMode.Compress); } public override string ContentEncoding @@ -33,21 +33,21 @@ public override string ContentEncoding public override void Write(byte[] buffer, int offset, int count) { - if (!HasWrittenHeaders) + if (!this.HasWrittenHeaders) { - WriteHeaders(); + this.WriteHeaders(); } - m_stream.Write(buffer, offset, count); + this.m_stream.Write(buffer, offset, count); } public override void Close() { - m_stream.Close(); + this.m_stream.Close(); } public override void Flush() { - m_stream.Flush(); + this.m_stream.Flush(); } } } diff --git a/DNN Platform/HttpModules/Compression/Filters/GZipFilter.cs b/DNN Platform/HttpModules/Compression/Filters/GZipFilter.cs index 8a864c763bf..983665a77b7 100644 --- a/DNN Platform/HttpModules/Compression/Filters/GZipFilter.cs +++ b/DNN Platform/HttpModules/Compression/Filters/GZipFilter.cs @@ -20,7 +20,7 @@ public class GZipFilter : CompressingFilter public GZipFilter(Stream baseStream) : base(baseStream) { - m_stream = new GZipStream(baseStream, CompressionMode.Compress); + this.m_stream = new GZipStream(baseStream, CompressionMode.Compress); } public override string ContentEncoding @@ -33,21 +33,21 @@ public override string ContentEncoding public override void Write(byte[] buffer, int offset, int count) { - if (!HasWrittenHeaders) + if (!this.HasWrittenHeaders) { - WriteHeaders(); + this.WriteHeaders(); } - m_stream.Write(buffer, offset, count); + this.m_stream.Write(buffer, offset, count); } public override void Close() { - m_stream.Close(); + this.m_stream.Close(); } public override void Flush() { - m_stream.Flush(); + this.m_stream.Flush(); } } } diff --git a/DNN Platform/HttpModules/Compression/Filters/HttpOutputFilter.cs b/DNN Platform/HttpModules/Compression/Filters/HttpOutputFilter.cs index f4a91944da3..d2ee10361a3 100644 --- a/DNN Platform/HttpModules/Compression/Filters/HttpOutputFilter.cs +++ b/DNN Platform/HttpModules/Compression/Filters/HttpOutputFilter.cs @@ -17,14 +17,14 @@ public abstract class HttpOutputFilter : Stream protected HttpOutputFilter(Stream baseStream) { - _sink = baseStream; + this._sink = baseStream; } protected Stream BaseStream { get { - return _sink; + return this._sink; } } @@ -48,7 +48,7 @@ public override bool CanWrite { get { - return _sink.CanWrite; + return this._sink.CanWrite; } } @@ -84,12 +84,12 @@ public override void SetLength(long length) public override void Close() { - _sink.Close(); + this._sink.Close(); } public override void Flush() { - _sink.Flush(); + this._sink.Flush(); } public override int Read(byte[] buffer, int offset, int count) diff --git a/DNN Platform/HttpModules/DependencyInjection/ServiceRequestScopeModule.cs b/DNN Platform/HttpModules/DependencyInjection/ServiceRequestScopeModule.cs index f7b151cd4db..9893bfd30f8 100644 --- a/DNN Platform/HttpModules/DependencyInjection/ServiceRequestScopeModule.cs +++ b/DNN Platform/HttpModules/DependencyInjection/ServiceRequestScopeModule.cs @@ -19,8 +19,8 @@ public static void InitModule() public void Init(HttpApplication context) { - context.BeginRequest += Context_BeginRequest; - context.EndRequest += Context_EndRequest; + context.BeginRequest += this.Context_BeginRequest; + context.EndRequest += this.Context_EndRequest; } public static void SetServiceProvider(IServiceProvider serviceProvider) @@ -47,7 +47,7 @@ private void Context_EndRequest(object sender, EventArgs e) /// public void Dispose() { - Dispose(true); + this.Dispose(true); } /// diff --git a/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj b/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj index 617a0078af6..c9b9ec652a3 100644 --- a/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj +++ b/DNN Platform/HttpModules/DotNetNuke.HttpModules.csproj @@ -1,143 +1,150 @@ - - - - 9.0.30729 - 2.0 - {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} - Debug - AnyCPU - DotNetNuke.HttpModules - Library - v4.7.2 - DotNetNuke.HttpModules - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - bin\ - bin\DotNetNuke.HttpModules.XML - true - true - 4 - full - AllRules.ruleset - 1591 - 7 - DEBUG - - - bin\ - bin\DotNetNuke.HttpModules.XML - true - true - 4 - pdbonly - AllRules.ruleset - 1591 - true - 7 - - - - False - ..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll - - - - ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - - - - - - - - - SolutionInfo.cs - - - - - - Code - - - - - - - - - - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\..\.. - - - - - - - - - + + + + 9.0.30729 + 2.0 + {3D9C3F5F-1D2D-4D89-995B-438055A5E3A6} + Debug + AnyCPU + DotNetNuke.HttpModules + Library + v4.7.2 + DotNetNuke.HttpModules + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + bin\ + bin\DotNetNuke.HttpModules.XML + true + true + 4 + full + AllRules.ruleset + 1591 + 7 + DEBUG + + + bin\ + bin\DotNetNuke.HttpModules.XML + true + true + 4 + pdbonly + AllRules.ruleset + 1591 + true + 7 + + + + False + ..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + + + + ..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + + + + + + + + + SolutionInfo.cs + + + + + + Code + + + + + + + + + + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + + + + + + + + + + + + + + $(MSBuildProjectDirectory)\..\.. + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/HttpModules/Exception/ExceptionModule.cs b/DNN Platform/HttpModules/Exception/ExceptionModule.cs index 539c5bd62e5..b72343c21a5 100644 --- a/DNN Platform/HttpModules/Exception/ExceptionModule.cs +++ b/DNN Platform/HttpModules/Exception/ExceptionModule.cs @@ -42,7 +42,7 @@ public string ModuleName /// The application. public void Init(HttpApplication application) { - application.Error += OnErrorRequest; + application.Error += this.OnErrorRequest; } public void Dispose() diff --git a/DNN Platform/HttpModules/Membership/MembershipModule.cs b/DNN Platform/HttpModules/Membership/MembershipModule.cs index 6350b2a1c7f..7939a50652c 100644 --- a/DNN Platform/HttpModules/Membership/MembershipModule.cs +++ b/DNN Platform/HttpModules/Membership/MembershipModule.cs @@ -78,8 +78,8 @@ private static string CurrentCulture /// The application. public void Init(HttpApplication application) { - application.AuthenticateRequest += OnAuthenticateRequest; - application.PreSendRequestHeaders += OnPreSendRequestHeaders; + application.AuthenticateRequest += this.OnAuthenticateRequest; + application.PreSendRequestHeaders += this.OnPreSendRequestHeaders; } /// diff --git a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs index 6408ebdf8cb..981e85965d8 100644 --- a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs +++ b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs @@ -30,8 +30,8 @@ public class MobileRedirectModule : IHttpModule public void Init(HttpApplication application) { - _redirectionController = new RedirectionController(); - application.BeginRequest += OnBeginRequest; + this._redirectionController = new RedirectionController(); + application.BeginRequest += this.OnBeginRequest; } public void Dispose() @@ -50,8 +50,8 @@ public void OnBeginRequest(object s, EventArgs e) if (!Initialize.ProcessHttpModule(app.Request, false, false) || app.Request.HttpMethod == "POST" || ServicesModule.ServiceApi.IsMatch(rawUrl) - || MvcServicePath.IsMatch(rawUrl) - || IsSpecialPage(rawUrl) + || this.MvcServicePath.IsMatch(rawUrl) + || this.IsSpecialPage(rawUrl) || (portalSettings != null && !IsRedirectAllowed(rawUrl, app, portalSettings))) { return; @@ -59,12 +59,12 @@ public void OnBeginRequest(object s, EventArgs e) //Check if redirection has been disabled for the session //This method inspects cookie and query string. It can also setup / clear cookies. - if (_redirectionController != null && + if (this._redirectionController != null && portalSettings?.ActiveTab != null && !string.IsNullOrEmpty(app.Request.UserAgent) && - _redirectionController.IsRedirectAllowedForTheSession(app)) + this._redirectionController.IsRedirectAllowedForTheSession(app)) { - var redirectUrl = _redirectionController.GetRedirectUrl(app.Request.UserAgent); + var redirectUrl = this._redirectionController.GetRedirectUrl(app.Request.UserAgent); if (!string.IsNullOrEmpty(redirectUrl)) { //append the query string from original url @@ -107,7 +107,7 @@ private bool IsSpecialPage(string url) { tabPath = tabPath.Replace(alias.Substring(idx), string.Empty); } - return _specialPages.Contains(tabPath); + return this._specialPages.Contains(tabPath); } } } diff --git a/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs b/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs index 4ef06d9b161..4e17305281e 100644 --- a/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs +++ b/DNN Platform/HttpModules/OutputCaching/OutputCacheModule.cs @@ -30,10 +30,10 @@ public class OutputCacheModule : IHttpModule public void Init(HttpApplication httpApp) { - _app = httpApp; + this._app = httpApp; - httpApp.ResolveRequestCache += OnResolveRequestCache; - httpApp.UpdateRequestCache += OnUpdateRequestCache; + httpApp.ResolveRequestCache += this.OnResolveRequestCache; + httpApp.UpdateRequestCache += this.OnUpdateRequestCache; } @@ -52,17 +52,17 @@ private bool IsInstallInProgress(HttpApplication app) private void OnResolveRequestCache(object sender, EventArgs e) { bool cached = false; - if (_app == null || _app.Context == null || !_app.Response.ContentType.Equals("text/html", StringComparison.InvariantCultureIgnoreCase) || _app.Context.Request.IsAuthenticated || _app.Context.Request.Browser.Crawler) + if (this._app == null || this._app.Context == null || !this._app.Response.ContentType.Equals("text/html", StringComparison.InvariantCultureIgnoreCase) || this._app.Context.Request.IsAuthenticated || this._app.Context.Request.Browser.Crawler) { return; } - if (IsInstallInProgress(_app)) + if (this.IsInstallInProgress(this._app)) { return; } - if (_app.Context.Request.RequestType == "POST" || ! (_app.Context.Request.Url.LocalPath.EndsWith(Globals.glbDefaultPage, StringComparison.InvariantCultureIgnoreCase))) + if (this._app.Context.Request.RequestType == "POST" || ! (this._app.Context.Request.Url.LocalPath.EndsWith(Globals.glbDefaultPage, StringComparison.InvariantCultureIgnoreCase))) { return; } @@ -94,7 +94,7 @@ private void OnResolveRequestCache(object sender, EventArgs e) string tabOutputCacheProvider = tabSettings["CacheProvider"].ToString(); - _app.Context.Items[ContextKeyTabOutputCacheProvider] = tabOutputCacheProvider; + this._app.Context.Items[ContextKeyTabOutputCacheProvider] = tabOutputCacheProvider; int maxCachedVariationsForTab = 250; //by default, prevent DOS attacks if (tabSettings["MaxVaryByCount"] != null && ! string.IsNullOrEmpty(tabSettings["MaxVaryByCount"].ToString())) { @@ -162,12 +162,12 @@ private void OnResolveRequestCache(object sender, EventArgs e) var varyBy = new SortedDictionary(); - foreach (string key in _app.Context.Request.QueryString) + foreach (string key in this._app.Context.Request.QueryString) { - if (key != null && _app.Context.Request.QueryString[key] != null) + if (key != null && this._app.Context.Request.QueryString[key] != null) { var varyKey = key.ToLowerInvariant(); - varyBy.Add(varyKey, _app.Context.Request.QueryString[key]); + varyBy.Add(varyKey, this._app.Context.Request.QueryString[key]); if (includeExclude == IncludeExcludeType.IncludeByDefault && !includeVaryByKeys.Contains(varyKey)) { @@ -196,27 +196,27 @@ private void OnResolveRequestCache(object sender, EventArgs e) string cacheKey = OutputCachingProvider.Instance(tabOutputCacheProvider).GenerateCacheKey(tabId, includeVaryByKeys, excludeVaryByKeys, varyBy); - bool returnedFromCache = OutputCachingProvider.Instance(tabOutputCacheProvider).StreamOutput(tabId, cacheKey, _app.Context); + bool returnedFromCache = OutputCachingProvider.Instance(tabOutputCacheProvider).StreamOutput(tabId, cacheKey, this._app.Context); if (returnedFromCache) { //output the content type heade when read content from cache. - _app.Context.Response.AddHeader("Content-Type", string.Format("{0}; charset={1}", _app.Response.ContentType, _app.Response.Charset)); + this._app.Context.Response.AddHeader("Content-Type", string.Format("{0}; charset={1}", this._app.Response.ContentType, this._app.Response.Charset)); //This is to give a site owner the ability //to visually verify that a page was rendered via //the output cache. Use FireFox FireBug or another //tool to view the response headers easily. - _app.Context.Response.AddHeader("DNNOutputCache", "true"); + this._app.Context.Response.AddHeader("DNNOutputCache", "true"); //Also add it ti the Context - the Headers are readonly unless using IIS in Integrated Pipleine mode //and we need to know if OutPut Caching is active in the compression module - _app.Context.Items.Add("DNNOutputCache", "true"); + this._app.Context.Items.Add("DNNOutputCache", "true"); - _app.Context.Response.End(); + this._app.Context.Response.End(); cached = true; } - _app.Context.Items[ContextKeyTabId] = tabId; + this._app.Context.Items[ContextKeyTabId] = tabId; if (cached != true) { @@ -225,13 +225,13 @@ private void OnResolveRequestCache(object sender, EventArgs e) int seconds = Convert.ToInt32(tabSettings["CacheDuration"].ToString()); var duration = new TimeSpan(0, 0, seconds); - OutputCacheResponseFilter responseFilter = OutputCachingProvider.Instance(_app.Context.Items[ContextKeyTabOutputCacheProvider].ToString()).GetResponseFilter(Convert.ToInt32(_app.Context.Items[ContextKeyTabId]), + OutputCacheResponseFilter responseFilter = OutputCachingProvider.Instance(this._app.Context.Items[ContextKeyTabOutputCacheProvider].ToString()).GetResponseFilter(Convert.ToInt32(this._app.Context.Items[ContextKeyTabId]), maxCachedVariationsForTab, - _app.Response.Filter, + this._app.Response.Filter, cacheKey, duration); - _app.Context.Items[ContextKeyResponseFilter] = responseFilter; - _app.Context.Response.Filter = responseFilter; + this._app.Context.Items[ContextKeyResponseFilter] = responseFilter; + this._app.Context.Response.Filter = responseFilter; } } } @@ -240,10 +240,10 @@ private void OnUpdateRequestCache(object sender, EventArgs e) { if (! HttpContext.Current.Request.Browser.Crawler) { - var responseFilter = _app.Context.Items[ContextKeyResponseFilter] as OutputCacheResponseFilter; + var responseFilter = this._app.Context.Items[ContextKeyResponseFilter] as OutputCacheResponseFilter; if (responseFilter != null) { - responseFilter.StopFiltering(Convert.ToInt32(_app.Context.Items[ContextKeyTabId]), false); + responseFilter.StopFiltering(Convert.ToInt32(this._app.Context.Items[ContextKeyTabId]), false); } } } diff --git a/DNN Platform/HttpModules/Personalization/PersonalizationModule.cs b/DNN Platform/HttpModules/Personalization/PersonalizationModule.cs index 862e86e8513..a6817e6084f 100644 --- a/DNN Platform/HttpModules/Personalization/PersonalizationModule.cs +++ b/DNN Platform/HttpModules/Personalization/PersonalizationModule.cs @@ -29,7 +29,7 @@ public string ModuleName public void Init(HttpApplication application) { - application.EndRequest += OnEndRequest; + application.EndRequest += this.OnEndRequest; } public void Dispose() diff --git a/DNN Platform/HttpModules/RequestFilter/Config/RequestFilterSettings.cs b/DNN Platform/HttpModules/RequestFilter/Config/RequestFilterSettings.cs index 585d76f203f..0d5964c6fb8 100644 --- a/DNN Platform/HttpModules/RequestFilter/Config/RequestFilterSettings.cs +++ b/DNN Platform/HttpModules/RequestFilter/Config/RequestFilterSettings.cs @@ -39,11 +39,11 @@ public List Rules { get { - return _rules; + return this._rules; } set { - _rules = value; + this._rules = value; } } diff --git a/DNN Platform/HttpModules/RequestFilter/RequestFilterRule.cs b/DNN Platform/HttpModules/RequestFilter/RequestFilterRule.cs index 79ff47fcf94..f1c9044d6cf 100644 --- a/DNN Platform/HttpModules/RequestFilter/RequestFilterRule.cs +++ b/DNN Platform/HttpModules/RequestFilter/RequestFilterRule.cs @@ -32,11 +32,11 @@ public class RequestFilterRule /// public RequestFilterRule(string serverVariable, string values, RequestFilterOperatorType op, RequestFilterRuleType action, string location) { - _ServerVariable = serverVariable; - SetValues(values, op); - _Operator = op; - _Action = action; - _Location = location; + this._ServerVariable = serverVariable; + this.SetValues(values, op); + this._Operator = op; + this._Action = action; + this._Location = location; } /// @@ -50,11 +50,11 @@ public string ServerVariable { get { - return _ServerVariable; + return this._ServerVariable; } set { - _ServerVariable = value; + this._ServerVariable = value; } } @@ -62,11 +62,11 @@ public List Values { get { - return _Values; + return this._Values; } set { - _Values = value; + this._Values = value; } } @@ -74,7 +74,7 @@ public string RawValue { get { - return string.Join(" ", _Values.ToArray()); + return string.Join(" ", this._Values.ToArray()); } } @@ -82,11 +82,11 @@ public RequestFilterRuleType Action { get { - return _Action; + return this._Action; } set { - _Action = value; + this._Action = value; } } @@ -94,11 +94,11 @@ public RequestFilterOperatorType Operator { get { - return _Operator; + return this._Operator; } set { - _Operator = value; + this._Operator = value; } } @@ -106,41 +106,41 @@ public string Location { get { - return _Location; + return this._Location; } set { - _Location = value; + this._Location = value; } } public void SetValues(string values, RequestFilterOperatorType op) { - _Values.Clear(); + this._Values.Clear(); if ((op != RequestFilterOperatorType.Regex)) { string[] vals = values.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries); foreach (string value in vals) { - _Values.Add(value.ToUpperInvariant()); + this._Values.Add(value.ToUpperInvariant()); } } else { - _Values.Add(values); + this._Values.Add(values); } } public bool Matches(string ServerVariableValue) { - switch (Operator) + switch (this.Operator) { case RequestFilterOperatorType.Equal: - return Values.Contains(ServerVariableValue.ToUpperInvariant()); + return this.Values.Contains(ServerVariableValue.ToUpperInvariant()); case RequestFilterOperatorType.NotEqual: - return !Values.Contains(ServerVariableValue.ToUpperInvariant()); + return !this.Values.Contains(ServerVariableValue.ToUpperInvariant()); case RequestFilterOperatorType.Regex: - return Regex.IsMatch(ServerVariableValue, Values[0], RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + return Regex.IsMatch(ServerVariableValue, this.Values[0], RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); } return false; } @@ -148,15 +148,15 @@ public bool Matches(string ServerVariableValue) public void Execute() { HttpResponse response = HttpContext.Current.Response; - switch (Action) + switch (this.Action) { case RequestFilterRuleType.Redirect: - response.Redirect(Location, true); + response.Redirect(this.Location, true); break; case RequestFilterRuleType.PermanentRedirect: response.StatusCode = 301; response.Status = "301 Moved Permanently"; - response.RedirectLocation = Location; + response.RedirectLocation = this.Location; response.End(); break; case RequestFilterRuleType.NotFound: diff --git a/DNN Platform/HttpModules/Services/ServicesModule.cs b/DNN Platform/HttpModules/Services/ServicesModule.cs index 3e553397135..31a8fdc90d9 100644 --- a/DNN Platform/HttpModules/Services/ServicesModule.cs +++ b/DNN Platform/HttpModules/Services/ServicesModule.cs @@ -17,7 +17,7 @@ public void Init(HttpApplication context) { context.BeginRequest += InitDnn; - context.PreSendRequestHeaders += OnPreSendRequestHeaders; + context.PreSendRequestHeaders += this.OnPreSendRequestHeaders; } private void OnPreSendRequestHeaders(object sender, EventArgs e) diff --git a/DNN Platform/HttpModules/UrlRewrite/BasicUrlRewriter.cs b/DNN Platform/HttpModules/UrlRewrite/BasicUrlRewriter.cs index 5dbb4ffa5f1..16640777a9d 100644 --- a/DNN Platform/HttpModules/UrlRewrite/BasicUrlRewriter.cs +++ b/DNN Platform/HttpModules/UrlRewrite/BasicUrlRewriter.cs @@ -84,7 +84,7 @@ internal override void RewriteUrl(object sender, EventArgs e) String domainName; - RewriteUrl(app, out domainName); + this.RewriteUrl(app, out domainName); //blank DomainName indicates RewriteUrl couldn't locate a current portal //reprocess url for portal alias if auto add is an option @@ -306,7 +306,7 @@ internal override void RewriteUrl(object sender, EventArgs e) { //switch to secure connection strURL = requestedPath.Replace("http://", "https://"); - strURL = FormatDomain(strURL, portalSettings.STDURL, portalSettings.SSLURL); + strURL = this.FormatDomain(strURL, portalSettings.STDURL, portalSettings.SSLURL); } } //if SSL is enforced @@ -319,7 +319,7 @@ internal override void RewriteUrl(object sender, EventArgs e) if (request.QueryString["ssl"] == null) { strURL = requestedPath.Replace("https://", "http://"); - strURL = FormatDomain(strURL, portalSettings.SSLURL, portalSettings.STDURL); + strURL = this.FormatDomain(strURL, portalSettings.SSLURL, portalSettings.STDURL); } } } diff --git a/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs b/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs index d371dc6e479..56630734bb7 100644 --- a/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs +++ b/DNN Platform/HttpModules/UrlRewrite/FriendlyUrlProvider.cs @@ -32,71 +32,71 @@ public class DNNFriendlyUrlProvider : FriendlyUrlProvider public DNNFriendlyUrlProvider() { //Read the configuration specific information for this provider - var objProvider = (Provider)_providerConfiguration.Providers[ProviderName]; + var objProvider = (Provider)this._providerConfiguration.Providers[ProviderName]; if (!String.IsNullOrEmpty(objProvider.Attributes["urlFormat"])) { switch (objProvider.Attributes["urlFormat"].ToLowerInvariant()) { case "searchfriendly": - _urlFormat = UrlFormatType.SearchFriendly; + this._urlFormat = UrlFormatType.SearchFriendly; break; case "humanfriendly": - _urlFormat = UrlFormatType.HumanFriendly; + this._urlFormat = UrlFormatType.HumanFriendly; break; case "advanced": case "customonly": - _urlFormat = UrlFormatType.Advanced; + this._urlFormat = UrlFormatType.Advanced; break; default: - _urlFormat = UrlFormatType.SearchFriendly; + this._urlFormat = UrlFormatType.SearchFriendly; break; } } //instance the correct provider implementation - switch (_urlFormat) + switch (this._urlFormat) { case UrlFormatType.Advanced: - _providerInstance = new AdvancedFriendlyUrlProvider(objProvider.Attributes); + this._providerInstance = new AdvancedFriendlyUrlProvider(objProvider.Attributes); break; case UrlFormatType.HumanFriendly: case UrlFormatType.SearchFriendly: - _providerInstance = new BasicFriendlyUrlProvider(objProvider.Attributes); + this._providerInstance = new BasicFriendlyUrlProvider(objProvider.Attributes); break; } string extensions = !String.IsNullOrEmpty(objProvider.Attributes["validExtensions"]) ? objProvider.Attributes["validExtensions"] : ".aspx"; - _validExtensions = extensions.Split(','); + this._validExtensions = extensions.Split(','); } public string[] ValidExtensions { - get { return _validExtensions; } + get { return this._validExtensions; } } public UrlFormatType UrlFormat { - get { return _urlFormat; } + get { return this._urlFormat; } } public override string FriendlyUrl(TabInfo tab, string path) { - return _providerInstance.FriendlyUrl(tab, path); + return this._providerInstance.FriendlyUrl(tab, path); } public override string FriendlyUrl(TabInfo tab, string path, string pageName) { - return _providerInstance.FriendlyUrl(tab, path, pageName); + return this._providerInstance.FriendlyUrl(tab, path, pageName); } public override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { - return _providerInstance.FriendlyUrl(tab, path, pageName, settings); + return this._providerInstance.FriendlyUrl(tab, path, pageName, settings); } public override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) { - return _providerInstance.FriendlyUrl(tab, path, pageName, portalAlias); + return this._providerInstance.FriendlyUrl(tab, path, pageName, portalAlias); } } } diff --git a/DNN Platform/HttpModules/UrlRewrite/UrlRewriteModule.cs b/DNN Platform/HttpModules/UrlRewrite/UrlRewriteModule.cs index 8c436c277df..3c99e268fb2 100644 --- a/DNN Platform/HttpModules/UrlRewrite/UrlRewriteModule.cs +++ b/DNN Platform/HttpModules/UrlRewrite/UrlRewriteModule.cs @@ -28,24 +28,24 @@ public string ModuleName public void Init(HttpApplication application) { - _providerToUse = DotNetNuke.Common.Utilities.Config.GetFriendlyUrlProvider(); + this._providerToUse = DotNetNuke.Common.Utilities.Config.GetFriendlyUrlProvider(); //bind events depending on currently configured friendly url provider //note that the current configured friendly url provider determines what type //of url rewriting is required. - switch (_providerToUse) + switch (this._providerToUse) { case "advanced": var advancedRewriter = new AdvancedUrlRewriter(); - _urlRewriter = advancedRewriter; + this._urlRewriter = advancedRewriter; //bind the rewrite event to the begin request event - application.BeginRequest += _urlRewriter.RewriteUrl; + application.BeginRequest += this._urlRewriter.RewriteUrl; break; default: var basicRewriter = new BasicUrlRewriter(); - _urlRewriter = basicRewriter; - application.BeginRequest += _urlRewriter.RewriteUrl; + this._urlRewriter = basicRewriter; + application.BeginRequest += this._urlRewriter.RewriteUrl; break; } } diff --git a/DNN Platform/HttpModules/Users Online/UsersOnlineModule.cs b/DNN Platform/HttpModules/Users Online/UsersOnlineModule.cs index 9790b29ba8a..84059961fcc 100644 --- a/DNN Platform/HttpModules/Users Online/UsersOnlineModule.cs +++ b/DNN Platform/HttpModules/Users Online/UsersOnlineModule.cs @@ -29,7 +29,7 @@ public string ModuleName public void Init(HttpApplication application) { - application.AuthorizeRequest += OnAuthorizeRequest; + application.AuthorizeRequest += this.OnAuthorizeRequest; } public void Dispose() diff --git a/DNN Platform/HttpModules/packages.config b/DNN Platform/HttpModules/packages.config index 50cd50d0ad8..93fa98c3e44 100644 --- a/DNN Platform/HttpModules/packages.config +++ b/DNN Platform/HttpModules/packages.config @@ -1,4 +1,5 @@ - - - + + + + \ No newline at end of file diff --git a/DNN Platform/Library/Application/Application.cs b/DNN Platform/Library/Application/Application.cs index 8cf9eb90723..7e745588c45 100644 --- a/DNN Platform/Library/Application/Application.cs +++ b/DNN Platform/Library/Application/Application.cs @@ -232,7 +232,7 @@ public virtual Version Version /// public virtual bool ApplyToProduct(string productNames) { - return productNames.Contains(Name); + return productNames.Contains(this.Name); } #endregion diff --git a/DNN Platform/Library/Application/AssemblyStatusAttribute.cs b/DNN Platform/Library/Application/AssemblyStatusAttribute.cs index 86dc2959fc2..33fc981a233 100644 --- a/DNN Platform/Library/Application/AssemblyStatusAttribute.cs +++ b/DNN Platform/Library/Application/AssemblyStatusAttribute.cs @@ -67,7 +67,7 @@ public class AssemblyStatusAttribute : Attribute /// The release mode. public AssemblyStatusAttribute(ReleaseMode releaseMode) { - _releaseMode = releaseMode; + this._releaseMode = releaseMode; } @@ -78,7 +78,7 @@ public ReleaseMode Status { get { - return _releaseMode; + return this._releaseMode; } } } diff --git a/DNN Platform/Library/Application/DotNetNukeContext.cs b/DNN Platform/Library/Application/DotNetNukeContext.cs index 28af7f3b1ec..a4a50a2db31 100644 --- a/DNN Platform/Library/Application/DotNetNukeContext.cs +++ b/DNN Platform/Library/Application/DotNetNukeContext.cs @@ -37,9 +37,9 @@ protected DotNetNukeContext() : this(new Application()) /// The application. protected DotNetNukeContext(Application application) { - _application = application; - _containerEventListeners = new NaiveLockingList(); - _skinEventListeners = new NaiveLockingList(); + this._application = application; + this._containerEventListeners = new NaiveLockingList(); + this._skinEventListeners = new NaiveLockingList(); } /// @@ -49,7 +49,7 @@ public Application Application { get { - return _application; + return this._application; } } @@ -65,7 +65,7 @@ public IList ContainerEventListeners { get { - return _containerEventListeners; + return this._containerEventListeners; } } @@ -81,7 +81,7 @@ public IList SkinEventListeners { get { - return _skinEventListeners; + return this._skinEventListeners; } } diff --git a/DNN Platform/Library/Collections/ExclusiveLockStrategy.cs b/DNN Platform/Library/Collections/ExclusiveLockStrategy.cs index 1a45c4dc32a..bd259ff18cd 100644 --- a/DNN Platform/Library/Collections/ExclusiveLockStrategy.cs +++ b/DNN Platform/Library/Collections/ExclusiveLockStrategy.cs @@ -22,30 +22,30 @@ public class ExclusiveLockStrategy : ILockStrategy public ISharedCollectionLock GetReadLock() { - return GetLock(TimeSpan.FromMilliseconds(-1)); + return this.GetLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetReadLock(TimeSpan timeout) { - return GetLock(timeout); + return this.GetLock(timeout); } public ISharedCollectionLock GetWriteLock() { - return GetLock(TimeSpan.FromMilliseconds(-1)); + return this.GetLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetWriteLock(TimeSpan timeout) { - return GetLock(timeout); + return this.GetLock(timeout); } public bool ThreadCanRead { get { - EnsureNotDisposed(); - return IsThreadLocked(); + this.EnsureNotDisposed(); + return this.IsThreadLocked(); } } @@ -53,8 +53,8 @@ public bool ThreadCanWrite { get { - EnsureNotDisposed(); - return IsThreadLocked(); + this.EnsureNotDisposed(); + return this.IsThreadLocked(); } } @@ -68,7 +68,7 @@ public bool SupportsConcurrentReads public void Dispose() { - _isDisposed = true; + this._isDisposed = true; //todo remove disposable from interface? } @@ -76,15 +76,15 @@ public void Dispose() private ISharedCollectionLock GetLock(TimeSpan timeout) { - EnsureNotDisposed(); - if (IsThreadLocked()) + this.EnsureNotDisposed(); + if (this.IsThreadLocked()) { throw new LockRecursionException(); } - if (Monitor.TryEnter(_lock, timeout)) + if (Monitor.TryEnter(this._lock, timeout)) { - _lockedThread = Thread.CurrentThread; + this._lockedThread = Thread.CurrentThread; return new MonitorLock(this); } else @@ -95,32 +95,32 @@ private ISharedCollectionLock GetLock(TimeSpan timeout) private ISharedCollectionLock GetLock() { - EnsureNotDisposed(); - if (IsThreadLocked()) + this.EnsureNotDisposed(); + if (this.IsThreadLocked()) { throw new LockRecursionException(); } - Monitor.Enter(_lock); - _lockedThread = Thread.CurrentThread; + Monitor.Enter(this._lock); + this._lockedThread = Thread.CurrentThread; return new MonitorLock(this); } private bool IsThreadLocked() { - return Thread.CurrentThread.Equals(_lockedThread); + return Thread.CurrentThread.Equals(this._lockedThread); } public void Exit() { - EnsureNotDisposed(); - Monitor.Exit(_lock); - _lockedThread = null; + this.EnsureNotDisposed(); + Monitor.Exit(this._lock); + this._lockedThread = null; } private void EnsureNotDisposed() { - if (_isDisposed) + if (this._isDisposed) { throw new ObjectDisposedException("ExclusiveLockStrategy"); } diff --git a/DNN Platform/Library/Collections/MonitorLock.cs b/DNN Platform/Library/Collections/MonitorLock.cs index 18627f7349b..6a3484e3c9e 100644 --- a/DNN Platform/Library/Collections/MonitorLock.cs +++ b/DNN Platform/Library/Collections/MonitorLock.cs @@ -16,7 +16,7 @@ internal class MonitorLock : IDisposable, ISharedCollectionLock public MonitorLock(ExclusiveLockStrategy lockStrategy) { - _lockStrategy = lockStrategy; + this._lockStrategy = lockStrategy; } #region "IDisposable Support" @@ -28,21 +28,21 @@ public MonitorLock(ExclusiveLockStrategy lockStrategy) public void Dispose() { // Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { - if (!_isDisposed) + if (!this._isDisposed) { if (disposing) { - _lockStrategy.Exit(); - _lockStrategy = null; + this._lockStrategy.Exit(); + this._lockStrategy = null; } } - _isDisposed = true; + this._isDisposed = true; } #endregion diff --git a/DNN Platform/Library/Collections/NaiveLockingList.cs b/DNN Platform/Library/Collections/NaiveLockingList.cs index 2282d9e9a16..2cb70e78ad3 100644 --- a/DNN Platform/Library/Collections/NaiveLockingList.cs +++ b/DNN Platform/Library/Collections/NaiveLockingList.cs @@ -15,12 +15,12 @@ public class NaiveLockingList : IList void DoInReadLock(Action action) { - DoInReadLock(() =>{ action.Invoke(); return true; }); + this.DoInReadLock(() =>{ action.Invoke(); return true; }); } TRet DoInReadLock(Func func) { - using (_list.GetReadLock()) + using (this._list.GetReadLock()) { return func.Invoke(); } @@ -28,12 +28,12 @@ TRet DoInReadLock(Func func) void DoInWriteLock(Action action) { - DoInWriteLock(() => { action.Invoke(); return true; }); + this.DoInWriteLock(() => { action.Invoke(); return true; }); } private TRet DoInWriteLock(Func func) { - using (_list.GetWriteLock()) + using (this._list.GetWriteLock()) { return func.Invoke(); } @@ -49,7 +49,7 @@ public SharedList SharedList { get { - return _list; + return this._list; } } @@ -58,45 +58,45 @@ public IEnumerator GetEnumerator() //disposal of enumerator will release read lock //TODO is there a need for some sort of timed release? the timmer must release from the correct thread //if using RWLS - var readLock = _list.GetReadLock(); - return new NaiveLockingEnumerator(_list.GetEnumerator(), readLock); + var readLock = this._list.GetReadLock(); + return new NaiveLockingEnumerator(this._list.GetEnumerator(), readLock); } IEnumerator IEnumerable.GetEnumerator() { - return GetEnumerator(); + return this.GetEnumerator(); } public void Add(T item) { - DoInWriteLock(() => _list.Add(item)); + this.DoInWriteLock(() => this._list.Add(item)); } public void Clear() { - DoInWriteLock(() => _list.Clear()); + this.DoInWriteLock(() => this._list.Clear()); } public bool Contains(T item) { - return DoInReadLock(() => _list.Contains(item)); + return this.DoInReadLock(() => this._list.Contains(item)); } public void CopyTo(T[] array, int arrayIndex) { - DoInReadLock(() => _list.CopyTo(array, arrayIndex)); + this.DoInReadLock(() => this._list.CopyTo(array, arrayIndex)); } public bool Remove(T item) { - return DoInWriteLock(() => _list.Remove(item)); + return this.DoInWriteLock(() => this._list.Remove(item)); } public int Count { get { - return DoInReadLock(() => _list.Count); + return this.DoInReadLock(() => this._list.Count); } } @@ -110,28 +110,28 @@ public bool IsReadOnly public int IndexOf(T item) { - return DoInReadLock(() => _list.IndexOf(item)); + return this.DoInReadLock(() => this._list.IndexOf(item)); } public void Insert(int index, T item) { - DoInWriteLock(() => _list.Insert(index, item)); + this.DoInWriteLock(() => this._list.Insert(index, item)); } public void RemoveAt(int index) { - DoInWriteLock(() => _list.RemoveAt(index)); + this.DoInWriteLock(() => this._list.RemoveAt(index)); } public T this[int index] { get { - return DoInReadLock(() => _list[index]); + return this.DoInReadLock(() => this._list[index]); } set { - DoInWriteLock(() => _list[index] = value); + this.DoInWriteLock(() => this._list[index] = value); } } @@ -143,25 +143,25 @@ public class NaiveLockingEnumerator : IEnumerator public NaiveLockingEnumerator(IEnumerator enumerator, ISharedCollectionLock readLock) { - _enumerator = enumerator; - _readLock = readLock; + this._enumerator = enumerator; + this._readLock = readLock; } public bool MoveNext() { - return _enumerator.MoveNext(); + return this._enumerator.MoveNext(); } public void Reset() { - _enumerator.Reset(); + this._enumerator.Reset(); } public T Current { get { - return _enumerator.Current; + return this._enumerator.Current; } } @@ -169,36 +169,36 @@ object IEnumerator.Current { get { - return Current; + return this.Current; } } public void Dispose() { - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { - if (!_isDisposed) + if (!this._isDisposed) { if (disposing) { //dispose managed resrources here - _enumerator.Dispose(); - _readLock.Dispose(); + this._enumerator.Dispose(); + this._readLock.Dispose(); } //dispose unmanaged resrources here - _isDisposed = true; + this._isDisposed = true; } } ~NaiveLockingEnumerator() { - Dispose(false); + this.Dispose(false); } } } diff --git a/DNN Platform/Library/Collections/PagedList.cs b/DNN Platform/Library/Collections/PagedList.cs index 2f75af55fdd..0d1386486ac 100644 --- a/DNN Platform/Library/Collections/PagedList.cs +++ b/DNN Platform/Library/Collections/PagedList.cs @@ -32,7 +32,7 @@ public class PagedList : List, IPagedList public PagedList(IEnumerable source, int pageIndex, int pageSize) { var enumerable = source as T[] ?? source.ToArray(); - CommonConstruct(enumerable.Skip(pageIndex * pageSize).Take(pageSize).ToList(), enumerable.Count(), pageIndex, pageSize); + this.CommonConstruct(enumerable.Skip(pageIndex * pageSize).Take(pageSize).ToList(), enumerable.Count(), pageIndex, pageSize); } /// @@ -44,7 +44,7 @@ public PagedList(IEnumerable source, int pageIndex, int pageSize) /// The size of the page to retrieve public PagedList(IEnumerable items, int totalCount, int pageIndex, int pageSize) { - CommonConstruct(items, totalCount, pageIndex, pageSize); + this.CommonConstruct(items, totalCount, pageIndex, pageSize); } #endregion @@ -53,9 +53,9 @@ public PagedList(IEnumerable items, int totalCount, int pageIndex, int pageSi private void CommonConstruct(IEnumerable items, int totalCount, int pageIndex, int pageSize) { - PageCount = (int)Math.Ceiling(totalCount / (double)pageSize); + this.PageCount = (int)Math.Ceiling(totalCount / (double)pageSize); - if (PageCount == 0) + if (this.PageCount == 0) { if (pageIndex > 0) { @@ -68,20 +68,20 @@ private void CommonConstruct(IEnumerable items, int totalCount, int pageIndex { throw new IndexOutOfRangeException("Index cannot be negative"); } - if (pageIndex >= PageCount) + if (pageIndex >= this.PageCount) { throw new IndexOutOfRangeException("Invalid Page Index"); } } - TotalCount = totalCount; - PageSize = pageSize; - PageIndex = pageIndex; - AddRange(items); - - HasNextPage = (PageIndex < (PageCount - 1)); - HasPreviousPage = (PageIndex > 0); - IsFirstPage = (PageIndex <= 0); - IsLastPage = (PageIndex >= (PageCount - 1)); + this.TotalCount = totalCount; + this.PageSize = pageSize; + this.PageIndex = pageIndex; + this.AddRange(items); + + this.HasNextPage = (this.PageIndex < (this.PageCount - 1)); + this.HasPreviousPage = (this.PageIndex > 0); + this.IsFirstPage = (this.PageIndex <= 0); + this.IsLastPage = (this.PageIndex >= (this.PageCount - 1)); } #endregion diff --git a/DNN Platform/Library/Collections/PagedSelector.cs b/DNN Platform/Library/Collections/PagedSelector.cs index ee30a8ca242..ea38cfb79b8 100644 --- a/DNN Platform/Library/Collections/PagedSelector.cs +++ b/DNN Platform/Library/Collections/PagedSelector.cs @@ -27,8 +27,8 @@ public class PageSelector /// The size of each page public PageSelector(IEnumerable source, int pageSize) { - _source = source; - _pageSize = pageSize; + this._source = source; + this._pageSize = pageSize; } #endregion @@ -45,7 +45,7 @@ public PageSelector(IEnumerable source, int pageSize) /// public IPagedList GetPage(int pageIndex) { - return new PagedList(_source, pageIndex, _pageSize); + return new PagedList(this._source, pageIndex, this._pageSize); } #endregion diff --git a/DNN Platform/Library/Collections/ReaderWriterLockStrategy.cs b/DNN Platform/Library/Collections/ReaderWriterLockStrategy.cs index 268c1bbfbbd..d42c94f73de 100644 --- a/DNN Platform/Library/Collections/ReaderWriterLockStrategy.cs +++ b/DNN Platform/Library/Collections/ReaderWriterLockStrategy.cs @@ -20,7 +20,7 @@ private ReaderWriterLockSlim Lock { get { - return _lock ?? (_lock = new ReaderWriterLockSlim(_lockRecursionPolicy)); + return this._lock ?? (this._lock = new ReaderWriterLockSlim(this._lockRecursionPolicy)); } } @@ -29,7 +29,7 @@ private ReaderWriterLockSlim Lock public void GetObjectData(SerializationInfo info, StreamingContext context) { // Use the AddValue method to specify serialized values. - info.AddValue("_lockRecursionPolicy", _lockRecursionPolicy, typeof(LockRecursionPolicy)); + info.AddValue("_lockRecursionPolicy", this._lockRecursionPolicy, typeof(LockRecursionPolicy)); } public ReaderWriterLockStrategy() @@ -39,31 +39,31 @@ public ReaderWriterLockStrategy() public ReaderWriterLockStrategy(LockRecursionPolicy recursionPolicy) { - _lockRecursionPolicy = recursionPolicy; - _lock = new ReaderWriterLockSlim(recursionPolicy); + this._lockRecursionPolicy = recursionPolicy; + this._lock = new ReaderWriterLockSlim(recursionPolicy); } // The special constructor is used to deserialize values. public ReaderWriterLockStrategy(SerializationInfo info, StreamingContext context) { - _lockRecursionPolicy = (LockRecursionPolicy)info.GetValue("_lockRecursionPolicy", typeof(LockRecursionPolicy)); - _lock = new ReaderWriterLockSlim(_lockRecursionPolicy); + this._lockRecursionPolicy = (LockRecursionPolicy)info.GetValue("_lockRecursionPolicy", typeof(LockRecursionPolicy)); + this._lock = new ReaderWriterLockSlim(this._lockRecursionPolicy); } #region ILockStrategy Members public ISharedCollectionLock GetReadLock() { - return GetReadLock(TimeSpan.FromMilliseconds(-1)); + return this.GetReadLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetReadLock(TimeSpan timeout) { - EnsureNotDisposed(); - if (Lock.RecursionPolicy == LockRecursionPolicy.NoRecursion && Lock.IsReadLockHeld || - Lock.TryEnterReadLock(timeout)) + this.EnsureNotDisposed(); + if (this.Lock.RecursionPolicy == LockRecursionPolicy.NoRecursion && this.Lock.IsReadLockHeld || + this.Lock.TryEnterReadLock(timeout)) { - return new ReaderWriterSlimLock(Lock); + return new ReaderWriterSlimLock(this.Lock); } else { @@ -73,16 +73,16 @@ public ISharedCollectionLock GetReadLock(TimeSpan timeout) public ISharedCollectionLock GetWriteLock() { - return GetWriteLock(TimeSpan.FromMilliseconds(-1)); + return this.GetWriteLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetWriteLock(TimeSpan timeout) { - EnsureNotDisposed(); - if (Lock.RecursionPolicy == LockRecursionPolicy.NoRecursion && Lock.IsWriteLockHeld || - Lock.TryEnterWriteLock(timeout)) + this.EnsureNotDisposed(); + if (this.Lock.RecursionPolicy == LockRecursionPolicy.NoRecursion && this.Lock.IsWriteLockHeld || + this.Lock.TryEnterWriteLock(timeout)) { - return new ReaderWriterSlimLock(Lock); + return new ReaderWriterSlimLock(this.Lock); } else { @@ -94,8 +94,8 @@ public bool ThreadCanRead { get { - EnsureNotDisposed(); - return Lock.IsReadLockHeld || Lock.IsWriteLockHeld; + this.EnsureNotDisposed(); + return this.Lock.IsReadLockHeld || this.Lock.IsWriteLockHeld; } } @@ -103,8 +103,8 @@ public bool ThreadCanWrite { get { - EnsureNotDisposed(); - return Lock.IsWriteLockHeld; + this.EnsureNotDisposed(); + return this.Lock.IsWriteLockHeld; } } @@ -125,13 +125,13 @@ public bool SupportsConcurrentReads public void Dispose() { // Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } private void EnsureNotDisposed() { - if (_isDisposed) + if (this._isDisposed) { throw new ObjectDisposedException("ReaderWriterLockStrategy"); } @@ -142,26 +142,26 @@ private void EnsureNotDisposed() // IDisposable protected virtual void Dispose(bool disposing) { - if (!_isDisposed) + if (!this._isDisposed) { if (disposing) { //dispose managed state (managed objects). } - if (_lock != null) + if (this._lock != null) { - _lock.Dispose(); - _lock = null; + this._lock.Dispose(); + this._lock = null; } } - _isDisposed = true; + this._isDisposed = true; } ~ReaderWriterLockStrategy() { // Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. - Dispose(false); + this.Dispose(false); } // This code added by Visual Basic to correctly implement the disposable pattern. diff --git a/DNN Platform/Library/Collections/ReaderWriterSlimLock.cs b/DNN Platform/Library/Collections/ReaderWriterSlimLock.cs index b6584e3fac5..dda6064a74a 100644 --- a/DNN Platform/Library/Collections/ReaderWriterSlimLock.cs +++ b/DNN Platform/Library/Collections/ReaderWriterSlimLock.cs @@ -18,14 +18,14 @@ internal class ReaderWriterSlimLock : ISharedCollectionLock public ReaderWriterSlimLock(ReaderWriterLockSlim @lock) { - _lock = @lock; + this._lock = @lock; } #region ISharedCollectionLock Members public void Dispose() { - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } @@ -34,7 +34,7 @@ public void Dispose() private void EnsureNotDisposed() { - if (_disposed) + if (this._disposed) { throw new ObjectDisposedException("ReaderWriterSlimLock"); } @@ -42,7 +42,7 @@ private void EnsureNotDisposed() protected virtual void Dispose(bool disposing) { - if (!_disposed) + if (!this._disposed) { if (disposing) { @@ -50,27 +50,27 @@ protected virtual void Dispose(bool disposing) } //free unmanaged resrources here - if (_lock.IsReadLockHeld) + if (this._lock.IsReadLockHeld) { - _lock.ExitReadLock(); + this._lock.ExitReadLock(); } - else if (_lock.IsWriteLockHeld) + else if (this._lock.IsWriteLockHeld) { - _lock.ExitWriteLock(); + this._lock.ExitWriteLock(); } - else if (_lock.IsUpgradeableReadLockHeld) + else if (this._lock.IsUpgradeableReadLockHeld) { - _lock.ExitUpgradeableReadLock(); + this._lock.ExitUpgradeableReadLock(); } - _lock = null; - _disposed = true; + this._lock = null; + this._disposed = true; } } ~ReaderWriterSlimLock() { - Dispose(false); + this.Dispose(false); } } } diff --git a/DNN Platform/Library/Collections/SharedDictionary.cs b/DNN Platform/Library/Collections/SharedDictionary.cs index 88f3e81431d..1d3352665f2 100644 --- a/DNN Platform/Library/Collections/SharedDictionary.cs +++ b/DNN Platform/Library/Collections/SharedDictionary.cs @@ -26,8 +26,8 @@ public SharedDictionary() : this(LockingStrategy.ReaderWriter) public SharedDictionary(ILockStrategy lockStrategy) { - _dict = new Dictionary(); - _lockController = lockStrategy; + this._dict = new Dictionary(); + this._lockController = lockStrategy; } public SharedDictionary(LockingStrategy strategy) : this(LockingStrategyFactory.Create(strategy)) @@ -38,7 +38,7 @@ internal IDictionary BackingDictionary { get { - return _dict; + return this._dict; } } @@ -46,56 +46,56 @@ internal IDictionary BackingDictionary IEnumerator> IEnumerable>.GetEnumerator() { - return IEnumerable_GetEnumerator(); + return this.IEnumerable_GetEnumerator(); } public IEnumerator GetEnumerator() { - return IEnumerable_GetEnumerator(); + return this.IEnumerable_GetEnumerator(); } public void Add(KeyValuePair item) { - EnsureNotDisposed(); - EnsureWriteAccess(); - _dict.Add(item); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._dict.Add(item); } public void Clear() { - EnsureNotDisposed(); - EnsureWriteAccess(); - _dict.Clear(); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._dict.Clear(); } public bool Contains(KeyValuePair item) { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.Contains(item); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.Contains(item); } public void CopyTo(KeyValuePair[] array, int arrayIndex) { - EnsureNotDisposed(); - EnsureReadAccess(); - _dict.CopyTo(array, arrayIndex); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + this._dict.CopyTo(array, arrayIndex); } public bool Remove(KeyValuePair item) { - EnsureNotDisposed(); - EnsureWriteAccess(); - return _dict.Remove(item); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + return this._dict.Remove(item); } public int Count { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.Count; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.Count; } } @@ -103,53 +103,53 @@ public bool IsReadOnly { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.IsReadOnly; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.IsReadOnly; } } public bool ContainsKey(TKey key) { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.ContainsKey(key); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.ContainsKey(key); } public void Add(TKey key, TValue value) { - EnsureNotDisposed(); - EnsureWriteAccess(); - _dict.Add(key, value); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._dict.Add(key, value); } public bool Remove(TKey key) { - EnsureNotDisposed(); - EnsureWriteAccess(); - return _dict.Remove(key); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + return this._dict.Remove(key); } public bool TryGetValue(TKey key, out TValue value) { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.TryGetValue(key, out value); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.TryGetValue(key, out value); } public TValue this[TKey key] { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict[key]; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict[key]; } set { - EnsureNotDisposed(); - EnsureWriteAccess(); - _dict[key] = value; + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._dict[key] = value; } } @@ -157,9 +157,9 @@ public ICollection Keys { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.Keys; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.Keys; } } @@ -167,9 +167,9 @@ public ICollection Values { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _dict.Values; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._dict.Values; } } @@ -179,7 +179,7 @@ public ICollection Values public void Dispose() { - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } @@ -188,40 +188,40 @@ public void Dispose() public ISharedCollectionLock GetReadLock() { - return GetReadLock(TimeSpan.FromMilliseconds(-1)); + return this.GetReadLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetReadLock(TimeSpan timeOut) { - EnsureNotDisposed(); - return _lockController.GetReadLock(timeOut); + this.EnsureNotDisposed(); + return this._lockController.GetReadLock(timeOut); } public ISharedCollectionLock GetReadLock(int millisecondTimeout) { - return GetReadLock(TimeSpan.FromMilliseconds(millisecondTimeout)); + return this.GetReadLock(TimeSpan.FromMilliseconds(millisecondTimeout)); } public ISharedCollectionLock GetWriteLock() { - return GetWriteLock(TimeSpan.FromMilliseconds(-1)); + return this.GetWriteLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetWriteLock(TimeSpan timeOut) { - EnsureNotDisposed(); - return _lockController.GetWriteLock(timeOut); + this.EnsureNotDisposed(); + return this._lockController.GetWriteLock(timeOut); } public ISharedCollectionLock GetWriteLock(int millisecondTimeout) { - return GetWriteLock(TimeSpan.FromMilliseconds(millisecondTimeout)); + return this.GetWriteLock(TimeSpan.FromMilliseconds(millisecondTimeout)); } private void EnsureReadAccess() { - if (!(_lockController.ThreadCanRead)) + if (!(this._lockController.ThreadCanRead)) { throw new ReadLockRequiredException(); } @@ -229,7 +229,7 @@ private void EnsureReadAccess() private void EnsureWriteAccess() { - if (!_lockController.ThreadCanWrite) + if (!this._lockController.ThreadCanWrite) { throw new WriteLockRequiredException(); } @@ -237,16 +237,16 @@ private void EnsureWriteAccess() public IEnumerator> IEnumerable_GetEnumerator() { - EnsureNotDisposed(); - EnsureReadAccess(); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); //todo nothing ensures read lock is held for life of enumerator - return _dict.GetEnumerator(); + return this._dict.GetEnumerator(); } private void EnsureNotDisposed() { - if (_isDisposed) + if (this._isDisposed) { throw new ObjectDisposedException("SharedDictionary"); } @@ -254,24 +254,24 @@ private void EnsureNotDisposed() protected virtual void Dispose(bool disposing) { - if (!_isDisposed) + if (!this._isDisposed) { if (disposing) { //dispose managed resrources here - _dict = null; + this._dict = null; } //dispose unmanaged resrources here - _lockController.Dispose(); - _lockController = null; - _isDisposed = true; + this._lockController.Dispose(); + this._lockController = null; + this._isDisposed = true; } } ~SharedDictionary() { - Dispose(false); + this.Dispose(false); } } } diff --git a/DNN Platform/Library/Collections/SharedList.cs b/DNN Platform/Library/Collections/SharedList.cs index 286f67a9825..51573249d74 100644 --- a/DNN Platform/Library/Collections/SharedList.cs +++ b/DNN Platform/Library/Collections/SharedList.cs @@ -23,7 +23,7 @@ public SharedList() : this(LockingStrategy.ReaderWriter) public SharedList(ILockStrategy lockStrategy) { - _lockStrategy = lockStrategy; + this._lockStrategy = lockStrategy; } public SharedList(LockingStrategy strategy) : this(LockingStrategyFactory.Create(strategy)) @@ -34,7 +34,7 @@ internal IList BackingList { get { - return _list; + return this._list; } } @@ -42,39 +42,39 @@ internal IList BackingList public void Add(T item) { - EnsureNotDisposed(); - EnsureWriteAccess(); - _list.Add(item); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._list.Add(item); } public void Clear() { - EnsureNotDisposed(); - EnsureWriteAccess(); - _list.Clear(); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._list.Clear(); } public bool Contains(T item) { - EnsureNotDisposed(); - EnsureReadAccess(); - return _list.Contains(item); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._list.Contains(item); } public void CopyTo(T[] array, int arrayIndex) { - EnsureNotDisposed(); - EnsureReadAccess(); - _list.CopyTo(array, arrayIndex); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + this._list.CopyTo(array, arrayIndex); } public int Count { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _list.Count; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._list.Count; } } @@ -82,66 +82,66 @@ public bool IsReadOnly { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return ((ICollection) _list).IsReadOnly; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return ((ICollection) this._list).IsReadOnly; } } public bool Remove(T item) { - EnsureNotDisposed(); - EnsureWriteAccess(); - return _list.Remove(item); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + return this._list.Remove(item); } public IEnumerator GetEnumerator() { - EnsureNotDisposed(); - EnsureReadAccess(); - return _list.GetEnumerator(); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._list.GetEnumerator(); } public int IndexOf(T item) { - EnsureNotDisposed(); - EnsureReadAccess(); - return _list.IndexOf(item); + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._list.IndexOf(item); } public void Insert(int index, T item) { - EnsureNotDisposed(); - EnsureWriteAccess(); - _list.Insert(index, item); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._list.Insert(index, item); } public T this[int index] { get { - EnsureNotDisposed(); - EnsureReadAccess(); - return _list[index]; + this.EnsureNotDisposed(); + this.EnsureReadAccess(); + return this._list[index]; } set { - EnsureNotDisposed(); - EnsureWriteAccess(); - _list[index] = value; + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._list[index] = value; } } public void RemoveAt(int index) { - EnsureNotDisposed(); - EnsureWriteAccess(); - _list.RemoveAt(index); + this.EnsureNotDisposed(); + this.EnsureWriteAccess(); + this._list.RemoveAt(index); } IEnumerator IEnumerable.GetEnumerator() { - return GetEnumerator1(); + return this.GetEnumerator1(); } #endregion @@ -152,7 +152,7 @@ IEnumerator IEnumerable.GetEnumerator() public void Dispose() { - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } @@ -160,7 +160,7 @@ public void Dispose() public void EnsureNotDisposed() { - if (_isDisposed) + if (this._isDisposed) { throw new ObjectDisposedException("SharedList"); } @@ -169,61 +169,61 @@ public void EnsureNotDisposed() // IDisposable protected virtual void Dispose(bool disposing) { - if (!_isDisposed) + if (!this._isDisposed) { if (disposing) { // dispose managed state (managed objects). } - _lockStrategy.Dispose(); - _lockStrategy = null; + this._lockStrategy.Dispose(); + this._lockStrategy = null; } - _isDisposed = true; + this._isDisposed = true; } ~SharedList() { - Dispose(false); + this.Dispose(false); } #endregion public ISharedCollectionLock GetReadLock() { - return GetReadLock(TimeSpan.FromMilliseconds(-1)); + return this.GetReadLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetReadLock(TimeSpan timeOut) { - EnsureNotDisposed(); - return _lockStrategy.GetReadLock(timeOut); + this.EnsureNotDisposed(); + return this._lockStrategy.GetReadLock(timeOut); } public ISharedCollectionLock GetReadLock(int millisecondTimeout) { - return GetReadLock(TimeSpan.FromMilliseconds(millisecondTimeout)); + return this.GetReadLock(TimeSpan.FromMilliseconds(millisecondTimeout)); } public ISharedCollectionLock GetWriteLock() { - return GetWriteLock(TimeSpan.FromMilliseconds(-1)); + return this.GetWriteLock(TimeSpan.FromMilliseconds(-1)); } public ISharedCollectionLock GetWriteLock(TimeSpan timeOut) { - EnsureNotDisposed(); - return _lockStrategy.GetWriteLock(timeOut); + this.EnsureNotDisposed(); + return this._lockStrategy.GetWriteLock(timeOut); } public ISharedCollectionLock GetWriteLock(int millisecondTimeout) { - return GetWriteLock(TimeSpan.FromMilliseconds(millisecondTimeout)); + return this.GetWriteLock(TimeSpan.FromMilliseconds(millisecondTimeout)); } private void EnsureReadAccess() { - if (!(_lockStrategy.ThreadCanRead)) + if (!(this._lockStrategy.ThreadCanRead)) { throw new ReadLockRequiredException(); } @@ -231,7 +231,7 @@ private void EnsureReadAccess() private void EnsureWriteAccess() { - if (!_lockStrategy.ThreadCanWrite) + if (!this._lockStrategy.ThreadCanWrite) { throw new WriteLockRequiredException(); } @@ -239,7 +239,7 @@ private void EnsureWriteAccess() public IEnumerator GetEnumerator1() { - return GetEnumerator(); + return this.GetEnumerator(); } } } diff --git a/DNN Platform/Library/Common/FileItem.cs b/DNN Platform/Library/Common/FileItem.cs index 0835e3a7240..85628ce79bc 100644 --- a/DNN Platform/Library/Common/FileItem.cs +++ b/DNN Platform/Library/Common/FileItem.cs @@ -16,8 +16,8 @@ public class FileItem /// The text. public FileItem(string value, string text) { - Value = value; - Text = text; + this.Value = value; + this.Text = text; } /// diff --git a/DNN Platform/Library/Common/Internal/EventHandlersContainer.cs b/DNN Platform/Library/Common/Internal/EventHandlersContainer.cs index d9d07720e97..43e98bcd6c9 100644 --- a/DNN Platform/Library/Common/Internal/EventHandlersContainer.cs +++ b/DNN Platform/Library/Common/Internal/EventHandlersContainer.cs @@ -24,7 +24,7 @@ public EventHandlersContainer() { try { - if (GetCurrentStatus() != Globals.UpgradeStatus.None) + if (this.GetCurrentStatus() != Globals.UpgradeStatus.None) { return; } @@ -40,7 +40,7 @@ public IEnumerable> EventHandlers { get { - return _eventHandlers; + return this._eventHandlers; } } diff --git a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs index 19234d4f06a..1bee2d4da0b 100644 --- a/DNN Platform/Library/Common/Internal/GlobalsImpl.cs +++ b/DNN Platform/Library/Common/Internal/GlobalsImpl.cs @@ -19,7 +19,7 @@ public class GlobalsImpl : IGlobals protected INavigationManager NavigationManager { get; } public GlobalsImpl() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public string ApplicationPath @@ -69,7 +69,7 @@ public string GetPortalDomainName(string strPortalAlias, HttpRequest Request, bo public string GetDomainName(Uri requestedUri) { - return GetDomainName(requestedUri, false); + return this.GetDomainName(requestedUri, false); } public string GetDomainName(Uri requestedUri, bool parsePortNumber) @@ -172,57 +172,57 @@ public string LoginURL(string returnURL, bool @override) public string NavigateURL() { - return NavigationManager.NavigateURL(); + return this.NavigationManager.NavigateURL(); } public string NavigateURL(int tabID) { - return NavigationManager.NavigateURL(tabID); + return this.NavigationManager.NavigateURL(tabID); } public string NavigateURL(int tabID, bool isSuperTab) { - return NavigationManager.NavigateURL(tabID, isSuperTab); + return this.NavigationManager.NavigateURL(tabID, isSuperTab); } public string NavigateURL(string controlKey) { - return NavigationManager.NavigateURL(controlKey); + return this.NavigationManager.NavigateURL(controlKey); } public string NavigateURL(string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(controlKey, additionalParameters); + return this.NavigationManager.NavigateURL(controlKey, additionalParameters); } public string NavigateURL(int tabID, string controlKey) { - return NavigationManager.NavigateURL(tabID, controlKey); + return this.NavigationManager.NavigateURL(tabID, controlKey); } public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, controlKey, additionalParameters); + return this.NavigationManager.NavigateURL(tabID, controlKey, additionalParameters); } public string NavigateURL(int tabID, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, settings, controlKey, additionalParameters); + return this.NavigationManager.NavigateURL(tabID, settings, controlKey, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + return this.NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); + return this.NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, additionalParameters); } public string NavigateURL(int tabID, bool isSuperTab, PortalSettings settings, string controlKey, string language, string pageName, params string[] additionalParameters) { - return NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); + return this.NavigationManager.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); } public string FriendlyUrl(TabInfo tab, string path) diff --git a/DNN Platform/Library/Common/Lists/CachedCountryList.cs b/DNN Platform/Library/Common/Lists/CachedCountryList.cs index ea240cf2c1a..863905289e5 100644 --- a/DNN Platform/Library/Common/Lists/CachedCountryList.cs +++ b/DNN Platform/Library/Common/Lists/CachedCountryList.cs @@ -44,7 +44,7 @@ public CachedCountryList(string locale) Name = text }; c.NormalizedFullName = c.FullName.NormalizeString(); - Add(li.Value, c); + this.Add(li.Value, c); } } diff --git a/DNN Platform/Library/Common/Lists/ListController.cs b/DNN Platform/Library/Common/Lists/ListController.cs index 3251ec91595..5e1252ffa3b 100644 --- a/DNN Platform/Library/Common/Lists/ListController.cs +++ b/DNN Platform/Library/Common/Lists/ListController.cs @@ -81,7 +81,7 @@ private Dictionary FillListInfoDictionary(IDataReader dr) while (dr.Read()) { // fill business object - ListInfo list = FillListInfo(dr, false); + ListInfo list = this.FillListInfo(dr, false); if (!dic.ContainsKey(list.Key)) { dic.Add(list.Key, list); @@ -106,7 +106,7 @@ private Dictionary GetListInfoDictionary(int portalId) return CBO.GetCachedObject>(new CacheItemArgs(cacheKey, DataCache.ListsCacheTimeOut, DataCache.ListsCachePriority), - c => FillListInfoDictionary(DataProvider.Instance().GetLists(portalId))); + c => this.FillListInfoDictionary(DataProvider.Instance().GetLists(portalId))); } private IEnumerable GetListEntries(string listName, int portalId) @@ -130,7 +130,7 @@ private IEnumerable GetListEntries(string listName, int portalId) public int AddListEntry(ListEntryInfo listEntry) { bool enableSortOrder = listEntry.SortOrder > 0; - ClearListCache(listEntry.PortalID); + this.ClearListCache(listEntry.PortalID); int entryId = DataProvider.Instance().AddListEntry(listEntry.ListName, listEntry.Value, listEntry.TextNonLocalized, @@ -147,7 +147,7 @@ public int AddListEntry(ListEntryInfo listEntry) { EventLogController.Instance.AddLog(listEntry, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LISTENTRY_CREATED); } - if (Thread.CurrentThread.CurrentCulture.Name != Localization.SystemLocale && !NonLocalizedLists.Contains(listEntry.ListName)) + if (Thread.CurrentThread.CurrentCulture.Name != Localization.SystemLocale && !this.NonLocalizedLists.Contains(listEntry.ListName)) { if (string.IsNullOrEmpty(listEntry.ParentKey)) { @@ -158,24 +158,24 @@ public int AddListEntry(ListEntryInfo listEntry) LocalizationProvider.Instance.SaveString(listEntry.ParentKey + "." + listEntry.Value + ".Text", listEntry.TextNonLocalized, listEntry.ResourceFileRoot, Thread.CurrentThread.CurrentCulture.Name, PortalController.Instance.GetCurrentPortalSettings(), LocalizationProvider.CustomizedLocale.None, true, true); } } - ClearEntriesCache(listEntry.ListName, listEntry.PortalID); + this.ClearEntriesCache(listEntry.ListName, listEntry.PortalID); return entryId; } public void DeleteList(string listName, string parentKey) { - DeleteList(listName, parentKey, Null.NullInteger); + this.DeleteList(listName, parentKey, Null.NullInteger); } public void DeleteList(string listName, string parentKey, int portalId) { - ListInfo list = GetListInfo(listName, parentKey, portalId); + ListInfo list = this.GetListInfo(listName, parentKey, portalId); EventLogController.Instance.AddLog("ListName", listName, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, EventLogController.EventLogType.LISTENTRY_DELETED); DataProvider.Instance().DeleteList(listName, parentKey); if (list != null) { - ClearListCache(list.PortalID); - ClearEntriesCache(list.Name, list.PortalID); + this.ClearListCache(list.PortalID); + this.ClearEntriesCache(list.Name, list.PortalID); } } @@ -191,7 +191,7 @@ public void DeleteList(ListInfo list, bool includeChildren) //add Children if (includeChildren) { - foreach (KeyValuePair listPair in GetListInfoDictionary(list.PortalID)) + foreach (KeyValuePair listPair in this.GetListInfoDictionary(list.PortalID)) { if ((listPair.Value.ParentList.StartsWith(list.Key))) { @@ -202,24 +202,24 @@ public void DeleteList(ListInfo list, bool includeChildren) //Delete items in reverse order so deeper descendants are removed before their parents for (int i = lists.Count - 1; i >= 0; i += -1) { - DeleteList(lists.Values[i].Name, lists.Values[i].ParentKey, lists.Values[i].PortalID); + this.DeleteList(lists.Values[i].Name, lists.Values[i].ParentKey, lists.Values[i].PortalID); } } public void DeleteListEntryByID(int entryId, bool deleteChild) { - ListEntryInfo entry = GetListEntryInfo(entryId); + ListEntryInfo entry = this.GetListEntryInfo(entryId); DataProvider.Instance().DeleteListEntryByID(entryId, deleteChild); - ClearListCache(entry.PortalID); - ClearEntriesCache(entry.ListName, entry.PortalID); + this.ClearListCache(entry.PortalID); + this.ClearEntriesCache(entry.ListName, entry.PortalID); } public void DeleteListEntryByListName(string listName, string listValue, bool deleteChild) { - ListEntryInfo entry = GetListEntryInfo(listName, listValue); + ListEntryInfo entry = this.GetListEntryInfo(listName, listValue); DataProvider.Instance().DeleteListEntryByListName(listName, listValue, deleteChild); - ClearListCache(entry.PortalID); - ClearEntriesCache(listName, entry.PortalID); + this.ClearListCache(entry.PortalID); + this.ClearEntriesCache(listName, entry.PortalID); } public ListEntryInfo GetListEntryInfo(int entryId) @@ -229,42 +229,42 @@ public ListEntryInfo GetListEntryInfo(int entryId) public ListEntryInfo GetListEntryInfo(string listName, int entryId) { - return GetListEntries(listName, Null.NullInteger).SingleOrDefault(l => l.EntryID == entryId); + return this.GetListEntries(listName, Null.NullInteger).SingleOrDefault(l => l.EntryID == entryId); } public ListEntryInfo GetListEntryInfo(string listName, string listValue) { - return GetListEntries(listName, Null.NullInteger).SingleOrDefault(l => l.Value == listValue); + return this.GetListEntries(listName, Null.NullInteger).SingleOrDefault(l => l.Value == listValue); } public IEnumerable GetListEntryInfoItems(string listName) { - return GetListEntries(listName, Null.NullInteger); + return this.GetListEntries(listName, Null.NullInteger); } public IEnumerable GetListEntryInfoItems(string listName, string parentKey) { - return GetListEntries(listName, Null.NullInteger).Where(l => l.ParentKey == parentKey); + return this.GetListEntries(listName, Null.NullInteger).Where(l => l.ParentKey == parentKey); } public IEnumerable GetListEntryInfoItems(string listName, string parentKey, int portalId) { - return GetListEntries(listName, portalId).Where(l => l.ParentKey == parentKey); + return this.GetListEntries(listName, portalId).Where(l => l.ParentKey == parentKey); } public Dictionary GetListEntryInfoDictionary(string listName) { - return GetListEntryInfoDictionary(listName, "", Null.NullInteger); + return this.GetListEntryInfoDictionary(listName, "", Null.NullInteger); } public Dictionary GetListEntryInfoDictionary(string listName, string parentKey) { - return GetListEntryInfoDictionary(listName, parentKey, Null.NullInteger); + return this.GetListEntryInfoDictionary(listName, parentKey, Null.NullInteger); } public Dictionary GetListEntryInfoDictionary(string listName, string parentKey, int portalId) { - return ListEntryInfoItemsToDictionary(GetListEntryInfoItems(listName, parentKey, portalId)); + return ListEntryInfoItemsToDictionary(this.GetListEntryInfoItems(listName, parentKey, portalId)); } private static Dictionary ListEntryInfoItemsToDictionary(IEnumerable items) @@ -277,12 +277,12 @@ private static Dictionary ListEntryInfoItemsToDictionary( public ListInfo GetListInfo(string listName) { - return GetListInfo(listName, ""); + return this.GetListInfo(listName, ""); } public ListInfo GetListInfo(string listName, string parentKey) { - return GetListInfo(listName, parentKey, -1); + return this.GetListInfo(listName, parentKey, -1); } public ListInfo GetListInfo(string listName, string parentKey, int portalId) @@ -294,13 +294,13 @@ public ListInfo GetListInfo(string listName, string parentKey, int portalId) key = parentKey + ":"; } key += listName; - Dictionary dicLists = GetListInfoDictionary(portalId); + Dictionary dicLists = this.GetListInfoDictionary(portalId); if (!dicLists.TryGetValue(key, out list)) { IDataReader dr = DataProvider.Instance().GetList(listName, parentKey, portalId); try { - list = FillListInfo(dr, true); + list = this.FillListInfo(dr, true); } finally { @@ -312,23 +312,23 @@ public ListInfo GetListInfo(string listName, string parentKey, int portalId) public ListInfoCollection GetListInfoCollection() { - return GetListInfoCollection(""); + return this.GetListInfoCollection(""); } public ListInfoCollection GetListInfoCollection(string listName) { - return GetListInfoCollection(listName, ""); + return this.GetListInfoCollection(listName, ""); } public ListInfoCollection GetListInfoCollection(string listName, string parentKey) { - return GetListInfoCollection(listName, parentKey, -1); + return this.GetListInfoCollection(listName, parentKey, -1); } public ListInfoCollection GetListInfoCollection(string listName, string parentKey, int portalId) { IList lists = new ListInfoCollection(); - foreach (KeyValuePair listPair in GetListInfoDictionary(portalId).OrderBy(l => l.Value.DisplayName)) + foreach (KeyValuePair listPair in this.GetListInfoDictionary(portalId).OrderBy(l => l.Value.DisplayName)) { ListInfo list = listPair.Value; if ((list.Name == listName || string.IsNullOrEmpty(listName)) && (list.ParentKey == parentKey || string.IsNullOrEmpty(parentKey)) && @@ -348,13 +348,13 @@ public ListInfoCollection GetListInfoCollection(string listName, string parentKe /// The list entry info item to update. public void UpdateListEntry(ListEntryInfo listEntry) { - if (Thread.CurrentThread.CurrentCulture.Name == Localization.SystemLocale || NonLocalizedLists.Contains(listEntry.ListName)) + if (Thread.CurrentThread.CurrentCulture.Name == Localization.SystemLocale || this.NonLocalizedLists.Contains(listEntry.ListName)) { DataProvider.Instance().UpdateListEntry(listEntry.EntryID, listEntry.Value, listEntry.TextNonLocalized, listEntry.Description, UserController.Instance.GetCurrentUserInfo().UserID); } else { - var oldItem = GetListEntryInfo(listEntry.EntryID); // look up existing db record to be able to just update the value or description and not touch the en-US text value + var oldItem = this.GetListEntryInfo(listEntry.EntryID); // look up existing db record to be able to just update the value or description and not touch the en-US text value DataProvider.Instance().UpdateListEntry(listEntry.EntryID, listEntry.Value, oldItem.TextNonLocalized, listEntry.Description, UserController.Instance.GetCurrentUserInfo().UserID); var key = string.IsNullOrEmpty(listEntry.ParentKey) @@ -365,34 +365,34 @@ public void UpdateListEntry(ListEntryInfo listEntry) Thread.CurrentThread.CurrentCulture.Name, PortalController.Instance.GetCurrentPortalSettings(), LocalizationProvider.CustomizedLocale.None, true, true); } EventLogController.Instance.AddLog(listEntry, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.LISTENTRY_UPDATED); - ClearListCache(listEntry.PortalID); - ClearEntriesCache(listEntry.ListName, listEntry.PortalID); + this.ClearListCache(listEntry.PortalID); + this.ClearEntriesCache(listEntry.ListName, listEntry.PortalID); } public void UpdateListSortOrder(int EntryID, bool MoveUp) { DataProvider.Instance().UpdateListSortOrder(EntryID, MoveUp); - ListEntryInfo entry = GetListEntryInfo(EntryID); - ClearListCache(entry.PortalID); - ClearEntriesCache(entry.ListName, entry.PortalID); + ListEntryInfo entry = this.GetListEntryInfo(EntryID); + this.ClearListCache(entry.PortalID); + this.ClearEntriesCache(entry.ListName, entry.PortalID); } [Obsolete("Obsoleted in 6.0.1 use IEnumerable GetListEntryInfoXXX(string) instead. Scheduled removal in v10.0.0."), EditorBrowsable(EditorBrowsableState.Never)] public ListEntryInfoCollection GetListEntryInfoCollection(string listName) { - return GetListEntryInfoCollection(listName, "", Null.NullInteger); + return this.GetListEntryInfoCollection(listName, "", Null.NullInteger); } [Obsolete("Obsoleted in 6.0.1 use IEnumerable GetListEntryInfoXXX(string, string, int) instead. Scheduled removal in v10.0.0."), EditorBrowsable(EditorBrowsableState.Never)] public ListEntryInfoCollection GetListEntryInfoCollection(string listName, string parentKey) { - return GetListEntryInfoCollection(listName, parentKey, Null.NullInteger); + return this.GetListEntryInfoCollection(listName, parentKey, Null.NullInteger); } [Obsolete("Obsoleted in 6.0.1 use IEnumerable GetListEntryInfoXXX(string, string, int) instead. Scheduled removal in v10.0.0."), EditorBrowsable(EditorBrowsableState.Never)] public ListEntryInfoCollection GetListEntryInfoCollection(string listName, string parentKey, int portalId) { - var items = GetListEntryInfoItems(listName, parentKey, portalId); + var items = this.GetListEntryInfoItems(listName, parentKey, portalId); var collection = new ListEntryInfoCollection(); if (items != null) diff --git a/DNN Platform/Library/Common/Lists/ListEntryCollection.cs b/DNN Platform/Library/Common/Lists/ListEntryCollection.cs index 21f5dbd2d1a..3eb6930469f 100644 --- a/DNN Platform/Library/Common/Lists/ListEntryCollection.cs +++ b/DNN Platform/Library/Common/Lists/ListEntryCollection.cs @@ -40,7 +40,7 @@ public ListEntryInfo Item(string key) // try { - if (_keyIndexLookup[key.ToLowerInvariant()] == null) + if (this._keyIndexLookup[key.ToLowerInvariant()] == null) { return null; } @@ -50,18 +50,18 @@ public ListEntryInfo Item(string key) Logger.Error(exc); return null; } - index = Convert.ToInt32(_keyIndexLookup[key.ToLowerInvariant()]); + index = Convert.ToInt32(this._keyIndexLookup[key.ToLowerInvariant()]); return (ListEntryInfo) base.List[index]; } public ListEntryInfo GetChildren(string parentName) { - return Item(parentName); + return this.Item(parentName); } internal new void Clear() { - _keyIndexLookup.Clear(); + this._keyIndexLookup.Clear(); base.Clear(); } @@ -71,7 +71,7 @@ public void Add(string key, ListEntryInfo value) try //Do validation first { index = base.List.Add(value); - _keyIndexLookup.Add(key.ToLowerInvariant(), index); + this._keyIndexLookup.Add(key.ToLowerInvariant(), index); } catch (Exception exc) { diff --git a/DNN Platform/Library/Common/Lists/ListEntryInfo.cs b/DNN Platform/Library/Common/Lists/ListEntryInfo.cs index aee1422d813..4a411a74594 100644 --- a/DNN Platform/Library/Common/Lists/ListEntryInfo.cs +++ b/DNN Platform/Library/Common/Lists/ListEntryInfo.cs @@ -19,12 +19,12 @@ public class ListEntryInfo { public ListEntryInfo() { - ParentKey = Null.NullString; - Parent = Null.NullString; - Description = Null.NullString; - Text = Null.NullString; - Value = Null.NullString; - ListName = Null.NullString; + this.ParentKey = Null.NullString; + this.Parent = Null.NullString; + this.Description = Null.NullString; + this.Text = Null.NullString; + this.Value = Null.NullString; + this.ListName = Null.NullString; } public int EntryID { get; set; } @@ -35,12 +35,12 @@ public string Key { get { - string _Key = ParentKey.Replace(":", "."); + string _Key = this.ParentKey.Replace(":", "."); if (!string.IsNullOrEmpty(_Key)) { _Key += "."; } - return _Key + ListName + ":" + Value; + return _Key + this.ListName + ":" + this.Value; } } @@ -50,7 +50,7 @@ public string DisplayName { get { - return ListName + ":" + Text; + return this.ListName + ":" + this.Text; } } @@ -72,27 +72,27 @@ public string Text try { string key; - if (string.IsNullOrEmpty(ParentKey)) + if (string.IsNullOrEmpty(this.ParentKey)) { - key = Value + ".Text"; + key = this.Value + ".Text"; } else { - key = ParentKey + '.' + Value + ".Text"; + key = this.ParentKey + '.' + this.Value + ".Text"; } - res = Services.Localization.Localization.GetString(key, ResourceFileRoot); + res = Services.Localization.Localization.GetString(key, this.ResourceFileRoot); } catch { //ignore } - if (string.IsNullOrEmpty(res)) { res = _Text; }; + if (string.IsNullOrEmpty(res)) { res = this._Text; }; return res; } set { - _Text = value; + this._Text = value; } } @@ -106,7 +106,7 @@ public string TextNonLocalized { get { - return _Text; + return this._Text; } } @@ -132,7 +132,7 @@ internal string ResourceFileRoot { get { - var listName = ListName.Replace(":", "."); + var listName = this.ListName.Replace(":", "."); if (listName.IndexOfAny(Path.GetInvalidFileNameChars()) > -1) { listName = Globals.CleanFileName(listName); diff --git a/DNN Platform/Library/Common/Lists/ListInfo.cs b/DNN Platform/Library/Common/Lists/ListInfo.cs index 85c63af9805..d8155e93469 100644 --- a/DNN Platform/Library/Common/Lists/ListInfo.cs +++ b/DNN Platform/Library/Common/Lists/ListInfo.cs @@ -20,14 +20,14 @@ public ListInfo() : this(String.Empty) { } public ListInfo(string Name) { - SystemList = Null.NullBoolean; - EnableSortOrder = Null.NullBoolean; - IsPopulated = Null.NullBoolean; - ParentList = Null.NullString; - Parent = Null.NullString; - ParentKey = Null.NullString; - PortalID = Null.NullInteger; - DefinitionID = Null.NullInteger; + this.SystemList = Null.NullBoolean; + this.EnableSortOrder = Null.NullBoolean; + this.IsPopulated = Null.NullBoolean; + this.ParentList = Null.NullString; + this.Parent = Null.NullString; + this.ParentKey = Null.NullString; + this.PortalID = Null.NullInteger; + this.DefinitionID = Null.NullInteger; this.Name = Name; } @@ -37,12 +37,12 @@ public string DisplayName { get { - string _DisplayName = Parent; + string _DisplayName = this.Parent; if (!string.IsNullOrEmpty(_DisplayName)) { _DisplayName += ":"; } - return _DisplayName + Name; + return _DisplayName + this.Name; } } @@ -56,12 +56,12 @@ public string Key { get { - string _Key = ParentKey; + string _Key = this.ParentKey; if (!string.IsNullOrEmpty(_Key)) { _Key += ":"; } - return _Key + Name; + return _Key + this.Name; } } diff --git a/DNN Platform/Library/Common/Lists/ListInfoCollection.cs b/DNN Platform/Library/Common/Lists/ListInfoCollection.cs index 796f98a84b2..9beecea572f 100644 --- a/DNN Platform/Library/Common/Lists/ListInfoCollection.cs +++ b/DNN Platform/Library/Common/Lists/ListInfoCollection.cs @@ -21,12 +21,12 @@ public class ListInfoCollection : CollectionBase public ListInfo GetChildren(string ParentName) { - return (ListInfo) Item(ParentName); + return (ListInfo) this.Item(ParentName); } internal new void Clear() { - mKeyIndexLookup.Clear(); + this.mKeyIndexLookup.Clear(); base.Clear(); } @@ -37,7 +37,7 @@ public void Add(string key, object value) try { index = base.List.Add(value); - mKeyIndexLookup.Add(key.ToLowerInvariant(), index); + this.mKeyIndexLookup.Add(key.ToLowerInvariant(), index); } catch (Exception exc) { @@ -66,7 +66,7 @@ public object Item(string key) object obj; try //Do validation first { - if (mKeyIndexLookup[key.ToLowerInvariant()] == null) + if (this.mKeyIndexLookup[key.ToLowerInvariant()] == null) { return null; } @@ -76,7 +76,7 @@ public object Item(string key) Logger.Error(exc); return null; } - index = Convert.ToInt32(mKeyIndexLookup[key.ToLowerInvariant()]); + index = Convert.ToInt32(this.mKeyIndexLookup[key.ToLowerInvariant()]); obj = base.List[index]; return obj; } @@ -89,7 +89,7 @@ public object Item(string key, bool Cache) bool itemExists = false; try //Do validation first { - if (mKeyIndexLookup[key.ToLowerInvariant()] != null) + if (this.mKeyIndexLookup[key.ToLowerInvariant()] != null) { itemExists = true; } @@ -108,13 +108,13 @@ public object Item(string key, bool Cache) //the collection has been cache, so add this entry list into it if specified if (Cache) { - Add(listInfo.Key, listInfo); + this.Add(listInfo.Key, listInfo); return listInfo; } } else { - index = Convert.ToInt32(mKeyIndexLookup[key.ToLowerInvariant()]); + index = Convert.ToInt32(this.mKeyIndexLookup[key.ToLowerInvariant()]); obj = base.List[index]; } return obj; @@ -123,7 +123,7 @@ public object Item(string key, bool Cache) public ArrayList GetChild(string ParentKey) { var childList = new ArrayList(); - foreach (object child in List) + foreach (object child in this.List) { if (((ListInfo) child).Key.IndexOf(ParentKey.ToLowerInvariant()) > -1) { diff --git a/DNN Platform/Library/Common/NavigationManager.cs b/DNN Platform/Library/Common/NavigationManager.cs index cf05bd6f13b..ea763263020 100644 --- a/DNN Platform/Library/Common/NavigationManager.cs +++ b/DNN Platform/Library/Common/NavigationManager.cs @@ -20,7 +20,7 @@ internal class NavigationManager : INavigationManager private readonly IPortalController _portalController; public NavigationManager(IPortalController portalController) { - _portalController = portalController; + this._portalController = portalController; } /// @@ -29,8 +29,8 @@ public NavigationManager(IPortalController portalController) /// Formatted URL. public string NavigateURL() { - PortalSettings portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(portalSettings.ActiveTab.TabID, Null.NullString); + PortalSettings portalSettings = this._portalController.GetCurrentPortalSettings(); + return this.NavigateURL(portalSettings.ActiveTab.TabID, Null.NullString); } /// @@ -40,7 +40,7 @@ public string NavigateURL() /// Formatted URL. public string NavigateURL(int tabID) { - return NavigateURL(tabID, Null.NullString); + return this.NavigateURL(tabID, Null.NullString); } /// @@ -51,9 +51,9 @@ public string NavigateURL(int tabID) /// Formatted URL. public string NavigateURL(int tabID, bool isSuperTab) { - IPortalSettings _portalSettings = _portalController.GetCurrentSettings(); + IPortalSettings _portalSettings = this._portalController.GetCurrentSettings(); string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, _portalSettings); - return NavigateURL(tabID, isSuperTab, _portalSettings, Null.NullString, cultureCode); + return this.NavigateURL(tabID, isSuperTab, _portalSettings, Null.NullString, cultureCode); } /// @@ -69,8 +69,8 @@ public string NavigateURL(string controlKey) } else { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(_portalSettings.ActiveTab.TabID, controlKey); + PortalSettings _portalSettings = this._portalController.GetCurrentPortalSettings(); + return this.NavigateURL(_portalSettings.ActiveTab.TabID, controlKey); } } @@ -82,8 +82,8 @@ public string NavigateURL(string controlKey) /// Formatted URL. public string NavigateURL(string controlKey, params string[] additionalParameters) { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(_portalSettings?.ActiveTab?.TabID ?? -1, controlKey, additionalParameters); + PortalSettings _portalSettings = this._portalController.GetCurrentPortalSettings(); + return this.NavigateURL(_portalSettings?.ActiveTab?.TabID ?? -1, controlKey, additionalParameters); } /// @@ -94,8 +94,8 @@ public string NavigateURL(string controlKey, params string[] additionalParameter /// Formatted URL. public string NavigateURL(int tabID, string controlKey) { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(tabID, _portalSettings, controlKey, null); + PortalSettings _portalSettings = this._portalController.GetCurrentPortalSettings(); + return this.NavigateURL(tabID, _portalSettings, controlKey, null); } /// @@ -107,8 +107,8 @@ public string NavigateURL(int tabID, string controlKey) /// Formatted URL. public string NavigateURL(int tabID, string controlKey, params string[] additionalParameters) { - PortalSettings _portalSettings = _portalController.GetCurrentPortalSettings(); - return NavigateURL(tabID, _portalSettings, controlKey, additionalParameters); + PortalSettings _portalSettings = this._portalController.GetCurrentPortalSettings(); + return this.NavigateURL(tabID, _portalSettings, controlKey, additionalParameters); } /// @@ -123,7 +123,7 @@ public string NavigateURL(int tabID, IPortalSettings settings, string controlKey { bool isSuperTab = Globals.IsHostTab(tabID); - return NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); + return this.NavigateURL(tabID, isSuperTab, settings, controlKey, additionalParameters); } /// @@ -138,7 +138,7 @@ public string NavigateURL(int tabID, IPortalSettings settings, string controlKey public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, params string[] additionalParameters) { string cultureCode = Globals.GetCultureCode(tabID, isSuperTab, settings); - return NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); + return this.NavigateURL(tabID, isSuperTab, settings, controlKey, cultureCode, additionalParameters); } /// @@ -153,7 +153,7 @@ public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, /// Formatted URL. public string NavigateURL(int tabID, bool isSuperTab, IPortalSettings settings, string controlKey, string language, params string[] additionalParameters) { - return NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); + return this.NavigateURL(tabID, isSuperTab, settings, controlKey, language, Globals.glbDefaultPage, additionalParameters); } /// diff --git a/DNN Platform/Library/Common/SerializableKeyValuePair.cs b/DNN Platform/Library/Common/SerializableKeyValuePair.cs index d6646943ecd..7503336082e 100644 --- a/DNN Platform/Library/Common/SerializableKeyValuePair.cs +++ b/DNN Platform/Library/Common/SerializableKeyValuePair.cs @@ -20,8 +20,8 @@ public class SerializableKeyValuePair public SerializableKeyValuePair(TKey key, TValue value) { - Key = key; - Value = value; + this.Key = key; + this.Value = value; } public override string ToString() diff --git a/DNN Platform/Library/Common/Utilities/CacheItemArgs.cs b/DNN Platform/Library/Common/Utilities/CacheItemArgs.cs index 4954ba7fc5f..6d6550f32a5 100644 --- a/DNN Platform/Library/Common/Utilities/CacheItemArgs.cs +++ b/DNN Platform/Library/Common/Utilities/CacheItemArgs.cs @@ -86,10 +86,10 @@ public CacheItemArgs(string key, int timeout, CacheItemPriority priority) ///----------------------------------------------------------------------------- public CacheItemArgs(string key, int timeout, CacheItemPriority priority, params object[] parameters) { - CacheKey = key; - CacheTimeOut = timeout; - CachePriority = priority; - Params = parameters; + this.CacheKey = key; + this.CacheTimeOut = timeout; + this.CachePriority = priority; + this.Params = parameters; } ///----------------------------------------------------------------------------- @@ -138,20 +138,20 @@ public ArrayList ParamList { get { - if (_paramList == null) + if (this._paramList == null) { - _paramList = new ArrayList(); + this._paramList = new ArrayList(); //add additional params to this list if its not null - if (Params != null) + if (this.Params != null) { - foreach (object param in Params) + foreach (object param in this.Params) { - _paramList.Add(param); + this._paramList.Add(param); } } } - return _paramList; + return this._paramList; } } diff --git a/DNN Platform/Library/Common/Utilities/FileExtensionWhitelist.cs b/DNN Platform/Library/Common/Utilities/FileExtensionWhitelist.cs index dd4d499eeb0..e3be2cd2165 100644 --- a/DNN Platform/Library/Common/Utilities/FileExtensionWhitelist.cs +++ b/DNN Platform/Library/Common/Utilities/FileExtensionWhitelist.cs @@ -20,7 +20,7 @@ public class FileExtensionWhitelist /// should not have an '.' in the extensions (e.g. txt,jpg,png,doc) public FileExtensionWhitelist(string extensionList) { - _extensions = EscapedString.Seperate(extensionList.ToLowerInvariant()).Select(item => "." + item).ToList(); + this._extensions = EscapedString.Seperate(extensionList.ToLowerInvariant()).Select(item => "." + item).ToList(); } /// @@ -29,7 +29,7 @@ public FileExtensionWhitelist(string extensionList) /// A String of the whitelist extensions formatted for display to an end user public string ToDisplayString() { - return ToDisplayString(null); + return this.ToDisplayString(null); } /// @@ -40,7 +40,7 @@ public string ToDisplayString() /// A String of the whitelist extensions formatted for storage display to an end user public string ToDisplayString(IEnumerable additionalExtensions) { - IEnumerable allExtensions = CombineLists(additionalExtensions); + IEnumerable allExtensions = this.CombineLists(additionalExtensions); return "*" + string.Join(", *", allExtensions.ToArray()); } @@ -52,7 +52,7 @@ public IEnumerable AllowedExtensions { get { - return _extensions; + return this._extensions; } } @@ -63,7 +63,7 @@ public IEnumerable AllowedExtensions /// True if extension is in whitelist or whitelist is empty. False otherwise. public bool IsAllowedExtension(String extension) { - return IsAllowedExtension(extension, null); + return this.IsAllowedExtension(extension, null); } /// @@ -74,7 +74,7 @@ public bool IsAllowedExtension(String extension) /// True if extension is in whitelist or whitelist is empty. False otherwise. public bool IsAllowedExtension(string extension, IEnumerable additionalExtensions) { - List allExtensions = CombineLists(additionalExtensions).ToList(); + List allExtensions = this.CombineLists(additionalExtensions).ToList(); if (!allExtensions.Any()) { return true; @@ -94,7 +94,7 @@ public bool IsAllowedExtension(string extension, IEnumerable additionalE public override string ToString() { - return ToDisplayString(); + return this.ToDisplayString(); } /// @@ -103,7 +103,7 @@ public override string ToString() /// A String of the whitelist extensions formatted for storage as a Host setting public string ToStorageString() { - return ToStorageString(null); + return this.ToStorageString(null); } /// @@ -114,7 +114,7 @@ public string ToStorageString() /// A String of the whitelist extensions formatted for storage as a Host setting public string ToStorageString(IEnumerable additionalExtensions) { - IEnumerable allExtensions = CombineLists(additionalExtensions); + IEnumerable allExtensions = this.CombineLists(additionalExtensions); var leadingDotRemoved = allExtensions.Select(ext => ext.Substring(1)); return EscapedString.Combine(leadingDotRemoved); } @@ -123,18 +123,18 @@ private IEnumerable CombineLists(IEnumerable additionalExtension { if (additionalExtensions == null) { - return _extensions; + return this._extensions; } //toList required to ensure that multiple enumerations of the list are possible var additionalExtensionsList = additionalExtensions.ToList(); if (!additionalExtensionsList.Any()) { - return _extensions; + return this._extensions; } - var normalizedExtensions = NormalizeExtensions(additionalExtensionsList); - return _extensions.Union(normalizedExtensions); + var normalizedExtensions = this.NormalizeExtensions(additionalExtensionsList); + return this._extensions.Union(normalizedExtensions); } private IEnumerable NormalizeExtensions(IEnumerable additionalExtensions) @@ -145,7 +145,7 @@ private IEnumerable NormalizeExtensions(IEnumerable additionalEx public FileExtensionWhitelist RestrictBy(FileExtensionWhitelist parentList) { var filter = parentList._extensions; - return new FileExtensionWhitelist(string.Join(",", _extensions.Where(x => filter.Contains(x)).Select(s => s.Substring(1)))); + return new FileExtensionWhitelist(string.Join(",", this._extensions.Where(x => filter.Contains(x)).Select(s => s.Substring(1)))); } } } diff --git a/DNN Platform/Library/Common/Utilities/FileSystemPermissionVerifier.cs b/DNN Platform/Library/Common/Utilities/FileSystemPermissionVerifier.cs index 64e1fdce8c5..9c5a9ae2a4b 100644 --- a/DNN Platform/Library/Common/Utilities/FileSystemPermissionVerifier.cs +++ b/DNN Platform/Library/Common/Utilities/FileSystemPermissionVerifier.cs @@ -34,19 +34,19 @@ public string BasePath { get { - return _basePath; + return this._basePath; } } public FileSystemPermissionVerifier(string basePath) { - _basePath = basePath; + this._basePath = basePath; } public FileSystemPermissionVerifier(string basePath, int retryTimes) : this(basePath) { - _retryTimes = retryTimes; + this._retryTimes = retryTimes; } /// ----------------------------------------------------------------------------- @@ -56,13 +56,13 @@ public FileSystemPermissionVerifier(string basePath, int retryTimes) : this(base /// ----------------------------------------------------------------------------- private bool VerifyFileCreate() { - string verifyPath = Path.Combine(_basePath, "Verify\\Verify.txt"); + string verifyPath = Path.Combine(this._basePath, "Verify\\Verify.txt"); bool verified = true; //Attempt to create the File try { - Try(() => FileCreateAction(verifyPath), "Creating verification file"); + this.Try(() => FileCreateAction(verifyPath), "Creating verification file"); } catch (Exception exc) { @@ -93,13 +93,13 @@ private static void FileCreateAction(string verifyPath) /// ----------------------------------------------------------------------------- private bool VerifyFileDelete() { - string verifyPath = Path.Combine(_basePath, "Verify\\Verify.txt"); + string verifyPath = Path.Combine(this._basePath, "Verify\\Verify.txt"); bool verified = true; //Attempt to delete the File try { - Try(() => File.Delete(verifyPath), "Deleting verification file"); + this.Try(() => File.Delete(verifyPath), "Deleting verification file"); } catch (Exception exc) { @@ -117,13 +117,13 @@ private bool VerifyFileDelete() /// ----------------------------------------------------------------------------- private bool VerifyFolderCreate() { - string verifyPath = Path.Combine(_basePath, "Verify"); + string verifyPath = Path.Combine(this._basePath, "Verify"); bool verified = true; //Attempt to create the Directory try { - Try(() => FolderCreateAction(verifyPath), "Creating verification folder"); + this.Try(() => FolderCreateAction(verifyPath), "Creating verification folder"); } catch (Exception exc) { @@ -151,13 +151,13 @@ private static void FolderCreateAction(string verifyPath) /// ----------------------------------------------------------------------------- private bool VerifyFolderDelete() { - string verifyPath = Path.Combine(_basePath, "Verify"); + string verifyPath = Path.Combine(this._basePath, "Verify"); bool verified = true; //Attempt to delete the Directory try { - Try(() => Directory.Delete(verifyPath, true), "Deleting verification folder"); + this.Try(() => Directory.Delete(verifyPath, true), "Deleting verification folder"); } catch (Exception exc) { @@ -173,16 +173,16 @@ public bool VerifyAll() lock (typeof(FileSystemPermissionVerifier)) { // All these steps must be executed in this sequence as one unit - return VerifyFolderCreate() && - VerifyFileCreate() && - VerifyFileDelete() && - VerifyFolderDelete(); + return this.VerifyFolderCreate() && + this.VerifyFileCreate() && + this.VerifyFileDelete() && + this.VerifyFolderDelete(); } } private void Try(Action action, string description) { - new RetryableAction(action, description, _retryTimes, TimeSpan.FromSeconds(1)).TryIt(); + new RetryableAction(action, description, this._retryTimes, TimeSpan.FromSeconds(1)).TryIt(); } } } diff --git a/DNN Platform/Library/Common/Utilities/JavaScriptObjectDictionary.cs b/DNN Platform/Library/Common/Utilities/JavaScriptObjectDictionary.cs index 043d56f0c6a..a3b2421e191 100644 --- a/DNN Platform/Library/Common/Utilities/JavaScriptObjectDictionary.cs +++ b/DNN Platform/Library/Common/Utilities/JavaScriptObjectDictionary.cs @@ -17,18 +17,18 @@ internal OrderedDictionary Dictionary { get { - return _dictionary ?? (_dictionary = new OrderedDictionary()); + return this._dictionary ?? (this._dictionary = new OrderedDictionary()); } } public void AddMethodBody(string name, string methodBody) { - AddMethod(name, "function() { " + methodBody + "; }"); + this.AddMethod(name, "function() { " + methodBody + "; }"); } public void AddMethod(string name, string method) { - Dictionary[name] = method; + this.Dictionary[name] = method; } private static string ToJsonString(IEnumerable> methods) @@ -125,7 +125,7 @@ public string ToJavaScriptArrayString() public IEnumerator> GetEnumerator() { - var enumerator = Dictionary.GetEnumerator(); + var enumerator = this.Dictionary.GetEnumerator(); while (enumerator.MoveNext()) { yield return new KeyValuePair(enumerator.Key.ToString(), enumerator.Value.ToString()); @@ -134,15 +134,15 @@ public IEnumerator> GetEnumerator() private IEnumerator GetEnumeratorPrivate() { - return GetEnumerator(); + return this.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { - return GetEnumeratorPrivate(); + return this.GetEnumeratorPrivate(); } public override string ToString() { - return _dictionary == null ? string.Empty : _dictionary.ToString(); + return this._dictionary == null ? string.Empty : this._dictionary.ToString(); } } diff --git a/DNN Platform/Library/Common/Utilities/ObjectMappingInfo.cs b/DNN Platform/Library/Common/Utilities/ObjectMappingInfo.cs index 0a6065f7e1d..ddca9b99147 100644 --- a/DNN Platform/Library/Common/Utilities/ObjectMappingInfo.cs +++ b/DNN Platform/Library/Common/Utilities/ObjectMappingInfo.cs @@ -45,8 +45,8 @@ public class ObjectMappingInfo ///----------------------------------------------------------------------------- public ObjectMappingInfo() { - _Properties = new Dictionary(); - _ColumnNames = new Dictionary(); + this._Properties = new Dictionary(); + this._ColumnNames = new Dictionary(); } /// ----------------------------------------------------------------------------- @@ -59,10 +59,10 @@ public string CacheKey { get { - string _CacheKey = RootCacheKey + TableName + "_"; - if (!string.IsNullOrEmpty(CacheByProperty)) + string _CacheKey = RootCacheKey + this.TableName + "_"; + if (!string.IsNullOrEmpty(this.CacheByProperty)) { - _CacheKey += CacheByProperty + "_"; + _CacheKey += this.CacheByProperty + "_"; } return _CacheKey; } @@ -80,11 +80,11 @@ public string CacheByProperty { get { - return _CacheByProperty; + return this._CacheByProperty; } set { - _CacheByProperty = value; + this._CacheByProperty = value; } } @@ -100,11 +100,11 @@ public int CacheTimeOutMultiplier { get { - return _CacheTimeOutMultiplier; + return this._CacheTimeOutMultiplier; } set { - _CacheTimeOutMultiplier = value; + this._CacheTimeOutMultiplier = value; } } @@ -117,7 +117,7 @@ public Dictionary ColumnNames { get { - return _ColumnNames; + return this._ColumnNames; } } @@ -130,11 +130,11 @@ public string ObjectType { get { - return _ObjectType; + return this._ObjectType; } set { - _ObjectType = value; + this._ObjectType = value; } } @@ -148,11 +148,11 @@ public string PrimaryKey { get { - return _PrimaryKey; + return this._PrimaryKey; } set { - _PrimaryKey = value; + this._PrimaryKey = value; } } @@ -165,7 +165,7 @@ public Dictionary Properties { get { - return _Properties; + return this._Properties; } } @@ -179,11 +179,11 @@ public string TableName { get { - return _TableName; + return this._TableName; } set { - _TableName = value; + this._TableName = value; } } } diff --git a/DNN Platform/Library/Common/Utilities/PathUtils.cs b/DNN Platform/Library/Common/Utilities/PathUtils.cs index 1353043cf31..2c162efff43 100644 --- a/DNN Platform/Library/Common/Utilities/PathUtils.cs +++ b/DNN Platform/Library/Common/Utilities/PathUtils.cs @@ -75,7 +75,7 @@ public virtual string GetPhysicalPath(int portalID, string relativePath) { Requires.PropertyNotNull("relativePath", relativePath); - var path1 = GetRootFolderMapPath(portalID); + var path1 = this.GetRootFolderMapPath(portalID); var path2 = relativePath.Replace("/", "\\"); if (Path.IsPathRooted(path2)) @@ -85,7 +85,7 @@ public virtual string GetPhysicalPath(int portalID, string relativePath) var physicalPath = Path.Combine(path1, path2); - return RemoveTrailingSlash(physicalPath); + return this.RemoveTrailingSlash(physicalPath); } /// @@ -100,7 +100,7 @@ public virtual string GetRelativePath(int portalID, string physicalPath) throw new ArgumentException("The argument 'physicalPath' is not a valid path. " + physicalPath); } - var rootFolderMapPath = RemoveTrailingSlash(GetRootFolderMapPath(portalID)); + var rootFolderMapPath = this.RemoveTrailingSlash(this.GetRootFolderMapPath(portalID)); string relativePath; @@ -120,7 +120,7 @@ public virtual string GetRelativePath(int portalID, string physicalPath) throw new ArgumentException("The argument 'physicalPath' is not a valid path."); } - return FormatFolderPath(relativePath); + return this.FormatFolderPath(relativePath); } /// @@ -149,7 +149,7 @@ public virtual string GetUserFolderPath(UserInfo user) /// The element from the user folder path. public virtual string GetUserFolderPathElement(int userID, UserFolderElement mode) { - return GetUserFolderPathElementInternal(userID, mode); + return this.GetUserFolderPathElementInternal(userID, mode); } internal string GetUserFolderPathElementInternal(int userId, UserFolderElement mode) @@ -173,8 +173,8 @@ internal string GetUserFolderPathElementInternal(int userId, UserFolderElement m internal string GetUserFolderPathInternal(UserInfo user) { - var rootFolder = GetUserFolderPathElementInternal(user.UserID, UserFolderElement.Root); - var subFolder = GetUserFolderPathElementInternal(user.UserID, UserFolderElement.SubFolder); + var rootFolder = this.GetUserFolderPathElementInternal(user.UserID, UserFolderElement.Root); + var subFolder = this.GetUserFolderPathElementInternal(user.UserID, UserFolderElement.SubFolder); var fullPath = Path.Combine(Path.Combine(rootFolder, subFolder), user.UserID.ToString(CultureInfo.InvariantCulture)); @@ -224,7 +224,7 @@ public virtual string MapPath(string path) if (path.StartsWith("~") | path.StartsWith(".") | path.StartsWith("/")) { - convertedPath = convertedPath.Length > 1 ? string.Concat(AddTrailingSlash(applicationMapPath), convertedPath.Substring(1)) : applicationMapPath; + convertedPath = convertedPath.Length > 1 ? string.Concat(this.AddTrailingSlash(applicationMapPath), convertedPath.Substring(1)) : applicationMapPath; } convertedPath = Path.GetFullPath(convertedPath); diff --git a/DNN Platform/Library/Common/Utilities/RetryableAction.cs b/DNN Platform/Library/Common/Utilities/RetryableAction.cs index af38a8c7f63..c97486fdd5f 100644 --- a/DNN Platform/Library/Common/Utilities/RetryableAction.cs +++ b/DNN Platform/Library/Common/Utilities/RetryableAction.cs @@ -78,43 +78,43 @@ public RetryableAction(Action action, string description, int maxRetries, TimeSp throw new ArgumentException(string.Format("delay must be less than {0} milliseconds", int.MaxValue)); } - Action = action; - Description = description; - MaxRetries = maxRetries; - Delay = delay; - DelayMultiplier = delayMultiplier; + this.Action = action; + this.Description = description; + this.MaxRetries = maxRetries; + this.Delay = delay; + this.DelayMultiplier = delayMultiplier; } public void TryIt() { - var currentDelay = (int) Delay.TotalMilliseconds; - int retrysRemaining = MaxRetries; + var currentDelay = (int) this.Delay.TotalMilliseconds; + int retrysRemaining = this.MaxRetries; do { try { - Action(); + this.Action(); if (Logger.IsTraceEnabled) - Logger.TraceFormat("Action succeeded - {0}", Description); + Logger.TraceFormat("Action succeeded - {0}", this.Description); return; } catch(Exception) { if (retrysRemaining <= 0) { - Logger.WarnFormat("All retries of action failed - {0}", Description); + Logger.WarnFormat("All retries of action failed - {0}", this.Description); throw; } if (Logger.IsTraceEnabled) - Logger.TraceFormat("Retrying action {0} - {1}", retrysRemaining, Description); + Logger.TraceFormat("Retrying action {0} - {1}", retrysRemaining, this.Description); SleepAction.Invoke(currentDelay); const double epsilon = 0.0001; - if(Math.Abs(DelayMultiplier - 1) > epsilon) + if(Math.Abs(this.DelayMultiplier - 1) > epsilon) { - currentDelay = (int)(currentDelay * DelayMultiplier); + currentDelay = (int)(currentDelay * this.DelayMultiplier); } } retrysRemaining--; diff --git a/DNN Platform/Library/Common/Utilities/StateVariable.cs b/DNN Platform/Library/Common/Utilities/StateVariable.cs index 63bdd3f56e4..96d22fdebdb 100644 --- a/DNN Platform/Library/Common/Utilities/StateVariable.cs +++ b/DNN Platform/Library/Common/Utilities/StateVariable.cs @@ -30,7 +30,7 @@ protected StateVariable(string key) { throw new ArgumentNullException("key"); } - _key = key + GetType().FullName; + this._key = key + this.GetType().FullName; } /// @@ -50,11 +50,11 @@ protected StateVariable(string key, Func initializer) : this(key) private object GetInitializedInternalValue() { - var value = this[_key]; - if (value == null && _initializer != null) + var value = this[this._key]; + if (value == null && this._initializer != null) { - value = _initializer(); - this[_key] = value; + value = this._initializer(); + this[this._key] = value; } return value; } @@ -82,7 +82,7 @@ public bool HasValue { get { - return this[_key] != null; + return this[this._key] != null; } } @@ -96,16 +96,16 @@ public T Value { get { - var returnedValue = GetInitializedInternalValue(); + var returnedValue = this.GetInitializedInternalValue(); if (returnedValue == null) { - throw new InvalidOperationException("There is no value for the '" + _key + "' key."); + throw new InvalidOperationException("There is no value for the '" + this._key + "' key."); } return (T)returnedValue; } set { - this[_key] = value; + this[this._key] = value; } } @@ -116,7 +116,7 @@ public T ValueOrDefault { get { - var returnedValue = GetInitializedInternalValue(); + var returnedValue = this.GetInitializedInternalValue(); if (returnedValue == null) { return default(T); @@ -130,7 +130,7 @@ public T ValueOrDefault /// public void Clear() { - Remove(_key); + this.Remove(this._key); } } diff --git a/DNN Platform/Library/Common/Utilities/UrlController.cs b/DNN Platform/Library/Common/Utilities/UrlController.cs index b13a26f4727..37b45148b56 100644 --- a/DNN Platform/Library/Common/Utilities/UrlController.cs +++ b/DNN Platform/Library/Common/Utilities/UrlController.cs @@ -38,7 +38,7 @@ public UrlTrackingInfo GetUrlTracking(int PortalID, string Url, int ModuleId) public void UpdateUrl(int PortalID, string Url, string UrlType, bool LogActivity, bool TrackClicks, int ModuleID, bool NewWindow) { - UpdateUrl(PortalID, Url, UrlType, 0, Null.NullDate, Null.NullDate, LogActivity, TrackClicks, ModuleID, NewWindow); + this.UpdateUrl(PortalID, Url, UrlType, 0, Null.NullDate, Null.NullDate, LogActivity, TrackClicks, ModuleID, NewWindow); } public void UpdateUrl(int PortalID, string Url, string UrlType, int Clicks, DateTime LastClick, DateTime CreatedDate, bool LogActivity, bool TrackClicks, int ModuleID, bool NewWindow) @@ -47,12 +47,12 @@ public void UpdateUrl(int PortalID, string Url, string UrlType, int Clicks, Date { if (UrlType == "U") { - if (GetUrl(PortalID, Url) == null) + if (this.GetUrl(PortalID, Url) == null) { DataProvider.Instance().AddUrl(PortalID, Url.Replace(@"\", @"/")); } } - UrlTrackingInfo objURLTracking = GetUrlTracking(PortalID, Url, ModuleID); + UrlTrackingInfo objURLTracking = this.GetUrlTracking(PortalID, Url, ModuleID); if (objURLTracking == null) { DataProvider.Instance().AddUrlTracking(PortalID, Url, UrlType, LogActivity, TrackClicks, ModuleID, NewWindow); @@ -84,7 +84,7 @@ public void UpdateUrlTracking(int PortalID, string Url, int ModuleId, int UserID Url = "FileID=" + file.FileId; } - UrlTrackingInfo objUrlTracking = GetUrlTracking(PortalID, Url, ModuleId); + UrlTrackingInfo objUrlTracking = this.GetUrlTracking(PortalID, Url, ModuleId); if (objUrlTracking != null) { if (objUrlTracking.TrackClicks) @@ -105,7 +105,7 @@ public void UpdateUrlTracking(int PortalID, string Url, int ModuleId, int UserID public ArrayList GetUrlLog(int PortalID, string Url, int ModuleId, DateTime StartDate, DateTime EndDate) { ArrayList arrUrlLog = null; - UrlTrackingInfo objUrlTracking = GetUrlTracking(PortalID, Url, ModuleId); + UrlTrackingInfo objUrlTracking = this.GetUrlTracking(PortalID, Url, ModuleId); if (objUrlTracking != null) { arrUrlLog = CBO.FillCollection(DataProvider.Instance().GetUrlLog(objUrlTracking.UrlTrackingID, StartDate, EndDate), typeof (UrlLogInfo)); diff --git a/DNN Platform/Library/Common/XmlValidatorBase.cs b/DNN Platform/Library/Common/XmlValidatorBase.cs index 5a40e4286ea..cf0837d16d9 100644 --- a/DNN Platform/Library/Common/XmlValidatorBase.cs +++ b/DNN Platform/Library/Common/XmlValidatorBase.cs @@ -24,8 +24,8 @@ public class XmlValidatorBase public XmlValidatorBase() { - _errs = new ArrayList(); - _schemaSet = new XmlSchemaSet(); + this._errs = new ArrayList(); + this._schemaSet = new XmlSchemaSet(); } /// @@ -38,11 +38,11 @@ public ArrayList Errors { get { - return _errs; + return this._errs; } set { - _errs = value; + this._errs = value; } } @@ -53,7 +53,7 @@ public XmlSchemaSet SchemaSet { get { - return _schemaSet; + return this._schemaSet; } } @@ -64,7 +64,7 @@ public XmlSchemaSet SchemaSet /// The instance containing the event data. protected void ValidationCallBack(object sender, ValidationEventArgs args) { - _errs.Add(args.Message); + this._errs.Add(args.Message); } /// @@ -82,17 +82,17 @@ public bool IsValid() //Create a validating reader var settings = new XmlReaderSettings(); - settings.Schemas = _schemaSet; + settings.Schemas = this._schemaSet; settings.ValidationType = ValidationType.Schema; //Set the validation event handler. - settings.ValidationEventHandler += ValidationCallBack; - XmlReader vreader = XmlReader.Create(_reader, settings); + settings.ValidationEventHandler += this.ValidationCallBack; + XmlReader vreader = XmlReader.Create(this._reader, settings); //Read and validate the XML data. while (vreader.Read()) { } vreader.Close(); - return (_errs.Count == 0); + return (this._errs.Count == 0); } /// @@ -103,12 +103,12 @@ public bool IsValid() public virtual bool Validate(Stream xmlStream) { xmlStream.Seek(0, SeekOrigin.Begin); - _reader = new XmlTextReader(xmlStream) + this._reader = new XmlTextReader(xmlStream) { XmlResolver = null, DtdProcessing = DtdProcessing.Prohibit }; - return IsValid(); + return this.IsValid(); } /// @@ -118,12 +118,12 @@ public virtual bool Validate(Stream xmlStream) /// public virtual bool Validate(string filename) { - _reader = new XmlTextReader(filename) + this._reader = new XmlTextReader(filename) { XmlResolver = null, DtdProcessing = DtdProcessing.Prohibit }; - return IsValid(); + return this.IsValid(); } } } diff --git a/DNN Platform/Library/ComponentModel/AbstractContainer.cs b/DNN Platform/Library/ComponentModel/AbstractContainer.cs index 10e59565e1f..7601fe24117 100644 --- a/DNN Platform/Library/ComponentModel/AbstractContainer.cs +++ b/DNN Platform/Library/ComponentModel/AbstractContainer.cs @@ -25,124 +25,124 @@ public abstract class AbstractContainer : IContainer public virtual TContract GetComponent() { - return (TContract) GetComponent(typeof (TContract)); + return (TContract) this.GetComponent(typeof (TContract)); } public virtual TContract GetComponent(string name) { - return (TContract) GetComponent(name, typeof (TContract)); + return (TContract) this.GetComponent(name, typeof (TContract)); } public abstract string[] GetComponentList(Type contractType); public virtual string[] GetComponentList() { - return GetComponentList(typeof (TContract)); + return this.GetComponentList(typeof (TContract)); } public abstract IDictionary GetComponentSettings(string name); public virtual IDictionary GetComponentSettings(Type component) { - return GetComponentSettings(component.FullName); + return this.GetComponentSettings(component.FullName); } public IDictionary GetComponentSettings() { - return GetComponentSettings(typeof (TComponent).FullName); + return this.GetComponentSettings(typeof (TComponent).FullName); } public abstract void RegisterComponent(string name, Type contractType, Type componentType, ComponentLifeStyleType lifestyle); public virtual void RegisterComponent(string name, Type contractType, Type componentType) { - RegisterComponent(name, contractType, componentType, ComponentLifeStyleType.Singleton); + this.RegisterComponent(name, contractType, componentType, ComponentLifeStyleType.Singleton); } public virtual void RegisterComponent(string name, Type componentType) { - RegisterComponent(name, componentType, componentType, ComponentLifeStyleType.Singleton); + this.RegisterComponent(name, componentType, componentType, ComponentLifeStyleType.Singleton); } public virtual void RegisterComponent(Type contractType, Type componentType) { - RegisterComponent(componentType.FullName, contractType, componentType, ComponentLifeStyleType.Singleton); + this.RegisterComponent(componentType.FullName, contractType, componentType, ComponentLifeStyleType.Singleton); } public virtual void RegisterComponent(Type contractType, Type componentType, ComponentLifeStyleType lifestyle) { - RegisterComponent(componentType.FullName, contractType, componentType, lifestyle); + this.RegisterComponent(componentType.FullName, contractType, componentType, lifestyle); } public virtual void RegisterComponent(Type componentType) { - RegisterComponent(componentType.FullName, componentType, componentType, ComponentLifeStyleType.Singleton); + this.RegisterComponent(componentType.FullName, componentType, componentType, ComponentLifeStyleType.Singleton); } public virtual void RegisterComponent() where TComponent : class { - RegisterComponent(typeof (TComponent)); + this.RegisterComponent(typeof (TComponent)); } public virtual void RegisterComponent(string name) where TComponent : class { - RegisterComponent(name, typeof (TComponent), typeof (TComponent), ComponentLifeStyleType.Singleton); + this.RegisterComponent(name, typeof (TComponent), typeof (TComponent), ComponentLifeStyleType.Singleton); } public virtual void RegisterComponent(string name, ComponentLifeStyleType lifestyle) where TComponent : class { - RegisterComponent(name, typeof (TComponent), typeof (TComponent), lifestyle); + this.RegisterComponent(name, typeof (TComponent), typeof (TComponent), lifestyle); } public virtual void RegisterComponent() where TComponent : class { - RegisterComponent(typeof (TContract), typeof (TComponent)); + this.RegisterComponent(typeof (TContract), typeof (TComponent)); } public virtual void RegisterComponent(string name) where TComponent : class { - RegisterComponent(name, typeof (TContract), typeof (TComponent), ComponentLifeStyleType.Singleton); + this.RegisterComponent(name, typeof (TContract), typeof (TComponent), ComponentLifeStyleType.Singleton); } public virtual void RegisterComponent(string name, ComponentLifeStyleType lifestyle) where TComponent : class { - RegisterComponent(name, typeof (TContract), typeof (TComponent), lifestyle); + this.RegisterComponent(name, typeof (TContract), typeof (TComponent), lifestyle); } public abstract void RegisterComponentSettings(string name, IDictionary dependencies); public virtual void RegisterComponentSettings(Type component, IDictionary dependencies) { - RegisterComponentSettings(component.FullName, dependencies); + this.RegisterComponentSettings(component.FullName, dependencies); } public virtual void RegisterComponentSettings(IDictionary dependencies) { - RegisterComponentSettings(typeof (TComponent).FullName, dependencies); + this.RegisterComponentSettings(typeof (TComponent).FullName, dependencies); } public abstract void RegisterComponentInstance(string name, Type contractType, object instance); public void RegisterComponentInstance(string name, object instance) { - RegisterComponentInstance(name, instance.GetType(), instance); + this.RegisterComponentInstance(name, instance.GetType(), instance); } public void RegisterComponentInstance(object instance) { - RegisterComponentInstance(instance.GetType().FullName, typeof (TContract), instance); + this.RegisterComponentInstance(instance.GetType().FullName, typeof (TContract), instance); } public void RegisterComponentInstance(string name, object instance) { - RegisterComponentInstance(name, typeof (TContract), instance); + this.RegisterComponentInstance(name, typeof (TContract), instance); } #endregion public virtual IDictionary GetCustomDependencies() { - return GetComponentSettings(typeof (TComponent).FullName); + return this.GetComponentSettings(typeof (TComponent).FullName); } } } diff --git a/DNN Platform/Library/ComponentModel/ComponentBuilderCollection.cs b/DNN Platform/Library/ComponentModel/ComponentBuilderCollection.cs index 66e2efb2f4c..1b01403a9b7 100644 --- a/DNN Platform/Library/ComponentModel/ComponentBuilderCollection.cs +++ b/DNN Platform/Library/ComponentModel/ComponentBuilderCollection.cs @@ -16,13 +16,13 @@ internal class ComponentBuilderCollection : SharedDictionaryThe base type of Components of this ComponentType public ComponentType(Type baseType) { - _BaseType = baseType; + this._BaseType = baseType; } public Type BaseType { get { - return _BaseType; + return this._BaseType; } } @@ -36,7 +36,7 @@ public ComponentBuilderCollection ComponentBuilders { get { - return _ComponentBuilders; + return this._ComponentBuilders; } } } diff --git a/DNN Platform/Library/ComponentModel/DataAnnotations/CacheableAttribute.cs b/DNN Platform/Library/ComponentModel/DataAnnotations/CacheableAttribute.cs index a4559a95dbe..f1756ec441c 100644 --- a/DNN Platform/Library/ComponentModel/DataAnnotations/CacheableAttribute.cs +++ b/DNN Platform/Library/ComponentModel/DataAnnotations/CacheableAttribute.cs @@ -18,8 +18,8 @@ public class CacheableAttribute : Attribute /// public CacheableAttribute() { - CachePriority = CacheItemPriority.Default; - CacheTimeOut = 20; + this.CachePriority = CacheItemPriority.Default; + this.CacheTimeOut = 20; } /// @@ -43,9 +43,9 @@ public CacheableAttribute(string cacheKey, CacheItemPriority priority) : this(ca /// The timeout multiplier used to cache the item public CacheableAttribute(string cacheKey, CacheItemPriority priority, int timeOut) { - CacheKey = cacheKey; - CachePriority = priority; - CacheTimeOut = timeOut; + this.CacheKey = cacheKey; + this.CachePriority = priority; + this.CacheTimeOut = timeOut; } /// diff --git a/DNN Platform/Library/ComponentModel/DataAnnotations/ColumnNameAttribute.cs b/DNN Platform/Library/ComponentModel/DataAnnotations/ColumnNameAttribute.cs index d950b28abba..373486267d9 100644 --- a/DNN Platform/Library/ComponentModel/DataAnnotations/ColumnNameAttribute.cs +++ b/DNN Platform/Library/ComponentModel/DataAnnotations/ColumnNameAttribute.cs @@ -14,7 +14,7 @@ public class ColumnNameAttribute : Attribute { public ColumnNameAttribute(string columnName) { - ColumnName = columnName; + this.ColumnName = columnName; } public string ColumnName { get; set; } diff --git a/DNN Platform/Library/ComponentModel/DataAnnotations/PrimaryKeyAttribute.cs b/DNN Platform/Library/ComponentModel/DataAnnotations/PrimaryKeyAttribute.cs index eea1074ca02..fed7230a70f 100644 --- a/DNN Platform/Library/ComponentModel/DataAnnotations/PrimaryKeyAttribute.cs +++ b/DNN Platform/Library/ComponentModel/DataAnnotations/PrimaryKeyAttribute.cs @@ -18,9 +18,9 @@ public PrimaryKeyAttribute(string columnName) : this(columnName, columnName) public PrimaryKeyAttribute(string columnName, string propertyName) { - ColumnName = columnName; - PropertyName = propertyName; - AutoIncrement = true; + this.ColumnName = columnName; + this.PropertyName = propertyName; + this.AutoIncrement = true; } public bool AutoIncrement { get; set; } diff --git a/DNN Platform/Library/ComponentModel/DataAnnotations/ScopeAttribute.cs b/DNN Platform/Library/ComponentModel/DataAnnotations/ScopeAttribute.cs index cfdaba553a3..9c4ea26695b 100644 --- a/DNN Platform/Library/ComponentModel/DataAnnotations/ScopeAttribute.cs +++ b/DNN Platform/Library/ComponentModel/DataAnnotations/ScopeAttribute.cs @@ -11,7 +11,7 @@ public class ScopeAttribute : Attribute public ScopeAttribute(string scope) { - Scope = scope; + this.Scope = scope; } /// diff --git a/DNN Platform/Library/ComponentModel/DataAnnotations/TableNameAttribute.cs b/DNN Platform/Library/ComponentModel/DataAnnotations/TableNameAttribute.cs index ae983624375..ce8cb8c8de2 100644 --- a/DNN Platform/Library/ComponentModel/DataAnnotations/TableNameAttribute.cs +++ b/DNN Platform/Library/ComponentModel/DataAnnotations/TableNameAttribute.cs @@ -14,7 +14,7 @@ public class TableNameAttribute : Attribute { public TableNameAttribute(string tableName) { - TableName = tableName; + this.TableName = tableName; } public string TableName { get; set; } diff --git a/DNN Platform/Library/ComponentModel/InstanceComponentBuilder.cs b/DNN Platform/Library/ComponentModel/InstanceComponentBuilder.cs index 4aa5c03d1bc..6d2d0aa1b8d 100644 --- a/DNN Platform/Library/ComponentModel/InstanceComponentBuilder.cs +++ b/DNN Platform/Library/ComponentModel/InstanceComponentBuilder.cs @@ -16,22 +16,22 @@ internal class InstanceComponentBuilder : IComponentBuilder /// public InstanceComponentBuilder(string name, object instance) { - _Name = name; - _Instance = instance; + this._Name = name; + this._Instance = instance; } #region IComponentBuilder Members public object BuildComponent() { - return _Instance; + return this._Instance; } public string Name { get { - return _Name; + return this._Name; } } diff --git a/DNN Platform/Library/ComponentModel/ProviderInstaller.cs b/DNN Platform/Library/ComponentModel/ProviderInstaller.cs index 6f49874e07b..6d7bed2de86 100644 --- a/DNN Platform/Library/ComponentModel/ProviderInstaller.cs +++ b/DNN Platform/Library/ComponentModel/ProviderInstaller.cs @@ -27,35 +27,35 @@ public class ProviderInstaller : IComponentInstaller public ProviderInstaller(string providerType, Type providerInterface) { - _ComponentLifeStyle = ComponentLifeStyleType.Singleton; - _ProviderType = providerType; - _ProviderInterface = providerInterface; + this._ComponentLifeStyle = ComponentLifeStyleType.Singleton; + this._ProviderType = providerType; + this._ProviderInterface = providerInterface; } public ProviderInstaller(string providerType, Type providerInterface, Type defaultProvider) { - _ComponentLifeStyle = ComponentLifeStyleType.Singleton; - _ProviderType = providerType; - _ProviderInterface = providerInterface; - _defaultProvider = defaultProvider; + this._ComponentLifeStyle = ComponentLifeStyleType.Singleton; + this._ProviderType = providerType; + this._ProviderInterface = providerInterface; + this._defaultProvider = defaultProvider; } public ProviderInstaller(string providerType, Type providerInterface, ComponentLifeStyleType lifeStyle) { - _ComponentLifeStyle = lifeStyle; - _ProviderType = providerType; - _ProviderInterface = providerInterface; + this._ComponentLifeStyle = lifeStyle; + this._ProviderType = providerType; + this._ProviderInterface = providerInterface; } #region IComponentInstaller Members public void InstallComponents(IContainer container) { - ProviderConfiguration config = ProviderConfiguration.GetProviderConfiguration(_ProviderType); + ProviderConfiguration config = ProviderConfiguration.GetProviderConfiguration(this._ProviderType); //Register the default provider first (so it is the first component registered for its service interface if (config != null) { - InstallProvider(container, (Provider) config.Providers[config.DefaultProvider]); + this.InstallProvider(container, (Provider) config.Providers[config.DefaultProvider]); //Register the others foreach (Provider provider in config.Providers.Values) @@ -63,7 +63,7 @@ public void InstallComponents(IContainer container) //Skip the default because it was registered above if (!config.DefaultProvider.Equals(provider.Name, StringComparison.OrdinalIgnoreCase)) { - InstallProvider(container, provider); + this.InstallProvider(container, provider); } } } @@ -84,9 +84,9 @@ private void InstallProvider(IContainer container, Provider provider) } catch (TypeLoadException) { - if (_defaultProvider != null) + if (this._defaultProvider != null) { - type = _defaultProvider; + type = this._defaultProvider; } } @@ -97,7 +97,7 @@ private void InstallProvider(IContainer container, Provider provider) else { //Register the component - container.RegisterComponent(provider.Name, _ProviderInterface, type, _ComponentLifeStyle); + container.RegisterComponent(provider.Name, this._ProviderInterface, type, this._ComponentLifeStyle); //Load the settings into a dictionary var settingsDict = new Dictionary { { "providerName", provider.Name } }; diff --git a/DNN Platform/Library/ComponentModel/SimpleContainer.cs b/DNN Platform/Library/ComponentModel/SimpleContainer.cs index 6a8ec42cff1..2148c433bc5 100644 --- a/DNN Platform/Library/ComponentModel/SimpleContainer.cs +++ b/DNN Platform/Library/ComponentModel/SimpleContainer.cs @@ -40,7 +40,7 @@ public SimpleContainer() : this(string.Format("Container_{0}", Guid.NewGuid())) /// public SimpleContainer(string name) { - _name = name; + this._name = name; } #endregion @@ -49,7 +49,7 @@ public SimpleContainer(string name) private void AddBuilder(Type contractType, IComponentBuilder builder) { - ComponentType componentType = GetComponentType(contractType); + ComponentType componentType = this.GetComponentType(contractType); if (componentType != null) { ComponentBuilderCollection builders = componentType.ComponentBuilders; @@ -59,24 +59,24 @@ private void AddBuilder(Type contractType, IComponentBuilder builder) builders.AddBuilder(builder, true); } - using (_componentBuilders.GetWriteLock()) + using (this._componentBuilders.GetWriteLock()) { - _componentBuilders.AddBuilder(builder, false); + this._componentBuilders.AddBuilder(builder, false); } } } private void AddComponentType(Type contractType) { - ComponentType componentType = GetComponentType(contractType); + ComponentType componentType = this.GetComponentType(contractType); if (componentType == null) { componentType = new ComponentType(contractType); - using (_componentTypes.GetWriteLock()) + using (this._componentTypes.GetWriteLock()) { - _componentTypes[componentType.BaseType] = componentType; + this._componentTypes[componentType.BaseType] = componentType; } } } @@ -99,9 +99,9 @@ private IComponentBuilder GetComponentBuilder(string name) { IComponentBuilder builder; - using (_componentBuilders.GetReadLock()) + using (this._componentBuilders.GetReadLock()) { - _componentBuilders.TryGetValue(name, out builder); + this._componentBuilders.TryGetValue(name, out builder); } return builder; @@ -123,9 +123,9 @@ private ComponentType GetComponentType(Type contractType) { ComponentType componentType; - using (_componentTypes.GetReadLock()) + using (this._componentTypes.GetReadLock()) { - _componentTypes.TryGetValue(contractType, out componentType); + this._componentTypes.TryGetValue(contractType, out componentType); } return componentType; @@ -133,9 +133,9 @@ private ComponentType GetComponentType(Type contractType) public override void RegisterComponent(string name, Type type) { - using (_registeredComponents.GetWriteLock()) + using (this._registeredComponents.GetWriteLock()) { - _registeredComponents[type] = name; + this._registeredComponents[type] = name; } } @@ -145,20 +145,20 @@ public override string Name { get { - return _name; + return this._name; } } public override object GetComponent(string name) { - IComponentBuilder builder = GetComponentBuilder(name); + IComponentBuilder builder = this.GetComponentBuilder(name); - return GetComponent(builder); + return this.GetComponent(builder); } public override object GetComponent(Type contractType) { - ComponentType componentType = GetComponentType(contractType); + ComponentType componentType = this.GetComponentType(contractType); object component = null; if (componentType != null) @@ -172,9 +172,9 @@ public override object GetComponent(Type contractType) if (builderCount > 0) { - IComponentBuilder builder = GetDefaultComponentBuilder(componentType); + IComponentBuilder builder = this.GetDefaultComponentBuilder(componentType); - component = GetComponent(builder); + component = this.GetComponent(builder); } } @@ -183,14 +183,14 @@ public override object GetComponent(Type contractType) public override object GetComponent(string name, Type contractType) { - ComponentType componentType = GetComponentType(contractType); + ComponentType componentType = this.GetComponentType(contractType); object component = null; if (componentType != null) { - IComponentBuilder builder = GetComponentBuilder(name); + IComponentBuilder builder = this.GetComponentBuilder(name); - component = GetComponent(builder); + component = this.GetComponent(builder); } return component; } @@ -199,9 +199,9 @@ public override string[] GetComponentList(Type contractType) { var components = new List(); - using (_registeredComponents.GetReadLock()) + using (this._registeredComponents.GetReadLock()) { - foreach (KeyValuePair kvp in _registeredComponents) + foreach (KeyValuePair kvp in this._registeredComponents) { if (contractType.IsAssignableFrom(kvp.Key)) { @@ -215,16 +215,16 @@ public override string[] GetComponentList(Type contractType) public override IDictionary GetComponentSettings(string name) { IDictionary settings; - using (_componentDependencies.GetReadLock()) + using (this._componentDependencies.GetReadLock()) { - settings = _componentDependencies[name]; + settings = this._componentDependencies[name]; } return settings; } public override void RegisterComponent(string name, Type contractType, Type type, ComponentLifeStyleType lifestyle) { - AddComponentType(contractType); + this.AddComponentType(contractType); IComponentBuilder builder = null; switch (lifestyle) @@ -236,25 +236,25 @@ public override void RegisterComponent(string name, Type contractType, Type type builder = new SingletonComponentBuilder(name, type); break; } - AddBuilder(contractType, builder); + this.AddBuilder(contractType, builder); - RegisterComponent(name, type); + this.RegisterComponent(name, type); } public override void RegisterComponentInstance(string name, Type contractType, object instance) { - AddComponentType(contractType); + this.AddComponentType(contractType); - AddBuilder(contractType, new InstanceComponentBuilder(name, instance)); + this.AddBuilder(contractType, new InstanceComponentBuilder(name, instance)); - RegisterComponent(name, instance.GetType()); + this.RegisterComponent(name, instance.GetType()); } public override void RegisterComponentSettings(string name, IDictionary dependencies) { - using (_componentDependencies.GetWriteLock()) + using (this._componentDependencies.GetWriteLock()) { - _componentDependencies[name] = dependencies; + this._componentDependencies[name] = dependencies; } } } diff --git a/DNN Platform/Library/ComponentModel/SingletonComponentBuilder.cs b/DNN Platform/Library/ComponentModel/SingletonComponentBuilder.cs index ef40bdbf119..5909e773c31 100644 --- a/DNN Platform/Library/ComponentModel/SingletonComponentBuilder.cs +++ b/DNN Platform/Library/ComponentModel/SingletonComponentBuilder.cs @@ -25,26 +25,26 @@ internal class SingletonComponentBuilder : IComponentBuilder /// The type of the component public SingletonComponentBuilder(string name, Type type) { - _Name = name; - _Type = type; + this._Name = name; + this._Type = type; } #region IComponentBuilder Members public object BuildComponent() { - if (_Instance == null) + if (this._Instance == null) { - CreateInstance(); + this.CreateInstance(); } - return _Instance; + return this._Instance; } public string Name { get { - return _Name; + return this._Name; } } @@ -52,7 +52,7 @@ public string Name private void CreateInstance() { - _Instance = Reflection.CreateObject(_Type); + this._Instance = Reflection.CreateObject(this._Type); } } } diff --git a/DNN Platform/Library/ComponentModel/TransientComponentBuilder.cs b/DNN Platform/Library/ComponentModel/TransientComponentBuilder.cs index a1310d5d9f6..5cf93623539 100644 --- a/DNN Platform/Library/ComponentModel/TransientComponentBuilder.cs +++ b/DNN Platform/Library/ComponentModel/TransientComponentBuilder.cs @@ -24,22 +24,22 @@ internal class TransientComponentBuilder : IComponentBuilder /// The type of the component public TransientComponentBuilder(string name, Type type) { - _Name = name; - _Type = type; + this._Name = name; + this._Type = type; } #region IComponentBuilder Members public object BuildComponent() { - return Reflection.CreateObject(_Type); + return Reflection.CreateObject(this._Type); } public string Name { get { - return _Name; + return this._Name; } } diff --git a/DNN Platform/Library/Data/ControllerBase.cs b/DNN Platform/Library/Data/ControllerBase.cs index d6714b7091c..d1850a2e545 100644 --- a/DNN Platform/Library/Data/ControllerBase.cs +++ b/DNN Platform/Library/Data/ControllerBase.cs @@ -20,7 +20,7 @@ protected ControllerBase(IDataContext dataContext) //Argument Contract Requires.NotNull("dataContext", dataContext); - DataContext = dataContext; + this.DataContext = dataContext; } public void Add(TEntity entity) @@ -28,9 +28,9 @@ public void Add(TEntity entity) //Argument Contract Requires.NotNull(entity); - using (DataContext) + using (this.DataContext) { - var rep = DataContext.GetRepository(); + var rep = this.DataContext.GetRepository(); rep.Insert(entity); } @@ -45,9 +45,9 @@ public void Delete(TEntity entity) Requires.PropertyNotNull(entity, primaryKey); Requires.PropertyNotNegative(entity, primaryKey); - using (DataContext) + using (this.DataContext) { - var rep = DataContext.GetRepository(); + var rep = this.DataContext.GetRepository(); rep.Delete(entity); } @@ -56,9 +56,9 @@ public void Delete(TEntity entity) public IEnumerable Find(string sqlCondition, params object[] args) { IEnumerable entities; - using (DataContext) + using (this.DataContext) { - var rep = DataContext.GetRepository(); + var rep = this.DataContext.GetRepository(); entities = rep.Find(sqlCondition, args); } @@ -70,9 +70,9 @@ public IEnumerable Find(string sqlCondition, params object[] args) public IEnumerable Get() { IEnumerable entities; - using (DataContext) + using (this.DataContext) { - var rep = DataContext.GetRepository(); + var rep = this.DataContext.GetRepository(); entities = rep.Get(); } @@ -83,9 +83,9 @@ public IEnumerable Get() public IEnumerable Get(TScope scope) { IEnumerable contentTypes; - using (DataContext) + using (this.DataContext) { - var rep = DataContext.GetRepository(); + var rep = this.DataContext.GetRepository(); contentTypes = rep.Get(scope); } @@ -102,9 +102,9 @@ public void Update(TEntity entity) Requires.PropertyNotNull(entity, primaryKey); Requires.PropertyNotNegative(entity, primaryKey); - using (DataContext) + using (this.DataContext) { - var rep = DataContext.GetRepository(); + var rep = this.DataContext.GetRepository(); rep.Update(entity); } diff --git a/DNN Platform/Library/Data/DataProvider.cs b/DNN Platform/Library/Data/DataProvider.cs index ce48e95ffc7..3eef74a7e62 100644 --- a/DNN Platform/Library/Data/DataProvider.cs +++ b/DNN Platform/Library/Data/DataProvider.cs @@ -60,7 +60,7 @@ public virtual string ConnectionString if (string.IsNullOrEmpty(connectionString)) { //Use connection string specified in provider - connectionString = Settings["connectionString"]; + connectionString = this.Settings["connectionString"]; } return connectionString; } @@ -70,7 +70,7 @@ public virtual string DatabaseOwner { get { - string databaseOwner = Settings["databaseOwner"]; + string databaseOwner = this.Settings["databaseOwner"]; if (!string.IsNullOrEmpty(databaseOwner) && databaseOwner.EndsWith(".") == false) { databaseOwner += "."; @@ -90,7 +90,7 @@ public virtual string ObjectQualifier { get { - string objectQualifier = Settings["objectQualifier"]; + string objectQualifier = this.Settings["objectQualifier"]; if (!string.IsNullOrEmpty(objectQualifier) && objectQualifier.EndsWith("_") == false) { objectQualifier += "_"; @@ -101,12 +101,12 @@ public virtual string ObjectQualifier public virtual string ProviderName { - get { return Settings["providerName"]; } + get { return this.Settings["providerName"]; } } public virtual string ProviderPath { - get { return Settings["providerPath"]; } + get { return this.Settings["providerPath"]; } } public abstract Dictionary Settings { get; } @@ -115,9 +115,9 @@ public virtual string UpgradeConnectionString { get { - return !String.IsNullOrEmpty(Settings["upgradeConnectionString"]) - ? Settings["upgradeConnectionString"] - : ConnectionString; + return !String.IsNullOrEmpty(this.Settings["upgradeConnectionString"]) + ? this.Settings["upgradeConnectionString"] + : this.ConnectionString; } } @@ -206,7 +206,7 @@ public virtual void CommitTransaction(DbTransaction transaction) public virtual DbTransaction GetTransaction() { - var Conn = new SqlConnection(UpgradeConnectionString); + var Conn = new SqlConnection(this.UpgradeConnectionString); Conn.Open(); SqlTransaction transaction = Conn.BeginTransaction(); return transaction; @@ -238,7 +238,7 @@ public virtual object GetNull(object Field) public virtual IDataReader FindDatabaseVersion(int Major, int Minor, int Build) { - return ExecuteReader("FindDatabaseVersion", Major, Minor, Build); + return this.ExecuteReader("FindDatabaseVersion", Major, Minor, Build); } public virtual Version GetDatabaseEngineVersion() @@ -247,7 +247,7 @@ public virtual Version GetDatabaseEngineVersion() IDataReader dr = null; try { - dr = ExecuteReader("GetDatabaseServer"); + dr = this.ExecuteReader("GetDatabaseServer"); if (dr.Read()) { version = dr["Version"].ToString(); @@ -262,22 +262,22 @@ public virtual Version GetDatabaseEngineVersion() public virtual IDataReader GetDatabaseVersion() { - return ExecuteReader("GetDatabaseVersion"); + return this.ExecuteReader("GetDatabaseVersion"); } public virtual IDataReader GetDatabaseInstallVersion() { - return ExecuteReader("GetDatabaseInstallVersion"); + return this.ExecuteReader("GetDatabaseInstallVersion"); } public virtual Version GetVersion() { - return GetVersionInternal(true); + return this.GetVersionInternal(true); } public virtual Version GetInstallVersion() { - return GetVersionInternal(false); + return this.GetVersionInternal(false); } @@ -287,7 +287,7 @@ private Version GetVersionInternal(bool current) IDataReader dr = null; try { - dr = current ? GetDatabaseVersion() : GetDatabaseInstallVersion(); + dr = current ? this.GetDatabaseVersion() : this.GetDatabaseInstallVersion(); if (dr.Read()) { version = new Version(Convert.ToInt32(dr["Major"]), Convert.ToInt32(dr["Minor"]), @@ -326,7 +326,7 @@ public virtual DbConnectionStringBuilder GetConnectionStringBuilder() public virtual string GetProviderPath() { - string path = ProviderPath; + string path = this.ProviderPath; if (!String.IsNullOrEmpty(path)) { path = HostingEnvironment.MapPath(path); @@ -335,7 +335,7 @@ public virtual string GetProviderPath() if (Directory.Exists(path)) // ReSharper restore AssignNullToNotNullAttribute { - if (!IsConnectionValid) + if (!this.IsConnectionValid) { path = "ERROR: Could not connect to database specified in connectionString for SqlDataProvider"; } @@ -419,27 +419,27 @@ public virtual void UpdateDatabaseVersion(int Major, int Minor, int Build, strin if ((Major >= 5 || (Major == 4 && Minor == 9 && Build > 0))) { //If the version > 4.9.0 use the new sproc, which is added in 4.9.1 script - ExecuteNonQuery("UpdateDatabaseVersionAndName", Major, Minor, Build, Name); + this.ExecuteNonQuery("UpdateDatabaseVersionAndName", Major, Minor, Build, Name); } else { - ExecuteNonQuery("UpdateDatabaseVersion", Major, Minor, Build); + this.ExecuteNonQuery("UpdateDatabaseVersion", Major, Minor, Build); } } public virtual void UpdateDatabaseVersionIncrement(int Major, int Minor, int Build, int Increment, string AppName) { - ExecuteNonQuery("UpdateDatabaseVersionIncrement", Major, Minor, Build, Increment, AppName); + this.ExecuteNonQuery("UpdateDatabaseVersionIncrement", Major, Minor, Build, Increment, AppName); } public virtual int GetLastAppliedIteration(int Major, int Minor, int Build) { - return ExecuteScalar("GetLastAppliedIteration", Major, Minor, Build); + return this.ExecuteScalar("GetLastAppliedIteration", Major, Minor, Build); } public virtual string GetUnappliedIterations(string version) { - return ExecuteScalar("GetUnappliedIterations", version); + return this.ExecuteScalar("GetUnappliedIterations", version); } #endregion @@ -448,18 +448,18 @@ public virtual string GetUnappliedIterations(string version) public virtual IDataReader GetHostSetting(string SettingName) { - return ExecuteReader("GetHostSetting", SettingName); + return this.ExecuteReader("GetHostSetting", SettingName); } public virtual IDataReader GetHostSettings() { - return ExecuteReader("GetHostSettings"); + return this.ExecuteReader("GetHostSettings"); } public virtual void UpdateHostSetting(string SettingName, string SettingValue, bool SettingIsSecure, int LastModifiedByUserID) { - ExecuteNonQuery("UpdateHostSetting", SettingName, SettingValue, SettingIsSecure, LastModifiedByUserID); + this.ExecuteNonQuery("UpdateHostSetting", SettingName, SettingValue, SettingIsSecure, LastModifiedByUserID); } #endregion @@ -468,23 +468,23 @@ public virtual void UpdateHostSetting(string SettingName, string SettingValue, b public virtual void DeleteServer(int ServerId) { - ExecuteNonQuery("DeleteServer", ServerId); + this.ExecuteNonQuery("DeleteServer", ServerId); } public virtual IDataReader GetServers() { - return ExecuteReader("GetServers"); + return this.ExecuteReader("GetServers"); } public virtual void UpdateServer(int serverId, string url, string uniqueId, bool enabled, string group) { - ExecuteNonQuery("UpdateServer", serverId, url, uniqueId, enabled, group); + this.ExecuteNonQuery("UpdateServer", serverId, url, uniqueId, enabled, group); } public virtual int UpdateServerActivity(string serverName, string iisAppName, DateTime createdDate, DateTime lastActivityDate, int pingFailureCount, bool enabled) { - return ExecuteScalar("UpdateServerActivity", serverName, iisAppName, createdDate, lastActivityDate, pingFailureCount, enabled); + return this.ExecuteScalar("UpdateServerActivity", serverName, iisAppName, createdDate, lastActivityDate, pingFailureCount, enabled); } #endregion @@ -497,7 +497,7 @@ public virtual int CreatePortal(string portalname, string currency, DateTime Exp string HomeDirectory, int CreatedByUserID) { return - CreatePortal( + this.CreatePortal( PortalSecurity.Instance.InputFilter(portalname, PortalSecurity.FilterFlag.NoMarkup), currency, ExpiryDate, @@ -516,15 +516,15 @@ public virtual int CreatePortal(string portalname, string currency, DateTime Exp string HomeDirectory, string CultureCode, int CreatedByUserID) { return - ExecuteScalar("AddPortalInfo", + this.ExecuteScalar("AddPortalInfo", PortalSecurity.Instance.InputFilter(portalname, PortalSecurity.FilterFlag.NoMarkup), currency, - GetNull(ExpiryDate), + this.GetNull(ExpiryDate), HostFee, HostSpace, PageQuota, UserQuota, - GetNull(SiteLogHistory), + this.GetNull(SiteLogHistory), HomeDirectory, CultureCode, CreatedByUserID); @@ -532,22 +532,22 @@ public virtual int CreatePortal(string portalname, string currency, DateTime Exp public virtual void DeletePortalInfo(int PortalId) { - ExecuteNonQuery("DeletePortalInfo", PortalId); + this.ExecuteNonQuery("DeletePortalInfo", PortalId); } public virtual void DeletePortalSetting(int PortalId, string SettingName, string CultureCode) { - ExecuteNonQuery("DeletePortalSetting", PortalId, SettingName, CultureCode); + this.ExecuteNonQuery("DeletePortalSetting", PortalId, SettingName, CultureCode); } public virtual void DeletePortalSettings(int PortalId, string CultureCode) { - ExecuteNonQuery("DeletePortalSettings", PortalId, CultureCode); + this.ExecuteNonQuery("DeletePortalSettings", PortalId, CultureCode); } public virtual IDataReader GetExpiredPortals() { - return ExecuteReader("GetExpiredPortals"); + return this.ExecuteReader("GetExpiredPortals"); } public virtual IDataReader GetPortals(string CultureCode) @@ -555,40 +555,40 @@ public virtual IDataReader GetPortals(string CultureCode) IDataReader reader; if (Globals.Status == Globals.UpgradeStatus.Upgrade && Globals.DataBaseVersion < new Version(6, 1, 0)) { - reader = ExecuteReader("GetPortals"); + reader = this.ExecuteReader("GetPortals"); } else { - reader = ExecuteReader("GetPortals", CultureCode); + reader = this.ExecuteReader("GetPortals", CultureCode); } return reader; } public virtual IDataReader GetAllPortals() { - return ExecuteReader("GetAllPortals"); + return this.ExecuteReader("GetAllPortals"); } public virtual IDataReader GetPortalsByName(string nameToMatch, int pageIndex, int pageSize) { - return ExecuteReader("GetPortalsByName", nameToMatch, pageIndex, pageSize); + return this.ExecuteReader("GetPortalsByName", nameToMatch, pageIndex, pageSize); } public virtual IDataReader GetPortalsByUser(int userId) { - return ExecuteReader("GetPortalsByUser", userId); + return this.ExecuteReader("GetPortalsByUser", userId); } public virtual IDataReader GetPortalSettings(int PortalId, string CultureCode) { - return ExecuteReader("GetPortalSettings", PortalId, CultureCode); + return this.ExecuteReader("GetPortalSettings", PortalId, CultureCode); } internal virtual IDictionary GetPortalSettingsBySetting(string settingName, string cultureCode) { var result = new Dictionary(); - using (var reader = ExecuteReader("GetPortalSettingsBySetting", settingName, cultureCode)) + using (var reader = this.ExecuteReader("GetPortalSettingsBySetting", settingName, cultureCode)) { while (reader.Read()) { @@ -600,7 +600,7 @@ internal virtual IDictionary GetPortalSettingsBySetting(string sett public virtual IDataReader GetPortalSpaceUsed(int PortalId) { - return ExecuteReader("GetPortalSpaceUsed", GetNull(PortalId)); + return this.ExecuteReader("GetPortalSpaceUsed", this.GetNull(PortalId)); } /// @@ -651,39 +651,39 @@ public virtual void UpdatePortalInfo(int portalId, int portalGroupId, string por int termsTabId, int privacyTabId, string defaultLanguage, string homeDirectory, int lastModifiedByUserID, string cultureCode) { - ExecuteNonQuery("UpdatePortalInfo", + this.ExecuteNonQuery("UpdatePortalInfo", portalId, portalGroupId, PortalSecurity.Instance.InputFilter(portalName, PortalSecurity.FilterFlag.NoMarkup), - GetNull(logoFile), - GetNull(footerText), - GetNull(expiryDate), + this.GetNull(logoFile), + this.GetNull(footerText), + this.GetNull(expiryDate), userRegistration, bannerAdvertising, currency, - GetNull(administratorId), + this.GetNull(administratorId), hostFee, hostSpace, pageQuota, userQuota, - GetNull(paymentProcessor), - GetNull(processorUserId), - GetNull(processorPassword), - GetNull(description), - GetNull(keyWords), - GetNull(backgroundFile), - GetNull(siteLogHistory), - GetNull(splashTabId), - GetNull(homeTabId), - GetNull(loginTabId), - GetNull(registerTabId), - GetNull(userTabId), - GetNull(searchTabId), - GetNull(custom404TabId), - GetNull(custom500TabId), - GetNull(termsTabId), - GetNull(privacyTabId), - GetNull(defaultLanguage), + this.GetNull(paymentProcessor), + this.GetNull(processorUserId), + this.GetNull(processorPassword), + this.GetNull(description), + this.GetNull(keyWords), + this.GetNull(backgroundFile), + this.GetNull(siteLogHistory), + this.GetNull(splashTabId), + this.GetNull(homeTabId), + this.GetNull(loginTabId), + this.GetNull(registerTabId), + this.GetNull(userTabId), + this.GetNull(searchTabId), + this.GetNull(custom404TabId), + this.GetNull(custom500TabId), + this.GetNull(termsTabId), + this.GetNull(privacyTabId), + this.GetNull(defaultLanguage), homeDirectory, lastModifiedByUserID, cultureCode); @@ -692,7 +692,7 @@ public virtual void UpdatePortalInfo(int portalId, int portalGroupId, string por public virtual void UpdatePortalSetting(int portalId, string settingName, string settingValue, int userId, string cultureCode, bool isSecure) { - ExecuteNonQuery("UpdatePortalSetting", portalId, settingName, settingValue, userId, cultureCode, isSecure); + this.ExecuteNonQuery("UpdatePortalSetting", portalId, settingName, settingValue, userId, cultureCode, isSecure); } public virtual void UpdatePortalSetup(int portalId, int administratorId, int administratorRoleId, @@ -701,7 +701,7 @@ public virtual void UpdatePortalSetup(int portalId, int administratorId, int adm int userTabId, int searchTabId, int custom404TabId, int custom500TabId, int termsTabId, int privacyTabId, int adminTabId, string cultureCode) { - ExecuteNonQuery("UpdatePortalSetup", + this.ExecuteNonQuery("UpdatePortalSetup", portalId, administratorId, administratorRoleId, @@ -727,279 +727,279 @@ public virtual void UpdatePortalSetup(int portalId, int administratorId, int adm public virtual int AddTabAfter(TabInfo tab, int afterTabId, int createdByUserID) { - return ExecuteScalar("AddTabAfter", + return this.ExecuteScalar("AddTabAfter", afterTabId, tab.ContentItemId, - GetNull(tab.PortalID), + this.GetNull(tab.PortalID), tab.UniqueId, tab.VersionGuid, - GetNull(tab.DefaultLanguageGuid), + this.GetNull(tab.DefaultLanguageGuid), tab.LocalizedVersionGuid, tab.TabName, tab.IsVisible, tab.DisableLink, - GetNull(tab.ParentId), + this.GetNull(tab.ParentId), tab.IconFile, tab.IconFileLarge, tab.Title, tab.Description, tab.KeyWords, tab.Url, - GetNull(tab.SkinSrc), - GetNull(tab.ContainerSrc), - GetNull(tab.StartDate), - GetNull(tab.EndDate), - GetNull(tab.RefreshInterval), - GetNull(tab.PageHeadText), + this.GetNull(tab.SkinSrc), + this.GetNull(tab.ContainerSrc), + this.GetNull(tab.StartDate), + this.GetNull(tab.EndDate), + this.GetNull(tab.RefreshInterval), + this.GetNull(tab.PageHeadText), tab.IsSecure, tab.PermanentRedirect, tab.SiteMapPriority, createdByUserID, - GetNull(tab.CultureCode), + this.GetNull(tab.CultureCode), tab.IsSystem); } public virtual int AddTabBefore(TabInfo tab, int beforeTabId, int createdByUserID) { - return ExecuteScalar("AddTabBefore", + return this.ExecuteScalar("AddTabBefore", beforeTabId, tab.ContentItemId, - GetNull(tab.PortalID), + this.GetNull(tab.PortalID), tab.UniqueId, tab.VersionGuid, - GetNull(tab.DefaultLanguageGuid), + this.GetNull(tab.DefaultLanguageGuid), tab.LocalizedVersionGuid, tab.TabName, tab.IsVisible, tab.DisableLink, - GetNull(tab.ParentId), + this.GetNull(tab.ParentId), tab.IconFile, tab.IconFileLarge, tab.Title, tab.Description, tab.KeyWords, tab.Url, - GetNull(tab.SkinSrc), - GetNull(tab.ContainerSrc), - GetNull(tab.StartDate), - GetNull(tab.EndDate), - GetNull(tab.RefreshInterval), - GetNull(tab.PageHeadText), + this.GetNull(tab.SkinSrc), + this.GetNull(tab.ContainerSrc), + this.GetNull(tab.StartDate), + this.GetNull(tab.EndDate), + this.GetNull(tab.RefreshInterval), + this.GetNull(tab.PageHeadText), tab.IsSecure, tab.PermanentRedirect, tab.SiteMapPriority, createdByUserID, - GetNull(tab.CultureCode), + this.GetNull(tab.CultureCode), tab.IsSystem); } public virtual int AddTabToEnd(TabInfo tab, int createdByUserID) { - return ExecuteScalar("AddTabToEnd", + return this.ExecuteScalar("AddTabToEnd", tab.ContentItemId, - GetNull(tab.PortalID), + this.GetNull(tab.PortalID), tab.UniqueId, tab.VersionGuid, - GetNull(tab.DefaultLanguageGuid), + this.GetNull(tab.DefaultLanguageGuid), tab.LocalizedVersionGuid, tab.TabName, tab.IsVisible, tab.DisableLink, - GetNull(tab.ParentId), + this.GetNull(tab.ParentId), tab.IconFile, tab.IconFileLarge, tab.Title, tab.Description, tab.KeyWords, tab.Url, - GetNull(tab.SkinSrc), - GetNull(tab.ContainerSrc), - GetNull(tab.StartDate), - GetNull(tab.EndDate), - GetNull(tab.RefreshInterval), - GetNull(tab.PageHeadText), + this.GetNull(tab.SkinSrc), + this.GetNull(tab.ContainerSrc), + this.GetNull(tab.StartDate), + this.GetNull(tab.EndDate), + this.GetNull(tab.RefreshInterval), + this.GetNull(tab.PageHeadText), tab.IsSecure, tab.PermanentRedirect, tab.SiteMapPriority, createdByUserID, - GetNull(tab.CultureCode), + this.GetNull(tab.CultureCode), tab.IsSystem); } public virtual void DeleteTab(int tabId) { - ExecuteNonQuery("DeleteTab", tabId); + this.ExecuteNonQuery("DeleteTab", tabId); } public virtual void DeleteTabSetting(int TabId, string SettingName) { - ExecuteNonQuery("DeleteTabSetting", TabId, SettingName); + this.ExecuteNonQuery("DeleteTabSetting", TabId, SettingName); } public virtual void DeleteTabSettings(int TabId) { - ExecuteNonQuery("DeleteTabSettings", TabId); + this.ExecuteNonQuery("DeleteTabSettings", TabId); } public virtual void DeleteTabUrl(int tabId, int seqNum) { - ExecuteNonQuery("DeleteTabUrl", tabId, seqNum); + this.ExecuteNonQuery("DeleteTabUrl", tabId, seqNum); } public virtual void DeleteTabVersion(int tabVersionId) { - ExecuteNonQuery("DeleteTabVersion", tabVersionId); + this.ExecuteNonQuery("DeleteTabVersion", tabVersionId); } public virtual void DeleteTabVersionDetail(int tabVersionDetailId) { - ExecuteNonQuery("DeleteTabVersionDetail", tabVersionDetailId); + this.ExecuteNonQuery("DeleteTabVersionDetail", tabVersionDetailId); } public virtual void DeleteTabVersionDetailByModule(int moduleId) { - ExecuteNonQuery("DeleteTabVersionDetailByModule", moduleId); + this.ExecuteNonQuery("DeleteTabVersionDetailByModule", moduleId); } public virtual void DeleteTranslatedTabs(int tabId, string cultureCode) { - ExecuteNonQuery("DeleteTranslatedTabs", tabId, cultureCode); + this.ExecuteNonQuery("DeleteTranslatedTabs", tabId, cultureCode); } public virtual void EnsureNeutralLanguage(int portalId, string cultureCode) { - ExecuteNonQuery("EnsureNeutralLanguage", portalId, cultureCode); + this.ExecuteNonQuery("EnsureNeutralLanguage", portalId, cultureCode); } public virtual void ConvertTabToNeutralLanguage(int portalId, int tabId, string cultureCode) { - ExecuteNonQuery("ConvertTabToNeutralLanguage", portalId, tabId, cultureCode); + this.ExecuteNonQuery("ConvertTabToNeutralLanguage", portalId, tabId, cultureCode); } public virtual IDataReader GetAllTabs() { - return ExecuteReader("GetAllTabs"); + return this.ExecuteReader("GetAllTabs"); } public virtual IDataReader GetTab(int tabId) { - return ExecuteReader("GetTab", tabId); + return this.ExecuteReader("GetTab", tabId); } public virtual IDataReader GetTabByUniqueID(Guid uniqueId) { - return ExecuteReader("GetTabByUniqueID", uniqueId); + return this.ExecuteReader("GetTabByUniqueID", uniqueId); } public virtual IDataReader GetTabPanes(int tabId) { - return ExecuteReader("GetTabPanes", tabId); + return this.ExecuteReader("GetTabPanes", tabId); } public virtual IDataReader GetTabPaths(int portalId, string cultureCode) { - return ExecuteReader("GetTabPaths", GetNull(portalId), cultureCode); + return this.ExecuteReader("GetTabPaths", this.GetNull(portalId), cultureCode); } public virtual IDataReader GetTabs(int portalId) { - return ExecuteReader("GetTabs", GetNull(portalId)); + return this.ExecuteReader("GetTabs", this.GetNull(portalId)); } public virtual IDataReader GetTabsByModuleID(int moduleID) { - return ExecuteReader("GetTabsByModuleID", moduleID); + return this.ExecuteReader("GetTabsByModuleID", moduleID); } public virtual IDataReader GetTabsByTabModuleID(int tabModuleID) { - return ExecuteReader("GetTabsByTabModuleID", tabModuleID); + return this.ExecuteReader("GetTabsByTabModuleID", tabModuleID); } public virtual IDataReader GetTabsByPackageID(int portalID, int packageID, bool forHost) { - return ExecuteReader("GetTabsByPackageID", GetNull(portalID), packageID, forHost); + return this.ExecuteReader("GetTabsByPackageID", this.GetNull(portalID), packageID, forHost); } public virtual IDataReader GetTabSetting(int TabID, string SettingName) { - return ExecuteReader("GetTabSetting", TabID, SettingName); + return this.ExecuteReader("GetTabSetting", TabID, SettingName); } public virtual IDataReader GetTabSettings(int portalId) { - return ExecuteReader("GetTabSettings", GetNull(portalId)); + return this.ExecuteReader("GetTabSettings", this.GetNull(portalId)); } public virtual IDataReader GetTabAliasSkins(int portalId) { - return ExecuteReader("GetTabAliasSkins", GetNull(portalId)); + return this.ExecuteReader("GetTabAliasSkins", this.GetNull(portalId)); } public virtual IDataReader GetTabCustomAliases(int portalId) { - return ExecuteReader("GetTabCustomAliases", GetNull(portalId)); + return this.ExecuteReader("GetTabCustomAliases", this.GetNull(portalId)); } public virtual IDataReader GetTabUrls(int portalId) { - return ExecuteReader("GetTabUrls", GetNull(portalId)); + return this.ExecuteReader("GetTabUrls", this.GetNull(portalId)); } public virtual IDataReader GetTabVersions(int tabId) { - return ExecuteReader("GetTabVersions", GetNull(tabId)); + return this.ExecuteReader("GetTabVersions", this.GetNull(tabId)); } public virtual IDataReader GetTabVersionDetails(int tabVersionId) { - return ExecuteReader("GetTabVersionDetails", GetNull(tabVersionId)); + return this.ExecuteReader("GetTabVersionDetails", this.GetNull(tabVersionId)); } public virtual IDataReader GetTabVersionDetailsHistory(int tabId, int version) { - return ExecuteReader("GetTabVersionDetailsHistory", GetNull(tabId), GetNull(version)); + return this.ExecuteReader("GetTabVersionDetailsHistory", this.GetNull(tabId), this.GetNull(version)); } public virtual IDataReader GetCustomAliasesForTabs() { - return ExecuteReader("GetCustomAliasesForTabs"); + return this.ExecuteReader("GetCustomAliasesForTabs"); } public virtual void LocalizeTab(int tabId, string cultureCode, int lastModifiedByUserID) { - ExecuteNonQuery("LocalizeTab", tabId, cultureCode, lastModifiedByUserID); + this.ExecuteNonQuery("LocalizeTab", tabId, cultureCode, lastModifiedByUserID); } public virtual void MoveTabAfter(int tabId, int afterTabId, int lastModifiedByUserID) { - ExecuteNonQuery("MoveTabAfter", tabId, afterTabId, lastModifiedByUserID); + this.ExecuteNonQuery("MoveTabAfter", tabId, afterTabId, lastModifiedByUserID); } public virtual void MoveTabBefore(int tabId, int beforeTabId, int lastModifiedByUserID) { - ExecuteNonQuery("MoveTabBefore", tabId, beforeTabId, lastModifiedByUserID); + this.ExecuteNonQuery("MoveTabBefore", tabId, beforeTabId, lastModifiedByUserID); } public virtual void MoveTabToParent(int tabId, int parentId, int lastModifiedByUserID) { - ExecuteNonQuery("MoveTabToParent", tabId, GetNull(parentId), lastModifiedByUserID); + this.ExecuteNonQuery("MoveTabToParent", tabId, this.GetNull(parentId), lastModifiedByUserID); } public virtual void SaveTabUrl(int tabId, int seqNum, int portalAliasId, int portalAliasUsage, string url, string queryString, string cultureCode, string httpStatus, bool isSystem, int modifiedByUserID) { - ExecuteNonQuery("SaveTabUrl", tabId, seqNum, GetNull(portalAliasId), portalAliasUsage, url, queryString, cultureCode, httpStatus, isSystem, modifiedByUserID); + this.ExecuteNonQuery("SaveTabUrl", tabId, seqNum, this.GetNull(portalAliasId), portalAliasUsage, url, queryString, cultureCode, httpStatus, isSystem, modifiedByUserID); } public virtual int SaveTabVersion(int tabVersionId, int tabId, DateTime timeStamp, int version, bool isPublished, int createdByUserID, int modifiedByUserID) { - return ExecuteScalar("SaveTabVersion", tabVersionId, tabId, timeStamp, version, isPublished, createdByUserID, modifiedByUserID); + return this.ExecuteScalar("SaveTabVersion", tabVersionId, tabId, timeStamp, version, isPublished, createdByUserID, modifiedByUserID); } public virtual int SaveTabVersionDetail(int tabVersionDetailId, int tabVersionId, int moduleId, int moduleVersion, string paneName, int moduleOrder, int action, int createdByUserID, int modifiedByUserID) { - return ExecuteScalar("SaveTabVersionDetail", tabVersionDetailId, tabVersionId, moduleId, moduleVersion, paneName, moduleOrder, action, createdByUserID, modifiedByUserID); + return this.ExecuteScalar("SaveTabVersionDetail", tabVersionDetailId, tabVersionId, moduleId, moduleVersion, paneName, moduleOrder, action, createdByUserID, modifiedByUserID); } public virtual void UpdateTab(int tabId, int contentItemId, int portalId, Guid versionGuid, @@ -1012,17 +1012,17 @@ public virtual void UpdateTab(int tabId, int contentItemId, int portalId, Guid v bool permanentRedirect, float siteMapPriority, int lastModifiedByuserID, string cultureCode, bool IsSystem) { - ExecuteNonQuery("UpdateTab", + this.ExecuteNonQuery("UpdateTab", tabId, contentItemId, - GetNull(portalId), + this.GetNull(portalId), versionGuid, - GetNull(defaultLanguageGuid), + this.GetNull(defaultLanguageGuid), localizedVersionGuid, tabName, isVisible, disableLink, - GetNull(parentId), + this.GetNull(parentId), iconFile, iconFileLarge, title, @@ -1030,44 +1030,44 @@ public virtual void UpdateTab(int tabId, int contentItemId, int portalId, Guid v keyWords, isDeleted, url, - GetNull(skinSrc), - GetNull(containerSrc), - GetNull(startDate), - GetNull(endDate), - GetNull(refreshInterval), - GetNull(pageHeadText), + this.GetNull(skinSrc), + this.GetNull(containerSrc), + this.GetNull(startDate), + this.GetNull(endDate), + this.GetNull(refreshInterval), + this.GetNull(pageHeadText), isSecure, permanentRedirect, siteMapPriority, lastModifiedByuserID, - GetNull(cultureCode), + this.GetNull(cultureCode), IsSystem); } public virtual void UpdateTabOrder(int tabId, int tabOrder, int parentId, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateTabOrder", tabId, tabOrder, GetNull(parentId), lastModifiedByUserID); + this.ExecuteNonQuery("UpdateTabOrder", tabId, tabOrder, this.GetNull(parentId), lastModifiedByUserID); } public virtual void UpdateTabSetting(int TabId, string SettingName, string SettingValue, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateTabSetting", TabId, SettingName, SettingValue, lastModifiedByUserID); + this.ExecuteNonQuery("UpdateTabSetting", TabId, SettingName, SettingValue, lastModifiedByUserID); } public virtual void UpdateTabTranslationStatus(int tabId, Guid localizedVersionGuid, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateTabTranslationStatus", tabId, localizedVersionGuid, lastModifiedByUserID); + this.ExecuteNonQuery("UpdateTabTranslationStatus", tabId, localizedVersionGuid, lastModifiedByUserID); } public virtual void MarkAsPublished(int tabId) { - ExecuteNonQuery("PublishTab", tabId); + this.ExecuteNonQuery("PublishTab", tabId); } public virtual void UpdateTabVersion(int tabId, Guid versionGuid) { - ExecuteNonQuery("UpdateTabVersion", tabId, versionGuid); + this.ExecuteNonQuery("UpdateTabVersion", tabId, versionGuid); } #endregion @@ -1079,13 +1079,13 @@ public virtual int AddModule(int contentItemId, int portalId, int moduleDefId, b bool isShareableViewOnly, bool isDeleted, int createdByUserID) { - return ExecuteScalar("AddModule", + return this.ExecuteScalar("AddModule", contentItemId, - GetNull(portalId), + this.GetNull(portalId), moduleDefId, allTabs, - GetNull(startDate), - GetNull(endDate), + this.GetNull(startDate), + this.GetNull(endDate), inheritViewPermissions, isShareable, isShareableViewOnly, @@ -1103,32 +1103,32 @@ public virtual void AddTabModule(int TabId, int ModuleId, string ModuleTitle, st Guid DefaultLanguageGuid, Guid LocalizedVersionGuid, string CultureCode, int createdByUserID) { - ExecuteNonQuery("AddTabModule", + this.ExecuteNonQuery("AddTabModule", TabId, ModuleId, ModuleTitle, - GetNull(Header), - GetNull(Footer), + this.GetNull(Header), + this.GetNull(Footer), ModuleOrder, PaneName, CacheTime, - GetNull(CacheMethod), - GetNull(Alignment), - GetNull(Color), - GetNull(Border), - GetNull(IconFile), + this.GetNull(CacheMethod), + this.GetNull(Alignment), + this.GetNull(Color), + this.GetNull(Border), + this.GetNull(IconFile), Visibility, - GetNull(ContainerSrc), + this.GetNull(ContainerSrc), DisplayTitle, DisplayPrint, DisplaySyndicate, IsWebSlice, WebSliceTitle, - GetNull(WebSliceExpiryDate), + this.GetNull(WebSliceExpiryDate), WebSliceTTL, UniqueId, VersionGuid, - GetNull(DefaultLanguageGuid), + this.GetNull(DefaultLanguageGuid), LocalizedVersionGuid, CultureCode, createdByUserID); @@ -1137,138 +1137,138 @@ public virtual void AddTabModule(int TabId, int ModuleId, string ModuleTitle, st public virtual void DeleteModule(int moduleId) { - ExecuteNonQuery("DeleteModule", moduleId); + this.ExecuteNonQuery("DeleteModule", moduleId); } public virtual void DeleteModuleSetting(int moduleId, string settingName) { - ExecuteNonQuery("DeleteModuleSetting", moduleId, settingName); + this.ExecuteNonQuery("DeleteModuleSetting", moduleId, settingName); } public virtual void DeleteModuleSettings(int moduleId) { - ExecuteNonQuery("DeleteModuleSettings", moduleId); + this.ExecuteNonQuery("DeleteModuleSettings", moduleId); } public virtual void DeleteTabModule(int tabId, int moduleId, bool softDelete, int lastModifiedByUserId = -1) { - ExecuteNonQuery("DeleteTabModule", tabId, moduleId, softDelete, lastModifiedByUserId); + this.ExecuteNonQuery("DeleteTabModule", tabId, moduleId, softDelete, lastModifiedByUserId); } public virtual void DeleteTabModuleSetting(int tabModuleId, string settingName) { - ExecuteNonQuery("DeleteTabModuleSetting", tabModuleId, settingName); + this.ExecuteNonQuery("DeleteTabModuleSetting", tabModuleId, settingName); } public virtual void DeleteTabModuleSettings(int tabModuleId) { - ExecuteNonQuery("DeleteTabModuleSettings", tabModuleId); + this.ExecuteNonQuery("DeleteTabModuleSettings", tabModuleId); } public virtual IDataReader GetTabModuleSettingsByName(int portalId, string settingName) { - return ExecuteReader("GetTabModuleSettingsByName", portalId, settingName); + return this.ExecuteReader("GetTabModuleSettingsByName", portalId, settingName); } public virtual IDataReader GetTabModuleIdsBySettingNameAndValue(int portalId, string settingName, string expectedValue) { - return ExecuteReader("GetTabModuleIdsBySettingNameAndValue", portalId, settingName, expectedValue); + return this.ExecuteReader("GetTabModuleIdsBySettingNameAndValue", portalId, settingName, expectedValue); } public virtual IDataReader GetAllModules() { - return ExecuteReader("GetAllModules"); + return this.ExecuteReader("GetAllModules"); } public virtual IDataReader GetAllTabsModules(int portalId, bool allTabs) { - return ExecuteReader("GetAllTabsModules", portalId, allTabs); + return this.ExecuteReader("GetAllTabsModules", portalId, allTabs); } public virtual IDataReader GetAllTabsModulesByModuleID(int moduleId) { - return ExecuteReader("GetAllTabsModulesByModuleID", moduleId); + return this.ExecuteReader("GetAllTabsModulesByModuleID", moduleId); } public virtual IDataReader GetModule(int moduleId, int tabId) { - return ExecuteReader("GetModule", moduleId, GetNull(tabId)); + return this.ExecuteReader("GetModule", moduleId, this.GetNull(tabId)); } public virtual IDataReader GetModuleByDefinition(int portalId, string definitionName) { - return ExecuteReader("GetModuleByDefinition", GetNull(portalId), definitionName); + return this.ExecuteReader("GetModuleByDefinition", this.GetNull(portalId), definitionName); } public virtual IDataReader GetModuleByUniqueID(Guid uniqueId) { - return ExecuteReader("GetModuleByUniqueID", uniqueId); + return this.ExecuteReader("GetModuleByUniqueID", uniqueId); } public virtual IDataReader GetModules(int portalId) { - return ExecuteReader("GetModules", portalId); + return this.ExecuteReader("GetModules", portalId); } public virtual IDataReader GetModuleSetting(int moduleId, string settingName) { - return ExecuteReader("GetModuleSetting", moduleId, settingName); + return this.ExecuteReader("GetModuleSetting", moduleId, settingName); } public virtual IDataReader GetModuleSettings(int moduleId) { - return ExecuteReader("GetModuleSettings", moduleId); + return this.ExecuteReader("GetModuleSettings", moduleId); } public virtual IDataReader GetModuleSettingsByTab(int tabId) { - return ExecuteReader("GetModuleSettingsByTab", tabId); + return this.ExecuteReader("GetModuleSettingsByTab", tabId); } public virtual IDataReader GetSearchModules(int portalId) { - return ExecuteReader("GetSearchModules", GetNull(portalId)); + return this.ExecuteReader("GetSearchModules", this.GetNull(portalId)); } public virtual IDataReader GetTabModule(int tabModuleId) { - return ExecuteReader("GetTabModule", tabModuleId); + return this.ExecuteReader("GetTabModule", tabModuleId); } public virtual IDataReader GetTabModuleOrder(int tabId, string paneName) { - return ExecuteReader("GetTabModuleOrder", tabId, paneName); + return this.ExecuteReader("GetTabModuleOrder", tabId, paneName); } public virtual IDataReader GetTabModules(int tabId) { - return ExecuteReader("GetTabModules", tabId); + return this.ExecuteReader("GetTabModules", tabId); } public virtual IDataReader GetTabModuleSetting(int tabModuleId, string settingName) { - return ExecuteReader("GetTabModuleSetting", tabModuleId, settingName); + return this.ExecuteReader("GetTabModuleSetting", tabModuleId, settingName); } public virtual IDataReader GetTabModuleSettings(int tabModuleId) { - return ExecuteReader("GetTabModuleSettings", tabModuleId); + return this.ExecuteReader("GetTabModuleSettings", tabModuleId); } public virtual IDataReader GetTabModuleSettingsByTab(int tabId) { - return ExecuteReader("GetTabModuleSettingsByTab", tabId); + return this.ExecuteReader("GetTabModuleSettingsByTab", tabId); } public virtual void MoveTabModule(int fromTabId, int moduleId, int toTabId, string toPaneName, int lastModifiedByUserID) { - ExecuteNonQuery("MoveTabModule", fromTabId, moduleId, toTabId, toPaneName, lastModifiedByUserID); + this.ExecuteNonQuery("MoveTabModule", fromTabId, moduleId, toTabId, toPaneName, lastModifiedByUserID); } public virtual void RestoreTabModule(int tabId, int moduleId) { - ExecuteNonQuery("RestoreTabModule", tabId, moduleId); + this.ExecuteNonQuery("RestoreTabModule", tabId, moduleId); } public virtual void UpdateModule(int moduleId, int moduleDefId, int contentItemId, bool allTabs, @@ -1277,13 +1277,13 @@ public virtual void UpdateModule(int moduleId, int moduleDefId, int contentItemI bool isShareableViewOnly, bool isDeleted, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateModule", + this.ExecuteNonQuery("UpdateModule", moduleId, moduleDefId, contentItemId, allTabs, - GetNull(startDate), - GetNull(endDate), + this.GetNull(startDate), + this.GetNull(endDate), inheritViewPermissions, isShareable, isShareableViewOnly, @@ -1293,18 +1293,18 @@ public virtual void UpdateModule(int moduleId, int moduleDefId, int contentItemI public virtual void UpdateModuleLastContentModifiedOnDate(int moduleId) { - ExecuteNonQuery("UpdateModuleLastContentModifiedOnDate", moduleId); + this.ExecuteNonQuery("UpdateModuleLastContentModifiedOnDate", moduleId); } public virtual void UpdateModuleOrder(int tabId, int moduleId, int moduleOrder, string paneName) { - ExecuteNonQuery("UpdateModuleOrder", tabId, moduleId, moduleOrder, paneName); + this.ExecuteNonQuery("UpdateModuleOrder", tabId, moduleId, moduleOrder, paneName); } public virtual void UpdateModuleSetting(int moduleId, string settingName, string settingValue, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateModuleSetting", moduleId, settingName, settingValue, lastModifiedByUserID); + this.ExecuteNonQuery("UpdateModuleSetting", moduleId, settingName, settingValue, lastModifiedByUserID); } public virtual void UpdateTabModule(int TabModuleId, int TabId, int ModuleId, string ModuleTitle, string Header, @@ -1317,32 +1317,32 @@ public virtual void UpdateTabModule(int TabModuleId, int TabId, int ModuleId, st Guid DefaultLanguageGuid, Guid LocalizedVersionGuid, string CultureCode, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateTabModule", + this.ExecuteNonQuery("UpdateTabModule", TabModuleId, TabId, ModuleId, ModuleTitle, - GetNull(Header), - GetNull(Footer), + this.GetNull(Header), + this.GetNull(Footer), ModuleOrder, PaneName, CacheTime, - GetNull(CacheMethod), - GetNull(Alignment), - GetNull(Color), - GetNull(Border), - GetNull(IconFile), + this.GetNull(CacheMethod), + this.GetNull(Alignment), + this.GetNull(Color), + this.GetNull(Border), + this.GetNull(IconFile), Visibility, - GetNull(ContainerSrc), + this.GetNull(ContainerSrc), DisplayTitle, DisplayPrint, DisplaySyndicate, IsWebSlice, WebSliceTitle, - GetNull(WebSliceExpiryDate), + this.GetNull(WebSliceExpiryDate), WebSliceTTL, VersionGuid, - GetNull(DefaultLanguageGuid), + this.GetNull(DefaultLanguageGuid), LocalizedVersionGuid, CultureCode, lastModifiedByUserID); @@ -1351,28 +1351,28 @@ public virtual void UpdateTabModule(int TabModuleId, int TabId, int ModuleId, st public virtual void UpdateTabModuleTranslationStatus(int tabModuleId, Guid localizedVersionGuid, int lastModifiedByUserId) { - ExecuteNonQuery("UpdateTabModuleTranslationStatus", tabModuleId, localizedVersionGuid, lastModifiedByUserId); + this.ExecuteNonQuery("UpdateTabModuleTranslationStatus", tabModuleId, localizedVersionGuid, lastModifiedByUserId); } public virtual void UpdateTabModuleSetting(int tabModuleId, string settingName, string settingValue, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateTabModuleSetting", tabModuleId, settingName, settingValue, lastModifiedByUserID); + this.ExecuteNonQuery("UpdateTabModuleSetting", tabModuleId, settingName, settingValue, lastModifiedByUserID); } public virtual void UpdateTabModuleVersion(int tabModuleId, Guid versionGuid) { - ExecuteNonQuery("UpdateTabModuleVersion", tabModuleId, versionGuid); + this.ExecuteNonQuery("UpdateTabModuleVersion", tabModuleId, versionGuid); } public virtual void UpdateTabModuleVersionByModule(int moduleId) { - ExecuteNonQuery("UpdateTabModuleVersionByModule", moduleId); + this.ExecuteNonQuery("UpdateTabModuleVersionByModule", moduleId); } public virtual IDataReader GetInstalledModules() { - return ExecuteReader("GetInstalledModules"); + return this.ExecuteReader("GetInstalledModules"); } #endregion @@ -1385,21 +1385,21 @@ public virtual int AddDesktopModule(int packageID, string moduleName, string fol string compatibleVersions, string dependencies, string permissions, int contentItemId, int createdByUserID, string adminPage, string hostPage) { - return ExecuteScalar("AddDesktopModule", + return this.ExecuteScalar("AddDesktopModule", packageID, moduleName, folderName, friendlyName, - GetNull(description), - GetNull(version), + this.GetNull(description), + this.GetNull(version), isPremium, isAdmin, businessControllerClass, supportedFeatures, shareable, - GetNull(compatibleVersions), - GetNull(dependencies), - GetNull(permissions), + this.GetNull(compatibleVersions), + this.GetNull(dependencies), + this.GetNull(permissions), contentItemId, createdByUserID, adminPage, @@ -1408,17 +1408,17 @@ public virtual int AddDesktopModule(int packageID, string moduleName, string fol public virtual void DeleteDesktopModule(int desktopModuleId) { - ExecuteNonQuery("DeleteDesktopModule", desktopModuleId); + this.ExecuteNonQuery("DeleteDesktopModule", desktopModuleId); } public virtual IDataReader GetDesktopModules() { - return ExecuteReader("GetDesktopModules"); + return this.ExecuteReader("GetDesktopModules"); } public virtual IDataReader GetDesktopModulesByPortal(int portalId) { - return ExecuteReader("GetDesktopModulesByPortal", portalId); + return this.ExecuteReader("GetDesktopModulesByPortal", portalId); } public virtual void UpdateDesktopModule(int desktopModuleId, int packageID, string moduleName, string folderName, @@ -1428,22 +1428,22 @@ public virtual void UpdateDesktopModule(int desktopModuleId, int packageID, stri string permissions, int contentItemId, int lastModifiedByUserID, string adminpage, string hostpage) { - ExecuteNonQuery("UpdateDesktopModule", + this.ExecuteNonQuery("UpdateDesktopModule", desktopModuleId, packageID, moduleName, folderName, friendlyName, - GetNull(description), - GetNull(version), + this.GetNull(description), + this.GetNull(version), isPremium, isAdmin, businessControllerClass, supportedFeatures, shareable, - GetNull(compatibleVersions), - GetNull(dependencies), - GetNull(permissions), + this.GetNull(compatibleVersions), + this.GetNull(dependencies), + this.GetNull(permissions), contentItemId, lastModifiedByUserID, adminpage, @@ -1456,17 +1456,17 @@ public virtual void UpdateDesktopModule(int desktopModuleId, int packageID, stri public virtual int AddPortalDesktopModule(int portalId, int desktopModuleId, int createdByUserID) { - return ExecuteScalar("AddPortalDesktopModule", portalId, desktopModuleId, createdByUserID); + return this.ExecuteScalar("AddPortalDesktopModule", portalId, desktopModuleId, createdByUserID); } public virtual void DeletePortalDesktopModules(int portalId, int desktopModuleId) { - ExecuteNonQuery("DeletePortalDesktopModules", GetNull(portalId), GetNull(desktopModuleId)); + this.ExecuteNonQuery("DeletePortalDesktopModules", this.GetNull(portalId), this.GetNull(desktopModuleId)); } public virtual IDataReader GetPortalDesktopModules(int portalId, int desktopModuleId) { - return ExecuteReader("GetPortalDesktopModules", GetNull(portalId), GetNull(desktopModuleId)); + return this.ExecuteReader("GetPortalDesktopModules", this.GetNull(portalId), this.GetNull(desktopModuleId)); } #endregion @@ -1476,24 +1476,24 @@ public virtual IDataReader GetPortalDesktopModules(int portalId, int desktopModu public virtual int AddModuleDefinition(int desktopModuleId, string friendlyName, string definitionName, int defaultCacheTime, int createdByUserID) { - return ExecuteScalar("AddModuleDefinition", desktopModuleId, friendlyName, definitionName, + return this.ExecuteScalar("AddModuleDefinition", desktopModuleId, friendlyName, definitionName, defaultCacheTime, createdByUserID); } public virtual void DeleteModuleDefinition(int moduleDefId) { - ExecuteNonQuery("DeleteModuleDefinition", moduleDefId); + this.ExecuteNonQuery("DeleteModuleDefinition", moduleDefId); } public virtual IDataReader GetModuleDefinitions() { - return ExecuteReader("GetModuleDefinitions"); + return this.ExecuteReader("GetModuleDefinitions"); } public virtual void UpdateModuleDefinition(int moduleDefId, string friendlyName, string definitionName, int defaultCacheTime, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateModuleDefinition", moduleDefId, friendlyName, definitionName, defaultCacheTime, + this.ExecuteNonQuery("UpdateModuleDefinition", moduleDefId, friendlyName, definitionName, defaultCacheTime, lastModifiedByUserID); } @@ -1505,15 +1505,15 @@ public virtual int AddModuleControl(int moduleDefId, string controlKey, string c string iconFile, int controlType, int viewOrder, string helpUrl, bool supportsPartialRendering, bool supportsPopUps, int createdByUserID) { - return ExecuteScalar("AddModuleControl", - GetNull(moduleDefId), - GetNull(controlKey), - GetNull(controlTitle), + return this.ExecuteScalar("AddModuleControl", + this.GetNull(moduleDefId), + this.GetNull(controlKey), + this.GetNull(controlTitle), controlSrc, - GetNull(iconFile), + this.GetNull(iconFile), controlType, - GetNull(viewOrder), - GetNull(helpUrl), + this.GetNull(viewOrder), + this.GetNull(helpUrl), supportsPartialRendering, supportsPopUps, createdByUserID); @@ -1521,12 +1521,12 @@ public virtual int AddModuleControl(int moduleDefId, string controlKey, string c public virtual void DeleteModuleControl(int moduleControlId) { - ExecuteNonQuery("DeleteModuleControl", moduleControlId); + this.ExecuteNonQuery("DeleteModuleControl", moduleControlId); } public virtual IDataReader GetModuleControls() { - return ExecuteReader("GetModuleControls"); + return this.ExecuteReader("GetModuleControls"); } public virtual void UpdateModuleControl(int moduleControlId, int moduleDefId, string controlKey, @@ -1536,16 +1536,16 @@ public virtual void UpdateModuleControl(int moduleControlId, int moduleDefId, st bool supportsPartialRendering, bool supportsPopUps, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateModuleControl", + this.ExecuteNonQuery("UpdateModuleControl", moduleControlId, - GetNull(moduleDefId), - GetNull(controlKey), - GetNull(controlTitle), + this.GetNull(moduleDefId), + this.GetNull(controlKey), + this.GetNull(controlTitle), controlSrc, - GetNull(iconFile), + this.GetNull(iconFile), controlType, - GetNull(viewOrder), - GetNull(helpUrl), + this.GetNull(viewOrder), + this.GetNull(helpUrl), supportsPartialRendering, supportsPopUps, lastModifiedByUserID); @@ -1560,8 +1560,8 @@ public virtual int AddFolder(int portalId, Guid uniqueId, Guid versionGuid, stri int createdByUserId, int folderMappingId, bool isVersioned, int workflowId, int parentId) { - return ExecuteScalar("AddFolder", - GetNull(portalId), + return this.ExecuteScalar("AddFolder", + this.GetNull(portalId), uniqueId, versionGuid, folderPath, @@ -1569,47 +1569,47 @@ public virtual int AddFolder(int portalId, Guid uniqueId, Guid versionGuid, stri storageLocation, isProtected, isCached, - GetNull(lastUpdated), + this.GetNull(lastUpdated), createdByUserId, folderMappingId, isVersioned, - GetNull(workflowId), - GetNull(parentId)); + this.GetNull(workflowId), + this.GetNull(parentId)); } public virtual void DeleteFolder(int portalId, string folderPath) { - ExecuteNonQuery("DeleteFolder", GetNull(portalId), folderPath); + this.ExecuteNonQuery("DeleteFolder", this.GetNull(portalId), folderPath); } public virtual IDataReader GetFolder(int folderId) { - return ExecuteReader("GetFolderByFolderID", folderId); + return this.ExecuteReader("GetFolderByFolderID", folderId); } public virtual IDataReader GetFolder(int portalId, string folderPath) { - return ExecuteReader("GetFolderByFolderPath", GetNull(portalId), folderPath); + return this.ExecuteReader("GetFolderByFolderPath", this.GetNull(portalId), folderPath); } public virtual IDataReader GetFolderByUniqueID(Guid uniqueId) { - return ExecuteReader("GetFolderByUniqueID", uniqueId); + return this.ExecuteReader("GetFolderByUniqueID", uniqueId); } public virtual IDataReader GetFoldersByPortal(int portalId) { - return ExecuteReader("GetFolders", GetNull(portalId)); + return this.ExecuteReader("GetFolders", this.GetNull(portalId)); } public virtual IDataReader GetFoldersByPortalAndPermissions(int portalId, string permissions, int userId) { - return ExecuteReader("GetFoldersByPermissions", GetNull(portalId), GetNull(permissions), GetNull(userId), -1, ""); + return this.ExecuteReader("GetFoldersByPermissions", this.GetNull(portalId), this.GetNull(permissions), this.GetNull(userId), -1, ""); } public virtual int GetLegacyFolderCount() { - return ExecuteScalar("GetLegacyFolderCount"); + return this.ExecuteScalar("GetLegacyFolderCount"); } public virtual void UpdateFolder(int portalId, Guid versionGuid, int folderId, string folderPath, @@ -1617,8 +1617,8 @@ public virtual void UpdateFolder(int portalId, Guid versionGuid, int folderId, s bool isProtected, bool isCached, DateTime lastUpdated, int lastModifiedByUserID, int folderMappingID, bool isVersioned, int workflowID, int parentID) { - ExecuteNonQuery("UpdateFolder", - GetNull(portalId), + this.ExecuteNonQuery("UpdateFolder", + this.GetNull(portalId), versionGuid, folderId, folderPath, @@ -1626,22 +1626,22 @@ public virtual void UpdateFolder(int portalId, Guid versionGuid, int folderId, s storageLocation, isProtected, isCached, - GetNull(lastUpdated), + this.GetNull(lastUpdated), lastModifiedByUserID, folderMappingID, isVersioned, - GetNull(workflowID), - GetNull(parentID)); + this.GetNull(workflowID), + this.GetNull(parentID)); } public virtual void UpdateFolderVersion(int folderId, Guid versionGuid) { - ExecuteNonQuery("UpdateFolderVersion", folderId, versionGuid); + this.ExecuteNonQuery("UpdateFolderVersion", folderId, versionGuid); } public virtual IDataReader UpdateLegacyFolders() { - return ExecuteReader("UpdateLegacyFolders"); + return this.ExecuteReader("UpdateLegacyFolders"); } #endregion @@ -1653,15 +1653,15 @@ public virtual int AddFile(int portalId, Guid uniqueId, Guid versionGuid, string int createdByUserID, string hash, DateTime lastModificationTime, string title, string description, DateTime startDate, DateTime endDate, bool enablePublishPeriod, int contentItemId) { - return ExecuteScalar("AddFile", - GetNull(portalId), + return this.ExecuteScalar("AddFile", + this.GetNull(portalId), uniqueId, versionGuid, fileName, extension, size, - GetNull(width), - GetNull(height), + this.GetNull(width), + this.GetNull(height), contentType, folder, folderId, @@ -1672,68 +1672,68 @@ public virtual int AddFile(int portalId, Guid uniqueId, Guid versionGuid, string description, enablePublishPeriod, startDate, - GetNull(endDate), - GetNull(contentItemId)); + this.GetNull(endDate), + this.GetNull(contentItemId)); } public virtual void SetFileHasBeenPublished(int fileId, bool hasBeenPublished) { - ExecuteNonQuery("SetFileHasBeenPublished", fileId, hasBeenPublished); + this.ExecuteNonQuery("SetFileHasBeenPublished", fileId, hasBeenPublished); } public virtual int CountLegacyFiles() { - return ExecuteScalar("CountLegacyFiles"); + return this.ExecuteScalar("CountLegacyFiles"); } public virtual void ClearFileContent(int fileId) { - ExecuteNonQuery("ClearFileContent", fileId); + this.ExecuteNonQuery("ClearFileContent", fileId); } public virtual void DeleteFile(int portalId, string fileName, int folderId) { - ExecuteNonQuery("DeleteFile", GetNull(portalId), fileName, folderId); + this.ExecuteNonQuery("DeleteFile", this.GetNull(portalId), fileName, folderId); } public virtual void DeleteFiles(int portalId) { - ExecuteNonQuery("DeleteFiles", GetNull(portalId)); + this.ExecuteNonQuery("DeleteFiles", this.GetNull(portalId)); } public virtual DataTable GetAllFiles() { - return Globals.ConvertDataReaderToDataTable(ExecuteReader("GetAllFiles")); + return Globals.ConvertDataReaderToDataTable(this.ExecuteReader("GetAllFiles")); } public virtual IDataReader GetFile(string fileName, int folderId, bool retrieveUnpublishedFiles = false) { - return ExecuteReader("GetFile", fileName, folderId, retrieveUnpublishedFiles); + return this.ExecuteReader("GetFile", fileName, folderId, retrieveUnpublishedFiles); } public virtual IDataReader GetFileById(int fileId, bool retrieveUnpublishedFiles = false) { - return ExecuteReader("GetFileById", fileId, retrieveUnpublishedFiles); + return this.ExecuteReader("GetFileById", fileId, retrieveUnpublishedFiles); } public virtual IDataReader GetFileByUniqueID(Guid uniqueId) { - return ExecuteReader("GetFileByUniqueID", uniqueId); + return this.ExecuteReader("GetFileByUniqueID", uniqueId); } public virtual IDataReader GetFileContent(int fileId) { - return ExecuteReader("GetFileContent", fileId); + return this.ExecuteReader("GetFileContent", fileId); } public virtual IDataReader GetFileVersionContent(int fileId, int version) { - return ExecuteReader("GetFileVersionContent", fileId, version); + return this.ExecuteReader("GetFileVersionContent", fileId, version); } public virtual IDataReader GetFiles(int folderId, bool retrieveUnpublishedFiles, bool recursive) { - return ExecuteReader("GetFiles", folderId, retrieveUnpublishedFiles, recursive); + return this.ExecuteReader("GetFiles", folderId, retrieveUnpublishedFiles, recursive); } /// @@ -1766,14 +1766,14 @@ public virtual void UpdateFile(int fileId, Guid versionGuid, string fileName, st int lastModifiedByUserID, string hash, DateTime lastModificationTime, string title, string description, DateTime startDate, DateTime endDate, bool enablePublishPeriod, int contentItemId) { - ExecuteNonQuery("UpdateFile", + this.ExecuteNonQuery("UpdateFile", fileId, versionGuid, fileName, extension, size, - GetNull(width), - GetNull(height), + this.GetNull(width), + this.GetNull(height), contentType, folderId, lastModifiedByUserID, @@ -1783,33 +1783,33 @@ public virtual void UpdateFile(int fileId, Guid versionGuid, string fileName, st description, enablePublishPeriod, startDate, - GetNull(endDate), - GetNull(contentItemId)); + this.GetNull(endDate), + this.GetNull(contentItemId)); } public virtual void UpdateFileLastModificationTime(int fileId, DateTime lastModificationTime) { - ExecuteNonQuery("UpdateFileLastModificationTime", + this.ExecuteNonQuery("UpdateFileLastModificationTime", fileId, lastModificationTime); } public virtual void UpdateFileHashCode(int fileId, string hashCode) { - ExecuteNonQuery("UpdateFileHashCode", + this.ExecuteNonQuery("UpdateFileHashCode", fileId, hashCode); } public virtual void UpdateFileContent(int fileId, byte[] content) { - ExecuteNonQuery("UpdateFileContent", fileId, GetNull(content)); + this.ExecuteNonQuery("UpdateFileContent", fileId, this.GetNull(content)); } public virtual void UpdateFileVersion(int fileId, Guid versionGuid) { - ExecuteNonQuery("UpdateFileVersion", fileId, versionGuid); + this.ExecuteNonQuery("UpdateFileVersion", fileId, versionGuid); } #endregion @@ -1818,17 +1818,17 @@ public virtual void UpdateFileVersion(int fileId, Guid versionGuid) public virtual int AddPermission(string permissionCode, int moduleDefID, string permissionKey, string permissionName, int createdByUserID) { - return ExecuteScalar("AddPermission", moduleDefID, permissionCode, permissionKey, permissionName, createdByUserID); + return this.ExecuteScalar("AddPermission", moduleDefID, permissionCode, permissionKey, permissionName, createdByUserID); } public virtual void DeletePermission(int permissionID) { - ExecuteNonQuery("DeletePermission", permissionID); + this.ExecuteNonQuery("DeletePermission", permissionID); } public virtual void UpdatePermission(int permissionID, string permissionCode, int moduleDefID, string permissionKey, string permissionName, int lastModifiedByUserID) { - ExecuteNonQuery("UpdatePermission", permissionID, permissionCode, moduleDefID, permissionKey, permissionName, lastModifiedByUserID); + this.ExecuteNonQuery("UpdatePermission", permissionID, permissionCode, moduleDefID, permissionKey, permissionName, lastModifiedByUserID); } #endregion @@ -1839,63 +1839,63 @@ public virtual int AddModulePermission(int moduleId, int portalId, int permissio bool allowAccess, int userId, int createdByUserId) { - return ExecuteScalar("AddModulePermission", + return this.ExecuteScalar("AddModulePermission", moduleId, portalId, permissionId, - GetRoleNull(roleId), + this.GetRoleNull(roleId), allowAccess, - GetNull(userId), + this.GetNull(userId), createdByUserId); } public virtual void DeleteModulePermission(int modulePermissionId) { - ExecuteNonQuery("DeleteModulePermission", modulePermissionId); + this.ExecuteNonQuery("DeleteModulePermission", modulePermissionId); } public virtual void DeleteModulePermissionsByModuleID(int moduleId, int portalId) { - ExecuteNonQuery("DeleteModulePermissionsByModuleID", moduleId, portalId); + this.ExecuteNonQuery("DeleteModulePermissionsByModuleID", moduleId, portalId); } public virtual void DeleteModulePermissionsByUserID(int portalId, int userId) { - ExecuteNonQuery("DeleteModulePermissionsByUserID", portalId, userId); + this.ExecuteNonQuery("DeleteModulePermissionsByUserID", portalId, userId); } public virtual IDataReader GetModulePermission(int modulePermissionId) { - return ExecuteReader("GetModulePermission", modulePermissionId); + return this.ExecuteReader("GetModulePermission", modulePermissionId); } public virtual IDataReader GetModulePermissionsByModuleID(int moduleID, int permissionId) { - return ExecuteReader("GetModulePermissionsByModuleID", moduleID, permissionId); + return this.ExecuteReader("GetModulePermissionsByModuleID", moduleID, permissionId); } public virtual IDataReader GetModulePermissionsByPortal(int portalId) { - return ExecuteReader("GetModulePermissionsByPortal", portalId); + return this.ExecuteReader("GetModulePermissionsByPortal", portalId); } public virtual IDataReader GetModulePermissionsByTabID(int tabId) { - return ExecuteReader("GetModulePermissionsByTabID", tabId); + return this.ExecuteReader("GetModulePermissionsByTabID", tabId); } public virtual void UpdateModulePermission(int modulePermissionId, int moduleId, int portalId, int permissionId, int roleId, bool allowAccess, int userId, int lastModifiedByUserId) { - ExecuteNonQuery("UpdateModulePermission", + this.ExecuteNonQuery("UpdateModulePermission", modulePermissionId, moduleId, portalId, permissionId, - GetRoleNull(roleId), + this.GetRoleNull(roleId), allowAccess, - GetNull(userId), + this.GetNull(userId), lastModifiedByUserId); } @@ -1906,51 +1906,51 @@ public virtual void UpdateModulePermission(int modulePermissionId, int moduleId, public virtual int AddTabPermission(int tabId, int permissionId, int roleID, bool allowAccess, int userId, int createdByUserID) { - return ExecuteScalar("AddTabPermission", + return this.ExecuteScalar("AddTabPermission", tabId, permissionId, - GetRoleNull(roleID), + this.GetRoleNull(roleID), allowAccess, - GetNull(userId), + this.GetNull(userId), createdByUserID); } public virtual void DeleteTabPermission(int tabPermissionId) { - ExecuteNonQuery("DeleteTabPermission", tabPermissionId); + this.ExecuteNonQuery("DeleteTabPermission", tabPermissionId); } public virtual void DeleteTabPermissionsByTabID(int tabId) { - ExecuteNonQuery("DeleteTabPermissionsByTabID", tabId); + this.ExecuteNonQuery("DeleteTabPermissionsByTabID", tabId); } public virtual void DeleteTabPermissionsByUserID(int portalId, int userId) { - ExecuteNonQuery("DeleteTabPermissionsByUserID", portalId, userId); + this.ExecuteNonQuery("DeleteTabPermissionsByUserID", portalId, userId); } public virtual IDataReader GetTabPermissionsByPortal(int portalId) { - return ExecuteReader("GetTabPermissionsByPortal", GetNull(portalId)); + return this.ExecuteReader("GetTabPermissionsByPortal", this.GetNull(portalId)); } public virtual IDataReader GetTabPermissionsByTabID(int tabId, int permissionId) { - return ExecuteReader("GetTabPermissionsByTabID", tabId, permissionId); + return this.ExecuteReader("GetTabPermissionsByTabID", tabId, permissionId); } public virtual void UpdateTabPermission(int tabPermissionId, int tabId, int permissionId, int roleID, bool allowAccess, int userId, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateTabPermission", + this.ExecuteNonQuery("UpdateTabPermission", tabPermissionId, tabId, permissionId, - GetRoleNull(roleID), + this.GetRoleNull(roleID), allowAccess, - GetNull(userId), + this.GetNull(userId), lastModifiedByUserID); } @@ -1961,60 +1961,60 @@ public virtual void UpdateTabPermission(int tabPermissionId, int tabId, int perm public virtual int AddFolderPermission(int folderId, int permissionId, int roleID, bool allowAccess, int userId, int createdByUserID) { - return ExecuteScalar("AddFolderPermission", + return this.ExecuteScalar("AddFolderPermission", folderId, permissionId, - GetRoleNull(roleID), + this.GetRoleNull(roleID), allowAccess, - GetNull(userId), + this.GetNull(userId), createdByUserID); } public virtual void DeleteFolderPermission(int folderPermissionId) { - ExecuteNonQuery("DeleteFolderPermission", folderPermissionId); + this.ExecuteNonQuery("DeleteFolderPermission", folderPermissionId); } public virtual void DeleteFolderPermissionsByFolderPath(int portalId, string folderPath) { - ExecuteNonQuery("DeleteFolderPermissionsByFolderPath", GetNull(portalId), folderPath); + this.ExecuteNonQuery("DeleteFolderPermissionsByFolderPath", this.GetNull(portalId), folderPath); } public virtual void DeleteFolderPermissionsByUserID(int portalId, int userId) { - ExecuteNonQuery("DeleteFolderPermissionsByUserID", portalId, userId); + this.ExecuteNonQuery("DeleteFolderPermissionsByUserID", portalId, userId); } public virtual IDataReader GetFolderPermission(int folderPermissionId) { - return ExecuteReader("GetFolderPermission", folderPermissionId); + return this.ExecuteReader("GetFolderPermission", folderPermissionId); } public virtual IDataReader GetFolderPermissionsByFolderPath(int portalId, string folderPath, int permissionId) { - return ExecuteReader("GetFolderPermissionsByFolderPath", GetNull(portalId), folderPath, permissionId); + return this.ExecuteReader("GetFolderPermissionsByFolderPath", this.GetNull(portalId), folderPath, permissionId); } public virtual IDataReader GetFolderPermissionsByPortal(int portalId) { - return ExecuteReader("GetFolderPermissionsByPortal", GetNull(portalId)); + return this.ExecuteReader("GetFolderPermissionsByPortal", this.GetNull(portalId)); } public virtual IDataReader GetFolderPermissionsByPortalAndPath(int portalId, string pathName) { - return ExecuteReader("GetFolderPermissionsByPortalAndPath", GetNull(portalId), pathName ?? ""); + return this.ExecuteReader("GetFolderPermissionsByPortalAndPath", this.GetNull(portalId), pathName ?? ""); } public virtual void UpdateFolderPermission(int FolderPermissionID, int FolderID, int PermissionID, int roleID, bool AllowAccess, int UserID, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateFolderPermission", + this.ExecuteNonQuery("UpdateFolderPermission", FolderPermissionID, FolderID, PermissionID, - GetRoleNull(roleID), + this.GetRoleNull(roleID), AllowAccess, - GetNull(UserID), + this.GetNull(UserID), lastModifiedByUserID); } @@ -2025,56 +2025,56 @@ public virtual void UpdateFolderPermission(int FolderPermissionID, int FolderID, public virtual int AddDesktopModulePermission(int portalDesktopModuleID, int permissionID, int roleID, bool allowAccess, int userID, int createdByUserID) { - return ExecuteScalar("AddDesktopModulePermission", + return this.ExecuteScalar("AddDesktopModulePermission", portalDesktopModuleID, permissionID, - GetRoleNull(roleID), + this.GetRoleNull(roleID), allowAccess, - GetNull(userID), + this.GetNull(userID), createdByUserID); } public virtual void DeleteDesktopModulePermission(int desktopModulePermissionID) { - ExecuteNonQuery("DeleteDesktopModulePermission", desktopModulePermissionID); + this.ExecuteNonQuery("DeleteDesktopModulePermission", desktopModulePermissionID); } public virtual void DeleteDesktopModulePermissionsByPortalDesktopModuleID(int portalDesktopModuleID) { - ExecuteNonQuery("DeleteDesktopModulePermissionsByPortalDesktopModuleID", portalDesktopModuleID); + this.ExecuteNonQuery("DeleteDesktopModulePermissionsByPortalDesktopModuleID", portalDesktopModuleID); } public virtual void DeleteDesktopModulePermissionsByUserID(int userID, int portalID) { - ExecuteNonQuery("DeleteDesktopModulePermissionsByUserID", userID, portalID); + this.ExecuteNonQuery("DeleteDesktopModulePermissionsByUserID", userID, portalID); } public virtual IDataReader GetDesktopModulePermission(int desktopModulePermissionID) { - return ExecuteReader("GetDesktopModulePermission", desktopModulePermissionID); + return this.ExecuteReader("GetDesktopModulePermission", desktopModulePermissionID); } public virtual IDataReader GetDesktopModulePermissions() { - return ExecuteReader("GetDesktopModulePermissions"); + return this.ExecuteReader("GetDesktopModulePermissions"); } public virtual IDataReader GetDesktopModulePermissionsByPortalDesktopModuleID(int portalDesktopModuleID) { - return ExecuteReader("GetDesktopModulePermissionsByPortalDesktopModuleID", portalDesktopModuleID); + return this.ExecuteReader("GetDesktopModulePermissionsByPortalDesktopModuleID", portalDesktopModuleID); } public virtual void UpdateDesktopModulePermission(int desktopModulePermissionID, int portalDesktopModuleID, int permissionID, int roleID, bool allowAccess, int userID, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateDesktopModulePermission", + this.ExecuteNonQuery("UpdateDesktopModulePermission", desktopModulePermissionID, portalDesktopModuleID, permissionID, - GetRoleNull(roleID), + this.GetRoleNull(roleID), allowAccess, - GetNull(userID), + this.GetNull(userID), lastModifiedByUserID); } @@ -2084,33 +2084,33 @@ public virtual void UpdateDesktopModulePermission(int desktopModulePermissionID, public virtual int AddRoleGroup(int portalId, string groupName, string description, int createdByUserID) { - return ExecuteScalar("AddRoleGroup", portalId, groupName, description, createdByUserID); + return this.ExecuteScalar("AddRoleGroup", portalId, groupName, description, createdByUserID); } public virtual void DeleteRoleGroup(int roleGroupId) { - ExecuteNonQuery("DeleteRoleGroup", roleGroupId); + this.ExecuteNonQuery("DeleteRoleGroup", roleGroupId); } public virtual IDataReader GetRoleGroup(int portalId, int roleGroupId) { - return ExecuteReader("GetRoleGroup", portalId, roleGroupId); + return this.ExecuteReader("GetRoleGroup", portalId, roleGroupId); } public virtual IDataReader GetRoleGroupByName(int portalID, string roleGroupName) { - return ExecuteReader("GetRoleGroupByName", portalID, roleGroupName); + return this.ExecuteReader("GetRoleGroupByName", portalID, roleGroupName); } public virtual IDataReader GetRoleGroups(int portalId) { - return ExecuteReader("GetRoleGroups", portalId); + return this.ExecuteReader("GetRoleGroups", portalId); } public virtual void UpdateRoleGroup(int roleGroupId, string groupName, string description, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateRoleGroup", roleGroupId, groupName, description, lastModifiedByUserID); + this.ExecuteNonQuery("UpdateRoleGroup", roleGroupId, groupName, description, lastModifiedByUserID); } #endregion @@ -2122,17 +2122,17 @@ public virtual int AddRole(int portalId, int roleGroupId, string roleName, strin string trialFrequency, bool isPublic, bool autoAssignment, string rsvpCode, string iconFile, int createdByUserID, int status, int securityMode, bool isSystemRole) { - return ExecuteScalar("AddRole", + return this.ExecuteScalar("AddRole", portalId, - GetNull(roleGroupId), + this.GetNull(roleGroupId), roleName, description, serviceFee, billingPeriod, - GetNull(billingFrequency), + this.GetNull(billingFrequency), trialFee, trialPeriod, - GetNull(trialFrequency), + this.GetNull(trialFrequency), isPublic, autoAssignment, rsvpCode, @@ -2145,27 +2145,27 @@ public virtual int AddRole(int portalId, int roleGroupId, string roleName, strin public virtual void DeleteRole(int roleId) { - ExecuteNonQuery("DeleteRole", roleId); + this.ExecuteNonQuery("DeleteRole", roleId); } public virtual IDataReader GetPortalRoles(int portalId) { - return ExecuteReader("GetPortalRoles", portalId); + return this.ExecuteReader("GetPortalRoles", portalId); } public virtual IDataReader GetRoles() { - return ExecuteReader("GetRoles"); + return this.ExecuteReader("GetRoles"); } public virtual IDataReader GetRolesBasicSearch(int portalID, int pageIndex, int pageSize, string filterBy) { - return ExecuteReader("GetRolesBasicSearch", portalID, pageIndex, pageSize, filterBy); + return this.ExecuteReader("GetRolesBasicSearch", portalID, pageIndex, pageSize, filterBy); } public virtual IDataReader GetRoleSettings(int roleId) { - return ExecuteReader("GetRoleSettings", roleId); + return this.ExecuteReader("GetRoleSettings", roleId); } public virtual void UpdateRole(int roleId, int roleGroupId, string roleName, string description, @@ -2175,17 +2175,17 @@ public virtual void UpdateRole(int roleId, int roleGroupId, string roleName, str string iconFile, int lastModifiedByUserID, int status, int securityMode, bool isSystemRole) { - ExecuteNonQuery("UpdateRole", + this.ExecuteNonQuery("UpdateRole", roleId, - GetNull(roleGroupId), + this.GetNull(roleGroupId), roleName, description, serviceFee, billingPeriod, - GetNull(billingFrequency), + this.GetNull(billingFrequency), trialFee, trialPeriod, - GetNull(trialFrequency), + this.GetNull(trialFrequency), isPublic, autoAssignment, rsvpCode, @@ -2199,7 +2199,7 @@ public virtual void UpdateRole(int roleId, int roleGroupId, string roleName, str public virtual void UpdateRoleSetting(int roleId, string settingName, string settingValue, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateRoleSetting", + this.ExecuteNonQuery("UpdateRoleSetting", roleId, settingName, settingValue, @@ -2214,12 +2214,12 @@ public virtual int AddUser(int portalID, string username, string firstName, stri bool isSuperUser, string email, string displayName, bool updatePassword, bool isApproved, int createdByUserID) { - return ExecuteScalar("AddUser", + return this.ExecuteScalar("AddUser", portalID, username, firstName, lastName, - GetNull(affiliateId), + this.GetNull(affiliateId), isSuperUser, email, displayName, @@ -2230,78 +2230,78 @@ public virtual int AddUser(int portalID, string username, string firstName, stri public virtual void AddUserPortal(int portalId, int userId) { - ExecuteNonQuery("AddUserPortal", portalId, userId); + this.ExecuteNonQuery("AddUserPortal", portalId, userId); } public virtual void ChangeUsername(int userId, string newUsername) { - ExecuteNonQuery("ChangeUsername", userId, newUsername); + this.ExecuteNonQuery("ChangeUsername", userId, newUsername); } public virtual void DeleteUserFromPortal(int userId, int portalId) { - ExecuteNonQuery("DeleteUserPortal", userId, GetNull(portalId)); + this.ExecuteNonQuery("DeleteUserPortal", userId, this.GetNull(portalId)); } public virtual IDataReader GetAllUsers(int portalID, int pageIndex, int pageSize, bool includeDeleted, bool superUsersOnly) { - return ExecuteReader("GetAllUsers", GetNull(portalID), pageIndex, pageSize, includeDeleted, superUsersOnly); + return this.ExecuteReader("GetAllUsers", this.GetNull(portalID), pageIndex, pageSize, includeDeleted, superUsersOnly); } public virtual IDataReader GetDeletedUsers(int portalId) { - return ExecuteReader("GetDeletedUsers", GetNull(portalId)); + return this.ExecuteReader("GetDeletedUsers", this.GetNull(portalId)); } public virtual IDataReader GetUnAuthorizedUsers(int portalId, bool includeDeleted, bool superUsersOnly) { - return ExecuteReader("GetUnAuthorizedUsers", GetNull(portalId), includeDeleted, superUsersOnly); + return this.ExecuteReader("GetUnAuthorizedUsers", this.GetNull(portalId), includeDeleted, superUsersOnly); } public virtual IDataReader GetUser(int portalId, int userId) { - return ExecuteReader("GetUser", portalId, userId); + return this.ExecuteReader("GetUser", portalId, userId); } public virtual IDataReader GetUserByAuthToken(int portalID, string userToken, string authType) { - return ExecuteReader("GetUserByAuthToken", portalID, userToken, authType); + return this.ExecuteReader("GetUserByAuthToken", portalID, userToken, authType); } public virtual IDataReader GetUserByDisplayName(int portalId, string displayName) { - return ExecuteReader("GetUserByDisplayName", GetNull(portalId), displayName); + return this.ExecuteReader("GetUserByDisplayName", this.GetNull(portalId), displayName); } public virtual IDataReader GetUserByUsername(int portalId, string username) { - return ExecuteReader("GetUserByUsername", GetNull(portalId), username); + return this.ExecuteReader("GetUserByUsername", this.GetNull(portalId), username); } public virtual IDataReader GetUserByUsername(string username, string spaceReplacement) { - return ExecuteReader("GetUserByUsernameForUrl", username, spaceReplacement); + return this.ExecuteReader("GetUserByUsernameForUrl", username, spaceReplacement); } public virtual IDataReader GetUserByVanityUrl(int portalId, string vanityUrl) { - return ExecuteReader("GetUserByVanityUrl", GetNull(portalId), vanityUrl); + return this.ExecuteReader("GetUserByVanityUrl", this.GetNull(portalId), vanityUrl); } public virtual IDataReader GetUserByPasswordResetToken(int portalId, string resetToken) { - return ExecuteReader("GetUserByPasswordResetToken", GetNull(portalId), resetToken); + return this.ExecuteReader("GetUserByPasswordResetToken", this.GetNull(portalId), resetToken); } public virtual IDataReader GetDisplayNameForUser(int userId, string spaceReplacement) { - return ExecuteReader("GetDisplayNameForUser", userId, spaceReplacement); + return this.ExecuteReader("GetDisplayNameForUser", userId, spaceReplacement); } public virtual int GetUserCountByPortal(int portalId) { - return ExecuteScalar("GetUserCountByPortal", portalId); + return this.ExecuteScalar("GetUserCountByPortal", portalId); } public virtual IDataReader GetUsersAdvancedSearch(int portalId, int userId, int filterUserId, int fitlerRoleId, @@ -2314,7 +2314,7 @@ public virtual IDataReader GetUsersAdvancedSearch(int portalId, int userId, int string filterSort = ps.InputFilter(sortColumn, PortalSecurity.FilterFlag.NoSQL); string filterName = ps.InputFilter(propertyNames, PortalSecurity.FilterFlag.NoSQL); string filterValue = ps.InputFilter(propertyValues, PortalSecurity.FilterFlag.NoSQL); - return ExecuteReader("GetUsersAdvancedSearch", portalId, userId, filterUserId, fitlerRoleId, relationTypeId, + return this.ExecuteReader("GetUsersAdvancedSearch", portalId, userId, filterUserId, fitlerRoleId, relationTypeId, isAdmin, pageSize, pageIndex, filterSort, sortAscending, filterName, filterValue); } @@ -2325,14 +2325,14 @@ public virtual IDataReader GetUsersBasicSearch(int portalId, int pageIndex, int string filterSort = ps.InputFilter(sortColumn, PortalSecurity.FilterFlag.NoSQL); string filterName = ps.InputFilter(propertyName, PortalSecurity.FilterFlag.NoSQL); string filterValue = ps.InputFilter(propertyValue, PortalSecurity.FilterFlag.NoSQL); - return ExecuteReader("GetUsersBasicSearch", portalId, pageSize, pageIndex, filterSort, sortAscending, + return this.ExecuteReader("GetUsersBasicSearch", portalId, pageSize, pageIndex, filterSort, sortAscending, filterName, filterValue); } public virtual IDataReader GetUsersByEmail(int portalID, string email, int pageIndex, int pageSize, bool includeDeleted, bool superUsersOnly) { - return ExecuteReader("GetUsersByEmail", GetNull(portalID), email, pageIndex, pageSize, includeDeleted, + return this.ExecuteReader("GetUsersByEmail", this.GetNull(portalID), email, pageIndex, pageSize, includeDeleted, superUsersOnly); } @@ -2340,52 +2340,52 @@ public virtual IDataReader GetUsersByProfileProperty(int portalID, string proper int pageIndex, int pageSize, bool includeDeleted, bool superUsersOnly) { - return ExecuteReader("GetUsersByProfileProperty", GetNull(portalID), propertyName, propertyValue, pageIndex, + return this.ExecuteReader("GetUsersByProfileProperty", this.GetNull(portalID), propertyName, propertyValue, pageIndex, pageSize, includeDeleted, superUsersOnly); } public virtual IDataReader GetUsersByRolename(int portalID, string rolename) { - return ExecuteReader("GetUsersByRolename", GetNull(portalID), rolename); + return this.ExecuteReader("GetUsersByRolename", this.GetNull(portalID), rolename); } public virtual IDataReader GetUsersByUsername(int portalID, string username, int pageIndex, int pageSize, bool includeDeleted, bool superUsersOnly) { - return ExecuteReader("GetUsersByUsername", GetNull(portalID), username, pageIndex, pageSize, includeDeleted, + return this.ExecuteReader("GetUsersByUsername", this.GetNull(portalID), username, pageIndex, pageSize, includeDeleted, superUsersOnly); } public virtual IDataReader GetUsersByDisplayname(int portalId, string name, int pageIndex, int pageSize, bool includeDeleted, bool superUsersOnly) { - return ExecuteReader("GetUsersByDisplayname", GetNull(portalId), name, pageIndex, pageSize, includeDeleted, + return this.ExecuteReader("GetUsersByDisplayname", this.GetNull(portalId), name, pageIndex, pageSize, includeDeleted, superUsersOnly); } public virtual int GetDuplicateEmailCount(int portalId) { - return ExecuteScalar("GetDuplicateEmailCount", portalId); + return this.ExecuteScalar("GetDuplicateEmailCount", portalId); } public virtual int GetSingleUserByEmail(int portalId, string emailToMatch) { - return ExecuteScalar("GetSingleUserByEmail", portalId, emailToMatch); + return this.ExecuteScalar("GetSingleUserByEmail", portalId, emailToMatch); } public virtual void RemoveUser(int userId, int portalId) { - ExecuteNonQuery("RemoveUser", userId, GetNull(portalId)); + this.ExecuteNonQuery("RemoveUser", userId, this.GetNull(portalId)); } public virtual void ResetTermsAgreement(int portalId) { - ExecuteNonQuery("ResetTermsAgreement", portalId); + this.ExecuteNonQuery("ResetTermsAgreement", portalId); } public virtual void RestoreUser(int userId, int portalId) { - ExecuteNonQuery("RestoreUser", userId, GetNull(portalId)); + this.ExecuteNonQuery("RestoreUser", userId, this.GetNull(portalId)); } public virtual void UpdateUser(int userId, int portalID, string firstName, string lastName, bool isSuperUser, @@ -2393,9 +2393,9 @@ public virtual void UpdateUser(int userId, int portalID, string firstName, strin bool isApproved, bool refreshRoles, string lastIpAddress, Guid passwordResetToken, DateTime passwordResetExpiration, bool isDeleted, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateUser", + this.ExecuteNonQuery("UpdateUser", userId, - GetNull(portalID), + this.GetNull(portalID), firstName, lastName, isSuperUser, @@ -2406,25 +2406,25 @@ public virtual void UpdateUser(int userId, int portalID, string firstName, strin isApproved, refreshRoles, lastIpAddress, - GetNull(passwordResetToken), - GetNull(passwordResetExpiration), + this.GetNull(passwordResetToken), + this.GetNull(passwordResetExpiration), isDeleted, lastModifiedByUserID); } public virtual void UpdateUserLastIpAddress(int userId, string lastIpAddress) { - ExecuteNonQuery("UpdateUserLastIpAddress", userId, lastIpAddress); + this.ExecuteNonQuery("UpdateUserLastIpAddress", userId, lastIpAddress); } public virtual void UserAgreedToTerms(int portalId, int userId) { - ExecuteNonQuery("UserAgreedToTerms", portalId, userId); + this.ExecuteNonQuery("UserAgreedToTerms", portalId, userId); } public virtual void UserRequestsRemoval(int portalId, int userId, bool remove) { - ExecuteNonQuery("UserRequestsRemoval", portalId, userId, remove); + this.ExecuteNonQuery("UserRequestsRemoval", portalId, userId, remove); } #endregion @@ -2434,39 +2434,39 @@ public virtual void UserRequestsRemoval(int portalId, int userId, bool remove) public virtual int AddUserRole(int portalId, int userId, int roleId, int status, bool isOwner, DateTime effectiveDate, DateTime expiryDate, int createdByUserID) { - return ExecuteScalar("AddUserRole", portalId, userId, roleId, status, isOwner, GetNull(effectiveDate), - GetNull(expiryDate), createdByUserID); + return this.ExecuteScalar("AddUserRole", portalId, userId, roleId, status, isOwner, this.GetNull(effectiveDate), + this.GetNull(expiryDate), createdByUserID); } public virtual void DeleteUserRole(int userId, int roleId) { - ExecuteNonQuery("DeleteUserRole", userId, roleId); + this.ExecuteNonQuery("DeleteUserRole", userId, roleId); } public virtual IDataReader GetServices(int portalId, int userId) { - return ExecuteReader("GetServices", portalId, GetNull(userId)); + return this.ExecuteReader("GetServices", portalId, this.GetNull(userId)); } public virtual IDataReader GetUserRole(int portalID, int userId, int roleId) { - return ExecuteReader("GetUserRole", portalID, userId, roleId); + return this.ExecuteReader("GetUserRole", portalID, userId, roleId); } public virtual IDataReader GetUserRoles(int portalID, int userId) { - return ExecuteReader("GetUserRoles", portalID, userId); + return this.ExecuteReader("GetUserRoles", portalID, userId); } public virtual IDataReader GetUserRolesByUsername(int portalID, string username, string rolename) { - return ExecuteReader("GetUserRolesByUsername", portalID, GetNull(username), GetNull(rolename)); + return this.ExecuteReader("GetUserRolesByUsername", portalID, this.GetNull(username), this.GetNull(rolename)); } public virtual void UpdateUserRole(int userRoleId, int status, bool isOwner, DateTime effectiveDate, DateTime expiryDate, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateUserRole", userRoleId, status, isOwner, GetNull(effectiveDate), GetNull(expiryDate), + this.ExecuteNonQuery("UpdateUserRole", userRoleId, status, isOwner, this.GetNull(effectiveDate), this.GetNull(expiryDate), lastModifiedByUserID); } @@ -2477,19 +2477,19 @@ public virtual void UpdateUserRole(int userRoleId, int status, bool isOwner, Dat [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] public virtual void DeleteUsersOnline(int timeWindow) { - ExecuteNonQuery("DeleteUsersOnline", timeWindow); + this.ExecuteNonQuery("DeleteUsersOnline", timeWindow); } [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] public virtual IDataReader GetOnlineUser(int userId) { - return ExecuteReader("GetOnlineUser", userId); + return this.ExecuteReader("GetOnlineUser", userId); } [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] public virtual IDataReader GetOnlineUsers(int portalId) { - return ExecuteReader("GetOnlineUsers", portalId); + return this.ExecuteReader("GetOnlineUsers", portalId); } [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] @@ -2506,12 +2506,12 @@ public virtual void UpdateUsersOnline(Hashtable userList) if (info != null) { var user = info; - ExecuteNonQuery("UpdateAnonymousUser", user.UserID, user.PortalID, user.TabID, user.LastActiveDate); + this.ExecuteNonQuery("UpdateAnonymousUser", user.UserID, user.PortalID, user.TabID, user.LastActiveDate); } else if (userList[key] is OnlineUserInfo) { var user = (OnlineUserInfo)userList[key]; - ExecuteNonQuery("UpdateOnlineUser", user.UserID, user.PortalID, user.TabID, user.LastActiveDate); + this.ExecuteNonQuery("UpdateOnlineUser", user.UserID, user.PortalID, user.TabID, user.LastActiveDate); } } } @@ -2528,8 +2528,8 @@ public virtual int AddPropertyDefinition(int portalId, int moduleDefId, int data int retValue; try { - retValue = ExecuteScalar("AddPropertyDefinition", - GetNull(portalId), + retValue = this.ExecuteScalar("AddPropertyDefinition", + this.GetNull(portalId), moduleDefId, dataType, defaultValue, @@ -2560,34 +2560,34 @@ public virtual int AddPropertyDefinition(int portalId, int moduleDefId, int data public virtual void DeletePropertyDefinition(int definitionId) { - ExecuteNonQuery("DeletePropertyDefinition", definitionId); + this.ExecuteNonQuery("DeletePropertyDefinition", definitionId); } public virtual IDataReader GetPropertyDefinition(int definitionId) { - return ExecuteReader("GetPropertyDefinition", definitionId); + return this.ExecuteReader("GetPropertyDefinition", definitionId); } public virtual IDataReader GetPropertyDefinitionByName(int portalId, string name) { - return ExecuteReader("GetPropertyDefinitionByName", GetNull(portalId), name); + return this.ExecuteReader("GetPropertyDefinitionByName", this.GetNull(portalId), name); } public virtual IDataReader GetPropertyDefinitionsByPortal(int portalId) { - return ExecuteReader("GetPropertyDefinitionsByPortal", GetNull(portalId)); + return this.ExecuteReader("GetPropertyDefinitionsByPortal", this.GetNull(portalId)); } public virtual IDataReader GetUserProfile(int userId) { - return ExecuteReader("GetUserProfile", userId); + return this.ExecuteReader("GetUserProfile", userId); } public virtual void UpdateProfileProperty(int profileId, int userId, int propertyDefinitionID, string propertyValue, int visibility, string extendedVisibility, DateTime lastUpdatedDate) { - ExecuteNonQuery("UpdateUserProfileProperty", GetNull(profileId), userId, propertyDefinitionID, propertyValue, + this.ExecuteNonQuery("UpdateUserProfileProperty", this.GetNull(profileId), userId, propertyDefinitionID, propertyValue, visibility, extendedVisibility, lastUpdatedDate); } @@ -2596,7 +2596,7 @@ public virtual void UpdatePropertyDefinition(int propertyDefinitionId, int dataT bool required, string validation, int viewOrder, bool visible, int length, int defaultVisibility, int lastModifiedByUserId) { - ExecuteNonQuery("UpdatePropertyDefinition", + this.ExecuteNonQuery("UpdatePropertyDefinition", propertyDefinitionId, dataType, defaultValue, @@ -2614,7 +2614,7 @@ public virtual void UpdatePropertyDefinition(int propertyDefinitionId, int dataT public virtual IDataReader SearchProfilePropertyValues(int portalId, string propertyName, string searchString) { - return ExecuteReader("SearchProfilePropertyValues", portalId, propertyName, searchString); + return this.ExecuteReader("SearchProfilePropertyValues", portalId, propertyName, searchString); } #endregion @@ -2625,9 +2625,9 @@ public virtual int AddSkinControl(int packageID, string ControlKey, string Contr bool SupportsPartialRendering, int CreatedByUserID) { - return ExecuteScalar("AddSkinControl", - GetNull(packageID), - GetNull(ControlKey), + return this.ExecuteScalar("AddSkinControl", + this.GetNull(packageID), + this.GetNull(ControlKey), ControlSrc, SupportsPartialRendering, CreatedByUserID); @@ -2635,36 +2635,36 @@ public virtual int AddSkinControl(int packageID, string ControlKey, string Contr public virtual void DeleteSkinControl(int skinControlID) { - ExecuteNonQuery("DeleteSkinControl", skinControlID); + this.ExecuteNonQuery("DeleteSkinControl", skinControlID); } public virtual IDataReader GetSkinControls() { - return ExecuteReader("GetSkinControls"); + return this.ExecuteReader("GetSkinControls"); } public virtual IDataReader GetSkinControl(int skinControlID) { - return ExecuteReader("GetSkinControl", skinControlID); + return this.ExecuteReader("GetSkinControl", skinControlID); } public virtual IDataReader GetSkinControlByKey(string controlKey) { - return ExecuteReader("GetSkinControlByKey", controlKey); + return this.ExecuteReader("GetSkinControlByKey", controlKey); } public virtual IDataReader GetSkinControlByPackageID(int packageID) { - return ExecuteReader("GetSkinControlByPackageID", packageID); + return this.ExecuteReader("GetSkinControlByPackageID", packageID); } public virtual void UpdateSkinControl(int skinControlID, int packageID, string ControlKey, string ControlSrc, bool SupportsPartialRendering, int LastModifiedByUserID) { - ExecuteNonQuery("UpdateSkinControl", + this.ExecuteNonQuery("UpdateSkinControl", skinControlID, - GetNull(packageID), - GetNull(ControlKey), + this.GetNull(packageID), + this.GetNull(ControlKey), ControlSrc, SupportsPartialRendering, LastModifiedByUserID); @@ -2676,50 +2676,50 @@ public virtual void UpdateSkinControl(int skinControlID, int packageID, string C public virtual int AddSkin(int skinPackageID, string skinSrc) { - return ExecuteScalar("AddSkin", skinPackageID, skinSrc); + return this.ExecuteScalar("AddSkin", skinPackageID, skinSrc); } public virtual int AddSkinPackage(int packageID, int portalID, string skinName, string skinType, int createdByUserId) { - return ExecuteScalar("AddSkinPackage", packageID, GetNull(portalID), skinName, skinType, + return this.ExecuteScalar("AddSkinPackage", packageID, this.GetNull(portalID), skinName, skinType, createdByUserId); } public virtual bool CanDeleteSkin(string skinType, string skinFoldername) { - return ExecuteScalar("CanDeleteSkin", skinType, skinFoldername) == 1; + return this.ExecuteScalar("CanDeleteSkin", skinType, skinFoldername) == 1; } public virtual void DeleteSkin(int skinID) { - ExecuteNonQuery("DeleteSkin", skinID); + this.ExecuteNonQuery("DeleteSkin", skinID); } public virtual void DeleteSkinPackage(int skinPackageID) { - ExecuteNonQuery("DeleteSkinPackage", skinPackageID); + this.ExecuteNonQuery("DeleteSkinPackage", skinPackageID); } public virtual IDataReader GetSkinByPackageID(int packageID) { - return ExecuteReader("GetSkinPackageByPackageID", packageID); + return this.ExecuteReader("GetSkinPackageByPackageID", packageID); } public virtual IDataReader GetSkinPackage(int portalID, string skinName, string skinType) { - return ExecuteReader("GetSkinPackage", GetNull(portalID), skinName, skinType); + return this.ExecuteReader("GetSkinPackage", this.GetNull(portalID), skinName, skinType); } public virtual void UpdateSkin(int skinID, string skinSrc) { - ExecuteNonQuery("UpdateSkin", skinID, skinSrc); + this.ExecuteNonQuery("UpdateSkin", skinID, skinSrc); } public virtual void UpdateSkinPackage(int skinPackageID, int packageID, int portalID, string skinName, string skinType, int LastModifiedByUserID) { - ExecuteNonQuery("UpdateSkinPackage", skinPackageID, packageID, GetNull(portalID), skinName, skinType, + this.ExecuteNonQuery("UpdateSkinPackage", skinPackageID, packageID, this.GetNull(portalID), skinName, skinType, LastModifiedByUserID); } @@ -2729,22 +2729,22 @@ public virtual void UpdateSkinPackage(int skinPackageID, int packageID, int port public virtual void AddProfile(int userId, int portalId) { - ExecuteNonQuery("AddProfile", userId, portalId); + this.ExecuteNonQuery("AddProfile", userId, portalId); } public virtual IDataReader GetAllProfiles() { - return ExecuteReader("GetAllProfiles"); + return this.ExecuteReader("GetAllProfiles"); } public virtual IDataReader GetProfile(int userId, int portalId) { - return ExecuteReader("GetProfile", userId, portalId); + return this.ExecuteReader("GetProfile", userId, portalId); } public virtual void UpdateProfile(int userId, int portalId, string profileData) { - ExecuteNonQuery("UpdateProfile", userId, portalId, profileData); + this.ExecuteNonQuery("UpdateProfile", userId, portalId, profileData); } #endregion @@ -2753,60 +2753,60 @@ public virtual void UpdateProfile(int userId, int portalId, string profileData) public virtual void AddUrl(int PortalID, string Url) { - ExecuteNonQuery("AddUrl", PortalID, Url); + this.ExecuteNonQuery("AddUrl", PortalID, Url); } public virtual void AddUrlLog(int UrlTrackingID, int UserID) { - ExecuteNonQuery("AddUrlLog", UrlTrackingID, GetNull(UserID)); + this.ExecuteNonQuery("AddUrlLog", UrlTrackingID, this.GetNull(UserID)); } public virtual void AddUrlTracking(int PortalID, string Url, string UrlType, bool LogActivity, bool TrackClicks, int ModuleID, bool NewWindow) { - ExecuteNonQuery("AddUrlTracking", PortalID, Url, UrlType, LogActivity, TrackClicks, GetNull(ModuleID), + this.ExecuteNonQuery("AddUrlTracking", PortalID, Url, UrlType, LogActivity, TrackClicks, this.GetNull(ModuleID), NewWindow); } public virtual void DeleteUrl(int PortalID, string Url) { - ExecuteNonQuery("DeleteUrl", PortalID, Url); + this.ExecuteNonQuery("DeleteUrl", PortalID, Url); } public virtual void DeleteUrlTracking(int PortalID, string Url, int ModuleID) { - ExecuteNonQuery("DeleteUrlTracking", PortalID, Url, GetNull(ModuleID)); + this.ExecuteNonQuery("DeleteUrlTracking", PortalID, Url, this.GetNull(ModuleID)); } public virtual IDataReader GetUrl(int PortalID, string Url) { - return ExecuteReader("GetUrl", PortalID, Url); + return this.ExecuteReader("GetUrl", PortalID, Url); } public virtual IDataReader GetUrlLog(int UrlTrackingID, DateTime StartDate, DateTime EndDate) { - return ExecuteReader("GetUrlLog", UrlTrackingID, GetNull(StartDate), GetNull(EndDate)); + return this.ExecuteReader("GetUrlLog", UrlTrackingID, this.GetNull(StartDate), this.GetNull(EndDate)); } public virtual IDataReader GetUrls(int PortalID) { - return ExecuteReader("GetUrls", PortalID); + return this.ExecuteReader("GetUrls", PortalID); } public virtual IDataReader GetUrlTracking(int PortalID, string Url, int ModuleID) { - return ExecuteReader("GetUrlTracking", PortalID, Url, GetNull(ModuleID)); + return this.ExecuteReader("GetUrlTracking", PortalID, Url, this.GetNull(ModuleID)); } public virtual void UpdateUrlTracking(int PortalID, string Url, bool LogActivity, bool TrackClicks, int ModuleID, bool NewWindow) { - ExecuteNonQuery("UpdateUrlTracking", PortalID, Url, LogActivity, TrackClicks, GetNull(ModuleID), NewWindow); + this.ExecuteNonQuery("UpdateUrlTracking", PortalID, Url, LogActivity, TrackClicks, this.GetNull(ModuleID), NewWindow); } public virtual void UpdateUrlTrackingStats(int PortalID, string Url, int ModuleID) { - ExecuteNonQuery("UpdateUrlTrackingStats", PortalID, Url, GetNull(ModuleID)); + this.ExecuteNonQuery("UpdateUrlTrackingStats", PortalID, Url, this.GetNull(ModuleID)); } #endregion @@ -2815,27 +2815,27 @@ public virtual void UpdateUrlTrackingStats(int PortalID, string Url, int ModuleI public virtual IDataReader GetDefaultLanguageByModule(string ModuleList) { - return ExecuteReader("GetDefaultLanguageByModule", ModuleList); + return this.ExecuteReader("GetDefaultLanguageByModule", ModuleList); } public virtual IDataReader GetSearchCommonWordsByLocale(string Locale) { - return ExecuteReader("GetSearchCommonWordsByLocale", Locale); + return this.ExecuteReader("GetSearchCommonWordsByLocale", Locale); } public virtual IDataReader GetSearchIndexers() { - return ExecuteReader("GetSearchIndexers"); + return this.ExecuteReader("GetSearchIndexers"); } public virtual IDataReader GetSearchResultModules(int PortalID) { - return ExecuteReader("GetSearchResultModules", PortalID); + return this.ExecuteReader("GetSearchResultModules", PortalID); } public virtual IDataReader GetSearchSettings(int ModuleId) { - return ExecuteReader("GetSearchSettings", ModuleId); + return this.ExecuteReader("GetSearchSettings", ModuleId); } #endregion @@ -2849,7 +2849,7 @@ public virtual int AddListEntry(string ListName, string Value, string Text, int { try { - return ExecuteScalar("AddListEntry", + return this.ExecuteScalar("AddListEntry", ListName, Value, Text, @@ -2875,53 +2875,53 @@ public virtual int AddListEntry(string ListName, string Value, string Text, int public virtual void DeleteList(string ListName, string ParentKey) { - ExecuteNonQuery("DeleteList", ListName, ParentKey); + this.ExecuteNonQuery("DeleteList", ListName, ParentKey); } public virtual void DeleteListEntryByID(int EntryID, bool DeleteChild) { - ExecuteNonQuery("DeleteListEntryByID", EntryID, DeleteChild); + this.ExecuteNonQuery("DeleteListEntryByID", EntryID, DeleteChild); } public virtual void DeleteListEntryByListName(string ListName, string Value, bool DeleteChild) { - ExecuteNonQuery("DeleteListEntryByListName", ListName, Value, DeleteChild); + this.ExecuteNonQuery("DeleteListEntryByListName", ListName, Value, DeleteChild); } public virtual IDataReader GetList(string ListName, string ParentKey, int PortalID) { - return ExecuteReader("GetList", ListName, ParentKey, PortalID); + return this.ExecuteReader("GetList", ListName, ParentKey, PortalID); } public virtual IDataReader GetListEntriesByListName(string ListName, string ParentKey, int PortalID) { - return ExecuteReader("GetListEntries", ListName, ParentKey, GetNull(PortalID)); + return this.ExecuteReader("GetListEntries", ListName, ParentKey, this.GetNull(PortalID)); } public virtual IDataReader GetListEntry(string ListName, string Value) { - return ExecuteReader("GetListEntry", ListName, Value, -1); + return this.ExecuteReader("GetListEntry", ListName, Value, -1); } public virtual IDataReader GetListEntry(int EntryID) { - return ExecuteReader("GetListEntry", "", "", EntryID); + return this.ExecuteReader("GetListEntry", "", "", EntryID); } public virtual IDataReader GetLists(int PortalID) { - return ExecuteReader("GetLists", PortalID); + return this.ExecuteReader("GetLists", PortalID); } public virtual void UpdateListEntry(int EntryID, string Value, string Text, string Description, int LastModifiedByUserID) { - ExecuteNonQuery("UpdateListEntry", EntryID, Value, Text, Description, LastModifiedByUserID); + this.ExecuteNonQuery("UpdateListEntry", EntryID, Value, Text, Description, LastModifiedByUserID); } public virtual void UpdateListSortOrder(int EntryID, bool MoveUp) { - ExecuteNonQuery("UpdateListSortOrder", EntryID, MoveUp); + this.ExecuteNonQuery("UpdateListSortOrder", EntryID, MoveUp); } #endregion @@ -2930,32 +2930,32 @@ public virtual void UpdateListSortOrder(int EntryID, bool MoveUp) public virtual int AddPortalAlias(int PortalID, string HTTPAlias, string cultureCode, string skin, string browserType, bool isPrimary, int createdByUserID) { - return ExecuteScalar("AddPortalAlias", PortalID, HTTPAlias, GetNull(cultureCode), GetNull(skin), GetNull(browserType), isPrimary, createdByUserID); + return this.ExecuteScalar("AddPortalAlias", PortalID, HTTPAlias, this.GetNull(cultureCode), this.GetNull(skin), this.GetNull(browserType), isPrimary, createdByUserID); } public virtual void DeletePortalAlias(int PortalAliasID) { - ExecuteNonQuery("DeletePortalAlias", PortalAliasID); + this.ExecuteNonQuery("DeletePortalAlias", PortalAliasID); } public virtual IDataReader GetPortalAliases() { - return ExecuteReader("GetPortalAliases"); + return this.ExecuteReader("GetPortalAliases"); } public virtual IDataReader GetPortalByPortalAliasID(int PortalAliasId) { - return ExecuteReader("GetPortalByPortalAliasID", PortalAliasId); + return this.ExecuteReader("GetPortalByPortalAliasID", PortalAliasId); } public virtual void UpdatePortalAlias(string PortalAlias, int lastModifiedByUserID) { - ExecuteNonQuery("UpdatePortalAliasOnInstall", PortalAlias, lastModifiedByUserID); + this.ExecuteNonQuery("UpdatePortalAliasOnInstall", PortalAlias, lastModifiedByUserID); } public virtual void UpdatePortalAliasInfo(int PortalAliasID, int PortalID, string HTTPAlias, string cultureCode, string skin, string browserType, bool isPrimary, int lastModifiedByUserID) { - ExecuteNonQuery("UpdatePortalAlias", PortalAliasID, PortalID, HTTPAlias, GetNull(cultureCode), GetNull(skin), GetNull(browserType), isPrimary, lastModifiedByUserID); + this.ExecuteNonQuery("UpdatePortalAlias", PortalAliasID, PortalID, HTTPAlias, this.GetNull(cultureCode), this.GetNull(skin), this.GetNull(browserType), isPrimary, lastModifiedByUserID); } #endregion @@ -2967,7 +2967,7 @@ public virtual int AddEventMessage(string eventName, int priority, string proces string exceptionMessage, DateTime sentDate, DateTime expirationDate, string attributes) { - return ExecuteScalar("AddEventMessage", + return this.ExecuteScalar("AddEventMessage", eventName, priority, processorType, @@ -2984,17 +2984,17 @@ public virtual int AddEventMessage(string eventName, int priority, string proces public virtual IDataReader GetEventMessages(string eventName) { - return ExecuteReader("GetEventMessages", eventName); + return this.ExecuteReader("GetEventMessages", eventName); } public virtual IDataReader GetEventMessagesBySubscriber(string eventName, string subscriberId) { - return ExecuteReader("GetEventMessagesBySubscriber", eventName, subscriberId); + return this.ExecuteReader("GetEventMessagesBySubscriber", eventName, subscriberId); } public virtual void SetEventMessageComplete(int eventMessageId) { - ExecuteNonQuery("SetEventMessageComplete", eventMessageId); + this.ExecuteNonQuery("SetEventMessageComplete", eventMessageId); } #endregion @@ -3005,7 +3005,7 @@ public virtual int AddAuthentication(int packageID, string authenticationType, b string settingsControlSrc, string loginControlSrc, string logoffControlSrc, int CreatedByUserID) { - return ExecuteScalar("AddAuthentication", + return this.ExecuteScalar("AddAuthentication", packageID, authenticationType, isEnabled, @@ -3018,7 +3018,7 @@ public virtual int AddAuthentication(int packageID, string authenticationType, b public virtual int AddUserAuthentication(int userID, string authenticationType, string authenticationToken, int CreatedByUserID) { - return ExecuteScalar("AddUserAuthentication", userID, authenticationType, authenticationToken, + return this.ExecuteScalar("AddUserAuthentication", userID, authenticationType, authenticationToken, CreatedByUserID); } @@ -3029,44 +3029,44 @@ public virtual int AddUserAuthentication(int userID, string authenticationType, /// UserAuthentication record public virtual IDataReader GetUserAuthentication(int userID) { - return ExecuteReader("GetUserAuthentication", userID); + return this.ExecuteReader("GetUserAuthentication", userID); } public virtual void DeleteAuthentication(int authenticationID) { - ExecuteNonQuery("DeleteAuthentication", authenticationID); + this.ExecuteNonQuery("DeleteAuthentication", authenticationID); } public virtual IDataReader GetAuthenticationService(int authenticationID) { - return ExecuteReader("GetAuthenticationService", authenticationID); + return this.ExecuteReader("GetAuthenticationService", authenticationID); } public virtual IDataReader GetAuthenticationServiceByPackageID(int packageID) { - return ExecuteReader("GetAuthenticationServiceByPackageID", packageID); + return this.ExecuteReader("GetAuthenticationServiceByPackageID", packageID); } public virtual IDataReader GetAuthenticationServiceByType(string authenticationType) { - return ExecuteReader("GetAuthenticationServiceByType", authenticationType); + return this.ExecuteReader("GetAuthenticationServiceByType", authenticationType); } public virtual IDataReader GetAuthenticationServices() { - return ExecuteReader("GetAuthenticationServices"); + return this.ExecuteReader("GetAuthenticationServices"); } public virtual IDataReader GetEnabledAuthenticationServices() { - return ExecuteReader("GetEnabledAuthenticationServices"); + return this.ExecuteReader("GetEnabledAuthenticationServices"); } public virtual void UpdateAuthentication(int authenticationID, int packageID, string authenticationType, bool isEnabled, string settingsControlSrc, string loginControlSrc, string logoffControlSrc, int LastModifiedByUserID) { - ExecuteNonQuery("UpdateAuthentication", + this.ExecuteNonQuery("UpdateAuthentication", authenticationID, packageID, authenticationType, @@ -3086,8 +3086,8 @@ public virtual int AddPackage(int portalID, string name, string friendlyName, st string organization, string url, string email, string releaseNotes, bool isSystemPackage, int createdByUserID, string folderName, string iconFile) { - return ExecuteScalar("AddPackage", - GetNull(portalID), + return this.ExecuteScalar("AddPackage", + this.GetNull(portalID), name, friendlyName, description, @@ -3108,43 +3108,43 @@ public virtual int AddPackage(int portalID, string name, string friendlyName, st public virtual void DeletePackage(int packageID) { - ExecuteNonQuery("DeletePackage", packageID); + this.ExecuteNonQuery("DeletePackage", packageID); } public virtual IDataReader GetModulePackagesInUse(int portalID, bool forHost) { - return ExecuteReader("GetModulePackagesInUse", portalID, forHost); + return this.ExecuteReader("GetModulePackagesInUse", portalID, forHost); } public virtual IDataReader GetPackageDependencies() { - return ExecuteReader("GetPackageDependencies"); + return this.ExecuteReader("GetPackageDependencies"); } public virtual IDataReader GetPackages(int portalID) { - return ExecuteReader("GetPackages", GetNull(portalID)); + return this.ExecuteReader("GetPackages", this.GetNull(portalID)); } public virtual IDataReader GetPackageTypes() { - return ExecuteReader("GetPackageTypes"); + return this.ExecuteReader("GetPackageTypes"); } public virtual int RegisterAssembly(int packageID, string assemblyName, string version) { - return ExecuteScalar("RegisterAssembly", GetNull(packageID), assemblyName, version); + return this.ExecuteScalar("RegisterAssembly", this.GetNull(packageID), assemblyName, version); } public virtual int SavePackageDependency(int packageDependencyId, int packageId, string packageName, string version) { - return ExecuteScalar("SavePackageDependency", packageDependencyId, packageId, packageName, version); + return this.ExecuteScalar("SavePackageDependency", packageDependencyId, packageId, packageName, version); } public virtual bool UnRegisterAssembly(int packageID, string assemblyName) { - return ExecuteScalar("UnRegisterAssembly", packageID, assemblyName) == 1; + return this.ExecuteScalar("UnRegisterAssembly", packageID, assemblyName) == 1; } public virtual void UpdatePackage(int packageID, int portalID, string friendlyName, string description, @@ -3153,9 +3153,9 @@ public virtual void UpdatePackage(int packageID, int portalID, string friendlyNa bool isSystemPackage, int lastModifiedByUserID, string folderName, string iconFile) { - ExecuteNonQuery("UpdatePackage", + this.ExecuteNonQuery("UpdatePackage", packageID, - GetNull(portalID), + this.GetNull(portalID), friendlyName, description, type, @@ -3175,7 +3175,7 @@ public virtual void UpdatePackage(int packageID, int portalID, string friendlyNa public virtual void SetCorePackageVersions() { - ExecuteNonQuery("SetCorePackageVersions"); + this.ExecuteNonQuery("SetCorePackageVersions"); } #endregion @@ -3185,91 +3185,91 @@ public virtual void SetCorePackageVersions() public virtual int AddLanguage(string cultureCode, string cultureName, string fallbackCulture, int CreatedByUserID) { - return ExecuteScalar("AddLanguage", cultureCode, cultureName, fallbackCulture, CreatedByUserID); + return this.ExecuteScalar("AddLanguage", cultureCode, cultureName, fallbackCulture, CreatedByUserID); } public virtual int AddLanguagePack(int packageID, int languageID, int dependentPackageID, int CreatedByUserID) { - return ExecuteScalar("AddLanguagePack", packageID, languageID, dependentPackageID, CreatedByUserID); + return this.ExecuteScalar("AddLanguagePack", packageID, languageID, dependentPackageID, CreatedByUserID); } public virtual int AddPortalLanguage(int portalID, int languageID, bool IsPublished, int CreatedByUserID) { - return ExecuteScalar("AddPortalLanguage", portalID, languageID, IsPublished, CreatedByUserID); + return this.ExecuteScalar("AddPortalLanguage", portalID, languageID, IsPublished, CreatedByUserID); } public virtual void DeleteLanguage(int languageID) { - ExecuteNonQuery("DeleteLanguage", languageID); + this.ExecuteNonQuery("DeleteLanguage", languageID); } public virtual void DeleteLanguagePack(int languagePackID) { - ExecuteNonQuery("DeleteLanguagePack", languagePackID); + this.ExecuteNonQuery("DeleteLanguagePack", languagePackID); } public virtual void DeletePortalLanguages(int portalID, int languageID) { - ExecuteNonQuery("DeletePortalLanguages", GetNull(portalID), GetNull(languageID)); + this.ExecuteNonQuery("DeletePortalLanguages", this.GetNull(portalID), this.GetNull(languageID)); } public virtual void EnsureLocalizationExists(int portalID, string CultureCode) { - ExecuteNonQuery("EnsureLocalizationExists", portalID, CultureCode); + this.ExecuteNonQuery("EnsureLocalizationExists", portalID, CultureCode); } public virtual void RemovePortalLocalization(int portalID, string CultureCode) { - ExecuteNonQuery("RemovePortalLocalization", portalID, CultureCode); + this.ExecuteNonQuery("RemovePortalLocalization", portalID, CultureCode); } public virtual IDataReader GetPortalLocalizations(int portalID) { - return ExecuteReader("GetPortalLocalizations", portalID); + return this.ExecuteReader("GetPortalLocalizations", portalID); } public virtual IDataReader GetLanguages() { - return ExecuteReader("GetLanguages"); + return this.ExecuteReader("GetLanguages"); } public virtual IDataReader GetLanguagePackByPackage(int packageID) { - return ExecuteReader("GetLanguagePackByPackage", packageID); + return this.ExecuteReader("GetLanguagePackByPackage", packageID); } public virtual IDataReader GetLanguagesByPortal(int portalID) { - return ExecuteReader("GetLanguagesByPortal", portalID); + return this.ExecuteReader("GetLanguagesByPortal", portalID); } public virtual string GetPortalDefaultLanguage(int portalID) { - return ExecuteScalar("GetPortalDefaultLanguage", portalID); + return this.ExecuteScalar("GetPortalDefaultLanguage", portalID); } public virtual void UpdateLanguage(int languageID, string cultureCode, string cultureName, string fallbackCulture, int LastModifiedByUserID) { - ExecuteNonQuery("UpdateLanguage", languageID, cultureCode, cultureName, fallbackCulture, + this.ExecuteNonQuery("UpdateLanguage", languageID, cultureCode, cultureName, fallbackCulture, LastModifiedByUserID); } public virtual int UpdateLanguagePack(int languagePackID, int packageID, int languageID, int dependentPackageID, int LastModifiedByUserID) { - return ExecuteScalar("UpdateLanguagePack", languagePackID, packageID, languageID, dependentPackageID, + return this.ExecuteScalar("UpdateLanguagePack", languagePackID, packageID, languageID, dependentPackageID, LastModifiedByUserID); } public virtual void UpdatePortalDefaultLanguage(int portalID, string CultureCode) { - ExecuteNonQuery("UpdatePortalDefaultLanguage", portalID, CultureCode); + this.ExecuteNonQuery("UpdatePortalDefaultLanguage", portalID, CultureCode); } public virtual void UpdatePortalLanguage(int portalID, int languageID, bool IsPublished, int UpdatedByUserID) { - ExecuteNonQuery("UpdatePortalLanguage", portalID, languageID, IsPublished, UpdatedByUserID); + this.ExecuteNonQuery("UpdatePortalLanguage", portalID, languageID, IsPublished, UpdatedByUserID); } #endregion @@ -3278,62 +3278,62 @@ public virtual void UpdatePortalLanguage(int portalID, int languageID, bool IsPu public virtual void AddDefaultFolderTypes(int portalID) { - ExecuteNonQuery("AddDefaultFolderTypes", portalID); + this.ExecuteNonQuery("AddDefaultFolderTypes", portalID); } public virtual int AddFolderMapping(int portalID, string mappingName, string folderProviderType, int createdByUserID) { - return ExecuteScalar("AddFolderMapping", GetNull(portalID), mappingName, folderProviderType, + return this.ExecuteScalar("AddFolderMapping", this.GetNull(portalID), mappingName, folderProviderType, createdByUserID); } public virtual void AddFolderMappingSetting(int folderMappingID, string settingName, string settingValue, int createdByUserID) { - ExecuteNonQuery("AddFolderMappingsSetting", folderMappingID, settingName, settingValue, createdByUserID); + this.ExecuteNonQuery("AddFolderMappingsSetting", folderMappingID, settingName, settingValue, createdByUserID); } public virtual void DeleteFolderMapping(int folderMappingID) { - ExecuteNonQuery("DeleteFolderMapping", folderMappingID); + this.ExecuteNonQuery("DeleteFolderMapping", folderMappingID); } public virtual IDataReader GetFolderMapping(int folderMappingID) { - return ExecuteReader("GetFolderMapping", folderMappingID); + return this.ExecuteReader("GetFolderMapping", folderMappingID); } public virtual IDataReader GetFolderMappingByMappingName(int portalID, string mappingName) { - return ExecuteReader("GetFolderMappingByMappingName", portalID, mappingName); + return this.ExecuteReader("GetFolderMappingByMappingName", portalID, mappingName); } public virtual IDataReader GetFolderMappings(int portalID) { - return ExecuteReader("GetFolderMappings", GetNull(portalID)); + return this.ExecuteReader("GetFolderMappings", this.GetNull(portalID)); } public virtual IDataReader GetFolderMappingSetting(int folderMappingID, string settingName) { - return ExecuteReader("GetFolderMappingsSetting", folderMappingID, settingName); + return this.ExecuteReader("GetFolderMappingsSetting", folderMappingID, settingName); } public virtual IDataReader GetFolderMappingSettings(int folderMappingID) { - return ExecuteReader("GetFolderMappingsSettings", folderMappingID); + return this.ExecuteReader("GetFolderMappingsSettings", folderMappingID); } public virtual void UpdateFolderMapping(int folderMappingID, string mappingName, int priority, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateFolderMapping", folderMappingID, mappingName, priority, lastModifiedByUserID); + this.ExecuteNonQuery("UpdateFolderMapping", folderMappingID, mappingName, priority, lastModifiedByUserID); } public virtual void UpdateFolderMappingSetting(int folderMappingID, string settingName, string settingValue, int lastModifiedByUserID) { - ExecuteNonQuery("UpdateFolderMappingsSetting", folderMappingID, settingName, settingValue, + this.ExecuteNonQuery("UpdateFolderMappingsSetting", folderMappingID, settingName, settingValue, lastModifiedByUserID); } @@ -3349,7 +3349,7 @@ public virtual IDataReader GetPasswordHistory(int userId) public virtual IDataReader GetPasswordHistory(int userId, int passwordsRetained, int daysRetained) { - return ExecuteReader("GetPasswordHistory", GetNull(userId), passwordsRetained, daysRetained); + return this.ExecuteReader("GetPasswordHistory", this.GetNull(userId), passwordsRetained, daysRetained); } [Obsolete("Deprecated in Platform 9.2.0, please use the overload that takes daysRetained. Scheduled removal in v11.0.0.")] @@ -3360,7 +3360,7 @@ public virtual void AddPasswordHistory(int userId, string password, string passw public virtual void AddPasswordHistory(int userId, string password, string passwordHistory, int passwordsRetained, int daysRetained) { - ExecuteNonQuery("AddPasswordHistory", GetNull(userId), password, passwordHistory, passwordsRetained, daysRetained, GetNull(userId)); + this.ExecuteNonQuery("AddPasswordHistory", this.GetNull(userId), password, passwordHistory, passwordsRetained, daysRetained, this.GetNull(userId)); } #endregion @@ -3369,17 +3369,17 @@ public virtual void AddPasswordHistory(int userId, string password, string passw public virtual DateTime GetDatabaseTimeUtc() { - return ExecuteScalar("GetDatabaseTimeUtc"); + return this.ExecuteScalar("GetDatabaseTimeUtc"); } public virtual DateTime GetDatabaseTime() { - return ExecuteScalar("GetDatabaseTime"); + return this.ExecuteScalar("GetDatabaseTime"); } public virtual DateTimeOffset GetDatabaseTimeOffset() { - using (var reader = (SqlDataReader)ExecuteSQL("SELECT SYSDATETIMEOFFSET()")) + using (var reader = (SqlDataReader)this.ExecuteSQL("SELECT SYSDATETIMEOFFSET()")) { reader.Read(); return reader.GetDateTimeOffset(0); @@ -3392,43 +3392,43 @@ public virtual DateTimeOffset GetDatabaseTimeOffset() public virtual void DeletePreviewProfile(int id) { - ExecuteNonQuery("Mobile_DeletePreviewProfile", id); + this.ExecuteNonQuery("Mobile_DeletePreviewProfile", id); } public virtual void DeleteRedirection(int id) { - ExecuteNonQuery("Mobile_DeleteRedirection", id); + this.ExecuteNonQuery("Mobile_DeleteRedirection", id); } public virtual void DeleteRedirectionRule(int id) { - ExecuteNonQuery("Mobile_DeleteRedirectionRule", id); + this.ExecuteNonQuery("Mobile_DeleteRedirectionRule", id); } public virtual IDataReader GetAllRedirections() { - return ExecuteReader("Mobile_GetAllRedirections"); + return this.ExecuteReader("Mobile_GetAllRedirections"); } public virtual IDataReader GetPreviewProfiles(int portalId) { - return ExecuteReader("Mobile_GetPreviewProfiles", portalId); + return this.ExecuteReader("Mobile_GetPreviewProfiles", portalId); } public virtual IDataReader GetRedirectionRules(int redirectionId) { - return ExecuteReader("Mobile_GetRedirectionRules", redirectionId); + return this.ExecuteReader("Mobile_GetRedirectionRules", redirectionId); } public virtual IDataReader GetRedirections(int portalId) { - return ExecuteReader("Mobile_GetRedirections", portalId); + return this.ExecuteReader("Mobile_GetRedirections", portalId); } public virtual int SavePreviewProfile(int id, int portalId, string name, int width, int height, string userAgent, int sortOrder, int userId) { - return ExecuteScalar("Mobile_SavePreviewProfile", id, portalId, name, width, height, userAgent, + return this.ExecuteScalar("Mobile_SavePreviewProfile", id, portalId, name, width, height, userAgent, sortOrder, userId); } @@ -3436,13 +3436,13 @@ public virtual int SaveRedirection(int id, int portalId, string name, int type, bool includeChildTabs, int targetType, object targetValue, bool enabled, int userId) { - return ExecuteScalar("Mobile_SaveRedirection", id, portalId, name, type, sortOrder, sourceTabId, + return this.ExecuteScalar("Mobile_SaveRedirection", id, portalId, name, type, sortOrder, sourceTabId, includeChildTabs, targetType, targetValue, enabled, userId); } public virtual void SaveRedirectionRule(int id, int redirectionId, string capbility, string expression) { - ExecuteNonQuery("Mobile_SaveRedirectionRule", id, redirectionId, capbility, expression); + this.ExecuteNonQuery("Mobile_SaveRedirectionRule", id, redirectionId, capbility, expression); } #endregion @@ -3456,7 +3456,7 @@ public virtual void AddLog(string logGUID, string logTypeKey, int logUserID, str if (exception != null) { if (!string.IsNullOrEmpty(exception.ExceptionHash)) - ExecuteNonQuery("AddException", + this.ExecuteNonQuery("AddException", exception.ExceptionHash, exception.Message, exception.StackTrace, @@ -3470,29 +3470,29 @@ public virtual void AddLog(string logGUID, string logTypeKey, int logUserID, str int logEventID; try { - logEventID = ExecuteScalar("AddEventLog", + logEventID = this.ExecuteScalar("AddEventLog", logGUID, logTypeKey, - GetNull(logUserID), - GetNull(logUserName), - GetNull(logPortalID), - GetNull(logPortalName), + this.GetNull(logUserID), + this.GetNull(logUserName), + this.GetNull(logPortalID), + this.GetNull(logPortalName), logCreateDate, logServerName, logProperties, logConfigID, - GetNull(exception.ExceptionHash), + this.GetNull(exception.ExceptionHash), notificationActive); } catch (SqlException) { - var s = ExecuteScalar("AddEventLog", + var s = this.ExecuteScalar("AddEventLog", logGUID, logTypeKey, - GetNull(logUserID), - GetNull(logUserName), - GetNull(logPortalID), - GetNull(logPortalName), + this.GetNull(logUserID), + this.GetNull(logUserName), + this.GetNull(logPortalID), + this.GetNull(logPortalName), logCreateDate, logServerName, logProperties, @@ -3505,7 +3505,7 @@ public virtual void AddLog(string logGUID, string logTypeKey, int logUserID, str if (!string.IsNullOrEmpty(exception.AssemblyVersion) && exception.AssemblyVersion != "-1") { - ExecuteNonQuery("AddExceptionEvent", + this.ExecuteNonQuery("AddExceptionEvent", logEventID, exception.AssemblyVersion, exception.PortalId, @@ -3518,13 +3518,13 @@ public virtual void AddLog(string logGUID, string logTypeKey, int logUserID, str } else { - ExecuteScalar("AddEventLog", + this.ExecuteScalar("AddEventLog", logGUID, logTypeKey, - GetNull(logUserID), - GetNull(logUserName), - GetNull(logPortalID), - GetNull(logPortalName), + this.GetNull(logUserID), + this.GetNull(logUserName), + this.GetNull(logPortalID), + this.GetNull(logPortalName), logCreateDate, logServerName, logProperties, @@ -3537,7 +3537,7 @@ public virtual void AddLog(string logGUID, string logTypeKey, int logUserID, str public virtual void AddLogType(string logTypeKey, string logTypeFriendlyName, string logTypeDescription, string logTypeCSSClass, string logTypeOwner) { - ExecuteNonQuery("AddEventLogType", logTypeKey, logTypeFriendlyName, logTypeDescription, logTypeOwner, + this.ExecuteNonQuery("AddEventLogType", logTypeKey, logTypeFriendlyName, logTypeDescription, logTypeOwner, logTypeCSSClass); } @@ -3559,92 +3559,92 @@ public virtual void AddLogTypeConfigInfo(bool loggingIsActive, string logTypeKey { portalID = Convert.ToInt32(logTypePortalID); } - ExecuteNonQuery("AddEventLogConfig", - GetNull(logTypeKey), - GetNull(portalID), + this.ExecuteNonQuery("AddEventLogConfig", + this.GetNull(logTypeKey), + this.GetNull(portalID), loggingIsActive, keepMostRecent, emailNotificationIsActive, - GetNull(threshold), - GetNull(notificationThresholdTime), - GetNull(notificationThresholdTimeType), + this.GetNull(threshold), + this.GetNull(notificationThresholdTime), + this.GetNull(notificationThresholdTimeType), mailFromAddress, mailToAddress); } public virtual void ClearLog() { - ExecuteNonQuery("DeleteEventLog", DBNull.Value); + this.ExecuteNonQuery("DeleteEventLog", DBNull.Value); } public virtual void DeleteLog(string logGUID) { - ExecuteNonQuery("DeleteEventLog", logGUID); + this.ExecuteNonQuery("DeleteEventLog", logGUID); } public virtual void DeleteLogType(string logTypeKey) { - ExecuteNonQuery("DeleteEventLogType", logTypeKey); + this.ExecuteNonQuery("DeleteEventLogType", logTypeKey); } public virtual void DeleteLogTypeConfigInfo(string id) { - ExecuteNonQuery("DeleteEventLogConfig", id); + this.ExecuteNonQuery("DeleteEventLogConfig", id); } public virtual IDataReader GetEventLogPendingNotif(int logConfigID) { - return ExecuteReader("GetEventLogPendingNotif", logConfigID); + return this.ExecuteReader("GetEventLogPendingNotif", logConfigID); } public virtual IDataReader GetEventLogPendingNotifConfig() { - return ExecuteReader("GetEventLogPendingNotifConfig"); + return this.ExecuteReader("GetEventLogPendingNotifConfig"); } public virtual IDataReader GetLogs(int portalID, string logType, int pageSize, int pageIndex) { - return ExecuteReader("GetEventLog", GetNull(portalID), GetNull(logType), pageSize, pageIndex); + return this.ExecuteReader("GetEventLog", this.GetNull(portalID), this.GetNull(logType), pageSize, pageIndex); } public virtual IDataReader GetLogTypeConfigInfo() { - return ExecuteReader("GetEventLogConfig", DBNull.Value); + return this.ExecuteReader("GetEventLogConfig", DBNull.Value); } public virtual IDataReader GetLogTypeConfigInfoByID(int id) { - return ExecuteReader("GetEventLogConfig", id); + return this.ExecuteReader("GetEventLogConfig", id); } public virtual IDataReader GetLogTypeInfo() { - return ExecuteReader("GetEventLogType"); + return this.ExecuteReader("GetEventLogType"); } public virtual IDataReader GetSingleLog(string logGUID) { - return ExecuteReader("GetEventLogByLogGUID", logGUID); + return this.ExecuteReader("GetEventLogByLogGUID", logGUID); } public virtual void PurgeLog() { //Because event log is run on application end, app may not be fully installed, so check for the sproc first - string sql = "IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'" + DatabaseOwner + ObjectQualifier + + string sql = "IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'" + this.DatabaseOwner + this.ObjectQualifier + "PurgeEventLog') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) " + " BEGIN " + - " EXEC " + DatabaseOwner + ObjectQualifier + "PurgeEventLog" + " END "; - PetaPocoHelper.ExecuteNonQuery(ConnectionString, CommandType.Text, sql); + " EXEC " + this.DatabaseOwner + this.ObjectQualifier + "PurgeEventLog" + " END "; + PetaPocoHelper.ExecuteNonQuery(this.ConnectionString, CommandType.Text, sql); } public virtual void UpdateEventLogPendingNotif(int logConfigID) { - ExecuteNonQuery("UpdateEventLogPendingNotif", logConfigID); + this.ExecuteNonQuery("UpdateEventLogPendingNotif", logConfigID); } public virtual void UpdateLogType(string logTypeKey, string logTypeFriendlyName, string logTypeDescription, string logTypeCSSClass, string logTypeOwner) { - ExecuteNonQuery("UpdateEventLogType", logTypeKey, logTypeFriendlyName, logTypeDescription, logTypeOwner, + this.ExecuteNonQuery("UpdateEventLogType", logTypeKey, logTypeFriendlyName, logTypeDescription, logTypeOwner, logTypeCSSClass); } @@ -3668,16 +3668,16 @@ public virtual void UpdateLogTypeConfigInfo(string id, bool loggingIsActive, str { portalID = Convert.ToInt32(logTypePortalID); } - ExecuteNonQuery("UpdateEventLogConfig", + this.ExecuteNonQuery("UpdateEventLogConfig", id, - GetNull(logTypeKey), - GetNull(portalID), + this.GetNull(logTypeKey), + this.GetNull(portalID), loggingIsActive, keepMostRecent, emailNotificationIsActive, - GetNull(threshold), - GetNull(notificationThresholdTime), - GetNull(notificationThresholdTimeType), + this.GetNull(threshold), + this.GetNull(notificationThresholdTime), + this.GetNull(notificationThresholdTimeType), mailFromAddress, mailToAddress); } @@ -3692,7 +3692,7 @@ public virtual int AddSchedule(string TypeFullName, int TimeLapse, string TimeLa string ObjectDependencies, string Servers, int CreatedByUserID, string FriendlyName, DateTime ScheduleStartDate) { - return ExecuteScalar("AddSchedule", + return this.ExecuteScalar("AddSchedule", TypeFullName, TimeLapse, TimeLapseMeasurement, @@ -3703,70 +3703,70 @@ public virtual int AddSchedule(string TypeFullName, int TimeLapse, string TimeLa CatchUpEnabled, Enabled, ObjectDependencies, - GetNull(Servers), + this.GetNull(Servers), CreatedByUserID, FriendlyName, - GetNull(ScheduleStartDate)); + this.GetNull(ScheduleStartDate)); } public virtual int AddScheduleHistory(int ScheduleID, DateTime StartDate, string Server) { - return ExecuteScalar("AddScheduleHistory", ScheduleID, FixDate(StartDate), Server); + return this.ExecuteScalar("AddScheduleHistory", ScheduleID, FixDate(StartDate), Server); } public virtual void AddScheduleItemSetting(int ScheduleID, string Name, string Value) { - ExecuteNonQuery("AddScheduleItemSetting", ScheduleID, Name, Value); + this.ExecuteNonQuery("AddScheduleItemSetting", ScheduleID, Name, Value); } public virtual void DeleteSchedule(int ScheduleID) { - ExecuteNonQuery("DeleteSchedule", ScheduleID); + this.ExecuteNonQuery("DeleteSchedule", ScheduleID); } public virtual IDataReader GetNextScheduledTask(string Server) { - return ExecuteReader("GetScheduleNextTask", GetNull(Server)); + return this.ExecuteReader("GetScheduleNextTask", this.GetNull(Server)); } public virtual IDataReader GetSchedule() { - return ExecuteReader("GetSchedule", DBNull.Value); + return this.ExecuteReader("GetSchedule", DBNull.Value); } public virtual IDataReader GetSchedule(string Server) { - return ExecuteReader("GetSchedule", GetNull(Server)); + return this.ExecuteReader("GetSchedule", this.GetNull(Server)); } public virtual IDataReader GetSchedule(int ScheduleID) { - return ExecuteReader("GetScheduleByScheduleID", ScheduleID); + return this.ExecuteReader("GetScheduleByScheduleID", ScheduleID); } public virtual IDataReader GetSchedule(string TypeFullName, string Server) { - return ExecuteReader("GetScheduleByTypeFullName", TypeFullName, GetNull(Server)); + return this.ExecuteReader("GetScheduleByTypeFullName", TypeFullName, this.GetNull(Server)); } public virtual IDataReader GetScheduleByEvent(string EventName, string Server) { - return ExecuteReader("GetScheduleByEvent", EventName, GetNull(Server)); + return this.ExecuteReader("GetScheduleByEvent", EventName, this.GetNull(Server)); } public virtual IDataReader GetScheduleHistory(int ScheduleID) { - return ExecuteReader("GetScheduleHistory", ScheduleID); + return this.ExecuteReader("GetScheduleHistory", ScheduleID); } public virtual IDataReader GetScheduleItemSettings(int ScheduleID) { - return ExecuteReader("GetScheduleItemSettings", ScheduleID); + return this.ExecuteReader("GetScheduleItemSettings", ScheduleID); } public virtual void PurgeScheduleHistory() { - ExecuteNonQuery(90, "PurgeScheduleHistory"); + this.ExecuteNonQuery(90, "PurgeScheduleHistory"); } public virtual void UpdateSchedule(int ScheduleID, string TypeFullName, int TimeLapse, @@ -3776,7 +3776,7 @@ public virtual void UpdateSchedule(int ScheduleID, string TypeFullName, int Time string ObjectDependencies, string Servers, int LastModifiedByUserID, string FriendlyName, DateTime ScheduleStartDate) { - ExecuteNonQuery("UpdateSchedule", + this.ExecuteNonQuery("UpdateSchedule", ScheduleID, TypeFullName, TimeLapse, @@ -3788,15 +3788,15 @@ public virtual void UpdateSchedule(int ScheduleID, string TypeFullName, int Time CatchUpEnabled, Enabled, ObjectDependencies, - GetNull(Servers), + this.GetNull(Servers), LastModifiedByUserID, FriendlyName, - GetNull(ScheduleStartDate)); + this.GetNull(ScheduleStartDate)); } public virtual void UpdateScheduleHistory(int ScheduleHistoryID, DateTime EndDate, bool Succeeded, string LogNotes, DateTime NextStart) { - ExecuteNonQuery("UpdateScheduleHistory", ScheduleHistoryID, FixDate(EndDate), GetNull(Succeeded), LogNotes, FixDate(NextStart)); + this.ExecuteNonQuery("UpdateScheduleHistory", ScheduleHistoryID, FixDate(EndDate), this.GetNull(Succeeded), LogNotes, FixDate(NextStart)); } #endregion @@ -3813,7 +3813,7 @@ public virtual int AddExtensionUrlProvider(int providerId, bool redirectAllUrls, bool replaceAllUrls) { - return ExecuteScalar("AddExtensionUrlProvider", + return this.ExecuteScalar("AddExtensionUrlProvider", providerId, desktopModuleId, providerName, @@ -3827,22 +3827,22 @@ public virtual int AddExtensionUrlProvider(int providerId, public virtual void DeleteExtensionUrlProvider(int providerId) { - ExecuteNonQuery("DeleteExtensionUrlProvider", providerId); + this.ExecuteNonQuery("DeleteExtensionUrlProvider", providerId); } public virtual IDataReader GetExtensionUrlProviders(int portalId) { - return ExecuteReader("GetExtensionUrlProviders", GetNull(portalId)); + return this.ExecuteReader("GetExtensionUrlProviders", this.GetNull(portalId)); } public virtual void SaveExtensionUrlProviderSetting(int providerId, int portalId, string settingName, string settingValue) { - ExecuteNonQuery("SaveExtensionUrlProviderSetting", providerId, portalId, settingName, settingValue); + this.ExecuteNonQuery("SaveExtensionUrlProviderSetting", providerId, portalId, settingName, settingValue); } public virtual void UpdateExtensionUrlProvider(int providerId, bool isActive) { - ExecuteNonQuery("UpdateExtensionUrlProvider", providerId, isActive); + this.ExecuteNonQuery("UpdateExtensionUrlProvider", providerId, isActive); } #endregion @@ -3852,27 +3852,27 @@ public virtual void UpdateExtensionUrlProvider(int providerId, bool isActive) public virtual IDataReader GetIPFilters() { - return ExecuteReader("GetIPFilters"); + return this.ExecuteReader("GetIPFilters"); } public virtual int AddIPFilter(string ipAddress, string subnetMask, int ruleType, int createdByUserId) { - return ExecuteScalar("AddIPFilter", ipAddress, subnetMask, ruleType, createdByUserId); + return this.ExecuteScalar("AddIPFilter", ipAddress, subnetMask, ruleType, createdByUserId); } public virtual void DeleteIPFilter(int ipFilterid) { - ExecuteNonQuery("DeleteIPFilter", ipFilterid); + this.ExecuteNonQuery("DeleteIPFilter", ipFilterid); } public virtual void UpdateIPFilter(int ipFilterid, string ipAddress, string subnetMask, int ruleType, int lastModifiedByUserId) { - ExecuteNonQuery("UpdateIPFilter", ipFilterid, ipAddress, subnetMask, ruleType, lastModifiedByUserId); + this.ExecuteNonQuery("UpdateIPFilter", ipFilterid, ipAddress, subnetMask, ruleType, lastModifiedByUserId); } public virtual IDataReader GetIPFilter(int ipf) { - return ExecuteReader("GetIPFilter", ipf); + return this.ExecuteReader("GetIPFilter", ipf); } #endregion @@ -3881,12 +3881,12 @@ public virtual IDataReader GetIPFilter(int ipf) public virtual IDataReader GetFileVersions(int fileId) { - return ExecuteReader("GetFileVersions", fileId); + return this.ExecuteReader("GetFileVersions", fileId); } public virtual IDataReader GetFileVersionsInFolder(int folderId) { - return ExecuteReader("GetFileVersionsInFolder", folderId); + return this.ExecuteReader("GetFileVersionsInFolder", folderId); } public virtual int AddFileVersion(int fileId, Guid uniqueId, Guid versionGuid, string fileName, string extension, @@ -3896,15 +3896,15 @@ public virtual int AddFileVersion(int fileId, Guid uniqueId, Guid versionGuid, s { if (content == null) { - return ExecuteScalar("AddFileVersion", + return this.ExecuteScalar("AddFileVersion", fileId, uniqueId, versionGuid, fileName, extension, size, - GetNull(width), - GetNull(height), + this.GetNull(width), + this.GetNull(height), contentType, folder, folderId, @@ -3914,19 +3914,19 @@ public virtual int AddFileVersion(int fileId, Guid uniqueId, Guid versionGuid, s title, enablePublishPeriod, startDate, - GetNull(endDate), - GetNull(contentItemID), + this.GetNull(endDate), + this.GetNull(contentItemID), published); } - return ExecuteScalar("AddFileVersion", + return this.ExecuteScalar("AddFileVersion", fileId, uniqueId, versionGuid, fileName, extension, size, - GetNull(width), - GetNull(height), + this.GetNull(width), + this.GetNull(height), contentType, folder, folderId, @@ -3936,30 +3936,30 @@ public virtual int AddFileVersion(int fileId, Guid uniqueId, Guid versionGuid, s title, enablePublishPeriod, startDate, - GetNull(endDate), - GetNull(contentItemID), + this.GetNull(endDate), + this.GetNull(contentItemID), published, - GetNull(content)); + this.GetNull(content)); } public virtual int DeleteFileVersion(int fileId, int version) { - return ExecuteScalar("DeleteFileVersion", fileId, version); + return this.ExecuteScalar("DeleteFileVersion", fileId, version); } public virtual void ResetFilePublishedVersion(int fileId) { - ExecuteNonQuery("ResetFilePublishedVersion", fileId); + this.ExecuteNonQuery("ResetFilePublishedVersion", fileId); } public virtual IDataReader GetFileVersion(int fileId, int version) { - return ExecuteReader("GetFileVersion", fileId, version); + return this.ExecuteReader("GetFileVersion", fileId, version); } public void SetPublishedVersion(int fileId, int newPublishedVersion) { - ExecuteNonQuery("SetPublishedVersion", fileId, newPublishedVersion); + this.ExecuteNonQuery("SetPublishedVersion", fileId, newPublishedVersion); } #endregion @@ -3968,24 +3968,24 @@ public void SetPublishedVersion(int fileId, int newPublishedVersion) public virtual int GetContentWorkflowUsageCount(int workflowId) { - return ExecuteScalar("GetContentWorkflowUsageCount", workflowId); + return this.ExecuteScalar("GetContentWorkflowUsageCount", workflowId); } public virtual IDataReader GetContentWorkflowUsage(int workflowId, int pageIndex, int pageSize) { - return ExecuteReader("GetContentWorkflowUsage", workflowId, pageIndex, pageSize); + return this.ExecuteReader("GetContentWorkflowUsage", workflowId, pageIndex, pageSize); } public virtual int GetContentWorkflowStateUsageCount(int stateId) { - return ExecuteScalar("GetContentWorkflowStateUsageCount", stateId); + return this.ExecuteScalar("GetContentWorkflowStateUsageCount", stateId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual int AddContentWorkflow(int portalId, string workflowName, string description, bool isDeleted, bool startAfterCreating, bool startAfterEditing, bool dispositionEnabled) { - return ExecuteScalar("AddContentWorkflow", - GetNull(portalId), + return this.ExecuteScalar("AddContentWorkflow", + this.GetNull(portalId), workflowName, description, isDeleted, @@ -3997,19 +3997,19 @@ public virtual int AddContentWorkflow(int portalId, string workflowName, string [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual IDataReader GetContentWorkflow(int workflowId) { - return ExecuteReader("GetContentWorkflow", workflowId); + return this.ExecuteReader("GetContentWorkflow", workflowId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual IDataReader GetContentWorkflows(int portalId) { - return ExecuteReader("GetContentWorkflows", portalId); + return this.ExecuteReader("GetContentWorkflows", portalId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual void UpdateContentWorkflow(int workflowId, string workflowName, string description, bool isDeleted, bool startAfterCreating, bool startAfterEditing, bool dispositionEnabled) { - ExecuteNonQuery("UpdateContentWorkflow", + this.ExecuteNonQuery("UpdateContentWorkflow", workflowId, workflowName, description, @@ -4025,7 +4025,7 @@ public virtual int AddContentWorkflowState(int workflowId, string stateName, int string onCompleteMessageSubject, string onCompleteMessageBody, string onDiscardMessageSubject, string onDiscardMessageBody) { - return ExecuteScalar("AddContentWorkflowState", + return this.ExecuteScalar("AddContentWorkflowState", workflowId, stateName, order, @@ -4042,7 +4042,7 @@ public virtual int AddContentWorkflowState(int workflowId, string stateName, int [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual void DeleteContentWorkflowState(int stateId) { - ExecuteNonQuery("DeleteContentWorkflowState", stateId); + this.ExecuteNonQuery("DeleteContentWorkflowState", stateId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] @@ -4051,7 +4051,7 @@ public virtual void UpdateContentWorkflowState(int stateId, string stateName, in string onCompleteMessageSubject, string onCompleteMessageBody, string onDiscardMessageSubject, string onDiscardMessageBody) { - ExecuteNonQuery("UpdateContentWorkflowState", + this.ExecuteNonQuery("UpdateContentWorkflowState", stateId, stateName, order, @@ -4068,19 +4068,19 @@ public virtual void UpdateContentWorkflowState(int stateId, string stateName, in [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual IDataReader GetContentWorkflowState(int stateId) { - return ExecuteReader("GetContentWorkflowState", stateId); + return this.ExecuteReader("GetContentWorkflowState", stateId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual IDataReader GetContentWorkflowStates(int workflowId) { - return ExecuteReader("GetContentWorkflowStates", workflowId); + return this.ExecuteReader("GetContentWorkflowStates", workflowId); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowLogger.AddWorkflowLog. Scheduled removal in v10.0.0.")] public virtual int AddContentWorkflowLog(string action, string comment, int user, int workflowId, int contentItemId) { - return ExecuteScalar("AddContentWorkflowLog", + return this.ExecuteScalar("AddContentWorkflowLog", action, comment, user, @@ -4091,68 +4091,68 @@ public virtual int AddContentWorkflowLog(string action, string comment, int user [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowLogger.GetWorkflowLogs. Scheduled removal in v10.0.0.")] public virtual IDataReader GetContentWorkflowLogs(int contentItemId, int workflowId) { - return ExecuteReader("GetContentWorkflowLogs", contentItemId, workflowId); + return this.ExecuteReader("GetContentWorkflowLogs", contentItemId, workflowId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual int DeleteContentWorkflowLogs(int contentItemId, int workflowId) { - return ExecuteScalar("DeleteContentWorkflowLogs", contentItemId, workflowId); + return this.ExecuteScalar("DeleteContentWorkflowLogs", contentItemId, workflowId); } public virtual int AddContentWorkflowStatePermission(int stateId, int permissionId, int roleId, bool allowAccess, int userId, int createdByUserId) { - return ExecuteScalar("AddContentWorkflowStatePermission", + return this.ExecuteScalar("AddContentWorkflowStatePermission", stateId, permissionId, - GetNull(roleId), + this.GetNull(roleId), allowAccess, - GetNull(userId), - GetNull(createdByUserId)); + this.GetNull(userId), + this.GetNull(createdByUserId)); } public virtual void UpdateContentWorkflowStatePermission(int workflowStatePermissionId, int stateId, int permissionId, int roleId, bool allowAccess, int userId, int lastModifiedByUserId) { - ExecuteNonQuery("UpdateContentWorkflowStatePermission", + this.ExecuteNonQuery("UpdateContentWorkflowStatePermission", workflowStatePermissionId, stateId, permissionId, - GetNull(roleId), + this.GetNull(roleId), allowAccess, - GetNull(userId), - GetNull(lastModifiedByUserId)); + this.GetNull(userId), + this.GetNull(lastModifiedByUserId)); } public virtual void DeleteContentWorkflowStatePermission(int workflowStatePermissionId) { - ExecuteNonQuery("DeleteContentWorkflowStatePermission", workflowStatePermissionId); + this.ExecuteNonQuery("DeleteContentWorkflowStatePermission", workflowStatePermissionId); } public virtual IDataReader GetContentWorkflowStatePermission(int workflowStatePermissionId) { - return ExecuteReader("GetContentWorkflowStatePermission", workflowStatePermissionId); + return this.ExecuteReader("GetContentWorkflowStatePermission", workflowStatePermissionId); } public virtual IDataReader GetContentWorkflowStatePermissions() { - return ExecuteReader("GetContentWorkflowStatePermissions"); + return this.ExecuteReader("GetContentWorkflowStatePermissions"); } public virtual IDataReader GetContentWorkflowStatePermissionsByStateID(int stateId) { - return ExecuteReader("GetContentWorkflowStatePermissionsByStateID", stateId); + return this.ExecuteReader("GetContentWorkflowStatePermissionsByStateID", stateId); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual IDataReader GetContentWorkflowSource(int workflowId, string sourceName) { - return ExecuteReader("GetContentWorkflowSource", workflowId, sourceName); + return this.ExecuteReader("GetContentWorkflowSource", workflowId, sourceName); } [Obsolete("Deprecated in Platform 7.4.0. Scheduled removal in v10.0.0.")] public virtual int AddContentWorkflowSource(int workflowId, string sourceName, string sourceType) { - return ExecuteScalar("AddContentWorkflowSource", workflowId, sourceName, sourceType); + return this.ExecuteScalar("AddContentWorkflowSource", workflowId, sourceName, sourceType); } #endregion @@ -4161,7 +4161,7 @@ public virtual int AddContentWorkflowSource(int workflowId, string sourceName, s public virtual IDataReader GetAllSearchTypes() { - return ExecuteReader("SearchTypes_GetAll"); + return this.ExecuteReader("SearchTypes_GetAll"); } #endregion @@ -4170,12 +4170,12 @@ public virtual IDataReader GetAllSearchTypes() public virtual IDataReader GetAllSynonymsGroups(int portalId, string cultureCode) { - return ExecuteReader("GetAllSynonymsGroups", portalId, cultureCode); + return this.ExecuteReader("GetAllSynonymsGroups", portalId, cultureCode); } public virtual int AddSynonymsGroup(string synonymsTags, int createdByUserId, int portalId, string cultureCode) { - return ExecuteScalar("AddSynonymsGroup", + return this.ExecuteScalar("AddSynonymsGroup", synonymsTags, createdByUserId, portalId, @@ -4184,12 +4184,12 @@ public virtual int AddSynonymsGroup(string synonymsTags, int createdByUserId, in public virtual void UpdateSynonymsGroup(int synonymsGroupId, string synonymsTags, int lastModifiedUserId) { - ExecuteNonQuery("UpdateSynonymsGroup", synonymsGroupId, synonymsTags, lastModifiedUserId); + this.ExecuteNonQuery("UpdateSynonymsGroup", synonymsGroupId, synonymsTags, lastModifiedUserId); } public virtual void DeleteSynonymsGroup(int synonymsGroupId) { - ExecuteNonQuery("DeleteSynonymsGroup", synonymsGroupId); + this.ExecuteNonQuery("DeleteSynonymsGroup", synonymsGroupId); } #endregion @@ -4198,22 +4198,22 @@ public virtual void DeleteSynonymsGroup(int synonymsGroupId) public virtual IDataReader GetSearchStopWords(int portalId, string cultureCode) { - return ExecuteReader("GetSearchStopWords", portalId, cultureCode); + return this.ExecuteReader("GetSearchStopWords", portalId, cultureCode); } public virtual int AddSearchStopWords(string stopWords, int createdByUserId, int portalId, string cultureCode) { - return ExecuteScalar("InsertSearchStopWords", stopWords, createdByUserId, portalId, cultureCode); + return this.ExecuteScalar("InsertSearchStopWords", stopWords, createdByUserId, portalId, cultureCode); } public virtual void UpdateSearchStopWords(int stopWordsId, string stopWords, int lastModifiedUserId) { - ExecuteNonQuery("UpdateSearchStopWords", stopWordsId, stopWords, lastModifiedUserId); + this.ExecuteNonQuery("UpdateSearchStopWords", stopWordsId, stopWords, lastModifiedUserId); } public virtual void DeleteSearchStopWords(int stopWordsId) { - ExecuteNonQuery("DeleteSearchStopWords", stopWordsId); + this.ExecuteNonQuery("DeleteSearchStopWords", stopWordsId); } #endregion @@ -4224,7 +4224,7 @@ public void AddSearchDeletedItems(SearchDocumentToDelete deletedIDocument) { try { - ExecuteNonQuery("SearchDeletedItems_Add", deletedIDocument.ToJsonString()); + this.ExecuteNonQuery("SearchDeletedItems_Add", deletedIDocument.ToJsonString()); } catch (SqlException ex) { @@ -4236,7 +4236,7 @@ public void DeleteProcessedSearchDeletedItems(DateTime cutoffTime) { try { - ExecuteNonQuery("SearchDeletedItems_DeleteProcessed", cutoffTime); + this.ExecuteNonQuery("SearchDeletedItems_DeleteProcessed", cutoffTime); } catch (SqlException ex) { @@ -4246,7 +4246,7 @@ public void DeleteProcessedSearchDeletedItems(DateTime cutoffTime) public IDataReader GetSearchDeletedItems(DateTime cutoffTime) { - return ExecuteReader("SearchDeletedItems_Select", cutoffTime); + return this.ExecuteReader("SearchDeletedItems_Select", cutoffTime); } #endregion @@ -4255,7 +4255,7 @@ public IDataReader GetSearchDeletedItems(DateTime cutoffTime) public virtual IDataReader GetAvailableUsersForIndex(int portalId, DateTime startDate, int startUserId, int numberOfUsers) { - return ExecuteReader(90, "GetAvailableUsersForIndex", portalId, startDate, startUserId, numberOfUsers); + return this.ExecuteReader(90, "GetAvailableUsersForIndex", portalId, startDate, startUserId, numberOfUsers); } #endregion @@ -4308,17 +4308,17 @@ public virtual void RemoveOutputCacheItem(int itemId) public virtual Guid AddRedirectMessage(int userId, int tabId, string text) { - return ExecuteScalar("AddRedirectMessage", userId, tabId, text); + return this.ExecuteScalar("AddRedirectMessage", userId, tabId, text); } public virtual string GetRedirectMessage(Guid id) { - return ExecuteScalar("GetRedirectMessage", id); + return this.ExecuteScalar("GetRedirectMessage", id); } public virtual void DeleteOldRedirectMessage(DateTime cutofDateTime) { - ExecuteNonQuery("DeleteOldRedirectMessage", FixDate(cutofDateTime)); + this.ExecuteNonQuery("DeleteOldRedirectMessage", FixDate(cutofDateTime)); } #endregion @@ -4327,22 +4327,22 @@ public virtual void DeleteOldRedirectMessage(DateTime cutofDateTime) public virtual void UpdateAuthCookie(string cookieValue, DateTime utcExpiry, int userId) { - ExecuteNonQuery("AuthCookies_Update", cookieValue, FixDate(utcExpiry), userId); + this.ExecuteNonQuery("AuthCookies_Update", cookieValue, FixDate(utcExpiry), userId); } public virtual IDataReader FindAuthCookie(string cookieValue) { - return ExecuteReader("AuthCookies_Find", cookieValue); + return this.ExecuteReader("AuthCookies_Find", cookieValue); } public virtual void DeleteAuthCookie(string cookieValue) { - ExecuteNonQuery("AuthCookies_DeleteByValue", cookieValue); + this.ExecuteNonQuery("AuthCookies_DeleteByValue", cookieValue); } public virtual void DeleteExpiredAuthCookies(DateTime utcExpiredBefore) { - ExecuteNonQuery("AuthCookies_DeleteOld", FixDate(utcExpiredBefore)); + this.ExecuteNonQuery("AuthCookies_DeleteOld", FixDate(utcExpiredBefore)); } #endregion @@ -4354,13 +4354,13 @@ public virtual void DeleteExpiredAuthCookies(DateTime utcExpiredBefore) [Obsolete("Deprecated in 7.0.0. This method is unneccessary. You can get a reader and convert it to a DataSet. Scheduled removal in v10.0.0.")] public virtual DataSet ExecuteDataSet(string procedureName, params object[] commandParameters) { - return Globals.ConvertDataReaderToDataSet(ExecuteReader(procedureName, commandParameters)); + return Globals.ConvertDataReaderToDataSet(this.ExecuteReader(procedureName, commandParameters)); } [Obsolete("Deprecated in 7.0.0. This method is unneccessary. Use the generic version ExecuteScalar.. Scheduled removal in v10.0.0.")] public virtual object ExecuteScalar(string procedureName, params object[] commandParameters) { - return ExecuteScalar(procedureName, commandParameters); + return this.ExecuteScalar(procedureName, commandParameters); } [Obsolete("Temporarily Added in DNN 5.4.2. This will be removed and replaced with named instance support.. Scheduled removal in v10.0.0.")] @@ -4378,7 +4378,7 @@ public virtual IDataReader ExecuteSQL(string sql, params IDataParameter[] comman sql = DataUtil.ReplaceTokens(sql); try { - return SqlHelper.ExecuteReader(ConnectionString, CommandType.Text, sql, sqlCommandParameters); + return SqlHelper.ExecuteReader(this.ConnectionString, CommandType.Text, sql, sqlCommandParameters); } catch { @@ -4390,7 +4390,7 @@ public virtual IDataReader ExecuteSQL(string sql, params IDataParameter[] comman [Obsolete("Obsoleted in 9.3.0, please use GetFiles(int, bool, boo) instead. schedule to remove in 11.0.0.")] public virtual IDataReader GetFiles(int folderId, bool retrieveUnpublishedFiles = false) { - return GetFiles(folderId, retrieveUnpublishedFiles, false); + return this.GetFiles(folderId, retrieveUnpublishedFiles, false); } #endregion diff --git a/DNN Platform/Library/Data/PetaPoco/FluentColumnMap.cs b/DNN Platform/Library/Data/PetaPoco/FluentColumnMap.cs index 89bb0d6aac2..edfdd3a2fee 100644 --- a/DNN Platform/Library/Data/PetaPoco/FluentColumnMap.cs +++ b/DNN Platform/Library/Data/PetaPoco/FluentColumnMap.cs @@ -19,9 +19,9 @@ public FluentColumnMap(ColumnInfo columnInfo) : this(columnInfo, null) { } public FluentColumnMap(ColumnInfo columnInfo, Func fromDbConverter) : this(columnInfo, fromDbConverter, null) { } public FluentColumnMap(ColumnInfo columnInfo, Func fromDbConverter, Func toDbConverter) { - ColumnInfo = columnInfo; - FromDbConverter = fromDbConverter; - ToDbConverter = toDbConverter; + this.ColumnInfo = columnInfo; + this.FromDbConverter = fromDbConverter; + this.ToDbConverter = toDbConverter; } } } diff --git a/DNN Platform/Library/Data/PetaPoco/FluentMapper.cs b/DNN Platform/Library/Data/PetaPoco/FluentMapper.cs index 1075f4bfdbc..813d16d1182 100644 --- a/DNN Platform/Library/Data/PetaPoco/FluentMapper.cs +++ b/DNN Platform/Library/Data/PetaPoco/FluentMapper.cs @@ -17,13 +17,13 @@ public class FluentMapper : IMapper public FluentMapper(string tablePrefix) { - CacheKey = String.Empty; - CachePriority = CacheItemPriority.Default; - CacheTimeOut = 0; - Mappings = new Dictionary(); - Scope = String.Empty; - TableInfo = new TableInfo(); - _tablePrefix = tablePrefix; + this.CacheKey = String.Empty; + this.CachePriority = CacheItemPriority.Default; + this.CacheTimeOut = 0; + this.Mappings = new Dictionary(); + this.Scope = String.Empty; + this.TableInfo = new TableInfo(); + this._tablePrefix = tablePrefix; } public string CacheKey { get; set; } @@ -40,13 +40,13 @@ public FluentMapper(string tablePrefix) public TableInfo GetTableInfo(Type pocoType) { - return TableInfo; + return this.TableInfo; } public ColumnInfo GetColumnInfo(PropertyInfo pocoProperty) { var fluentMap = default(FluentColumnMap); - if (Mappings.TryGetValue(pocoProperty.Name, out fluentMap)) + if (this.Mappings.TryGetValue(pocoProperty.Name, out fluentMap)) return fluentMap.ColumnInfo; return null; } @@ -55,7 +55,7 @@ public Func GetFromDbConverter(PropertyInfo targetProperty, Type { // ReSharper disable once RedundantAssignment var fluentMap = default(FluentColumnMap); - if (Mappings.TryGetValue(targetProperty.Name, out fluentMap)) + if (this.Mappings.TryGetValue(targetProperty.Name, out fluentMap)) return fluentMap.FromDbConverter; return null; } @@ -64,14 +64,14 @@ public Func GetToDbConverter(PropertyInfo sourceProperty) { // ReSharper disable once RedundantAssignment var fluentMap = default(FluentColumnMap); - if (Mappings.TryGetValue(sourceProperty.Name, out fluentMap)) + if (this.Mappings.TryGetValue(sourceProperty.Name, out fluentMap)) return fluentMap.ToDbConverter; return null; } public string GetTablePrefix() { - return _tablePrefix; + return this._tablePrefix; } } } diff --git a/DNN Platform/Library/Data/PetaPoco/PetaPocoDataContext.cs b/DNN Platform/Library/Data/PetaPoco/PetaPocoDataContext.cs index 1277a0c68b0..82557c44c8d 100644 --- a/DNN Platform/Library/Data/PetaPoco/PetaPocoDataContext.cs +++ b/DNN Platform/Library/Data/PetaPoco/PetaPocoDataContext.cs @@ -42,10 +42,10 @@ public PetaPocoDataContext(string connectionStringName, string tablePrefix, Dict { Requires.NotNullOrEmpty("connectionStringName", connectionStringName); - _database = new Database(connectionStringName); - _mapper = new PetaPocoMapper(tablePrefix); - TablePrefix = tablePrefix; - FluentMappers = mappers; + this._database = new Database(connectionStringName); + this._mapper = new PetaPocoMapper(tablePrefix); + this.TablePrefix = tablePrefix; + this.FluentMappers = mappers; } #endregion @@ -58,18 +58,18 @@ public PetaPocoDataContext(string connectionStringName, string tablePrefix, Dict public void BeginTransaction() { - _database.BeginTransaction(); + this._database.BeginTransaction(); } public void Commit() { - _database.CompleteTransaction(); + this._database.CompleteTransaction(); } public bool EnableAutoSelect { - get { return _database.EnableAutoSelect; } - set { _database.EnableAutoSelect = value; } + get { return this._database.EnableAutoSelect; } + set { this._database.EnableAutoSelect = value; } } public void Execute(CommandType type, string sql, params object[] args) @@ -79,18 +79,18 @@ public void Execute(CommandType type, string sql, params object[] args) sql = DataUtil.GenerateExecuteStoredProcedureSql(sql, args); } - _database.Execute(DataUtil.ReplaceTokens(sql), args); + this._database.Execute(DataUtil.ReplaceTokens(sql), args); } public IEnumerable ExecuteQuery(CommandType type, string sql, params object[] args) { - PetaPocoMapper.SetMapper(_mapper); + PetaPocoMapper.SetMapper(this._mapper); if (type == CommandType.StoredProcedure) { sql = DataUtil.GenerateExecuteStoredProcedureSql(sql, args); } - return _database.Fetch(DataUtil.ReplaceTokens(sql), args); + return this._database.Fetch(DataUtil.ReplaceTokens(sql), args); } public T ExecuteScalar(CommandType type, string sql, params object[] args) @@ -100,18 +100,18 @@ public T ExecuteScalar(CommandType type, string sql, params object[] args) sql = DataUtil.GenerateExecuteStoredProcedureSql(sql, args); } - return _database.ExecuteScalar(DataUtil.ReplaceTokens(sql), args); + return this._database.ExecuteScalar(DataUtil.ReplaceTokens(sql), args); } public T ExecuteSingleOrDefault(CommandType type, string sql, params object[] args) { - PetaPocoMapper.SetMapper(_mapper); + PetaPocoMapper.SetMapper(this._mapper); if (type == CommandType.StoredProcedure) { sql = DataUtil.GenerateExecuteStoredProcedureSql(sql, args); } - return _database.SingleOrDefault(DataUtil.ReplaceTokens(sql), args); + return this._database.SingleOrDefault(DataUtil.ReplaceTokens(sql), args); } public IRepository GetRepository() where T : class @@ -119,18 +119,18 @@ public IRepository GetRepository() where T : class PetaPocoRepository rep = null; //Determine whether to use a Fluent Mapper - if (FluentMappers.ContainsKey(typeof (T))) + if (this.FluentMappers.ContainsKey(typeof (T))) { - var fluentMapper = FluentMappers[typeof(T)] as FluentMapper; + var fluentMapper = this.FluentMappers[typeof(T)] as FluentMapper; if (fluentMapper != null) { - rep = new PetaPocoRepository(_database, fluentMapper); + rep = new PetaPocoRepository(this._database, fluentMapper); rep.Initialize(fluentMapper.CacheKey, fluentMapper.CacheTimeOut, fluentMapper.CachePriority, fluentMapper.Scope); } } else { - rep = new PetaPocoRepository(_database, _mapper); + rep = new PetaPocoRepository(this._database, this._mapper); } return rep; @@ -138,7 +138,7 @@ public IRepository GetRepository() where T : class public void RollbackTransaction() { - _database.AbortTransaction(); + this._database.AbortTransaction(); } #endregion @@ -147,7 +147,7 @@ public void RollbackTransaction() public void Dispose() { - _database.Dispose(); + this._database.Dispose(); } #endregion diff --git a/DNN Platform/Library/Data/PetaPoco/PetaPocoMapper.cs b/DNN Platform/Library/Data/PetaPoco/PetaPocoMapper.cs index 68acdd0b8aa..e89cc7fc38c 100644 --- a/DNN Platform/Library/Data/PetaPoco/PetaPocoMapper.cs +++ b/DNN Platform/Library/Data/PetaPoco/PetaPocoMapper.cs @@ -22,7 +22,7 @@ public class PetaPocoMapper : IMapper public PetaPocoMapper(string tablePrefix) { - _tablePrefix = tablePrefix; + this._tablePrefix = tablePrefix; _defaultMapper = new StandardMapper(); } @@ -70,7 +70,7 @@ public TableInfo GetTableInfo(Type pocoType) //Table Name ti.TableName = DataUtil.GetTableName(pocoType, ti.TableName + "s"); - ti.TableName = _tablePrefix + ti.TableName; + ti.TableName = this._tablePrefix + ti.TableName; //Primary Key ti.PrimaryKey = DataUtil.GetPrimaryKeyColumn(pocoType, ti.PrimaryKey); diff --git a/DNN Platform/Library/Data/PetaPoco/PetaPocoRepository.cs b/DNN Platform/Library/Data/PetaPoco/PetaPocoRepository.cs index caf074fe1db..8198461dc38 100644 --- a/DNN Platform/Library/Data/PetaPoco/PetaPocoRepository.cs +++ b/DNN Platform/Library/Data/PetaPoco/PetaPocoRepository.cs @@ -27,8 +27,8 @@ public PetaPocoRepository(Database database, IMapper mapper) { Requires.NotNull("database", database); - _database = database; - _mapper = mapper; + this._database = database; + this._mapper = mapper; PetaPocoMapper.SetMapper(mapper); } @@ -39,12 +39,12 @@ public PetaPocoRepository(Database database, IMapper mapper) public override void Delete(string sqlCondition, params object[] args) { - _database.Delete(DataUtil.ReplaceTokens(sqlCondition), args); + this._database.Delete(DataUtil.ReplaceTokens(sqlCondition), args); } public override IEnumerable Find(string sqlCondition, params object[] args) { - return _database.Fetch(DataUtil.ReplaceTokens(sqlCondition), args); + return this._database.Fetch(DataUtil.ReplaceTokens(sqlCondition), args); } public override IPagedList Find(int pageIndex, int pageSize, string sqlCondition, params object[] args) @@ -52,63 +52,63 @@ public override IPagedList Find(int pageIndex, int pageSize, string sqlCondit //Make sure that the sql Condition contains an ORDER BY Clause if(!sqlCondition.ToUpperInvariant().Contains("ORDER BY")) { - sqlCondition = String.Format("{0} ORDER BY {1}", sqlCondition, _mapper.GetTableInfo(typeof(T)).PrimaryKey); + sqlCondition = String.Format("{0} ORDER BY {1}", sqlCondition, this._mapper.GetTableInfo(typeof(T)).PrimaryKey); } - Page petaPocoPage = _database.Page(pageIndex + 1, pageSize, DataUtil.ReplaceTokens(sqlCondition), args); + Page petaPocoPage = this._database.Page(pageIndex + 1, pageSize, DataUtil.ReplaceTokens(sqlCondition), args); return new PagedList(petaPocoPage.Items, (int)petaPocoPage.TotalItems, pageIndex, pageSize); } public override void Update(string sqlCondition, params object[] args) { - _database.Update(DataUtil.ReplaceTokens(sqlCondition), args); + this._database.Update(DataUtil.ReplaceTokens(sqlCondition), args); } #endregion protected override void DeleteInternal(T item) { - _database.Delete(item); + this._database.Delete(item); } protected override IEnumerable GetInternal() { - return _database.Fetch(String.Empty); + return this._database.Fetch(String.Empty); } protected override IPagedList GetPageInternal(int pageIndex, int pageSize) { - return Find(pageIndex, pageSize, String.Empty); + return this.Find(pageIndex, pageSize, String.Empty); } protected override IEnumerable GetByScopeInternal(object propertyValue) { - return _database.Fetch(GetScopeSql(), propertyValue); + return this._database.Fetch(this.GetScopeSql(), propertyValue); } protected override IPagedList GetPageByScopeInternal(object propertyValue, int pageIndex, int pageSize) { - return Find(pageIndex, pageSize, GetScopeSql(), propertyValue); + return this.Find(pageIndex, pageSize, this.GetScopeSql(), propertyValue); } protected override T GetByIdInternal(object id) { - return _database.SingleOrDefault(id); + return this._database.SingleOrDefault(id); } protected override void InsertInternal(T item) { - _database.Insert(item); + this._database.Insert(item); } protected override void UpdateInternal(T item) { - _database.Update(item); + this._database.Update(item); } private string GetScopeSql() { - return String.Format("WHERE {0} = @0", DataUtil.GetColumnName(typeof (T), Scope)); + return String.Format("WHERE {0} = @0", DataUtil.GetColumnName(typeof (T), this.Scope)); } } } diff --git a/DNN Platform/Library/Data/RepositoryBase.cs b/DNN Platform/Library/Data/RepositoryBase.cs index f1608391aef..895b39306f2 100644 --- a/DNN Platform/Library/Data/RepositoryBase.cs +++ b/DNN Platform/Library/Data/RepositoryBase.cs @@ -19,7 +19,7 @@ public abstract class RepositoryBase : IRepository where T : class protected RepositoryBase() { - InitializeInternal(); + this.InitializeInternal(); } #endregion @@ -28,8 +28,8 @@ protected RepositoryBase() public void Delete(T item) { - DeleteInternal(item); - ClearCache(item); + this.DeleteInternal(item); + this.ClearCache(item); } public abstract void Delete(string sqlCondition, params object[] args); @@ -40,65 +40,65 @@ public void Delete(T item) public IEnumerable Get() { - return IsCacheable && !IsScoped - ? DataCache.GetCachedData>(CacheArgs, c => GetInternal()) - : GetInternal(); + return this.IsCacheable && !this.IsScoped + ? DataCache.GetCachedData>(this.CacheArgs, c => this.GetInternal()) + : this.GetInternal(); } public IEnumerable Get(TScopeType scopeValue) { - CheckIfScoped(); + this.CheckIfScoped(); - if(IsCacheable) + if(this.IsCacheable) { - CacheArgs.CacheKey = String.Format(CacheArgs.CacheKey, scopeValue); + this.CacheArgs.CacheKey = String.Format(this.CacheArgs.CacheKey, scopeValue); } - return IsCacheable - ? DataCache.GetCachedData>(CacheArgs, c => GetByScopeInternal(scopeValue)) - : GetByScopeInternal(scopeValue); + return this.IsCacheable + ? DataCache.GetCachedData>(this.CacheArgs, c => this.GetByScopeInternal(scopeValue)) + : this.GetByScopeInternal(scopeValue); } public T GetById(TProperty id) { - return IsCacheable && !IsScoped - ? Get().SingleOrDefault(t => CompareTo(GetPrimaryKey(t), id) == 0) - : GetByIdInternal(id); + return this.IsCacheable && !this.IsScoped + ? this.Get().SingleOrDefault(t => this.CompareTo(this.GetPrimaryKey(t), id) == 0) + : this.GetByIdInternal(id); } public T GetById(TProperty id, TScopeType scopeValue) { - CheckIfScoped(); + this.CheckIfScoped(); - return Get(scopeValue).SingleOrDefault(t => CompareTo(GetPrimaryKey(t), id) == 0); + return this.Get(scopeValue).SingleOrDefault(t => this.CompareTo(this.GetPrimaryKey(t), id) == 0); } public IPagedList GetPage(int pageIndex, int pageSize) { - return IsCacheable && !IsScoped - ? Get().InPagesOf(pageSize).GetPage(pageIndex) - : GetPageInternal(pageIndex, pageSize); + return this.IsCacheable && !this.IsScoped + ? this.Get().InPagesOf(pageSize).GetPage(pageIndex) + : this.GetPageInternal(pageIndex, pageSize); } public IPagedList GetPage(TScopeType scopeValue, int pageIndex, int pageSize) { - CheckIfScoped(); + this.CheckIfScoped(); - return IsCacheable - ? Get(scopeValue).InPagesOf(pageSize).GetPage(pageIndex) - : GetPageByScopeInternal(scopeValue, pageIndex, pageSize); + return this.IsCacheable + ? this.Get(scopeValue).InPagesOf(pageSize).GetPage(pageIndex) + : this.GetPageByScopeInternal(scopeValue, pageIndex, pageSize); } public void Insert(T item) { - InsertInternal(item); - ClearCache(item); + this.InsertInternal(item); + this.ClearCache(item); } public void Update(T item) { - UpdateInternal(item); - ClearCache(item); + this.UpdateInternal(item); + this.ClearCache(item); } public abstract void Update(string sqlCondition, params object[] args); @@ -109,7 +109,7 @@ public void Update(T item) private void CheckIfScoped() { - if (!IsScoped) + if (!this.IsScoped) { throw new NotSupportedException("This method requires the model to be cacheable and have a cache scope defined"); } @@ -117,46 +117,46 @@ private void CheckIfScoped() private void ClearCache(T item) { - if (IsCacheable) + if (this.IsCacheable) { - DataCache.RemoveCache(IsScoped - ? String.Format(CacheArgs.CacheKey, GetScopeValue(item)) - : CacheArgs.CacheKey); + DataCache.RemoveCache(this.IsScoped + ? String.Format(this.CacheArgs.CacheKey, this.GetScopeValue(item)) + : this.CacheArgs.CacheKey); } } private void InitializeInternal() { var type = typeof (T); - Scope = String.Empty; - IsCacheable = false; - IsScoped = false; - CacheArgs = null; + this.Scope = String.Empty; + this.IsCacheable = false; + this.IsScoped = false; + this.CacheArgs = null; var scopeAttribute = DataUtil.GetAttribute(type); if (scopeAttribute != null) { - Scope = scopeAttribute.Scope; + this.Scope = scopeAttribute.Scope; } - IsScoped = (!String.IsNullOrEmpty(Scope)); + this.IsScoped = (!String.IsNullOrEmpty(this.Scope)); var cacheableAttribute = DataUtil.GetAttribute(type); if (cacheableAttribute != null) { - IsCacheable = true; + this.IsCacheable = true; var cacheKey = !String.IsNullOrEmpty(cacheableAttribute.CacheKey) ? cacheableAttribute.CacheKey : String.Format("OR_{0}", type.Name); var cachePriority = cacheableAttribute.CachePriority; var cacheTimeOut = cacheableAttribute.CacheTimeOut; - if (IsScoped) + if (this.IsScoped) { - cacheKey += "_" + Scope + "_{0}"; + cacheKey += "_" + this.Scope + "_{0}"; } - CacheArgs = new CacheItemArgs(cacheKey, cacheTimeOut, cachePriority); + this.CacheArgs = new CacheItemArgs(cacheKey, cacheTimeOut, cachePriority); } } @@ -199,7 +199,7 @@ protected TProperty GetPrimaryKey(T item) protected TProperty GetScopeValue(T item) { - return DataUtil.GetPropertyValue(item, Scope); + return DataUtil.GetPropertyValue(item, this.Scope); } #region Abstract Methods @@ -224,20 +224,20 @@ protected TProperty GetScopeValue(T item) public void Initialize(string cacheKey, int cacheTimeOut = 20, CacheItemPriority cachePriority = CacheItemPriority.Default, string scope = "") { - Scope = scope; - IsScoped = (!String.IsNullOrEmpty(Scope)); - IsCacheable = (!String.IsNullOrEmpty(cacheKey)); - if (IsCacheable) + this.Scope = scope; + this.IsScoped = (!String.IsNullOrEmpty(this.Scope)); + this.IsCacheable = (!String.IsNullOrEmpty(cacheKey)); + if (this.IsCacheable) { - if (IsScoped) + if (this.IsScoped) { - cacheKey += "_" + Scope + "_{0}"; + cacheKey += "_" + this.Scope + "_{0}"; } - CacheArgs = new CacheItemArgs(cacheKey, cacheTimeOut, cachePriority); + this.CacheArgs = new CacheItemArgs(cacheKey, cacheTimeOut, cachePriority); } else { - CacheArgs = null; + this.CacheArgs = null; } } } diff --git a/DNN Platform/Library/Data/SqlDataProvider.cs b/DNN Platform/Library/Data/SqlDataProvider.cs index cc0b114e5c0..fed1296a3e9 100644 --- a/DNN Platform/Library/Data/SqlDataProvider.cs +++ b/DNN Platform/Library/Data/SqlDataProvider.cs @@ -39,7 +39,7 @@ public override bool IsConnectionValid { get { - return CanConnect(ConnectionString, DatabaseOwner, ObjectQualifier); + return CanConnect(this.ConnectionString, this.DatabaseOwner, this.ObjectQualifier); } } @@ -109,7 +109,7 @@ private string ExecuteScriptInternal(string connectionString, string script, int private IDataReader ExecuteSQLInternal(string connectionString, string sql, int timeoutSec = 0) { string errorMessage; - return ExecuteSQLInternal(connectionString, sql, timeoutSec, out errorMessage); + return this.ExecuteSQLInternal(connectionString, sql, timeoutSec, out errorMessage); } private IDataReader ExecuteSQLInternal(string connectionString, string sql, int timeoutSec, out string errorMessage) @@ -145,7 +145,7 @@ private string GetConnectionStringUserID() //If connection string does not use integrated security, then get user id. //Normalize to uppercase before all of the comparisons - var connectionStringUppercase = ConnectionString.ToUpper(); + var connectionStringUppercase = this.ConnectionString.ToUpper(); if (connectionStringUppercase.Contains("USER ID") || connectionStringUppercase.Contains("UID") || connectionStringUppercase.Contains("USER")) { string[] ConnSettings = connectionStringUppercase.Split(';'); @@ -177,7 +177,7 @@ private string GrantStoredProceduresPermission(string Permission, string LoginOr + " where ( OBJECTPROPERTY(o.id, N'IsProcedure') = 1 or OBJECTPROPERTY(o.id, N'IsExtendedProc') = 1 or OBJECTPROPERTY(o.id, N'IsReplProc') = 1 ) " + " and OBJECTPROPERTY(o.id, N'IsMSShipped') = 0 " + " and o.name not like N'#%%' " - + " and (left(o.name,len('" + ObjectQualifier + "')) = '" + ObjectQualifier + "' or left(o.name,7) = 'aspnet_') " + + " and (left(o.name,len('" + this.ObjectQualifier + "')) = '" + this.ObjectQualifier + "' or left(o.name,7) = 'aspnet_') " + " open sp_cursor " + " fetch sp_cursor into @name " + " while @@fetch_status >= 0 " @@ -189,7 +189,7 @@ private string GrantStoredProceduresPermission(string Permission, string LoginOr + " deallocate sp_cursor" + " end "; - return ExecuteUpgradedConnectionQuery(sql); + return this.ExecuteUpgradedConnectionQuery(sql); } private string GrantUserDefinedFunctionsPermission(string ScalarPermission, string TablePermission, string LoginOrRole) @@ -206,7 +206,7 @@ private string GrantUserDefinedFunctionsPermission(string ScalarPermission, stri + " where ( OBJECTPROPERTY(o.id, N'IsScalarFunction') = 1 OR OBJECTPROPERTY(o.id, N'IsTableFunction') = 1 ) " + " and OBJECTPROPERTY(o.id, N'IsMSShipped') = 0 " + " and o.name not like N'#%%' " - + " and (left(o.name,len('" + ObjectQualifier + "')) = '" + ObjectQualifier + "' or left(o.name,7) = 'aspnet_') " + + " and (left(o.name,len('" + this.ObjectQualifier + "')) = '" + this.ObjectQualifier + "' or left(o.name,7) = 'aspnet_') " + " open sp_cursor " + " fetch sp_cursor into @name, @isscalarfunction " + " while @@fetch_status >= 0 " @@ -227,7 +227,7 @@ private string GrantUserDefinedFunctionsPermission(string ScalarPermission, stri + " deallocate sp_cursor" + " end "; - return ExecuteUpgradedConnectionQuery(sql); + return this.ExecuteUpgradedConnectionQuery(sql); } private string ExecuteUpgradedConnectionQuery(string sql) @@ -236,7 +236,7 @@ private string ExecuteUpgradedConnectionQuery(string sql) try { - _dbConnectionProvider.ExecuteNonQuery(UpgradeConnectionString, CommandType.Text, 0, sql); + _dbConnectionProvider.ExecuteNonQuery(this.UpgradeConnectionString, CommandType.Text, 0, sql); } catch (SqlException objException) { @@ -253,65 +253,65 @@ private string ExecuteUpgradedConnectionQuery(string sql) public override void ExecuteNonQuery(string procedureName, params object[] commandParameters) { - _dbConnectionProvider.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, 0, DatabaseOwner + ObjectQualifier + procedureName, commandParameters); + _dbConnectionProvider.ExecuteNonQuery(this.ConnectionString, CommandType.StoredProcedure, 0, this.DatabaseOwner + this.ObjectQualifier + procedureName, commandParameters); } public override void ExecuteNonQuery(int timeoutSec, string procedureName, params object[] commandParameters) { - _dbConnectionProvider.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, timeoutSec, DatabaseOwner + ObjectQualifier + procedureName, commandParameters); + _dbConnectionProvider.ExecuteNonQuery(this.ConnectionString, CommandType.StoredProcedure, timeoutSec, this.DatabaseOwner + this.ObjectQualifier + procedureName, commandParameters); } public override void BulkInsert(string procedureName, string tableParameterName, DataTable dataTable) { - _dbConnectionProvider.BulkInsert(ConnectionString, 0, DatabaseOwner + ObjectQualifier + procedureName, tableParameterName, dataTable); + _dbConnectionProvider.BulkInsert(this.ConnectionString, 0, this.DatabaseOwner + this.ObjectQualifier + procedureName, tableParameterName, dataTable); } public override void BulkInsert(string procedureName, string tableParameterName, DataTable dataTable, int timeoutSec) { - _dbConnectionProvider.BulkInsert(ConnectionString, timeoutSec, DatabaseOwner + ObjectQualifier + procedureName, tableParameterName, dataTable); + _dbConnectionProvider.BulkInsert(this.ConnectionString, timeoutSec, this.DatabaseOwner + this.ObjectQualifier + procedureName, tableParameterName, dataTable); } public override void BulkInsert(string procedureName, string tableParameterName, DataTable dataTable, Dictionary commandParameters) { - _dbConnectionProvider.BulkInsert(ConnectionString, 0, DatabaseOwner + ObjectQualifier + procedureName, tableParameterName, dataTable, commandParameters); + _dbConnectionProvider.BulkInsert(this.ConnectionString, 0, this.DatabaseOwner + this.ObjectQualifier + procedureName, tableParameterName, dataTable, commandParameters); } public override void BulkInsert(string procedureName, string tableParameterName, DataTable dataTable, int timeoutSec, Dictionary commandParameters) { - _dbConnectionProvider.BulkInsert(ConnectionString, 0, DatabaseOwner + ObjectQualifier + procedureName, tableParameterName, dataTable, commandParameters); + _dbConnectionProvider.BulkInsert(this.ConnectionString, 0, this.DatabaseOwner + this.ObjectQualifier + procedureName, tableParameterName, dataTable, commandParameters); } public override IDataReader ExecuteReader(string procedureName, params object[] commandParameters) { - return _dbConnectionProvider.ExecuteReader(ConnectionString, CommandType.StoredProcedure, 0, DatabaseOwner + ObjectQualifier + procedureName, commandParameters); + return _dbConnectionProvider.ExecuteReader(this.ConnectionString, CommandType.StoredProcedure, 0, this.DatabaseOwner + this.ObjectQualifier + procedureName, commandParameters); } public override IDataReader ExecuteReader(int timeoutSec, string procedureName, params object[] commandParameters) { - return _dbConnectionProvider.ExecuteReader(ConnectionString, CommandType.StoredProcedure, timeoutSec, DatabaseOwner + ObjectQualifier + procedureName, commandParameters); + return _dbConnectionProvider.ExecuteReader(this.ConnectionString, CommandType.StoredProcedure, timeoutSec, this.DatabaseOwner + this.ObjectQualifier + procedureName, commandParameters); } public override T ExecuteScalar(string procedureName, params object[] commandParameters) { - return _dbConnectionProvider.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, 0, DatabaseOwner + ObjectQualifier + procedureName, commandParameters); + return _dbConnectionProvider.ExecuteScalar(this.ConnectionString, CommandType.StoredProcedure, 0, this.DatabaseOwner + this.ObjectQualifier + procedureName, commandParameters); } public override T ExecuteScalar(int timeoutSec, string procedureName, params object[] commandParameters) { - return _dbConnectionProvider.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, timeoutSec, DatabaseOwner + ObjectQualifier + procedureName, commandParameters); + return _dbConnectionProvider.ExecuteScalar(this.ConnectionString, CommandType.StoredProcedure, timeoutSec, this.DatabaseOwner + this.ObjectQualifier + procedureName, commandParameters); } public override string ExecuteScript(string script) { - return ExecuteScript(script, 0); + return this.ExecuteScript(script, 0); } public override string ExecuteScript(string script, int timeoutSec) { - string exceptions = ExecuteScriptInternal(UpgradeConnectionString, script, timeoutSec); + string exceptions = this.ExecuteScriptInternal(this.UpgradeConnectionString, script, timeoutSec); //if the upgrade connection string is specified or or db_owner setting is not set to dbo - if (UpgradeConnectionString != ConnectionString || !DatabaseOwner.Trim().Equals("dbo.", StringComparison.InvariantCultureIgnoreCase)) + if (this.UpgradeConnectionString != this.ConnectionString || !this.DatabaseOwner.Trim().Equals("dbo.", StringComparison.InvariantCultureIgnoreCase)) { try { @@ -319,7 +319,7 @@ public override string ExecuteScript(string script, int timeoutSec) //necesary because the UpgradeConnectionString will create stored procedures //which restrict execute permissions for the ConnectionString user account. This is also //necessary when db_owner is not set to "dbo" - exceptions += GrantStoredProceduresPermission("EXECUTE", GetConnectionStringUserID()); + exceptions += this.GrantStoredProceduresPermission("EXECUTE", this.GetConnectionStringUserID()); } catch (SqlException objException) { @@ -335,7 +335,7 @@ public override string ExecuteScript(string script, int timeoutSec) //necesary because the UpgradeConnectionString will create user defined functions //which restrict execute permissions for the ConnectionString user account. This is also //necessary when db_owner is not set to "dbo" - exceptions += GrantUserDefinedFunctionsPermission("EXECUTE", "SELECT", GetConnectionStringUserID()); + exceptions += this.GrantUserDefinedFunctionsPermission("EXECUTE", "SELECT", this.GetConnectionStringUserID()); } catch (SqlException objException) { @@ -349,44 +349,44 @@ public override string ExecuteScript(string script, int timeoutSec) public override string ExecuteScript(string connectionString, string script) { - return ExecuteScriptInternal(connectionString, script); + return this.ExecuteScriptInternal(connectionString, script); } public override string ExecuteScript(string connectionString, string script, int timeoutSec) { - return ExecuteScriptInternal(connectionString, script, timeoutSec); + return this.ExecuteScriptInternal(connectionString, script, timeoutSec); } public override IDataReader ExecuteSQL(string sql) { - return ExecuteSQLInternal(ConnectionString, sql); + return this.ExecuteSQLInternal(this.ConnectionString, sql); } public override IDataReader ExecuteSQL(string sql, int timeoutSec) { - return ExecuteSQLInternal(ConnectionString, sql, timeoutSec); + return this.ExecuteSQLInternal(this.ConnectionString, sql, timeoutSec); } public override IDataReader ExecuteSQLTemp(string connectionString, string sql) { string errorMessage; - return ExecuteSQLTemp(connectionString, sql, out errorMessage); + return this.ExecuteSQLTemp(connectionString, sql, out errorMessage); } public override IDataReader ExecuteSQLTemp(string connectionString, string sql, int timeoutSec) { string errorMessage; - return ExecuteSQLTemp(connectionString, sql, timeoutSec, out errorMessage); + return this.ExecuteSQLTemp(connectionString, sql, timeoutSec, out errorMessage); } public override IDataReader ExecuteSQLTemp(string connectionString, string sql, out string errorMessage) { - return ExecuteSQLInternal(connectionString, sql, 0, out errorMessage); + return this.ExecuteSQLInternal(connectionString, sql, 0, out errorMessage); } public override IDataReader ExecuteSQLTemp(string connectionString, string sql, int timeoutSec, out string errorMessage) { - return ExecuteSQLInternal(connectionString, sql, timeoutSec, out errorMessage); + return this.ExecuteSQLInternal(connectionString, sql, timeoutSec, out errorMessage); } #endregion diff --git a/DNN Platform/Library/DotNetNuke.Library.csproj b/DNN Platform/Library/DotNetNuke.Library.csproj index f686f9eb986..fc7291a916b 100644 --- a/DNN Platform/Library/DotNetNuke.Library.csproj +++ b/DNN Platform/Library/DotNetNuke.Library.csproj @@ -1748,6 +1748,9 @@ + + stylecop.json + Designer @@ -1876,6 +1879,10 @@ DotNetNuke.WebUtility + + + + $(MSBuildProjectDirectory)\..\.. diff --git a/DNN Platform/Library/Entities/BaseEntityInfo.cs b/DNN Platform/Library/Entities/BaseEntityInfo.cs index 231d253169b..712c656daf1 100644 --- a/DNN Platform/Library/Entities/BaseEntityInfo.cs +++ b/DNN Platform/Library/Entities/BaseEntityInfo.cs @@ -30,8 +30,8 @@ public abstract class BaseEntityInfo { protected BaseEntityInfo() { - CreatedByUserID = Null.NullInteger; - LastModifiedByUserID = Null.NullInteger; + this.CreatedByUserID = Null.NullInteger; + this.LastModifiedByUserID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -79,9 +79,9 @@ protected BaseEntityInfo() /// ----------------------------------------------------------------------------- public UserInfo CreatedByUser(int portalId) { - if (CreatedByUserID > Null.NullInteger) + if (this.CreatedByUserID > Null.NullInteger) { - UserInfo user = UserController.GetUserById(portalId, CreatedByUserID); + UserInfo user = UserController.GetUserById(portalId, this.CreatedByUserID); return user; } return null; @@ -96,9 +96,9 @@ public UserInfo CreatedByUser(int portalId) /// ----------------------------------------------------------------------------- public UserInfo LastModifiedByUser(int portalId) { - if (LastModifiedByUserID > Null.NullInteger) + if (this.LastModifiedByUserID > Null.NullInteger) { - UserInfo user = UserController.GetUserById(portalId, LastModifiedByUserID); + UserInfo user = UserController.GetUserById(portalId, this.LastModifiedByUserID); return user; } return null; @@ -112,10 +112,10 @@ public UserInfo LastModifiedByUser(int portalId) /// ----------------------------------------------------------------------------- protected virtual void FillInternal(IDataReader dr) { - CreatedByUserID = Null.SetNullInteger(dr["CreatedByUserID"]); - CreatedOnDate = Null.SetNullDateTime(dr["CreatedOnDate"]); - LastModifiedByUserID = Null.SetNullInteger(dr["LastModifiedByUserID"]); - LastModifiedOnDate = Null.SetNullDateTime(dr["LastModifiedOnDate"]); + this.CreatedByUserID = Null.SetNullInteger(dr["CreatedByUserID"]); + this.CreatedOnDate = Null.SetNullDateTime(dr["CreatedOnDate"]); + this.LastModifiedByUserID = Null.SetNullInteger(dr["LastModifiedByUserID"]); + this.LastModifiedOnDate = Null.SetNullDateTime(dr["LastModifiedOnDate"]); } protected void CloneBaseProperties(BaseEntityInfo clonedItem, BaseEntityInfo originalItem) @@ -133,7 +133,7 @@ protected void CloneBaseProperties(BaseEntityInfo clonedItem, BaseEntityInfo ori /// internal void FillBaseProperties(IDataReader dr) { - FillInternal(dr); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Entities/Content/AttachmentController.cs b/DNN Platform/Library/Entities/Content/AttachmentController.cs index 73721f94a2e..17ed43f5c21 100644 --- a/DNN Platform/Library/Entities/Content/AttachmentController.cs +++ b/DNN Platform/Library/Entities/Content/AttachmentController.cs @@ -26,7 +26,7 @@ public AttachmentController() public AttachmentController(IContentController contentController) { - _contentController = contentController; + this._contentController = contentController; } private readonly IContentController _contentController; @@ -35,60 +35,60 @@ public AttachmentController(IContentController contentController) private void AddToContent(int contentItemId, Action action) { - var contentItem = _contentController.GetContentItem(contentItemId); + var contentItem = this._contentController.GetContentItem(contentItemId); action(contentItem); - _contentController.UpdateContentItem(contentItem); + this._contentController.UpdateContentItem(contentItem); } public void AddFileToContent(int contentItemId, IFileInfo fileInfo) { - AddFilesToContent(contentItemId, new[] { fileInfo }); + this.AddFilesToContent(contentItemId, new[] { fileInfo }); } public void AddFilesToContent(int contentItemId, IEnumerable fileInfo) { - AddToContent(contentItemId, contentItem => contentItem.Files.AddRange(fileInfo)); + this.AddToContent(contentItemId, contentItem => contentItem.Files.AddRange(fileInfo)); } public void AddVideoToContent(int contentItemId, IFileInfo fileInfo) { - AddVideosToContent(contentItemId, new[] { fileInfo }); + this.AddVideosToContent(contentItemId, new[] { fileInfo }); } public void AddVideosToContent(int contentItemId, IEnumerable fileInfo) { - AddToContent(contentItemId, contentItem => contentItem.Videos.AddRange(fileInfo)); + this.AddToContent(contentItemId, contentItem => contentItem.Videos.AddRange(fileInfo)); } public void AddImageToContent(int contentItemId, IFileInfo fileInfo) { - AddImagesToContent(contentItemId, new[] { fileInfo }); + this.AddImagesToContent(contentItemId, new[] { fileInfo }); } public void AddImagesToContent(int contentItemId, IEnumerable fileInfo) { - AddToContent(contentItemId, contentItem => contentItem.Images.AddRange(fileInfo)); + this.AddToContent(contentItemId, contentItem => contentItem.Images.AddRange(fileInfo)); } public IList GetVideosByContent(int contentItemId) { - var files = GetFilesByContent(contentItemId, VideoKey); + var files = this.GetFilesByContent(contentItemId, VideoKey); return files.Select(fileId => FileManager.Instance.GetFile(fileId)).ToList(); } public IList GetImagesByContent(int contentItemId) { - var files = GetFilesByContent(contentItemId, ImageKey); + var files = this.GetFilesByContent(contentItemId, ImageKey); return files.Select(fileId => FileManager.Instance.GetFile(fileId)).ToList(); } public IList GetFilesByContent(int contentItemId) { - var files = GetFilesByContent(contentItemId, FilesKey); + var files = this.GetFilesByContent(contentItemId, FilesKey); return files.Select(fileId => FileManager.Instance.GetFile(fileId)).ToList(); } @@ -129,7 +129,7 @@ internal static void SerializeAttachmentMetadata(ContentItem contentItem) private IEnumerable GetFilesByContent(int contentItemId, string type) { - var contentItem = _contentController.GetContentItem(contentItemId); + var contentItem = this._contentController.GetContentItem(contentItemId); if (contentItem == null) { throw new ApplicationException(string.Format("Cannot find ContentItem ID {0}", contentItemId)); diff --git a/DNN Platform/Library/Entities/Content/ContentController.cs b/DNN Platform/Library/Entities/Content/ContentController.cs index aa294d97c96..620db5c3e4a 100644 --- a/DNN Platform/Library/Entities/Content/ContentController.cs +++ b/DNN Platform/Library/Entities/Content/ContentController.cs @@ -37,7 +37,7 @@ public ContentController() : this(Util.GetDataService()) public ContentController(IDataService dataService) { - _dataService = dataService; + this._dataService = dataService; } public int AddContentItem(ContentItem contentItem) @@ -51,11 +51,11 @@ public int AddContentItem(ContentItem contentItem) createdByUserId = contentItem.CreatedByUserID; } - contentItem.ContentItemId = _dataService.AddContentItem(contentItem, createdByUserId); + contentItem.ContentItemId = this._dataService.AddContentItem(contentItem, createdByUserId); contentItem.CreatedByUserID = createdByUserId; contentItem.LastModifiedByUserID = currentUser.UserID; - SaveMetadataDelta(contentItem); + this.SaveMetadataDelta(contentItem); UpdateContentItemsCache(contentItem); @@ -77,15 +77,15 @@ public void DeleteContentItem(ContentItem contentItem) }; DotNetNuke.Data.DataProvider.Instance().AddSearchDeletedItems(searrchDoc); - _dataService.DeleteContentItem(contentItem.ContentItemId); + this._dataService.DeleteContentItem(contentItem.ContentItemId); UpdateContentItemsCache(contentItem, false); } public void DeleteContentItem(int contentItemId) { - var contentItem = GetContentItem(contentItemId); - DeleteContentItem(contentItem); + var contentItem = this.GetContentItem(contentItemId); + this.DeleteContentItem(contentItem); } public ContentItem GetContentItem(int contentItemId) @@ -95,12 +95,12 @@ public ContentItem GetContentItem(int contentItemId) return CBO.GetCachedObject( new CacheItemArgs(GetContentItemCacheKey(contentItemId), DataCache.ContentItemsCacheTimeOut, DataCache.ContentItemsCachePriority), - c => CBO.FillObject(_dataService.GetContentItem(contentItemId))); + c => CBO.FillObject(this._dataService.GetContentItem(contentItemId))); } public IQueryable GetContentItems(int contentTypeId, int tabId, int moduleId) { - return CBO.FillQueryable(_dataService.GetContentItems(contentTypeId, tabId, moduleId)); + return CBO.FillQueryable(this._dataService.GetContentItems(contentTypeId, tabId, moduleId)); } public IQueryable GetContentItemsByTerm(string term) @@ -108,28 +108,28 @@ public IQueryable GetContentItemsByTerm(string term) //Argument Contract Requires.NotNullOrEmpty("term", term); - return CBO.FillQueryable(_dataService.GetContentItemsByTerm(term)); + return CBO.FillQueryable(this._dataService.GetContentItemsByTerm(term)); } public IQueryable GetContentItemsByTerm(Term term) { - return GetContentItemsByTerm(term.Name); + return this.GetContentItemsByTerm(term.Name); } public IQueryable GetContentItemsByContentType(int contentTypeId) { - return CBO.FillQueryable(_dataService.GetContentItemsByContentType(contentTypeId)); + return CBO.FillQueryable(this._dataService.GetContentItemsByContentType(contentTypeId)); } /// Get a list of content items by ContentType. public IQueryable GetContentItemsByContentType(ContentType contentType) { - return GetContentItemsByContentType(contentType.ContentTypeId); + return this.GetContentItemsByContentType(contentType.ContentTypeId); } public IQueryable GetContentItemsByTerms(IList terms) { - return GetContentItemsByTerms(terms.Select(t => t.Name).ToArray()); + return this.GetContentItemsByTerms(terms.Select(t => t.Name).ToArray()); } public IQueryable GetContentItemsByTerms(string[] terms) @@ -139,30 +139,30 @@ public IQueryable GetContentItemsByTerms(string[] terms) union = terms.Aggregate(union, (current, term) => !current.Any() - ? GetContentItemsByTerm(term).ToList() - : current.Intersect(GetContentItemsByTerm(term), new ContentItemEqualityComparer()).ToList()); + ? this.GetContentItemsByTerm(term).ToList() + : current.Intersect(this.GetContentItemsByTerm(term), new ContentItemEqualityComparer()).ToList()); return union.AsQueryable(); } public IQueryable GetContentItemsByTabId(int tabId) { - return CBO.FillQueryable(_dataService.GetContentItemsByTabId(tabId)); + return CBO.FillQueryable(this._dataService.GetContentItemsByTabId(tabId)); } public IQueryable GetContentItemsByVocabularyId(int vocabularyId) { - return CBO.FillQueryable(_dataService.GetContentItemsByVocabularyId(vocabularyId)); + return CBO.FillQueryable(this._dataService.GetContentItemsByVocabularyId(vocabularyId)); } public IQueryable GetUnIndexedContentItems() { - return CBO.FillQueryable(_dataService.GetUnIndexedContentItems()); + return CBO.FillQueryable(this._dataService.GetUnIndexedContentItems()); } public IQueryable GetContentItemsByModuleId(int moduleId) { - return CBO.FillQueryable(_dataService.GetContentItemsByModuleId(moduleId)); + return CBO.FillQueryable(this._dataService.GetContentItemsByModuleId(moduleId)); } public void UpdateContentItem(ContentItem contentItem) @@ -173,10 +173,10 @@ public void UpdateContentItem(ContentItem contentItem) AttachmentController.SerializeAttachmentMetadata(contentItem); - SaveMetadataDelta(contentItem); + this.SaveMetadataDelta(contentItem); var userId = UserController.Instance.GetCurrentUserInfo().UserID; - _dataService.UpdateContentItem(contentItem, userId); + this._dataService.UpdateContentItem(contentItem, userId); contentItem.LastModifiedByUserID = userId; UpdateContentItemsCache(contentItem); @@ -189,7 +189,7 @@ public void AddMetaData(ContentItem contentItem, string name, string value) Requires.PropertyNotNegative("contentItem", "ContentItemId", contentItem.ContentItemId); Requires.NotNullOrEmpty("name", name); - _dataService.AddMetaData(contentItem, name, value); + this._dataService.AddMetaData(contentItem, name, value); UpdateContentItemsCache(contentItem, false); } @@ -201,7 +201,7 @@ public void DeleteMetaData(ContentItem contentItem, string name, string value) Requires.PropertyNotNegative("contentItem", "ContentItemId", contentItem.ContentItemId); Requires.NotNullOrEmpty("name", name); - _dataService.DeleteMetaData(contentItem, name, value); + this._dataService.DeleteMetaData(contentItem, name, value); UpdateContentItemsCache(contentItem, false); } @@ -210,7 +210,7 @@ public void DeleteMetaData(ContentItem contentItem, string name) { if (contentItem.Metadata.AllKeys.Contains(name)) { - DeleteMetaData(contentItem, name, contentItem.Metadata[name]); + this.DeleteMetaData(contentItem, name, contentItem.Metadata[name]); } } @@ -221,7 +221,7 @@ public NameValueCollection GetMetaData(int contentItemId) var metadata = new NameValueCollection(); - using (var dr = _dataService.GetMetaData(contentItemId)) + using (var dr = this._dataService.GetMetaData(contentItemId)) { if (dr != null) { @@ -237,7 +237,7 @@ public NameValueCollection GetMetaData(int contentItemId) private void SaveMetadataDelta(ContentItem contentItem) { - var persisted = GetMetaData(contentItem.ContentItemId); + var persisted = this.GetMetaData(contentItem.ContentItemId); var lh = persisted.AllKeys.ToDictionary(x => x, x => persisted[x]); @@ -254,7 +254,7 @@ private void SaveMetadataDelta(ContentItem contentItem) // Items included in the object but missing from the database (newly added). var added = rh.Except(lh).ToArray(); - _dataService.SynchronizeMetaData(contentItem, added, deleted); + this._dataService.SynchronizeMetaData(contentItem, added, deleted); UpdateContentItemsCache(contentItem, false); } diff --git a/DNN Platform/Library/Entities/Content/ContentItem.cs b/DNN Platform/Library/Entities/Content/ContentItem.cs index 441f41c6401..af099dd118a 100644 --- a/DNN Platform/Library/Entities/Content/ContentItem.cs +++ b/DNN Platform/Library/Entities/Content/ContentItem.cs @@ -75,11 +75,11 @@ public class ContentItem : BaseEntityInfo, IHydratable public ContentItem() { - TabID = Null.NullInteger; - ModuleID = Null.NullInteger; - ContentTypeId = Null.NullInteger; - ContentItemId = Null.NullInteger; - StateID = Null.NullInteger; + this.TabID = Null.NullInteger; + this.ModuleID = Null.NullInteger; + this.ContentTypeId = Null.NullInteger; + this.ContentItemId = Null.NullInteger; + this.StateID = Null.NullInteger; } #region Public Properties @@ -143,7 +143,7 @@ public NameValueCollection Metadata { get { - return _metadata ?? (_metadata = this.GetMetaData(ContentItemId)); + return this._metadata ?? (this._metadata = this.GetMetaData(this.ContentItemId)); } } @@ -175,7 +175,7 @@ public List Terms { get { - return _terms ?? (_terms = this.GetTerms(ContentItemId)); + return this._terms ?? (this._terms = this.GetTerms(this.ContentItemId)); } } @@ -185,11 +185,11 @@ public string ContentTitle { get { - return Metadata[AttachmentController.TitleKey]; + return this.Metadata[AttachmentController.TitleKey]; } set { - Metadata[AttachmentController.TitleKey] = value; + this.Metadata[AttachmentController.TitleKey] = value; } } @@ -200,7 +200,7 @@ public string ContentTitle [ScriptIgnore] public List Files { - get { return _files ?? (_files = AttachmentController.DeserializeFileInfo(Metadata[AttachmentController.FilesKey]).ToList()); } + get { return this._files ?? (this._files = AttachmentController.DeserializeFileInfo(this.Metadata[AttachmentController.FilesKey]).ToList()); } } /// @@ -210,7 +210,7 @@ public List Files [ScriptIgnore] public List Videos { - get { return _videos ?? (_videos = AttachmentController.DeserializeFileInfo(Metadata[AttachmentController.VideoKey]).ToList()); } + get { return this._videos ?? (this._videos = AttachmentController.DeserializeFileInfo(this.Metadata[AttachmentController.VideoKey]).ToList()); } } /// @@ -220,7 +220,7 @@ public List Videos [ScriptIgnore] public List Images { - get { return _images ?? (_images = AttachmentController.DeserializeFileInfo(Metadata[AttachmentController.ImageKey]).ToList()); } + get { return this._images ?? (this._images = AttachmentController.DeserializeFileInfo(this.Metadata[AttachmentController.ImageKey]).ToList()); } } /// @@ -247,27 +247,27 @@ protected override void FillInternal(IDataReader dr) { base.FillInternal(dr); - ContentItemId = Null.SetNullInteger(dr["ContentItemID"]); - Content = Null.SetNullString(dr["Content"]); - ContentTypeId = Null.SetNullInteger(dr["ContentTypeID"]); - TabID = Null.SetNullInteger(dr["TabID"]); - ModuleID = Null.SetNullInteger(dr["ModuleID"]); - ContentKey = Null.SetNullString(dr["ContentKey"]); - Indexed = Null.SetNullBoolean(dr["Indexed"]); + this.ContentItemId = Null.SetNullInteger(dr["ContentItemID"]); + this.Content = Null.SetNullString(dr["Content"]); + this.ContentTypeId = Null.SetNullInteger(dr["ContentTypeID"]); + this.TabID = Null.SetNullInteger(dr["TabID"]); + this.ModuleID = Null.SetNullInteger(dr["ModuleID"]); + this.ContentKey = Null.SetNullString(dr["ContentKey"]); + this.Indexed = Null.SetNullBoolean(dr["Indexed"]); var schema = dr.GetSchemaTable(); if (schema != null) { if (schema.Select("ColumnName = 'StateID'").Length > 0) { - StateID = Null.SetNullInteger(dr["StateID"]); + this.StateID = Null.SetNullInteger(dr["StateID"]); } } } protected void Clone(ContentItem cloneItem, ContentItem originalItem) { - CloneBaseProperties(cloneItem, originalItem); + this.CloneBaseProperties(cloneItem, originalItem); cloneItem.ContentItemId = originalItem.ContentItemId; cloneItem.Content = originalItem.Content; @@ -290,7 +290,7 @@ protected void Clone(ContentItem cloneItem, ContentItem originalItem) /// public virtual void Fill(IDataReader dr) { - FillInternal(dr); + this.FillInternal(dr); } /// @@ -307,11 +307,11 @@ public virtual int KeyID { get { - return ContentItemId; + return this.ContentItemId; } set { - ContentItemId = value; + this.ContentItemId = value; } } diff --git a/DNN Platform/Library/Entities/Content/ContentType.cs b/DNN Platform/Library/Entities/Content/ContentType.cs index 8c11c9b31c6..ca05f42ad4c 100644 --- a/DNN Platform/Library/Entities/Content/ContentType.cs +++ b/DNN Platform/Library/Entities/Content/ContentType.cs @@ -46,8 +46,8 @@ public ContentType() : this(Null.NullString) public ContentType(string contentType) { - ContentTypeId = Null.NullInteger; - ContentType = contentType; + this.ContentTypeId = Null.NullInteger; + this.ContentType = contentType; } #endregion @@ -97,8 +97,8 @@ public static ContentType Tab /// public void Fill(IDataReader dr) { - ContentTypeId = Null.SetNullInteger(dr["ContentTypeID"]); - ContentType = Null.SetNullString(dr["ContentType"]); + this.ContentTypeId = Null.SetNullInteger(dr["ContentTypeID"]); + this.ContentType = Null.SetNullString(dr["ContentType"]); } /// @@ -111,11 +111,11 @@ public int KeyID { get { - return ContentTypeId; + return this.ContentTypeId; } set { - ContentTypeId = value; + this.ContentTypeId = value; } } @@ -129,7 +129,7 @@ public int KeyID /// public override string ToString() { - return ContentType; + return this.ContentType; } } } diff --git a/DNN Platform/Library/Entities/Content/ContentTypeController.cs b/DNN Platform/Library/Entities/Content/ContentTypeController.cs index e8394b5a1cc..8c52658ba14 100644 --- a/DNN Platform/Library/Entities/Content/ContentTypeController.cs +++ b/DNN Platform/Library/Entities/Content/ContentTypeController.cs @@ -46,7 +46,7 @@ public ContentTypeController() : this(Util.GetDataService()) public ContentTypeController(IDataService dataService) { - _DataService = dataService; + this._DataService = dataService; } #endregion @@ -66,10 +66,10 @@ public int AddContentType(ContentType contentType) Requires.NotNull("contentType", contentType); Requires.PropertyNotNullOrEmpty("contentType", "ContentType", contentType.ContentType); - contentType.ContentTypeId = _DataService.AddContentType(contentType); + contentType.ContentTypeId = this._DataService.AddContentType(contentType); //Refresh cached collection of types - ClearContentTypeCache(); + this.ClearContentTypeCache(); return contentType.ContentTypeId; } @@ -94,10 +94,10 @@ public void DeleteContentType(ContentType contentType) Requires.NotNull("contentType", contentType); Requires.PropertyNotNegative("contentType", "ContentTypeId", contentType.ContentTypeId); - _DataService.DeleteContentType(contentType); + this._DataService.DeleteContentType(contentType); //Refresh cached collection of types - ClearContentTypeCache(); + this.ClearContentTypeCache(); } /// @@ -109,7 +109,7 @@ public IQueryable GetContentTypes() return CBO.GetCachedObject>(new CacheItemArgs(DataCache.ContentTypesCacheKey, DataCache.ContentTypesCacheTimeOut, DataCache.ContentTypesCachePriority), - c => CBO.FillQueryable(_DataService.GetContentTypes()).ToList()).AsQueryable(); + c => CBO.FillQueryable(this._DataService.GetContentTypes()).ToList()).AsQueryable(); } /// @@ -126,10 +126,10 @@ public void UpdateContentType(ContentType contentType) Requires.PropertyNotNegative("contentType", "ContentTypeId", contentType.ContentTypeId); Requires.PropertyNotNullOrEmpty("contentType", "ContentType", contentType.ContentType); - _DataService.UpdateContentType(contentType); + this._DataService.UpdateContentType(contentType); //Refresh cached collection of types - ClearContentTypeCache(); + this.ClearContentTypeCache(); } #endregion diff --git a/DNN Platform/Library/Entities/Content/Data/DataService.cs b/DNN Platform/Library/Entities/Content/Data/DataService.cs index c3b7d6dac49..5ed84d01358 100644 --- a/DNN Platform/Library/Entities/Content/Data/DataService.cs +++ b/DNN Platform/Library/Entities/Content/Data/DataService.cs @@ -50,7 +50,7 @@ public class DataService : IDataService /// content item id. public int AddContentItem(ContentItem contentItem, int createdByUserId) { - return _provider.ExecuteScalar("AddContentItem", + return this._provider.ExecuteScalar("AddContentItem", contentItem.Content, contentItem.ContentTypeId, contentItem.TabID, @@ -58,7 +58,7 @@ public int AddContentItem(ContentItem contentItem, int createdByUserId) contentItem.ContentKey, contentItem.Indexed, createdByUserId, - _provider.GetNull(contentItem.StateID)); + this._provider.GetNull(contentItem.StateID)); } /// @@ -67,7 +67,7 @@ public int AddContentItem(ContentItem contentItem, int createdByUserId) /// The content item ID. public void DeleteContentItem(int contentItemId) { - _provider.ExecuteNonQuery("DeleteContentItem", contentItemId); + this._provider.ExecuteNonQuery("DeleteContentItem", contentItemId); } /// @@ -77,7 +77,7 @@ public void DeleteContentItem(int contentItemId) /// data reader. public IDataReader GetContentItem(int contentItemId) { - return _provider.ExecuteReader("GetContentItem", contentItemId); + return this._provider.ExecuteReader("GetContentItem", contentItemId); } /// @@ -89,9 +89,9 @@ public IDataReader GetContentItem(int contentItemId) /// data reader. public IDataReader GetContentItems(int contentTypeId, int tabId, int moduleId) { - return _provider.ExecuteReader("GetContentItems", _provider.GetNull(contentTypeId), - _provider.GetNull(tabId), - _provider.GetNull(moduleId)); + return this._provider.ExecuteReader("GetContentItems", this._provider.GetNull(contentTypeId), + this._provider.GetNull(tabId), + this._provider.GetNull(moduleId)); } /// @@ -101,7 +101,7 @@ public IDataReader GetContentItems(int contentTypeId, int tabId, int moduleId) /// data reader. public IDataReader GetContentItemsByTerm(string term) { - return _provider.ExecuteReader("GetContentItemsByTerm", term); + return this._provider.ExecuteReader("GetContentItemsByTerm", term); } /// @@ -110,7 +110,7 @@ public IDataReader GetContentItemsByTerm(string term) /// The type of content items you are searching for public IDataReader GetContentItemsByContentType(int contentTypeId) { - return _provider.ExecuteReader("GetContentItemsByContentType", contentTypeId); + return this._provider.ExecuteReader("GetContentItemsByContentType", contentTypeId); } /// @@ -119,7 +119,7 @@ public IDataReader GetContentItemsByContentType(int contentTypeId) /// The TabID (or "Page ID") that the content items are associated with public IDataReader GetContentItemsByTabId(int tabId) { - return _provider.ExecuteReader("GetContentItemsByTabId", tabId); + return this._provider.ExecuteReader("GetContentItemsByTabId", tabId); } /// @@ -127,7 +127,7 @@ public IDataReader GetContentItemsByTabId(int tabId) /// public IDataReader GetContentItemsByModuleId(int moduleId) { - return _provider.ExecuteReader("GetContentItemsByModuleId", moduleId); + return this._provider.ExecuteReader("GetContentItemsByModuleId", moduleId); } /// @@ -135,7 +135,7 @@ public IDataReader GetContentItemsByModuleId(int moduleId) /// public IDataReader GetContentItemsByVocabularyId(int vocabularyId) { - return _provider.ExecuteReader("GetContentItemsByVocabularyId", vocabularyId); + return this._provider.ExecuteReader("GetContentItemsByVocabularyId", vocabularyId); } /// @@ -144,7 +144,7 @@ public IDataReader GetContentItemsByVocabularyId(int vocabularyId) /// data reader. public IDataReader GetUnIndexedContentItems() { - return _provider.ExecuteReader("GetUnIndexedContentItems"); + return this._provider.ExecuteReader("GetUnIndexedContentItems"); } /// @@ -154,7 +154,7 @@ public IDataReader GetUnIndexedContentItems() /// The created by user id. public void UpdateContentItem(ContentItem contentItem, int createdByUserId) { - _provider.ExecuteNonQuery("UpdateContentItem", + this._provider.ExecuteNonQuery("UpdateContentItem", contentItem.ContentItemId, contentItem.Content, contentItem.ContentTypeId, @@ -163,7 +163,7 @@ public void UpdateContentItem(ContentItem contentItem, int createdByUserId) contentItem.ContentKey, contentItem.Indexed, createdByUserId, - _provider.GetNull(contentItem.StateID)); + this._provider.GetNull(contentItem.StateID)); } #endregion @@ -178,7 +178,7 @@ public void UpdateContentItem(ContentItem contentItem, int createdByUserId) /// The value. public void AddMetaData(ContentItem contentItem, string name, string value) { - _provider.ExecuteNonQuery("AddMetaData", contentItem.ContentItemId, name, value); + this._provider.ExecuteNonQuery("AddMetaData", contentItem.ContentItemId, name, value); } public void SynchronizeMetaData(ContentItem contentItem, IEnumerable> added, IEnumerable> deleted) @@ -214,12 +214,12 @@ public void SynchronizeMetaData(ContentItem contentItem, IEnumerableThe value. public void DeleteMetaData(ContentItem contentItem, string name, string value) { - _provider.ExecuteNonQuery("DeleteMetaData", contentItem.ContentItemId, name, value); + this._provider.ExecuteNonQuery("DeleteMetaData", contentItem.ContentItemId, name, value); } /// @@ -242,7 +242,7 @@ public void DeleteMetaData(ContentItem contentItem, string name, string value) /// data reader. public IDataReader GetMetaData(int contentItemId) { - return _provider.ExecuteReader("GetMetaData", contentItemId); + return this._provider.ExecuteReader("GetMetaData", contentItemId); } #endregion @@ -256,12 +256,12 @@ public IDataReader GetMetaData(int contentItemId) /// content type id. public int AddContentType(ContentType contentType) { - return _provider.ExecuteScalar("AddContentType", contentType.ContentType); + return this._provider.ExecuteScalar("AddContentType", contentType.ContentType); } public void DeleteContentType(ContentType contentType) { - _provider.ExecuteNonQuery("DeleteContentType", contentType.ContentTypeId); + this._provider.ExecuteNonQuery("DeleteContentType", contentType.ContentTypeId); } /// @@ -270,7 +270,7 @@ public void DeleteContentType(ContentType contentType) /// data reader. public IDataReader GetContentTypes() { - return _provider.ExecuteReader("GetContentTypes"); + return this._provider.ExecuteReader("GetContentTypes"); } /// @@ -279,7 +279,7 @@ public IDataReader GetContentTypes() /// Type of the content. public void UpdateContentType(ContentType contentType) { - _provider.ExecuteNonQuery("UpdateContentType", contentType.ContentTypeId, contentType.ContentType); + this._provider.ExecuteNonQuery("UpdateContentType", contentType.ContentTypeId, contentType.ContentType); } #endregion @@ -293,7 +293,7 @@ public void UpdateContentType(ContentType contentType) /// scope type id. public int AddScopeType(ScopeType scopeType) { - return _provider.ExecuteScalar("AddScopeType", scopeType.ScopeType); + return this._provider.ExecuteScalar("AddScopeType", scopeType.ScopeType); } /// @@ -302,7 +302,7 @@ public int AddScopeType(ScopeType scopeType) /// Type of the scope. public void DeleteScopeType(ScopeType scopeType) { - _provider.ExecuteNonQuery("DeleteScopeType", scopeType.ScopeTypeId); + this._provider.ExecuteNonQuery("DeleteScopeType", scopeType.ScopeTypeId); } /// @@ -311,7 +311,7 @@ public void DeleteScopeType(ScopeType scopeType) /// data reader. public IDataReader GetScopeTypes() { - return _provider.ExecuteReader("GetScopeTypes"); + return this._provider.ExecuteReader("GetScopeTypes"); } /// @@ -320,7 +320,7 @@ public IDataReader GetScopeTypes() /// Type of the scope. public void UpdateScopeType(ScopeType scopeType) { - _provider.ExecuteNonQuery("UpdateScopeType", scopeType.ScopeTypeId, scopeType.ScopeType); + this._provider.ExecuteNonQuery("UpdateScopeType", scopeType.ScopeTypeId, scopeType.ScopeType); } #endregion @@ -335,7 +335,7 @@ public void UpdateScopeType(ScopeType scopeType) /// term id. public int AddHeirarchicalTerm(Term term, int createdByUserId) { - return _provider.ExecuteScalar("AddHeirarchicalTerm", term.VocabularyId, term.ParentTermId, term.Name, term.Description, term.Weight, createdByUserId); + return this._provider.ExecuteScalar("AddHeirarchicalTerm", term.VocabularyId, term.ParentTermId, term.Name, term.Description, term.Weight, createdByUserId); } /// @@ -346,12 +346,12 @@ public int AddHeirarchicalTerm(Term term, int createdByUserId) /// term id. public int AddSimpleTerm(Term term, int createdByUserId) { - return _provider.ExecuteScalar("AddSimpleTerm", term.VocabularyId, term.Name, term.Description, term.Weight, createdByUserId); + return this._provider.ExecuteScalar("AddSimpleTerm", term.VocabularyId, term.Name, term.Description, term.Weight, createdByUserId); } public void AddTermToContent(Term term, ContentItem contentItem) { - _provider.ExecuteNonQuery("AddTermToContent", term.TermId, contentItem.ContentItemId); + this._provider.ExecuteNonQuery("AddTermToContent", term.TermId, contentItem.ContentItemId); } /// @@ -360,7 +360,7 @@ public void AddTermToContent(Term term, ContentItem contentItem) /// The term. public void DeleteSimpleTerm(Term term) { - _provider.ExecuteNonQuery("DeleteSimpleTerm", term.TermId); + this._provider.ExecuteNonQuery("DeleteSimpleTerm", term.TermId); } /// @@ -369,7 +369,7 @@ public void DeleteSimpleTerm(Term term) /// The term. public void DeleteHeirarchicalTerm(Term term) { - _provider.ExecuteNonQuery("DeleteHeirarchicalTerm", term.TermId); + this._provider.ExecuteNonQuery("DeleteHeirarchicalTerm", term.TermId); } /// @@ -379,7 +379,7 @@ public void DeleteHeirarchicalTerm(Term term) /// data reader. public IDataReader GetTerm(int termId) { - return _provider.ExecuteReader("GetTerm", termId); + return this._provider.ExecuteReader("GetTerm", termId); } /// @@ -387,7 +387,7 @@ public IDataReader GetTerm(int termId) /// public IDataReader GetTermUsage(int termId) { - return _provider.ExecuteReader("GetTermUsage", termId); + return this._provider.ExecuteReader("GetTermUsage", termId); } /// @@ -397,7 +397,7 @@ public IDataReader GetTermUsage(int termId) /// data reader. public IDataReader GetTermsByContent(int contentItemId) { - return _provider.ExecuteReader("GetTermsByContent", contentItemId); + return this._provider.ExecuteReader("GetTermsByContent", contentItemId); } /// @@ -407,7 +407,7 @@ public IDataReader GetTermsByContent(int contentItemId) /// data reader. public IDataReader GetTermsByVocabulary(int vocabularyId) { - return _provider.ExecuteReader("GetTermsByVocabulary", vocabularyId); + return this._provider.ExecuteReader("GetTermsByVocabulary", vocabularyId); } /// @@ -416,7 +416,7 @@ public IDataReader GetTermsByVocabulary(int vocabularyId) /// The content item. public void RemoveTermsFromContent(ContentItem contentItem) { - _provider.ExecuteNonQuery("RemoveTermsFromContent", contentItem.ContentItemId); + this._provider.ExecuteNonQuery("RemoveTermsFromContent", contentItem.ContentItemId); } /// @@ -426,7 +426,7 @@ public void RemoveTermsFromContent(ContentItem contentItem) /// The last modified by user id. public void UpdateHeirarchicalTerm(Term term, int lastModifiedByUserId) { - _provider.ExecuteNonQuery("UpdateHeirarchicalTerm", term.TermId, term.VocabularyId, term.ParentTermId, term.Name, term.Description, term.Weight, lastModifiedByUserId); + this._provider.ExecuteNonQuery("UpdateHeirarchicalTerm", term.TermId, term.VocabularyId, term.ParentTermId, term.Name, term.Description, term.Weight, lastModifiedByUserId); } /// @@ -436,7 +436,7 @@ public void UpdateHeirarchicalTerm(Term term, int lastModifiedByUserId) /// The last modified by user id. public void UpdateSimpleTerm(Term term, int lastModifiedByUserId) { - _provider.ExecuteNonQuery("UpdateSimpleTerm", term.TermId, term.VocabularyId, term.Name, term.Description, term.Weight, lastModifiedByUserId); + this._provider.ExecuteNonQuery("UpdateSimpleTerm", term.TermId, term.VocabularyId, term.Name, term.Description, term.Weight, lastModifiedByUserId); } #endregion @@ -451,12 +451,12 @@ public void UpdateSimpleTerm(Term term, int lastModifiedByUserId) /// Vocabulary id. public int AddVocabulary(Vocabulary vocabulary, int createdByUserId) { - return _provider.ExecuteScalar("AddVocabulary", + return this._provider.ExecuteScalar("AddVocabulary", vocabulary.Type, vocabulary.Name, vocabulary.Description, vocabulary.Weight, - _provider.GetNull(vocabulary.ScopeId), + this._provider.GetNull(vocabulary.ScopeId), vocabulary.ScopeTypeId, createdByUserId); } @@ -467,7 +467,7 @@ public int AddVocabulary(Vocabulary vocabulary, int createdByUserId) /// The vocabulary. public void DeleteVocabulary(Vocabulary vocabulary) { - _provider.ExecuteNonQuery("DeleteVocabulary", vocabulary.VocabularyId); + this._provider.ExecuteNonQuery("DeleteVocabulary", vocabulary.VocabularyId); } /// @@ -476,7 +476,7 @@ public void DeleteVocabulary(Vocabulary vocabulary) /// data reader. public IDataReader GetVocabularies() { - return _provider.ExecuteReader("GetVocabularies"); + return this._provider.ExecuteReader("GetVocabularies"); } /// @@ -486,7 +486,7 @@ public IDataReader GetVocabularies() /// The last modified by user id. public void UpdateVocabulary(Vocabulary vocabulary, int lastModifiedByUserId) { - _provider.ExecuteNonQuery("UpdateVocabulary", + this._provider.ExecuteNonQuery("UpdateVocabulary", vocabulary.VocabularyId, vocabulary.Type, vocabulary.Name, diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/ScopeType.cs b/DNN Platform/Library/Entities/Content/Taxonomy/ScopeType.cs index 0c9531dbc68..fd56c389f84 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/ScopeType.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/ScopeType.cs @@ -38,33 +38,33 @@ public ScopeType() : this(Null.NullString) public ScopeType(string scopeType) { - ScopeTypeId = Null.NullInteger; - ScopeType = scopeType; + this.ScopeTypeId = Null.NullInteger; + this.ScopeType = scopeType; } public int ScopeTypeId { get; set; } public void Fill(IDataReader dr) { - ScopeTypeId = Null.SetNullInteger(dr["ScopeTypeID"]); - ScopeType = Null.SetNullString(dr["ScopeType"]); + this.ScopeTypeId = Null.SetNullInteger(dr["ScopeTypeID"]); + this.ScopeType = Null.SetNullString(dr["ScopeType"]); } public int KeyID { get { - return ScopeTypeId; + return this.ScopeTypeId; } set { - ScopeTypeId = value; + this.ScopeTypeId = value; } } public override string ToString() { - return ScopeType; + return this.ScopeType; } } } diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/ScopeTypeController.cs b/DNN Platform/Library/Entities/Content/Taxonomy/ScopeTypeController.cs index f5af55d4f14..a1868974a03 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/ScopeTypeController.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/ScopeTypeController.cs @@ -33,7 +33,7 @@ public ScopeTypeController() : this(Util.GetDataService()) public ScopeTypeController(IDataService dataService) { - _DataService = dataService; + this._DataService = dataService; } #endregion @@ -42,7 +42,7 @@ public ScopeTypeController(IDataService dataService) private object GetScopeTypesCallBack(CacheItemArgs cacheItemArgs) { - return CBO.FillQueryable(_DataService.GetScopeTypes()).ToList(); + return CBO.FillQueryable(this._DataService.GetScopeTypes()).ToList(); } #endregion @@ -55,7 +55,7 @@ public int AddScopeType(ScopeType scopeType) Requires.NotNull("scopeType", scopeType); Requires.PropertyNotNullOrEmpty("scopeType", "ScopeType", scopeType.ScopeType); - scopeType.ScopeTypeId = _DataService.AddScopeType(scopeType); + scopeType.ScopeTypeId = this._DataService.AddScopeType(scopeType); //Refresh cached collection of types DataCache.RemoveCache(DataCache.ScopeTypesCacheKey); @@ -74,7 +74,7 @@ public void DeleteScopeType(ScopeType scopeType) Requires.NotNull("scopeType", scopeType); Requires.PropertyNotNegative("scopeType", "ScopeTypeId", scopeType.ScopeTypeId); - _DataService.DeleteScopeType(scopeType); + this._DataService.DeleteScopeType(scopeType); //Refresh cached collection of types DataCache.RemoveCache(DataCache.ScopeTypesCacheKey); @@ -82,7 +82,7 @@ public void DeleteScopeType(ScopeType scopeType) public IQueryable GetScopeTypes() { - return CBO.GetCachedObject>(new CacheItemArgs(DataCache.ScopeTypesCacheKey, _CacheTimeOut), GetScopeTypesCallBack).AsQueryable(); + return CBO.GetCachedObject>(new CacheItemArgs(DataCache.ScopeTypesCacheKey, _CacheTimeOut), this.GetScopeTypesCallBack).AsQueryable(); } public void UpdateScopeType(ScopeType scopeType) @@ -92,7 +92,7 @@ public void UpdateScopeType(ScopeType scopeType) Requires.PropertyNotNegative("scopeType", "ScopeTypeId", scopeType.ScopeTypeId); Requires.PropertyNotNullOrEmpty("scopeType", "ScopeType", scopeType.ScopeType); - _DataService.UpdateScopeType(scopeType); + this._DataService.UpdateScopeType(scopeType); //Refresh cached collection of types DataCache.RemoveCache(DataCache.ScopeTypesCacheKey); diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/Term.cs b/DNN Platform/Library/Entities/Content/Taxonomy/Term.cs index 5ece24c2b07..ad5f8cf8f62 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/Term.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/Term.cs @@ -87,15 +87,15 @@ public Term(string name, string description) : this(name, description, Null.Null public Term(string name, string description, int vocabularyId) { - Description = description; - Name = name; - _vocabularyId = vocabularyId; - - ParentTermId = null; - TermId = Null.NullInteger; - _left = 0; - _right = 0; - Weight = 0; + this.Description = description; + this.Name = name; + this._vocabularyId = vocabularyId; + + this.ParentTermId = null; + this.TermId = Null.NullInteger; + this._left = 0; + this._right = 0; + this.Weight = 0; } #endregion @@ -108,11 +108,11 @@ public List ChildTerms { get { - if (_childTerms == null) + if (this._childTerms == null) { - _childTerms = this.GetChildTerms(_termId, _vocabularyId); + this._childTerms = this.GetChildTerms(this._termId, this._vocabularyId); } - return _childTerms; + return this._childTerms; } } @@ -122,11 +122,11 @@ public string Description { get { - return _description; + return this._description; } set { - _description = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); + this._description = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); } } @@ -136,7 +136,7 @@ public bool IsHeirarchical { get { - return (Vocabulary.Type == VocabularyType.Hierarchy); + return (this.Vocabulary.Type == VocabularyType.Hierarchy); } } @@ -146,7 +146,7 @@ public int Left { get { - return _left; + return this._left; } } @@ -156,7 +156,7 @@ public string Name { get { - return _name; + return this._name; } set { @@ -164,7 +164,7 @@ public string Name value = System.Net.WebUtility.UrlDecode(value); if (HtmlUtils.ContainsEntity(value)) value = System.Net.WebUtility.HtmlDecode(value); - _name = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); + this._name = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); } } @@ -174,11 +174,11 @@ public int? ParentTermId { get { - return _parentTermId; + return this._parentTermId; } set { - _parentTermId = value; + this._parentTermId = value; } } @@ -188,7 +188,7 @@ public int Right { get { - return _right; + return this._right; } } @@ -198,7 +198,7 @@ public List Synonyms { get { - return _synonyms; + return this._synonyms; } } @@ -208,11 +208,11 @@ public int TermId { get { - return _termId; + return this._termId; } set { - _termId = value; + this._termId = value; } } @@ -222,11 +222,11 @@ public Vocabulary Vocabulary { get { - if (_vocabulary == null && _vocabularyId > Null.NullInteger) + if (this._vocabulary == null && this._vocabularyId > Null.NullInteger) { - _vocabulary = this.GetVocabulary(_vocabularyId); + this._vocabulary = this.GetVocabulary(this._vocabularyId); } - return _vocabulary; + return this._vocabulary; } } @@ -236,7 +236,7 @@ public int VocabularyId { get { - return _vocabularyId; + return this._vocabularyId; } } @@ -246,11 +246,11 @@ public int Weight { get { - return _weight; + return this._weight; } set { - _weight = value; + this._weight = value; } } @@ -260,38 +260,38 @@ public int Weight public virtual void Fill(IDataReader dr) { - TermId = Null.SetNullInteger(dr["TermID"]); - Name = Null.SetNullString(dr["Name"]); - Description = Null.SetNullString(dr["Description"]); - Weight = Null.SetNullInteger(dr["Weight"]); - _vocabularyId = Null.SetNullInteger(dr["VocabularyID"]); + this.TermId = Null.SetNullInteger(dr["TermID"]); + this.Name = Null.SetNullString(dr["Name"]); + this.Description = Null.SetNullString(dr["Description"]); + this.Weight = Null.SetNullInteger(dr["Weight"]); + this._vocabularyId = Null.SetNullInteger(dr["VocabularyID"]); if (dr["TermLeft"] != DBNull.Value) { - _left = Convert.ToInt32(dr["TermLeft"]); + this._left = Convert.ToInt32(dr["TermLeft"]); } if (dr["TermRight"] != DBNull.Value) { - _right = Convert.ToInt32(dr["TermRight"]); + this._right = Convert.ToInt32(dr["TermRight"]); } if (dr["ParentTermID"] != DBNull.Value) { - ParentTermId = Convert.ToInt32(dr["ParentTermID"]); + this.ParentTermId = Convert.ToInt32(dr["ParentTermID"]); } //Fill base class properties - FillInternal(dr); + this.FillInternal(dr); } public int KeyID { get { - return TermId; + return this.TermId; } set { - TermId = value; + this.TermId = value; } } @@ -299,13 +299,13 @@ public int KeyID public string GetTermPath() { - string path = "\\\\" + Name; + string path = "\\\\" + this.Name; - if (ParentTermId.HasValue) + if (this.ParentTermId.HasValue) { ITermController ctl = Util.GetTermController(); - Term parentTerm = (from t in ctl.GetTermsByVocabulary(VocabularyId) where t.TermId == ParentTermId select t).SingleOrDefault(); + Term parentTerm = (from t in ctl.GetTermsByVocabulary(this.VocabularyId) where t.TermId == this.ParentTermId select t).SingleOrDefault(); if (parentTerm != null) { diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/TermController.cs b/DNN Platform/Library/Entities/Content/Taxonomy/TermController.cs index 1d7144e7b0f..4353c6222ed 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/TermController.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/TermController.cs @@ -46,7 +46,7 @@ public TermController() : this(Util.GetDataService()) public TermController(IDataService dataService) { - _DataService = dataService; + this._DataService = dataService; } #endregion @@ -56,7 +56,7 @@ public TermController(IDataService dataService) private object GetTermsCallBack(CacheItemArgs cacheItemArgs) { var vocabularyId = (int) cacheItemArgs.ParamList[0]; - return CBO.FillQueryable(_DataService.GetTermsByVocabulary(vocabularyId)).ToList(); + return CBO.FillQueryable(this._DataService.GetTermsByVocabulary(vocabularyId)).ToList(); } #endregion @@ -82,11 +82,11 @@ public int AddTerm(Term term) if ((term.IsHeirarchical)) { - term.TermId = _DataService.AddHeirarchicalTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); + term.TermId = this._DataService.AddHeirarchicalTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); } else { - term.TermId = _DataService.AddSimpleTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); + term.TermId = this._DataService.AddSimpleTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); } //Clear Cache @@ -108,7 +108,7 @@ public void AddTermToContent(Term term, ContentItem contentItem) Requires.NotNull("term", term); Requires.NotNull("contentItem", contentItem); - _DataService.AddTermToContent(term, contentItem); + this._DataService.AddTermToContent(term, contentItem); } /// @@ -125,11 +125,11 @@ public void DeleteTerm(Term term) if ((term.IsHeirarchical)) { - _DataService.DeleteHeirarchicalTerm(term); + this._DataService.DeleteHeirarchicalTerm(term); } else { - _DataService.DeleteSimpleTerm(term); + this._DataService.DeleteSimpleTerm(term); } //Clear Cache @@ -147,7 +147,7 @@ public Term GetTerm(int termId) //Argument Contract Requires.NotNegative("termId", termId); - return CBO.FillObject(_DataService.GetTerm(termId)); + return CBO.FillObject(this._DataService.GetTerm(termId)); } @@ -159,7 +159,7 @@ public TermUsage GetTermUsage(int termId) { Requires.NotNegative("termId", termId); - return CBO.FillObject(_DataService.GetTermUsage(termId)); + return CBO.FillObject(this._DataService.GetTermUsage(termId)); } /// @@ -173,7 +173,7 @@ public IQueryable GetTermsByContent(int contentItemId) //Argument Contract Requires.NotNegative("contentItemId", contentItemId); - return CBO.FillQueryable(_DataService.GetTermsByContent(contentItemId)); + return CBO.FillQueryable(this._DataService.GetTermsByContent(contentItemId)); } /// @@ -187,7 +187,7 @@ public IQueryable GetTermsByVocabulary(int vocabularyId) //Argument Contract Requires.NotNegative("vocabularyId", vocabularyId); - return CBO.GetCachedObject>(new CacheItemArgs(string.Format(DataCache.TermCacheKey, vocabularyId), _CacheTimeOut, _CachePriority, vocabularyId), GetTermsCallBack).AsQueryable(); + return CBO.GetCachedObject>(new CacheItemArgs(string.Format(DataCache.TermCacheKey, vocabularyId), _CacheTimeOut, _CachePriority, vocabularyId), this.GetTermsCallBack).AsQueryable(); } /// @@ -211,7 +211,7 @@ public IQueryable GetTermsByVocabulary(string vocabularyName) throw new ArgumentException("Vocabulary does not exist.", "vocabularyName"); } - return GetTermsByVocabulary(vocabulary.VocabularyId); + return this.GetTermsByVocabulary(vocabulary.VocabularyId); } /// @@ -224,7 +224,7 @@ public void RemoveTermsFromContent(ContentItem contentItem) //Argument Contract Requires.NotNull("contentItem", contentItem); - _DataService.RemoveTermsFromContent(contentItem); + this._DataService.RemoveTermsFromContent(contentItem); } /// @@ -245,11 +245,11 @@ public void UpdateTerm(Term term) if ((term.IsHeirarchical)) { - _DataService.UpdateHeirarchicalTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); + this._DataService.UpdateHeirarchicalTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); } else { - _DataService.UpdateSimpleTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); + this._DataService.UpdateSimpleTerm(term, UserController.Instance.GetCurrentUserInfo().UserID); } //Clear Cache diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/TermUsage.cs b/DNN Platform/Library/Entities/Content/Taxonomy/TermUsage.cs index cc079ca58df..0fcb02cef95 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/TermUsage.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/TermUsage.cs @@ -24,13 +24,13 @@ public TermUsage() internal TermUsage(int total, int month, int week, int day) { - TotalTermUsage = total; + this.TotalTermUsage = total; - MonthTermUsage = month; + this.MonthTermUsage = month; - WeekTermUsage = week; + this.WeekTermUsage = week; - DayTermUsage = day; + this.DayTermUsage = day; } } } diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/Vocabulary.cs b/DNN Platform/Library/Entities/Content/Taxonomy/Vocabulary.cs index deac63a89b2..93b04f11b96 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/Vocabulary.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/Vocabulary.cs @@ -58,14 +58,14 @@ public Vocabulary(VocabularyType type) : this(Null.NullString, Null.NullString, public Vocabulary(string name, string description, VocabularyType type) { - Description = description; - Name = name; - Type = type; + this.Description = description; + this.Name = name; + this.Type = type; - ScopeId = Null.NullInteger; - ScopeTypeId = Null.NullInteger; - VocabularyId = Null.NullInteger; - Weight = 0; + this.ScopeId = Null.NullInteger; + this.ScopeTypeId = Null.NullInteger; + this.VocabularyId = Null.NullInteger; + this.Weight = 0; } #endregion @@ -76,11 +76,11 @@ public string Description { get { - return _Description; + return this._Description; } set { - _Description = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); + this._Description = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); } } @@ -88,7 +88,7 @@ public bool IsHeirarchical { get { - return (Type == VocabularyType.Hierarchy); + return (this.Type == VocabularyType.Hierarchy); } } @@ -96,11 +96,11 @@ public bool IsSystem { get { - return _IsSystem; + return this._IsSystem; } set { - _IsSystem = value; + this._IsSystem = value; } } @@ -108,13 +108,13 @@ public string Name { get { - return _Name; + return this._Name; } set { if (HtmlUtils.ContainsEntity(value)) value = System.Net.WebUtility.HtmlDecode(value); - _Name = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); + this._Name = Security.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); } } @@ -122,11 +122,11 @@ public int ScopeId { get { - return _ScopeId; + return this._ScopeId; } set { - _ScopeId = value; + this._ScopeId = value; } } @@ -134,12 +134,12 @@ public ScopeType ScopeType { get { - if (_ScopeType == null) + if (this._ScopeType == null) { - _ScopeType = this.GetScopeType(_ScopeTypeId); + this._ScopeType = this.GetScopeType(this._ScopeTypeId); } - return _ScopeType; + return this._ScopeType; } } @@ -147,11 +147,11 @@ public int ScopeTypeId { get { - return _ScopeTypeId; + return this._ScopeTypeId; } set { - _ScopeTypeId = value; + this._ScopeTypeId = value; } } @@ -159,11 +159,11 @@ public List Terms { get { - if (_Terms == null) + if (this._Terms == null) { - _Terms = this.GetTerms(_VocabularyId); + this._Terms = this.GetTerms(this._VocabularyId); } - return _Terms; + return this._Terms; } } @@ -171,11 +171,11 @@ public VocabularyType Type { get { - return _Type; + return this._Type; } set { - _Type = value; + this._Type = value; } } @@ -183,11 +183,11 @@ public int VocabularyId { get { - return _VocabularyId; + return this._VocabularyId; } set { - _VocabularyId = value; + this._VocabularyId = value; } } @@ -195,11 +195,11 @@ public int Weight { get { - return _Weight; + return this._Weight; } set { - _Weight = value; + this._Weight = value; } } @@ -209,36 +209,36 @@ public int Weight public virtual void Fill(IDataReader dr) { - VocabularyId = Null.SetNullInteger(dr["VocabularyID"]); + this.VocabularyId = Null.SetNullInteger(dr["VocabularyID"]); switch (Convert.ToInt16(dr["VocabularyTypeID"])) { case 1: - Type = VocabularyType.Simple; + this.Type = VocabularyType.Simple; break; case 2: - Type = VocabularyType.Hierarchy; + this.Type = VocabularyType.Hierarchy; break; } - IsSystem = Null.SetNullBoolean(dr["IsSystem"]); - Name = Null.SetNullString(dr["Name"]); - Description = Null.SetNullString(dr["Description"]); - ScopeId = Null.SetNullInteger(dr["ScopeID"]); - ScopeTypeId = Null.SetNullInteger(dr["ScopeTypeID"]); - Weight = Null.SetNullInteger(dr["Weight"]); + this.IsSystem = Null.SetNullBoolean(dr["IsSystem"]); + this.Name = Null.SetNullString(dr["Name"]); + this.Description = Null.SetNullString(dr["Description"]); + this.ScopeId = Null.SetNullInteger(dr["ScopeID"]); + this.ScopeTypeId = Null.SetNullInteger(dr["ScopeTypeID"]); + this.Weight = Null.SetNullInteger(dr["Weight"]); //Fill base class properties - FillInternal(dr); + this.FillInternal(dr); } public virtual int KeyID { get { - return VocabularyId; + return this.VocabularyId; } set { - VocabularyId = value; + this.VocabularyId = value; } } diff --git a/DNN Platform/Library/Entities/Content/Taxonomy/VocabularyController.cs b/DNN Platform/Library/Entities/Content/Taxonomy/VocabularyController.cs index 2d87357eda7..4a857a5c572 100644 --- a/DNN Platform/Library/Entities/Content/Taxonomy/VocabularyController.cs +++ b/DNN Platform/Library/Entities/Content/Taxonomy/VocabularyController.cs @@ -34,7 +34,7 @@ public VocabularyController() : this(Util.GetDataService()) public VocabularyController(IDataService dataService) { - _DataService = dataService; + this._DataService = dataService; } #endregion @@ -43,7 +43,7 @@ public VocabularyController(IDataService dataService) private object GetVocabulariesCallBack(CacheItemArgs cacheItemArgs) { - return CBO.FillQueryable(_DataService.GetVocabularies()).ToList(); + return CBO.FillQueryable(this._DataService.GetVocabularies()).ToList(); } #endregion @@ -57,7 +57,7 @@ public int AddVocabulary(Vocabulary vocabulary) Requires.PropertyNotNullOrEmpty("vocabulary", "Name", vocabulary.Name); Requires.PropertyNotNegative("vocabulary", "ScopeTypeId", vocabulary.ScopeTypeId); - vocabulary.VocabularyId = _DataService.AddVocabulary(vocabulary, UserController.Instance.GetCurrentUserInfo().UserID); + vocabulary.VocabularyId = this._DataService.AddVocabulary(vocabulary, UserController.Instance.GetCurrentUserInfo().UserID); //Refresh Cache DataCache.RemoveCache(DataCache.VocabularyCacheKey); @@ -76,7 +76,7 @@ public void DeleteVocabulary(Vocabulary vocabulary) Requires.NotNull("vocabulary", vocabulary); Requires.PropertyNotNegative("vocabulary", "VocabularyId", vocabulary.VocabularyId); - _DataService.DeleteVocabulary(vocabulary); + this._DataService.DeleteVocabulary(vocabulary); //Refresh Cache DataCache.RemoveCache(DataCache.VocabularyCacheKey); @@ -84,7 +84,7 @@ public void DeleteVocabulary(Vocabulary vocabulary) public IQueryable GetVocabularies() { - return CBO.GetCachedObject>(new CacheItemArgs(DataCache.VocabularyCacheKey, _CacheTimeOut), GetVocabulariesCallBack).AsQueryable(); + return CBO.GetCachedObject>(new CacheItemArgs(DataCache.VocabularyCacheKey, _CacheTimeOut), this.GetVocabulariesCallBack).AsQueryable(); } public void UpdateVocabulary(Vocabulary vocabulary) @@ -97,7 +97,7 @@ public void UpdateVocabulary(Vocabulary vocabulary) //Refresh Cache DataCache.RemoveCache(DataCache.VocabularyCacheKey); - _DataService.UpdateVocabulary(vocabulary, UserController.Instance.GetCurrentUserInfo().UserID); + this._DataService.UpdateVocabulary(vocabulary, UserController.Instance.GetCurrentUserInfo().UserID); } #endregion diff --git a/DNN Platform/Library/Entities/Content/Workflow/Actions/WorkflowActionManager.cs b/DNN Platform/Library/Entities/Content/Workflow/Actions/WorkflowActionManager.cs index ed554fedb22..326b251307a 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/Actions/WorkflowActionManager.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/Actions/WorkflowActionManager.cs @@ -18,14 +18,14 @@ public class WorkflowActionManager : ServiceLocator diff --git a/DNN Platform/Library/Entities/Content/Workflow/Entities/Workflow.cs b/DNN Platform/Library/Entities/Content/Workflow/Entities/Workflow.cs index 99621f07a7a..8fe2730a0fb 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/Entities/Workflow.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/Entities/Workflow.cs @@ -66,7 +66,7 @@ public WorkflowState FirstState { get { - return States == null || !States.Any() ? null : States.OrderBy(s => s.Order).FirstOrDefault(); + return this.States == null || !this.States.Any() ? null : this.States.OrderBy(s => s.Order).FirstOrDefault(); } } @@ -78,7 +78,7 @@ public WorkflowState LastState { get { - return States == null || !States.Any() ? null : States.OrderBy(s => s.Order).LastOrDefault(); + return this.States == null || !this.States.Any() ? null : this.States.OrderBy(s => s.Order).LastOrDefault(); } } } diff --git a/DNN Platform/Library/Entities/Content/Workflow/Obsolete/ContentWorkflowController.cs b/DNN Platform/Library/Entities/Content/Workflow/Obsolete/ContentWorkflowController.cs index c09528eb448..9e8f220318c 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/Obsolete/ContentWorkflowController.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/Obsolete/ContentWorkflowController.cs @@ -30,7 +30,7 @@ public class ContentWorkflowController : ComponentBase GetWorkflows(int portalID) [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowManager. Scheduled removal in v10.0.0.")] public ContentWorkflow GetWorkflow(ContentItem item) { - var state = GetWorkflowStateByID(item.StateID); + var state = this.GetWorkflowStateByID(item.StateID); if (state == null) return null; - return GetWorkflowByID(state.WorkflowID); + return this.GetWorkflowByID(state.WorkflowID); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowManager. Scheduled removal in v10.0.0.")] @@ -322,7 +322,7 @@ public ContentWorkflow GetWorkflowByID(int workflowID) var workflow = CBO.FillObject(DataProvider.Instance().GetContentWorkflow(workflowID)); if (workflow != null) { - workflow.States = GetWorkflowStates(workflowID); + workflow.States = this.GetWorkflowStates(workflowID); return workflow; } return null; @@ -333,7 +333,7 @@ public ContentWorkflow GetWorkflowByID(int workflowID) [Obsolete("Deprecated in Platform 7.4.0. Use instead ISystemWorkflowManager. Scheduled removal in v10.0.0.")] public void CreateDefaultWorkflows(int portalId) { - if (GetWorkflows(portalId).Any(w => w.WorkflowName == Localization.GetString("DefaultWorkflowName"))) + if (this.GetWorkflows(portalId).Any(w => w.WorkflowName == Localization.GetString("DefaultWorkflowName"))) { return; } @@ -418,19 +418,19 @@ public void CreateDefaultWorkflows(int portalId) } }; - AddWorkflow(worflow); + this.AddWorkflow(worflow); foreach (var state in worflow.States) { state.WorkflowID = worflow.WorkflowID; - AddWorkflowState(state); + this.AddWorkflowState(state); } } [Obsolete("Deprecated in Platform 7.4.0. Use instead ISystemWorkflowManager. Scheduled removal in v10.0.0.")] public ContentWorkflow GetDefaultWorkflow(int portalID) { - var wf = GetWorkflows(portalID).First(); // We assume there is only 1 Workflow. This needs to be changed for other scenarios - wf.States = GetWorkflowStates(wf.WorkflowID); + var wf = this.GetWorkflows(portalID).First(); // We assume there is only 1 Workflow. This needs to be changed for other scenarios + wf.States = this.GetWorkflowStates(wf.WorkflowID); return wf; } #endregion @@ -439,47 +439,47 @@ public ContentWorkflow GetDefaultWorkflow(int portalID) [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowSecurity. Scheduled removal in v10.0.0.")] public bool IsAnyReviewer(int workflowID) { - var workflow = GetWorkflowByID(workflowID); - return workflow.States.Any(contentWorkflowState => IsReviewer(contentWorkflowState.StateID)); + var workflow = this.GetWorkflowByID(workflowID); + return workflow.States.Any(contentWorkflowState => this.IsReviewer(contentWorkflowState.StateID)); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowSecurity. Scheduled removal in v10.0.0.")] public bool IsAnyReviewer(int portalID, int userID, int workflowID) { - var workflow = GetWorkflowByID(workflowID); - return workflow.States.Any(contentWorkflowState => IsReviewer(portalID, userID, contentWorkflowState.StateID)); + var workflow = this.GetWorkflowByID(workflowID); + return workflow.States.Any(contentWorkflowState => this.IsReviewer(portalID, userID, contentWorkflowState.StateID)); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowSecurity. Scheduled removal in v10.0.0.")] public bool IsReviewer(int stateID) { - var permissions = GetWorkflowStatePermissionByState(stateID); + var permissions = this.GetWorkflowStatePermissionByState(stateID); var user = UserController.Instance.GetCurrentUserInfo(); - return IsReviewer(user, PortalSettings.Current, permissions); + return this.IsReviewer(user, PortalSettings.Current, permissions); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowSecurity. Scheduled removal in v10.0.0.")] public bool IsReviewer(int portalID, int userID, int stateID) { - var permissions = GetWorkflowStatePermissionByState(stateID); + var permissions = this.GetWorkflowStatePermissionByState(stateID); var user = UserController.GetUserById(portalID, userID); var portalSettings = new PortalSettings(portalID); - return IsReviewer(user, portalSettings, permissions); + return this.IsReviewer(user, portalSettings, permissions); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowSecurity. Scheduled removal in v10.0.0.")] public bool IsCurrentReviewer(int portalID, int userID, int itemID) { - var item = contentController.GetContentItem(itemID); - return IsReviewer(portalID, userID, item.StateID); + var item = this.contentController.GetContentItem(itemID); + return this.IsReviewer(portalID, userID, item.StateID); } [Obsolete("Deprecated in Platform 7.4.0. Use instead IWorkflowSecurity. Scheduled removal in v10.0.0.")] public bool IsCurrentReviewer(int itemID) { - var item = contentController.GetContentItem(itemID); - return IsReviewer(item.StateID); + var item = this.contentController.GetContentItem(itemID); + return this.IsReviewer(item.StateID); } #endregion @@ -494,9 +494,9 @@ public ContentWorkflowSource GetWorkflowSource(int workflowId, string sourceName public void SendWorkflowNotification(bool sendEmail, bool sendMessage, PortalSettings settings, IEnumerable roles, IEnumerable users, string subject, string body, string comment, int userID) { - var replacedSubject = ReplaceNotificationTokens(subject, null, null, null, settings.PortalId, userID); - var replacedBody = ReplaceNotificationTokens(body, null, null, null, settings.PortalId, userID); - SendNotification(sendEmail, sendMessage, settings, roles, users, replacedSubject, replacedBody, comment, userID, null, null); + var replacedSubject = this.ReplaceNotificationTokens(subject, null, null, null, settings.PortalId, userID); + var replacedBody = this.ReplaceNotificationTokens(body, null, null, null, settings.PortalId, userID); + this.SendNotification(sendEmail, sendMessage, settings, roles, users, replacedSubject, replacedBody, comment, userID, null, null); } #endregion #endregion @@ -504,38 +504,38 @@ public void SendWorkflowNotification(bool sendEmail, bool sendMessage, PortalSet #region Private Methods private void AddWorkflowCommentLog(ContentItem item, string userComment, int userID) { - var workflow = GetWorkflow(item); + var workflow = this.GetWorkflow(item); - var logComment = ReplaceNotificationTokens(GetWorkflowActionComment(ContentWorkflowLogType.CommentProvided), workflow, item, workflow.States.FirstOrDefault(s => s.StateID == item.StateID), workflow.PortalID, userID, userComment); - AddWorkflowLog(workflow.WorkflowID, item, GetWorkflowActionText(ContentWorkflowLogType.CommentProvided), logComment, userID); + var logComment = this.ReplaceNotificationTokens(this.GetWorkflowActionComment(ContentWorkflowLogType.CommentProvided), workflow, item, workflow.States.FirstOrDefault(s => s.StateID == item.StateID), workflow.PortalID, userID, userComment); + this.AddWorkflowLog(workflow.WorkflowID, item, this.GetWorkflowActionText(ContentWorkflowLogType.CommentProvided), logComment, userID); } private void SendNotification(bool sendEmail, bool sendMessage, PortalSettings settings, IEnumerable roles, IEnumerable users, string subject, string body, string comment, int userID, string source, string[] parameters) { if (sendEmail) { - SendEmailNotifications(settings, roles, users, subject, body, comment); + this.SendEmailNotifications(settings, roles, users, subject, body, comment); } if (sendMessage) { - SendMessageNotifications(settings, roles, users, subject, body, comment, userID, source, parameters); + this.SendMessageNotifications(settings, roles, users, subject, body, comment, userID, source, parameters); } } private void SendNotification(PortalSettings settings, ContentWorkflow workflow, ContentItem item, ContentWorkflowState state, string subject, string body, string comment, int destinationStateID, int actionUserID, string source, string[] parameters) { - var permissions = GetWorkflowStatePermissionByState(destinationStateID); - var users = GetUsersFromPermissions(settings, permissions); - var roles = GetRolesFromPermissions(settings, permissions); - var replacedSubject = ReplaceNotificationTokens(subject, workflow, item, GetWorkflowStateByID(destinationStateID), settings.PortalId, actionUserID); - var replacedBody = ReplaceNotificationTokens(body, workflow, item, GetWorkflowStateByID(destinationStateID), settings.PortalId, actionUserID); + var permissions = this.GetWorkflowStatePermissionByState(destinationStateID); + var users = this.GetUsersFromPermissions(settings, permissions); + var roles = this.GetRolesFromPermissions(settings, permissions); + var replacedSubject = this.ReplaceNotificationTokens(subject, workflow, item, this.GetWorkflowStateByID(destinationStateID), settings.PortalId, actionUserID); + var replacedBody = this.ReplaceNotificationTokens(body, workflow, item, this.GetWorkflowStateByID(destinationStateID), settings.PortalId, actionUserID); - SendNotification(state.SendEmail, state.SendMessage, settings, roles, users, replacedSubject, replacedBody, comment, actionUserID, source, parameters); + this.SendNotification(state.SendEmail, state.SendMessage, settings, roles, users, replacedSubject, replacedBody, comment, actionUserID, source, parameters); } private void SendMessageNotifications(PortalSettings settings, IEnumerable roles, IEnumerable users, string subject, string body, string comment, int actionUserID, string source, string[] parameters) { - var fullbody = GetFullBody(body, comment); + var fullbody = this.GetFullBody(body, comment); if (!roles.Any() && !users.Any()) { @@ -571,7 +571,7 @@ private string GetFullBody(string body, string comment) private void SendEmailNotifications(PortalSettings settings, IEnumerable roles, IEnumerable users, string subject, string body, string comment) { - var fullbody = GetFullBody(body, comment); + var fullbody = this.GetFullBody(body, comment); var emailUsers = users.ToList(); foreach (var role in roles) { @@ -650,11 +650,11 @@ private bool IsReviewer(UserInfo user, PortalSettings settings, IEnumerable s.StateID == item.StateID), workflow.PortalID, userID); + var comment = this.ReplaceNotificationTokens(this.GetWorkflowActionComment(logType), workflow, item, workflow.States.FirstOrDefault(s => s.StateID == item.StateID), workflow.PortalID, userID); - AddWorkflowLog(workflow.WorkflowID, item, GetWorkflowActionText(logType), comment, userID); + this.AddWorkflowLog(workflow.WorkflowID, item, this.GetWorkflowActionText(logType), comment, userID); } private void AddWorkflowLog(int workflowID, ContentItem item, string action, string comment, int userID) @@ -735,7 +735,7 @@ private int GetPreviousWorkflowStateID(ContentWorkflow workflow, int stateID) // if none found then reset to first state if (intPreviousStateID == -1) { - intPreviousStateID = GetFirstWorkflowStateID(workflow); + intPreviousStateID = this.GetFirstWorkflowStateID(workflow); } return intPreviousStateID; @@ -775,7 +775,7 @@ private int GetNextWorkflowStateID(ContentWorkflow workflow, int stateID) // if none found then reset to first state if (intNextStateID == -1) { - intNextStateID = GetFirstWorkflowStateID(workflow); + intNextStateID = this.GetFirstWorkflowStateID(workflow); } return intNextStateID; @@ -784,12 +784,12 @@ private int GetNextWorkflowStateID(ContentWorkflow workflow, int stateID) private void SetWorkflowState(int stateID, ContentItem item) { item.StateID = stateID; - contentController.UpdateContentItem(item); + this.contentController.UpdateContentItem(item); } private bool IsWorkflowCompleted(ContentWorkflow workflow, ContentItem item) { - var endStateID = GetLastWorkflowStateID(workflow); + var endStateID = this.GetLastWorkflowStateID(workflow); return item.StateID == Null.NullInteger || endStateID == item.StateID; } diff --git a/DNN Platform/Library/Entities/Content/Workflow/Repositories/WorkflowRepository.cs b/DNN Platform/Library/Entities/Content/Workflow/Repositories/WorkflowRepository.cs index 339b241e657..f1ba4b0d2cf 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/Repositories/WorkflowRepository.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/Repositories/WorkflowRepository.cs @@ -23,7 +23,7 @@ internal class WorkflowRepository : ServiceLocator sw.WorkflowKey == DirectPublishWorkflowKey); + return this._workflowRepository.GetSystemWorkflows(portalId).SingleOrDefault(sw => sw.WorkflowKey == DirectPublishWorkflowKey); } public Entities.Workflow GetSaveDraftWorkflow(int portalId) { - return _workflowRepository.GetSystemWorkflows(portalId).SingleOrDefault(sw => sw.WorkflowKey == SaveDraftWorkflowKey); + return this._workflowRepository.GetSystemWorkflows(portalId).SingleOrDefault(sw => sw.WorkflowKey == SaveDraftWorkflowKey); } public Entities.Workflow GetContentApprovalWorkflow(int portalId) { - return _workflowRepository.GetSystemWorkflows(portalId).SingleOrDefault(sw => sw.WorkflowKey == ContentAprovalWorkflowKey); + return this._workflowRepository.GetSystemWorkflows(portalId).SingleOrDefault(sw => sw.WorkflowKey == ContentAprovalWorkflowKey); } public WorkflowState GetDraftStateDefinition(int order) { - var state = GetDefaultWorkflowState(order); + var state = this.GetDefaultWorkflowState(order); state.StateName = Localization.GetString("DefaultWorkflowState1.StateName"); return state; } public WorkflowState GetPublishedStateDefinition(int order) { - var state = GetDefaultWorkflowState(order); + var state = this.GetDefaultWorkflowState(order); state.StateName = Localization.GetString("DefaultWorkflowState3.StateName"); return state; } public WorkflowState GetReadyForReviewStateDefinition(int order) { - var state = GetDefaultWorkflowState(order); + var state = this.GetDefaultWorkflowState(order); state.StateName = Localization.GetString("DefaultWorkflowState2.StateName"); state.SendNotification = true; state.SendNotificationToAdministrators = true; diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowEngine.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowEngine.cs index 7323408a555..acb9290f4ed 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowEngine.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowEngine.cs @@ -49,18 +49,18 @@ public class WorkflowEngine : ServiceLocator, I #region Constructor public WorkflowEngine() { - _contentController = Util.GetContentController(); - _workflowRepository = WorkflowRepository.Instance; - _workflowStateRepository = WorkflowStateRepository.Instance; - _workflowStatePermissionsRepository = WorkflowStatePermissionsRepository.Instance; - _workflowLogRepository = WorkflowLogRepository.Instance; - _workflowActionManager = WorkflowActionManager.Instance; - _workflowSecurity = WorkflowSecurity.Instance; - _userController = UserController.Instance; - _notificationsController = NotificationsController.Instance; - _workflowManager = WorkflowManager.Instance; - _workflowLogger = WorkflowLogger.Instance; - _systemWorkflowManager = SystemWorkflowManager.Instance; + this._contentController = Util.GetContentController(); + this._workflowRepository = WorkflowRepository.Instance; + this._workflowStateRepository = WorkflowStateRepository.Instance; + this._workflowStatePermissionsRepository = WorkflowStatePermissionsRepository.Instance; + this._workflowLogRepository = WorkflowLogRepository.Instance; + this._workflowActionManager = WorkflowActionManager.Instance; + this._workflowSecurity = WorkflowSecurity.Instance; + this._userController = UserController.Instance; + this._notificationsController = NotificationsController.Instance; + this._workflowManager = WorkflowManager.Instance; + this._workflowLogger = WorkflowLogger.Instance; + this._systemWorkflowManager = SystemWorkflowManager.Instance; } #endregion @@ -79,8 +79,8 @@ private StateTransaction CreateInitialTransaction(int contentItemId, int stateId private void PerformWorkflowActionOnStateChanged(StateTransaction stateTransaction, WorkflowActionTypes actionType) { - var contentItem = _contentController.GetContentItem(stateTransaction.ContentItemId); - var workflowAction = GetWorkflowActionInstance(contentItem, actionType); + var contentItem = this._contentController.GetContentItem(stateTransaction.ContentItemId); + var workflowAction = this.GetWorkflowActionInstance(contentItem, actionType); if (workflowAction != null) { workflowAction.DoActionOnStateChanged(stateTransaction); @@ -89,8 +89,8 @@ private void PerformWorkflowActionOnStateChanged(StateTransaction stateTransacti private void PerformWorkflowActionOnStateChanging(StateTransaction stateTransaction, WorkflowActionTypes actionType) { - var contentItem = _contentController.GetContentItem(stateTransaction.ContentItemId); - var workflowAction = GetWorkflowActionInstance(contentItem, actionType); + var contentItem = this._contentController.GetContentItem(stateTransaction.ContentItemId); + var workflowAction = this.GetWorkflowActionInstance(contentItem, actionType); if (workflowAction != null) { workflowAction.DoActionOnStateChanging(stateTransaction); @@ -99,35 +99,35 @@ private void PerformWorkflowActionOnStateChanging(StateTransaction stateTransact private IWorkflowAction GetWorkflowActionInstance(ContentItem contentItem, WorkflowActionTypes actionType) { - return _workflowActionManager.GetWorkflowActionInstance(contentItem.ContentTypeId, actionType); + return this._workflowActionManager.GetWorkflowActionInstance(contentItem.ContentTypeId, actionType); } private void UpdateContentItemWorkflowState(int stateId, ContentItem item) { item.StateID = stateId; - _contentController.UpdateContentItem(item); + this._contentController.UpdateContentItem(item); } private UserInfo GetUserThatHaveStartedOrSubmittedDraftState(Entities.Workflow workflow, ContentItem contentItem, StateTransaction stateTransaction) { - bool wasDraftSubmitted = WasDraftSubmitted(workflow, stateTransaction.CurrentStateId); + bool wasDraftSubmitted = this.WasDraftSubmitted(workflow, stateTransaction.CurrentStateId); if (wasDraftSubmitted) { - return GetSubmittedDraftStateUser(contentItem); + return this.GetSubmittedDraftStateUser(contentItem); } - return GetStartedDraftStateUser(contentItem); + return this.GetStartedDraftStateUser(contentItem); } private UserInfo GetUserByWorkflowLogType(ContentItem contentItem, WorkflowLogType type) { - var workflow = _workflowManager.GetWorkflow(contentItem); + var workflow = this._workflowManager.GetWorkflow(contentItem); if (workflow == null) { return null; } - var logs = _workflowLogRepository.GetWorkflowLogs(contentItem.ContentItemId, workflow.WorkflowID); + var logs = this._workflowLogRepository.GetWorkflowLogs(contentItem.ContentItemId, workflow.WorkflowID); var logDraftCompleted = logs .OrderByDescending(l => l.Date) @@ -135,7 +135,7 @@ private UserInfo GetUserByWorkflowLogType(ContentItem contentItem, WorkflowLogTy if (logDraftCompleted != null && logDraftCompleted.User != Null.NullInteger) { - return _userController.GetUserById(workflow.PortalID, logDraftCompleted.User); + return this._userController.GetUserById(workflow.PortalID, logDraftCompleted.User); } return null; } @@ -155,19 +155,19 @@ private string GetWorkflowNotificationContext(ContentItem contentItem, WorkflowS private void DeleteWorkflowNotifications(ContentItem contentItem, WorkflowState state) { - var context = GetWorkflowNotificationContext(contentItem, state); - var notificationTypeId = _notificationsController.GetNotificationType(ContentWorkflowNotificationType).NotificationTypeId; - DeleteNotificationsByType(notificationTypeId, context); - notificationTypeId = _notificationsController.GetNotificationType(ContentWorkflowNotificatioStartWorkflowType).NotificationTypeId; - DeleteNotificationsByType(notificationTypeId, context); + var context = this.GetWorkflowNotificationContext(contentItem, state); + var notificationTypeId = this._notificationsController.GetNotificationType(ContentWorkflowNotificationType).NotificationTypeId; + this.DeleteNotificationsByType(notificationTypeId, context); + notificationTypeId = this._notificationsController.GetNotificationType(ContentWorkflowNotificatioStartWorkflowType).NotificationTypeId; + this.DeleteNotificationsByType(notificationTypeId, context); } private void DeleteNotificationsByType(int notificationTypeId, string context) { - var notifications = _notificationsController.GetNotificationByContext(notificationTypeId, context); + var notifications = this._notificationsController.GetNotificationByContext(notificationTypeId, context); foreach (var notification in notifications) { - _notificationsController.DeleteAllNotificationRecipients(notification.NotificationID); + this._notificationsController.DeleteAllNotificationRecipients(notification.NotificationID); } } @@ -180,7 +180,7 @@ private void SendNotificationToAuthor(StateTransaction stateTransaction, Workflo return; } - var user = GetUserThatHaveStartedOrSubmittedDraftState(workflow, contentItem, stateTransaction); + var user = this.GetUserThatHaveStartedOrSubmittedDraftState(workflow, contentItem, stateTransaction); if (user == null) { //Services.Exceptions.Exceptions.LogException(new WorkflowException(Localization.GetExceptionMessage("WorkflowAuthorNotFound", "Author cannot be found. Notification won't be sent"))); @@ -192,7 +192,7 @@ private void SendNotificationToAuthor(StateTransaction stateTransaction, Workflo return; } - var workflowAction = GetWorkflowActionInstance(contentItem, workflowActionType); + var workflowAction = this.GetWorkflowActionInstance(contentItem, workflowActionType); if (workflowAction == null) { return; @@ -200,10 +200,10 @@ private void SendNotificationToAuthor(StateTransaction stateTransaction, Workflo var message = workflowAction.GetActionMessage(stateTransaction, state); - var notification = GetNotification(GetWorkflowNotificationContext(contentItem, state), stateTransaction, message, ContentWorkflowNotificationNoActionType); + var notification = this.GetNotification(this.GetWorkflowNotificationContext(contentItem, state), stateTransaction, message, ContentWorkflowNotificationNoActionType); - _notificationsController.SendNotification(notification, workflow.PortalID, null, new[] { user }); + this._notificationsController.SendNotification(notification, workflow.PortalID, null, new[] { user }); } catch (Exception ex) { @@ -220,20 +220,20 @@ private void SendNotificationToWorkflowStarter(StateTransaction stateTransaction return; } - var workflowAction = GetWorkflowActionInstance(contentItem, workflowActionType); + var workflowAction = this.GetWorkflowActionInstance(contentItem, workflowActionType); if (workflowAction == null) { return; } - var user = _userController.GetUser(workflow.PortalID, starterUserId); + var user = this._userController.GetUser(workflow.PortalID, starterUserId); var message = workflowAction.GetActionMessage(stateTransaction, workflow.FirstState); - var notification = GetNotification( GetWorkflowNotificationContext(contentItem, workflow.FirstState), stateTransaction, message, ContentWorkflowNotificatioStartWorkflowType); + var notification = this.GetNotification( this.GetWorkflowNotificationContext(contentItem, workflow.FirstState), stateTransaction, message, ContentWorkflowNotificatioStartWorkflowType); - _notificationsController.SendNotification(notification, workflow.PortalID, null, new[] { user }); + this._notificationsController.SendNotification(notification, workflow.PortalID, null, new[] { user }); } catch (Exception ex) { @@ -251,14 +251,14 @@ private void SendNotificationsToReviewers(ContentItem contentItem, WorkflowState return; } - var reviewers = GetUserAndRolesForStateReviewers(portalSettings, state); + var reviewers = this.GetUserAndRolesForStateReviewers(portalSettings, state); if (!reviewers.Roles.Any() && !reviewers.Users.Any()) { return; // If there are no receivers, the notification is avoided } - var workflowAction = GetWorkflowActionInstance(contentItem, workflowActionType); + var workflowAction = this.GetWorkflowActionInstance(contentItem, workflowActionType); if (workflowAction == null) { return; @@ -266,9 +266,9 @@ private void SendNotificationsToReviewers(ContentItem contentItem, WorkflowState var message = workflowAction.GetActionMessage(stateTransaction, state); - var notification = GetNotification(GetWorkflowNotificationContext(contentItem, state), stateTransaction, message, ContentWorkflowNotificationType); + var notification = this.GetNotification(this.GetWorkflowNotificationContext(contentItem, state), stateTransaction, message, ContentWorkflowNotificationType); - _notificationsController.SendNotification(notification, portalSettings.PortalId, reviewers.Roles.ToList(), reviewers.Users.ToList()); + this._notificationsController.SendNotification(notification, portalSettings.PortalId, reviewers.Roles.ToList(), reviewers.Users.ToList()); } catch (Exception ex) { @@ -282,7 +282,7 @@ private Notification GetNotification(string workflowContext, StateTransaction st var notification = new Notification { NotificationTypeID = - _notificationsController.GetNotificationType(notificationType).NotificationTypeId, + this._notificationsController.GetNotificationType(notificationType).NotificationTypeId, Subject = message.Subject, Body = message.Body, IncludeDismissAction = true, @@ -310,7 +310,7 @@ private ReviewersDto GetUserAndRolesForStateReviewers(PortalSettings portalSetti }; if (state.SendNotification) { - var permissions = _workflowStatePermissionsRepository.GetWorkflowStatePermissionByState(state.StateID).ToArray(); + var permissions = this._workflowStatePermissionsRepository.GetWorkflowStatePermissionByState(state.StateID).ToArray(); reviewers.Users = GetUsersFromPermissions(portalSettings, permissions); reviewers.Roles = GetRolesFromPermissions(portalSettings, permissions); } @@ -374,8 +374,8 @@ private void AddWorkflowCommentLog(ContentItem contentItem, int userId, string u { return; } - var state = _workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); - AddWorkflowLog(contentItem, state, WorkflowLogType.CommentProvided, userId, userComment); + var state = this._workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); + this.AddWorkflowLog(contentItem, state, WorkflowLogType.CommentProvided, userId, userComment); } private void AddWorkflowCommentLog(ContentItem contentItem, WorkflowState state, int userId, string userComment) { @@ -383,20 +383,20 @@ private void AddWorkflowCommentLog(ContentItem contentItem, WorkflowState state, { return; } - AddWorkflowLog(contentItem, state, WorkflowLogType.CommentProvided, userId, userComment); + this.AddWorkflowLog(contentItem, state, WorkflowLogType.CommentProvided, userId, userComment); } private void AddWorkflowLog(ContentItem contentItem, WorkflowLogType logType, int userId, string userComment = null) { - var state = _workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); - AddWorkflowLog(contentItem, state, logType, userId, userComment); + var state = this._workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); + this.AddWorkflowLog(contentItem, state, logType, userId, userComment); } private void AddWorkflowLog(ContentItem contentItem, WorkflowState state, WorkflowLogType logType, int userId, string userComment = null) { try { - TryAddWorkflowLog(contentItem, state, logType, userId, userComment); + this.TryAddWorkflowLog(contentItem, state, logType, userId, userComment); } catch (Exception ex) { @@ -406,10 +406,10 @@ private void AddWorkflowLog(ContentItem contentItem, WorkflowState state, Workfl private void TryAddWorkflowLog(ContentItem contentItem, WorkflowState state, WorkflowLogType logType, int userId, string userComment) { - var workflow = _workflowManager.GetWorkflow(contentItem); + var workflow = this._workflowManager.GetWorkflow(contentItem); var logTypeText = GetWorkflowActionComment(logType); - var logComment = ReplaceNotificationTokens(logTypeText, workflow, contentItem, state, userId, userComment); - _workflowLogger.AddWorkflowLog(contentItem.ContentItemId, workflow.WorkflowID, logType, logComment, userId); + var logComment = this.ReplaceNotificationTokens(logTypeText, workflow, contentItem, state, userId, userComment); + this._workflowLogger.AddWorkflowLog(contentItem.ContentItemId, workflow.WorkflowID, logType, logComment, userId); } private static string GetWorkflowActionComment(WorkflowLogType logType) @@ -420,7 +420,7 @@ private static string GetWorkflowActionComment(WorkflowLogType logType) private string ReplaceNotificationTokens(string text, Entities.Workflow workflow, ContentItem item, WorkflowState state, int userId, string comment = "") { - var user = _userController.GetUserById(workflow.PortalID, userId); + var user = this._userController.GetUserById(workflow.PortalID, userId); var datetime = DateTime.UtcNow; var result = text.Replace("[USER]", user != null ? user.DisplayName : ""); result = result.Replace("[DATE]", datetime.ToString("F", CultureInfo.CurrentCulture)); @@ -484,66 +484,66 @@ private WorkflowState GetPreviousWorkflowState(Entities.Workflow workflow, int s #region Public Methods public UserInfo GetStartedDraftStateUser(ContentItem contentItem) { - return GetUserByWorkflowLogType(contentItem, WorkflowLogType.WorkflowStarted); + return this.GetUserByWorkflowLogType(contentItem, WorkflowLogType.WorkflowStarted); } public UserInfo GetSubmittedDraftStateUser(ContentItem contentItem) { - return GetUserByWorkflowLogType(contentItem, WorkflowLogType.DraftCompleted); + return this.GetUserByWorkflowLogType(contentItem, WorkflowLogType.DraftCompleted); } public void StartWorkflow(int workflowId, int contentItemId, int userId) { Requires.NotNegative("workflowId", workflowId); - var contentItem = _contentController.GetContentItem(contentItemId); - var workflow = _workflowManager.GetWorkflow(contentItem); + var contentItem = this._contentController.GetContentItem(contentItemId); + var workflow = this._workflowManager.GetWorkflow(contentItem); //If already exists a started workflow - if (workflow != null && !IsWorkflowCompleted(contentItem)) + if (workflow != null && !this.IsWorkflowCompleted(contentItem)) { throw new WorkflowInvalidOperationException(Localization.GetExceptionMessage("WorkflowAlreadyStarted", "Workflow cannot get started for this Content Item. It already has a started workflow.")); } if (workflow == null || workflow.WorkflowID != workflowId) { - workflow = _workflowRepository.GetWorkflow(workflowId); + workflow = this._workflowRepository.GetWorkflow(workflowId); } - var initialTransaction = CreateInitialTransaction(contentItemId, workflow.FirstState.StateID, userId); + var initialTransaction = this.CreateInitialTransaction(contentItemId, workflow.FirstState.StateID, userId); //Perform action before starting workflow - PerformWorkflowActionOnStateChanging( initialTransaction, WorkflowActionTypes.StartWorkflow); - UpdateContentItemWorkflowState(workflow.FirstState.StateID, contentItem); + this.PerformWorkflowActionOnStateChanging( initialTransaction, WorkflowActionTypes.StartWorkflow); + this.UpdateContentItemWorkflowState(workflow.FirstState.StateID, contentItem); //Send notifications to stater - if (workflow.WorkflowID != _systemWorkflowManager.GetDirectPublishWorkflow(workflow.PortalID).WorkflowID) //This notification is not sent in Direct Publish WF + if (workflow.WorkflowID != this._systemWorkflowManager.GetDirectPublishWorkflow(workflow.PortalID).WorkflowID) //This notification is not sent in Direct Publish WF { - SendNotificationToWorkflowStarter(initialTransaction, workflow, contentItem, userId, WorkflowActionTypes.StartWorkflow); + this.SendNotificationToWorkflowStarter(initialTransaction, workflow, contentItem, userId, WorkflowActionTypes.StartWorkflow); } // Delete previous logs - _workflowLogRepository.DeleteWorkflowLogs(contentItemId, workflowId); + this._workflowLogRepository.DeleteWorkflowLogs(contentItemId, workflowId); // Add logs - AddWorkflowLog(contentItem, WorkflowLogType.WorkflowStarted, userId); - AddWorkflowLog(contentItem, WorkflowLogType.StateInitiated, userId); + this.AddWorkflowLog(contentItem, WorkflowLogType.WorkflowStarted, userId); + this.AddWorkflowLog(contentItem, WorkflowLogType.StateInitiated, userId); //Perform action after starting workflow - PerformWorkflowActionOnStateChanged(initialTransaction, WorkflowActionTypes.StartWorkflow); + this.PerformWorkflowActionOnStateChanged(initialTransaction, WorkflowActionTypes.StartWorkflow); } public void CompleteState(StateTransaction stateTransaction) { - var contentItem = _contentController.GetContentItem(stateTransaction.ContentItemId); - var workflow = _workflowManager.GetWorkflow(contentItem); + var contentItem = this._contentController.GetContentItem(stateTransaction.ContentItemId); + var workflow = this._workflowManager.GetWorkflow(contentItem); if (workflow == null) { return; } - if (IsWorkflowCompleted(contentItem) + if (this.IsWorkflowCompleted(contentItem) && !(workflow.IsSystem && workflow.States.Count() == 1)) { throw new WorkflowInvalidOperationException(Localization.GetExceptionMessage("WorkflowSystemWorkflowStateCannotComplete", "System workflow state cannot be completed.")); @@ -551,51 +551,51 @@ public void CompleteState(StateTransaction stateTransaction) var isFirstState = workflow.FirstState.StateID == contentItem.StateID; - if (!isFirstState && !_workflowSecurity.HasStateReviewerPermission(workflow.PortalID, stateTransaction.UserId, contentItem.StateID)) + if (!isFirstState && !this._workflowSecurity.HasStateReviewerPermission(workflow.PortalID, stateTransaction.UserId, contentItem.StateID)) { throw new WorkflowSecurityException(Localization.GetExceptionMessage("UserCannotReviewWorkflowState", "User cannot review the workflow state")); } - var currentState = _workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); + var currentState = this._workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); if (currentState.StateID != stateTransaction.CurrentStateId) { throw new WorkflowConcurrencyException(); } - var nextState = GetNextWorkflowState(workflow, contentItem.StateID); + var nextState = this.GetNextWorkflowState(workflow, contentItem.StateID); if (nextState.StateID == workflow.LastState.StateID) { - CompleteWorkflow(stateTransaction); + this.CompleteWorkflow(stateTransaction); return; } // before-change action - PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.CompleteState); - UpdateContentItemWorkflowState(nextState.StateID, contentItem); + this.PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.CompleteState); + this.UpdateContentItemWorkflowState(nextState.StateID, contentItem); // Add logs - AddWorkflowCommentLog(contentItem, currentState, stateTransaction.UserId, stateTransaction.Message.UserComment); - AddWorkflowLog(contentItem, currentState, + this.AddWorkflowCommentLog(contentItem, currentState, stateTransaction.UserId, stateTransaction.Message.UserComment); + this.AddWorkflowLog(contentItem, currentState, currentState.StateID == workflow.FirstState.StateID ? WorkflowLogType.DraftCompleted : WorkflowLogType.StateCompleted, stateTransaction.UserId); - AddWorkflowLog(contentItem, + this.AddWorkflowLog(contentItem, nextState.StateID == workflow.LastState.StateID ? WorkflowLogType.WorkflowApproved : WorkflowLogType.StateInitiated, stateTransaction.UserId); - SendNotificationsToReviewers(contentItem, nextState, stateTransaction, WorkflowActionTypes.CompleteState, new PortalSettings(workflow.PortalID)); + this.SendNotificationsToReviewers(contentItem, nextState, stateTransaction, WorkflowActionTypes.CompleteState, new PortalSettings(workflow.PortalID)); - DeleteWorkflowNotifications(contentItem, currentState); + this.DeleteWorkflowNotifications(contentItem, currentState); // after-change action - PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.CompleteState); + this.PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.CompleteState); } public void DiscardState(StateTransaction stateTransaction) { - var contentItem = _contentController.GetContentItem(stateTransaction.ContentItemId); - var workflow = _workflowManager.GetWorkflow(contentItem); + var contentItem = this._contentController.GetContentItem(stateTransaction.ContentItemId); + var workflow = this._workflowManager.GetWorkflow(contentItem); if (workflow == null) { return; @@ -609,59 +609,59 @@ public void DiscardState(StateTransaction stateTransaction) throw new WorkflowInvalidOperationException(Localization.GetExceptionMessage("WorkflowCannotDiscard", "Cannot discard on last workflow state")); } - if (!isFirstState && !_workflowSecurity.HasStateReviewerPermission(workflow.PortalID, stateTransaction.UserId, contentItem.StateID)) + if (!isFirstState && !this._workflowSecurity.HasStateReviewerPermission(workflow.PortalID, stateTransaction.UserId, contentItem.StateID)) { throw new WorkflowSecurityException(Localization.GetExceptionMessage("UserCannotReviewWorkflowState", "User cannot review the workflow state")); } - var currentState = _workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); + var currentState = this._workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); if (currentState.StateID != stateTransaction.CurrentStateId) { throw new WorkflowConcurrencyException(); } - var previousState = GetPreviousWorkflowState(workflow, contentItem.StateID); + var previousState = this.GetPreviousWorkflowState(workflow, contentItem.StateID); if (previousState.StateID == workflow.LastState.StateID) { - DiscardWorkflow(stateTransaction); + this.DiscardWorkflow(stateTransaction); return; } // before-change action - PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.DiscardState); + this.PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.DiscardState); - UpdateContentItemWorkflowState(previousState.StateID, contentItem); + this.UpdateContentItemWorkflowState(previousState.StateID, contentItem); // Add logs - AddWorkflowCommentLog(contentItem, currentState, stateTransaction.UserId, stateTransaction.Message.UserComment); - AddWorkflowLog(contentItem, currentState, WorkflowLogType.StateDiscarded, stateTransaction.UserId); - AddWorkflowLog(contentItem, WorkflowLogType.StateInitiated, stateTransaction.UserId); + this.AddWorkflowCommentLog(contentItem, currentState, stateTransaction.UserId, stateTransaction.Message.UserComment); + this.AddWorkflowLog(contentItem, currentState, WorkflowLogType.StateDiscarded, stateTransaction.UserId); + this.AddWorkflowLog(contentItem, WorkflowLogType.StateInitiated, stateTransaction.UserId); if (previousState.StateID == workflow.FirstState.StateID) { // Send to author - workflow comes back to draft state - SendNotificationToAuthor(stateTransaction, previousState, workflow, contentItem, WorkflowActionTypes.DiscardState); + this.SendNotificationToAuthor(stateTransaction, previousState, workflow, contentItem, WorkflowActionTypes.DiscardState); } else { - SendNotificationsToReviewers(contentItem, previousState, stateTransaction, WorkflowActionTypes.DiscardState, new PortalSettings(workflow.PortalID)); + this.SendNotificationsToReviewers(contentItem, previousState, stateTransaction, WorkflowActionTypes.DiscardState, new PortalSettings(workflow.PortalID)); } - DeleteWorkflowNotifications(contentItem, currentState); + this.DeleteWorkflowNotifications(contentItem, currentState); // after-change action - PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.DiscardState); + this.PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.DiscardState); } public bool IsWorkflowCompleted(int contentItemId) { - var contentItem = _contentController.GetContentItem(contentItemId); - return IsWorkflowCompleted(contentItem); + var contentItem = this._contentController.GetContentItem(contentItemId); + return this.IsWorkflowCompleted(contentItem); } public bool IsWorkflowCompleted(ContentItem contentItem) { - var workflow = _workflowManager.GetWorkflow(contentItem); + var workflow = this._workflowManager.GetWorkflow(contentItem); if (workflow == null) return true; // If item has not workflow, then it is considered as completed return contentItem.StateID == Null.NullInteger || workflow.LastState.StateID == contentItem.StateID; @@ -669,71 +669,71 @@ public bool IsWorkflowCompleted(ContentItem contentItem) public bool IsWorkflowOnDraft(int contentItemId) { - var contentItem = _contentController.GetContentItem(contentItemId); //Ensure DB values - return IsWorkflowOnDraft(contentItem); + var contentItem = this._contentController.GetContentItem(contentItemId); //Ensure DB values + return this.IsWorkflowOnDraft(contentItem); } public bool IsWorkflowOnDraft(ContentItem contentItem) { - var workflow = _workflowManager.GetWorkflow(contentItem); + var workflow = this._workflowManager.GetWorkflow(contentItem); if (workflow == null) return false; // If item has not workflow, then it is not on Draft return contentItem.StateID == workflow.FirstState.StateID; } public void DiscardWorkflow(StateTransaction stateTransaction) { - var contentItem = _contentController.GetContentItem(stateTransaction.ContentItemId); + var contentItem = this._contentController.GetContentItem(stateTransaction.ContentItemId); - var currentState = _workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); + var currentState = this._workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); if (currentState.StateID != stateTransaction.CurrentStateId) { throw new WorkflowConcurrencyException(); } // before-change action - PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.DiscardWorkflow); + this.PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.DiscardWorkflow); - var workflow =_workflowManager.GetWorkflow(contentItem); - UpdateContentItemWorkflowState(workflow.LastState.StateID, contentItem); + var workflow =this._workflowManager.GetWorkflow(contentItem); + this.UpdateContentItemWorkflowState(workflow.LastState.StateID, contentItem); // Logs - AddWorkflowCommentLog(contentItem, stateTransaction.UserId, stateTransaction.Message.UserComment); - AddWorkflowLog(contentItem, WorkflowLogType.WorkflowDiscarded, stateTransaction.UserId); + this.AddWorkflowCommentLog(contentItem, stateTransaction.UserId, stateTransaction.Message.UserComment); + this.AddWorkflowLog(contentItem, WorkflowLogType.WorkflowDiscarded, stateTransaction.UserId); // Notifications - SendNotificationToAuthor(stateTransaction, workflow.LastState, workflow, contentItem, WorkflowActionTypes.DiscardWorkflow); - DeleteWorkflowNotifications(contentItem, currentState); + this.SendNotificationToAuthor(stateTransaction, workflow.LastState, workflow, contentItem, WorkflowActionTypes.DiscardWorkflow); + this.DeleteWorkflowNotifications(contentItem, currentState); // after-change action - PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.DiscardWorkflow); + this.PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.DiscardWorkflow); } public void CompleteWorkflow(StateTransaction stateTransaction) { - var contentItem = _contentController.GetContentItem(stateTransaction.ContentItemId); + var contentItem = this._contentController.GetContentItem(stateTransaction.ContentItemId); - var currentState = _workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); + var currentState = this._workflowStateRepository.GetWorkflowStateByID(contentItem.StateID); if (currentState.StateID != stateTransaction.CurrentStateId) { throw new WorkflowConcurrencyException(); } // before-change action - PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.CompleteWorkflow); + this.PerformWorkflowActionOnStateChanging(stateTransaction, WorkflowActionTypes.CompleteWorkflow); - var workflow = _workflowManager.GetWorkflow(contentItem); - UpdateContentItemWorkflowState(workflow.LastState.StateID, contentItem); + var workflow = this._workflowManager.GetWorkflow(contentItem); + this.UpdateContentItemWorkflowState(workflow.LastState.StateID, contentItem); // Logs - AddWorkflowCommentLog(contentItem, stateTransaction.UserId, stateTransaction.Message.UserComment); - AddWorkflowLog(contentItem, WorkflowLogType.WorkflowApproved, stateTransaction.UserId); + this.AddWorkflowCommentLog(contentItem, stateTransaction.UserId, stateTransaction.Message.UserComment); + this.AddWorkflowLog(contentItem, WorkflowLogType.WorkflowApproved, stateTransaction.UserId); // Notifications - SendNotificationToAuthor(stateTransaction, workflow.LastState, workflow, contentItem, WorkflowActionTypes.CompleteWorkflow); - DeleteWorkflowNotifications(contentItem, currentState); + this.SendNotificationToAuthor(stateTransaction, workflow.LastState, workflow, contentItem, WorkflowActionTypes.CompleteWorkflow); + this.DeleteWorkflowNotifications(contentItem, currentState); // after-change action - PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.CompleteWorkflow); + this.PerformWorkflowActionOnStateChanged(stateTransaction, WorkflowActionTypes.CompleteWorkflow); } #endregion diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowLogger.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowLogger.cs index 059f5fa24a6..7095ed1195d 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowLogger.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowLogger.cs @@ -20,7 +20,7 @@ public class WorkflowLogger : ServiceLocator, I #region Constructor public WorkflowLogger() { - _workflowLogRepository = WorkflowLogRepository.Instance; + this._workflowLogRepository = WorkflowLogRepository.Instance; } #endregion @@ -37,7 +37,7 @@ private void AddWorkflowLog(int contentItemId, int workflowId, WorkflowLogType t User = userId, Date = DateTime.UtcNow }; - _workflowLogRepository.AddWorkflowLog(workflowLog); + this._workflowLogRepository.AddWorkflowLog(workflowLog); } private string GetWorkflowActionText(WorkflowLogType logType) @@ -50,18 +50,18 @@ private string GetWorkflowActionText(WorkflowLogType logType) #region Public Methods public IEnumerable GetWorkflowLogs(int contentItemId, int workflowId) { - return _workflowLogRepository.GetWorkflowLogs(contentItemId, workflowId); + return this._workflowLogRepository.GetWorkflowLogs(contentItemId, workflowId); } public void AddWorkflowLog(int contentItemId, int workflowId, WorkflowLogType type, string comment, int userId) { - AddWorkflowLog(contentItemId, workflowId, type, GetWorkflowActionText(type), comment, userId); + this.AddWorkflowLog(contentItemId, workflowId, type, this.GetWorkflowActionText(type), comment, userId); } public void AddWorkflowLog(int contentItemId, int workflowId, string action, string comment, int userId) { - AddWorkflowLog(contentItemId, workflowId, WorkflowLogType.CommentProvided, action, comment, userId); + this.AddWorkflowLog(contentItemId, workflowId, WorkflowLogType.CommentProvided, action, comment, userId); } #endregion diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowManager.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowManager.cs index dbcb7bd2a33..f28b65661e6 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowManager.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowManager.cs @@ -25,10 +25,10 @@ public class WorkflowManager : ServiceLocator #region Constructor public WorkflowManager() { - _dataProvider = DataProvider.Instance(); - _workflowRepository = WorkflowRepository.Instance; - _workflowStateRepository = WorkflowStateRepository.Instance; - _systemWorkflowManager = SystemWorkflowManager.Instance; + this._dataProvider = DataProvider.Instance(); + this._workflowRepository = WorkflowRepository.Instance; + this._workflowStateRepository = WorkflowStateRepository.Instance; + this._systemWorkflowManager = SystemWorkflowManager.Instance; } #endregion @@ -36,7 +36,7 @@ public WorkflowManager() public void DeleteWorkflow(Entities.Workflow workflow) { - var workflowToDelete = _workflowRepository.GetWorkflow(workflow.WorkflowID); + var workflowToDelete = this._workflowRepository.GetWorkflow(workflow.WorkflowID); if (workflowToDelete == null) { return; @@ -47,18 +47,18 @@ public void DeleteWorkflow(Entities.Workflow workflow) throw new WorkflowInvalidOperationException(Localization.GetString("SystemWorkflowDeletionException", Localization.ExceptionsResourceFile)); } - var usageCount = GetWorkflowUsageCount(workflowToDelete.WorkflowID); + var usageCount = this.GetWorkflowUsageCount(workflowToDelete.WorkflowID); if (usageCount > 0) { throw new WorkflowInvalidOperationException(Localization.GetString("WorkflowInUsageException", Localization.ExceptionsResourceFile)); } - _workflowRepository.DeleteWorkflow(workflowToDelete); + this._workflowRepository.DeleteWorkflow(workflowToDelete); } public Entities.Workflow GetWorkflow(int workflowId) { - return _workflowRepository.GetWorkflow(workflowId); + return this._workflowRepository.GetWorkflow(workflowId); } public Entities.Workflow GetWorkflow(ContentItem contentItem) @@ -68,26 +68,26 @@ public Entities.Workflow GetWorkflow(ContentItem contentItem) return null; } var state = WorkflowStateRepository.Instance.GetWorkflowStateByID(contentItem.StateID); - return state == null ? null : GetWorkflow(state.WorkflowID); + return state == null ? null : this.GetWorkflow(state.WorkflowID); } public IEnumerable GetWorkflows(int portalId) { - return _workflowRepository.GetWorkflows(portalId); + return this._workflowRepository.GetWorkflows(portalId); } public void AddWorkflow(Entities.Workflow workflow) { - _workflowRepository.AddWorkflow(workflow); + this._workflowRepository.AddWorkflow(workflow); - var firstDefaultState = _systemWorkflowManager.GetDraftStateDefinition(1); - var lastDefaultState = _systemWorkflowManager.GetPublishedStateDefinition(2); + var firstDefaultState = this._systemWorkflowManager.GetDraftStateDefinition(1); + var lastDefaultState = this._systemWorkflowManager.GetPublishedStateDefinition(2); firstDefaultState.WorkflowID = workflow.WorkflowID; lastDefaultState.WorkflowID = workflow.WorkflowID; - _workflowStateRepository.AddWorkflowState(firstDefaultState); - _workflowStateRepository.AddWorkflowState(lastDefaultState); + this._workflowStateRepository.AddWorkflowState(firstDefaultState); + this._workflowStateRepository.AddWorkflowState(lastDefaultState); workflow.States = new List { @@ -98,17 +98,17 @@ public void AddWorkflow(Entities.Workflow workflow) public void UpdateWorkflow(Entities.Workflow workflow) { - _workflowRepository.UpdateWorkflow(workflow); + this._workflowRepository.UpdateWorkflow(workflow); } public IEnumerable GetWorkflowUsage(int workflowId, int pageIndex, int pageSize) { - return CBO.FillCollection(_dataProvider.GetContentWorkflowUsage(workflowId, pageIndex, pageSize)); + return CBO.FillCollection(this._dataProvider.GetContentWorkflowUsage(workflowId, pageIndex, pageSize)); } public int GetWorkflowUsageCount(int workflowId) { - return _dataProvider.GetContentWorkflowUsageCount(workflowId); + return this._dataProvider.GetContentWorkflowUsageCount(workflowId); } #endregion diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs index 552bce8e251..285a5bd63ee 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowSecurity.cs @@ -29,7 +29,7 @@ public class WorkflowSecurity : ServiceLocator HasStateReviewerPermission(workflow.PortalID, userId, contentWorkflowState.StateID)); + var workflow = this._workflowManager.GetWorkflow(workflowId); + return workflow.States.Any(contentWorkflowState => this.HasStateReviewerPermission(workflow.PortalID, userId, contentWorkflowState.StateID)); } public PermissionInfo GetStateReviewPermission() diff --git a/DNN Platform/Library/Entities/Content/Workflow/WorkflowStateManager.cs b/DNN Platform/Library/Entities/Content/Workflow/WorkflowStateManager.cs index 4c7c21546ba..69ecef3ac9c 100644 --- a/DNN Platform/Library/Entities/Content/Workflow/WorkflowStateManager.cs +++ b/DNN Platform/Library/Entities/Content/Workflow/WorkflowStateManager.cs @@ -26,24 +26,24 @@ public class WorkflowStateManager : ServiceLocator GetWorkflowStates(int workflowId) { - return _workflowStateRepository.GetWorkflowStates(workflowId); + return this._workflowStateRepository.GetWorkflowStates(workflowId); } public WorkflowState GetWorkflowState(int stateId) { - return _workflowStateRepository.GetWorkflowStateByID(stateId); + return this._workflowStateRepository.GetWorkflowStateByID(stateId); } public void AddWorkflowState(WorkflowState state) { - var workflow = _workflowRepository.GetWorkflow(state.WorkflowID); + var workflow = this._workflowRepository.GetWorkflow(state.WorkflowID); if (workflow == null) { throw new WorkflowDoesNotExistException(); @@ -60,13 +60,13 @@ public void AddWorkflowState(WorkflowState state) state.Order = lastState.Order; lastState.Order++; - _workflowStateRepository.AddWorkflowState(state); - _workflowStateRepository.UpdateWorkflowState(lastState); // Update last state order + this._workflowStateRepository.AddWorkflowState(state); + this._workflowStateRepository.UpdateWorkflowState(lastState); // Update last state order } public void DeleteWorkflowState(WorkflowState state) { - var stateToDelete = _workflowStateRepository.GetWorkflowStateByID(state.StateID); + var stateToDelete = this._workflowStateRepository.GetWorkflowStateByID(state.StateID); if (stateToDelete == null) { return; @@ -77,12 +77,12 @@ public void DeleteWorkflowState(WorkflowState state) throw new WorkflowInvalidOperationException(Localization.GetString("WorkflowSystemWorkflowStateCannotBeDeleted", Localization.ExceptionsResourceFile)); } - if (_dataProvider.GetContentWorkflowStateUsageCount(state.StateID) > 0) + if (this._dataProvider.GetContentWorkflowStateUsageCount(state.StateID) > 0) { throw new WorkflowInvalidOperationException(Localization.GetString("WorkflowStateInUsageException", Localization.ExceptionsResourceFile)); } - _workflowStateRepository.DeleteWorkflowState(stateToDelete); + this._workflowStateRepository.DeleteWorkflowState(stateToDelete); // Reorder states order using (var context = DataContext.Instance()) @@ -94,23 +94,23 @@ public void DeleteWorkflowState(WorkflowState state) public void UpdateWorkflowState(WorkflowState state) { - var workflowState = _workflowStateRepository.GetWorkflowStateByID(state.StateID); + var workflowState = this._workflowStateRepository.GetWorkflowStateByID(state.StateID); if (workflowState == null) { throw new WorkflowDoesNotExistException(); } - _workflowStateRepository.UpdateWorkflowState(state); + this._workflowStateRepository.UpdateWorkflowState(state); } public void MoveWorkflowStateDown(int stateId) { - var state = _workflowStateRepository.GetWorkflowStateByID(stateId); + var state = this._workflowStateRepository.GetWorkflowStateByID(stateId); if (state == null) { throw new WorkflowDoesNotExistException(); } - var states = _workflowStateRepository.GetWorkflowStates(state.WorkflowID).ToArray(); + var states = this._workflowStateRepository.GetWorkflowStates(state.WorkflowID).ToArray(); if (states.Length == 3) { @@ -144,19 +144,19 @@ public void MoveWorkflowStateDown(int stateId) stateToMoveDown.Order = stateToMoveUp.Order; stateToMoveUp.Order = orderTmp; - _workflowStateRepository.UpdateWorkflowState(stateToMoveUp); - _workflowStateRepository.UpdateWorkflowState(stateToMoveDown); + this._workflowStateRepository.UpdateWorkflowState(stateToMoveUp); + this._workflowStateRepository.UpdateWorkflowState(stateToMoveDown); } public void MoveWorkflowStateUp(int stateId) { - var state = _workflowStateRepository.GetWorkflowStateByID(stateId); + var state = this._workflowStateRepository.GetWorkflowStateByID(stateId); if (state == null) { throw new WorkflowDoesNotExistException(); } - var states = _workflowStateRepository.GetWorkflowStates(state.WorkflowID).ToArray(); + var states = this._workflowStateRepository.GetWorkflowStates(state.WorkflowID).ToArray(); if (states.Length == 3) { @@ -190,25 +190,25 @@ public void MoveWorkflowStateUp(int stateId) stateToMoveDown.Order = stateToMoveUp.Order; stateToMoveUp.Order = orderTmp; - _workflowStateRepository.UpdateWorkflowState(stateToMoveUp); - _workflowStateRepository.UpdateWorkflowState(stateToMoveDown); + this._workflowStateRepository.UpdateWorkflowState(stateToMoveUp); + this._workflowStateRepository.UpdateWorkflowState(stateToMoveDown); } public void MoveState(int stateId, int index) { - var state = _workflowStateRepository.GetWorkflowStateByID(stateId); + var state = this._workflowStateRepository.GetWorkflowStateByID(stateId); if (state == null) { throw new WorkflowDoesNotExistException(); } - var states = _workflowStateRepository.GetWorkflowStates(state.WorkflowID).ToArray(); + var states = this._workflowStateRepository.GetWorkflowStates(state.WorkflowID).ToArray(); if (index < 1 || index > states.Length - 2) { throw new WorkflowInvalidOperationException(Localization.GetString("WorkflowStateCannotBeMoved", Localization.ExceptionsResourceFile)); } - var currentIndex = GetStateIndex(states, state); + var currentIndex = this.GetStateIndex(states, state); if (currentIndex == 0 || currentIndex == states.Length - 1) @@ -216,27 +216,27 @@ public void MoveState(int stateId, int index) throw new WorkflowInvalidOperationException(Localization.GetString("WorkflowStateCannotBeMoved", Localization.ExceptionsResourceFile)); } - MoveState(state, index, currentIndex); + this.MoveState(state, index, currentIndex); } public IEnumerable GetWorkflowStatePermissionByState(int stateId) { - return _workflowStatePermissionsRepository.GetWorkflowStatePermissionByState(stateId); + return this._workflowStatePermissionsRepository.GetWorkflowStatePermissionByState(stateId); } public void AddWorkflowStatePermission(WorkflowStatePermission permission, int userId) { - permission.WorkflowStatePermissionID = _workflowStatePermissionsRepository.AddWorkflowStatePermission(permission, userId); + permission.WorkflowStatePermissionID = this._workflowStatePermissionsRepository.AddWorkflowStatePermission(permission, userId); } public void DeleteWorkflowStatePermission(int workflowStatePermissionId) { - _workflowStatePermissionsRepository.DeleteWorkflowStatePermission(workflowStatePermissionId); + this._workflowStatePermissionsRepository.DeleteWorkflowStatePermission(workflowStatePermissionId); } public int GetContentWorkflowStateUsageCount(int stateId) { - return _dataProvider.GetContentWorkflowStateUsageCount(stateId); + return this._dataProvider.GetContentWorkflowStateUsageCount(stateId); } #endregion @@ -270,11 +270,11 @@ private void MoveState(WorkflowState state, int targetIndex, int currentIndex) { if (moveUp) { - MoveWorkflowStateUp(state.StateID); + this.MoveWorkflowStateUp(state.StateID); } else { - MoveWorkflowStateDown(state.StateID); + this.MoveWorkflowStateDown(state.StateID); } } } diff --git a/DNN Platform/Library/Entities/Controllers/HostController.cs b/DNN Platform/Library/Entities/Controllers/HostController.cs index 657a2ddf706..0f8e758dad9 100644 --- a/DNN Platform/Library/Entities/Controllers/HostController.cs +++ b/DNN Platform/Library/Entities/Controllers/HostController.cs @@ -60,7 +60,7 @@ internal HostController() /// key is empty. public bool GetBoolean(string key) { - return GetBoolean(key, Null.NullBoolean); + return this.GetBoolean(key, Null.NullBoolean); } /// @@ -78,9 +78,9 @@ public bool GetBoolean(string key, bool defaultValue) try { string setting = string.Empty; - if ((GetSettings().ContainsKey(key))) + if ((this.GetSettings().ContainsKey(key))) { - setting = GetSettings()[key].Value; + setting = this.GetSettings()[key].Value; } if (string.IsNullOrEmpty(setting)) @@ -108,7 +108,7 @@ public bool GetBoolean(string key, bool defaultValue) /// key is empty. public double GetDouble(string key) { - return GetDouble(key, Null.NullDouble); + return this.GetDouble(key, Null.NullDouble); } /// @@ -124,7 +124,7 @@ public double GetDouble(string key, double defaultValue) double retValue; - if ((!GetSettings().ContainsKey(key) || !double.TryParse(GetSettings()[key].Value, out retValue))) + if ((!this.GetSettings().ContainsKey(key) || !double.TryParse(this.GetSettings()[key].Value, out retValue))) { retValue = defaultValue; } @@ -140,7 +140,7 @@ public double GetDouble(string key, double defaultValue) /// key is empty. public int GetInteger(string key) { - return GetInteger(key, Null.NullInteger); + return this.GetInteger(key, Null.NullInteger); } /// @@ -156,7 +156,7 @@ public int GetInteger(string key, int defaultValue) int retValue; - if ((!GetSettings().ContainsKey(key) || !int.TryParse(GetSettings()[key].Value, out retValue))) + if ((!this.GetSettings().ContainsKey(key) || !int.TryParse(this.GetSettings()[key].Value, out retValue))) { retValue = defaultValue; } @@ -184,7 +184,7 @@ public Dictionary GetSettings() /// host setting's value. public Dictionary GetSettingsDictionary() { - return GetSettings().ToDictionary(c => c.Key, c => c.Value.Value); + return this.GetSettings().ToDictionary(c => c.Key, c => c.Value.Value); } /// @@ -197,7 +197,7 @@ public string GetEncryptedString(string key, string passPhrase) { Requires.NotNullOrEmpty("key", key); Requires.NotNullOrEmpty("passPhrase", passPhrase); - var cipherText = GetString(key); + var cipherText = this.GetString(key); return Security.FIPSCompliant.DecryptAES(cipherText, passPhrase, Entities.Host.Host.GUID); } @@ -210,7 +210,7 @@ public string GetEncryptedString(string key, string passPhrase) /// key is empty. public string GetString(string key) { - return GetString(key, string.Empty); + return this.GetString(key, string.Empty); } /// @@ -224,12 +224,12 @@ public string GetString(string key, string defaultValue) { Requires.NotNullOrEmpty("key", key); - if (!GetSettings().ContainsKey(key) || GetSettings()[key].Value == null) + if (!this.GetSettings().ContainsKey(key) || this.GetSettings()[key].Value == null) { return defaultValue; } - return GetSettings()[key].Value; + return this.GetSettings()[key].Value; } /// @@ -240,7 +240,7 @@ public void Update(Dictionary settings) { foreach (KeyValuePair settingKvp in settings) { - Update(settingKvp.Key, settingKvp.Value, false); + this.Update(settingKvp.Key, settingKvp.Value, false); } DataCache.ClearHostCache(false); @@ -252,7 +252,7 @@ public void Update(Dictionary settings) /// The config. public void Update(ConfigurationSetting config) { - Update(config, true); + this.Update(config, true); } /// @@ -311,7 +311,7 @@ public void Update(ConfigurationSetting config, bool clearCache) /// if set to true will clear cache after update settings. public void Update(string key, string value, bool clearCache) { - Update(new ConfigurationSetting { Key = key, Value = value }, clearCache); + this.Update(new ConfigurationSetting { Key = key, Value = value }, clearCache); } /// @@ -321,7 +321,7 @@ public void Update(string key, string value, bool clearCache) /// The value. public void Update(string key, string value) { - Update(key, value, true); + this.Update(key, value, true); } /// @@ -336,7 +336,7 @@ public void UpdateEncryptedString(string key, string value, string passPhrase) Requires.PropertyNotNull("value", value); Requires.NotNullOrEmpty("passPhrase", passPhrase); var cipherText = Security.FIPSCompliant.EncryptAES(value, passPhrase, Entities.Host.Host.GUID); - Update(key, cipherText); + this.Update(key, cipherText); } /// @@ -347,7 +347,7 @@ public void IncrementCrmVersion(bool includeOverridingPortals) { var currentVersion = Host.Host.CrmVersion; var newVersion = currentVersion + 1; - Update(ClientResourceSettings.VersionKey, newVersion.ToString(CultureInfo.InvariantCulture), true); + this.Update(ClientResourceSettings.VersionKey, newVersion.ToString(CultureInfo.InvariantCulture), true); if (includeOverridingPortals) { diff --git a/DNN Platform/Library/Entities/DataStructures/NTree.cs b/DNN Platform/Library/Entities/DataStructures/NTree.cs index 816162bb20d..81e7852ba75 100644 --- a/DNN Platform/Library/Entities/DataStructures/NTree.cs +++ b/DNN Platform/Library/Entities/DataStructures/NTree.cs @@ -14,7 +14,7 @@ public class NTree { public NTree() { - Children = new List>(); + this.Children = new List>(); } [DataMember(Name = "data")] @@ -25,7 +25,7 @@ public NTree() public bool HasChildren() { - return Children != null && Children.Count > 0; + return this.Children != null && this.Children.Count > 0; } } diff --git a/DNN Platform/Library/Entities/EventManager.cs b/DNN Platform/Library/Entities/EventManager.cs index 119a2bf8052..60398f8c1a0 100644 --- a/DNN Platform/Library/Entities/EventManager.cs +++ b/DNN Platform/Library/Entities/EventManager.cs @@ -81,94 +81,94 @@ public EventManager() { foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - FileChanged += handler.Value.FileOverwritten; - FileDeleted += handler.Value.FileDeleted; - FileRenamed += handler.Value.FileRenamed; - FileMoved += handler.Value.FileMoved; - FileAdded += handler.Value.FileAdded; - FileOverwritten += handler.Value.FileOverwritten; - FileMetadataChanged += handler.Value.FileMetadataChanged; - FileDownloaded += handler.Value.FileDownloaded; + this.FileChanged += handler.Value.FileOverwritten; + this.FileDeleted += handler.Value.FileDeleted; + this.FileRenamed += handler.Value.FileRenamed; + this.FileMoved += handler.Value.FileMoved; + this.FileAdded += handler.Value.FileAdded; + this.FileOverwritten += handler.Value.FileOverwritten; + this.FileMetadataChanged += handler.Value.FileMetadataChanged; + this.FileDownloaded += handler.Value.FileDownloaded; - FolderAdded += handler.Value.FolderAdded; - FolderDeleted += handler.Value.FolderDeleted; - FolderMoved += handler.Value.FolderMoved; - FolderRenamed += handler.Value.FolderRenamed; + this.FolderAdded += handler.Value.FolderAdded; + this.FolderDeleted += handler.Value.FolderDeleted; + this.FolderMoved += handler.Value.FolderMoved; + this.FolderRenamed += handler.Value.FolderRenamed; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - FollowRequested += handler.Value.FollowRequested; - UnfollowRequested += handler.Value.UnfollowRequested; + this.FollowRequested += handler.Value.FollowRequested; + this.UnfollowRequested += handler.Value.UnfollowRequested; } foreach (var handlers in EventHandlersContainer.Instance.EventHandlers) { - FriendshipRequested += handlers.Value.FriendshipRequested; - FriendshipAccepted += handlers.Value.FriendshipAccepted; - FriendshipDeleted += handlers.Value.FriendshipDeleted; + this.FriendshipRequested += handlers.Value.FriendshipRequested; + this.FriendshipAccepted += handlers.Value.FriendshipAccepted; + this.FriendshipDeleted += handlers.Value.FriendshipDeleted; } foreach (var handlers in EventHandlersContainer.Instance.EventHandlers) { - ModuleCreated += handlers.Value.ModuleCreated; - ModuleUpdated += handlers.Value.ModuleUpdated; - ModuleRemoved += handlers.Value.ModuleRemoved; - ModuleDeleted += handlers.Value.ModuleDeleted; + this.ModuleCreated += handlers.Value.ModuleCreated; + this.ModuleUpdated += handlers.Value.ModuleUpdated; + this.ModuleRemoved += handlers.Value.ModuleRemoved; + this.ModuleDeleted += handlers.Value.ModuleDeleted; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - PortalCreated += handler.Value.PortalCreated; + this.PortalCreated += handler.Value.PortalCreated; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - PortalSettingUpdated += handler.Value.PortalSettingUpdated; + this.PortalSettingUpdated += handler.Value.PortalSettingUpdated; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - PortalTemplateCreated += handler.Value.TemplateCreated; + this.PortalTemplateCreated += handler.Value.TemplateCreated; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - ProfileUpdated += handler.Value.ProfileUpdated; + this.ProfileUpdated += handler.Value.ProfileUpdated; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - RoleCreated += handler.Value.RoleCreated; - RoleDeleted += handler.Value.RoleDeleted; - RoleJoined += handler.Value.RoleJoined; - RoleLeft += handler.Value.RoleLeft; + this.RoleCreated += handler.Value.RoleCreated; + this.RoleDeleted += handler.Value.RoleDeleted; + this.RoleJoined += handler.Value.RoleJoined; + this.RoleLeft += handler.Value.RoleLeft; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - TabCreated += handler.Value.TabCreated; - TabUpdated += handler.Value.TabUpdated; - TabRemoved += handler.Value.TabRemoved; - TabDeleted += handler.Value.TabDeleted; - TabRestored += handler.Value.TabRestored; - TabMarkedAsPublished += handler.Value.TabMarkedAsPublished; + this.TabCreated += handler.Value.TabCreated; + this.TabUpdated += handler.Value.TabUpdated; + this.TabRemoved += handler.Value.TabRemoved; + this.TabDeleted += handler.Value.TabDeleted; + this.TabRestored += handler.Value.TabRestored; + this.TabMarkedAsPublished += handler.Value.TabMarkedAsPublished; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - TabSerialize += handler.Value.TabSerialize; - TabDeserialize += handler.Value.TabDeserialize; + this.TabSerialize += handler.Value.TabSerialize; + this.TabDeserialize += handler.Value.TabDeserialize; } foreach (var handler in EventHandlersContainer.Instance.EventHandlers) { - UserAuthenticated += handler.Value.UserAuthenticated; - UserCreated += handler.Value.UserCreated; - UserDeleted += handler.Value.UserDeleted; - UserRemoved += handler.Value.UserRemoved; - UserApproved += handler.Value.UserApproved; - UserUpdated += handler.Value.UserUpdated; + this.UserAuthenticated += handler.Value.UserAuthenticated; + this.UserCreated += handler.Value.UserCreated; + this.UserDeleted += handler.Value.UserDeleted; + this.UserRemoved += handler.Value.UserRemoved; + this.UserApproved += handler.Value.UserApproved; + this.UserUpdated += handler.Value.UserUpdated; } } @@ -180,9 +180,9 @@ protected override Func GetFactory() public virtual void OnFileAdded(FileAddedEventArgs args) { - if (FileAdded != null) + if (this.FileAdded != null) { - FileAdded(this, args); + this.FileAdded(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_ADDED); @@ -190,9 +190,9 @@ public virtual void OnFileAdded(FileAddedEventArgs args) public virtual void OnFileChanged(FileChangedEventArgs args) { - if (FileChanged != null) + if (this.FileChanged != null) { - FileChanged(this, args); + this.FileChanged(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_CHANGED); @@ -200,9 +200,9 @@ public virtual void OnFileChanged(FileChangedEventArgs args) public virtual void OnFileDeleted(FileDeletedEventArgs args) { - if (FileDeleted != null) + if (this.FileDeleted != null) { - FileDeleted(this, args); + this.FileDeleted(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_DELETED); @@ -210,9 +210,9 @@ public virtual void OnFileDeleted(FileDeletedEventArgs args) public virtual void OnFileMetadataChanged(FileChangedEventArgs args) { - if (FileMetadataChanged != null) + if (this.FileMetadataChanged != null) { - FileMetadataChanged(this, args); + this.FileMetadataChanged(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_METADATACHANGED); @@ -220,9 +220,9 @@ public virtual void OnFileMetadataChanged(FileChangedEventArgs args) public virtual void OnFileDownloaded(FileDownloadedEventArgs args) { - if (FileDownloaded != null) + if (this.FileDownloaded != null) { - FileDownloaded(this, args); + this.FileDownloaded(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_DOWNLOADED); @@ -230,9 +230,9 @@ public virtual void OnFileDownloaded(FileDownloadedEventArgs args) public virtual void OnFileMoved(FileMovedEventArgs args) { - if (FileMoved != null) + if (this.FileMoved != null) { - FileMoved(this, args); + this.FileMoved(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_MOVED); @@ -240,9 +240,9 @@ public virtual void OnFileMoved(FileMovedEventArgs args) public virtual void OnFileOverwritten(FileChangedEventArgs args) { - if (FileOverwritten != null) + if (this.FileOverwritten != null) { - FileOverwritten(this, args); + this.FileOverwritten(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_OVERWRITTEN); @@ -250,9 +250,9 @@ public virtual void OnFileOverwritten(FileChangedEventArgs args) public virtual void OnFileRenamed(FileRenamedEventArgs args) { - if (FileRenamed != null) + if (this.FileRenamed != null) { - FileRenamed(this, args); + this.FileRenamed(this, args); } AddLog(args.FileInfo, args.UserId, EventLogController.EventLogType.FILE_RENAMED); @@ -260,281 +260,281 @@ public virtual void OnFileRenamed(FileRenamedEventArgs args) public virtual void OnFolderAdded(FolderChangedEventArgs args) { - if (FolderAdded != null) + if (this.FolderAdded != null) { - FolderAdded(this, args); + this.FolderAdded(this, args); } } public virtual void OnFolderDeleted(FolderDeletedEventArgs args) { - if (FolderDeleted != null) + if (this.FolderDeleted != null) { - FolderDeleted(this, args); + this.FolderDeleted(this, args); } } public virtual void OnFolderMoved(FolderMovedEventArgs args) { - if (FolderMoved != null) + if (this.FolderMoved != null) { - FolderMoved(this, args); + this.FolderMoved(this, args); } } public virtual void OnFolderRenamed(FolderRenamedEventArgs args) { - if (FolderRenamed != null) + if (this.FolderRenamed != null) { - FolderRenamed(this, args); + this.FolderRenamed(this, args); } } public virtual void OnFollowRequested(RelationshipEventArgs args) { - if (FollowRequested != null) + if (this.FollowRequested != null) { - FollowRequested(this, args); + this.FollowRequested(this, args); } } public virtual void OnFriendshipAccepted(RelationshipEventArgs args) { - if (FriendshipAccepted != null) + if (this.FriendshipAccepted != null) { - FriendshipAccepted(this, args); + this.FriendshipAccepted(this, args); } } public virtual void OnFriendshipDeleted(RelationshipEventArgs args) { - if (FriendshipDeleted != null) + if (this.FriendshipDeleted != null) { - FriendshipDeleted(this, args); + this.FriendshipDeleted(this, args); } } public virtual void OnFriendshipRequested(RelationshipEventArgs args) { - if (FriendshipRequested != null) + if (this.FriendshipRequested != null) { - FriendshipRequested(this, args); + this.FriendshipRequested(this, args); } } public virtual void OnModuleCreated(ModuleEventArgs args) { - if (ModuleCreated != null) + if (this.ModuleCreated != null) { - ModuleCreated(this, args); + this.ModuleCreated(this, args); } } public virtual void OnModuleDeleted(ModuleEventArgs args) { - if (ModuleDeleted != null) + if (this.ModuleDeleted != null) { - ModuleDeleted(this, args); + this.ModuleDeleted(this, args); } } public virtual void OnModuleRemoved(ModuleEventArgs args) { - if (ModuleRemoved != null) + if (this.ModuleRemoved != null) { - ModuleRemoved(this, args); + this.ModuleRemoved(this, args); } } public virtual void OnModuleUpdated(ModuleEventArgs args) { - if (ModuleUpdated != null) + if (this.ModuleUpdated != null) { - ModuleUpdated(this, args); + this.ModuleUpdated(this, args); } } public virtual void OnPortalCreated(PortalCreatedEventArgs args) { - if (PortalCreated != null) + if (this.PortalCreated != null) { - PortalCreated(this, args); + this.PortalCreated(this, args); } } public virtual void OnPortalSettingUpdated(PortalSettingUpdatedEventArgs args) { - if (PortalSettingUpdated != null) + if (this.PortalSettingUpdated != null) { - PortalSettingUpdated(this, args); + this.PortalSettingUpdated(this, args); } } public virtual void OnPortalTemplateCreated(PortalTemplateEventArgs args) { - if (PortalTemplateCreated != null) + if (this.PortalTemplateCreated != null) { - PortalTemplateCreated(this, args); + this.PortalTemplateCreated(this, args); } } public virtual void OnProfileUpdated(ProfileEventArgs args) { - if (ProfileUpdated != null) + if (this.ProfileUpdated != null) { - ProfileUpdated(this, args); + this.ProfileUpdated(this, args); } } public virtual void OnRoleCreated(RoleEventArgs args) { - if (RoleCreated != null) + if (this.RoleCreated != null) { - RoleCreated(this, args); + this.RoleCreated(this, args); } } public virtual void OnRoleDeleted(RoleEventArgs args) { - if (RoleDeleted != null) + if (this.RoleDeleted != null) { - RoleDeleted(this, args); + this.RoleDeleted(this, args); } } public virtual void OnRoleJoined(RoleEventArgs args) { - if (RoleJoined != null) + if (this.RoleJoined != null) { - RoleJoined(this, args); + this.RoleJoined(this, args); } } public virtual void OnRoleLeft(RoleEventArgs args) { - if (RoleLeft != null) + if (this.RoleLeft != null) { - RoleLeft(this, args); + this.RoleLeft(this, args); } } public virtual void OnTabCreated(TabEventArgs args) { - if (TabCreated != null) + if (this.TabCreated != null) { - TabCreated(this, args); + this.TabCreated(this, args); } } public virtual void OnTabDeleted(TabEventArgs args) { - if (TabDeleted != null) + if (this.TabDeleted != null) { - TabDeleted(this, args); + this.TabDeleted(this, args); } } public virtual void OnTabDeserialize(TabSyncEventArgs args) { - if (TabDeserialize != null) + if (this.TabDeserialize != null) { - TabDeserialize(this, args); + this.TabDeserialize(this, args); } } public virtual void OnTabMarkedAsPublished(TabEventArgs args) { - if (TabMarkedAsPublished != null) + if (this.TabMarkedAsPublished != null) { - TabMarkedAsPublished(this, args); + this.TabMarkedAsPublished(this, args); } } public virtual void OnTabRemoved(TabEventArgs args) { - if (TabRemoved != null) + if (this.TabRemoved != null) { - TabRemoved(this, args); + this.TabRemoved(this, args); } } public virtual void OnTabRestored(TabEventArgs args) { - if (TabRestored != null) + if (this.TabRestored != null) { - TabRestored(this, args); + this.TabRestored(this, args); } } public virtual void OnTabSerialize(TabSyncEventArgs args) { - if (TabSerialize != null) + if (this.TabSerialize != null) { - TabSerialize(this, args); + this.TabSerialize(this, args); } } public virtual void OnTabUpdated(TabEventArgs args) { - if (TabUpdated != null) + if (this.TabUpdated != null) { - TabUpdated(this, args); + this.TabUpdated(this, args); } } public virtual void OnUnfollowRequested(RelationshipEventArgs args) { - if (UnfollowRequested != null) + if (this.UnfollowRequested != null) { - UnfollowRequested(this, args); + this.UnfollowRequested(this, args); } } public virtual void OnUserApproved(UserEventArgs args) { - if (UserApproved != null) + if (this.UserApproved != null) { - UserApproved(this, args); + this.UserApproved(this, args); } } public virtual void OnUserAuthenticated(UserEventArgs args) { - if (UserAuthenticated != null) + if (this.UserAuthenticated != null) { - UserAuthenticated(this, args); + this.UserAuthenticated(this, args); } } public virtual void OnUserCreated(UserEventArgs args) { - if (UserCreated != null) + if (this.UserCreated != null) { - UserCreated(this, args); + this.UserCreated(this, args); } } public virtual void OnUserDeleted(UserEventArgs args) { - if (UserDeleted != null) + if (this.UserDeleted != null) { - UserDeleted(this, args); + this.UserDeleted(this, args); } } public virtual void OnUserRemoved(UserEventArgs args) { - if (UserRemoved != null) + if (this.UserRemoved != null) { - UserRemoved(this, args); + this.UserRemoved(this, args); } } public virtual void OnUserUpdated(UpdateUserEventArgs args) { - if (UserUpdated != null) + if (this.UserUpdated != null) { - UserUpdated(this, args); + this.UserUpdated(this, args); } } @@ -542,8 +542,8 @@ public void RefreshTabSyncHandlers() { foreach (var handlers in new EventHandlersContainer().EventHandlers) { - TabSerialize += handlers.Value.TabSerialize; - TabDeserialize += handlers.Value.TabDeserialize; + this.TabSerialize += handlers.Value.TabSerialize; + this.TabDeserialize += handlers.Value.TabDeserialize; } } diff --git a/DNN Platform/Library/Entities/Host/ServerInfo.cs b/DNN Platform/Library/Entities/Host/ServerInfo.cs index d0e1bd16b80..da193477e07 100644 --- a/DNN Platform/Library/Entities/Host/ServerInfo.cs +++ b/DNN Platform/Library/Entities/Host/ServerInfo.cs @@ -24,12 +24,12 @@ public ServerInfo() : this(DateTime.Now, DateTime.Now) public ServerInfo(DateTime created, DateTime lastactivity) { - IISAppName = Globals.IISAppName; - ServerName = Globals.ServerName; - ServerGroup = String.Empty; - CreatedDate = created; - LastActivityDate = lastactivity; - Enabled = true; + this.IISAppName = Globals.IISAppName; + this.ServerName = Globals.ServerName; + this.ServerGroup = String.Empty; + this.CreatedDate = created; + this.LastActivityDate = lastactivity; + this.Enabled = true; } public int ServerID { get; set; } @@ -62,28 +62,28 @@ public ServerInfo(DateTime created, DateTime lastactivity) /// ----------------------------------------------------------------------------- public void Fill(IDataReader dr) { - ServerID = Null.SetNullInteger(dr["ServerID"]); - IISAppName = Null.SetNullString(dr["IISAppName"]); - ServerName = Null.SetNullString(dr["ServerName"]); - Url = Null.SetNullString(dr["URL"]); - Enabled = Null.SetNullBoolean(dr["Enabled"]); - CreatedDate = Null.SetNullDateTime(dr["CreatedDate"]); - LastActivityDate = Null.SetNullDateTime(dr["LastActivityDate"]); + this.ServerID = Null.SetNullInteger(dr["ServerID"]); + this.IISAppName = Null.SetNullString(dr["IISAppName"]); + this.ServerName = Null.SetNullString(dr["ServerName"]); + this.Url = Null.SetNullString(dr["URL"]); + this.Enabled = Null.SetNullBoolean(dr["Enabled"]); + this.CreatedDate = Null.SetNullDateTime(dr["CreatedDate"]); + this.LastActivityDate = Null.SetNullDateTime(dr["LastActivityDate"]); var schema = dr.GetSchemaTable(); if (schema != null) { if (schema.Select("ColumnName = 'PingFailureCount'").Length > 0) { - PingFailureCount = Null.SetNullInteger(dr["PingFailureCount"]); + this.PingFailureCount = Null.SetNullInteger(dr["PingFailureCount"]); } if (schema.Select("ColumnName = 'ServerGroup'").Length > 0) { - ServerGroup = Null.SetNullString(dr["ServerGroup"]); + this.ServerGroup = Null.SetNullString(dr["ServerGroup"]); } if (schema.Select("ColumnName = 'UniqueId'").Length > 0) { - UniqueId = Null.SetNullString(dr["UniqueId"]); + this.UniqueId = Null.SetNullString(dr["UniqueId"]); } } } @@ -98,11 +98,11 @@ public int KeyID { get { - return ServerID; + return this.ServerID; } set { - ServerID = value; + this.ServerID = value; } } diff --git a/DNN Platform/Library/Entities/IPFilter/IPFilterController.cs b/DNN Platform/Library/Entities/IPFilter/IPFilterController.cs index f68a758ff58..e7ccd82aaee 100644 --- a/DNN Platform/Library/Entities/IPFilter/IPFilterController.cs +++ b/DNN Platform/Library/Entities/IPFilter/IPFilterController.cs @@ -101,7 +101,7 @@ IList IIPFilterController.GetIPFilters() [Obsolete("deprecated with 7.1.0 - please use IsIPBanned instead to return the value and apply your own logic. Scheduled removal in v10.0.0.")] public void IsIPAddressBanned(string ipAddress) { - if (CheckIfBannedIPAddress(ipAddress)) + if (this.CheckIfBannedIPAddress(ipAddress)) {//should throw 403.6 throw new HttpException(403, ""); } @@ -115,7 +115,7 @@ public void IsIPAddressBanned(string ipAddress) public bool IsIPBanned(string ipAddress) { - return CheckIfBannedIPAddress(ipAddress); + return this.CheckIfBannedIPAddress(ipAddress); } private bool CheckIfBannedIPAddress(string ipAddress) @@ -130,7 +130,7 @@ private bool CheckIfBannedIPAddress(string ipAddress) if (NetworkUtils.IsIPInRange(ipAddress, ipFilterInfo.IPAddress, ipFilterInfo.SubnetMask)) { //log - LogBannedIPAttempt(ipAddress); + this.LogBannedIPAttempt(ipAddress); return true; } diff --git a/DNN Platform/Library/Entities/IPFilter/IPFilterInfo.cs b/DNN Platform/Library/Entities/IPFilter/IPFilterInfo.cs index 9e3b665f002..bed360aceb4 100644 --- a/DNN Platform/Library/Entities/IPFilter/IPFilterInfo.cs +++ b/DNN Platform/Library/Entities/IPFilter/IPFilterInfo.cs @@ -35,16 +35,16 @@ public class IPFilterInfo : BaseEntityInfo, IHydratable /// public IPFilterInfo(string ipAddress, string subnetMask, int ruleType) { - IPAddress = ipAddress; - SubnetMask = subnetMask; - RuleType = ruleType; + this.IPAddress = ipAddress; + this.SubnetMask = subnetMask; + this.RuleType = ruleType; } public IPFilterInfo() { - IPAddress = String.Empty; - SubnetMask = String.Empty; - RuleType = -1; + this.IPAddress = String.Empty; + this.SubnetMask = String.Empty; + this.RuleType = -1; } #endregion @@ -72,11 +72,11 @@ public IPFilterInfo() /// public void Fill(IDataReader dr) { - IPFilterID = Null.SetNullInteger(dr["IPFilterID"]); + this.IPFilterID = Null.SetNullInteger(dr["IPFilterID"]); try { - IPFilterID = Null.SetNullInteger(dr["IPFilterID"]); + this.IPFilterID = Null.SetNullInteger(dr["IPFilterID"]); } catch (IndexOutOfRangeException) { @@ -84,11 +84,11 @@ public void Fill(IDataReader dr) //else swallow the error } - IPAddress = Null.SetNullString(dr["IPAddress"]); - SubnetMask = Null.SetNullString(dr["SubnetMask"]); - RuleType = Null.SetNullInteger(dr["RuleType"]); + this.IPAddress = Null.SetNullString(dr["IPAddress"]); + this.SubnetMask = Null.SetNullString(dr["SubnetMask"]); + this.RuleType = Null.SetNullInteger(dr["RuleType"]); - FillInternal(dr); + this.FillInternal(dr); } /// @@ -100,11 +100,11 @@ public int KeyID { get { - return IPFilterID; + return this.IPFilterID; } set { - IPFilterID = value; + this.IPFilterID = value; } } diff --git a/DNN Platform/Library/Entities/Modules/Actions/ActionEventArgs.cs b/DNN Platform/Library/Entities/Modules/Actions/ActionEventArgs.cs index 72df0a7bd9f..17fe269f93a 100644 --- a/DNN Platform/Library/Entities/Modules/Actions/ActionEventArgs.cs +++ b/DNN Platform/Library/Entities/Modules/Actions/ActionEventArgs.cs @@ -34,8 +34,8 @@ public class ActionEventArgs : EventArgs ///----------------------------------------------------------------------------- public ActionEventArgs(ModuleAction Action, ModuleInfo ModuleConfiguration) { - _action = Action; - _moduleConfiguration = ModuleConfiguration; + this._action = Action; + this._moduleConfiguration = ModuleConfiguration; } ///----------------------------------------------------------------------------- @@ -49,7 +49,7 @@ public ModuleAction Action { get { - return _action; + return this._action; } } @@ -64,7 +64,7 @@ public ModuleInfo ModuleConfiguration { get { - return _moduleConfiguration; + return this._moduleConfiguration; } } } diff --git a/DNN Platform/Library/Entities/Modules/Actions/ModuleAction.cs b/DNN Platform/Library/Entities/Modules/Actions/ModuleAction.cs index 4d64dce64ba..83450ce46fd 100644 --- a/DNN Platform/Library/Entities/Modules/Actions/ModuleAction.cs +++ b/DNN Platform/Library/Entities/Modules/Actions/ModuleAction.cs @@ -94,18 +94,18 @@ public ModuleAction(int id, string title, string cmdName, string cmdArg, string public ModuleAction(int id, string title, string cmdName, string cmdArg, string icon, string url, string clientScript, bool useActionEvent, SecurityAccessLevel secure, bool visible, bool newWindow) { - ID = id; - Title = title; - CommandName = cmdName; - CommandArgument = cmdArg; - Icon = icon; - Url = url; - ClientScript = clientScript; - UseActionEvent = useActionEvent; - Secure = secure; - Visible = visible; - NewWindow = newWindow; - Actions = new ModuleActionCollection(); + this.ID = id; + this.Title = title; + this.CommandName = cmdName; + this.CommandArgument = cmdArg; + this.Icon = icon; + this.Url = url; + this.ClientScript = clientScript; + this.UseActionEvent = useActionEvent; + this.Secure = secure; + this.Visible = visible; + this.NewWindow = newWindow; + this.Actions = new ModuleActionCollection(); } ///----------------------------------------------------------------------------- @@ -193,27 +193,27 @@ internal string ControlKey get { string controlKey = String.Empty; - if (!String.IsNullOrEmpty(Url)) + if (!String.IsNullOrEmpty(this.Url)) { - int startIndex = Url.IndexOf("/ctl/"); + int startIndex = this.Url.IndexOf("/ctl/"); int endIndex = -1; if (startIndex > -1) { startIndex += 4; - endIndex = Url.IndexOf("/", startIndex + 1); + endIndex = this.Url.IndexOf("/", startIndex + 1); } else { - startIndex = Url.IndexOf("ctl="); + startIndex = this.Url.IndexOf("ctl="); if (startIndex > -1) { startIndex += 4; - endIndex = Url.IndexOf("&", startIndex + 1); + endIndex = this.Url.IndexOf("&", startIndex + 1); } } if (startIndex > -1) { - controlKey = endIndex > -1 ? Url.Substring(startIndex + 1, endIndex - startIndex - 1) : Url.Substring(startIndex + 1); + controlKey = endIndex > -1 ? this.Url.Substring(startIndex + 1, endIndex - startIndex - 1) : this.Url.Substring(startIndex + 1); } } return controlKey; @@ -303,7 +303,7 @@ internal string ControlKey ///----------------------------------------------------------------------------- public bool HasChildren() { - return (Actions.Count > 0); + return (this.Actions.Count > 0); } } } diff --git a/DNN Platform/Library/Entities/Modules/Actions/ModuleActionCollection.cs b/DNN Platform/Library/Entities/Modules/Actions/ModuleActionCollection.cs index b3cbfda48b6..fbb41bce90d 100644 --- a/DNN Platform/Library/Entities/Modules/Actions/ModuleActionCollection.cs +++ b/DNN Platform/Library/Entities/Modules/Actions/ModuleActionCollection.cs @@ -47,7 +47,7 @@ public ModuleActionCollection() ///----------------------------------------------------------------------------- public ModuleActionCollection(ModuleActionCollection value) { - AddRange(value); + this.AddRange(value); } /// ----------------------------------------------------------------------------- @@ -62,7 +62,7 @@ public ModuleActionCollection(ModuleActionCollection value) ///----------------------------------------------------------------------------- public ModuleActionCollection(ModuleAction[] value) { - AddRange(value); + this.AddRange(value); } ///----------------------------------------------------------------------------- @@ -81,11 +81,11 @@ public ModuleAction this[int index] { get { - return (ModuleAction) List[index]; + return (ModuleAction) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } @@ -98,7 +98,7 @@ public ModuleAction this[int index] ///----------------------------------------------------------------------------- public int Add(ModuleAction value) { - return List.Add(value); + return this.List.Add(value); } ///----------------------------------------------------------------------------- @@ -115,7 +115,7 @@ public int Add(ModuleAction value) ///----------------------------------------------------------------------------- public ModuleAction Add(int ID, string Title, string CmdName) { - return Add(ID, Title, CmdName, string.Empty, string.Empty, string.Empty, false, SecurityAccessLevel.Anonymous, true, false); + return this.Add(ID, Title, CmdName, string.Empty, string.Empty, string.Empty, false, SecurityAccessLevel.Anonymous, true, false); } ///----------------------------------------------------------------------------- @@ -142,7 +142,7 @@ public ModuleAction Add(int ID, string Title, string CmdName) ///----------------------------------------------------------------------------- public ModuleAction Add(int ID, string Title, string CmdName, string CmdArg, string Icon, string Url, bool UseActionEvent, SecurityAccessLevel Secure, bool Visible, bool NewWindow) { - return Add(ID, Title, CmdName, CmdArg, Icon, Url, "", UseActionEvent, Secure, Visible, NewWindow); + return this.Add(ID, Title, CmdName, CmdArg, Icon, Url, "", UseActionEvent, Secure, Visible, NewWindow); } /// ----------------------------------------------------------------------------- @@ -174,7 +174,7 @@ public ModuleAction Add(int ID, string Title, string CmdName, string CmdArg, str bool NewWindow) { var ModAction = new ModuleAction(ID, Title, CmdName, CmdArg, Icon, Url, ClientScript, UseActionEvent, Secure, Visible, NewWindow); - Add(ModAction); + this.Add(ModAction); return ModAction; } @@ -191,7 +191,7 @@ public void AddRange(ModuleAction[] value) int i; for (i = 0; i <= value.Length - 1; i++) { - Add(value[i]); + this.Add(value[i]); } } @@ -207,7 +207,7 @@ public void AddRange(ModuleActionCollection value) { foreach (ModuleAction mA in value) { - Add(mA); + this.Add(mA); } } @@ -232,7 +232,7 @@ public void AddRange(ModuleActionCollection value) public bool Contains(ModuleAction value) { //If value is not of type ModuleAction, this will return false. - return List.Contains(value); + return this.List.Contains(value); } public ModuleAction GetActionByCommandName(string name) @@ -240,7 +240,7 @@ public ModuleAction GetActionByCommandName(string name) ModuleAction retAction = null; //Check each action in the List - foreach (ModuleAction modAction in List) + foreach (ModuleAction modAction in this.List) { if (modAction.CommandName == name) { @@ -266,7 +266,7 @@ public ModuleActionCollection GetActionsByCommandName(string name) var retActions = new ModuleActionCollection(); //Check each action in the List - foreach (ModuleAction modAction in List) + foreach (ModuleAction modAction in this.List) { if (modAction.CommandName == name) { @@ -286,7 +286,7 @@ public ModuleAction GetActionByID(int id) ModuleAction retAction = null; //Check each action in the List - foreach (ModuleAction modAction in List) + foreach (ModuleAction modAction in this.List) { if (modAction.ID == id) { @@ -327,7 +327,7 @@ public ModuleAction GetActionByID(int id) ///----------------------------------------------------------------------------- public int IndexOf(ModuleAction value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } ///----------------------------------------------------------------------------- @@ -346,7 +346,7 @@ public int IndexOf(ModuleAction value) ///----------------------------------------------------------------------------- public void Insert(int index, ModuleAction value) { - List.Insert(index, value); + this.List.Insert(index, value); } ///----------------------------------------------------------------------------- @@ -364,7 +364,7 @@ public void Insert(int index, ModuleAction value) ///----------------------------------------------------------------------------- public void Remove(ModuleAction value) { - List.Remove(value); + this.List.Remove(value); } } } diff --git a/DNN Platform/Library/Entities/Modules/Actions/ModuleActionEventListener.cs b/DNN Platform/Library/Entities/Modules/Actions/ModuleActionEventListener.cs index e0215ca5841..34a6aebc8bf 100644 --- a/DNN Platform/Library/Entities/Modules/Actions/ModuleActionEventListener.cs +++ b/DNN Platform/Library/Entities/Modules/Actions/ModuleActionEventListener.cs @@ -29,8 +29,8 @@ public class ModuleActionEventListener ///----------------------------------------------------------------------------- public ModuleActionEventListener(int ModID, ActionEventHandler e) { - _moduleID = ModID; - _actionEvent = e; + this._moduleID = ModID; + this._actionEvent = e; } ///----------------------------------------------------------------------------- @@ -44,7 +44,7 @@ public int ModuleID { get { - return _moduleID; + return this._moduleID; } } @@ -59,7 +59,7 @@ public ActionEventHandler ActionEvent { get { - return _actionEvent; + return this._actionEvent; } } } diff --git a/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicate.cs b/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicate.cs index 5dea7ccedc5..0ab9277f333 100644 --- a/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicate.cs +++ b/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicate.cs @@ -30,7 +30,7 @@ public ModuleCommunicators ModuleCommunicators { get { - return _ModuleCommunicators; + return this._ModuleCommunicators; } } @@ -44,7 +44,7 @@ public ModuleListeners ModuleListeners { get { - return _ModuleListeners; + return this._ModuleListeners; } } @@ -58,24 +58,24 @@ public void LoadCommunicator(Control ctrl) // Check and see if the module implements IModuleCommunicator if (ctrl is IModuleCommunicator) { - Add((IModuleCommunicator) ctrl); + this.Add((IModuleCommunicator) ctrl); } // Check and see if the module implements IModuleListener if (ctrl is IModuleListener) { - Add((IModuleListener) ctrl); + this.Add((IModuleListener) ctrl); } } private int Add(IModuleCommunicator item) { - int returnData = _ModuleCommunicators.Add(item); + int returnData = this._ModuleCommunicators.Add(item); int i = 0; - for (i = 0; i <= _ModuleListeners.Count - 1; i++) + for (i = 0; i <= this._ModuleListeners.Count - 1; i++) { - item.ModuleCommunication += _ModuleListeners[i].OnModuleCommunication; + item.ModuleCommunication += this._ModuleListeners[i].OnModuleCommunication; } @@ -84,12 +84,12 @@ private int Add(IModuleCommunicator item) private int Add(IModuleListener item) { - int returnData = _ModuleListeners.Add(item); + int returnData = this._ModuleListeners.Add(item); int i = 0; - for (i = 0; i <= _ModuleCommunicators.Count - 1; i++) + for (i = 0; i <= this._ModuleCommunicators.Count - 1; i++) { - _ModuleCommunicators[i].ModuleCommunication += item.OnModuleCommunication; + this._ModuleCommunicators[i].ModuleCommunication += item.OnModuleCommunication; } return returnData; diff --git a/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicationEventArgs.cs b/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicationEventArgs.cs index 2d8f7e3dfad..547a8cbbf6a 100644 --- a/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicationEventArgs.cs +++ b/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicationEventArgs.cs @@ -18,15 +18,15 @@ public ModuleCommunicationEventArgs() public ModuleCommunicationEventArgs(string text) { - Text = text; + this.Text = text; } public ModuleCommunicationEventArgs(string type, object value, string sender, string target) { - Type = type; - Value = value; - Sender = sender; - Target = target; + this.Type = type; + this.Value = value; + this.Sender = sender; + this.Target = target; } public string Sender { get; set; } diff --git a/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicators.cs b/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicators.cs index 7f4ab079bf0..b652d3c1421 100644 --- a/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicators.cs +++ b/DNN Platform/Library/Entities/Modules/Communications/ModuleCommunicators.cs @@ -16,17 +16,17 @@ public IModuleCommunicator this[int index] { get { - return (IModuleCommunicator) List[index]; + return (IModuleCommunicator) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public int Add(IModuleCommunicator item) { - return List.Add(item); + return this.List.Add(item); } } } diff --git a/DNN Platform/Library/Entities/Modules/Communications/ModuleListeners.cs b/DNN Platform/Library/Entities/Modules/Communications/ModuleListeners.cs index 83ffd4e8114..090d794c734 100644 --- a/DNN Platform/Library/Entities/Modules/Communications/ModuleListeners.cs +++ b/DNN Platform/Library/Entities/Modules/Communications/ModuleListeners.cs @@ -16,17 +16,17 @@ public IModuleListener this[int index] { get { - return (IModuleListener) List[index]; + return (IModuleListener) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public int Add(IModuleListener item) { - return List.Add(item); + return this.List.Add(item); } } } diff --git a/DNN Platform/Library/Entities/Modules/ControlInfo.cs b/DNN Platform/Library/Entities/Modules/ControlInfo.cs index 1f964293aaf..4270e805547 100644 --- a/DNN Platform/Library/Entities/Modules/ControlInfo.cs +++ b/DNN Platform/Library/Entities/Modules/ControlInfo.cs @@ -28,7 +28,7 @@ public abstract class ControlInfo : BaseEntityInfo { protected ControlInfo() { - SupportsPartialRendering = Null.NullBoolean; + this.SupportsPartialRendering = Null.NullBoolean; } /// ----------------------------------------------------------------------------- @@ -66,9 +66,9 @@ protected override void FillInternal(IDataReader dr) { //Call EntityBaseInfo's implementation base.FillInternal(dr); - ControlKey = Null.SetNullString(dr["ControlKey"]); - ControlSrc = Null.SetNullString(dr["ControlSrc"]); - SupportsPartialRendering = Null.SetNullBoolean(dr["SupportsPartialRendering"]); + this.ControlKey = Null.SetNullString(dr["ControlKey"]); + this.ControlSrc = Null.SetNullString(dr["ControlSrc"]); + this.SupportsPartialRendering = Null.SetNullBoolean(dr["SupportsPartialRendering"]); } protected void ReadXmlInternal(XmlReader reader) @@ -76,16 +76,16 @@ protected void ReadXmlInternal(XmlReader reader) switch (reader.Name) { case "controlKey": - ControlKey = reader.ReadElementContentAsString(); + this.ControlKey = reader.ReadElementContentAsString(); break; case "controlSrc": - ControlSrc = reader.ReadElementContentAsString(); + this.ControlSrc = reader.ReadElementContentAsString(); break; case "supportsPartialRendering": string elementvalue = reader.ReadElementContentAsString(); if (!string.IsNullOrEmpty(elementvalue)) { - SupportsPartialRendering = bool.Parse(elementvalue); + this.SupportsPartialRendering = bool.Parse(elementvalue); } break; } @@ -94,9 +94,9 @@ protected void ReadXmlInternal(XmlReader reader) protected void WriteXmlInternal(XmlWriter writer) { //write out properties - writer.WriteElementString("controlKey", ControlKey); - writer.WriteElementString("controlSrc", ControlSrc); - writer.WriteElementString("supportsPartialRendering", SupportsPartialRendering.ToString()); + writer.WriteElementString("controlKey", this.ControlKey); + writer.WriteElementString("controlSrc", this.ControlSrc); + writer.WriteElementString("supportsPartialRendering", this.SupportsPartialRendering.ToString()); } } } diff --git a/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionController.cs b/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionController.cs index 1b25587036e..9ff0514a1d9 100644 --- a/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionController.cs +++ b/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionController.cs @@ -59,7 +59,7 @@ private static object GetModuleDefinitionsCallBack(CacheItemArgs cacheItemArgs) /// ----------------------------------------------------------------------------- public void DeleteModuleDefinition(ModuleDefinitionInfo objModuleDefinition) { - DeleteModuleDefinition(objModuleDefinition.ModuleDefID); + this.DeleteModuleDefinition(objModuleDefinition.ModuleDefID); } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionInfo.cs b/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionInfo.cs index 861d1a49318..6e820fbe646 100644 --- a/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionInfo.cs +++ b/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionInfo.cs @@ -35,9 +35,9 @@ public class ModuleDefinitionInfo : IXmlSerializable, IHydratable public ModuleDefinitionInfo() { - Permissions = new Dictionary(); - DesktopModuleID = Null.NullInteger; - ModuleDefID = Null.NullInteger; + this.Permissions = new Dictionary(); + this.DesktopModuleID = Null.NullInteger; + this.ModuleDefID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -79,15 +79,15 @@ public string DefinitionName { get { - if(String.IsNullOrEmpty(_definitionName)) + if(String.IsNullOrEmpty(this._definitionName)) { - return FriendlyName; + return this.FriendlyName; } - return _definitionName; + return this._definitionName; } - set { _definitionName = value; } + set { this._definitionName = value; } } /// ----------------------------------------------------------------------------- @@ -100,11 +100,11 @@ public Dictionary ModuleControls { get { - if (_ModuleControls == null) + if (this._ModuleControls == null) { - LoadControls(); + this.LoadControls(); } - return _ModuleControls; + return this._ModuleControls; } } @@ -126,13 +126,13 @@ public Dictionary ModuleControls /// ----------------------------------------------------------------------------- public void Fill(IDataReader dr) { - ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); - DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); - DefaultCacheTime = Null.SetNullInteger(dr["DefaultCacheTime"]); - FriendlyName = Null.SetNullString(dr["FriendlyName"]); + this.ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); + this.DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); + this.DefaultCacheTime = Null.SetNullInteger(dr["DefaultCacheTime"]); + this.FriendlyName = Null.SetNullString(dr["FriendlyName"]); if (dr.GetSchemaTable().Select("ColumnName = 'DefinitionName'").Length > 0) { - DefinitionName = Null.SetNullString(dr["DefinitionName"]); + this.DefinitionName = Null.SetNullString(dr["DefinitionName"]); } } @@ -146,11 +146,11 @@ public int KeyID { get { - return ModuleDefID; + return this.ModuleDefID; } set { - ModuleDefID = value; + this.ModuleDefID = value; } } @@ -188,7 +188,7 @@ public void ReadXml(XmlReader reader) } if (reader.NodeType == XmlNodeType.Element && reader.Name == "moduleControls") { - ReadModuleControls(reader); + this.ReadModuleControls(reader); } else { @@ -197,20 +197,20 @@ public void ReadXml(XmlReader reader) case "moduleDefinition": break; case "friendlyName": - FriendlyName = reader.ReadElementContentAsString(); + this.FriendlyName = reader.ReadElementContentAsString(); break; case "defaultCacheTime": string elementvalue = reader.ReadElementContentAsString(); if (!string.IsNullOrEmpty(elementvalue)) { - DefaultCacheTime = int.Parse(elementvalue); + this.DefaultCacheTime = int.Parse(elementvalue); } break; case "permissions": //Ignore permissons node reader.Skip(); break; case "definitionName": - DefinitionName = reader.ReadElementContentAsString(); + this.DefinitionName = reader.ReadElementContentAsString(); break; default: if(reader.NodeType == XmlNodeType.Element && !String.IsNullOrEmpty(reader.Name)) @@ -235,14 +235,14 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("moduleDefinition"); //write out properties - writer.WriteElementString("friendlyName", FriendlyName); - writer.WriteElementString("definitionName", DefinitionName); - writer.WriteElementString("defaultCacheTime", DefaultCacheTime.ToString()); + writer.WriteElementString("friendlyName", this.FriendlyName); + writer.WriteElementString("definitionName", this.DefinitionName); + writer.WriteElementString("defaultCacheTime", this.DefaultCacheTime.ToString()); //Write start of Module Controls writer.WriteStartElement("moduleControls"); //Iterate through controls - foreach (ModuleControlInfo control in ModuleControls.Values) + foreach (ModuleControlInfo control in this.ModuleControls.Values) { control.WriteXml(writer); } @@ -257,7 +257,7 @@ public void WriteXml(XmlWriter writer) public void LoadControls() { - _ModuleControls = ModuleDefID > Null.NullInteger ? ModuleControlController.GetModuleControlsByModuleDefinitionID(ModuleDefID) : new Dictionary(); + this._ModuleControls = this.ModuleDefID > Null.NullInteger ? ModuleControlController.GetModuleControlsByModuleDefinitionID(this.ModuleDefID) : new Dictionary(); } /// ----------------------------------------------------------------------------- @@ -274,7 +274,7 @@ private void ReadModuleControls(XmlReader reader) reader.ReadStartElement("moduleControl"); var moduleControl = new ModuleControlInfo(); moduleControl.ReadXml(reader); - ModuleControls.Add(moduleControl.ControlKey, moduleControl); + this.ModuleControls.Add(moduleControl.ControlKey, moduleControl); } while (reader.ReadToNextSibling("moduleControl")); } } diff --git a/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionValidator.cs b/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionValidator.cs index 4cc9b46bd3f..ab3a38f69bb 100644 --- a/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionValidator.cs +++ b/DNN Platform/Library/Entities/Modules/Definitions/ModuleDefinitionValidator.cs @@ -31,7 +31,7 @@ public class ModuleDefinitionValidator : XmlValidatorBase { private string GetDnnSchemaPath(Stream xmlStream) { - ModuleDefinitionVersion Version = GetModuleDefinitionVersion(xmlStream); + ModuleDefinitionVersion Version = this.GetModuleDefinitionVersion(xmlStream); string schemaPath = ""; switch (Version) { @@ -116,7 +116,7 @@ public ModuleDefinitionVersion GetModuleDefinitionVersion(Stream xmlStream) public override bool Validate(Stream XmlStream) { - SchemaSet.Add("", GetDnnSchemaPath(XmlStream)); + this.SchemaSet.Add("", this.GetDnnSchemaPath(XmlStream)); return base.Validate(XmlStream); } } diff --git a/DNN Platform/Library/Entities/Modules/DesktopModuleController.cs b/DNN Platform/Library/Entities/Modules/DesktopModuleController.cs index fc7dfdd37ec..78af9a9bcc4 100644 --- a/DNN Platform/Library/Entities/Modules/DesktopModuleController.cs +++ b/DNN Platform/Library/Entities/Modules/DesktopModuleController.cs @@ -138,7 +138,7 @@ public static void AddModuleCategory(string category) /// ----------------------------------------------------------------------------- public void DeleteDesktopModule(DesktopModuleInfo objDesktopModule) { - DeleteDesktopModule(objDesktopModule.DesktopModuleID); + this.DeleteDesktopModule(objDesktopModule.DesktopModuleID); } /// ----------------------------------------------------------------------------- @@ -371,12 +371,12 @@ internal static int SaveDesktopModule(DesktopModuleInfo desktopModule, bool save public void UpdateModuleInterfaces(ref DesktopModuleInfo desktopModuleInfo) { - UpdateModuleInterfaces(ref desktopModuleInfo, (UserController.Instance.GetCurrentUserInfo() == null) ? "" : UserController.Instance.GetCurrentUserInfo().Username, true); + this.UpdateModuleInterfaces(ref desktopModuleInfo, (UserController.Instance.GetCurrentUserInfo() == null) ? "" : UserController.Instance.GetCurrentUserInfo().Username, true); } public void UpdateModuleInterfaces(ref DesktopModuleInfo desktopModuleInfo, string sender, bool forceAppRestart) { - CheckInterfacesImplementation(ref desktopModuleInfo); + this.CheckInterfacesImplementation(ref desktopModuleInfo); var oAppStartMessage = new EventMessage { Sender = sender, diff --git a/DNN Platform/Library/Entities/Modules/DesktopModuleInfo.cs b/DNN Platform/Library/Entities/Modules/DesktopModuleInfo.cs index 6ca55eec4fe..664ec19e8cf 100644 --- a/DNN Platform/Library/Entities/Modules/DesktopModuleInfo.cs +++ b/DNN Platform/Library/Entities/Modules/DesktopModuleInfo.cs @@ -63,12 +63,12 @@ public class PageInfo : IXmlSerializable public bool HasAdminPage() { - return Type.IndexOf("admin", StringComparison.InvariantCultureIgnoreCase) > Null.NullInteger; + return this.Type.IndexOf("admin", StringComparison.InvariantCultureIgnoreCase) > Null.NullInteger; } public bool HasHostPage() { - return Type.IndexOf("host", StringComparison.InvariantCultureIgnoreCase) > Null.NullInteger; + return this.Type.IndexOf("host", StringComparison.InvariantCultureIgnoreCase) > Null.NullInteger; } @@ -101,26 +101,26 @@ public void ReadXml(XmlReader reader) switch (reader.Name) { case "page": - Type = reader.GetAttribute("type"); + this.Type = reader.GetAttribute("type"); var commonValue = reader.GetAttribute("common"); if (!string.IsNullOrEmpty(commonValue)) { - IsCommon = commonValue.Equals("true", StringComparison.InvariantCultureIgnoreCase); + this.IsCommon = commonValue.Equals("true", StringComparison.InvariantCultureIgnoreCase); } reader.Read(); break; case "name": - Name = reader.ReadElementContentAsString(); + this.Name = reader.ReadElementContentAsString(); break; case "icon": - Icon = reader.ReadElementContentAsString(); + this.Icon = reader.ReadElementContentAsString(); break; case "largeIcon": - LargeIcon = reader.ReadElementContentAsString(); + this.LargeIcon = reader.ReadElementContentAsString(); break; case "description": - Description = reader.ReadElementContentAsString(); + this.Description = reader.ReadElementContentAsString(); break; default: reader.Read(); @@ -133,14 +133,14 @@ public void WriteXml(XmlWriter writer) { //Write start of main elemenst writer.WriteStartElement("page"); - writer.WriteAttributeString("type", Type); - writer.WriteAttributeString("common", IsCommon.ToString().ToLowerInvariant()); + writer.WriteAttributeString("type", this.Type); + writer.WriteAttributeString("common", this.IsCommon.ToString().ToLowerInvariant()); //write out properties - writer.WriteElementString("name", Name); - writer.WriteElementString("icon", Icon); - writer.WriteElementString("largeIcon", LargeIcon); - writer.WriteElementString("description", Description); + writer.WriteElementString("name", this.Name); + writer.WriteElementString("icon", this.Icon); + writer.WriteElementString("largeIcon", this.LargeIcon); + writer.WriteElementString("description", this.Description); //Write end of main element writer.WriteEndElement(); @@ -154,13 +154,13 @@ public void WriteXml(XmlWriter writer) public DesktopModuleInfo() { - IsPremium = Null.NullBoolean; - IsAdmin = Null.NullBoolean; - CodeSubDirectory = Null.NullString; - PackageID = Null.NullInteger; - DesktopModuleID = Null.NullInteger; - SupportedFeatures = Null.NullInteger; - Shareable = ModuleSharing.Unknown; + this.IsPremium = Null.NullBoolean; + this.IsAdmin = Null.NullBoolean; + this.CodeSubDirectory = Null.NullString; + this.PackageID = Null.NullInteger; + this.DesktopModuleID = Null.NullInteger; + this.SupportedFeatures = Null.NullInteger; + this.Shareable = ModuleSharing.Unknown; } #region "Public Properties" @@ -198,12 +198,12 @@ public string Category { get { - Term term = (from Term t in Terms select t).FirstOrDefault(); + Term term = (from Term t in this.Terms select t).FirstOrDefault(); return (term != null) ? term.Name : String.Empty; } set { - Terms.Clear(); + this.Terms.Clear(); ITermController termController = Util.GetTermController(); var term = (from Term t in termController.GetTermsByVocabulary("Module_Categories") where t.Name == value @@ -211,7 +211,7 @@ public string Category .FirstOrDefault(); if (term != null) { - Terms.Add(term); + this.Terms.Add(term); } } } @@ -288,11 +288,11 @@ public bool IsPortable { get { - return GetFeature(DesktopModuleSupportedFeature.IsPortable); + return this.GetFeature(DesktopModuleSupportedFeature.IsPortable); } set { - UpdateFeature(DesktopModuleSupportedFeature.IsPortable, value); + this.UpdateFeature(DesktopModuleSupportedFeature.IsPortable, value); } } @@ -314,11 +314,11 @@ public bool IsSearchable { get { - return GetFeature(DesktopModuleSupportedFeature.IsSearchable); + return this.GetFeature(DesktopModuleSupportedFeature.IsSearchable); } set { - UpdateFeature(DesktopModuleSupportedFeature.IsSearchable, value); + this.UpdateFeature(DesktopModuleSupportedFeature.IsSearchable, value); } } @@ -332,11 +332,11 @@ public bool IsUpgradeable { get { - return GetFeature(DesktopModuleSupportedFeature.IsUpgradeable); + return this.GetFeature(DesktopModuleSupportedFeature.IsUpgradeable); } set { - UpdateFeature(DesktopModuleSupportedFeature.IsUpgradeable, value); + this.UpdateFeature(DesktopModuleSupportedFeature.IsUpgradeable, value); } } @@ -359,18 +359,18 @@ public Dictionary ModuleDefinitions { get { - if (_moduleDefinitions == null) + if (this._moduleDefinitions == null) { - if (DesktopModuleID > Null.NullInteger) + if (this.DesktopModuleID > Null.NullInteger) { - _moduleDefinitions = ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(DesktopModuleID); + this._moduleDefinitions = ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(this.DesktopModuleID); } else { - _moduleDefinitions = new Dictionary(); + this._moduleDefinitions = new Dictionary(); } } - return _moduleDefinitions; + return this._moduleDefinitions; } } @@ -410,9 +410,9 @@ public PageInfo Page { get { - if (_pageInfo == null && PackageID > Null.NullInteger) + if (this._pageInfo == null && this.PackageID > Null.NullInteger) { - var package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == PackageID); + var package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == this.PackageID); if (package != null && !string.IsNullOrEmpty(package.Manifest)) { var xmlDocument = new XmlDocument { XmlResolver = null }; @@ -420,16 +420,16 @@ public PageInfo Page var pageNode = xmlDocument.SelectSingleNode("//package//components//component[@type=\"Module\"]//page"); if (pageNode != null) { - _pageInfo = CBO.DeserializeObject(new StringReader(pageNode.OuterXml)); + this._pageInfo = CBO.DeserializeObject(new StringReader(pageNode.OuterXml)); } } } - return _pageInfo; + return this._pageInfo; } set { - _pageInfo = value; + this._pageInfo = value; } } @@ -445,24 +445,24 @@ public PageInfo Page /// ----------------------------------------------------------------------------- public override void Fill(IDataReader dr) { - DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); - PackageID = Null.SetNullInteger(dr["PackageID"]); - ModuleName = Null.SetNullString(dr["ModuleName"]); - FriendlyName = Null.SetNullString(dr["FriendlyName"]); - Description = Null.SetNullString(dr["Description"]); - FolderName = Null.SetNullString(dr["FolderName"]); - Version = Null.SetNullString(dr["Version"]); - Description = Null.SetNullString(dr["Description"]); - IsPremium = Null.SetNullBoolean(dr["IsPremium"]); - IsAdmin = Null.SetNullBoolean(dr["IsAdmin"]); - BusinessControllerClass = Null.SetNullString(dr["BusinessControllerClass"]); - SupportedFeatures = Null.SetNullInteger(dr["SupportedFeatures"]); - CompatibleVersions = Null.SetNullString(dr["CompatibleVersions"]); - Dependencies = Null.SetNullString(dr["Dependencies"]); - Permissions = Null.SetNullString(dr["Permissions"]); - Shareable = (ModuleSharing)Null.SetNullInteger(dr["Shareable"]); - AdminPage = Null.SetNullString(dr["AdminPage"]); - HostPage = Null.SetNullString(dr["HostPage"]); + this.DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); + this.PackageID = Null.SetNullInteger(dr["PackageID"]); + this.ModuleName = Null.SetNullString(dr["ModuleName"]); + this.FriendlyName = Null.SetNullString(dr["FriendlyName"]); + this.Description = Null.SetNullString(dr["Description"]); + this.FolderName = Null.SetNullString(dr["FolderName"]); + this.Version = Null.SetNullString(dr["Version"]); + this.Description = Null.SetNullString(dr["Description"]); + this.IsPremium = Null.SetNullBoolean(dr["IsPremium"]); + this.IsAdmin = Null.SetNullBoolean(dr["IsAdmin"]); + this.BusinessControllerClass = Null.SetNullString(dr["BusinessControllerClass"]); + this.SupportedFeatures = Null.SetNullInteger(dr["SupportedFeatures"]); + this.CompatibleVersions = Null.SetNullString(dr["CompatibleVersions"]); + this.Dependencies = Null.SetNullString(dr["Dependencies"]); + this.Permissions = Null.SetNullString(dr["Permissions"]); + this.Shareable = (ModuleSharing)Null.SetNullInteger(dr["Shareable"]); + this.AdminPage = Null.SetNullString(dr["AdminPage"]); + this.HostPage = Null.SetNullString(dr["HostPage"]); //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); } @@ -501,19 +501,19 @@ public void ReadXml(XmlReader reader) } if (reader.NodeType == XmlNodeType.Element && reader.Name == "moduleDefinitions" && !reader.IsEmptyElement) { - ReadModuleDefinitions(reader); + this.ReadModuleDefinitions(reader); } else if (reader.NodeType == XmlNodeType.Element && reader.Name == "supportedFeatures" && !reader.IsEmptyElement) { - ReadSupportedFeatures(reader); + this.ReadSupportedFeatures(reader); } else if (reader.NodeType == XmlNodeType.Element && reader.Name == "shareable" && !reader.IsEmptyElement) { - ReadModuleSharing(reader); + this.ReadModuleSharing(reader); } else if (reader.NodeType == XmlNodeType.Element && reader.Name == "page" && !reader.IsEmptyElement) { - ReadPageInfo(reader); + this.ReadPageInfo(reader); } else { @@ -522,39 +522,39 @@ public void ReadXml(XmlReader reader) case "desktopModule": break; case "moduleName": - ModuleName = reader.ReadElementContentAsString(); + this.ModuleName = reader.ReadElementContentAsString(); break; case "foldername": - FolderName = reader.ReadElementContentAsString(); + this.FolderName = reader.ReadElementContentAsString(); break; case "businessControllerClass": - BusinessControllerClass = reader.ReadElementContentAsString(); + this.BusinessControllerClass = reader.ReadElementContentAsString(); break; case "codeSubDirectory": - CodeSubDirectory = reader.ReadElementContentAsString(); + this.CodeSubDirectory = reader.ReadElementContentAsString(); break; case "page": - ReadPageInfo(reader); + this.ReadPageInfo(reader); - if (Page.HasAdminPage()) + if (this.Page.HasAdminPage()) { - AdminPage = Page.Name; + this.AdminPage = this.Page.Name; } - if (Page.HasHostPage()) + if (this.Page.HasHostPage()) { - HostPage = Page.Name; + this.HostPage = this.Page.Name; } break; case "isAdmin": bool isAdmin; Boolean.TryParse(reader.ReadElementContentAsString(), out isAdmin); - IsAdmin = isAdmin; + this.IsAdmin = isAdmin; break; case "isPremium": bool isPremium; Boolean.TryParse(reader.ReadElementContentAsString(), out isPremium); - IsPremium = isPremium; + this.IsPremium = isPremium; break; default: if(reader.NodeType == XmlNodeType.Element && !String.IsNullOrEmpty(reader.Name)) @@ -580,29 +580,29 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("desktopModule"); //write out properties - writer.WriteElementString("moduleName", ModuleName); - writer.WriteElementString("foldername", FolderName); - writer.WriteElementString("businessControllerClass", BusinessControllerClass); - if (!string.IsNullOrEmpty(CodeSubDirectory)) + writer.WriteElementString("moduleName", this.ModuleName); + writer.WriteElementString("foldername", this.FolderName); + writer.WriteElementString("businessControllerClass", this.BusinessControllerClass); + if (!string.IsNullOrEmpty(this.CodeSubDirectory)) { - writer.WriteElementString("codeSubDirectory", CodeSubDirectory); + writer.WriteElementString("codeSubDirectory", this.CodeSubDirectory); } //Write out Supported Features writer.WriteStartElement("supportedFeatures"); - if (IsPortable) + if (this.IsPortable) { writer.WriteStartElement("supportedFeature"); writer.WriteAttributeString("type", "Portable"); writer.WriteEndElement(); } - if (IsSearchable) + if (this.IsSearchable) { writer.WriteStartElement("supportedFeature"); writer.WriteAttributeString("type", "Searchable"); writer.WriteEndElement(); } - if (IsUpgradeable) + if (this.IsUpgradeable) { writer.WriteStartElement("supportedFeature"); writer.WriteAttributeString("type", "Upgradeable"); @@ -613,17 +613,17 @@ public void WriteXml(XmlWriter writer) writer.WriteEndElement(); //Write admin/host page info. - if (Page != null) + if (this.Page != null) { - Page.WriteXml(writer); + this.Page.WriteXml(writer); } // Module sharing - if(Shareable != ModuleSharing.Unknown) + if(this.Shareable != ModuleSharing.Unknown) { writer.WriteStartElement("shareable"); - switch (Shareable) + switch (this.Shareable) { case ModuleSharing.Supported: writer.WriteString("Supported"); @@ -639,7 +639,7 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("moduleDefinitions"); //Iterate through definitions - foreach (ModuleDefinitionInfo definition in ModuleDefinitions.Values) + foreach (ModuleDefinitionInfo definition in this.ModuleDefinitions.Values) { definition.WriteXml(writer); } @@ -663,7 +663,7 @@ public void WriteXml(XmlWriter writer) private void ClearFeature(DesktopModuleSupportedFeature feature) { //And with the 1's complement of Feature to Clear the Feature flag - SupportedFeatures = SupportedFeatures & ~((int) feature); + this.SupportedFeatures = this.SupportedFeatures & ~((int) feature); } /// ----------------------------------------------------------------------------- @@ -674,7 +674,7 @@ private void ClearFeature(DesktopModuleSupportedFeature feature) /// ----------------------------------------------------------------------------- private bool GetFeature(DesktopModuleSupportedFeature feature) { - return SupportedFeatures > Null.NullInteger && (SupportedFeatures & (int) feature) == (int) feature; + return this.SupportedFeatures > Null.NullInteger && (this.SupportedFeatures & (int) feature) == (int) feature; } /// ----------------------------------------------------------------------------- @@ -685,7 +685,7 @@ private bool GetFeature(DesktopModuleSupportedFeature feature) /// ----------------------------------------------------------------------------- private void SetFeature(DesktopModuleSupportedFeature feature) { - SupportedFeatures |= (int) feature; + this.SupportedFeatures |= (int) feature; } /// ----------------------------------------------------------------------------- @@ -699,11 +699,11 @@ private void UpdateFeature(DesktopModuleSupportedFeature feature, bool isSet) { if (isSet) { - SetFeature(feature); + this.SetFeature(feature); } else { - ClearFeature(feature); + this.ClearFeature(feature); } } @@ -715,7 +715,7 @@ private void UpdateFeature(DesktopModuleSupportedFeature feature, bool isSet) /// ----------------------------------------------------------------------------- private void ReadSupportedFeatures(XmlReader reader) { - SupportedFeatures = 0; + this.SupportedFeatures = 0; reader.ReadStartElement("supportedFeatures"); do { @@ -725,13 +725,13 @@ private void ReadSupportedFeatures(XmlReader reader) switch (reader.ReadContentAsString()) { case "Portable": - IsPortable = true; + this.IsPortable = true; break; case "Searchable": - IsSearchable = true; + this.IsSearchable = true; break; case "Upgradeable": - IsUpgradeable = true; + this.IsUpgradeable = true; break; } } @@ -744,21 +744,21 @@ private void ReadModuleSharing(XmlReader reader) if (string.IsNullOrEmpty(sharing)) { - Shareable = ModuleSharing.Unknown; + this.Shareable = ModuleSharing.Unknown; } else { switch (sharing.ToLowerInvariant()) { case "supported": - Shareable = ModuleSharing.Supported; + this.Shareable = ModuleSharing.Supported; break; case "unsupported": - Shareable = ModuleSharing.Unsupported; + this.Shareable = ModuleSharing.Unsupported; break; default: case "unknown": - Shareable = ModuleSharing.Unknown; + this.Shareable = ModuleSharing.Unknown; break; } } @@ -784,24 +784,24 @@ private void ReadModuleDefinitions(XmlReader reader) moduleDefinition.ReadXml(reader); //Add to the collection - ModuleDefinitions.Add(moduleDefinition.FriendlyName, moduleDefinition); + this.ModuleDefinitions.Add(moduleDefinition.FriendlyName, moduleDefinition); } while (reader.ReadToNextSibling("moduleDefinition")); } private void ReadPageInfo(XmlReader reader) { - Page = new PageInfo(); + this.Page = new PageInfo(); //Load it from the Xml - Page.ReadXml(reader.ReadSubtree()); + this.Page.ReadXml(reader.ReadSubtree()); - if (Page.HasAdminPage()) + if (this.Page.HasAdminPage()) { - AdminPage = Page.Name; + this.AdminPage = this.Page.Name; } - if (Page.HasHostPage()) + if (this.Page.HasHostPage()) { - HostPage = Page.Name; + this.HostPage = this.Page.Name; } } diff --git a/DNN Platform/Library/Entities/Modules/InstalledModuleInfo.cs b/DNN Platform/Library/Entities/Modules/InstalledModuleInfo.cs index 50df8e4d394..03d65c2b7f3 100644 --- a/DNN Platform/Library/Entities/Modules/InstalledModuleInfo.cs +++ b/DNN Platform/Library/Entities/Modules/InstalledModuleInfo.cs @@ -27,10 +27,10 @@ public void WriteXml(XmlWriter writer) //Write start of main elemenst writer.WriteStartElement("module"); - writer.WriteElementString("moduleName", ModuleName); - writer.WriteElementString("friendlyName", FriendlyName); - writer.WriteElementString("version", Version); - writer.WriteElementString("instances", Instances.ToString()); + writer.WriteElementString("moduleName", this.ModuleName); + writer.WriteElementString("friendlyName", this.FriendlyName); + writer.WriteElementString("version", this.Version); + writer.WriteElementString("instances", this.Instances.ToString()); //Write end of Host Info writer.WriteEndElement(); diff --git a/DNN Platform/Library/Entities/Modules/ModuleControlInfo.cs b/DNN Platform/Library/Entities/Modules/ModuleControlInfo.cs index b7e2dae8268..77363d23b63 100644 --- a/DNN Platform/Library/Entities/Modules/ModuleControlInfo.cs +++ b/DNN Platform/Library/Entities/Modules/ModuleControlInfo.cs @@ -31,10 +31,10 @@ public class ModuleControlInfo : ControlInfo, IXmlSerializable, IHydratable { public ModuleControlInfo() { - ModuleControlID = Null.NullInteger; - ModuleDefID = Null.NullInteger; - ControlType = SecurityAccessLevel.Anonymous; - SupportsPopUps = false; + this.ModuleControlID = Null.NullInteger; + this.ModuleDefID = Null.NullInteger; + this.ControlType = SecurityAccessLevel.Anonymous; + this.SupportsPopUps = false; } /// ----------------------------------------------------------------------------- @@ -111,15 +111,15 @@ public ModuleControlInfo() /// ----------------------------------------------------------------------------- public void Fill(IDataReader dr) { - ModuleControlID = Null.SetNullInteger(dr["ModuleControlID"]); - FillInternal(dr); - ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); - ControlTitle = Null.SetNullString(dr["ControlTitle"]); - IconFile = Null.SetNullString(dr["IconFile"]); - HelpURL = Null.SetNullString(dr["HelpUrl"]); - ControlType = (SecurityAccessLevel) Enum.Parse(typeof (SecurityAccessLevel), Null.SetNullString(dr["ControlType"])); - ViewOrder = Null.SetNullInteger(dr["ViewOrder"]); - SupportsPopUps = Null.SetNullBoolean(dr["SupportsPopUps"]); + this.ModuleControlID = Null.SetNullInteger(dr["ModuleControlID"]); + this.FillInternal(dr); + this.ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); + this.ControlTitle = Null.SetNullString(dr["ControlTitle"]); + this.IconFile = Null.SetNullString(dr["IconFile"]); + this.HelpURL = Null.SetNullString(dr["HelpUrl"]); + this.ControlType = (SecurityAccessLevel) Enum.Parse(typeof (SecurityAccessLevel), Null.SetNullString(dr["ControlType"])); + this.ViewOrder = Null.SetNullInteger(dr["ViewOrder"]); + this.SupportsPopUps = Null.SetNullBoolean(dr["SupportsPopUps"]); //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); } @@ -134,11 +134,11 @@ public int KeyID { get { - return ModuleControlID; + return this.ModuleControlID; } set { - ModuleControlID = value; + this.ModuleControlID = value; } } @@ -174,29 +174,29 @@ public void ReadXml(XmlReader reader) { continue; } - ReadXmlInternal(reader); + this.ReadXmlInternal(reader); switch (reader.Name) { case "controlTitle": - ControlTitle = reader.ReadElementContentAsString(); + this.ControlTitle = reader.ReadElementContentAsString(); break; case "controlType": - ControlType = (SecurityAccessLevel) Enum.Parse(typeof (SecurityAccessLevel), reader.ReadElementContentAsString()); + this.ControlType = (SecurityAccessLevel) Enum.Parse(typeof (SecurityAccessLevel), reader.ReadElementContentAsString()); break; case "iconFile": - IconFile = reader.ReadElementContentAsString(); + this.IconFile = reader.ReadElementContentAsString(); break; case "helpUrl": - HelpURL = reader.ReadElementContentAsString(); + this.HelpURL = reader.ReadElementContentAsString(); break; case "supportsPopUps": - SupportsPopUps = Boolean.Parse(reader.ReadElementContentAsString()); + this.SupportsPopUps = Boolean.Parse(reader.ReadElementContentAsString()); break; case "viewOrder": string elementvalue = reader.ReadElementContentAsString(); if (!string.IsNullOrEmpty(elementvalue)) { - ViewOrder = int.Parse(elementvalue); + this.ViewOrder = int.Parse(elementvalue); } break; default: @@ -221,15 +221,15 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("moduleControl"); //write out properties - WriteXmlInternal(writer); - writer.WriteElementString("controlTitle", ControlTitle); - writer.WriteElementString("controlType", ControlType.ToString()); - writer.WriteElementString("iconFile", IconFile); - writer.WriteElementString("helpUrl", HelpURL); - writer.WriteElementString("supportsPopUps", SupportsPopUps.ToString()); - if (ViewOrder > Null.NullInteger) + this.WriteXmlInternal(writer); + writer.WriteElementString("controlTitle", this.ControlTitle); + writer.WriteElementString("controlType", this.ControlType.ToString()); + writer.WriteElementString("iconFile", this.IconFile); + writer.WriteElementString("helpUrl", this.HelpURL); + writer.WriteElementString("supportsPopUps", this.SupportsPopUps.ToString()); + if (this.ViewOrder > Null.NullInteger) { - writer.WriteElementString("viewOrder", ViewOrder.ToString()); + writer.WriteElementString("viewOrder", this.ViewOrder.ToString()); } //Write end of main element writer.WriteEndElement(); diff --git a/DNN Platform/Library/Entities/Modules/ModuleController.cs b/DNN Platform/Library/Entities/Modules/ModuleController.cs index d57f1bf2b6d..dafbf476ca5 100644 --- a/DNN Platform/Library/Entities/Modules/ModuleController.cs +++ b/DNN Platform/Library/Entities/Modules/ModuleController.cs @@ -114,7 +114,7 @@ private void AddModuleInternal(ModuleInfo module) if (Null.IsNull(module.ModuleID)) { var currentUser = UserController.Instance.GetCurrentUserInfo(); - CreateContentItem(module); + this.CreateContentItem(module); //Add Module module.ModuleID = dataProvider.AddModule(module.ContentItemId, @@ -140,7 +140,7 @@ private void AddModuleInternal(ModuleInfo module) } //Save ModuleSettings - UpdateModuleSettings(module); + this.UpdateModuleSettings(module); EventManager.Instance.OnModuleCreated(new ModuleEventArgs { Module = module }); } @@ -231,7 +231,7 @@ private void CopyTabModuleSettingsInternal(ModuleInfo fromModule, ModuleInfo toM //Copy each setting to the new TabModule instance foreach (DictionaryEntry setting in fromModule.TabModuleSettings) { - UpdateTabModuleSetting(toModule.TabModuleID, Convert.ToString(setting.Key), Convert.ToString(setting.Value)); + this.UpdateTabModuleSetting(toModule.TabModuleID, Convert.ToString(setting.Key), Convert.ToString(setting.Value)); } } @@ -299,8 +299,8 @@ private void CopyModulePermisions(ModuleInfo sourceModule, ModuleInfo newModule) foreach (ModulePermissionInfo permission in sourceModule.ModulePermissions) { // skip inherited view and translator permissions - if (IsModuleViewPermissionInherited(newModule, permission) || - IsTranslatorRolePermission(permission, sourceModule.PortalID, sourceModule.CultureCode)) + if (this.IsModuleViewPermissionInherited(newModule, permission) || + this.IsTranslatorRolePermission(permission, sourceModule.PortalID, sourceModule.CultureCode)) { continue; } @@ -310,7 +310,7 @@ private void CopyModulePermisions(ModuleInfo sourceModule, ModuleInfo newModule) null : permission.PermissionKey; - AddModulePermission( + this.AddModulePermission( newModule, permission, permission.RoleID, @@ -684,14 +684,14 @@ private int LocalizeModuleInternal(ModuleInfo sourceModule) } // copy permisions from source to new module - CopyModulePermisions(sourceModule, newModule); + this.CopyModulePermisions(sourceModule, newModule); //Add Module - AddModuleInternal(newModule); + this.AddModuleInternal(newModule); //copy module settings DataCache.RemoveCache(string.Format(DataCache.ModuleSettingsCacheKey, sourceModule.TabID)); - var settings = GetModuleSettings(sourceModule.ModuleID, sourceModule.TabID); + var settings = this.GetModuleSettings(sourceModule.ModuleID, sourceModule.TabID); // update tabmodule var currentUser = UserController.Instance.GetCurrentUserInfo(); @@ -729,7 +729,7 @@ private int LocalizeModuleInternal(ModuleInfo sourceModule) //Copy each setting to the new TabModule instance foreach (DictionaryEntry setting in settings) { - UpdateModuleSetting(newModule.ModuleID, Convert.ToString(setting.Key), Convert.ToString(setting.Value)); + this.UpdateModuleSetting(newModule.ModuleID, Convert.ToString(setting.Key), Convert.ToString(setting.Value)); } if (!string.IsNullOrEmpty(newModule.DesktopModule.BusinessControllerClass)) @@ -765,8 +765,8 @@ private int LocalizeModuleInternal(ModuleInfo sourceModule) moduleId = newModule.ModuleID; //Clear Caches - ClearCache(newModule.TabID); - ClearCache(sourceModule.TabID); + this.ClearCache(newModule.TabID); + this.ClearCache(sourceModule.TabID); } return moduleId; @@ -822,7 +822,7 @@ private void UpdateModuleSettingInternal(int moduleId, string settingName, strin if (updateVersion) { - UpdateTabModuleVersionsByModuleID(moduleId); + this.UpdateTabModuleVersionsByModuleID(moduleId); } } catch (Exception ex) @@ -846,16 +846,16 @@ private void UpdateModuleSettings(ModuleInfo updatedModule) foreach (string key in updatedModule.ModuleSettings.Keys) { string sKey = key; - UpdateModuleSettingInternal(updatedModule.ModuleID, sKey, Convert.ToString(updatedModule.ModuleSettings[sKey]), false); + this.UpdateModuleSettingInternal(updatedModule.ModuleID, sKey, Convert.ToString(updatedModule.ModuleSettings[sKey]), false); } - UpdateTabModuleVersionsByModuleID(updatedModule.ModuleID); + this.UpdateTabModuleVersionsByModuleID(updatedModule.ModuleID); } private void UpdateTabModuleSettings(ModuleInfo updatedTabModule) { foreach (string sKey in updatedTabModule.TabModuleSettings.Keys) { - UpdateTabModuleSetting(updatedTabModule.TabModuleID, sKey, Convert.ToString(updatedTabModule.TabModuleSettings[sKey])); + this.UpdateTabModuleSetting(updatedTabModule.TabModuleID, sKey, Convert.ToString(updatedTabModule.TabModuleSettings[sKey])); } } @@ -867,23 +867,23 @@ private static void UpdateTabModuleVersion(int tabModuleId) private void UpdateTabModuleVersionsByModuleID(int moduleID) { // Update the version guid of each TabModule linked to the updated module - foreach (ModuleInfo modInfo in GetAllTabsModulesByModuleID(moduleID)) + foreach (ModuleInfo modInfo in this.GetAllTabsModulesByModuleID(moduleID)) { - ClearCache(modInfo.TabID); + this.ClearCache(modInfo.TabID); } dataProvider.UpdateTabModuleVersionByModule(moduleID); } private bool HasModuleOrderOrPaneChanged(ModuleInfo module) { - var storedModuleInfo = GetTabModule(module.TabModuleID); + var storedModuleInfo = this.GetTabModule(module.TabModuleID); return storedModuleInfo == null || storedModuleInfo.ModuleOrder != module.ModuleOrder || storedModuleInfo.PaneName != module.PaneName; } private void UncopyModule(int tabId, int moduleId, bool softDelete, int originalTabId) { - ModuleInfo moduleInfo = GetModule(moduleId, tabId, false); - DeleteTabModuleInternal(moduleInfo, softDelete, true); + ModuleInfo moduleInfo = this.GetModule(moduleId, tabId, false); + this.DeleteTabModuleInternal(moduleInfo, softDelete, true); var userId = UserController.Instance.GetCurrentUserInfo().UserID; TabChangeTracker.Instance.TrackModuleUncopy(moduleInfo, Null.NullInteger, originalTabId, userId); } @@ -904,7 +904,7 @@ private void DeleteTabModuleInternal(ModuleInfo moduleInfo, bool softDelete, boo //reorder all modules on tab if (!uncopy) { - UpdateTabModuleOrder(moduleInfo.TabID); + this.UpdateTabModuleOrder(moduleInfo.TabID); //ModuleRemove is only raised when doing a soft delete of the module if (softDelete) { @@ -913,14 +913,14 @@ private void DeleteTabModuleInternal(ModuleInfo moduleInfo, bool softDelete, boo } //check if all modules instances have been deleted - if (GetModule(moduleInfo.ModuleID, Null.NullInteger, true).TabID == Null.NullInteger) + if (this.GetModule(moduleInfo.ModuleID, Null.NullInteger, true).TabID == Null.NullInteger) { //hard delete the module - DeleteModule(moduleInfo.ModuleID); + this.DeleteModule(moduleInfo.ModuleID); } DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, moduleInfo.TabModuleID)); - ClearCache(moduleInfo.TabID); + this.ClearCache(moduleInfo.TabID); } } @@ -974,12 +974,12 @@ public int GetMasterTabId(ModuleInfo module) public int AddModule(ModuleInfo module) { //add module - AddModuleInternal(module); + this.AddModuleInternal(module); var currentUser = UserController.Instance.GetCurrentUserInfo(); //Lets see if the module already exists - ModuleInfo tmpModule = GetModule(module.ModuleID, module.TabID, false); + ModuleInfo tmpModule = this.GetModule(module.ModuleID, module.TabID, false); if (tmpModule != null) { //Module Exists already @@ -989,13 +989,13 @@ public int AddModule(ModuleInfo module) var pane = module.PaneName; //Restore Module - RestoreModule(module); + this.RestoreModule(module); TabChangeTracker.Instance.TrackModuleAddition(module, 1, currentUser.UserID); //Set Module Order as expected - UpdateModuleOrder(module.TabID, module.ModuleID, order, pane); - UpdateTabModuleOrder(module.TabID); + this.UpdateModuleOrder(module.TabID, module.ModuleID, order, pane); + this.UpdateTabModuleOrder(module.TabID); } } else @@ -1046,12 +1046,12 @@ public int AddModule(ModuleInfo module) if (module.ModuleOrder == -1) { //position module at bottom of pane - UpdateModuleOrder(module.TabID, module.ModuleID, module.ModuleOrder, module.PaneName); + this.UpdateModuleOrder(module.TabID, module.ModuleID, module.ModuleOrder, module.PaneName); } else { //position module in pane - UpdateTabModuleOrder(module.TabID); + this.UpdateTabModuleOrder(module.TabID); } } @@ -1060,13 +1060,13 @@ public int AddModule(ModuleInfo module) { if (tmpModule == null) { - tmpModule = GetModule(module.ModuleID, module.TabID, false); + tmpModule = this.GetModule(module.ModuleID, module.TabID, false); } module.TabModuleID = tmpModule.TabModuleID; } - UpdateTabModuleSettings(module); + this.UpdateTabModuleSettings(module); - ClearCache(module.TabID); + this.ClearCache(module.TabID); return module.ModuleID; } @@ -1118,13 +1118,13 @@ public void CopyModule(ModuleInfo sourceModule, TabInfo destinationTab, string t // tab is localized, but the source is not in the default language (it was on a single culture page) // this wires up all the connections sourceModule.DefaultLanguageGuid = destinationModule.UniqueId; - UpdateModule(sourceModule); + this.UpdateModule(sourceModule); } else if (sourceModule.AllTabs && sourceModule.CultureCode != portal.DefaultLanguage) { if (sourceModule.DefaultLanguageModule != null && destinationTab.DefaultLanguageTab != null) { - ModuleInfo defaultLanguageModule = GetModule(sourceModule.DefaultLanguageModule.ModuleID, destinationTab.DefaultLanguageTab.TabID, false); + ModuleInfo defaultLanguageModule = this.GetModule(sourceModule.DefaultLanguageModule.ModuleID, destinationTab.DefaultLanguageTab.TabID, false); if (defaultLanguageModule != null) { @@ -1171,7 +1171,7 @@ public void CopyModule(ModuleInfo sourceModule, TabInfo destinationTab, string t //Optionally copy the TabModuleSettings if (includeSettings) { - CopyTabModuleSettingsInternal(sourceModule, destinationModule); + this.CopyTabModuleSettingsInternal(sourceModule, destinationModule); } } catch (Exception exc) @@ -1180,14 +1180,14 @@ public void CopyModule(ModuleInfo sourceModule, TabInfo destinationTab, string t Logger.Error(exc); } - ClearCache(sourceModule.TabID); - ClearCache(destinationTab.TabID); + this.ClearCache(sourceModule.TabID); + this.ClearCache(destinationTab.TabID); //Optionally copy the TabModuleSettings if (includeSettings) { - destinationModule = GetModule(destinationModule.ModuleID, destinationModule.TabID, false); - CopyTabModuleSettingsInternal(sourceModule, destinationModule); + destinationModule = this.GetModule(destinationModule.ModuleID, destinationModule.TabID, false); + this.CopyTabModuleSettingsInternal(sourceModule, destinationModule); } } @@ -1199,7 +1199,7 @@ public void CopyModule(ModuleInfo sourceModule, TabInfo destinationTab, string t /// if set to true will use source module directly, else will create new module info by source module. public void CopyModules(TabInfo sourceTab, TabInfo destinationTab, bool asReference) { - CopyModules(sourceTab, destinationTab, asReference, false); + this.CopyModules(sourceTab, destinationTab, asReference, false); } /// @@ -1211,7 +1211,7 @@ public void CopyModules(TabInfo sourceTab, TabInfo destinationTab, bool asRefere /// if set to true will include modules which shown on all pages, this is used when create localized copy. public void CopyModules(TabInfo sourceTab, TabInfo destinationTab, bool asReference, bool includeAllTabsMobules) { - foreach (KeyValuePair kvp in GetTabModules(sourceTab.TabID)) + foreach (KeyValuePair kvp in this.GetTabModules(sourceTab.TabID)) { ModuleInfo sourceModule = kvp.Value; @@ -1225,12 +1225,12 @@ public void CopyModules(TabInfo sourceTab, TabInfo destinationTab, bool asRefere var newModule = sourceModule.Clone(); newModule.ModuleID = Null.NullInteger; newModule.TabID = destinationTab.TabID; - AddModule(newModule); + this.AddModule(newModule); } else { //Shallow (Reference Copy) - CopyModule(sourceModule, destinationTab, Null.NullString, true); + this.CopyModule(sourceModule, destinationTab, Null.NullString, true); } } } @@ -1273,25 +1273,25 @@ public void CreateContentItem(ModuleInfo module) /// A flag to indicate whether to delete the Module itself public void DeleteAllModules(int moduleId, int tabId, List fromTabs, bool softDelete, bool includeCurrent, bool deleteBaseModule) { - var moduleInfo = GetModule(moduleId, tabId, false); + var moduleInfo = this.GetModule(moduleId, tabId, false); //Iterate through collection deleting the module from each Tab (except the current) foreach (TabInfo objTab in fromTabs) { if (objTab.TabID != tabId || includeCurrent) { - UncopyModule(objTab.TabID, moduleId, softDelete, tabId); //uncopy existing modules + this.UncopyModule(objTab.TabID, moduleId, softDelete, tabId); //uncopy existing modules } } //Optionally delete the Module if (includeCurrent && deleteBaseModule && !softDelete) { - DeleteModule(moduleId); - ClearCache(tabId); + this.DeleteModule(moduleId); + this.ClearCache(tabId); } else { - ClearCache(tabId); + this.ClearCache(tabId); //ModuleRemove is only raised when doing a soft delete of the module if (softDelete) @@ -1308,7 +1308,7 @@ public void DeleteAllModules(int moduleId, int tabId, List fromTabs, bo public void DeleteModule(int moduleId) { //Get the module - ModuleInfo module = GetModule(moduleId, Null.NullInteger, true); + ModuleInfo module = this.GetModule(moduleId, Null.NullInteger, true); //Delete Module dataProvider.DeleteModule(moduleId); @@ -1346,7 +1346,7 @@ public void DeleteModuleSetting(int moduleId, string settingName) log.LogProperties.Add(new LogDetailInfo("ModuleId", moduleId.ToString(CultureInfo.InvariantCulture))); log.LogProperties.Add(new LogDetailInfo("SettingName", settingName)); LogController.Instance.AddLog(log); - UpdateTabModuleVersionsByModuleID(moduleId); + this.UpdateTabModuleVersionsByModuleID(moduleId); ClearModuleSettingsCache(moduleId); } @@ -1359,8 +1359,8 @@ public void DeleteModuleSetting(int moduleId, string settingName) /// A flag that determines whether the instance should be soft-deleted public void DeleteTabModule(int tabId, int moduleId, bool softDelete) { - ModuleInfo moduleInfo = GetModule(moduleId, tabId, false); - DeleteTabModuleInternal(moduleInfo, softDelete); + ModuleInfo moduleInfo = this.GetModule(moduleId, tabId, false); + this.DeleteTabModuleInternal(moduleInfo, softDelete); var userId = UserController.Instance.GetCurrentUserInfo().UserID; if (softDelete) { @@ -1444,18 +1444,18 @@ public int DeLocalizeModule(ModuleInfo sourceModule) TabChangeTracker.Instance.TrackModuleCopy(newModule, Null.NullInteger, newModule.TabID, userId); //check if all modules instances have been deleted - if (GetModule(sourceModule.ModuleID, Null.NullInteger, true).TabID == Null.NullInteger) + if (this.GetModule(sourceModule.ModuleID, Null.NullInteger, true).TabID == Null.NullInteger) { //delete the deep copy "module info" - DeleteModule(sourceModule.ModuleID); + this.DeleteModule(sourceModule.ModuleID); } } moduleId = newModule.ModuleID; //Clear Caches - ClearCache(newModule.TabID); - ClearCache(sourceModule.TabID); + this.ClearCache(newModule.TabID); + this.ClearCache(sourceModule.TabID); } return moduleId; @@ -1501,7 +1501,7 @@ public ArrayList GetAllTabsModulesByModuleID(int moduleID) /// from the database. public ModuleInfo GetModule(int moduleID) { - return GetModule(moduleID, Null.NullInteger, true); + return this.GetModule(moduleID, Null.NullInteger, true); } /// @@ -1512,7 +1512,7 @@ public ModuleInfo GetModule(int moduleID) /// ModuleInfo object public ModuleInfo GetModule(int moduleID, int tabID) { - return GetModule(moduleID, tabID, false); + return this.GetModule(moduleID, tabID, false); } /// @@ -1529,7 +1529,7 @@ public ModuleInfo GetModule(int moduleID, int tabID, bool ignoreCache) if (!ignoreCache) { //First try the cache - var dicModules = GetTabModules(tabID); + var dicModules = this.GetTabModules(tabID); bFound = dicModules.TryGetValue(moduleID, out modInfo); } if (ignoreCache || !bFound) @@ -1552,7 +1552,7 @@ public ModuleInfo GetModuleByCulture(int ModuleId, int tabid, int portalId, Loca ModuleInfo localizedModule = null; //Get Module specified by Id - ModuleInfo originalModule = GetModule(ModuleId, tabid, false); + ModuleInfo originalModule = this.GetModule(ModuleId, tabid, false); if (locale != null && originalModule != null) { @@ -1696,7 +1696,7 @@ public ArrayList GetModulesByDesktopModuleId(int desktopModuleId) var portals = PortalController.Instance.GetPortals(); foreach (PortalInfo portal in portals) { - modules.AddRange(GetModulesByDefinition(portal.PortalID, moduleDefinition.Value.DefinitionName)); + modules.AddRange(this.GetModulesByDefinition(portal.PortalID, moduleDefinition.Value.DefinitionName)); } } return modules; @@ -1737,7 +1737,7 @@ public Dictionary GetTabModules(int tabId) return CBO.GetCachedObject>(new CacheItemArgs(cacheKey, DataCache.TabModuleCacheTimeOut, DataCache.TabModuleCachePriority), - c => GetModulesCurrentPage(tabId)); + c => this.GetModulesCurrentPage(tabId)); } private Dictionary GetModulesCurrentPage(int tabId) @@ -1795,12 +1795,12 @@ public void InitialModulePermission(ModuleInfo module, int tabId, int permission continue; } - ModulePermissionInfo modulePermission = AddModulePermission(module, systemModulePermission, tabPermission.RoleID, tabPermission.UserID, tabPermission.AllowAccess); + ModulePermissionInfo modulePermission = this.AddModulePermission(module, systemModulePermission, tabPermission.RoleID, tabPermission.UserID, tabPermission.AllowAccess); // ensure that every EDIT permission which allows access also provides VIEW permission if (modulePermission.PermissionKey == "EDIT" && modulePermission.AllowAccess) { - AddModulePermission(module, (PermissionInfo)systemModuleViewPermissions[0], modulePermission.RoleID, modulePermission.UserID, true); + this.AddModulePermission(module, (PermissionInfo)systemModuleViewPermissions[0], modulePermission.RoleID, modulePermission.UserID, true); } } @@ -1816,7 +1816,7 @@ public void InitialModulePermission(ModuleInfo module, int tabId, int permission // create the module permission var customModulePermission = (PermissionInfo)customModulePermissions[j]; - AddModulePermission(module, customModulePermission, tabPermission.RoleID, tabPermission.UserID, tabPermission.AllowAccess); + this.AddModulePermission(module, customModulePermission, tabPermission.RoleID, tabPermission.UserID, tabPermission.AllowAccess); } } } @@ -1836,13 +1836,13 @@ public void LocalizeModule(ModuleInfo sourceModule, Locale locale) ModuleInfo localizedModule; var alreadyLocalized = defaultModule.LocalizedModules.TryGetValue(locale.Code, out localizedModule) && localizedModule.ModuleID != defaultModule.ModuleID; - var tabModules = GetTabModulesByModule(defaultModule.ModuleID); + var tabModules = this.GetTabModulesByModule(defaultModule.ModuleID); if (tabModules.Count > 1) { //default language version is a reference copy //Localize first tabModule - var newModuleId = alreadyLocalized ? localizedModule.ModuleID : LocalizeModuleInternal(sourceModule); + var newModuleId = alreadyLocalized ? localizedModule.ModuleID : this.LocalizeModuleInternal(sourceModule); //Update Reference Copies foreach (ModuleInfo tm in tabModules) @@ -1853,14 +1853,14 @@ public void LocalizeModule(ModuleInfo sourceModule, Locale locale) if (tm.LocalizedModules.TryGetValue(locale.Code, out localModule)) { localModule.ModuleID = newModuleId; - UpdateModule(localModule); + this.UpdateModule(localModule); } } } } else if (!alreadyLocalized) { - LocalizeModuleInternal(sourceModule); + this.LocalizeModuleInternal(sourceModule); } } } @@ -1899,10 +1899,10 @@ public void MoveModule(int moduleId, int fromTabId, int toTabId, string toPaneNa } //Update Module Order for source tab, also updates the tabmodule version guid - UpdateTabModuleOrder(fromTabId); + this.UpdateTabModuleOrder(fromTabId); //Update Module Order for target tab, also updates the tabmodule version guid - UpdateTabModuleOrder(toTabId); + this.UpdateTabModuleOrder(toTabId); } /// @@ -1914,7 +1914,7 @@ public void RestoreModule(ModuleInfo objModule) dataProvider.RestoreTabModule(objModule.TabID, objModule.ModuleID); var userId = UserController.Instance.GetCurrentUserInfo().UserID; TabChangeTracker.Instance.TrackModuleAddition(objModule, 1, userId); - ClearCache(objModule.TabID); + this.ClearCache(objModule.TabID); } /// @@ -1928,11 +1928,11 @@ public void UpdateModule(ModuleInfo module) { if (module.ContentItemId == Null.NullInteger) { - CreateContentItem(module); + this.CreateContentItem(module); } else { - UpdateContentItem(module); + this.UpdateContentItem(module); } } @@ -1963,13 +1963,13 @@ public void UpdateModule(ModuleInfo module) //save module permissions ModulePermissionController.SaveModulePermissions(module); - UpdateModuleSettings(module); + this.UpdateModuleSettings(module); module.VersionGuid = Guid.NewGuid(); module.LocalizedVersionGuid = Guid.NewGuid(); if (!Null.IsNull(module.TabID)) { - var hasModuleOrderOrPaneChanged = HasModuleOrderOrPaneChanged(module); + var hasModuleOrderOrPaneChanged = this.HasModuleOrderOrPaneChanged(module); //update tabmodule dataProvider.UpdateTabModule(module.TabModuleID, @@ -2008,7 +2008,7 @@ public void UpdateModule(ModuleInfo module) if (hasModuleOrderOrPaneChanged) { //update module order in pane - UpdateModuleOrder(module.TabID, module.ModuleID, module.ModuleOrder, module.PaneName); + this.UpdateModuleOrder(module.TabID, module.ModuleID, module.ModuleOrder, module.PaneName); } //set the default module @@ -2043,7 +2043,7 @@ public void UpdateModule(ModuleInfo module) foreach (KeyValuePair tabPair in TabController.Instance.GetTabsByPortal(module.PortalID)) { TabInfo tab = tabPair.Value; - foreach (KeyValuePair modulePair in GetTabModules(tab.TabID)) + foreach (KeyValuePair modulePair in this.GetTabModules(tab.TabID)) { var targetModule = modulePair.Value; targetModule.VersionGuid = Guid.NewGuid(); @@ -2079,15 +2079,15 @@ public void UpdateModule(ModuleInfo module) currentUser.UserID); DataCache.RemoveCache(string.Format(DataCache.SingleTabModuleCacheKey, targetModule.TabModuleID)); - ClearCache(targetModule.TabID); + this.ClearCache(targetModule.TabID); } } } } //Clear Cache for all TabModules - foreach (ModuleInfo tabModule in GetTabModulesByModule(module.ModuleID)) + foreach (ModuleInfo tabModule in this.GetTabModulesByModule(module.ModuleID)) { - ClearCache(tabModule.TabID); + this.ClearCache(tabModule.TabID); } EventManager.Instance.OnModuleUpdated(new ModuleEventArgs { Module = module }); @@ -2102,7 +2102,7 @@ public void UpdateModule(ModuleInfo module) /// name of the pane, the module is placed in on the page public void UpdateModuleOrder(int tabId, int moduleId, int moduleOrder, string paneName) { - ModuleInfo moduleInfo = GetModule(moduleId, tabId, false); + ModuleInfo moduleInfo = this.GetModule(moduleId, tabId, false); if (moduleInfo != null) { //adding a module to a new pane - places the module at the bottom of the pane @@ -2128,9 +2128,9 @@ public void UpdateModuleOrder(int tabId, int moduleId, int moduleOrder, string p moduleOrder += 2; } dataProvider.UpdateModuleOrder(tabId, moduleId, moduleOrder, paneName); - TabChangeTracker.Instance.TrackModuleModification(GetModule(moduleId, tabId, true), Null.NullInteger, UserController.Instance.GetCurrentUserInfo().UserID); + TabChangeTracker.Instance.TrackModuleModification(this.GetModule(moduleId, tabId, true), Null.NullInteger, UserController.Instance.GetCurrentUserInfo().UserID); //clear cache - ClearCache(tabId); + this.ClearCache(tabId); } } @@ -2143,7 +2143,7 @@ public void UpdateModuleOrder(int tabId, int moduleId, int moduleOrder, string p /// empty SettingValue will remove the setting, if not preserveIfEmpty is true public void UpdateModuleSetting(int moduleId, string settingName, string settingValue) { - UpdateModuleSettingInternal(moduleId, settingName, settingValue, true); + this.UpdateModuleSettingInternal(moduleId, settingName, settingValue, true); } /// @@ -2176,7 +2176,7 @@ public void UpdateTabModuleOrder(int tabId) if (!isDeleted) { - var moduleInfo = GetModule(moduleId, tabId, true); + var moduleInfo = this.GetModule(moduleId, tabId, true); var userInfo = UserController.Instance.GetCurrentUserInfo(); TabChangeTracker.Instance.TrackModuleModification(moduleInfo, Null.NullInteger, userInfo.UserID); @@ -2202,7 +2202,7 @@ public void UpdateTabModuleOrder(int tabId) CBO.CloseDataReader(dr, true); } //clear module cache - ClearCache(tabId); + this.ClearCache(tabId); } /// @@ -2268,7 +2268,7 @@ public void UpdateTranslationStatus(ModuleInfo localizedModule, bool isTranslate DataProvider.Instance().UpdateTabModuleTranslationStatus(localizedModule.TabModuleID, localizedModule.LocalizedVersionGuid, UserController.Instance.GetCurrentUserInfo().UserID); //Clear Tab Caches - ClearCache(localizedModule.TabID); + this.ClearCache(localizedModule.TabID); } #endregion diff --git a/DNN Platform/Library/Entities/Modules/ModuleInfo.cs b/DNN Platform/Library/Entities/Modules/ModuleInfo.cs index 276ef9278d1..23c9e1d6306 100644 --- a/DNN Platform/Library/Entities/Modules/ModuleInfo.cs +++ b/DNN Platform/Library/Entities/Modules/ModuleInfo.cs @@ -64,35 +64,35 @@ public ModuleInfo() { //initialize the properties that can be null //in the database - PortalID = Null.NullInteger; - OwnerPortalID = Null.NullInteger; - TabModuleID = Null.NullInteger; - DesktopModuleID = Null.NullInteger; - ModuleDefID = Null.NullInteger; - ModuleTitle = Null.NullString; - ModuleVersion = Null.NullInteger; - _authorizedEditRoles = Null.NullString; - _authorizedViewRoles = Null.NullString; - Alignment = Null.NullString; - Color = Null.NullString; - Border = Null.NullString; - IconFile = Null.NullString; - Header = Null.NullString; - Footer = Null.NullString; - StartDate = Null.NullDate; - EndDate = Null.NullDate; - ContainerSrc = Null.NullString; - DisplayTitle = true; - DisplayPrint = true; - DisplaySyndicate = false; + this.PortalID = Null.NullInteger; + this.OwnerPortalID = Null.NullInteger; + this.TabModuleID = Null.NullInteger; + this.DesktopModuleID = Null.NullInteger; + this.ModuleDefID = Null.NullInteger; + this.ModuleTitle = Null.NullString; + this.ModuleVersion = Null.NullInteger; + this._authorizedEditRoles = Null.NullString; + this._authorizedViewRoles = Null.NullString; + this.Alignment = Null.NullString; + this.Color = Null.NullString; + this.Border = Null.NullString; + this.IconFile = Null.NullString; + this.Header = Null.NullString; + this.Footer = Null.NullString; + this.StartDate = Null.NullDate; + this.EndDate = Null.NullDate; + this.ContainerSrc = Null.NullString; + this.DisplayTitle = true; + this.DisplayPrint = true; + this.DisplaySyndicate = false; //Guid, Version Guid, and Localized Version Guid should be initialised to a new value - UniqueId = Guid.NewGuid(); - VersionGuid = Guid.NewGuid(); - _localizedVersionGuid = Guid.NewGuid(); + this.UniqueId = Guid.NewGuid(); + this.VersionGuid = Guid.NewGuid(); + this._localizedVersionGuid = Guid.NewGuid(); //Default Language Guid should be initialised to a null Guid - _defaultLanguageGuid = Null.NullGuid; + this._defaultLanguageGuid = Null.NullGuid; } [XmlElement("alignment")] @@ -132,9 +132,9 @@ public ModuleInfo() public DesktopModuleInfo DesktopModule { get { - return _desktopModule ?? - (_desktopModule = DesktopModuleID > Null.NullInteger - ? DesktopModuleController.GetDesktopModule(DesktopModuleID, PortalID) + return this._desktopModule ?? + (this._desktopModule = this.DesktopModuleID > Null.NullInteger + ? DesktopModuleController.GetDesktopModule(this.DesktopModuleID, this.PortalID) : new DesktopModuleInfo()); } } @@ -171,7 +171,7 @@ public bool HideAdminBorder { get { - object setting = TabModuleSettings["hideadminborder"]; + object setting = this.TabModuleSettings["hideadminborder"]; if (setting == null || string.IsNullOrEmpty(setting.ToString())) { return false; @@ -201,7 +201,7 @@ public bool HideAdminBorder [XmlIgnore] public bool IsShared { - get { return OwnerPortalID != PortalID; } + get { return this.OwnerPortalID != this.PortalID; } } [XmlIgnore] @@ -216,9 +216,9 @@ public bool IsShared public ModuleControlInfo ModuleControl { get { - return _moduleControl ?? - (_moduleControl = ModuleControlId > Null.NullInteger - ? ModuleControlController.GetModuleControl(ModuleControlId) + return this._moduleControl ?? + (this._moduleControl = this.ModuleControlId > Null.NullInteger + ? ModuleControlController.GetModuleControl(this.ModuleControlId) : new ModuleControlInfo()); } } @@ -245,9 +245,9 @@ public ModuleControlInfo ModuleControl public ModuleDefinitionInfo ModuleDefinition { get { - return _moduleDefinition ?? - (_moduleDefinition = ModuleDefID > Null.NullInteger - ? ModuleDefinitionController.GetModuleDefinitionByID(ModuleDefID) + return this._moduleDefinition ?? + (this._moduleDefinition = this.ModuleDefID > Null.NullInteger + ? ModuleDefinitionController.GetModuleDefinitionByID(this.ModuleDefID) : new ModuleDefinitionInfo()); } } @@ -267,14 +267,14 @@ public ModulePermissionCollection ModulePermissions { get { - return _modulePermissions ?? - (_modulePermissions = ModuleID > 0 - ? new ModulePermissionCollection(ModulePermissionController.GetModulePermissions(ModuleID, TabID)) + return this._modulePermissions ?? + (this._modulePermissions = this.ModuleID > 0 + ? new ModulePermissionCollection(ModulePermissionController.GetModulePermissions(this.ModuleID, this.TabID)) : new ModulePermissionCollection()); } set { - _modulePermissions = value; + this._modulePermissions = value; } } @@ -283,18 +283,18 @@ public Hashtable ModuleSettings { get { - if (_moduleSettings == null) + if (this._moduleSettings == null) { - if (ModuleID == Null.NullInteger) + if (this.ModuleID == Null.NullInteger) { - _moduleSettings = new Hashtable(); + this._moduleSettings = new Hashtable(); } else { - _moduleSettings = new ModuleController().GetModuleSettings(ModuleID, TabID); + this._moduleSettings = new ModuleController().GetModuleSettings(this.ModuleID, this.TabID); } } - return _moduleSettings; + return this._moduleSettings; } } @@ -330,19 +330,19 @@ public Hashtable TabModuleSettings { get { - if (_tabModuleSettings == null) + if (this._tabModuleSettings == null) { - if (TabModuleID == Null.NullInteger) + if (this.TabModuleID == Null.NullInteger) { - _tabModuleSettings = new Hashtable(); + this._tabModuleSettings = new Hashtable(); } else { - _tabModuleSettings = new ModuleController().GetTabModuleSettings(TabModuleID, TabID); + this._tabModuleSettings = new ModuleController().GetTabModuleSettings(this.TabModuleID, this.TabID); } } - return _tabModuleSettings; + return this._tabModuleSettings; } } @@ -371,11 +371,11 @@ public string CultureCode { get { - return _cultureCode; + return this._cultureCode; } set { - _cultureCode = value; + this._cultureCode = value; } } @@ -384,11 +384,11 @@ public Guid DefaultLanguageGuid { get { - return _defaultLanguageGuid; + return this._defaultLanguageGuid; } set { - _defaultLanguageGuid = value; + this._defaultLanguageGuid = value; } } @@ -397,12 +397,12 @@ public ModuleInfo DefaultLanguageModule { get { - if (_defaultLanguageModule == null && (!DefaultLanguageGuid.Equals(Null.NullGuid)) && ParentTab != null && ParentTab.DefaultLanguageTab != null && - ParentTab.DefaultLanguageTab.ChildModules != null) + if (this._defaultLanguageModule == null && (!this.DefaultLanguageGuid.Equals(Null.NullGuid)) && this.ParentTab != null && this.ParentTab.DefaultLanguageTab != null && + this.ParentTab.DefaultLanguageTab.ChildModules != null) { - _defaultLanguageModule = (from kvp in ParentTab.DefaultLanguageTab.ChildModules where kvp.Value.UniqueId == DefaultLanguageGuid select kvp.Value).SingleOrDefault(); + this._defaultLanguageModule = (from kvp in this.ParentTab.DefaultLanguageTab.ChildModules where kvp.Value.UniqueId == this.DefaultLanguageGuid select kvp.Value).SingleOrDefault(); } - return _defaultLanguageModule; + return this._defaultLanguageModule; } } @@ -410,7 +410,7 @@ public bool IsDefaultLanguage { get { - return (DefaultLanguageGuid == Null.NullGuid); + return (this.DefaultLanguageGuid == Null.NullGuid); } } @@ -419,10 +419,10 @@ public bool IsLocalized get { bool isLocalized = true; - if (DefaultLanguageModule != null) + if (this.DefaultLanguageModule != null) { //Child language - isLocalized = ModuleID != DefaultLanguageModule.ModuleID; + isLocalized = this.ModuleID != this.DefaultLanguageModule.ModuleID; } return isLocalized; } @@ -432,7 +432,7 @@ public bool IsNeutralCulture { get { - return string.IsNullOrEmpty(CultureCode); + return string.IsNullOrEmpty(this.CultureCode); } } @@ -442,10 +442,10 @@ public bool IsTranslated get { bool isTranslated = true; - if (DefaultLanguageModule != null) + if (this.DefaultLanguageModule != null) { //Child language - isTranslated = (LocalizedVersionGuid == DefaultLanguageModule.LocalizedVersionGuid); + isTranslated = (this.LocalizedVersionGuid == this.DefaultLanguageModule.LocalizedVersionGuid); } return isTranslated; } @@ -456,23 +456,23 @@ public Dictionary LocalizedModules { get { - if (_localizedModules == null && (DefaultLanguageGuid.Equals(Null.NullGuid)) && ParentTab != null && ParentTab.LocalizedTabs != null) + if (this._localizedModules == null && (this.DefaultLanguageGuid.Equals(Null.NullGuid)) && this.ParentTab != null && this.ParentTab.LocalizedTabs != null) { //Cycle through all localized tabs looking for this module - _localizedModules = new Dictionary(); - foreach (TabInfo t in ParentTab.LocalizedTabs.Values) + this._localizedModules = new Dictionary(); + foreach (TabInfo t in this.ParentTab.LocalizedTabs.Values) { foreach (ModuleInfo m in t.ChildModules.Values) { ModuleInfo tempModuleInfo; - if (m.DefaultLanguageGuid == UniqueId && !m.IsDeleted && !_localizedModules.TryGetValue(m.CultureCode, out tempModuleInfo)) + if (m.DefaultLanguageGuid == this.UniqueId && !m.IsDeleted && !this._localizedModules.TryGetValue(m.CultureCode, out tempModuleInfo)) { - _localizedModules.Add(m.CultureCode, m); + this._localizedModules.Add(m.CultureCode, m); } } } } - return _localizedModules; + return this._localizedModules; } } @@ -481,11 +481,11 @@ public Guid LocalizedVersionGuid { get { - return _localizedVersionGuid; + return this._localizedVersionGuid; } set { - _localizedVersionGuid = value; + this._localizedVersionGuid = value; } } @@ -497,19 +497,19 @@ public TabInfo ParentTab { get { - if (_parentTab == null) + if (this._parentTab == null) { - if (PortalID == Null.NullInteger || string.IsNullOrEmpty(CultureCode)) + if (this.PortalID == Null.NullInteger || string.IsNullOrEmpty(this.CultureCode)) { - _parentTab = TabController.Instance.GetTab(TabID, PortalID, false); + this._parentTab = TabController.Instance.GetTab(this.TabID, this.PortalID, false); } else { - Locale locale = LocaleController.Instance.GetLocale(CultureCode); - _parentTab = TabController.Instance.GetTabByCulture(TabID, PortalID, locale); + Locale locale = LocaleController.Instance.GetLocale(this.CultureCode); + this._parentTab = TabController.Instance.GetTabByCulture(this.TabID, this.PortalID, locale); } } - return _parentTab; + return this._parentTab; } } @@ -528,83 +528,83 @@ public override void Fill(IDataReader dr) //Call the base classes fill method to populate base class properties base.FillInternal(dr); - UniqueId = Null.SetNullGuid(dr["UniqueId"]); - VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); - DefaultLanguageGuid = Null.SetNullGuid(dr["DefaultLanguageGuid"]); - LocalizedVersionGuid = Null.SetNullGuid(dr["LocalizedVersionGuid"]); - CultureCode = Null.SetNullString(dr["CultureCode"]); + this.UniqueId = Null.SetNullGuid(dr["UniqueId"]); + this.VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); + this.DefaultLanguageGuid = Null.SetNullGuid(dr["DefaultLanguageGuid"]); + this.LocalizedVersionGuid = Null.SetNullGuid(dr["LocalizedVersionGuid"]); + this.CultureCode = Null.SetNullString(dr["CultureCode"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); if (dr.GetSchemaTable().Select("ColumnName = 'OwnerPortalID'").Length > 0) { - OwnerPortalID = Null.SetNullInteger(dr["OwnerPortalID"]); + this.OwnerPortalID = Null.SetNullInteger(dr["OwnerPortalID"]); } - ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); - ModuleTitle = Null.SetNullString(dr["ModuleTitle"]); - AllTabs = Null.SetNullBoolean(dr["AllTabs"]); - IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]); - InheritViewPermissions = Null.SetNullBoolean(dr["InheritViewPermissions"]); + this.ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); + this.ModuleTitle = Null.SetNullString(dr["ModuleTitle"]); + this.AllTabs = Null.SetNullBoolean(dr["AllTabs"]); + this.IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]); + this.InheritViewPermissions = Null.SetNullBoolean(dr["InheritViewPermissions"]); if (dr.GetSchemaTable().Select("ColumnName = 'IsShareable'").Length > 0) { - IsShareable = Null.SetNullBoolean(dr["IsShareable"]); + this.IsShareable = Null.SetNullBoolean(dr["IsShareable"]); } if (dr.GetSchemaTable().Select("ColumnName = 'IsShareableViewOnly'").Length > 0) { - IsShareableViewOnly = Null.SetNullBoolean(dr["IsShareableViewOnly"]); + this.IsShareableViewOnly = Null.SetNullBoolean(dr["IsShareableViewOnly"]); } - Header = Null.SetNullString(dr["Header"]); - Footer = Null.SetNullString(dr["Footer"]); - StartDate = Null.SetNullDateTime(dr["StartDate"]); - EndDate = Null.SetNullDateTime(dr["EndDate"]); - LastContentModifiedOnDate = Null.SetNullDateTime(dr["LastContentModifiedOnDate"]); + this.Header = Null.SetNullString(dr["Header"]); + this.Footer = Null.SetNullString(dr["Footer"]); + this.StartDate = Null.SetNullDateTime(dr["StartDate"]); + this.EndDate = Null.SetNullDateTime(dr["EndDate"]); + this.LastContentModifiedOnDate = Null.SetNullDateTime(dr["LastContentModifiedOnDate"]); try { - TabModuleID = Null.SetNullInteger(dr["TabModuleID"]); - ModuleOrder = Null.SetNullInteger(dr["ModuleOrder"]); - PaneName = Null.SetNullString(dr["PaneName"]); - CacheTime = Null.SetNullInteger(dr["CacheTime"]); - CacheMethod = Null.SetNullString(dr["CacheMethod"]); - Alignment = Null.SetNullString(dr["Alignment"]); - Color = Null.SetNullString(dr["Color"]); - Border = Null.SetNullString(dr["Border"]); - IconFile = Null.SetNullString(dr["IconFile"]); + this.TabModuleID = Null.SetNullInteger(dr["TabModuleID"]); + this.ModuleOrder = Null.SetNullInteger(dr["ModuleOrder"]); + this.PaneName = Null.SetNullString(dr["PaneName"]); + this.CacheTime = Null.SetNullInteger(dr["CacheTime"]); + this.CacheMethod = Null.SetNullString(dr["CacheMethod"]); + this.Alignment = Null.SetNullString(dr["Alignment"]); + this.Color = Null.SetNullString(dr["Color"]); + this.Border = Null.SetNullString(dr["Border"]); + this.IconFile = Null.SetNullString(dr["IconFile"]); int visible = Null.SetNullInteger(dr["Visibility"]); if (visible == Null.NullInteger) { - Visibility = VisibilityState.Maximized; + this.Visibility = VisibilityState.Maximized; } else { switch (visible) { case 0: - Visibility = VisibilityState.Maximized; + this.Visibility = VisibilityState.Maximized; break; case 1: - Visibility = VisibilityState.Minimized; + this.Visibility = VisibilityState.Minimized; break; case 2: - Visibility = VisibilityState.None; + this.Visibility = VisibilityState.None; break; } } - ContainerSrc = Null.SetNullString(dr["ContainerSrc"]); - DisplayTitle = Null.SetNullBoolean(dr["DisplayTitle"]); - DisplayPrint = Null.SetNullBoolean(dr["DisplayPrint"]); - DisplaySyndicate = Null.SetNullBoolean(dr["DisplaySyndicate"]); - IsWebSlice = Null.SetNullBoolean(dr["IsWebSlice"]); - if (IsWebSlice) + this.ContainerSrc = Null.SetNullString(dr["ContainerSrc"]); + this.DisplayTitle = Null.SetNullBoolean(dr["DisplayTitle"]); + this.DisplayPrint = Null.SetNullBoolean(dr["DisplayPrint"]); + this.DisplaySyndicate = Null.SetNullBoolean(dr["DisplaySyndicate"]); + this.IsWebSlice = Null.SetNullBoolean(dr["IsWebSlice"]); + if (this.IsWebSlice) { - WebSliceTitle = Null.SetNullString(dr["WebSliceTitle"]); - WebSliceExpiryDate = Null.SetNullDateTime(dr["WebSliceExpiryDate"]); - WebSliceTTL = Null.SetNullInteger(dr["WebSliceTTL"]); + this.WebSliceTitle = Null.SetNullString(dr["WebSliceTitle"]); + this.WebSliceExpiryDate = Null.SetNullDateTime(dr["WebSliceExpiryDate"]); + this.WebSliceTTL = Null.SetNullInteger(dr["WebSliceTTL"]); } - DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); - ModuleControlId = Null.SetNullInteger(dr["ModuleControlID"]); + this.DesktopModuleID = Null.SetNullInteger(dr["DesktopModuleID"]); + this.ModuleControlId = Null.SetNullInteger(dr["ModuleControlID"]); } catch (Exception exc) { @@ -624,11 +624,11 @@ public override int KeyID { get { - return ModuleID; + return this.ModuleID; } set { - ModuleID = value; + this.ModuleID = value; } } @@ -655,286 +655,286 @@ public string GetProperty(string propertyName, string format, CultureInfo format { case "portalid": propertyNotFound = false; - result = (PortalID.ToString(outputFormat, formatProvider)); + result = (this.PortalID.ToString(outputFormat, formatProvider)); break; case "displayportalid": propertyNotFound = false; - result = (OwnerPortalID.ToString(outputFormat, formatProvider)); + result = (this.OwnerPortalID.ToString(outputFormat, formatProvider)); break; case "tabid": propertyNotFound = false; - result = (TabID.ToString(outputFormat, formatProvider)); + result = (this.TabID.ToString(outputFormat, formatProvider)); break; case "tabmoduleid": propertyNotFound = false; - result = (TabModuleID.ToString(outputFormat, formatProvider)); + result = (this.TabModuleID.ToString(outputFormat, formatProvider)); break; case "moduleid": propertyNotFound = false; - result = (ModuleID.ToString(outputFormat, formatProvider)); + result = (this.ModuleID.ToString(outputFormat, formatProvider)); break; case "moduledefid": isPublic = false; propertyNotFound = false; - result = (ModuleDefID.ToString(outputFormat, formatProvider)); + result = (this.ModuleDefID.ToString(outputFormat, formatProvider)); break; case "moduleorder": isPublic = false; propertyNotFound = false; - result = (ModuleOrder.ToString(outputFormat, formatProvider)); + result = (this.ModuleOrder.ToString(outputFormat, formatProvider)); break; case "panename": propertyNotFound = false; - result = PropertyAccess.FormatString(PaneName, format); + result = PropertyAccess.FormatString(this.PaneName, format); break; case "moduletitle": propertyNotFound = false; - result = PropertyAccess.FormatString(ModuleTitle, format); + result = PropertyAccess.FormatString(this.ModuleTitle, format); break; case "cachetime": isPublic = false; propertyNotFound = false; - result = (CacheTime.ToString(outputFormat, formatProvider)); + result = (this.CacheTime.ToString(outputFormat, formatProvider)); break; case "cachemethod": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(CacheMethod, format); + result = PropertyAccess.FormatString(this.CacheMethod, format); break; case "alignment": propertyNotFound = false; - result = PropertyAccess.FormatString(Alignment, format); + result = PropertyAccess.FormatString(this.Alignment, format); break; case "color": propertyNotFound = false; - result = PropertyAccess.FormatString(Color, format); + result = PropertyAccess.FormatString(this.Color, format); break; case "border": propertyNotFound = false; - result = PropertyAccess.FormatString(Border, format); + result = PropertyAccess.FormatString(this.Border, format); break; case "iconfile": propertyNotFound = false; - result = PropertyAccess.FormatString(IconFile, format); + result = PropertyAccess.FormatString(this.IconFile, format); break; case "alltabs": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(AllTabs, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.AllTabs, formatProvider)); break; case "isdeleted": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsDeleted, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsDeleted, formatProvider)); break; case "header": propertyNotFound = false; - result = PropertyAccess.FormatString(Header, format); + result = PropertyAccess.FormatString(this.Header, format); break; case "footer": propertyNotFound = false; - result = PropertyAccess.FormatString(Footer, format); + result = PropertyAccess.FormatString(this.Footer, format); break; case "startdate": isPublic = false; propertyNotFound = false; - result = (StartDate.ToString(outputFormat, formatProvider)); + result = (this.StartDate.ToString(outputFormat, formatProvider)); break; case "enddate": isPublic = false; propertyNotFound = false; - result = (EndDate.ToString(outputFormat, formatProvider)); + result = (this.EndDate.ToString(outputFormat, formatProvider)); break; case "containersrc": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(ContainerSrc, format); + result = PropertyAccess.FormatString(this.ContainerSrc, format); break; case "displaytitle": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DisplayTitle, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DisplayTitle, formatProvider)); break; case "displayprint": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DisplayPrint, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DisplayPrint, formatProvider)); break; case "displaysyndicate": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DisplaySyndicate, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DisplaySyndicate, formatProvider)); break; case "iswebslice": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsWebSlice, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsWebSlice, formatProvider)); break; case "webslicetitle": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(WebSliceTitle, format); + result = PropertyAccess.FormatString(this.WebSliceTitle, format); break; case "websliceexpirydate": isPublic = false; propertyNotFound = false; - result = (WebSliceExpiryDate.ToString(outputFormat, formatProvider)); + result = (this.WebSliceExpiryDate.ToString(outputFormat, formatProvider)); break; case "webslicettl": isPublic = false; propertyNotFound = false; - result = (WebSliceTTL.ToString(outputFormat, formatProvider)); + result = (this.WebSliceTTL.ToString(outputFormat, formatProvider)); break; case "inheritviewpermissions": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(InheritViewPermissions, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.InheritViewPermissions, formatProvider)); break; case "isshareable": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsShareable, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsShareable, formatProvider)); break; case "isshareableviewonly": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsShareableViewOnly, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsShareableViewOnly, formatProvider)); break; case "desktopmoduleid": isPublic = false; propertyNotFound = false; - result = (DesktopModuleID.ToString(outputFormat, formatProvider)); + result = (this.DesktopModuleID.ToString(outputFormat, formatProvider)); break; case "friendlyname": propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.FriendlyName, format); + result = PropertyAccess.FormatString(this.DesktopModule.FriendlyName, format); break; case "foldername": propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.FolderName, format); + result = PropertyAccess.FormatString(this.DesktopModule.FolderName, format); break; case "description": propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.Description, format); + result = PropertyAccess.FormatString(this.DesktopModule.Description, format); break; case "version": propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.Version, format); + result = PropertyAccess.FormatString(this.DesktopModule.Version, format); break; case "ispremium": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsPremium, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DesktopModule.IsPremium, formatProvider)); break; case "isadmin": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsAdmin, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DesktopModule.IsAdmin, formatProvider)); break; case "businesscontrollerclass": propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.BusinessControllerClass, format); + result = PropertyAccess.FormatString(this.DesktopModule.BusinessControllerClass, format); break; case "modulename": propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.ModuleName, format); + result = PropertyAccess.FormatString(this.DesktopModule.ModuleName, format); break; case "supportedfeatures": isPublic = false; propertyNotFound = false; - result = (DesktopModule.SupportedFeatures.ToString(outputFormat, formatProvider)); + result = (this.DesktopModule.SupportedFeatures.ToString(outputFormat, formatProvider)); break; case "compatibleversions": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.CompatibleVersions, format); + result = PropertyAccess.FormatString(this.DesktopModule.CompatibleVersions, format); break; case "dependencies": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.Dependencies, format); + result = PropertyAccess.FormatString(this.DesktopModule.Dependencies, format); break; case "permissions": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.Permissions, format); + result = PropertyAccess.FormatString(this.DesktopModule.Permissions, format); break; case "defaultcachetime": isPublic = false; propertyNotFound = false; - result = (ModuleDefinition.DefaultCacheTime.ToString(outputFormat, formatProvider)); + result = (this.ModuleDefinition.DefaultCacheTime.ToString(outputFormat, formatProvider)); break; case "modulecontrolid": isPublic = false; propertyNotFound = false; - result = (ModuleControlId.ToString(outputFormat, formatProvider)); + result = (this.ModuleControlId.ToString(outputFormat, formatProvider)); break; case "controlsrc": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(ModuleControl.ControlSrc, format); + result = PropertyAccess.FormatString(this.ModuleControl.ControlSrc, format); break; case "controltitle": propertyNotFound = false; - result = PropertyAccess.FormatString(ModuleControl.ControlTitle, format); + result = PropertyAccess.FormatString(this.ModuleControl.ControlTitle, format); break; case "helpurl": propertyNotFound = false; - result = PropertyAccess.FormatString(ModuleControl.HelpURL, format); + result = PropertyAccess.FormatString(this.ModuleControl.HelpURL, format); break; case "supportspartialrendering": propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(ModuleControl.SupportsPartialRendering, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.ModuleControl.SupportsPartialRendering, formatProvider)); break; case "containerpath": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(ContainerPath, format); + result = PropertyAccess.FormatString(this.ContainerPath, format); break; case "panemoduleindex": isPublic = false; propertyNotFound = false; - result = (PaneModuleIndex.ToString(outputFormat, formatProvider)); + result = (this.PaneModuleIndex.ToString(outputFormat, formatProvider)); break; case "panemodulecount": isPublic = false; propertyNotFound = false; - result = (PaneModuleCount.ToString(outputFormat, formatProvider)); + result = (this.PaneModuleCount.ToString(outputFormat, formatProvider)); break; case "isdefaultmodule": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsDefaultModule, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsDefaultModule, formatProvider)); break; case "allmodules": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(AllModules, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.AllModules, formatProvider)); break; case "isportable": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsPortable, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DesktopModule.IsPortable, formatProvider)); break; case "issearchable": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsSearchable, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DesktopModule.IsSearchable, formatProvider)); break; case "isupgradeable": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DesktopModule.IsUpgradeable, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DesktopModule.IsUpgradeable, formatProvider)); break; case "adminpage": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.AdminPage, format); + result = PropertyAccess.FormatString(this.DesktopModule.AdminPage, format); break; case "hostpage": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(DesktopModule.HostPage, format); + result = PropertyAccess.FormatString(this.DesktopModule.HostPage, format); break; } if (!isPublic && currentScope != Scope.Debug) @@ -959,64 +959,64 @@ public ModuleInfo Clone() { var objModuleInfo = new ModuleInfo { - PortalID = PortalID, - OwnerPortalID = OwnerPortalID, - TabID = TabID, - TabModuleID = TabModuleID, - ModuleID = ModuleID, - ModuleOrder = ModuleOrder, - PaneName = PaneName, - ModuleTitle = ModuleTitle, - CacheTime = CacheTime, - CacheMethod = CacheMethod, - Alignment = Alignment, - Color = Color, - Border = Border, - IconFile = IconFile, - AllTabs = AllTabs, - Visibility = Visibility, - IsDeleted = IsDeleted, - Header = Header, - Footer = Footer, - StartDate = StartDate, - EndDate = EndDate, - ContainerSrc = ContainerSrc, - DisplayTitle = DisplayTitle, - DisplayPrint = DisplayPrint, - DisplaySyndicate = DisplaySyndicate, - IsWebSlice = IsWebSlice, - WebSliceTitle = WebSliceTitle, - WebSliceExpiryDate = WebSliceExpiryDate, - WebSliceTTL = WebSliceTTL, - InheritViewPermissions = InheritViewPermissions, - IsShareable = IsShareable, - IsShareableViewOnly = IsShareableViewOnly, - DesktopModuleID = DesktopModuleID, - ModuleDefID = ModuleDefID, - ModuleControlId = ModuleControlId, - ContainerPath = ContainerPath, - PaneModuleIndex = PaneModuleIndex, - PaneModuleCount = PaneModuleCount, - IsDefaultModule = IsDefaultModule, - AllModules = AllModules, + PortalID = this.PortalID, + OwnerPortalID = this.OwnerPortalID, + TabID = this.TabID, + TabModuleID = this.TabModuleID, + ModuleID = this.ModuleID, + ModuleOrder = this.ModuleOrder, + PaneName = this.PaneName, + ModuleTitle = this.ModuleTitle, + CacheTime = this.CacheTime, + CacheMethod = this.CacheMethod, + Alignment = this.Alignment, + Color = this.Color, + Border = this.Border, + IconFile = this.IconFile, + AllTabs = this.AllTabs, + Visibility = this.Visibility, + IsDeleted = this.IsDeleted, + Header = this.Header, + Footer = this.Footer, + StartDate = this.StartDate, + EndDate = this.EndDate, + ContainerSrc = this.ContainerSrc, + DisplayTitle = this.DisplayTitle, + DisplayPrint = this.DisplayPrint, + DisplaySyndicate = this.DisplaySyndicate, + IsWebSlice = this.IsWebSlice, + WebSliceTitle = this.WebSliceTitle, + WebSliceExpiryDate = this.WebSliceExpiryDate, + WebSliceTTL = this.WebSliceTTL, + InheritViewPermissions = this.InheritViewPermissions, + IsShareable = this.IsShareable, + IsShareableViewOnly = this.IsShareableViewOnly, + DesktopModuleID = this.DesktopModuleID, + ModuleDefID = this.ModuleDefID, + ModuleControlId = this.ModuleControlId, + ContainerPath = this.ContainerPath, + PaneModuleIndex = this.PaneModuleIndex, + PaneModuleCount = this.PaneModuleCount, + IsDefaultModule = this.IsDefaultModule, + AllModules = this.AllModules, UniqueId = Guid.NewGuid(), VersionGuid = Guid.NewGuid(), - DefaultLanguageGuid = DefaultLanguageGuid, - LocalizedVersionGuid = LocalizedVersionGuid, - CultureCode = CultureCode + DefaultLanguageGuid = this.DefaultLanguageGuid, + LocalizedVersionGuid = this.LocalizedVersionGuid, + CultureCode = this.CultureCode }; //localized properties - Clone(objModuleInfo, this); + this.Clone(objModuleInfo, this); return objModuleInfo; } public string GetEffectiveCacheMethod() { string effectiveCacheMethod; - if (!string.IsNullOrEmpty(CacheMethod)) + if (!string.IsNullOrEmpty(this.CacheMethod)) { - effectiveCacheMethod = CacheMethod; + effectiveCacheMethod = this.CacheMethod; } else if (!string.IsNullOrEmpty(Host.Host.ModuleCachingMethod)) { @@ -1036,57 +1036,57 @@ public string GetEffectiveCacheMethod() public void Initialize(int portalId) { - PortalID = portalId; - OwnerPortalID = portalId; - ModuleDefID = Null.NullInteger; - ModuleOrder = Null.NullInteger; - PaneName = Null.NullString; - ModuleTitle = Null.NullString; - CacheTime = 0; - CacheMethod = Null.NullString; - Alignment = Null.NullString; - Color = Null.NullString; - Border = Null.NullString; - IconFile = Null.NullString; - AllTabs = Null.NullBoolean; - Visibility = VisibilityState.Maximized; - IsDeleted = Null.NullBoolean; - Header = Null.NullString; - Footer = Null.NullString; - StartDate = Null.NullDate; - EndDate = Null.NullDate; - DisplayTitle = true; - DisplayPrint = false; - DisplaySyndicate = Null.NullBoolean; - IsWebSlice = Null.NullBoolean; - WebSliceTitle = ""; - WebSliceExpiryDate = Null.NullDate; - WebSliceTTL = 0; - InheritViewPermissions = Null.NullBoolean; - IsShareable = true; - IsShareableViewOnly = true; - ContainerSrc = Null.NullString; - DesktopModuleID = Null.NullInteger; - ModuleControlId = Null.NullInteger; - ContainerPath = Null.NullString; - PaneModuleIndex = 0; - PaneModuleCount = 0; - IsDefaultModule = Null.NullBoolean; - AllModules = Null.NullBoolean; + this.PortalID = portalId; + this.OwnerPortalID = portalId; + this.ModuleDefID = Null.NullInteger; + this.ModuleOrder = Null.NullInteger; + this.PaneName = Null.NullString; + this.ModuleTitle = Null.NullString; + this.CacheTime = 0; + this.CacheMethod = Null.NullString; + this.Alignment = Null.NullString; + this.Color = Null.NullString; + this.Border = Null.NullString; + this.IconFile = Null.NullString; + this.AllTabs = Null.NullBoolean; + this.Visibility = VisibilityState.Maximized; + this.IsDeleted = Null.NullBoolean; + this.Header = Null.NullString; + this.Footer = Null.NullString; + this.StartDate = Null.NullDate; + this.EndDate = Null.NullDate; + this.DisplayTitle = true; + this.DisplayPrint = false; + this.DisplaySyndicate = Null.NullBoolean; + this.IsWebSlice = Null.NullBoolean; + this.WebSliceTitle = ""; + this.WebSliceExpiryDate = Null.NullDate; + this.WebSliceTTL = 0; + this.InheritViewPermissions = Null.NullBoolean; + this.IsShareable = true; + this.IsShareableViewOnly = true; + this.ContainerSrc = Null.NullString; + this.DesktopModuleID = Null.NullInteger; + this.ModuleControlId = Null.NullInteger; + this.ContainerPath = Null.NullString; + this.PaneModuleIndex = 0; + this.PaneModuleCount = 0; + this.IsDefaultModule = Null.NullBoolean; + this.AllModules = Null.NullBoolean; if (PortalSettings.Current.DefaultModuleId > Null.NullInteger && PortalSettings.Current.DefaultTabId > Null.NullInteger) { ModuleInfo objModule = ModuleController.Instance.GetModule(PortalSettings.Current.DefaultModuleId, PortalSettings.Current.DefaultTabId, true); if (objModule != null) { - Alignment = objModule.Alignment; - Color = objModule.Color; - Border = objModule.Border; - IconFile = objModule.IconFile; - Visibility = objModule.Visibility; - ContainerSrc = objModule.ContainerSrc; - DisplayTitle = objModule.DisplayTitle; - DisplayPrint = objModule.DisplayPrint; - DisplaySyndicate = objModule.DisplaySyndicate; + this.Alignment = objModule.Alignment; + this.Color = objModule.Color; + this.Border = objModule.Border; + this.IconFile = objModule.IconFile; + this.Visibility = objModule.Visibility; + this.ContainerSrc = objModule.ContainerSrc; + this.DisplayTitle = objModule.DisplayTitle; + this.DisplayPrint = objModule.DisplayPrint; + this.DisplaySyndicate = objModule.DisplaySyndicate; } } } diff --git a/DNN Platform/Library/Entities/Modules/ModuleSettingsBase.cs b/DNN Platform/Library/Entities/Modules/ModuleSettingsBase.cs index 59da7757fbf..7e2d28f0bc8 100644 --- a/DNN Platform/Library/Entities/Modules/ModuleSettingsBase.cs +++ b/DNN Platform/Library/Entities/Modules/ModuleSettingsBase.cs @@ -20,7 +20,7 @@ public Hashtable ModuleSettings { get { - return ModuleContext.Configuration.ModuleSettings; + return this.ModuleContext.Configuration.ModuleSettings; } } @@ -28,7 +28,7 @@ public Hashtable TabModuleSettings { get { - return ModuleContext.Configuration.TabModuleSettings; + return this.ModuleContext.Configuration.TabModuleSettings; } } diff --git a/DNN Platform/Library/Entities/Modules/PortalDesktopModuleInfo.cs b/DNN Platform/Library/Entities/Modules/PortalDesktopModuleInfo.cs index 71685291ce4..367c2bd95ed 100644 --- a/DNN Platform/Library/Entities/Modules/PortalDesktopModuleInfo.cs +++ b/DNN Platform/Library/Entities/Modules/PortalDesktopModuleInfo.cs @@ -28,11 +28,11 @@ public DesktopModuleInfo DesktopModule { get { - if (_desktopModule == null) + if (this._desktopModule == null) { - _desktopModule = DesktopModuleID > Null.NullInteger ? DesktopModuleController.GetDesktopModule(DesktopModuleID, PortalID) : new DesktopModuleInfo(); + this._desktopModule = this.DesktopModuleID > Null.NullInteger ? DesktopModuleController.GetDesktopModule(this.DesktopModuleID, this.PortalID) : new DesktopModuleInfo(); } - return _desktopModule; + return this._desktopModule; } } [XmlIgnore] @@ -44,11 +44,11 @@ public DesktopModulePermissionCollection Permissions { get { - if (_permissions == null) + if (this._permissions == null) { - _permissions = new DesktopModulePermissionCollection(DesktopModulePermissionController.GetDesktopModulePermissions(PortalDesktopModuleID)); + this._permissions = new DesktopModulePermissionCollection(DesktopModulePermissionController.GetDesktopModulePermissions(this.PortalDesktopModuleID)); } - return _permissions; + return this._permissions; } } diff --git a/DNN Platform/Library/Entities/Modules/PortalModuleBase.cs b/DNN Platform/Library/Entities/Modules/PortalModuleBase.cs index f233435be3e..b8d093329e5 100644 --- a/DNN Platform/Library/Entities/Modules/PortalModuleBase.cs +++ b/DNN Platform/Library/Entities/Modules/PortalModuleBase.cs @@ -61,7 +61,7 @@ public class PortalModuleBase : UserControlBase, IModuleControl public PortalModuleBase() { - DependencyProvider = Globals.DependencyProvider; + this.DependencyProvider = Globals.DependencyProvider; } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] @@ -69,11 +69,11 @@ public ModuleActionCollection Actions { get { - return ModuleContext.Actions; + return this.ModuleContext.Actions; } set { - ModuleContext.Actions = value; + this.ModuleContext.Actions = value; } } @@ -82,7 +82,7 @@ public Control ContainerControl { get { - return Globals.FindControlRecursive(this, "ctr" + ModuleId); + return Globals.FindControlRecursive(this, "ctr" + this.ModuleId); } } @@ -99,7 +99,7 @@ public bool EditMode { get { - return ModuleContext.EditMode; + return this.ModuleContext.EditMode; } } @@ -107,11 +107,11 @@ public string HelpURL { get { - return ModuleContext.HelpURL; + return this.ModuleContext.HelpURL; } set { - ModuleContext.HelpURL = value; + this.ModuleContext.HelpURL = value; } } @@ -120,7 +120,7 @@ public bool IsEditable { get { - return ModuleContext.IsEditable; + return this.ModuleContext.IsEditable; } } @@ -129,11 +129,11 @@ public ModuleInfo ModuleConfiguration { get { - return ModuleContext.Configuration; + return this.ModuleContext.Configuration; } set { - ModuleContext.Configuration = value; + this.ModuleContext.Configuration = value; } } @@ -142,7 +142,7 @@ public int PortalId { get { - return ModuleContext.PortalId; + return this.ModuleContext.PortalId; } } @@ -151,7 +151,7 @@ public int TabId { get { - return ModuleContext.TabId; + return this.ModuleContext.TabId; } } @@ -160,11 +160,11 @@ public int TabModuleId { get { - return ModuleContext.TabModuleId; + return this.ModuleContext.TabModuleId; } set { - ModuleContext.TabModuleId = value; + this.ModuleContext.TabModuleId = value; } } @@ -173,11 +173,11 @@ public int ModuleId { get { - return ModuleContext.ModuleId; + return this.ModuleContext.ModuleId; } set { - ModuleContext.ModuleId = value; + this.ModuleContext.ModuleId = value; } } @@ -186,7 +186,7 @@ public UserInfo UserInfo { get { - return PortalSettings.UserInfo; + return this.PortalSettings.UserInfo; } } @@ -195,7 +195,7 @@ public int UserId { get { - return PortalSettings.UserId; + return this.PortalSettings.UserId; } } @@ -204,7 +204,7 @@ public PortalAliasInfo PortalAlias { get { - return PortalSettings.PortalAlias; + return this.PortalSettings.PortalAlias; } } @@ -213,7 +213,7 @@ public Hashtable Settings { get { - return ModuleContext.Settings; + return this.ModuleContext.Settings; } } @@ -243,7 +243,7 @@ public string ControlPath { get { - return TemplateSourceDirectory + "/"; + return this.TemplateSourceDirectory + "/"; } } @@ -257,7 +257,7 @@ public string ControlName { get { - return GetType().Name.Replace("_", "."); + return this.GetType().Name.Replace("_", "."); } } @@ -272,19 +272,19 @@ public string LocalResourceFile get { string fileRoot; - if (string.IsNullOrEmpty(_localResourceFile)) + if (string.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = Path.Combine(ControlPath, Localization.LocalResourceDirectory + "/" + ID); + fileRoot = Path.Combine(this.ControlPath, Localization.LocalResourceDirectory + "/" + this.ID); } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -298,11 +298,11 @@ public ModuleInstanceContext ModuleContext { get { - if (_moduleContext == null) + if (this._moduleContext == null) { - _moduleContext = new ModuleInstanceContext(this); + this._moduleContext = new ModuleInstanceContext(this); } - return _moduleContext; + return this._moduleContext; } } @@ -310,55 +310,55 @@ public ModuleInstanceContext ModuleContext protected override void OnInit(EventArgs e) { - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"PortalModuleBase.OnInit Start (TabId:{PortalSettings.ActiveTab.TabID},ModuleId:{ModuleId}): {GetType()}"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"PortalModuleBase.OnInit Start (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleId:{this.ModuleId}): {this.GetType()}"); base.OnInit(e); - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"PortalModuleBase.OnInit End (TabId:{PortalSettings.ActiveTab.TabID},ModuleId:{ModuleId}): {GetType()}"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"PortalModuleBase.OnInit End (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleId:{this.ModuleId}): {this.GetType()}"); } protected override void OnLoad(EventArgs e) { - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"PortalModuleBase.OnLoad Start (TabId:{PortalSettings.ActiveTab.TabID},ModuleId:{ModuleId}): {GetType()}"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"PortalModuleBase.OnLoad Start (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleId:{this.ModuleId}): {this.GetType()}"); base.OnLoad(e); - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"PortalModuleBase.OnLoad End (TabId:{PortalSettings.ActiveTab.TabID},ModuleId:{ModuleId}): {GetType()}"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"PortalModuleBase.OnLoad End (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleId:{this.ModuleId}): {this.GetType()}"); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string EditUrl() { - return ModuleContext.EditUrl(); + return this.ModuleContext.EditUrl(); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string EditUrl(string ControlKey) { - return ModuleContext.EditUrl(ControlKey); + return this.ModuleContext.EditUrl(ControlKey); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string EditUrl(string KeyName, string KeyValue) { - return ModuleContext.EditUrl(KeyName, KeyValue); + return this.ModuleContext.EditUrl(KeyName, KeyValue); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string EditUrl(string KeyName, string KeyValue, string ControlKey) { - return ModuleContext.EditUrl(KeyName, KeyValue, ControlKey); + return this.ModuleContext.EditUrl(KeyName, KeyValue, ControlKey); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string EditUrl(string KeyName, string KeyValue, string ControlKey, params string[] AdditionalParameters) { - return ModuleContext.EditUrl(KeyName, KeyValue, ControlKey, AdditionalParameters); + return this.ModuleContext.EditUrl(KeyName, KeyValue, ControlKey, AdditionalParameters); } [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public string EditUrl(int TabID, string ControlKey, bool PageRedirect, params string[] AdditionalParameters) { - return ModuleContext.NavigateUrl(TabID, ControlKey, PageRedirect, AdditionalParameters); + return this.ModuleContext.NavigateUrl(TabID, ControlKey, PageRedirect, AdditionalParameters); } /// ----------------------------------------------------------------------------- @@ -374,24 +374,24 @@ protected void AddActionHandler(ActionEventHandler e) UI.Skins.Skin ParentSkin = UI.Skins.Skin.GetParentSkin(this); if (ParentSkin != null) { - ParentSkin.RegisterModuleActionEvent(ModuleId, e); + ParentSkin.RegisterModuleActionEvent(this.ModuleId, e); } } protected string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } protected string LocalizeSafeJsString(string key) { - return Localization.GetSafeJSString(key, LocalResourceFile); + return Localization.GetSafeJSString(key, this.LocalResourceFile); } public int GetNextActionID() { - return ModuleContext.GetNextActionID(); + return this.ModuleContext.GetNextActionID(); } #region "Obsolete methods" @@ -428,7 +428,7 @@ public string CacheFileName get { string strCacheKey = "TabModule:"; - strCacheKey += TabModuleId + ":"; + strCacheKey += this.TabModuleId + ":"; strCacheKey += Thread.CurrentThread.CurrentUICulture.ToString(); return PortalController.Instance.GetCurrentPortalSettings().HomeDirectoryMapPath + "Cache" + "\\" + Globals.CleanFileName(strCacheKey) + ".resources"; } @@ -440,7 +440,7 @@ public string CacheKey get { string strCacheKey = "TabModule:"; - strCacheKey += TabModuleId + ":"; + strCacheKey += this.TabModuleId + ":"; strCacheKey += Thread.CurrentThread.CurrentUICulture.ToString(); return strCacheKey; } @@ -467,7 +467,7 @@ public string GetCacheKey(int tabModuleId) [Obsolete("This method is deprecated. Plaese use ModuleController.SynchronizeModule(ModuleId). Scheduled removal in v11.0.0.")] public void SynchronizeModule() { - ModuleController.SynchronizeModule(ModuleId); + ModuleController.SynchronizeModule(this.ModuleId); } #endregion diff --git a/DNN Platform/Library/Entities/Modules/ProfileUserControlBase.cs b/DNN Platform/Library/Entities/Modules/ProfileUserControlBase.cs index 3fbe977141b..58ef156becf 100644 --- a/DNN Platform/Library/Entities/Modules/ProfileUserControlBase.cs +++ b/DNN Platform/Library/Entities/Modules/ProfileUserControlBase.cs @@ -33,9 +33,9 @@ public class ProfileUserControlBase : UserModuleBase /// ----------------------------------------------------------------------------- public void OnProfileUpdateCompleted(EventArgs e) { - if (ProfileUpdateCompleted != null) + if (this.ProfileUpdateCompleted != null) { - ProfileUpdateCompleted(this, e); + this.ProfileUpdateCompleted(this, e); } } @@ -46,9 +46,9 @@ public void OnProfileUpdateCompleted(EventArgs e) /// ----------------------------------------------------------------------------- public void OnProfileUpdated(EventArgs e) { - if (ProfileUpdated != null) + if (this.ProfileUpdated != null) { - ProfileUpdated(this, e); + this.ProfileUpdated(this, e); } } } diff --git a/DNN Platform/Library/Entities/Modules/Settings/SettingsRepository.cs b/DNN Platform/Library/Entities/Modules/Settings/SettingsRepository.cs index ecbd533ed00..c49a5c4de85 100644 --- a/DNN Platform/Library/Entities/Modules/Settings/SettingsRepository.cs +++ b/DNN Platform/Library/Entities/Modules/Settings/SettingsRepository.cs @@ -31,13 +31,13 @@ namespace DotNetNuke.Entities.Modules.Settings protected SettingsRepository() { - Mapping = LoadMapping(); - _moduleController = ModuleController.Instance; + this.Mapping = this.LoadMapping(); + this._moduleController = ModuleController.Instance; } public T GetSettings(ModuleInfo moduleContext) { - return CBO.GetCachedObject(new CacheItemArgs(CacheKey(moduleContext.TabModuleID), 20, CacheItemPriority.AboveNormal, moduleContext), Load, false); + return CBO.GetCachedObject(new CacheItemArgs(this.CacheKey(moduleContext.TabModuleID), 20, CacheItemPriority.AboveNormal, moduleContext), this.Load, false); } #region Serialization @@ -46,7 +46,7 @@ public void SaveSettings(ModuleInfo moduleContext, T settings) Requires.NotNull("settings", settings); Requires.NotNull("ctlModule", moduleContext); - Mapping.ForEach(mapping => + this.Mapping.ForEach(mapping => { var attribute = mapping.Attribute; var property = mapping.Property; @@ -67,12 +67,12 @@ public void SaveSettings(ModuleInfo moduleContext, T settings) if (attribute is ModuleSettingAttribute) { - _moduleController.UpdateModuleSetting(moduleContext.ModuleID, mapping.FullParameterName, settingValueAsString); + this._moduleController.UpdateModuleSetting(moduleContext.ModuleID, mapping.FullParameterName, settingValueAsString); moduleContext.ModuleSettings[mapping.FullParameterName] = settingValueAsString; // temporary fix for issue 3692 } else if (attribute is TabModuleSettingAttribute) { - _moduleController.UpdateTabModuleSetting(moduleContext.TabModuleID, mapping.FullParameterName, settingValueAsString); + this._moduleController.UpdateTabModuleSetting(moduleContext.TabModuleID, mapping.FullParameterName, settingValueAsString); moduleContext.TabModuleSettings[mapping.FullParameterName] = settingValueAsString; // temporary fix for issue 3692 } else if (attribute is PortalSettingAttribute) @@ -81,7 +81,7 @@ public void SaveSettings(ModuleInfo moduleContext, T settings) } } }); - DataCache.SetCache(CacheKey(moduleContext.TabModuleID), settings); + DataCache.SetCache(this.CacheKey(moduleContext.TabModuleID), settings); } private static string GetSettingValueAsString(object settingValue) @@ -151,7 +151,7 @@ private T Load(CacheItemArgs args) var ctlModule = (ModuleInfo)args.ParamList[0]; var settings = new T(); - Mapping.ForEach(mapping => + this.Mapping.ForEach(mapping => { string settingValue = null; @@ -174,7 +174,7 @@ private T Load(CacheItemArgs args) if (settingValue != null && property.CanWrite) { - DeserializeProperty(settings, property, attribute, settingValue); + this.DeserializeProperty(settings, property, attribute, settingValue); } }); @@ -264,7 +264,7 @@ private void DeserializeProperty(T settings, PropertyInfo property, ParameterAtt if (propertyType.GetInterface(typeof(IConvertible).FullName) != null) { - propertyValue = ChangeFormatForBooleansIfNeeded(propertyType, propertyValue); + propertyValue = this.ChangeFormatForBooleansIfNeeded(propertyType, propertyValue); property.SetValue(settings, Convert.ChangeType(propertyValue, propertyType, CultureInfo.InvariantCulture), null); return; } diff --git a/DNN Platform/Library/Entities/Modules/SkinControlInfo.cs b/DNN Platform/Library/Entities/Modules/SkinControlInfo.cs index 30badae723b..bb48e02bfd2 100644 --- a/DNN Platform/Library/Entities/Modules/SkinControlInfo.cs +++ b/DNN Platform/Library/Entities/Modules/SkinControlInfo.cs @@ -30,8 +30,8 @@ public class SkinControlInfo : ControlInfo, IXmlSerializable, IHydratable { public SkinControlInfo() { - PackageID = Null.NullInteger; - SkinControlID = Null.NullInteger; + this.PackageID = Null.NullInteger; + this.SkinControlID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -60,9 +60,9 @@ public SkinControlInfo() /// ----------------------------------------------------------------------------- public void Fill(IDataReader dr) { - SkinControlID = Null.SetNullInteger(dr["SkinControlID"]); - PackageID = Null.SetNullInteger(dr["PackageID"]); - FillInternal(dr); + this.SkinControlID = Null.SetNullInteger(dr["SkinControlID"]); + this.PackageID = Null.SetNullInteger(dr["PackageID"]); + this.FillInternal(dr); } /// ----------------------------------------------------------------------------- @@ -75,11 +75,11 @@ public int KeyID { get { - return SkinControlID; + return this.SkinControlID; } set { - SkinControlID = value; + this.SkinControlID = value; } } @@ -115,7 +115,7 @@ public void ReadXml(XmlReader reader) { continue; } - ReadXmlInternal(reader); + this.ReadXmlInternal(reader); } } @@ -131,7 +131,7 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("moduleControl"); //write out properties - WriteXmlInternal(writer); + this.WriteXmlInternal(writer); //Write end of main element writer.WriteEndElement(); diff --git a/DNN Platform/Library/Entities/Modules/UserModuleBase.cs b/DNN Platform/Library/Entities/Modules/UserModuleBase.cs index 9eecba6ed8b..95bad15e051 100644 --- a/DNN Platform/Library/Entities/Modules/UserModuleBase.cs +++ b/DNN Platform/Library/Entities/Modules/UserModuleBase.cs @@ -61,7 +61,7 @@ protected virtual bool AddUser { get { - return (UserId == Null.NullInteger); + return (this.UserId == Null.NullInteger); } } @@ -72,7 +72,7 @@ protected bool IsAdmin { get { - return Request.IsAuthenticated && PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); + return this.Request.IsAuthenticated && PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); } } @@ -86,7 +86,7 @@ protected bool IsUserOrAdmin { get { - return IsUser || IsAdmin; + return this.IsUser || this.IsAdmin; } } @@ -109,9 +109,9 @@ protected bool IsEdit get { bool _IsEdit = false; - if (Request.QueryString["ctl"] != null) + if (this.Request.QueryString["ctl"] != null) { - string ctl = Request.QueryString["ctl"]; + string ctl = this.Request.QueryString["ctl"]; if (ctl.Equals("edit", StringComparison.InvariantCultureIgnoreCase)) { _IsEdit = true; @@ -129,12 +129,12 @@ protected bool IsProfile get { bool _IsProfile = false; - if (IsUser) + if (this.IsUser) { - if (PortalSettings.UserTabId != -1) + if (this.PortalSettings.UserTabId != -1) { //user defined tab - if (PortalSettings.ActiveTab.TabID == PortalSettings.UserTabId) + if (this.PortalSettings.ActiveTab.TabID == this.PortalSettings.UserTabId) { _IsProfile = true; } @@ -142,9 +142,9 @@ protected bool IsProfile else { //admin tab - if (Request.QueryString["ctl"] != null) + if (this.Request.QueryString["ctl"] != null) { - string ctl = Request.QueryString["ctl"]; + string ctl = this.Request.QueryString["ctl"]; if (ctl.Equals("profile", StringComparison.InvariantCultureIgnoreCase)) { _IsProfile = true; @@ -163,7 +163,7 @@ protected bool IsRegister { get { - return !IsAdmin && !IsUser; + return !this.IsAdmin && !this.IsUser; } } @@ -174,7 +174,7 @@ protected bool IsUser { get { - return Request.IsAuthenticated && (UserId == UserInfo.UserID); + return this.Request.IsAuthenticated && (this.UserId == this.UserInfo.UserID); } } @@ -185,7 +185,7 @@ protected int UserPortalID { get { - return IsHostTab ? Null.NullInteger : PortalId; + return this.IsHostTab ? Null.NullInteger : this.PortalId; } } @@ -196,14 +196,14 @@ public UserInfo User { get { - return _User ?? (_User = AddUser ? InitialiseUser() : UserController.GetUserById(UserPortalID, UserId)); + return this._User ?? (this._User = this.AddUser ? this.InitialiseUser() : UserController.GetUserById(this.UserPortalID, this.UserId)); } set { - _User = value; - if (_User != null) + this._User = value; + if (this._User != null) { - UserId = _User.UserID; + this.UserId = this._User.UserID; } } } @@ -216,25 +216,25 @@ public UserInfo User get { int _UserId = Null.NullInteger; - if (ViewState["UserId"] == null) + if (this.ViewState["UserId"] == null) { - if (Request.QueryString["userid"] != null) + if (this.Request.QueryString["userid"] != null) { int userId; // Use Int32.MaxValue as invalid UserId - _UserId = Int32.TryParse(Request.QueryString["userid"], out userId) ? userId : Int32.MaxValue; - ViewState["UserId"] = _UserId; + _UserId = Int32.TryParse(this.Request.QueryString["userid"], out userId) ? userId : Int32.MaxValue; + this.ViewState["UserId"] = _UserId; } } else { - _UserId = Convert.ToInt32(ViewState["UserId"]); + _UserId = Convert.ToInt32(this.ViewState["UserId"]); } return _UserId; } set { - ViewState["UserId"] = value; + this.ViewState["UserId"] = value; } } @@ -287,26 +287,26 @@ public static void UpdateSettings(int portalId, Hashtable settings) private UserInfo InitialiseUser() { var newUser = new UserInfo(); - if (IsHostMenu && !IsRegister) + if (this.IsHostMenu && !this.IsRegister) { newUser.IsSuperUser = true; } else { - newUser.PortalID = PortalId; + newUser.PortalID = this.PortalId; } //Initialise the ProfileProperties Collection string lc = new Localization().CurrentUICulture; - newUser.Profile.InitialiseProfile(PortalId); - newUser.Profile.PreferredTimeZone = PortalSettings.TimeZone; + newUser.Profile.InitialiseProfile(this.PortalId); + newUser.Profile.PreferredTimeZone = this.PortalSettings.TimeZone; newUser.Profile.PreferredLocale = lc; //Set default countr string country = Null.NullString; - country = LookupCountry(); + country = this.LookupCountry(); if (!String.IsNullOrEmpty(country)) { ListController listController = new ListController(); @@ -320,9 +320,9 @@ private UserInfo InitialiseUser() } //Set AffiliateId int AffiliateId = Null.NullInteger; - if (Request.Cookies["AffiliateId"] != null) + if (this.Request.Cookies["AffiliateId"] != null) { - AffiliateId = int.Parse(Request.Cookies["AffiliateId"].Value); + AffiliateId = int.Parse(this.Request.Cookies["AffiliateId"].Value); } newUser.AffiliateID = AffiliateId; return newUser; @@ -335,23 +335,23 @@ private string LookupCountry() bool _CacheGeoIPData = true; string _GeoIPFile; _GeoIPFile = "controls/CountryListBox/Data/GeoIP.dat"; - if (Page.Request.UserHostAddress == "127.0.0.1") + if (this.Page.Request.UserHostAddress == "127.0.0.1") { //'The country cannot be detected because the user is local. IsLocal = true; //Set the IP address in case they didn't specify LocalhostCountryCode - IP = Page.Request.UserHostAddress; + IP = this.Page.Request.UserHostAddress; } else { //Set the IP address so we can find the country - IP = Page.Request.UserHostAddress; + IP = this.Page.Request.UserHostAddress; } //Check to see if we need to generate the Cache for the GeoIPData file - if (Context.Cache.Get("GeoIPData") == null && _CacheGeoIPData) + if (this.Context.Cache.Get("GeoIPData") == null && _CacheGeoIPData) { //Store it as well as setting a dependency on the file - Context.Cache.Insert("GeoIPData", CountryLookup.FileToMemory(Context.Server.MapPath(_GeoIPFile)), new CacheDependency(Context.Server.MapPath(_GeoIPFile))); + this.Context.Cache.Insert("GeoIPData", CountryLookup.FileToMemory(this.Context.Server.MapPath(_GeoIPFile)), new CacheDependency(this.Context.Server.MapPath(_GeoIPFile))); } //Check to see if the request is a localhost request @@ -370,12 +370,12 @@ private string LookupCountry() if (_CacheGeoIPData) { //Yes, get it from cache - _CountryLookup = new CountryLookup((MemoryStream) Context.Cache.Get("GeoIPData")); + _CountryLookup = new CountryLookup((MemoryStream) this.Context.Cache.Get("GeoIPData")); } else { //No, get it from file - _CountryLookup = new CountryLookup(Context.Server.MapPath(_GeoIPFile)); + _CountryLookup = new CountryLookup(this.Context.Server.MapPath(_GeoIPFile)); } //Get the country code based on the IP address string country = Null.NullString; @@ -412,7 +412,7 @@ protected void AddLocalizedModuleMessage(string message, ModuleMessage.ModuleMes /// A flag that determines whether the message should be displayed protected void AddModuleMessage(string message, ModuleMessage.ModuleMessageType type, bool display) { - AddLocalizedModuleMessage(Localization.GetString(message, LocalResourceFile), type, display); + this.AddLocalizedModuleMessage(Localization.GetString(message, this.LocalResourceFile), type, display); } protected string CompleteUserCreation(UserCreateStatus createStatus, UserInfo newUser, bool notify, bool register) @@ -424,19 +424,19 @@ protected string CompleteUserCreation(UserCreateStatus createStatus, UserInfo ne //send notification to portal administrator of new user registration //check the receive notification setting first, but if register type is Private, we will always send the notification email. //because the user need administrators to do the approve action so that he can continue use the website. - if (PortalSettings.EnableRegisterNotification || PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.PrivateRegistration) + if (this.PortalSettings.EnableRegisterNotification || this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.PrivateRegistration) { - strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationAdmin, PortalSettings); - SendAdminNotification(newUser, PortalSettings); + strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationAdmin, this.PortalSettings); + this.SendAdminNotification(newUser, this.PortalSettings); } var loginStatus = UserLoginStatus.LOGIN_FAILURE; //complete registration - switch (PortalSettings.UserRegistration) + switch (this.PortalSettings.UserRegistration) { case (int) Globals.PortalRegistrationType.PrivateRegistration: - strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPrivate, PortalSettings); + strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPrivate, this.PortalSettings); //show a message that a portal administrator has to verify the user credentials if (string.IsNullOrEmpty(strMessage)) @@ -446,23 +446,23 @@ protected string CompleteUserCreation(UserCreateStatus createStatus, UserInfo ne } break; case (int) Globals.PortalRegistrationType.PublicRegistration: - Mail.SendMail(newUser, MessageType.UserRegistrationPublic, PortalSettings); - UserController.UserLogin(PortalSettings.PortalId, newUser.Username, newUser.Membership.Password, "", PortalSettings.PortalName, "", ref loginStatus, false); + Mail.SendMail(newUser, MessageType.UserRegistrationPublic, this.PortalSettings); + UserController.UserLogin(this.PortalSettings.PortalId, newUser.Username, newUser.Membership.Password, "", this.PortalSettings.PortalName, "", ref loginStatus, false); break; case (int) Globals.PortalRegistrationType.VerifiedRegistration: - Mail.SendMail(newUser, MessageType.UserRegistrationVerified, PortalSettings); - UserController.UserLogin(PortalSettings.PortalId, newUser.Username, newUser.Membership.Password, "", PortalSettings.PortalName, "", ref loginStatus, false); + Mail.SendMail(newUser, MessageType.UserRegistrationVerified, this.PortalSettings); + UserController.UserLogin(this.PortalSettings.PortalId, newUser.Username, newUser.Membership.Password, "", this.PortalSettings.PortalName, "", ref loginStatus, false); break; } //store preferredlocale in cookie Localization.SetLanguage(newUser.Profile.PreferredLocale); - if (IsRegister && message == ModuleMessage.ModuleMessageType.RedError) + if (this.IsRegister && message == ModuleMessage.ModuleMessageType.RedError) { - AddLocalizedModuleMessage(string.Format(Localization.GetString("SendMail.Error", Localization.SharedResourceFile), strMessage), message, (!String.IsNullOrEmpty(strMessage))); + this.AddLocalizedModuleMessage(string.Format(Localization.GetString("SendMail.Error", Localization.SharedResourceFile), strMessage), message, (!String.IsNullOrEmpty(strMessage))); } else { - AddLocalizedModuleMessage(strMessage, message, (!String.IsNullOrEmpty(strMessage))); + this.AddLocalizedModuleMessage(strMessage, message, (!String.IsNullOrEmpty(strMessage))); } } else @@ -470,13 +470,13 @@ protected string CompleteUserCreation(UserCreateStatus createStatus, UserInfo ne if (notify) { //Send Notification to User - if (PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.VerifiedRegistration) + if (this.PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.VerifiedRegistration) { - strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationVerified, PortalSettings); + strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationVerified, this.PortalSettings); } else { - strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPublic, PortalSettings); + strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPublic, this.PortalSettings); } } } @@ -495,8 +495,8 @@ private void SendAdminNotification(UserInfo newUser, PortalSettings portalSettin NotificationTypeID = NotificationsController.Instance.GetNotificationType(notificationType).NotificationTypeId, IncludeDismissAction = newUser.Membership.Approved, SenderUserID = portalSettings.AdministratorId, - Subject = GetNotificationSubject(locale, newUser, portalSettings), - Body = GetNotificationBody(locale, newUser, portalSettings), + Subject = this.GetNotificationSubject(locale, newUser, portalSettings), + Body = this.GetNotificationBody(locale, newUser, portalSettings), Context = newUser.UserID.ToString(CultureInfo.InvariantCulture) }; var adminrole = RoleController.Instance.GetRoleById(portalSettings.PortalId, portalSettings.AdministratorRoleId); @@ -507,7 +507,7 @@ private void SendAdminNotification(UserInfo newUser, PortalSettings portalSettin private string GetNotificationBody(string locale, UserInfo newUser, PortalSettings portalSettings) { const string text = "EMAIL_USER_REGISTRATION_ADMINISTRATOR_BODY"; - return LocalizeNotificationText(text, locale, newUser, portalSettings); + return this.LocalizeNotificationText(text, locale, newUser, portalSettings); } private string LocalizeNotificationText(string text, string locale, UserInfo user, PortalSettings portalSettings) @@ -519,7 +519,7 @@ private string LocalizeNotificationText(string text, string locale, UserInfo use private string GetNotificationSubject(string locale, UserInfo newUser, PortalSettings portalSettings) { const string text = "EMAIL_USER_REGISTRATION_ADMINISTRATOR_SUBJECT"; - return LocalizeNotificationText(text, locale, newUser, portalSettings); + return this.LocalizeNotificationText(text, locale, newUser, portalSettings); } #endregion diff --git a/DNN Platform/Library/Entities/Modules/UserUserControlBase.cs b/DNN Platform/Library/Entities/Modules/UserUserControlBase.cs index ec998e7726f..9c8c1bfd5eb 100644 --- a/DNN Platform/Library/Entities/Modules/UserUserControlBase.cs +++ b/DNN Platform/Library/Entities/Modules/UserUserControlBase.cs @@ -57,9 +57,9 @@ public class UserUserControlBase : UserModuleBase /// ----------------------------------------------------------------------------- public void OnUserCreateCompleted(UserCreatedEventArgs e) { - if (UserCreateCompleted != null) + if (this.UserCreateCompleted != null) { - UserCreateCompleted(this, e); + this.UserCreateCompleted(this, e); } } @@ -70,9 +70,9 @@ public void OnUserCreateCompleted(UserCreatedEventArgs e) /// ----------------------------------------------------------------------------- public void OnUserCreated(UserCreatedEventArgs e) { - if (UserCreated != null) + if (this.UserCreated != null) { - UserCreated(this, e); + this.UserCreated(this, e); } } @@ -83,9 +83,9 @@ public void OnUserCreated(UserCreatedEventArgs e) /// ----------------------------------------------------------------------------- public void OnUserDeleted(UserDeletedEventArgs e) { - if (UserDeleted != null) + if (this.UserDeleted != null) { - UserDeleted(this, e); + this.UserDeleted(this, e); } } @@ -96,41 +96,41 @@ public void OnUserDeleted(UserDeletedEventArgs e) /// ----------------------------------------------------------------------------- public void OnUserDeleteError(UserUpdateErrorArgs e) { - if (UserDeleteError != null) + if (this.UserDeleteError != null) { - UserDeleteError(this, e); + this.UserDeleteError(this, e); } } public void OnUserRestored(UserRestoredEventArgs e) { - if (UserRestored != null) + if (this.UserRestored != null) { - UserRestored(this, e); + this.UserRestored(this, e); } } public void OnUserRestoreError(UserUpdateErrorArgs e) { - if (UserRestoreError != null) + if (this.UserRestoreError != null) { - UserRestoreError(this, e); + this.UserRestoreError(this, e); } } public void OnUserRemoved(UserRemovedEventArgs e) { - if (UserRemoved != null) + if (this.UserRemoved != null) { - UserRemoved(this, e); + this.UserRemoved(this, e); } } public void OnUserRemoveError(UserUpdateErrorArgs e) { - if (UserRemoveError != null) + if (this.UserRemoveError != null) { - UserRemoveError(this, e); + this.UserRemoveError(this, e); } } @@ -141,9 +141,9 @@ public void OnUserRemoveError(UserUpdateErrorArgs e) /// ----------------------------------------------------------------------------- public void OnUserUpdated(EventArgs e) { - if (UserUpdated != null) + if (this.UserUpdated != null) { - UserUpdated(this, e); + this.UserUpdated(this, e); } } @@ -154,9 +154,9 @@ public void OnUserUpdated(EventArgs e) /// ----------------------------------------------------------------------------- public void OnUserUpdateCompleted(EventArgs e) { - if (UserUpdateCompleted != null) + if (this.UserUpdateCompleted != null) { - UserUpdateCompleted(this, e); + this.UserUpdateCompleted(this, e); } } @@ -167,9 +167,9 @@ public void OnUserUpdateCompleted(EventArgs e) /// ----------------------------------------------------------------------------- public void OnUserUpdateError(UserUpdateErrorArgs e) { - if (UserUpdateError != null) + if (this.UserUpdateError != null) { - UserUpdateError(this, e); + this.UserUpdateError(this, e); } } @@ -177,7 +177,7 @@ public void OnUserUpdateError(UserUpdateErrorArgs e) #region "Properties" - protected override bool AddUser => !Request.IsAuthenticated || base.AddUser; + protected override bool AddUser => !this.Request.IsAuthenticated || base.AddUser; #endregion @@ -227,7 +227,7 @@ public class UserCreatedEventArgs /// ----------------------------------------------------------------------------- public UserCreatedEventArgs(UserInfo newUser) { - NewUser = newUser; + this.NewUser = newUser; } /// ----------------------------------------------------------------------------- @@ -239,11 +239,11 @@ public UserCreateStatus CreateStatus { get { - return _createStatus; + return this._createStatus; } set { - _createStatus = value; + this._createStatus = value; } } @@ -283,8 +283,8 @@ public class UserDeletedEventArgs : BaseUserEventArgs /// ----------------------------------------------------------------------------- public UserDeletedEventArgs(int id, string name) { - UserId = id; - UserName = name; + this.UserId = id; + this.UserName = name; } } @@ -309,8 +309,8 @@ public class UserRestoredEventArgs : BaseUserEventArgs /// ----------------------------------------------------------------------------- public UserRestoredEventArgs(int id, string name) { - UserId = id; - UserName = name; + this.UserId = id; + this.UserName = name; } } @@ -336,8 +336,8 @@ public class UserRemovedEventArgs : BaseUserEventArgs /// ----------------------------------------------------------------------------- public UserRemovedEventArgs(int id, string name) { - UserId = id; - UserName = name; + this.UserId = id; + this.UserName = name; } } @@ -364,9 +364,9 @@ public class UserUpdateErrorArgs : BaseUserEventArgs /// ----------------------------------------------------------------------------- public UserUpdateErrorArgs(int id, string name, string message) { - UserId = id; - UserName = name; - Message = message; + this.UserId = id; + this.UserName = name; + this.Message = message; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/Entities/Portals/Data/DataService.cs b/DNN Platform/Library/Entities/Portals/Data/DataService.cs index 9b671c980cd..d62b639beac 100644 --- a/DNN Platform/Library/Entities/Portals/Data/DataService.cs +++ b/DNN Platform/Library/Entities/Portals/Data/DataService.cs @@ -18,7 +18,7 @@ public class DataService : ComponentBase, IDataServic public int AddPortalGroup(PortalGroupInfo portalGroup, int createdByUserId) { - return _provider.ExecuteScalar("AddPortalGroup", + return this._provider.ExecuteScalar("AddPortalGroup", portalGroup.PortalGroupName, portalGroup.PortalGroupDescription, portalGroup.MasterPortalId, @@ -28,17 +28,17 @@ public int AddPortalGroup(PortalGroupInfo portalGroup, int createdByUserId) public void DeletePortalGroup(PortalGroupInfo portalGroup) { - _provider.ExecuteNonQuery("DeletePortalGroup", portalGroup.PortalGroupId); + this._provider.ExecuteNonQuery("DeletePortalGroup", portalGroup.PortalGroupId); } public IDataReader GetPortalGroups() { - return _provider.ExecuteReader("GetPortalGroups"); + return this._provider.ExecuteReader("GetPortalGroups"); } public void UpdatePortalGroup(PortalGroupInfo portalGroup, int lastModifiedByUserId) { - _provider.ExecuteNonQuery("UpdatePortalGroup", + this._provider.ExecuteNonQuery("UpdatePortalGroup", portalGroup.PortalGroupId, portalGroup.PortalGroupName, portalGroup.PortalGroupDescription, @@ -48,12 +48,12 @@ public void UpdatePortalGroup(PortalGroupInfo portalGroup, int lastModifiedByUse public IDataReader GetSharedModulesWithPortal(PortalInfo portal) { - return _provider.ExecuteReader("GetSharedModulesWithPortal", portal.PortalID); + return this._provider.ExecuteReader("GetSharedModulesWithPortal", portal.PortalID); } public IDataReader GetSharedModulesByPortal(PortalInfo portal) { - return _provider.ExecuteReader("GetSharedModulesByPortal", portal.PortalID); + return this._provider.ExecuteReader("GetSharedModulesByPortal", portal.PortalID); } } } diff --git a/DNN Platform/Library/Entities/Portals/PortalAliasCollection.cs b/DNN Platform/Library/Entities/Portals/PortalAliasCollection.cs index d91d773734e..8e57ce317e4 100644 --- a/DNN Platform/Library/Entities/Portals/PortalAliasCollection.cs +++ b/DNN Platform/Library/Entities/Portals/PortalAliasCollection.cs @@ -21,11 +21,11 @@ public PortalAliasInfo this[string key] { get { - return (PortalAliasInfo) Dictionary[key]; + return (PortalAliasInfo) this.Dictionary[key]; } set { - Dictionary[key] = value; + this.Dictionary[key] = value; } } @@ -36,7 +36,7 @@ public Boolean HasKeys { get { - return Dictionary.Keys.Count > 0; + return this.Dictionary.Keys.Count > 0; } } @@ -44,7 +44,7 @@ public ICollection Keys { get { - return Dictionary.Keys; + return this.Dictionary.Keys; } } @@ -52,13 +52,13 @@ public ICollection Values { get { - return Dictionary.Values; + return this.Dictionary.Values; } } public bool Contains(String key) { - return Dictionary.Contains(key); + return this.Dictionary.Contains(key); } /// @@ -66,7 +66,7 @@ public bool Contains(String key) /// public void Add(String key, PortalAliasInfo value) { - Dictionary.Add(key, value); + this.Dictionary.Add(key, value); } } } diff --git a/DNN Platform/Library/Entities/Portals/PortalAliasController.cs b/DNN Platform/Library/Entities/Portals/PortalAliasController.cs index 15539e328c5..f2ebcdc8965 100644 --- a/DNN Platform/Library/Entities/Portals/PortalAliasController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalAliasController.cs @@ -59,7 +59,7 @@ private static void ClearCache(bool refreshServiceRoutes, int portalId = -1) private PortalAliasInfo GetPortalAliasLookupInternal(string alias) { - return GetPortalAliasesInternal().SingleOrDefault(pa => pa.Key == alias).Value; + return this.GetPortalAliasesInternal().SingleOrDefault(pa => pa.Key == alias).Value; } private PortalAliasInfo GetPortalAliasInternal(string httpAlias) @@ -67,7 +67,7 @@ private PortalAliasInfo GetPortalAliasInternal(string httpAlias) string strPortalAlias; //try the specified alias first - PortalAliasInfo portalAlias = GetPortalAliasLookupInternal(httpAlias.ToLowerInvariant()); + PortalAliasInfo portalAlias = this.GetPortalAliasLookupInternal(httpAlias.ToLowerInvariant()); //domain.com and www.domain.com should be synonymous if (portalAlias == null) @@ -82,7 +82,7 @@ private PortalAliasInfo GetPortalAliasInternal(string httpAlias) strPortalAlias = string.Concat("www.", httpAlias); } //perform the lookup - portalAlias = GetPortalAliasLookupInternal(strPortalAlias.ToLowerInvariant()); + portalAlias = this.GetPortalAliasLookupInternal(strPortalAlias.ToLowerInvariant()); } //allow domain wildcards if (portalAlias == null) @@ -97,13 +97,13 @@ private PortalAliasInfo GetPortalAliasInternal(string httpAlias) strPortalAlias = httpAlias; } //try an explicit lookup using the wildcard entry ( ie. *.domain.com ) - portalAlias = GetPortalAliasLookupInternal("*." + strPortalAlias.ToLowerInvariant()) ?? - GetPortalAliasLookupInternal(strPortalAlias.ToLowerInvariant()); + portalAlias = this.GetPortalAliasLookupInternal("*." + strPortalAlias.ToLowerInvariant()) ?? + this.GetPortalAliasLookupInternal(strPortalAlias.ToLowerInvariant()); if (portalAlias == null) { //try a lookup using "www." + raw domain - portalAlias = GetPortalAliasLookupInternal("www." + strPortalAlias.ToLowerInvariant()); + portalAlias = this.GetPortalAliasLookupInternal("www." + strPortalAlias.ToLowerInvariant()); } } if (portalAlias == null) @@ -124,7 +124,7 @@ private PortalAliasInfo GetPortalAliasInternal(string httpAlias) //clear the cachekey "GetPortalByAlias" otherwise portalalias "_default" stays in cache after first install DataCache.RemoveCache("GetPortalByAlias"); //try again - portalAlias = GetPortalAliasLookupInternal(httpAlias.ToLowerInvariant()); + portalAlias = this.GetPortalAliasLookupInternal(httpAlias.ToLowerInvariant()); } } return portalAlias; @@ -192,7 +192,7 @@ public void DeletePortalAlias(PortalAliasInfo portalAlias) public PortalAliasInfo GetPortalAlias(string alias) { - return GetPortalAliasInternal(alias); + return this.GetPortalAliasInternal(alias); } /// @@ -203,7 +203,7 @@ public PortalAliasInfo GetPortalAlias(string alias) /// Portal Alias Info. public PortalAliasInfo GetPortalAlias(string alias, int portalId) { - return GetPortalAliasesInternal().SingleOrDefault(pa => pa.Key.Equals(alias, StringComparison.InvariantCultureIgnoreCase) && pa.Value.PortalID == portalId).Value; + return this.GetPortalAliasesInternal().SingleOrDefault(pa => pa.Key.Equals(alias, StringComparison.InvariantCultureIgnoreCase) && pa.Value.PortalID == portalId).Value; } /// @@ -213,7 +213,7 @@ public PortalAliasInfo GetPortalAlias(string alias, int portalId) /// Portal alias info. public PortalAliasInfo GetPortalAliasByPortalAliasID(int portalAliasId) { - return GetPortalAliasesInternal().SingleOrDefault(pa => pa.Value.PortalAliasID == portalAliasId).Value; + return this.GetPortalAliasesInternal().SingleOrDefault(pa => pa.Value.PortalAliasID == portalAliasId).Value; } internal Dictionary GetPortalAliasesInternal() @@ -233,7 +233,7 @@ internal Dictionary GetPortalAliasesInternal() public PortalAliasCollection GetPortalAliases() { var aliasCollection = new PortalAliasCollection(); - foreach (var alias in GetPortalAliasesInternal().Values) + foreach (var alias in this.GetPortalAliasesInternal().Values) { aliasCollection.Add(alias.HTTPAlias, alias); } @@ -243,7 +243,7 @@ public PortalAliasCollection GetPortalAliases() public IEnumerable GetPortalAliasesByPortalId(int portalId) { - return GetPortalAliasesInternal().Values.Where(alias => alias.PortalID == portalId).ToList(); + return this.GetPortalAliasesInternal().Values.Where(alias => alias.PortalID == portalId).ToList(); } /// diff --git a/DNN Platform/Library/Entities/Portals/PortalAliasInfo.cs b/DNN Platform/Library/Entities/Portals/PortalAliasInfo.cs index c583b98642f..a3e375ef579 100644 --- a/DNN Platform/Library/Entities/Portals/PortalAliasInfo.cs +++ b/DNN Platform/Library/Entities/Portals/PortalAliasInfo.cs @@ -25,14 +25,14 @@ public PortalAliasInfo() {} public PortalAliasInfo(PortalAliasInfo alias) { - HTTPAlias = alias.HTTPAlias; - PortalAliasID = alias.PortalAliasID; - PortalID = alias.PortalID; - IsPrimary = alias.IsPrimary; - Redirect = alias.Redirect; - BrowserType = alias.BrowserType; - CultureCode = alias.CultureCode; - Skin = alias.Skin; + this.HTTPAlias = alias.HTTPAlias; + this.PortalAliasID = alias.PortalAliasID; + this.PortalID = alias.PortalID; + this.IsPrimary = alias.IsPrimary; + this.Redirect = alias.Redirect; + this.BrowserType = alias.BrowserType; + this.CultureCode = alias.CultureCode; + this.Skin = alias.Skin; } #region Auto-Properties @@ -53,24 +53,24 @@ public PortalAliasInfo(PortalAliasInfo alias) public int KeyID { - get { return PortalAliasID; } - set { PortalAliasID = value; } + get { return this.PortalAliasID; } + set { this.PortalAliasID = value; } } public void Fill(IDataReader dr) { base.FillInternal(dr); - PortalAliasID = Null.SetNullInteger(dr["PortalAliasID"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - HTTPAlias = Null.SetNullString(dr["HTTPAlias"]); - IsPrimary = Null.SetNullBoolean(dr["IsPrimary"]); + this.PortalAliasID = Null.SetNullInteger(dr["PortalAliasID"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.HTTPAlias = Null.SetNullString(dr["HTTPAlias"]); + this.IsPrimary = Null.SetNullBoolean(dr["IsPrimary"]); var browserType = Null.SetNullString(dr["BrowserType"]); - BrowserType = String.IsNullOrEmpty(browserType) || browserType.Equals("normal", StringComparison.OrdinalIgnoreCase) + this.BrowserType = String.IsNullOrEmpty(browserType) || browserType.Equals("normal", StringComparison.OrdinalIgnoreCase) ? BrowserTypes.Normal : BrowserTypes.Mobile; - CultureCode = Null.SetNullString(dr["CultureCode"]); - Skin = Null.SetNullString(dr["Skin"]); + this.CultureCode = Null.SetNullString(dr["CultureCode"]); + this.Skin = Null.SetNullString(dr["Skin"]); } #endregion @@ -99,26 +99,26 @@ public void ReadXml(XmlReader reader) case "portalAlias": break; case "portalID": - PortalID = reader.ReadElementContentAsInt(); + this.PortalID = reader.ReadElementContentAsInt(); break; case "portalAliasID": - PortalAliasID = reader.ReadElementContentAsInt(); + this.PortalAliasID = reader.ReadElementContentAsInt(); break; case "HTTPAlias": - HTTPAlias = reader.ReadElementContentAsString(); + this.HTTPAlias = reader.ReadElementContentAsString(); break; case "skin": - Skin = reader.ReadElementContentAsString(); + this.Skin = reader.ReadElementContentAsString(); break; case "cultureCode": - CultureCode = reader.ReadElementContentAsString(); + this.CultureCode = reader.ReadElementContentAsString(); break; case "browserType": string type = reader.ReadElementContentAsString(); - BrowserType = type.Equals("mobile", StringComparison.InvariantCultureIgnoreCase) ? BrowserTypes.Mobile : BrowserTypes.Normal; + this.BrowserType = type.Equals("mobile", StringComparison.InvariantCultureIgnoreCase) ? BrowserTypes.Mobile : BrowserTypes.Normal; break; case "primary": - IsPrimary = reader.ReadElementContentAsBoolean(); + this.IsPrimary = reader.ReadElementContentAsBoolean(); break; default: if(reader.NodeType == XmlNodeType.Element && !String.IsNullOrEmpty(reader.Name)) @@ -136,13 +136,13 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("portalAlias"); //write out properties - writer.WriteElementString("portalID", PortalID.ToString()); - writer.WriteElementString("portalAliasID", PortalAliasID.ToString()); - writer.WriteElementString("HTTPAlias", HTTPAlias); - writer.WriteElementString("skin", Skin); - writer.WriteElementString("cultureCode", CultureCode); - writer.WriteElementString("browserType", BrowserType.ToString().ToLowerInvariant()); - writer.WriteElementString("primary", IsPrimary.ToString().ToLowerInvariant()); + writer.WriteElementString("portalID", this.PortalID.ToString()); + writer.WriteElementString("portalAliasID", this.PortalAliasID.ToString()); + writer.WriteElementString("HTTPAlias", this.HTTPAlias); + writer.WriteElementString("skin", this.Skin); + writer.WriteElementString("cultureCode", this.CultureCode); + writer.WriteElementString("browserType", this.BrowserType.ToString().ToLowerInvariant()); + writer.WriteElementString("primary", this.IsPrimary.ToString().ToLowerInvariant()); //Write end of main element writer.WriteEndElement(); diff --git a/DNN Platform/Library/Entities/Portals/PortalController.cs b/DNN Platform/Library/Entities/Portals/PortalController.cs index d60dc524fc9..63f1bbc830d 100644 --- a/DNN Platform/Library/Entities/Portals/PortalController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalController.cs @@ -77,7 +77,7 @@ protected override Func GetFactory() private void AddFolderPermissions(int portalId, int folderId) { - var portal = GetPortal(portalId); + var portal = this.GetPortal(portalId); var folderManager = FolderManager.Instance; var folder = folderManager.GetFolder(folderId); var permissionController = new PermissionController(); @@ -138,7 +138,7 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi } string templatePath, templateFile; - PrepareLocalizedPortalTemplate(template, out templatePath, out templateFile); + this.PrepareLocalizedPortalTemplate(template, out templatePath, out templateFile); string mergedTemplatePath = Path.Combine(templatePath, templateFile); if (String.IsNullOrEmpty(homeDirectory)) @@ -205,12 +205,12 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi } //copy the default page template - CopyPageTemplate("Default.page.template", mappedHomeDirectory); + this.CopyPageTemplate("Default.page.template", mappedHomeDirectory); // process zip resource file if present if (File.Exists(template.ResourceFilePath)) { - ProcessResourceFileExplicit(mappedHomeDirectory, template.ResourceFilePath); + this.ProcessResourceFileExplicit(mappedHomeDirectory, template.ResourceFilePath); } } catch (Exception Exc) @@ -246,8 +246,8 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi { try { - CreatePredefinedFolderTypes(portalId); - ParseTemplateInternal(portalId, templatePath, templateFile, adminUser.UserID, PortalTemplateModuleAction.Replace, true, out newPortalLocales); + this.CreatePredefinedFolderTypes(portalId); + this.ParseTemplateInternal(portalId, templatePath, templateFile, adminUser.UserID, PortalTemplateModuleAction.Replace, true, out newPortalLocales); } catch (Exception Exc) { @@ -262,7 +262,7 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi if (message == Null.NullString) { - var portal = GetPortal(portalId); + var portal = this.GetPortal(portalId); portal.Description = description; portal.KeyWords = keyWords; portal.UserTabId = TabController.GetTabByTabPath(portal.PortalID, "//UserProfile", portal.CultureCode); @@ -271,7 +271,7 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi portal.UserTabId = TabController.GetTabByTabPath(portal.PortalID, "//ActivityFeed", portal.CultureCode); } portal.SearchTabId = TabController.GetTabByTabPath(portal.PortalID, "//SearchResults", portal.CultureCode); - UpdatePortalInfo(portal); + this.UpdatePortalInfo(portal); adminUser.Profile.PreferredLocale = portal.DefaultLanguage; var portalSettings = new PortalSettings(portal); @@ -280,7 +280,7 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi DesktopModuleController.AddDesktopModulesToPortal(portalId); - AddPortalAlias(portalId, portalAlias); + this.AddPortalAlias(portalId, portalAlias); UpdatePortalSetting(portalId, "DefaultPortalAlias", portalAlias, false); @@ -293,7 +293,7 @@ private void CreatePortalInternal(int portalId, string portalName, UserInfo admi Localization.AddLanguageToPortal(portalId, newPortalLocale.LanguageId, false); if (portalSettings.ContentLocalizationEnabled) { - MapLocalizedSpecialPages(portalId, newPortalLocale.Code); + this.MapLocalizedSpecialPages(portalId, newPortalLocale.Code); } } } @@ -926,7 +926,7 @@ private void CreatePredefinedFolderTypes(int portalId) try { EnsureFolderProviderRegistration(folderTypeConfig, webConfig); - FolderMappingController.Instance.AddFolderMapping(GetFolderMappingFromConfig(folderTypeConfig, + FolderMappingController.Instance.AddFolderMapping(this.GetFolderMappingFromConfig(folderTypeConfig, portalId)); } catch (Exception ex) @@ -1045,7 +1045,7 @@ private FolderMappingInfo GetFolderMappingFromConfig(FolderTypeConfig node, int foreach (FolderTypeSettingConfig settingNode in node.Settings) { - var settingValue = EnsureSettingValue(folderMapping.FolderProviderType, settingNode, portalId); + var settingValue = this.EnsureSettingValue(folderMapping.FolderProviderType, settingNode, portalId); folderMapping.FolderMappingSettings.Add(settingNode.Name, settingValue); } @@ -1177,7 +1177,7 @@ private void ParseFolders(XmlNode nodeFolders, int portalId) try { folderMapping = FolderMappingsConfigController.Instance.GetFolderMapping(portalId, folderPath) - ?? GetFolderMappingFromStorageLocation(portalId, node); + ?? this.GetFolderMappingFromStorageLocation(portalId, node); } catch (Exception ex) { @@ -1351,7 +1351,7 @@ private static void ParsePortalDesktopModules(XPathNavigator nav, int portalID) private void ParsePortalSettings(XmlNode nodeSettings, int portalId) { String currentCulture = GetActivePortalLanguage(portalId); - var objPortal = GetPortal(portalId); + var objPortal = this.GetPortal(portalId); objPortal.LogoFile = Globals.ImportFile(portalId, XmlUtils.GetNodeValue(nodeSettings.CreateNavigator(), "logofile")); objPortal.FooterText = XmlUtils.GetNodeValue(nodeSettings.CreateNavigator(), "footertext"); if (nodeSettings.SelectSingleNode("expirydate") != null) @@ -1384,7 +1384,7 @@ private void ParsePortalSettings(XmlNode nodeSettings, int portalId) objPortal.PaymentProcessor = XmlUtils.GetNodeValue(nodeSettings.CreateNavigator(), "paymentprocessor"); objPortal.DefaultLanguage = XmlUtils.GetNodeValue(nodeSettings, "defaultlanguage", "en-US"); - UpdatePortalInfo(objPortal); + this.UpdatePortalInfo(objPortal); if (!String.IsNullOrEmpty(XmlUtils.GetNodeValue(nodeSettings, "skinsrc", ""))) { @@ -1541,8 +1541,8 @@ private void ParseRoleGroups(XPathNavigator nav, int portalID, int administrator CreateDefaultPortalRoles(portalID, administratorId, ref administratorRoleId, ref registeredRoleId, ref subscriberRoleId, unverifiedRoleId); //update portal setup - var portal = GetPortal(portalID); - UpdatePortalSetup(portalID, + var portal = this.GetPortal(portalID); + this.UpdatePortalSetup(portalID, administratorId, administratorRoleId, registeredRoleId, @@ -1597,8 +1597,8 @@ private void ParseRoles(XPathNavigator nav, int portalID, int administratorId) CreateDefaultPortalRoles(portalID, administratorId, ref administratorRoleId, ref registeredRoleId, ref subscriberRoleId, unverifiedRoleId); //update portal setup - var portal = GetPortal(portalID); - UpdatePortalSetup(portalID, + var portal = this.GetPortal(portalID); + this.UpdatePortalSetup(portalID, administratorId, administratorRoleId, registeredRoleId, @@ -1620,7 +1620,7 @@ private void ParseTab(XmlNode nodeTab, int portalId, bool isAdminTemplate, Porta { TabInfo tab = null; string strName = XmlUtils.GetNodeValue(nodeTab.CreateNavigator(), "name"); - var portal = GetPortal(portalId); + var portal = this.GetPortal(portalId); if (!String.IsNullOrEmpty(strName)) { if (!isNewPortal) //running from wizard: try to find the tab by path @@ -1678,7 +1678,7 @@ private void ParseTab(XmlNode nodeTab, int portalId, bool isAdminTemplate, Porta logType = "Custom500Tab"; break; } - UpdatePortalSetup(portalId, + this.UpdatePortalSetup(portalId, portal.AdministratorId, portal.AdministratorRoleId, portal.RegisteredRoleId, @@ -1743,7 +1743,7 @@ private void ParseTabs(XmlNode nodeTabs, int portalId, bool isAdminTemplate, Por foreach (XmlNode nodeTab in nodeTabs.SelectNodes("//tab")) { HtmlUtils.WriteKeepAlive(); - ParseTab(nodeTab, portalId, isAdminTemplate, mergeTabs, ref hModules, ref hTabs, isNewPortal); + this.ParseTab(nodeTab, portalId, isAdminTemplate, mergeTabs, ref hModules, ref hTabs, isNewPortal); } //Process tabs that are linked to tabs @@ -1787,7 +1787,7 @@ private void ParseTabs(XmlNode nodeTabs, int portalId, bool isAdminTemplate, Por private void ParseTemplateInternal(int portalId, string templatePath, string templateFile, int administratorId, PortalTemplateModuleAction mergeTabs, bool isNewPortal) { LocaleCollection localeCollection; - ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal, out localeCollection); + this.ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal, out localeCollection); } private void ParseTemplateInternal(int portalId, string templatePath, string templateFile, int administratorId, PortalTemplateModuleAction mergeTabs, bool isNewPortal, out LocaleCollection localeCollection) @@ -1808,7 +1808,7 @@ private void ParseTemplateInternal(int portalId, string templatePath, string tem if (node != null && isNewPortal) { HtmlUtils.WriteKeepAlive(); - ParsePortalSettings(node, portalId); + this.ParsePortalSettings(node, portalId); } node = xmlPortal.SelectSingleNode("//locales"); if (node != null && isNewPortal) @@ -1830,12 +1830,12 @@ private void ParseTemplateInternal(int portalId, string templatePath, string tem node = xmlPortal.SelectSingleNode("//portal/rolegroups"); if (node != null) { - ParseRoleGroups(node.CreateNavigator(), portalId, administratorId); + this.ParseRoleGroups(node.CreateNavigator(), portalId, administratorId); } node = xmlPortal.SelectSingleNode("//portal/roles"); if (node != null) { - ParseRoles(node.CreateNavigator(), portalId, administratorId); + this.ParseRoles(node.CreateNavigator(), portalId, administratorId); } node = xmlPortal.SelectSingleNode("//portal/portalDesktopModules"); if (node != null) @@ -1846,12 +1846,12 @@ private void ParseTemplateInternal(int portalId, string templatePath, string tem node = xmlPortal.SelectSingleNode("//portal/folders"); if (node != null) { - ParseFolders(node, portalId); + this.ParseFolders(node, portalId); } node = xmlPortal.SelectSingleNode("//portal/extensionUrlProviders"); if (node != null) { - ParseExtensionUrlProviders(node.CreateNavigator(), portalId); + this.ParseExtensionUrlProviders(node.CreateNavigator(), portalId); } var defaultFolderMapping = FolderMappingController.Instance.GetDefaultFolderMapping(portalId); @@ -1862,7 +1862,7 @@ private void ParseTemplateInternal(int portalId, string templatePath, string tem objFolder.IsProtected = true; FolderManager.Instance.UpdateFolder(objFolder); - AddFolderPermissions(portalId, objFolder.FolderID); + this.AddFolderPermissions(portalId, objFolder.FolderID); } if (FolderManager.Instance.GetFolder(portalId, "Templates/") == null) @@ -1932,7 +1932,7 @@ private void ParseTemplateInternal(int portalId, string templatePath, string tem Logger.Error(ex); } } - ParseTabs(node, portalId, false, mergeTabs, isNewPortal); + this.ParseTabs(node, portalId, false, mergeTabs, isNewPortal); } CachingProvider.EnableCacheExpiration(); @@ -2193,7 +2193,7 @@ public int CreatePortal(string portalName, int adminUserId, string description, if (administratorId > 0) { - CreatePortalInternal(portalId, portalName, adminUser, description, keyWords, template, homeDirectory, portalAlias, serverPath, childPath, isChildPortal, ref message); + this.CreatePortalInternal(portalId, portalName, adminUser, description, keyWords, template, homeDirectory, portalAlias, serverPath, childPath, isChildPortal, ref message); } } else @@ -2275,7 +2275,7 @@ public int CreatePortal(string portalName, UserInfo adminUser, string descriptio if (administratorId > 0) { - CreatePortalInternal(portalId, portalName, adminUser, description, keyWords, template, homeDirectory, portalAlias, serverPath, childPath, isChildPortal, ref message); + this.CreatePortalInternal(portalId, portalName, adminUser, description, keyWords, template, homeDirectory, portalAlias, serverPath, childPath, isChildPortal, ref message); } } else @@ -2315,7 +2315,7 @@ public IList GetAvailablePortalTemplates() foreach (string templateFilePath in templateFilePaths) { var currentFileName = Path.GetFileName(templateFilePath); - var langs = languageFileNames.Where(x => GetTemplateName(x).Equals(currentFileName, StringComparison.InvariantCultureIgnoreCase)).Select(x => GetCultureCode(x)).Distinct().ToList(); + var langs = languageFileNames.Where(x => this.GetTemplateName(x).Equals(currentFileName, StringComparison.InvariantCultureIgnoreCase)).Select(x => this.GetCultureCode(x)).Distinct().ToList(); if (langs.Any()) { @@ -2360,12 +2360,12 @@ public PortalInfo GetPortal(int portalId) } string defaultLanguage = GetActivePortalLanguage(portalId); - PortalInfo portal = GetPortal(portalId, defaultLanguage); + PortalInfo portal = this.GetPortal(portalId, defaultLanguage); if (portal == null) { //Active language may not be valid, so fallback to default language defaultLanguage = GetPortalDefaultLanguage(portalId); - portal = GetPortal(portalId, defaultLanguage); + portal = this.GetPortal(portalId, defaultLanguage); } return portal; } @@ -2422,7 +2422,7 @@ public PortalInfo GetPortal(int portalId, string cultureCode) /// Portal info. public PortalInfo GetPortal(Guid uniqueId) { - return GetPortalList(Null.NullString).SingleOrDefault(p => p.GUID == uniqueId); + return this.GetPortalList(Null.NullString).SingleOrDefault(p => p.GUID == uniqueId); } /// @@ -2431,7 +2431,7 @@ public PortalInfo GetPortal(Guid uniqueId) /// ArrayList of PortalInfo objects public ArrayList GetPortals() { - return new ArrayList(GetPortalList(Null.NullString)); + return new ArrayList(this.GetPortalList(Null.NullString)); } /// @@ -2538,11 +2538,11 @@ public bool HasSpaceAvailable(int portalId, long fileSizeBytes) } else { - PortalInfo portal = GetPortal(portalId); + PortalInfo portal = this.GetPortal(portalId); hostSpace = portal.HostSpace; } } - return (((GetPortalSpaceUsedBytes(portalId) + fileSizeBytes) / Math.Pow(1024, 2)) <= hostSpace) || hostSpace == 0; + return (((this.GetPortalSpaceUsedBytes(portalId) + fileSizeBytes) / Math.Pow(1024, 2)) <= hostSpace) || hostSpace == 0; } /// @@ -2556,8 +2556,8 @@ public void MapLocalizedSpecialPages(int portalId, string cultureCode) DataCache.ClearHostCache(true); DataProvider.Instance().EnsureLocalizationExists(portalId, cultureCode); - PortalInfo defaultPortal = GetPortal(portalId, GetPortalDefaultLanguage(portalId)); - PortalInfo targetPortal = GetPortal(portalId, cultureCode); + PortalInfo defaultPortal = this.GetPortal(portalId, GetPortalDefaultLanguage(portalId)); + PortalInfo targetPortal = this.GetPortal(portalId, cultureCode); Locale targetLocale = LocaleController.Instance.GetLocale(cultureCode); TabInfo tempTab; @@ -2642,7 +2642,7 @@ public void MapLocalizedSpecialPages(int portalId, string cultureCode) } } - UpdatePortalInternal(targetPortal, false); + this.UpdatePortalInternal(targetPortal, false); } /// @@ -2674,9 +2674,9 @@ public void RemovePortalLocalization(int portalId, string cultureCode, bool clea public void ParseTemplate(int portalId, PortalTemplateInfo template, int administratorId, PortalTemplateModuleAction mergeTabs, bool isNewPortal) { string templatePath, templateFile; - PrepareLocalizedPortalTemplate(template, out templatePath, out templateFile); + this.PrepareLocalizedPortalTemplate(template, out templatePath, out templateFile); - ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal); + this.ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal); } /// @@ -2708,7 +2708,7 @@ public void ProcessResourceFileExplicit(string portalPath, string resoureceFile) /// The culture code. public void UpdatePortalExpiry(int portalId, string cultureCode) { - var portal = GetPortal(portalId, cultureCode); + var portal = this.GetPortal(portalId, cultureCode); if (portal.ExpiryDate == Null.NullDate) { @@ -2716,7 +2716,7 @@ public void UpdatePortalExpiry(int portalId, string cultureCode) } portal.ExpiryDate = portal.ExpiryDate.AddMonths(1); - UpdatePortalInfo(portal); + this.UpdatePortalInfo(portal); } /// @@ -2725,7 +2725,7 @@ public void UpdatePortalExpiry(int portalId, string cultureCode) /// public void UpdatePortalInfo(PortalInfo portal) { - UpdatePortalInternal(portal, true); + this.UpdatePortalInternal(portal, true); } [Obsolete("Deprecated in DNN 9.2.0. Use the overloaded one with the 'isSecure' parameter instead. Scheduled removal in v11.0.0.")] @@ -3532,27 +3532,27 @@ public class PortalTemplateInfo public PortalTemplateInfo(string templateFilePath, string cultureCode) { - TemplateFilePath = templateFilePath; + this.TemplateFilePath = templateFilePath; - InitLocalizationFields(cultureCode); - InitNameAndDescription(); + this.InitLocalizationFields(cultureCode); + this.InitNameAndDescription(); } private void InitNameAndDescription() { - if (!String.IsNullOrEmpty(LanguageFilePath)) + if (!String.IsNullOrEmpty(this.LanguageFilePath)) { - LoadNameAndDescriptionFromLanguageFile(); + this.LoadNameAndDescriptionFromLanguageFile(); } - if (String.IsNullOrEmpty(Name)) + if (String.IsNullOrEmpty(this.Name)) { - Name = Path.GetFileNameWithoutExtension(TemplateFilePath); + this.Name = Path.GetFileNameWithoutExtension(this.TemplateFilePath); } - if (String.IsNullOrEmpty(Description)) + if (String.IsNullOrEmpty(this.Description)) { - LoadDescriptionFromTemplateFile(); + this.LoadDescriptionFromTemplateFile(); } } @@ -3561,16 +3561,16 @@ private void LoadDescriptionFromTemplateFile() try { XDocument xmlDoc; - using (var reader = PortalTemplateIO.Instance.OpenTextReader(TemplateFilePath)) + using (var reader = PortalTemplateIO.Instance.OpenTextReader(this.TemplateFilePath)) { xmlDoc = XDocument.Load(reader); } - Description = xmlDoc.Elements("portal").Elements("description").SingleOrDefault().Value; + this.Description = xmlDoc.Elements("portal").Elements("description").SingleOrDefault().Value; } catch (Exception e) { - Logger.Error("Error while parsing: " + TemplateFilePath, e); + Logger.Error("Error while parsing: " + this.TemplateFilePath, e); } } @@ -3578,17 +3578,17 @@ private void LoadNameAndDescriptionFromLanguageFile() { try { - using (var reader = PortalTemplateIO.Instance.OpenTextReader(LanguageFilePath)) + using (var reader = PortalTemplateIO.Instance.OpenTextReader(this.LanguageFilePath)) { var xmlDoc = XDocument.Load(reader); - Name = ReadLanguageFileValue(xmlDoc, "LocalizedTemplateName.Text"); - Description = ReadLanguageFileValue(xmlDoc, "PortalDescription.Text"); + this.Name = ReadLanguageFileValue(xmlDoc, "LocalizedTemplateName.Text"); + this.Description = ReadLanguageFileValue(xmlDoc, "PortalDescription.Text"); } } catch (Exception e) { - Logger.Error("Error while parsing: " + TemplateFilePath, e); + Logger.Error("Error while parsing: " + this.TemplateFilePath, e); } } @@ -3601,16 +3601,16 @@ static string ReadLanguageFileValue(XDocument xmlDoc, string name) private void InitLocalizationFields(string cultureCode) { - LanguageFilePath = PortalTemplateIO.Instance.GetLanguageFilePath(TemplateFilePath, cultureCode); - if (!String.IsNullOrEmpty(LanguageFilePath)) + this.LanguageFilePath = PortalTemplateIO.Instance.GetLanguageFilePath(this.TemplateFilePath, cultureCode); + if (!String.IsNullOrEmpty(this.LanguageFilePath)) { - CultureCode = cultureCode; + this.CultureCode = cultureCode; } else { var portalSettings = PortalSettings.Current; //DNN-6544 portal creation requires valid culture, if template has no culture defined, then use default language. - CultureCode = portalSettings != null ? GetPortalDefaultLanguage(portalSettings.PortalId) : Localization.SystemLocale; + this.CultureCode = portalSettings != null ? GetPortalDefaultLanguage(portalSettings.PortalId) : Localization.SystemLocale; } } @@ -3624,12 +3624,12 @@ public string ResourceFilePath { get { - if (_resourceFilePath == null) + if (this._resourceFilePath == null) { - _resourceFilePath = PortalTemplateIO.Instance.GetResourceFilePath(TemplateFilePath); + this._resourceFilePath = PortalTemplateIO.Instance.GetResourceFilePath(this.TemplateFilePath); } - return _resourceFilePath; + return this._resourceFilePath; } } } diff --git a/DNN Platform/Library/Entities/Portals/PortalGroupController.cs b/DNN Platform/Library/Entities/Portals/PortalGroupController.cs index b1b60826816..91ca3737ad3 100644 --- a/DNN Platform/Library/Entities/Portals/PortalGroupController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalGroupController.cs @@ -45,8 +45,8 @@ public PortalGroupController(IDataService dataService, IPortalController portalC Requires.NotNull("dataService", dataService); Requires.NotNull("portalController", portalController); - _dataService = dataService; - _portalController = portalController; + this._dataService = dataService; + this._portalController = portalController; } #endregion @@ -55,7 +55,7 @@ public PortalGroupController(IDataService dataService, IPortalController portalC private object GetPortalGroupsCallback(CacheItemArgs cacheItemArgs) { - return CBO.FillCollection(_dataService.GetPortalGroups()); + return CBO.FillCollection(this._dataService.GetPortalGroups()); } private static void ClearCache() @@ -159,7 +159,7 @@ public void AddPortalToGroup(PortalInfo portal, PortalGroupInfo portalGroup, Use Requires.PropertyNotNegative("portalGroup", "PortalGroupId", portalGroup.PortalGroupId); Requires.PropertyNotNegative("portalGroup", "MasterPortalId", portalGroup.MasterPortalId); - OnAddPortalToGroupStart(callback, portal); + this.OnAddPortalToGroupStart(callback, portal); var users = UserController.GetUsers(portal.PortalID); var masterUsers = UserController.GetUsers(portalGroup.MasterPortalId); @@ -168,7 +168,7 @@ public void AddPortalToGroup(PortalInfo portal, PortalGroupInfo portalGroup, Use if (users.Count > 0) { - var masterPortal = _portalController.GetPortal(portalGroup.MasterPortalId); + var masterPortal = this._portalController.GetPortal(portalGroup.MasterPortalId); foreach (UserInfo user in users) { @@ -176,7 +176,7 @@ public void AddPortalToGroup(PortalInfo portal, PortalGroupInfo portalGroup, Use UserController.MoveUserToPortal(user, masterPortal, true); - OnUserAddedToSiteGroup(callback, portal, user, totalUsers, userNo); + this.OnUserAddedToSiteGroup(callback, portal, user, totalUsers, userNo); } } @@ -193,20 +193,20 @@ public void AddPortalToGroup(PortalInfo portal, PortalGroupInfo portalGroup, Use { RoleController.Instance.AddUserRole(portalGroup.MasterPortalId, user.UserID, autoAssignRole.RoleID, RoleStatus.Approved, false, Null.NullDate, Null.NullDate); } - OnUserAddedToSiteGroup(callback, portal, user, totalUsers, userNo); + this.OnUserAddedToSiteGroup(callback, portal, user, totalUsers, userNo); } } - OnAddPortalToGroupFinishing(callback, portal, users.Count); + this.OnAddPortalToGroupFinishing(callback, portal, users.Count); - RemoveProfileDefinitions(portal); + this.RemoveProfileDefinitions(portal); //Add portal to group portal.PortalGroupID = portalGroup.PortalGroupId; PortalController.Instance.UpdatePortalInfo(portal); - LogEvent(EventLogController.EventLogType.PORTAL_ADDEDTOPORTALGROUP, portalGroup, portal); + this.LogEvent(EventLogController.EventLogType.PORTAL_ADDEDTOPORTALGROUP, portalGroup, portal); - OnAddPortalToGroupFinished(callback, portal, portalGroup, users.Count); + this.OnAddPortalToGroupFinished(callback, portal, portalGroup, users.Count); } private void RemoveProfileDefinitions(PortalInfo portal) @@ -230,13 +230,13 @@ private void CopyPropertyDefinitions(int portalId, int masterPortalId) private void DeleteSharedModules(PortalInfo portal) { - var sharedModules = GetSharedModulesWithPortal(portal); + var sharedModules = this.GetSharedModulesWithPortal(portal); foreach (var sharedModule in sharedModules) { ModuleController.Instance.DeleteTabModule(sharedModule.TabID, sharedModule.ModuleID, false); } - sharedModules = GetSharedModulesByPortal(portal); + sharedModules = this.GetSharedModulesByPortal(portal); foreach (var sharedModule in sharedModules) { ModuleController.Instance.DeleteTabModule(sharedModule.TabID, sharedModule.ModuleID, false); @@ -249,7 +249,7 @@ private IEnumerable GetSharedModulesWithPortal(PortalInfo portal) DataCache.SharedModulesWithPortalCacheTimeOut, DataCache.SharedModulesWithPortalCachePriority, portal), - (p) => CBO.FillCollection(_dataService.GetSharedModulesWithPortal(portal))); + (p) => CBO.FillCollection(this._dataService.GetSharedModulesWithPortal(portal))); } private IEnumerable GetSharedModulesByPortal(PortalInfo portal) @@ -258,7 +258,7 @@ private IEnumerable GetSharedModulesByPortal(PortalInfo portal) DataCache.SharedModulesByPortalCacheTimeOut, DataCache.SharedModulesByPortalCachePriority, portal), - (p) => CBO.FillCollection(_dataService.GetSharedModulesByPortal(portal))); + (p) => CBO.FillCollection(this._dataService.GetSharedModulesByPortal(portal))); } public int AddPortalGroup(PortalGroupInfo portalGroup) @@ -266,16 +266,16 @@ public int AddPortalGroup(PortalGroupInfo portalGroup) //Argument Contract Requires.NotNull("portalGroup", portalGroup); - portalGroup.PortalGroupId = _dataService.AddPortalGroup(portalGroup, UserController.Instance.GetCurrentUserInfo().UserID); + portalGroup.PortalGroupId = this._dataService.AddPortalGroup(portalGroup, UserController.Instance.GetCurrentUserInfo().UserID); //Update portal - var portal = _portalController.GetPortal(portalGroup.MasterPortalId); + var portal = this._portalController.GetPortal(portalGroup.MasterPortalId); if (portal != null) { portal.PortalGroupID = portalGroup.PortalGroupId; - _portalController.UpdatePortalInfo(portal); + this._portalController.UpdatePortalInfo(portal); } - LogEvent(EventLogController.EventLogType.PORTALGROUP_CREATED, portalGroup, null); + this.LogEvent(EventLogController.EventLogType.PORTALGROUP_CREATED, portalGroup, null); ClearCache(); @@ -289,16 +289,16 @@ public void DeletePortalGroup(PortalGroupInfo portalGroup) Requires.PropertyNotNegative("portalGroup", "PortalGroupId", portalGroup.PortalGroupId); //Update portal - var portal = _portalController.GetPortal(portalGroup.MasterPortalId); + var portal = this._portalController.GetPortal(portalGroup.MasterPortalId); if (portal != null) { - DeleteSharedModules(portal); + this.DeleteSharedModules(portal); portal.PortalGroupID = -1; PortalController.Instance.UpdatePortalInfo(portal); } - _dataService.DeletePortalGroup(portalGroup); - LogEvent(EventLogController.EventLogType.PORTALGROUP_DELETED, portalGroup, null); + this._dataService.DeletePortalGroup(portalGroup); + this.LogEvent(EventLogController.EventLogType.PORTALGROUP_DELETED, portalGroup, null); ClearCache(); } @@ -308,7 +308,7 @@ public IEnumerable GetPortalGroups() return CBO.GetCachedObject>(new CacheItemArgs(DataCache.PortalGroupsCacheKey, DataCache.PortalGroupsCacheTimeOut, DataCache.PortalGroupsCachePriority), - GetPortalGroupsCallback); + this.GetPortalGroupsCallback); } public IEnumerable GetPortalsByGroup(int portalGroupId) @@ -341,12 +341,12 @@ public void RemovePortalFromGroup(PortalInfo portal, PortalGroupInfo portalGroup callback(args); //Remove portal from group - DeleteSharedModules(portal); + this.DeleteSharedModules(portal); portal.PortalGroupID = -1; PortalController.Instance.UpdatePortalInfo(portal); - LogEvent(EventLogController.EventLogType.PORTAL_REMOVEDFROMPORTALGROUP, portalGroup, portal); + this.LogEvent(EventLogController.EventLogType.PORTAL_REMOVEDFROMPORTALGROUP, portalGroup, portal); - CopyPropertyDefinitions(portal.PortalID, portalGroup.MasterPortalId); + this.CopyPropertyDefinitions(portal.PortalID, portalGroup.MasterPortalId); var userNo = 0; if (copyUsers) @@ -411,7 +411,7 @@ public void UpdatePortalGroup(PortalGroupInfo portalGroup) Requires.NotNull("portalGroup", portalGroup); Requires.PropertyNotNegative("portalGroup", "PortalGroupId", portalGroup.PortalGroupId); - _dataService.UpdatePortalGroup(portalGroup, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataService.UpdatePortalGroup(portalGroup, UserController.Instance.GetCurrentUserInfo().UserID); ClearCache(); } @@ -419,7 +419,7 @@ public void UpdatePortalGroup(PortalGroupInfo portalGroup) public bool IsModuleShared(int moduleId, PortalInfo portal) { if (portal == null) return false; - return GetSharedModulesWithPortal(portal).Any(x => x.ModuleID == moduleId && !x.IsDeleted) || GetSharedModulesByPortal(portal).Any(x => x.ModuleID == moduleId && !x.IsDeleted); + return this.GetSharedModulesWithPortal(portal).Any(x => x.ModuleID == moduleId && !x.IsDeleted) || this.GetSharedModulesByPortal(portal).Any(x => x.ModuleID == moduleId && !x.IsDeleted); } #endregion diff --git a/DNN Platform/Library/Entities/Portals/PortalGroupInfo.cs b/DNN Platform/Library/Entities/Portals/PortalGroupInfo.cs index aa4e7e5f66b..f7e1750c6f6 100644 --- a/DNN Platform/Library/Entities/Portals/PortalGroupInfo.cs +++ b/DNN Platform/Library/Entities/Portals/PortalGroupInfo.cs @@ -30,9 +30,9 @@ public string MasterPortalName get { string portalName = String.Empty; - if (MasterPortalId > -1) + if (this.MasterPortalId > -1) { - var portal = PortalController.Instance.GetPortal(MasterPortalId); + var portal = PortalController.Instance.GetPortal(this.MasterPortalId); if (portal != null) { portalName = portal.PortalName; @@ -54,23 +54,23 @@ public int KeyID { get { - return PortalGroupId; + return this.PortalGroupId; } set { - PortalGroupId = value; + this.PortalGroupId = value; } } public void Fill(IDataReader dr) { - FillInternal(dr); + this.FillInternal(dr); - PortalGroupId = Null.SetNullInteger(dr["PortalGroupID"]); - PortalGroupName = Null.SetNullString(dr["PortalGroupName"]); - PortalGroupDescription = Null.SetNullString(dr["PortalGroupDescription"]); - MasterPortalId = Null.SetNullInteger(dr["MasterPortalID"]); - AuthenticationDomain = Null.SetNullString(dr["AuthenticationDomain"]); + this.PortalGroupId = Null.SetNullInteger(dr["PortalGroupID"]); + this.PortalGroupName = Null.SetNullString(dr["PortalGroupName"]); + this.PortalGroupDescription = Null.SetNullString(dr["PortalGroupDescription"]); + this.MasterPortalId = Null.SetNullInteger(dr["MasterPortalID"]); + this.AuthenticationDomain = Null.SetNullString(dr["AuthenticationDomain"]); } #endregion diff --git a/DNN Platform/Library/Entities/Portals/PortalInfo.cs b/DNN Platform/Library/Entities/Portals/PortalInfo.cs index 3dd7a1c466e..55ed59c23f1 100644 --- a/DNN Platform/Library/Entities/Portals/PortalInfo.cs +++ b/DNN Platform/Library/Entities/Portals/PortalInfo.cs @@ -81,7 +81,7 @@ public class PortalInfo : BaseEntityInfo, IHydratable /// public PortalInfo() { - Users = Null.NullInteger; + this.Users = Null.NullInteger; } #endregion @@ -279,7 +279,7 @@ public PortalInfo() /// [XmlElement("homesystemdirectory")] public string HomeSystemDirectory { - get { return String.Format("{0}-System", HomeDirectory); } + get { return String.Format("{0}-System", this.HomeDirectory); } } /// @@ -622,13 +622,13 @@ public int Users { get { - if (_users < 0) + if (this._users < 0) { - _users = UserController.GetUserCountByPortal(PortalID); + this._users = UserController.GetUserCountByPortal(this.PortalID); } - return _users; + return this._users; } - set { _users = value; } + set { this._users = value; } } /// @@ -656,20 +656,20 @@ public string AdministratorRoleName { get { - if (_administratorRoleName == Null.NullString && AdministratorRoleId > Null.NullInteger) + if (this._administratorRoleName == Null.NullString && this.AdministratorRoleId > Null.NullInteger) { //Get Role Name - RoleInfo adminRole = RoleController.Instance.GetRole(PortalID, r => r.RoleID == AdministratorRoleId); + RoleInfo adminRole = RoleController.Instance.GetRole(this.PortalID, r => r.RoleID == this.AdministratorRoleId); if (adminRole != null) { - _administratorRoleName = adminRole.RoleName; + this._administratorRoleName = adminRole.RoleName; } } - return _administratorRoleName; + return this._administratorRoleName; } set { - _administratorRoleName = value; + this._administratorRoleName = value; } } @@ -684,7 +684,7 @@ public string HomeDirectoryMapPath { get { - return String.Format("{0}\\{1}\\", Globals.ApplicationMapPath, HomeDirectory.Replace("/", "\\")); + return String.Format("{0}\\{1}\\", Globals.ApplicationMapPath, this.HomeDirectory.Replace("/", "\\")); } } @@ -699,7 +699,7 @@ public string HomeSystemDirectoryMapPath { get { - return String.Format("{0}\\{1}\\", Globals.ApplicationMapPath, HomeSystemDirectory.Replace("/", "\\")); + return String.Format("{0}\\{1}\\", Globals.ApplicationMapPath, this.HomeSystemDirectory.Replace("/", "\\")); } } @@ -714,15 +714,15 @@ public int Pages { get { - if (_pages < 0) + if (this._pages < 0) { - _pages = TabController.Instance.GetUserTabsByPortal(PortalID).Count; + this._pages = TabController.Instance.GetUserTabsByPortal(this.PortalID).Count; } - return _pages; + return this._pages; } set { - _pages = value; + this._pages = value; } } @@ -738,20 +738,20 @@ public string RegisteredRoleName { get { - if (_registeredRoleName == Null.NullString && RegisteredRoleId > Null.NullInteger) + if (this._registeredRoleName == Null.NullString && this.RegisteredRoleId > Null.NullInteger) { //Get Role Name - RoleInfo regUsersRole = RoleController.Instance.GetRole(PortalID, r => r.RoleID == RegisteredRoleId); + RoleInfo regUsersRole = RoleController.Instance.GetRole(this.PortalID, r => r.RoleID == this.RegisteredRoleId); if (regUsersRole != null) { - _registeredRoleName = regUsersRole.RoleName; + this._registeredRoleName = regUsersRole.RoleName; } } - return _registeredRoleName; + return this._registeredRoleName; } set { - _registeredRoleName = value; + this._registeredRoleName = value; } } @@ -771,11 +771,11 @@ public string RegisteredRoleName /// public void Fill(IDataReader dr) { - PortalID = Null.SetNullInteger(dr["PortalID"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); try { - PortalGroupID = Null.SetNullInteger(dr["PortalGroupID"]); + this.PortalGroupID = Null.SetNullInteger(dr["PortalGroupID"]); } catch (IndexOutOfRangeException) { @@ -788,77 +788,77 @@ public void Fill(IDataReader dr) //else swallow the error } - PortalName = Null.SetNullString(dr["PortalName"]); - LogoFile = Null.SetNullString(dr["LogoFile"]); - FooterText = Null.SetNullString(dr["FooterText"]); - ExpiryDate = Null.SetNullDateTime(dr["ExpiryDate"]); - UserRegistration = Null.SetNullInteger(dr["UserRegistration"]); - BannerAdvertising = Null.SetNullInteger(dr["BannerAdvertising"]); - AdministratorId = Null.SetNullInteger(dr["AdministratorID"]); - Email = Null.SetNullString(dr["Email"]); - Currency = Null.SetNullString(dr["Currency"]); - HostFee = Null.SetNullInteger(dr["HostFee"]); - HostSpace = Null.SetNullInteger(dr["HostSpace"]); - PageQuota = Null.SetNullInteger(dr["PageQuota"]); - UserQuota = Null.SetNullInteger(dr["UserQuota"]); - AdministratorRoleId = Null.SetNullInteger(dr["AdministratorRoleID"]); - RegisteredRoleId = Null.SetNullInteger(dr["RegisteredRoleID"]); - Description = Null.SetNullString(dr["Description"]); - KeyWords = Null.SetNullString(dr["KeyWords"]); - BackgroundFile = Null.SetNullString(dr["BackGroundFile"]); - GUID = new Guid(Null.SetNullString(dr["GUID"])); - PaymentProcessor = Null.SetNullString(dr["PaymentProcessor"]); - ProcessorUserId = Null.SetNullString(dr["ProcessorUserId"]); + this.PortalName = Null.SetNullString(dr["PortalName"]); + this.LogoFile = Null.SetNullString(dr["LogoFile"]); + this.FooterText = Null.SetNullString(dr["FooterText"]); + this.ExpiryDate = Null.SetNullDateTime(dr["ExpiryDate"]); + this.UserRegistration = Null.SetNullInteger(dr["UserRegistration"]); + this.BannerAdvertising = Null.SetNullInteger(dr["BannerAdvertising"]); + this.AdministratorId = Null.SetNullInteger(dr["AdministratorID"]); + this.Email = Null.SetNullString(dr["Email"]); + this.Currency = Null.SetNullString(dr["Currency"]); + this.HostFee = Null.SetNullInteger(dr["HostFee"]); + this.HostSpace = Null.SetNullInteger(dr["HostSpace"]); + this.PageQuota = Null.SetNullInteger(dr["PageQuota"]); + this.UserQuota = Null.SetNullInteger(dr["UserQuota"]); + this.AdministratorRoleId = Null.SetNullInteger(dr["AdministratorRoleID"]); + this.RegisteredRoleId = Null.SetNullInteger(dr["RegisteredRoleID"]); + this.Description = Null.SetNullString(dr["Description"]); + this.KeyWords = Null.SetNullString(dr["KeyWords"]); + this.BackgroundFile = Null.SetNullString(dr["BackGroundFile"]); + this.GUID = new Guid(Null.SetNullString(dr["GUID"])); + this.PaymentProcessor = Null.SetNullString(dr["PaymentProcessor"]); + this.ProcessorUserId = Null.SetNullString(dr["ProcessorUserId"]); var p = Null.SetNullString(dr["ProcessorPassword"]); try { - ProcessorPassword = string.IsNullOrEmpty(p) + this.ProcessorPassword = string.IsNullOrEmpty(p) ? p : Security.FIPSCompliant.DecryptAES(p, Config.GetDecryptionkey(), Host.Host.GUID); } catch (Exception ex) when (ex is FormatException || ex is CryptographicException) { // for backward compatibility - ProcessorPassword = p; + this.ProcessorPassword = p; } - SplashTabId = Null.SetNullInteger(dr["SplashTabID"]); - HomeTabId = Null.SetNullInteger(dr["HomeTabID"]); - LoginTabId = Null.SetNullInteger(dr["LoginTabID"]); - RegisterTabId = Null.SetNullInteger(dr["RegisterTabID"]); - UserTabId = Null.SetNullInteger(dr["UserTabID"]); - SearchTabId = Null.SetNullInteger(dr["SearchTabID"]); - - Custom404TabId = Custom500TabId = Null.NullInteger; + this.SplashTabId = Null.SetNullInteger(dr["SplashTabID"]); + this.HomeTabId = Null.SetNullInteger(dr["HomeTabID"]); + this.LoginTabId = Null.SetNullInteger(dr["LoginTabID"]); + this.RegisterTabId = Null.SetNullInteger(dr["RegisterTabID"]); + this.UserTabId = Null.SetNullInteger(dr["UserTabID"]); + this.SearchTabId = Null.SetNullInteger(dr["SearchTabID"]); + + this.Custom404TabId = this.Custom500TabId = Null.NullInteger; var schema = dr.GetSchemaTable(); if (schema != null) { if (schema.Select("ColumnName = 'Custom404TabId'").Length > 0) { - Custom404TabId = Null.SetNullInteger(dr["Custom404TabId"]); + this.Custom404TabId = Null.SetNullInteger(dr["Custom404TabId"]); } if (schema.Select("ColumnName = 'Custom500TabId'").Length > 0) { - Custom500TabId = Null.SetNullInteger(dr["Custom500TabId"]); + this.Custom500TabId = Null.SetNullInteger(dr["Custom500TabId"]); } } - TermsTabId = Null.SetNullInteger(dr["TermsTabId"]); - PrivacyTabId = Null.SetNullInteger(dr["PrivacyTabId"]); + this.TermsTabId = Null.SetNullInteger(dr["TermsTabId"]); + this.PrivacyTabId = Null.SetNullInteger(dr["PrivacyTabId"]); - DefaultLanguage = Null.SetNullString(dr["DefaultLanguage"]); + this.DefaultLanguage = Null.SetNullString(dr["DefaultLanguage"]); #pragma warning disable 612,618 //needed for upgrades and backwards compatibility - TimeZoneOffset = Null.SetNullInteger(dr["TimeZoneOffset"]); + this.TimeZoneOffset = Null.SetNullInteger(dr["TimeZoneOffset"]); #pragma warning restore 612,618 - AdminTabId = Null.SetNullInteger(dr["AdminTabID"]); - HomeDirectory = Null.SetNullString(dr["HomeDirectory"]); - SuperTabId = Null.SetNullInteger(dr["SuperTabId"]); - CultureCode = Null.SetNullString(dr["CultureCode"]); + this.AdminTabId = Null.SetNullInteger(dr["AdminTabID"]); + this.HomeDirectory = Null.SetNullString(dr["HomeDirectory"]); + this.SuperTabId = Null.SetNullInteger(dr["SuperTabId"]); + this.CultureCode = Null.SetNullString(dr["CultureCode"]); - FillInternal(dr); - AdministratorRoleName = Null.NullString; - RegisteredRoleName = Null.NullString; + this.FillInternal(dr); + this.AdministratorRoleName = Null.NullString; + this.RegisteredRoleName = Null.NullString; - Users = Null.NullInteger; - Pages = Null.NullInteger; + this.Users = Null.NullInteger; + this.Pages = Null.NullInteger; } /// @@ -870,11 +870,11 @@ public int KeyID { get { - return PortalID; + return this.PortalID; } set { - PortalID = value; + this.PortalID = value; } } diff --git a/DNN Platform/Library/Entities/Portals/PortalSettings.cs b/DNN Platform/Library/Entities/Portals/PortalSettings.cs index cbc9eef3a5a..0c16cbb54e2 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettings.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettings.cs @@ -77,7 +77,7 @@ public enum UserDeleteAction public PortalSettings() { - Registration = new RegistrationSettings(); + this.Registration = new RegistrationSettings(); } public PortalSettings(int portalId) @@ -87,9 +87,9 @@ public PortalSettings(int portalId) public PortalSettings(int tabId, int portalId) { - PortalId = portalId; + this.PortalId = portalId; var portal = PortalController.Instance.GetPortal(portalId); - BuildPortalSettings(tabId, portal); + this.BuildPortalSettings(tabId, portal); } /// ----------------------------------------------------------------------------- @@ -105,13 +105,13 @@ public PortalSettings(int tabId, int portalId) /// ----------------------------------------------------------------------------- public PortalSettings(int tabId, PortalAliasInfo portalAliasInfo) { - PortalId = portalAliasInfo.PortalID; - PortalAlias = portalAliasInfo; + this.PortalId = portalAliasInfo.PortalID; + this.PortalAlias = portalAliasInfo; var portal = string.IsNullOrEmpty(portalAliasInfo.CultureCode) ? PortalController.Instance.GetPortal(portalAliasInfo.PortalID) : PortalController.Instance.GetPortal(portalAliasInfo.PortalID, portalAliasInfo.CultureCode); - BuildPortalSettings(tabId, portal); + this.BuildPortalSettings(tabId, portal); } public PortalSettings(PortalInfo portal) @@ -121,8 +121,8 @@ public PortalSettings(PortalInfo portal) public PortalSettings(int tabId, PortalInfo portal) { - PortalId = portal != null ? portal.PortalID : Null.NullInteger; - BuildPortalSettings(tabId, portal); + this.PortalId = portal != null ? portal.PortalID : Null.NullInteger; + this.BuildPortalSettings(tabId, portal); } private void BuildPortalSettings(int tabId, PortalInfo portal) @@ -137,14 +137,14 @@ private void BuildPortalSettings(int tabId, PortalInfo portal) var items = HttpContext.Current != null ? HttpContext.Current.Items : null; if (items != null && items.Contains(key)) { - ActiveTab = items[key] as TabInfo; + this.ActiveTab = items[key] as TabInfo; } else { - ActiveTab = PortalSettingsController.Instance().GetActiveTab(tabId, this); - if (items != null && ActiveTab != null) + this.ActiveTab = PortalSettingsController.Instance().GetActiveTab(tabId, this); + if (items != null && this.ActiveTab != null) { - items[key] = ActiveTab; + items[key] = this.ActiveTab; } } } @@ -461,8 +461,8 @@ public bool ControlPanelVisible { get { - var setting = Convert.ToString(Personalization.GetProfile("Usability", "ControlPanelVisible" + PortalId)); - return String.IsNullOrEmpty(setting) ? DefaultControlPanelVisibility : Convert.ToBoolean(setting); + var setting = Convert.ToString(Personalization.GetProfile("Usability", "ControlPanelVisible" + this.PortalId)); + return String.IsNullOrEmpty(setting) ? this.DefaultControlPanelVisibility : Convert.ToBoolean(setting); } } @@ -478,7 +478,7 @@ public string DefaultPortalAlias { get { - foreach (var alias in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalId).Where(alias => alias.IsPrimary)) + foreach (var alias in PortalAliasController.Instance.GetPortalAliasesByPortalId(this.PortalId).Where(alias => alias.IsPrimary)) { return alias.HTTPAlias; } @@ -490,7 +490,7 @@ public PortalAliasMapping PortalAliasMappingMode { get { - return PortalSettingsController.Instance().GetPortalAliasMappingMode(PortalId); + return PortalSettingsController.Instance().GetPortalAliasMappingMode(this.PortalId); } } @@ -502,7 +502,7 @@ public int UserId { if (HttpContext.Current != null && HttpContext.Current.Request.IsAuthenticated) { - return UserInfo.UserID; + return this.UserInfo.UserID; } return Null.NullInteger; } @@ -525,8 +525,8 @@ public Mode UserMode Mode mode; if (HttpContext.Current != null && HttpContext.Current.Request.IsAuthenticated) { - mode = DefaultControlPanelMode; - string setting = Convert.ToString(Personalization.GetProfile("Usability", "UserMode" + PortalId)); + mode = this.DefaultControlPanelMode; + string setting = Convert.ToString(Personalization.GetProfile("Usability", "UserMode" + this.PortalId)); switch (setting.ToUpper()) { case "VIEW": @@ -553,7 +553,7 @@ public Mode UserMode /// public bool IsLocked { - get { return IsThisPortalLocked || Host.Host.IsLocked; } + get { return this.IsThisPortalLocked || Host.Host.IsLocked; } } /// @@ -561,7 +561,7 @@ public bool IsLocked /// public bool IsThisPortalLocked { - get { return PortalController.GetPortalSettingAsBoolean("IsLocked", PortalId, false); } + get { return PortalController.GetPortalSettingAsBoolean("IsLocked", this.PortalId, false); } } public TimeZoneInfo TimeZone { get; set; } = TimeZoneInfo.Local; @@ -573,7 +573,7 @@ public string PageHeadText // For New Install string pageHead = ""; string setting; - if (PortalController.Instance.GetPortalSettings(PortalId).TryGetValue("PageHeadText", out setting)) + if (PortalController.Instance.GetPortalSettings(this.PortalId).TryGetValue("PageHeadText", out setting)) { // Hack to store empty string portalsetting with non empty default value pageHead = (setting == "false") ? "" : setting; @@ -593,7 +593,7 @@ public bool InjectModuleHyperLink { get { - return PortalController.GetPortalSettingAsBoolean("InjectModuleHyperLink", PortalId, true); + return PortalController.GetPortalSettingAsBoolean("InjectModuleHyperLink", this.PortalId, true); } } /* @@ -607,7 +607,7 @@ public string AddCompatibleHttpHeader { string CompatibleHttpHeader = "IE=edge"; string setting; - if (PortalController.Instance.GetPortalSettings(PortalId).TryGetValue("AddCompatibleHttpHeader", out setting)) + if (PortalController.Instance.GetPortalSettings(this.PortalId).TryGetValue("AddCompatibleHttpHeader", out setting)) { // Hack to store empty string portalsetting with non empty default value CompatibleHttpHeader = (setting == "false") ? "" : setting; @@ -623,7 +623,7 @@ public bool AddCachebusterToResourceUris { get { - return PortalController.GetPortalSettingAsBoolean("AddCachebusterToResourceUris", PortalId, true); + return PortalController.GetPortalSettingAsBoolean("AddCachebusterToResourceUris", this.PortalId, true); } } @@ -634,7 +634,7 @@ public bool DisablePrivateMessage { get { - return PortalController.GetPortalSetting("DisablePrivateMessage", PortalId, "N") == "Y"; + return PortalController.GetPortalSetting("DisablePrivateMessage", this.PortalId, "N") == "Y"; } } @@ -699,18 +699,22 @@ public string GetProperty(string propertyName, string format, CultureInfo format var isPublic = true; switch (lowerPropertyName) { + case "scheme": + propertyNotFound = false; + result = SSLEnabled ? "https" : "http"; + break; case "url": propertyNotFound = false; - result = PropertyAccess.FormatString(PortalAlias.HTTPAlias, format); + result = PropertyAccess.FormatString(this.PortalAlias.HTTPAlias, format); break; - case "fullurl": //return portal alias with protocol + case "fullurl": //return portal alias with protocol - note this depends on HttpContext propertyNotFound = false; - result = PropertyAccess.FormatString(Globals.AddHTTP(PortalAlias.HTTPAlias), format); + result = PropertyAccess.FormatString(Globals.AddHTTP(this.PortalAlias.HTTPAlias), format); break; - case "passwordreminderurl": //if regsiter page defined in portal settings, then get that page url, otherwise return home page. + case "passwordreminderurl": //if regsiter page defined in portal settings, then get that page url, otherwise return home page. - note this depends on HttpContext propertyNotFound = false; - var reminderUrl = Globals.AddHTTP(PortalAlias.HTTPAlias); - if (RegisterTabId > Null.NullInteger) + var reminderUrl = Globals.AddHTTP(this.PortalAlias.HTTPAlias); + if (this.RegisterTabId > Null.NullInteger) { reminderUrl = Globals.RegisterURL(string.Empty, string.Empty); } @@ -718,158 +722,158 @@ public string GetProperty(string propertyName, string format, CultureInfo format break; case "portalid": propertyNotFound = false; - result = (PortalId.ToString(outputFormat, formatProvider)); + result = (this.PortalId.ToString(outputFormat, formatProvider)); break; case "portalname": propertyNotFound = false; - result = PropertyAccess.FormatString(PortalName, format); + result = PropertyAccess.FormatString(this.PortalName, format); break; case "homedirectory": propertyNotFound = false; - result = PropertyAccess.FormatString(HomeDirectory, format); + result = PropertyAccess.FormatString(this.HomeDirectory, format); break; case "homedirectorymappath": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(HomeDirectoryMapPath, format); + result = PropertyAccess.FormatString(this.HomeDirectoryMapPath, format); break; case "logofile": propertyNotFound = false; - result = PropertyAccess.FormatString(LogoFile, format); + result = PropertyAccess.FormatString(this.LogoFile, format); break; case "footertext": propertyNotFound = false; - var footerText = FooterText.Replace("[year]", DateTime.Now.Year.ToString()); + var footerText = this.FooterText.Replace("[year]", DateTime.Now.Year.ToString()); result = PropertyAccess.FormatString(footerText, format); break; case "expirydate": isPublic = false; propertyNotFound = false; - result = (ExpiryDate.ToString(outputFormat, formatProvider)); + result = (this.ExpiryDate.ToString(outputFormat, formatProvider)); break; case "userregistration": isPublic = false; propertyNotFound = false; - result = (UserRegistration.ToString(outputFormat, formatProvider)); + result = (this.UserRegistration.ToString(outputFormat, formatProvider)); break; case "banneradvertising": isPublic = false; propertyNotFound = false; - result = (BannerAdvertising.ToString(outputFormat, formatProvider)); + result = (this.BannerAdvertising.ToString(outputFormat, formatProvider)); break; case "currency": propertyNotFound = false; - result = PropertyAccess.FormatString(Currency, format); + result = PropertyAccess.FormatString(this.Currency, format); break; case "administratorid": isPublic = false; propertyNotFound = false; - result = (AdministratorId.ToString(outputFormat, formatProvider)); + result = (this.AdministratorId.ToString(outputFormat, formatProvider)); break; case "email": propertyNotFound = false; - result = PropertyAccess.FormatString(Email, format); + result = PropertyAccess.FormatString(this.Email, format); break; case "hostfee": isPublic = false; propertyNotFound = false; - result = (HostFee.ToString(outputFormat, formatProvider)); + result = (this.HostFee.ToString(outputFormat, formatProvider)); break; case "hostspace": isPublic = false; propertyNotFound = false; - result = (HostSpace.ToString(outputFormat, formatProvider)); + result = (this.HostSpace.ToString(outputFormat, formatProvider)); break; case "pagequota": isPublic = false; propertyNotFound = false; - result = (PageQuota.ToString(outputFormat, formatProvider)); + result = (this.PageQuota.ToString(outputFormat, formatProvider)); break; case "userquota": isPublic = false; propertyNotFound = false; - result = (UserQuota.ToString(outputFormat, formatProvider)); + result = (this.UserQuota.ToString(outputFormat, formatProvider)); break; case "administratorroleid": isPublic = false; propertyNotFound = false; - result = (AdministratorRoleId.ToString(outputFormat, formatProvider)); + result = (this.AdministratorRoleId.ToString(outputFormat, formatProvider)); break; case "administratorrolename": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(AdministratorRoleName, format); + result = PropertyAccess.FormatString(this.AdministratorRoleName, format); break; case "registeredroleid": isPublic = false; propertyNotFound = false; - result = (RegisteredRoleId.ToString(outputFormat, formatProvider)); + result = (this.RegisteredRoleId.ToString(outputFormat, formatProvider)); break; case "registeredrolename": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(RegisteredRoleName, format); + result = PropertyAccess.FormatString(this.RegisteredRoleName, format); break; case "description": propertyNotFound = false; - result = PropertyAccess.FormatString(Description, format); + result = PropertyAccess.FormatString(this.Description, format); break; case "keywords": propertyNotFound = false; - result = PropertyAccess.FormatString(KeyWords, format); + result = PropertyAccess.FormatString(this.KeyWords, format); break; case "backgroundfile": propertyNotFound = false; - result = PropertyAccess.FormatString(BackgroundFile, format); + result = PropertyAccess.FormatString(this.BackgroundFile, format); break; case "admintabid": isPublic = false; propertyNotFound = false; - result = AdminTabId.ToString(outputFormat, formatProvider); + result = this.AdminTabId.ToString(outputFormat, formatProvider); break; case "supertabid": isPublic = false; propertyNotFound = false; - result = SuperTabId.ToString(outputFormat, formatProvider); + result = this.SuperTabId.ToString(outputFormat, formatProvider); break; case "splashtabid": isPublic = false; propertyNotFound = false; - result = SplashTabId.ToString(outputFormat, formatProvider); + result = this.SplashTabId.ToString(outputFormat, formatProvider); break; case "hometabid": isPublic = false; propertyNotFound = false; - result = HomeTabId.ToString(outputFormat, formatProvider); + result = this.HomeTabId.ToString(outputFormat, formatProvider); break; case "logintabid": isPublic = false; propertyNotFound = false; - result = LoginTabId.ToString(outputFormat, formatProvider); + result = this.LoginTabId.ToString(outputFormat, formatProvider); break; case "registertabid": isPublic = false; propertyNotFound = false; - result = RegisterTabId.ToString(outputFormat, formatProvider); + result = this.RegisterTabId.ToString(outputFormat, formatProvider); break; case "usertabid": isPublic = false; propertyNotFound = false; - result = UserTabId.ToString(outputFormat, formatProvider); + result = this.UserTabId.ToString(outputFormat, formatProvider); break; case "defaultlanguage": propertyNotFound = false; - result = PropertyAccess.FormatString(DefaultLanguage, format); + result = PropertyAccess.FormatString(this.DefaultLanguage, format); break; case "users": isPublic = false; propertyNotFound = false; - result = Users.ToString(outputFormat, formatProvider); + result = this.Users.ToString(outputFormat, formatProvider); break; case "pages": isPublic = false; propertyNotFound = false; - result = Pages.ToString(outputFormat, formatProvider); + result = this.Pages.ToString(outputFormat, formatProvider); break; case "contentvisible": isPublic = false; @@ -877,7 +881,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format case "controlpanelvisible": isPublic = false; propertyNotFound = false; - result = PropertyAccess.Boolean2LocalizedYesNo(ControlPanelVisible, formatProvider); + result = PropertyAccess.Boolean2LocalizedYesNo(this.ControlPanelVisible, formatProvider); break; } if (!isPublic && accessLevel != Scope.Debug) @@ -894,7 +898,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format public PortalSettings Clone() { - return (PortalSettings)MemberwiseClone(); + return (PortalSettings)this.MemberwiseClone(); } #endregion diff --git a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs index 64850607f0e..6d94dde3fee 100644 --- a/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs +++ b/DNN Platform/Library/Entities/Portals/PortalSettingsController.cs @@ -39,9 +39,9 @@ public virtual void ConfigureActiveTab(PortalSettings portalSettings) if (activeTab == null || activeTab.TabID == Null.NullInteger) return; - UpdateSkinSettings(activeTab, portalSettings); + this.UpdateSkinSettings(activeTab, portalSettings); - activeTab.BreadCrumbs = new ArrayList(GetBreadcrumbs(activeTab.TabID, portalSettings.PortalId)); + activeTab.BreadCrumbs = new ArrayList(this.GetBreadcrumbs(activeTab.TabID, portalSettings.PortalId)); } public virtual TabInfo GetActiveTab(int tabId, PortalSettings portalSettings) diff --git a/DNN Platform/Library/Entities/Portals/PortalTemplateValidator.cs b/DNN Platform/Library/Entities/Portals/PortalTemplateValidator.cs index 366fbf19c56..5db0719e017 100644 --- a/DNN Platform/Library/Entities/Portals/PortalTemplateValidator.cs +++ b/DNN Platform/Library/Entities/Portals/PortalTemplateValidator.cs @@ -20,8 +20,8 @@ public class PortalTemplateValidator : XmlValidatorBase { public bool Validate(string xmlFilename, string schemaFileName) { - SchemaSet.Add("", schemaFileName); - return Validate(xmlFilename); + this.SchemaSet.Add("", schemaFileName); + return this.Validate(xmlFilename); } } } diff --git a/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinition.cs b/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinition.cs index 8d4c4d3c272..9403175dfae 100644 --- a/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinition.cs +++ b/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinition.cs @@ -57,16 +57,16 @@ public class ProfilePropertyDefinition : BaseEntityInfo public ProfilePropertyDefinition() { - PropertyDefinitionId = Null.NullInteger; + this.PropertyDefinitionId = Null.NullInteger; //Get the default PortalSettings PortalSettings _Settings = PortalController.Instance.GetCurrentPortalSettings(); - PortalId = _Settings.PortalId; + this.PortalId = _Settings.PortalId; } public ProfilePropertyDefinition(int portalId) { - PropertyDefinitionId = Null.NullInteger; - PortalId = portalId; + this.PropertyDefinitionId = Null.NullInteger; + this.PortalId = portalId; } #endregion @@ -88,15 +88,15 @@ public int DataType { get { - return _dataType; + return this._dataType; } set { - if (_dataType != value) + if (this._dataType != value) { - IsDirty = true; + this.IsDirty = true; } - _dataType = value; + this._dataType = value; } } @@ -111,15 +111,15 @@ public string DefaultValue { get { - return _defaultValue; + return this._defaultValue; } set { - if (_defaultValue != value) + if (this._defaultValue != value) { - IsDirty = true; + this.IsDirty = true; } - _defaultValue = value; + this._defaultValue = value; } } @@ -134,15 +134,15 @@ public UserVisibilityMode DefaultVisibility { get { - return _defaultVisibility; + return this._defaultVisibility; } set { - if (_defaultVisibility != value) + if (this._defaultVisibility != value) { - IsDirty = true; + this.IsDirty = true; } - _defaultVisibility = value; + this._defaultVisibility = value; } } @@ -157,11 +157,11 @@ public bool Deleted { get { - return _deleted; + return this._deleted; } set { - _deleted = value; + this._deleted = value; } } @@ -185,15 +185,15 @@ public int Length { get { - return _length; + return this._length; } set { - if (_length != value) + if (this._length != value) { - IsDirty = true; + this.IsDirty = true; } - _length = value; + this._length = value; } } @@ -208,11 +208,11 @@ public int ModuleDefId { get { - return _moduleDefId; + return this._moduleDefId; } set { - _moduleDefId = value; + this._moduleDefId = value; } } @@ -227,11 +227,11 @@ public int PortalId { get { - return _portalId; + return this._portalId; } set { - _portalId = value; + this._portalId = value; } } @@ -247,15 +247,15 @@ public string PropertyCategory { get { - return _propertyCategory; + return this._propertyCategory; } set { - if (_propertyCategory != value) + if (this._propertyCategory != value) { - IsDirty = true; + this.IsDirty = true; } - _propertyCategory = value; + this._propertyCategory = value; } } @@ -282,15 +282,15 @@ public string PropertyName { get { - return _propertyName; + return this._propertyName; } set { - if (_propertyName != value) + if (this._propertyName != value) { - IsDirty = true; + this.IsDirty = true; } - _propertyName = value; + this._propertyName = value; } } @@ -305,15 +305,15 @@ public string PropertyValue { get { - return _propertyValue; + return this._propertyValue; } set { - if (_propertyValue != value) + if (this._propertyValue != value) { - IsDirty = true; + this.IsDirty = true; } - _propertyValue = value; + this._propertyValue = value; } } @@ -328,15 +328,15 @@ public bool ReadOnly { get { - return _readOnly; + return this._readOnly; } set { - if (_readOnly != value) + if (this._readOnly != value) { - IsDirty = true; + this.IsDirty = true; } - _readOnly = value; + this._readOnly = value; } } @@ -351,15 +351,15 @@ public bool Required { get { - return _required; + return this._required; } set { - if (_required != value) + if (this._required != value) { - IsDirty = true; + this.IsDirty = true; } - _required = value; + this._required = value; } } @@ -374,15 +374,15 @@ public string ValidationExpression { get { - return _ValidationExpression; + return this._ValidationExpression; } set { - if (_ValidationExpression != value) + if (this._ValidationExpression != value) { - IsDirty = true; + this.IsDirty = true; } - _ValidationExpression = value; + this._ValidationExpression = value; } } @@ -398,15 +398,15 @@ public int ViewOrder { get { - return _viewOrder; + return this._viewOrder; } set { - if (_viewOrder != value) + if (this._viewOrder != value) { - IsDirty = true; + this.IsDirty = true; } - _viewOrder = value; + this._viewOrder = value; } } @@ -421,15 +421,15 @@ public bool Visible { get { - return _visible; + return this._visible; } set { - if (_visible != value) + if (this._visible != value) { - IsDirty = true; + this.IsDirty = true; } - _visible = value; + this._visible = value; } } @@ -444,15 +444,15 @@ public ProfileVisibility ProfileVisibility { get { - return _profileVisibility; + return this._profileVisibility; } set { - if (_profileVisibility != value) + if (this._profileVisibility != value) { - IsDirty = true; + this.IsDirty = true; } - _profileVisibility = value; + this._profileVisibility = value; } } @@ -467,7 +467,7 @@ public ProfileVisibility ProfileVisibility /// ----------------------------------------------------------------------------- public void ClearIsDirty() { - IsDirty = false; + this.IsDirty = false; } /// @@ -476,24 +476,24 @@ public void ClearIsDirty() /// A ProfilePropertyDefinition public ProfilePropertyDefinition Clone() { - var clone = new ProfilePropertyDefinition(PortalId) + var clone = new ProfilePropertyDefinition(this.PortalId) { - DataType = DataType, - DefaultValue = DefaultValue, - Length = Length, - ModuleDefId = ModuleDefId, - PropertyCategory = PropertyCategory, - PropertyDefinitionId = PropertyDefinitionId, - PropertyName = PropertyName, - PropertyValue = PropertyValue, - ReadOnly = ReadOnly, - Required = Required, - ValidationExpression = ValidationExpression, - ViewOrder = ViewOrder, - DefaultVisibility = DefaultVisibility, - ProfileVisibility = ProfileVisibility.Clone(), - Visible = Visible, - Deleted = Deleted + DataType = this.DataType, + DefaultValue = this.DefaultValue, + Length = this.Length, + ModuleDefId = this.ModuleDefId, + PropertyCategory = this.PropertyCategory, + PropertyDefinitionId = this.PropertyDefinitionId, + PropertyName = this.PropertyName, + PropertyValue = this.PropertyValue, + ReadOnly = this.ReadOnly, + Required = this.Required, + ValidationExpression = this.ValidationExpression, + ViewOrder = this.ViewOrder, + DefaultVisibility = this.DefaultVisibility, + ProfileVisibility = this.ProfileVisibility.Clone(), + Visible = this.Visible, + Deleted = this.Deleted }; clone.ClearIsDirty(); return clone; @@ -510,15 +510,15 @@ public UserVisibilityMode Visibility { get { - return ProfileVisibility.VisibilityMode; + return this.ProfileVisibility.VisibilityMode; } set { - if (ProfileVisibility.VisibilityMode != value) + if (this.ProfileVisibility.VisibilityMode != value) { - IsDirty = true; + this.IsDirty = true; } - ProfileVisibility.VisibilityMode = value; + this.ProfileVisibility.VisibilityMode = value; } } diff --git a/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinitionCollection.cs b/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinitionCollection.cs index c6cb89ea39c..95b48e47098 100644 --- a/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinitionCollection.cs +++ b/DNN Platform/Library/Entities/Profile/ProfilePropertyDefinitionCollection.cs @@ -43,7 +43,7 @@ public ProfilePropertyDefinitionCollection() /// ----------------------------------------------------------------------------- public ProfilePropertyDefinitionCollection(ArrayList definitionsList) { - AddRange(definitionsList); + this.AddRange(definitionsList); } /// ----------------------------------------------------------------------------- @@ -54,7 +54,7 @@ public ProfilePropertyDefinitionCollection(ArrayList definitionsList) /// ----------------------------------------------------------------------------- public ProfilePropertyDefinitionCollection(ProfilePropertyDefinitionCollection collection) { - AddRange(collection); + this.AddRange(collection); } /// ----------------------------------------------------------------------------- @@ -69,11 +69,11 @@ public ProfilePropertyDefinition this[int index] { get { - return (ProfilePropertyDefinition) List[index]; + return (ProfilePropertyDefinition) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } @@ -89,7 +89,7 @@ public ProfilePropertyDefinition this[string name] { get { - return GetByName(name); + return this.GetByName(name); } } @@ -102,7 +102,7 @@ public ProfilePropertyDefinition this[string name] /// ----------------------------------------------------------------------------- public int Add(ProfilePropertyDefinition value) { - return List.Add(value); + return this.List.Add(value); } /// ----------------------------------------------------------------------------- @@ -115,7 +115,7 @@ public void AddRange(ArrayList definitionsList) { foreach (ProfilePropertyDefinition objProfilePropertyDefinition in definitionsList) { - Add(objProfilePropertyDefinition); + this.Add(objProfilePropertyDefinition); } } @@ -129,7 +129,7 @@ public void AddRange(ProfilePropertyDefinitionCollection collection) { foreach (ProfilePropertyDefinition objProfilePropertyDefinition in collection) { - Add(objProfilePropertyDefinition); + this.Add(objProfilePropertyDefinition); } } @@ -142,7 +142,7 @@ public void AddRange(ProfilePropertyDefinitionCollection collection) /// ----------------------------------------------------------------------------- public bool Contains(ProfilePropertyDefinition value) { - return List.Contains(value); + return this.List.Contains(value); } /// ----------------------------------------------------------------------------- @@ -155,7 +155,7 @@ public bool Contains(ProfilePropertyDefinition value) public ProfilePropertyDefinitionCollection GetByCategory(string category) { var collection = new ProfilePropertyDefinitionCollection(); - foreach (ProfilePropertyDefinition profileProperty in InnerList) + foreach (ProfilePropertyDefinition profileProperty in this.InnerList) { if (profileProperty.PropertyCategory == category) { @@ -175,7 +175,7 @@ public ProfilePropertyDefinitionCollection GetByCategory(string category) public ProfilePropertyDefinition GetById(int id) { ProfilePropertyDefinition profileItem = null; - foreach (ProfilePropertyDefinition profileProperty in InnerList) + foreach (ProfilePropertyDefinition profileProperty in this.InnerList) { if (profileProperty.PropertyDefinitionId == id) { @@ -195,7 +195,7 @@ public ProfilePropertyDefinition GetById(int id) public ProfilePropertyDefinition GetByName(string name) { ProfilePropertyDefinition profileItem = null; - foreach (ProfilePropertyDefinition profileProperty in InnerList) + foreach (ProfilePropertyDefinition profileProperty in this.InnerList) { if (profileProperty?.PropertyName == name) { @@ -215,7 +215,7 @@ public ProfilePropertyDefinition GetByName(string name) /// ----------------------------------------------------------------------------- public int IndexOf(ProfilePropertyDefinition value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } /// ----------------------------------------------------------------------------- @@ -227,7 +227,7 @@ public int IndexOf(ProfilePropertyDefinition value) /// ----------------------------------------------------------------------------- public void Insert(int index, ProfilePropertyDefinition value) { - List.Insert(index, value); + this.List.Insert(index, value); } /// ----------------------------------------------------------------------------- @@ -238,7 +238,7 @@ public void Insert(int index, ProfilePropertyDefinition value) /// ----------------------------------------------------------------------------- public void Remove(ProfilePropertyDefinition value) { - List.Remove(value); + this.List.Remove(value); } /// ----------------------------------------------------------------------------- @@ -248,7 +248,7 @@ public void Remove(ProfilePropertyDefinition value) /// ----------------------------------------------------------------------------- public void Sort() { - InnerList.Sort(new ProfilePropertyDefinitionComparer()); + this.InnerList.Sort(new ProfilePropertyDefinitionComparer()); } } } diff --git a/DNN Platform/Library/Entities/Profile/ProfileVisibility.cs b/DNN Platform/Library/Entities/Profile/ProfileVisibility.cs index 1f3f2cb26dc..b884526478d 100644 --- a/DNN Platform/Library/Entities/Profile/ProfileVisibility.cs +++ b/DNN Platform/Library/Entities/Profile/ProfileVisibility.cs @@ -19,8 +19,8 @@ public class ProfileVisibility { public ProfileVisibility() { - RoleVisibilities = new List(); - RelationshipVisibilities = new List(); + this.RoleVisibilities = new List(); + this.RelationshipVisibilities = new List(); } public ProfileVisibility(int portalId, string extendedVisibility) : this() @@ -38,7 +38,7 @@ public ProfileVisibility(int portalId, string extendedVisibility) : this() { int roleId = Int32.Parse(role); RoleInfo userRole = RoleController.Instance.GetRole(portalId, r => r.RoleID == roleId); - RoleVisibilities.Add(userRole); + this.RoleVisibilities.Add(userRole); } } if (!String.IsNullOrEmpty(lists[1].Substring(2).TrimEnd(','))) @@ -47,7 +47,7 @@ public ProfileVisibility(int portalId, string extendedVisibility) : this() foreach (var relationship in relationships) { Relationship userRelationship = RelationshipController.Instance.GetRelationship(Int32.Parse(relationship)); - RelationshipVisibilities.Add(userRelationship); + this.RelationshipVisibilities.Add(userRelationship); } } } @@ -64,25 +64,25 @@ public ProfileVisibility Clone() { var pv = new ProfileVisibility() { - VisibilityMode = VisibilityMode, - RoleVisibilities = new List(RoleVisibilities), - RelationshipVisibilities = new List(RelationshipVisibilities) + VisibilityMode = this.VisibilityMode, + RoleVisibilities = new List(this.RoleVisibilities), + RelationshipVisibilities = new List(this.RelationshipVisibilities) }; return pv; } public string ExtendedVisibilityString() { - if (VisibilityMode == UserVisibilityMode.FriendsAndGroups) + if (this.VisibilityMode == UserVisibilityMode.FriendsAndGroups) { var sb = new StringBuilder(); sb.Append("G:"); - foreach (var role in RoleVisibilities) + foreach (var role in this.RoleVisibilities) { sb.Append(role.RoleID.ToString(CultureInfo.InvariantCulture) + ","); } sb.Append(";R:"); - foreach (var relationship in RelationshipVisibilities) + foreach (var relationship in this.RelationshipVisibilities) { sb.Append(relationship.RelationshipId.ToString(CultureInfo.InvariantCulture) + ","); } diff --git a/DNN Platform/Library/Entities/Tabs/Dto/ChangeControlState.cs b/DNN Platform/Library/Entities/Tabs/Dto/ChangeControlState.cs index 704c34a51ce..55a9286ff81 100644 --- a/DNN Platform/Library/Entities/Tabs/Dto/ChangeControlState.cs +++ b/DNN Platform/Library/Entities/Tabs/Dto/ChangeControlState.cs @@ -38,7 +38,7 @@ public class ChangeControlState /// public bool IsChangeControlEnabledForTab { - get { return IsVersioningEnabledForTab || IsWorkflowEnabledForTab; } + get { return this.IsVersioningEnabledForTab || this.IsWorkflowEnabledForTab; } } /// diff --git a/DNN Platform/Library/Entities/Tabs/TabAliasSkinInfo.cs b/DNN Platform/Library/Entities/Tabs/TabAliasSkinInfo.cs index 40315d83e16..efb5779daff 100644 --- a/DNN Platform/Library/Entities/Tabs/TabAliasSkinInfo.cs +++ b/DNN Platform/Library/Entities/Tabs/TabAliasSkinInfo.cs @@ -32,19 +32,19 @@ public class TabAliasSkinInfo : BaseEntityInfo, IHydratable public int KeyID { - get { return TabAliasSkinId; } - set { TabAliasSkinId = value; } + get { return this.TabAliasSkinId; } + set { this.TabAliasSkinId = value; } } public void Fill(IDataReader dr) { base.FillInternal(dr); - TabAliasSkinId = Null.SetNullInteger(dr["TabAliasSkinId"]); - HttpAlias = Null.SetNullString(dr["HttpAlias"]); - PortalAliasId = Null.SetNullInteger(dr["PortalAliasId"]); - SkinSrc = Null.SetNullString(dr["SkinSrc"]); - TabId = Null.SetNullInteger(dr["TabId"]); + this.TabAliasSkinId = Null.SetNullInteger(dr["TabAliasSkinId"]); + this.HttpAlias = Null.SetNullString(dr["HttpAlias"]); + this.PortalAliasId = Null.SetNullInteger(dr["PortalAliasId"]); + this.SkinSrc = Null.SetNullString(dr["SkinSrc"]); + this.TabId = Null.SetNullInteger(dr["TabId"]); } } } diff --git a/DNN Platform/Library/Entities/Tabs/TabCollection.cs b/DNN Platform/Library/Entities/Tabs/TabCollection.cs index e6af8cf2b26..504357522f9 100644 --- a/DNN Platform/Library/Entities/Tabs/TabCollection.cs +++ b/DNN Platform/Library/Entities/Tabs/TabCollection.cs @@ -42,34 +42,34 @@ public class TabCollection : Dictionary public TabCollection() { - _list = new List(); - _children = new Dictionary>(); - _localizedTabs = new Dictionary>(); + this._list = new List(); + this._children = new Dictionary>(); + this._localizedTabs = new Dictionary>(); } // The special constructor is used to deserialize values. public TabCollection(SerializationInfo info, StreamingContext context) : base(info, context) { - _list = new List(); - _children = new Dictionary>(); - _localizedTabs = new Dictionary>(); + this._list = new List(); + this._children = new Dictionary>(); + this._localizedTabs = new Dictionary>(); } public override void OnDeserialization(object sender) { base.OnDeserialization(sender); - foreach (var tab in Values) + foreach (var tab in this.Values) { //Update all child collections - AddInternal(tab); + this.AddInternal(tab); } } public TabCollection(IEnumerable tabs) : this() { - AddRange(tabs); + this.AddRange(tabs); } #endregion @@ -81,40 +81,40 @@ private void AddInternal(TabInfo tab) if (tab.ParentId == Null.NullInteger) { //Add tab to Children collection - AddToChildren(tab); + this.AddToChildren(tab); //Add to end of List as all zero-level tabs are returned in order first - _list.Add(tab); + this._list.Add(tab); } else { //Find Parent in list - for (int index = 0; index <= _list.Count - 1; index++) + for (int index = 0; index <= this._list.Count - 1; index++) { - TabInfo parentTab = _list[index]; + TabInfo parentTab = this._list[index]; if (parentTab.TabID == tab.ParentId) { - int childCount = AddToChildren(tab); + int childCount = this.AddToChildren(tab); //Insert tab in master List - _list.Insert(index + childCount, tab); + this._list.Insert(index + childCount, tab); } } } //Add to localized tabs if (tab.PortalID == Null.NullInteger || IsLocalizationEnabled(tab.PortalID)) { - AddToLocalizedTabs(tab); + this.AddToLocalizedTabs(tab); } } private int AddToChildren(TabInfo tab) { List childList; - if (!_children.TryGetValue(tab.ParentId, out childList)) + if (!this._children.TryGetValue(tab.ParentId, out childList)) { childList = new List(); - _children.Add(tab.ParentId, childList); + this._children.Add(tab.ParentId, childList); } //Add tab to end of child list as children are returned in order @@ -127,10 +127,10 @@ private void AddToLocalizedTabCollection(TabInfo tab, string cultureCode) List localizedTabCollection; var key = cultureCode.ToLowerInvariant(); - if (!_localizedTabs.TryGetValue(key, out localizedTabCollection)) + if (!this._localizedTabs.TryGetValue(key, out localizedTabCollection)) { localizedTabCollection = new List(); - _localizedTabs.Add(key, localizedTabCollection); + this._localizedTabs.Add(key, localizedTabCollection); } //Add tab to end of localized tabs @@ -144,27 +144,27 @@ private void AddToLocalizedTabs(TabInfo tab) //Add to all cultures foreach (var locale in LocaleController.Instance.GetLocales(tab.PortalID).Values) { - AddToLocalizedTabCollection(tab, locale.Code); + this.AddToLocalizedTabCollection(tab, locale.Code); } } else { - AddToLocalizedTabCollection(tab, tab.CultureCode); + this.AddToLocalizedTabCollection(tab, tab.CultureCode); } } private List GetDescendants(int tabId, int tabLevel) { var descendantTabs = new List(); - for (int index = 0; index <= _list.Count - 1; index++) + for (int index = 0; index <= this._list.Count - 1; index++) { - TabInfo parentTab = _list[index]; + TabInfo parentTab = this._list[index]; if (parentTab.TabID == tabId) { //Found Parent - so add descendents - for (int descendantIndex = index + 1; descendantIndex <= _list.Count - 1; descendantIndex++) + for (int descendantIndex = index + 1; descendantIndex <= this._list.Count - 1; descendantIndex++) { - TabInfo descendantTab = _list[descendantIndex]; + TabInfo descendantTab = this._list[descendantIndex]; if ((tabLevel == Null.NullInteger)) { @@ -205,48 +205,48 @@ private static bool IsLocalizationEnabled(int portalId) public void Add(TabInfo tab) { //Call base class to add to base Dictionary - Add(tab.TabID, tab); + this.Add(tab.TabID, tab); //Update all child collections - AddInternal(tab); + this.AddInternal(tab); } public void AddRange(IEnumerable tabs) { foreach (TabInfo tab in tabs) { - Add(tab); + this.Add(tab); } } public List AsList() { - return _list; + return this._list; } public List DescendentsOf(int tabId) { - return GetDescendants(tabId, Null.NullInteger); + return this.GetDescendants(tabId, Null.NullInteger); } public List DescendentsOf(int tabId, int originalTabLevel) { - return GetDescendants(tabId, originalTabLevel); + return this.GetDescendants(tabId, originalTabLevel); } public bool IsDescendentOf(int ancestorId, int testTabId) { - return DescendentsOf(ancestorId).Any(tab => tab.TabID == testTabId); + return this.DescendentsOf(ancestorId).Any(tab => tab.TabID == testTabId); } public ArrayList ToArrayList() { - return new ArrayList(_list); + return new ArrayList(this._list); } public TabCollection WithCulture(string cultureCode, bool includeNeutral) { - return WithCulture(cultureCode, includeNeutral, IsLocalizationEnabled()); + return this.WithCulture(cultureCode, includeNeutral, IsLocalizationEnabled()); } public TabCollection WithCulture(string cultureCode, bool includeNeutral, bool localizationEnabled) { @@ -262,7 +262,7 @@ public TabCollection WithCulture(string cultureCode, bool includeNeutral, bool l { cultureCode = cultureCode.ToLowerInvariant(); List tabs; - if (!_localizedTabs.TryGetValue(cultureCode, out tabs)) + if (!this._localizedTabs.TryGetValue(cultureCode, out tabs)) { collection = new TabCollection(new List()); } @@ -287,7 +287,7 @@ where t.CultureCode.ToLowerInvariant() == cultureCode public List WithParentId(int parentId) { List tabs; - if (!_children.TryGetValue(parentId, out tabs)) + if (!this._children.TryGetValue(parentId, out tabs)) { tabs = new List(); } @@ -297,7 +297,7 @@ public List WithParentId(int parentId) public TabInfo WithTabId(int tabId) { TabInfo t = null; - if (ContainsKey(tabId)) + if (this.ContainsKey(tabId)) { t = this[tabId]; } @@ -306,38 +306,38 @@ public TabInfo WithTabId(int tabId) public TabInfo WithTabNameAndParentId(string tabName, int parentId) { - return (from t in _list where t.TabName.Equals(tabName, StringComparison.InvariantCultureIgnoreCase) && t.ParentId == parentId select t).SingleOrDefault(); + return (from t in this._list where t.TabName.Equals(tabName, StringComparison.InvariantCultureIgnoreCase) && t.ParentId == parentId select t).SingleOrDefault(); } public TabInfo WithTabName(string tabName) { - return (from t in _list where !string.IsNullOrEmpty(t.TabName) && t.TabName.Equals(tabName, StringComparison.InvariantCultureIgnoreCase) select t).FirstOrDefault(); + return (from t in this._list where !string.IsNullOrEmpty(t.TabName) && t.TabName.Equals(tabName, StringComparison.InvariantCultureIgnoreCase) select t).FirstOrDefault(); } internal void RefreshCache(int tabId, TabInfo updatedTab) { - if (ContainsKey(tabId)) + if (this.ContainsKey(tabId)) { if (updatedTab == null) //the tab has been deleted { - Remove(tabId); - _list.RemoveAll(t => t.TabID == tabId); - _localizedTabs.ForEach(kvp => + this.Remove(tabId); + this._list.RemoveAll(t => t.TabID == tabId); + this._localizedTabs.ForEach(kvp => { kvp.Value.RemoveAll(t => t.TabID == tabId); }); - _children.Remove(tabId); + this._children.Remove(tabId); } else { this[tabId] = updatedTab; - var index = _list.FindIndex(t => t.TabID == tabId); + var index = this._list.FindIndex(t => t.TabID == tabId); if (index > Null.NullInteger) { - _list[index] = updatedTab; + this._list[index] = updatedTab; } - _localizedTabs.ForEach(kvp => + this._localizedTabs.ForEach(kvp => { var localizedIndex = kvp.Value.FindIndex(t => t.TabID == tabId); if (localizedIndex > Null.NullInteger) diff --git a/DNN Platform/Library/Entities/Tabs/TabController.cs b/DNN Platform/Library/Entities/Tabs/TabController.cs index be621ece4ec..a6fd6bf45b7 100644 --- a/DNN Platform/Library/Entities/Tabs/TabController.cs +++ b/DNN Platform/Library/Entities/Tabs/TabController.cs @@ -83,7 +83,7 @@ public static TabInfo CurrentPage private bool IsAdminTab(TabInfo tab) { var portal = PortalController.Instance.GetPortal(tab.PortalID); - return portal.AdminTabId == tab.TabID || IsAdminTabRecursive(tab, portal.AdminTabId); + return portal.AdminTabId == tab.TabID || this.IsAdminTabRecursive(tab, portal.AdminTabId); } private bool IsAdminTabRecursive(TabInfo tab, int adminTabId) @@ -98,8 +98,8 @@ private bool IsAdminTabRecursive(TabInfo tab, int adminTabId) return true; } - var parentTab = GetTab(tab.ParentId, tab.PortalID); - return IsAdminTabRecursive(parentTab, adminTabId); + var parentTab = this.GetTab(tab.ParentId, tab.PortalID); + return this.IsAdminTabRecursive(parentTab, adminTabId); } private bool IsHostTab(TabInfo tab) @@ -131,22 +131,22 @@ private int AddTabInternal(TabInfo tab, int afterTabId, int beforeTabId, bool in ValidateTabPath(tab); //First create ContentItem as we need the ContentItemID - CreateContentItem(tab); + this.CreateContentItem(tab); //Add Tab if (afterTabId > 0) { - tab.TabID = _dataProvider.AddTabAfter(tab, afterTabId, UserController.Instance.GetCurrentUserInfo().UserID); + tab.TabID = this._dataProvider.AddTabAfter(tab, afterTabId, UserController.Instance.GetCurrentUserInfo().UserID); } else { tab.TabID = beforeTabId > 0 - ? _dataProvider.AddTabBefore(tab, beforeTabId, UserController.Instance.GetCurrentUserInfo().UserID) - : _dataProvider.AddTabToEnd(tab, UserController.Instance.GetCurrentUserInfo().UserID); + ? this._dataProvider.AddTabBefore(tab, beforeTabId, UserController.Instance.GetCurrentUserInfo().UserID) + : this._dataProvider.AddTabToEnd(tab, UserController.Instance.GetCurrentUserInfo().UserID); } //Clear the Cache - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); ITermController termController = Util.GetTermController(); termController.RemoveTermsFromContent(tab); @@ -164,7 +164,7 @@ private int AddTabInternal(TabInfo tab, int afterTabId, int beforeTabId, bool in //Add TabSettings - use Try/catch as tabs are added during upgrade ptocess and the sproc may not exist try { - UpdateTabSettings(ref tab); + this.UpdateTabSettings(ref tab); } catch (Exception ex) { @@ -180,7 +180,7 @@ private int AddTabInternal(TabInfo tab, int afterTabId, int beforeTabId, bool in //Check Tab Versioning if (tab.PortalID == Null.NullInteger || !TabVersionSettings.Instance.IsVersioningEnabled(tab.PortalID, tab.TabID)) { - MarkAsPublished(tab); + this.MarkAsPublished(tab); } EventManager.Instance.OnTabCreated(new TabEventArgs { Tab = tab }); @@ -217,7 +217,7 @@ private void CreateLocalizedCopyInternal(TabInfo originalTab, Locale locale, boo if (locale == defaultLocale) { originalTab.DefaultLanguageGuid = localizedCopy.UniqueId; - UpdateTab(originalTab); + this.UpdateTab(originalTab); } else { @@ -241,10 +241,10 @@ private void CreateLocalizedCopyInternal(TabInfo originalTab, Locale locale, boo //check the original whether have parent. if (!Null.IsNull(originalTab.ParentId)) { - TabInfo originalParent = GetTab(originalTab.ParentId, originalTab.PortalID, false); + TabInfo originalParent = this.GetTab(originalTab.ParentId, originalTab.PortalID, false); //Get the localized parent - TabInfo localizedParent = GetTabByCulture(originalParent.TabID, originalParent.PortalID, locale); + TabInfo localizedParent = this.GetTabByCulture(originalParent.TabID, originalParent.PortalID, locale); localizedCopy.ParentId = localizedParent.TabID; } @@ -252,12 +252,12 @@ private void CreateLocalizedCopyInternal(TabInfo originalTab, Locale locale, boo var afterTabId = insertAfterOriginal ? originalTab.TabID : -1; const int beforeTabId = -1; const bool includeAllModules = false; - AddTabInternal(localizedCopy, afterTabId, beforeTabId, includeAllModules); //not include modules show on all page, it will handled in copy modules action. + this.AddTabInternal(localizedCopy, afterTabId, beforeTabId, includeAllModules); //not include modules show on all page, it will handled in copy modules action. //if the tab has custom stylesheet defined, then also copy the stylesheet to the localized version. if (originalTab.TabSettings.ContainsKey("CustomStylesheet")) { - UpdateTabSetting(localizedCopy.TabID, "CustomStylesheet", originalTab.TabSettings["CustomStylesheet"].ToString()); + this.UpdateTabSetting(localizedCopy.TabID, "CustomStylesheet", originalTab.TabSettings["CustomStylesheet"].ToString()); } /* Tab versioning and workflow is disabled @@ -281,13 +281,13 @@ private void CreateLocalizedCopyInternal(TabInfo originalTab, Locale locale, boo } //Add Translator Role - GiveTranslatorRoleEditRights(localizedCopy, null); + this.GiveTranslatorRoleEditRights(localizedCopy, null); /* Tab versioning and workflow is re-enabled * when the Localized copy is created */ EnableTabVersioningAndWorkflow(localizedCopy); - MarkAsPublished(localizedCopy); + this.MarkAsPublished(localizedCopy); } catch (Exception ex) { @@ -298,7 +298,7 @@ private void CreateLocalizedCopyInternal(TabInfo originalTab, Locale locale, boo //Clear the Cache if (clearCache) { - ClearCache(originalTab.PortalID); + this.ClearCache(originalTab.PortalID); } } @@ -309,7 +309,7 @@ private void ClearTabSettingsCache(int tabId) DataCache.RemoveCache(cacheKey); //aslo clear the settings from tab object in cache. - var tab = GetTab(tabId, portalId, false); + var tab = this.GetTab(tabId, portalId, false); if (tab != null) { tab.ClearSettingsCache(); @@ -345,21 +345,21 @@ private void CreateTabRedirect(TabInfo tab) IsSystem = true }; - SaveTabUrl(tabUrl, tab.PortalID, false); + this.SaveTabUrl(tabUrl, tab.PortalID, false); } } } private void CreateTabRedirects(TabInfo tab) { - CreateTabRedirect(tab); + this.CreateTabRedirect(tab); - var descendants = GetTabsByPortal(tab.PortalID).DescendentsOf(tab.TabID); + var descendants = this.GetTabsByPortal(tab.PortalID).DescendentsOf(tab.TabID); //Create Redirect for descendant tabs foreach (TabInfo descendantTab in descendants) { - CreateTabRedirect(descendantTab); + this.CreateTabRedirect(descendantTab); } } @@ -459,7 +459,7 @@ private Dictionary> GetAliasSkins(int portalId) DataCache.TabAliasSkinCacheTimeOut, DataCache.TabAliasSkinCachePriority, portalId), - GetAliasSkinsCallback); + this.GetAliasSkinsCallback); } @@ -513,7 +513,7 @@ private Dictionary> GetCustomAliases(int portalI DataCache.TabCustomAliasCacheTimeOut, DataCache.TabCustomAliasCachePriority, portalId), - GetCustomAliasesCallback); + this.GetCustomAliasesCallback); } @@ -582,7 +582,7 @@ private static int GetPortalId(int tabId, int portalId) private IEnumerable GetSiblingTabs(TabInfo objTab) { - return GetTabsByPortal(objTab.PortalID).WithCulture(objTab.CultureCode, true).WithParentId(objTab.ParentId); + return this.GetTabsByPortal(objTab.PortalID).WithCulture(objTab.CultureCode, true).WithParentId(objTab.ParentId); } private static object GetTabPathDictionaryCallback(CacheItemArgs cacheItemArgs) @@ -618,7 +618,7 @@ private Dictionary GetTabSettingsByPortal(int portalId) c => { var tabSettings = new Dictionary(); - using (var dr = _dataProvider.GetTabSettings(portalId)) + using (var dr = this._dataProvider.GetTabSettings(portalId)) { while (dr.Read()) { @@ -651,7 +651,7 @@ internal Dictionary> GetTabUrls(int portalId) DataCache.TabUrlCacheTimeOut, DataCache.TabUrlCachePriority, portalId), - GetTabUrlsCallback); + this.GetTabUrlsCallback); } @@ -707,10 +707,10 @@ private void HardDeleteTabInternal(int tabId, int portalId) ModuleController.Instance.DeleteTabModule(m.TabID, m.ModuleID, false); } - var tab = GetTab(tabId, portalId, false); + var tab = this.GetTab(tabId, portalId, false); //Delete Tab - _dataProvider.DeleteTab(tabId); + this._dataProvider.DeleteTab(tabId); //Log deletion EventLogController.Instance.AddLog("TabID", @@ -742,7 +742,7 @@ private bool SoftDeleteChildTabs(int intTabid, PortalSettings portalSettings) bool bDeleted = true; foreach (TabInfo objtab in GetTabsByParent(intTabid, portalSettings.PortalId)) { - bDeleted = SoftDeleteTabInternal(objtab, portalSettings); + bDeleted = this.SoftDeleteTabInternal(objtab, portalSettings); if (!bDeleted) { break; @@ -768,10 +768,10 @@ private bool SoftDeleteTabInternal(TabInfo tabToDelete, PortalSettings portalSet var deleted = false; if (!IsSpecialTab(tabToDelete.TabID, portalSettings)) { - if (SoftDeleteChildTabs(tabToDelete.TabID, portalSettings)) + if (this.SoftDeleteChildTabs(tabToDelete.TabID, portalSettings)) { tabToDelete.IsDeleted = true; - UpdateTab(tabToDelete); + this.UpdateTab(tabToDelete); foreach (ModuleInfo m in ModuleController.Instance.GetTabModules(tabToDelete.TabID).Values) { @@ -797,13 +797,13 @@ private bool SoftDeleteTabInternal(TabInfo tabToDelete, PortalSettings portalSet private void UpdateTabSettingInternal(int tabId, string settingName, string settingValue, bool clearCache) { - using (var dr = _dataProvider.GetTabSetting(tabId, settingName)) + using (var dr = this._dataProvider.GetTabSetting(tabId, settingName)) { if (dr.Read()) { if (dr.GetString(0) != settingValue) { - _dataProvider.UpdateTabSetting(tabId, settingName, settingValue, + this._dataProvider.UpdateTabSetting(tabId, settingName, settingValue, UserController.Instance.GetCurrentUserInfo().UserID); EventLogController.AddSettingLog(EventLogController.EventLogType.TAB_SETTING_UPDATED, "TabId", tabId, settingName, settingValue, @@ -812,7 +812,7 @@ private void UpdateTabSettingInternal(int tabId, string settingName, string sett } else { - _dataProvider.UpdateTabSetting(tabId, settingName, settingValue, + this._dataProvider.UpdateTabSetting(tabId, settingName, settingValue, UserController.Instance.GetCurrentUserInfo().UserID); EventLogController.AddSettingLog(EventLogController.EventLogType.TAB_SETTING_CREATED, "TabId", tabId, settingName, settingValue, @@ -824,7 +824,7 @@ private void UpdateTabSettingInternal(int tabId, string settingName, string sett UpdateTabVersion(tabId); if (clearCache) { - ClearTabSettingsCache(tabId); + this.ClearTabSettingsCache(tabId); } } @@ -833,7 +833,7 @@ private void UpdateTabSettings(ref TabInfo updatedTab) foreach (string sKeyLoopVariable in updatedTab.TabSettings.Keys) { string sKey = sKeyLoopVariable; - UpdateTabSettingInternal(updatedTab.TabID, sKey, Convert.ToString(updatedTab.TabSettings[sKey]), false); + this.UpdateTabSettingInternal(updatedTab.TabID, sKey, Convert.ToString(updatedTab.TabSettings[sKey]), false); } } @@ -881,7 +881,7 @@ private void UpdateContentItem(TabInfo tab) /// public void AddMissingLanguages(int portalId, int tabId) { - var currentTab = GetTab(tabId, portalId, false); + var currentTab = this.GetTab(tabId, portalId, false); if (currentTab.CultureCode != null) { var defaultLocale = LocaleController.Instance.GetDefaultLocale(portalId); @@ -891,7 +891,7 @@ public void AddMissingLanguages(int portalId, int tabId) // we are adding missing languages to a single culture page that is not in the default language // so we must first add a page in the default culture - CreateLocalizedCopyInternal(workingTab, defaultLocale, false, true, insertAfterOriginal: true); + this.CreateLocalizedCopyInternal(workingTab, defaultLocale, false, true, insertAfterOriginal: true); } if (currentTab.DefaultLanguageTab != null) @@ -910,7 +910,7 @@ public void AddMissingLanguages(int portalId, int tabId) } if (missing) { - CreateLocalizedCopyInternal(workingTab, locale, false, true, insertAfterOriginal: true); + this.CreateLocalizedCopyInternal(workingTab, locale, false, true, insertAfterOriginal: true); } } } @@ -925,7 +925,7 @@ public void AddMissingLanguages(int portalId, int tabId) /// The tab is added to the end of the current Level. public int AddTab(TabInfo tab) { - return AddTab(tab, true); + return this.AddTab(tab, true); } /// @@ -938,10 +938,10 @@ public int AddTab(TabInfo tab) public int AddTab(TabInfo tab, bool includeAllTabsModules) { //Add tab to store - int tabID = AddTabInternal(tab, -1, -1, includeAllTabsModules); + int tabID = this.AddTabInternal(tab, -1, -1, includeAllTabsModules); //Clear the Cache - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); return tabID; } @@ -954,10 +954,10 @@ public int AddTab(TabInfo tab, bool includeAllTabsModules) public int AddTabAfter(TabInfo tab, int afterTabId) { //Add tab to store - int tabID = AddTabInternal(tab, afterTabId, -1, true); + int tabID = this.AddTabInternal(tab, afterTabId, -1, true); //Clear the Cache - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); return tabID; } @@ -970,10 +970,10 @@ public int AddTabAfter(TabInfo tab, int afterTabId) public int AddTabBefore(TabInfo objTab, int beforeTabId) { //Add tab to store - int tabID = AddTabInternal(objTab, -1, beforeTabId, true); + int tabID = this.AddTabInternal(objTab, -1, beforeTabId, true); //Clear the Cache - ClearCache(objTab.PortalID); + this.ClearCache(objTab.PortalID); return tabID; } @@ -996,10 +996,10 @@ public void ClearCache(int portalId) public void RefreshCache(int portalId, int tabId) { - var portalTabs = GetTabsByPortal(portalId); + var portalTabs = this.GetTabsByPortal(portalId); if (portalTabs.WithTabId(tabId) != null) { - var updateTab = GetTab(tabId, portalId, true); + var updateTab = this.GetTab(tabId, portalId, true); portalTabs.RefreshCache(tabId, updateTab); } } @@ -1015,20 +1015,20 @@ public void RefreshCache(int portalId, int tabId) public void ConvertTabToNeutralLanguage(int portalId, int tabId, string cultureCode, bool clearCache) { //parent tabs can not be deleted - if (GetTabsByPortal(portalId).WithParentId(tabId).Count == 0) + if (this.GetTabsByPortal(portalId).WithParentId(tabId).Count == 0) { // delete all translated / localized tabs for this tab - var tab = GetTab(tabId, portalId, true); + var tab = this.GetTab(tabId, portalId, true); foreach (var localizedTab in tab.LocalizedTabs.Values) { - HardDeleteTabInternal(localizedTab.TabID, portalId); + this.HardDeleteTabInternal(localizedTab.TabID, portalId); } // reset culture of current tab back to neutral - _dataProvider.ConvertTabToNeutralLanguage(portalId, tabId, cultureCode); + this._dataProvider.ConvertTabToNeutralLanguage(portalId, tabId, cultureCode); if (clearCache) { - ClearCache(portalId); + this.ClearCache(portalId); } } @@ -1064,7 +1064,7 @@ public void CreateLocalizedCopies(TabInfo originalTab) { if (subLocale.Code != defaultLocale.Code) { - CreateLocalizedCopyInternal(originalTab, subLocale, false, true); + this.CreateLocalizedCopyInternal(originalTab, subLocale, false, true); } } } @@ -1077,7 +1077,7 @@ public void CreateLocalizedCopies(TabInfo originalTab) /// Clear the cache? public void CreateLocalizedCopy(TabInfo originalTab, Locale locale, bool clearCache) { - CreateLocalizedCopyInternal(originalTab, locale, true, clearCache); + this.CreateLocalizedCopyInternal(originalTab, locale, true, clearCache); } private static void EnableTabVersioningAndWorkflow(TabInfo tab) @@ -1115,11 +1115,11 @@ private static void DisableTabVersioningAndWorkflow(TabInfo tab) public void DeleteTab(int tabId, int portalId) { //parent tabs can not be deleted - if (GetTabsByPortal(portalId).WithParentId(tabId).Count == 0) + if (this.GetTabsByPortal(portalId).WithParentId(tabId).Count == 0) { - HardDeleteTabInternal(tabId, portalId); + this.HardDeleteTabInternal(tabId, portalId); } - ClearCache(portalId); + this.ClearCache(portalId); } /// @@ -1130,16 +1130,16 @@ public void DeleteTab(int tabId, int portalId) /// if set to true will delete all child tabs. public void DeleteTab(int tabId, int portalId, bool deleteDescendants) { - List descendantList = GetTabsByPortal(portalId).DescendentsOf(tabId); + List descendantList = this.GetTabsByPortal(portalId).DescendentsOf(tabId); if (deleteDescendants && descendantList.Count > 0) { //Iterate through descendants from bottom - which will remove children first for (int i = descendantList.Count - 1; i >= 0; i += -1) { - HardDeleteTabInternal(descendantList[i].TabID, portalId); + this.HardDeleteTabInternal(descendantList[i].TabID, portalId); } } - DeleteTab(tabId, portalId); + this.DeleteTab(tabId, portalId); } /// @@ -1149,14 +1149,14 @@ public void DeleteTab(int tabId, int portalId, bool deleteDescendants) /// Name of the setting to be deleted public void DeleteTabSetting(int tabId, string settingName) { - _dataProvider.DeleteTabSetting(tabId, settingName); + this._dataProvider.DeleteTabSetting(tabId, settingName); var log = new LogInfo {LogTypeKey = EventLogController.EventLogType.TAB_SETTING_DELETED.ToString()}; log.LogProperties.Add(new LogDetailInfo("TabID", tabId.ToString())); log.LogProperties.Add(new LogDetailInfo("SettingName", settingName)); LogController.Instance.AddLog(log); UpdateTabVersion(tabId); - ClearTabSettingsCache(tabId); + this.ClearTabSettingsCache(tabId); } /// @@ -1165,12 +1165,12 @@ public void DeleteTabSetting(int tabId, string settingName) /// ID of the affected tab public void DeleteTabSettings(int tabId) { - _dataProvider.DeleteTabSettings(tabId); + this._dataProvider.DeleteTabSettings(tabId); var log = new LogInfo {LogTypeKey = EventLogController.EventLogType.TAB_SETTING_DELETED.ToString()}; log.LogProperties.Add(new LogDetailInfo("TabId", tabId.ToString())); LogController.Instance.AddLog(log); UpdateTabVersion(tabId); - ClearTabSettingsCache(tabId); + this.ClearTabSettingsCache(tabId); } /// @@ -1192,7 +1192,7 @@ public void DeleteTabUrl(TabUrlInfo tabUrl, int portalId, bool clearCache) { DataCache.RemoveCache(String.Format(DataCache.TabUrlCacheKey, portalId)); CacheController.ClearCustomAliasesCache(); - var tab = GetTab(tabUrl.TabId, portalId); + var tab = this.GetTab(tabUrl.TabId, portalId); tab.ClearTabUrls(); } } @@ -1211,11 +1211,11 @@ public bool DeleteTranslatedTabs(int portalId, string cultureCode, bool clearCac var defaultLanguage = PortalController.Instance.GetCurrentPortalSettings().DefaultLanguage; if (cultureCode != defaultLanguage) { - _dataProvider.DeleteTranslatedTabs(portalId, cultureCode); + this._dataProvider.DeleteTranslatedTabs(portalId, cultureCode); if (clearCache) { - ClearCache(portalId); + this.ClearCache(portalId); } } @@ -1232,10 +1232,10 @@ public bool DeleteTranslatedTabs(int portalId, string cultureCode, bool clearCac /// public void EnsureNeutralLanguage(int portalId, string cultureCode, bool clearCache) { - _dataProvider.EnsureNeutralLanguage(portalId, cultureCode); + this._dataProvider.EnsureNeutralLanguage(portalId, cultureCode); if (clearCache) { - ClearCache(portalId); + this.ClearCache(portalId); } } @@ -1248,7 +1248,7 @@ public void EnsureNeutralLanguage(int portalId, string cultureCode, bool clearCa public List GetAliasSkins(int tabId, int portalId) { //Get the Portal AliasSkin Dictionary - Dictionary> dicTabAliases = GetAliasSkins(portalId); + Dictionary> dicTabAliases = this.GetAliasSkins(portalId); //Get the Collection from the Dictionary List tabAliases; @@ -1270,7 +1270,7 @@ public List GetAliasSkins(int tabId, int portalId) public Dictionary GetCustomAliases(int tabId, int portalId) { //Get the Portal CustomAlias Dictionary - Dictionary> dicCustomAliases = GetCustomAliases(portalId); + Dictionary> dicCustomAliases = this.GetCustomAliases(portalId); //Get the Collection from the Dictionary Dictionary customAliases; @@ -1291,7 +1291,7 @@ public Dictionary GetCustomAliases(int tabId, int portalId) /// tab info. public TabInfo GetTab(int tabId, int portalId) { - return GetTab(tabId, portalId, false); + return this.GetTab(tabId, portalId, false); } /// @@ -1312,7 +1312,7 @@ public TabInfo GetTab(int tabId, int portalId, bool ignoreCache) else if (ignoreCache || Host.Host.PerformanceSetting == Globals.PerformanceSettings.NoCaching) { //if we are using the cache - tab = CBO.FillObject(_dataProvider.GetTab(tabId)); + tab = CBO.FillObject(this._dataProvider.GetTab(tabId)); } else { @@ -1320,20 +1320,20 @@ public TabInfo GetTab(int tabId, int portalId, bool ignoreCache) portalId = GetPortalId(tabId, portalId); //if we have the PortalId then try to get the TabInfo object - tab = GetTabsByPortal(portalId).WithTabId(tabId) ?? - GetTabsByPortal(GetPortalId(tabId, Null.NullInteger)).WithTabId(tabId); + tab = this.GetTabsByPortal(portalId).WithTabId(tabId) ?? + this.GetTabsByPortal(GetPortalId(tabId, Null.NullInteger)).WithTabId(tabId); if (tab == null) { //recheck the info directly from database to make sure we can avoid error if the cache doesn't update // correctly, this may occurred when install is set up in web farm. - tab = CBO.FillObject(_dataProvider.GetTab(tabId)); + tab = CBO.FillObject(this._dataProvider.GetTab(tabId)); // if tab is not null means that the cache doesn't update correctly, we need clear the cache // and let it rebuild cache when request next time. if (tab != null) { - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); } else { @@ -1355,7 +1355,7 @@ public TabInfo GetTab(int tabId, int portalId, bool ignoreCache) public TabInfo GetTabByCulture(int tabId, int portalId, Locale locale) { TabInfo localizedTab = null; - TabCollection tabs = GetTabsByPortal(portalId); + TabCollection tabs = this.GetTabsByPortal(portalId); //Get Tab specified by Id TabInfo originalTab = tabs.WithTabId(tabId); @@ -1406,7 +1406,7 @@ public TabInfo GetTabByCulture(int tabId, int portalId, Locale locale) /// tab info. public TabInfo GetTabByName(string tabName, int portalId) { - return GetTabsByPortal(portalId).WithTabName(tabName); + return this.GetTabsByPortal(portalId).WithTabName(tabName); } /// @@ -1418,7 +1418,7 @@ public TabInfo GetTabByName(string tabName, int portalId) /// tab info public TabInfo GetTabByName(string tabName, int portalId, int parentId) { - return GetTabsByPortal(portalId).WithTabNameAndParentId(tabName, parentId); + return this.GetTabsByPortal(portalId).WithTabNameAndParentId(tabName, parentId); } /// @@ -1428,7 +1428,7 @@ public TabInfo GetTabByName(string tabName, int portalId, int parentId) /// tab collection public IDictionary GetTabsByModuleID(int moduleID) { - return CBO.FillDictionary("TabID", _dataProvider.GetTabsByModuleID(moduleID)); + return CBO.FillDictionary("TabID", this._dataProvider.GetTabsByModuleID(moduleID)); } /// @@ -1438,7 +1438,7 @@ public IDictionary GetTabsByModuleID(int moduleID) /// tab collection public IDictionary GetTabsByTabModuleID(int tabModuleId) { - return CBO.FillDictionary("TabID", _dataProvider.GetTabsByTabModuleID(tabModuleId)); + return CBO.FillDictionary("TabID", this._dataProvider.GetTabsByTabModuleID(tabModuleId)); } /// @@ -1450,7 +1450,7 @@ public IDictionary GetTabsByTabModuleID(int tabModuleId) /// tab collection public IDictionary GetTabsByPackageID(int portalID, int packageID, bool forHost) { - return CBO.FillDictionary("TabID", _dataProvider.GetTabsByPackageID(portalID, packageID, forHost)); + return CBO.FillDictionary("TabID", this._dataProvider.GetTabsByPackageID(portalID, packageID, forHost)); } /// @@ -1466,7 +1466,7 @@ public TabCollection GetTabsByPortal(int portalId) DataCache.TabCachePriority), c => { - List tabs = CBO.FillCollection(_dataProvider.GetTabs(portalId)); + List tabs = CBO.FillCollection(this._dataProvider.GetTabs(portalId)); return new TabCollection(tabs); }); } @@ -1480,7 +1480,7 @@ public TabCollection GetTabsByPortal(int portalId) /// public TabCollection GetUserTabsByPortal(int portalId) { - var tabs = GetTabsByPortal(portalId); + var tabs = this.GetTabsByPortal(portalId); var portal = PortalController.Instance.GetPortal(portalId); IEnumerable filteredList = from tab in tabs @@ -1503,7 +1503,7 @@ public Hashtable GetTabSettings(int tabId) { var portalId = GetPortalId(tabId, -1); Hashtable settings; - if (!GetTabSettingsByPortal(portalId).TryGetValue(tabId, out settings)) + if (!this.GetTabSettingsByPortal(portalId).TryGetValue(tabId, out settings)) { settings = new Hashtable(); } @@ -1519,7 +1519,7 @@ public Hashtable GetTabSettings(int tabId) public List GetTabUrls(int tabId, int portalId) { //Get the Portal TabUrl Dictionary - Dictionary> dicTabUrls = GetTabUrls(portalId); + Dictionary> dicTabUrls = this.GetTabUrls(portalId); //Get the Collection from the Dictionary List tabRedirects; @@ -1574,7 +1574,7 @@ public void GiveTranslatorRoleEditRights(TabInfo localizedTab, Dictionary public bool HasMissingLanguages(int portalId, int tabId) { - var currentTab = GetTab(tabId, portalId, false); + var currentTab = this.GetTab(tabId, portalId, false); var workingTab = currentTab; var locales = LocaleController.Instance.GetLocales(portalId); var LocaleCount = locales.Count; @@ -1644,7 +1644,7 @@ public bool IsTabPublished(TabInfo publishTab) /// The locale. public void LocalizeTab(TabInfo originalTab, Locale locale) { - LocalizeTab(originalTab, locale, true); + this.LocalizeTab(originalTab, locale, true); } /// @@ -1655,7 +1655,7 @@ public void LocalizeTab(TabInfo originalTab, Locale locale) /// public void LocalizeTab(TabInfo originalTab, Locale locale, bool clearCache) { - _dataProvider.LocalizeTab(originalTab.TabID, locale.Code, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataProvider.LocalizeTab(originalTab.TabID, locale.Code, UserController.Instance.GetCurrentUserInfo().UserID); if (clearCache) { DataCache.ClearTabsCache(originalTab.PortalID); @@ -1671,22 +1671,22 @@ public void LocalizeTab(TabInfo originalTab, Locale locale, bool clearCache) public void MoveTabAfter(TabInfo tab, int afterTabId) { //Get AfterTab - var afterTab = GetTab(afterTabId, tab.PortalID, false); + var afterTab = this.GetTab(afterTabId, tab.PortalID, false); //Create Tab Redirects if (afterTab.ParentId != tab.ParentId) { - CreateTabRedirects(tab); + this.CreateTabRedirects(tab); } //Move Tab - _dataProvider.MoveTabAfter(tab.TabID, afterTabId, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataProvider.MoveTabAfter(tab.TabID, afterTabId, UserController.Instance.GetCurrentUserInfo().UserID); //Clear the Cache - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); var portalId = GetPortalId(tab.TabID, -1); - var updatedTab = GetTab(tab.TabID, portalId, true); + var updatedTab = this.GetTab(tab.TabID, portalId, true); EventManager.Instance.OnTabUpdated(new TabEventArgs { Tab = updatedTab }); } @@ -1698,22 +1698,22 @@ public void MoveTabAfter(TabInfo tab, int afterTabId) public void MoveTabBefore(TabInfo tab, int beforeTabId) { //Get AfterTab - var beforeTab = GetTab(beforeTabId, tab.PortalID, false); + var beforeTab = this.GetTab(beforeTabId, tab.PortalID, false); //Create Tab Redirects if (beforeTab.ParentId != tab.ParentId) { - CreateTabRedirects(tab); + this.CreateTabRedirects(tab); } //Move Tab - _dataProvider.MoveTabBefore(tab.TabID, beforeTabId, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataProvider.MoveTabBefore(tab.TabID, beforeTabId, UserController.Instance.GetCurrentUserInfo().UserID); //Clear the Cache - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); var portalId = GetPortalId(tab.TabID, -1); - var updatedTab = GetTab(tab.TabID, portalId, true); + var updatedTab = this.GetTab(tab.TabID, portalId, true); EventManager.Instance.OnTabUpdated(new TabEventArgs { Tab = updatedTab }); } @@ -1727,17 +1727,17 @@ public void MoveTabToParent(TabInfo tab, int parentId) //Create Tab Redirects if (parentId != tab.ParentId) { - CreateTabRedirects(tab); + this.CreateTabRedirects(tab); } //Move Tab - _dataProvider.MoveTabToParent(tab.TabID, parentId, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataProvider.MoveTabToParent(tab.TabID, parentId, UserController.Instance.GetCurrentUserInfo().UserID); //Clear the Cache - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); var portalId = GetPortalId(tab.TabID, -1); - var updatedTab = GetTab(tab.TabID, portalId, true); + var updatedTab = this.GetTab(tab.TabID, portalId, true); EventManager.Instance.OnTabUpdated(new TabEventArgs { Tab = updatedTab }); } @@ -1750,7 +1750,7 @@ public void PopulateBreadCrumbs(ref TabInfo tab) if ((tab.BreadCrumbs == null)) { var crumbs = new ArrayList(); - PopulateBreadCrumbs(tab.PortalID, ref crumbs, tab.TabID); + this.PopulateBreadCrumbs(tab.PortalID, ref crumbs, tab.TabID); tab.BreadCrumbs = crumbs; } } @@ -1765,8 +1765,8 @@ public void PopulateBreadCrumbs(int portalID, ref ArrayList breadCrumbs, int tab { //find the tab in the tabs collection TabInfo tab; - TabCollection portalTabs = GetTabsByPortal(portalID); - TabCollection hostTabs = GetTabsByPortal(Null.NullInteger); + TabCollection portalTabs = this.GetTabsByPortal(portalID); + TabCollection hostTabs = this.GetTabsByPortal(Null.NullInteger); bool found = portalTabs.TryGetValue(tabID, out tab); if (!found) { @@ -1780,7 +1780,7 @@ public void PopulateBreadCrumbs(int portalID, ref ArrayList breadCrumbs, int tab //get the tab parent if (!Null.IsNull(tab.ParentId)) { - PopulateBreadCrumbs(portalID, ref breadCrumbs, tab.ParentId); + this.PopulateBreadCrumbs(portalID, ref breadCrumbs, tab.ParentId); } } } @@ -1824,7 +1824,7 @@ public void PublishTabs(List tabs) { if (t.IsTranslated) { - PublishTab(t); + this.PublishTab(t); } } } @@ -1839,18 +1839,18 @@ public void RestoreTab(TabInfo tab, PortalSettings portalSettings) if (tab.DefaultLanguageTab != null) { //We are trying to restore the child, so recall this function with the master language's tab id - RestoreTab(tab.DefaultLanguageTab, portalSettings); + this.RestoreTab(tab.DefaultLanguageTab, portalSettings); return; } tab.IsDeleted = false; - UpdateTab(tab); + this.UpdateTab(tab); //Restore any localized children foreach (TabInfo localizedtab in tab.LocalizedTabs.Values) { localizedtab.IsDeleted = false; - UpdateTab(localizedtab); + this.UpdateTab(localizedtab); } EventLogController.Instance.AddLog(tab, portalSettings, portalSettings.UserId, "", EventLogController.EventLogType.TAB_RESTORED); @@ -1865,7 +1865,7 @@ public void RestoreTab(TabInfo tab, PortalSettings portalSettings) } } - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); EventManager.Instance.OnTabRestored(new TabEventArgs { Tab = tab }); } @@ -1892,7 +1892,7 @@ public void SaveTabUrl(TabUrlInfo tabUrl, int portalId, bool clearCache) else { //need to see if sequence number exists to decide if insert or update - List t = GetTabUrls(portalId, tabUrl.TabId); + List t = this.GetTabUrls(portalId, tabUrl.TabId); var existingSeq = t.FirstOrDefault(r => r.SeqNum == tabUrl.SeqNum); if (existingSeq == null) { @@ -1912,8 +1912,8 @@ public void SaveTabUrl(TabUrlInfo tabUrl, int portalId, bool clearCache) { DataCache.RemoveCache(String.Format(DataCache.TabUrlCacheKey, portalId)); CacheController.ClearCustomAliasesCache(); - ClearCache(portalId); - var tab = GetTab(tabUrl.TabId, portalId); + this.ClearCache(portalId); + var tab = this.GetTab(tabUrl.TabId, portalId); tab.ClearTabUrls(); } } @@ -1927,24 +1927,24 @@ public void SaveTabUrl(TabUrlInfo tabUrl, int portalId, bool clearCache) public bool SoftDeleteTab(int tabId, PortalSettings portalSettings) { bool deleted; - TabInfo tab = GetTab(tabId, portalSettings.PortalId, false); + TabInfo tab = this.GetTab(tabId, portalSettings.PortalId, false); if (tab != null) { if (tab.DefaultLanguageTab != null && LocaleController.Instance.GetLocales(portalSettings.PortalId).ContainsKey(tab.CultureCode)) { //We are trying to delete the child, so recall this function with the master language's tab id - return SoftDeleteTab(tab.DefaultLanguageTab.TabID, portalSettings); + return this.SoftDeleteTab(tab.DefaultLanguageTab.TabID, portalSettings); } //Delete the Tab - deleted = SoftDeleteTabInternal(tab, portalSettings); + deleted = this.SoftDeleteTabInternal(tab, portalSettings); //Delete any localized children if (deleted) { foreach (TabInfo localizedtab in tab.LocalizedTabs.Values) { - SoftDeleteTabInternal(localizedtab, portalSettings); + this.SoftDeleteTabInternal(localizedtab, portalSettings); } } } @@ -1961,29 +1961,29 @@ public bool SoftDeleteTab(int tabId, PortalSettings portalSettings) /// The updated tab. public void UpdateTab(TabInfo updatedTab) { - TabInfo originalTab = GetTab(updatedTab.TabID, updatedTab.PortalID, true); + TabInfo originalTab = this.GetTab(updatedTab.TabID, updatedTab.PortalID, true); //Update ContentItem If neccessary if (updatedTab.TabID != Null.NullInteger) { if (updatedTab.ContentItemId == Null.NullInteger) { - CreateContentItem(updatedTab); + this.CreateContentItem(updatedTab); } else { - UpdateContentItem(updatedTab); + this.UpdateContentItem(updatedTab); } } //Create Tab Redirects if (originalTab.ParentId != updatedTab.ParentId || originalTab.TabName != updatedTab.TabName) { - CreateTabRedirects(updatedTab); + this.CreateTabRedirects(updatedTab); } //Update Tab to DataStore - _dataProvider.UpdateTab(updatedTab.TabID, + this._dataProvider.UpdateTab(updatedTab.TabID, updatedTab.ContentItemId, updatedTab.PortalID, updatedTab.VersionGuid, @@ -2032,7 +2032,7 @@ public void UpdateTab(TabInfo updatedTab) //Update TabSettings - use Try/catch as tabs are added during upgrade ptocess and the sproc may not exist try { - UpdateTabSettings(ref updatedTab); + this.UpdateTabSettings(ref updatedTab); } catch (Exception ex) { @@ -2043,10 +2043,10 @@ public void UpdateTab(TabInfo updatedTab) UpdateTabVersion(updatedTab.TabID); //Clear Tab Caches - ClearCache(updatedTab.PortalID); + this.ClearCache(updatedTab.PortalID); if (updatedTab.PortalID != originalTab.PortalID) { - ClearCache(originalTab.PortalID); + this.ClearCache(originalTab.PortalID); } EventManager.Instance.OnTabUpdated(new TabEventArgs { Tab = updatedTab }); @@ -2061,7 +2061,7 @@ public void UpdateTab(TabInfo updatedTab) /// empty SettingValue will remove the setting, if not preserveIfEmpty is true public void UpdateTabSetting(int tabId, string settingName, string settingValue) { - UpdateTabSettingInternal(tabId, settingName, settingValue, true); + this.UpdateTabSettingInternal(tabId, settingName, settingValue, true); } /// @@ -2084,7 +2084,7 @@ public void UpdateTranslationStatus(TabInfo localizedTab, bool isTranslated) UserController.Instance.GetCurrentUserInfo().UserID); //Clear Tab Caches - ClearCache(localizedTab.PortalID); + this.ClearCache(localizedTab.PortalID); } /// @@ -2093,10 +2093,10 @@ public void UpdateTranslationStatus(TabInfo localizedTab, bool isTranslated) /// The Tab to be marked public void MarkAsPublished(TabInfo tab) { - _dataProvider.MarkAsPublished(tab.TabID); + this._dataProvider.MarkAsPublished(tab.TabID); //Clear Tab Caches - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); EventManager.Instance.OnTabMarkedAsPublished(new TabEventArgs { Tab = tab }); } @@ -2715,7 +2715,7 @@ public static bool IsSpecialTab(int tabId, int portalId) /// public bool IsHostOrAdminPage(TabInfo tab) { - return IsHostTab(tab) || IsAdminTab(tab); + return this.IsHostTab(tab) || this.IsAdminTab(tab); } /// diff --git a/DNN Platform/Library/Entities/Tabs/TabException.cs b/DNN Platform/Library/Entities/Tabs/TabException.cs index d872498ec40..8a81ce735c8 100644 --- a/DNN Platform/Library/Entities/Tabs/TabException.cs +++ b/DNN Platform/Library/Entities/Tabs/TabException.cs @@ -14,7 +14,7 @@ public class TabException : Exception { public TabException(int tabId, string message) : base(message) { - TabId = tabId; + this.TabId = tabId; } public int TabId { get; private set; } diff --git a/DNN Platform/Library/Entities/Tabs/TabInfo.cs b/DNN Platform/Library/Entities/Tabs/TabInfo.cs index 6a0b615881f..a1cc8501377 100644 --- a/DNN Platform/Library/Entities/Tabs/TabInfo.cs +++ b/DNN Platform/Library/Entities/Tabs/TabInfo.cs @@ -76,44 +76,44 @@ public TabInfo() private TabInfo(SharedDictionary localizedTabNameDictionary, SharedDictionary fullUrlDictionary) { - _localizedTabNameDictionary = localizedTabNameDictionary; - _fullUrlDictionary = fullUrlDictionary; - - PortalID = Null.NullInteger; - _authorizedRoles = Null.NullString; - ParentId = Null.NullInteger; - IconFile = Null.NullString; - IconFileLarge = Null.NullString; - _administratorRoles = Null.NullString; - Title = Null.NullString; - Description = Null.NullString; - KeyWords = Null.NullString; - Url = Null.NullString; - SkinSrc = Null.NullString; - _skinDoctype = Null.NullString; - ContainerSrc = Null.NullString; - TabPath = Null.NullString; - StartDate = Null.NullDate; - EndDate = Null.NullDate; - RefreshInterval = Null.NullInteger; - PageHeadText = Null.NullString; - SiteMapPriority = 0.5F; + this._localizedTabNameDictionary = localizedTabNameDictionary; + this._fullUrlDictionary = fullUrlDictionary; + + this.PortalID = Null.NullInteger; + this._authorizedRoles = Null.NullString; + this.ParentId = Null.NullInteger; + this.IconFile = Null.NullString; + this.IconFileLarge = Null.NullString; + this._administratorRoles = Null.NullString; + this.Title = Null.NullString; + this.Description = Null.NullString; + this.KeyWords = Null.NullString; + this.Url = Null.NullString; + this.SkinSrc = Null.NullString; + this._skinDoctype = Null.NullString; + this.ContainerSrc = Null.NullString; + this.TabPath = Null.NullString; + this.StartDate = Null.NullDate; + this.EndDate = Null.NullDate; + this.RefreshInterval = Null.NullInteger; + this.PageHeadText = Null.NullString; + this.SiteMapPriority = 0.5F; //UniqueId, Version Guid, and Localized Version Guid should be initialised to a new value - UniqueId = Guid.NewGuid(); - VersionGuid = Guid.NewGuid(); - LocalizedVersionGuid = Guid.NewGuid(); + this.UniqueId = Guid.NewGuid(); + this.VersionGuid = Guid.NewGuid(); + this.LocalizedVersionGuid = Guid.NewGuid(); //Default Language Guid should be initialised to a null Guid - DefaultLanguageGuid = Null.NullGuid; + this.DefaultLanguageGuid = Null.NullGuid; - IsVisible = true; - HasBeenPublished = true; - DisableLink = false; + this.IsVisible = true; + this.HasBeenPublished = true; + this.DisableLink = false; - Panes = new ArrayList(); + this.Panes = new ArrayList(); - IsSystem = false; + this.IsSystem = false; } #endregion @@ -172,7 +172,7 @@ private TabInfo(SharedDictionary localizedTabNameDictionary, Sha public bool HasAVisibleVersion { get { - return HasBeenPublished || TabVersionUtils.CanSeeVersionedPages(this); + return this.HasBeenPublished || TabVersionUtils.CanSeeVersionedPages(this); } } @@ -190,11 +190,11 @@ public ArrayList Modules { get { - return _modules ?? (_modules = TabModulesController.Instance.GetTabModules(this)); + return this._modules ?? (this._modules = TabModulesController.Instance.GetTabModules(this)); } set { - _modules = value; + this._modules = value; } } @@ -255,7 +255,7 @@ public Dictionary ChildModules { get { - return ModuleController.Instance.GetTabModules(TabID); + return ModuleController.Instance.GetTabModules(this.TabID); } } @@ -264,11 +264,11 @@ public TabInfo DefaultLanguageTab { get { - if (_defaultLanguageTab == null && (!DefaultLanguageGuid.Equals(Null.NullGuid))) + if (this._defaultLanguageTab == null && (!this.DefaultLanguageGuid.Equals(Null.NullGuid))) { - _defaultLanguageTab = (from kvp in TabController.Instance.GetTabsByPortal(PortalID) where kvp.Value.UniqueId == DefaultLanguageGuid select kvp.Value).SingleOrDefault(); + this._defaultLanguageTab = (from kvp in TabController.Instance.GetTabsByPortal(this.PortalID) where kvp.Value.UniqueId == this.DefaultLanguageGuid select kvp.Value).SingleOrDefault(); } - return _defaultLanguageTab; + return this._defaultLanguageTab; } } @@ -278,9 +278,9 @@ public bool DoNotRedirect get { bool doNotRedirect; - if (TabSettings.ContainsKey("DoNotRedirect") && !string.IsNullOrEmpty(TabSettings["DoNotRedirect"].ToString())) + if (this.TabSettings.ContainsKey("DoNotRedirect") && !string.IsNullOrEmpty(this.TabSettings["DoNotRedirect"].ToString())) { - doNotRedirect = bool.Parse(TabSettings["DoNotRedirect"].ToString()); + doNotRedirect = bool.Parse(this.TabSettings["DoNotRedirect"].ToString()); } else { @@ -295,14 +295,14 @@ public string IconFile { get { - IconFileGetter(ref _iconFile, IconFileRaw); - return _iconFile; + this.IconFileGetter(ref this._iconFile, this.IconFileRaw); + return this._iconFile; } set { - IconFileRaw = value; - _iconFile = null; + this.IconFileRaw = value; + this._iconFile = null; } } @@ -311,14 +311,14 @@ public string IconFileLarge { get { - IconFileGetter(ref _iconFileLarge, IconFileLargeRaw); - return _iconFileLarge; + this.IconFileGetter(ref this._iconFileLarge, this.IconFileLargeRaw); + return this._iconFileLarge; } set { - IconFileLargeRaw = value; - _iconFileLarge = null; + this.IconFileLargeRaw = value; + this._iconFileLarge = null; } } @@ -328,11 +328,11 @@ public string IndentedTabName get { string indentedTabName = Null.NullString; - for (int intCounter = 1; intCounter <= Level; intCounter++) + for (int intCounter = 1; intCounter <= this.Level; intCounter++) { indentedTabName += "..."; } - indentedTabName += LocalizedTabName; + indentedTabName += this.LocalizedTabName; return indentedTabName; } } @@ -342,7 +342,7 @@ public bool IsDefaultLanguage { get { - return (DefaultLanguageGuid == Null.NullGuid); + return (this.DefaultLanguageGuid == Null.NullGuid); } } @@ -351,7 +351,7 @@ public bool IsNeutralCulture { get { - return string.IsNullOrEmpty(CultureCode); + return string.IsNullOrEmpty(this.CultureCode); } } @@ -360,16 +360,16 @@ public bool IsSuperTab { get { - if (_superTabIdSet) + if (this._superTabIdSet) { - return _isSuperTab; + return this._isSuperTab; } - return (PortalID == Null.NullInteger); + return (this.PortalID == Null.NullInteger); } set { - _isSuperTab = value; - _superTabIdSet = true; + this._isSuperTab = value; + this._superTabIdSet = true; } } @@ -379,10 +379,10 @@ public bool IsTranslated get { bool isTranslated = true; - if (DefaultLanguageTab != null) + if (this.DefaultLanguageTab != null) { //Child language - isTranslated = (LocalizedVersionGuid == DefaultLanguageTab.LocalizedVersionGuid); + isTranslated = (this.LocalizedVersionGuid == this.DefaultLanguageTab.LocalizedVersionGuid); } return isTranslated; } @@ -393,11 +393,11 @@ public override int KeyID { get { - return TabID; + return this.TabID; } set { - TabID = value; + this.TabID = value; } } @@ -406,28 +406,28 @@ public string LocalizedTabName { get { - if (String.IsNullOrEmpty(TabPath)) return TabName; + if (String.IsNullOrEmpty(this.TabPath)) return this.TabName; var key = Thread.CurrentThread.CurrentUICulture.ToString(); string localizedTabName; - using (_localizedTabNameDictionary.GetReadLock()) + using (this._localizedTabNameDictionary.GetReadLock()) { - _localizedTabNameDictionary.TryGetValue(key, out localizedTabName); + this._localizedTabNameDictionary.TryGetValue(key, out localizedTabName); } if (String.IsNullOrEmpty(localizedTabName)) { - using (_localizedTabNameDictionary.GetWriteLock()) + using (this._localizedTabNameDictionary.GetWriteLock()) { - localizedTabName = Localization.GetString(TabPath + ".String", Localization.GlobalResourceFile, true); + localizedTabName = Localization.GetString(this.TabPath + ".String", Localization.GlobalResourceFile, true); if (string.IsNullOrEmpty(localizedTabName)) { - localizedTabName = TabName; + localizedTabName = this.TabName; } - if (!_localizedTabNameDictionary.ContainsKey(key)) + if (!this._localizedTabNameDictionary.ContainsKey(key)) { - _localizedTabNameDictionary.Add(key, localizedTabName.Trim()); + this._localizedTabNameDictionary.Add(key, localizedTabName.Trim()); } } } @@ -441,14 +441,14 @@ public Dictionary LocalizedTabs { get { - if (_localizedTabs == null) + if (this._localizedTabs == null) { - _localizedTabs = - (from kvp in TabController.Instance.GetTabsByPortal(PortalID) - where kvp.Value.DefaultLanguageGuid == UniqueId && LocaleController.Instance.GetLocale(PortalID, kvp.Value.CultureCode) != null + this._localizedTabs = + (from kvp in TabController.Instance.GetTabsByPortal(this.PortalID) + where kvp.Value.DefaultLanguageGuid == this.UniqueId && LocaleController.Instance.GetLocale(this.PortalID, kvp.Value.CultureCode) != null select kvp.Value).ToDictionary(t => t.CultureCode); } - return _localizedTabs; + return this._localizedTabs; } } @@ -457,19 +457,19 @@ public string SkinDoctype { get { - if (string.IsNullOrEmpty(SkinSrc) == false && string.IsNullOrEmpty(_skinDoctype)) + if (string.IsNullOrEmpty(this.SkinSrc) == false && string.IsNullOrEmpty(this._skinDoctype)) { - _skinDoctype = CheckIfDoctypeConfigExists(); - if (string.IsNullOrEmpty(_skinDoctype)) + this._skinDoctype = this.CheckIfDoctypeConfigExists(); + if (string.IsNullOrEmpty(this._skinDoctype)) { - _skinDoctype = Host.Host.DefaultDocType; + this._skinDoctype = Host.Host.DefaultDocType; } } - return _skinDoctype; + return this._skinDoctype; } set { - _skinDoctype = value; + this._skinDoctype = value; } } @@ -478,7 +478,7 @@ public TabPermissionCollection TabPermissions { get { - return _permissions ?? (_permissions = new TabPermissionCollection(TabPermissionController.GetTabPermissions(TabID, PortalID))); + return this._permissions ?? (this._permissions = new TabPermissionCollection(TabPermissionController.GetTabPermissions(this.TabID, this.PortalID))); } } @@ -487,7 +487,7 @@ public Hashtable TabSettings { get { - return _settings ?? (_settings = (TabID == Null.NullInteger) ? new Hashtable() : TabController.Instance.GetTabSettings(TabID)); + return this._settings ?? (this._settings = (this.TabID == Null.NullInteger) ? new Hashtable() : TabController.Instance.GetTabSettings(this.TabID)); } } @@ -496,7 +496,7 @@ public TabType TabType { get { - return Globals.GetURLType(Url); + return Globals.GetURLType(this.Url); } } @@ -509,7 +509,7 @@ public List AliasSkins { get { - return _aliasSkins ?? (_aliasSkins = (TabID == Null.NullInteger) ? new List() : TabController.Instance.GetAliasSkins(TabID, PortalID)); + return this._aliasSkins ?? (this._aliasSkins = (this.TabID == Null.NullInteger) ? new List() : TabController.Instance.GetAliasSkins(this.TabID, this.PortalID)); } } @@ -518,7 +518,7 @@ public Dictionary CustomAliases { get { - return _customAliases ?? (_customAliases = (TabID == Null.NullInteger) ? new Dictionary() : TabController.Instance.GetCustomAliases(TabID, PortalID)); + return this._customAliases ?? (this._customAliases = (this.TabID == Null.NullInteger) ? new Dictionary() : TabController.Instance.GetCustomAliases(this.TabID, this.PortalID)); } } @@ -531,40 +531,40 @@ public string FullUrl Thread.CurrentThread.CurrentCulture); string fullUrl; - using (_fullUrlDictionary.GetReadLock()) + using (this._fullUrlDictionary.GetReadLock()) { - _fullUrlDictionary.TryGetValue(key, out fullUrl); + this._fullUrlDictionary.TryGetValue(key, out fullUrl); } if (String.IsNullOrEmpty(fullUrl)) { - using (_fullUrlDictionary.GetWriteLock()) + using (this._fullUrlDictionary.GetWriteLock()) { - switch (TabType) + switch (this.TabType) { case TabType.Normal: //normal tab - fullUrl = TestableGlobals.Instance.NavigateURL(TabID, IsSuperTab); + fullUrl = TestableGlobals.Instance.NavigateURL(this.TabID, this.IsSuperTab); break; case TabType.Tab: //alternate tab url - fullUrl = TestableGlobals.Instance.NavigateURL(Convert.ToInt32(Url)); + fullUrl = TestableGlobals.Instance.NavigateURL(Convert.ToInt32(this.Url)); break; case TabType.File: //file url - fullUrl = TestableGlobals.Instance.LinkClick(Url, TabID, Null.NullInteger); + fullUrl = TestableGlobals.Instance.LinkClick(this.Url, this.TabID, Null.NullInteger); break; case TabType.Url: //external url - fullUrl = Url; + fullUrl = this.Url; break; } - if (!_fullUrlDictionary.ContainsKey(key)) + if (!this._fullUrlDictionary.ContainsKey(key)) { if (fullUrl != null) { - _fullUrlDictionary.Add(key, fullUrl.Trim()); + this._fullUrlDictionary.Add(key, fullUrl.Trim()); } } } @@ -585,7 +585,7 @@ public List TabUrls { get { - return _tabUrls ?? (_tabUrls = (TabID == Null.NullInteger) ? new List() : TabController.Instance.GetTabUrls(TabID, PortalID)); + return this._tabUrls ?? (this._tabUrls = (this.TabID == Null.NullInteger) ? new List() : TabController.Instance.GetTabUrls(this.TabID, this.PortalID)); } } @@ -621,136 +621,136 @@ public string GetProperty(string propertyName, string format, CultureInfo format { case "tabid": propertyNotFound = false; - result = (TabID.ToString(outputFormat, formatProvider)); + result = (this.TabID.ToString(outputFormat, formatProvider)); break; case "taborder": isPublic = false; propertyNotFound = false; - result = (TabOrder.ToString(outputFormat, formatProvider)); + result = (this.TabOrder.ToString(outputFormat, formatProvider)); break; case "portalid": propertyNotFound = false; - result = (PortalID.ToString(outputFormat, formatProvider)); + result = (this.PortalID.ToString(outputFormat, formatProvider)); break; case "tabname": propertyNotFound = false; - result = PropertyAccess.FormatString(LocalizedTabName, format); + result = PropertyAccess.FormatString(this.LocalizedTabName, format); break; case "isvisible": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsVisible, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsVisible, formatProvider)); break; case "parentid": isPublic = false; propertyNotFound = false; - result = (ParentId.ToString(outputFormat, formatProvider)); + result = (this.ParentId.ToString(outputFormat, formatProvider)); break; case "level": isPublic = false; propertyNotFound = false; - result = (Level.ToString(outputFormat, formatProvider)); + result = (this.Level.ToString(outputFormat, formatProvider)); break; case "iconfile": propertyNotFound = false; - result = PropertyAccess.FormatString(IconFile, format); + result = PropertyAccess.FormatString(this.IconFile, format); break; case "iconfilelarge": propertyNotFound = false; - result = PropertyAccess.FormatString(IconFileLarge, format); + result = PropertyAccess.FormatString(this.IconFileLarge, format); break; case "disablelink": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(DisableLink, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.DisableLink, formatProvider)); break; case "title": propertyNotFound = false; - result = PropertyAccess.FormatString(Title, format); + result = PropertyAccess.FormatString(this.Title, format); break; case "description": propertyNotFound = false; - result = PropertyAccess.FormatString(Description, format); + result = PropertyAccess.FormatString(this.Description, format); break; case "keywords": propertyNotFound = false; - result = PropertyAccess.FormatString(KeyWords, format); + result = PropertyAccess.FormatString(this.KeyWords, format); break; case "isdeleted": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsDeleted, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsDeleted, formatProvider)); break; case "url": propertyNotFound = false; - result = PropertyAccess.FormatString(Url, format); + result = PropertyAccess.FormatString(this.Url, format); break; case "skinsrc": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(SkinSrc, format); + result = PropertyAccess.FormatString(this.SkinSrc, format); break; case "containersrc": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(ContainerSrc, format); + result = PropertyAccess.FormatString(this.ContainerSrc, format); break; case "tabpath": propertyNotFound = false; - result = PropertyAccess.FormatString(TabPath, format); + result = PropertyAccess.FormatString(this.TabPath, format); break; case "startdate": isPublic = false; propertyNotFound = false; - result = (StartDate.ToString(outputFormat, formatProvider)); + result = (this.StartDate.ToString(outputFormat, formatProvider)); break; case "enddate": isPublic = false; propertyNotFound = false; - result = (EndDate.ToString(outputFormat, formatProvider)); + result = (this.EndDate.ToString(outputFormat, formatProvider)); break; case "haschildren": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(HasChildren, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.HasChildren, formatProvider)); break; case "refreshinterval": isPublic = false; propertyNotFound = false; - result = (RefreshInterval.ToString(outputFormat, formatProvider)); + result = (this.RefreshInterval.ToString(outputFormat, formatProvider)); break; case "pageheadtext": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(PageHeadText, format); + result = PropertyAccess.FormatString(this.PageHeadText, format); break; case "skinpath": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(SkinPath, format); + result = PropertyAccess.FormatString(this.SkinPath, format); break; case "skindoctype": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(SkinDoctype, format); + result = PropertyAccess.FormatString(this.SkinDoctype, format); break; case "containerpath": isPublic = false; propertyNotFound = false; - result = PropertyAccess.FormatString(ContainerPath, format); + result = PropertyAccess.FormatString(this.ContainerPath, format); break; case "issupertab": isPublic = false; propertyNotFound = false; - result = (PropertyAccess.Boolean2LocalizedYesNo(IsSuperTab, formatProvider)); + result = (PropertyAccess.Boolean2LocalizedYesNo(this.IsSuperTab, formatProvider)); break; case "fullurl": propertyNotFound = false; - result = PropertyAccess.FormatString(FullUrl, format); + result = PropertyAccess.FormatString(this.FullUrl, format); break; case "sitemappriority": propertyNotFound = false; - result = PropertyAccess.FormatString(SiteMapPriority.ToString(), format); + result = PropertyAccess.FormatString(this.SiteMapPriority.ToString(), format); break; } if (!isPublic && currentScope != Scope.Debug) @@ -785,18 +785,18 @@ public CacheLevel Cacheability /// private string CheckIfDoctypeConfigExists() { - if (string.IsNullOrEmpty(SkinSrc)) + if (string.IsNullOrEmpty(this.SkinSrc)) return string.Empty; // loading an XML document from disk for each page request is expensive // let's implement some local caching - if (!_docTypeCache.ContainsKey(SkinSrc)) { + if (!_docTypeCache.ContainsKey(this.SkinSrc)) { // appply lock after IF, locking is more expensive than worst case scenario (check disk twice) _docTypeCacheLock.EnterWriteLock(); try { - var docType = LoadDocType(); - _docTypeCache[SkinSrc] = docType == null ? string.Empty : docType.FirstChild.InnerText; + var docType = this.LoadDocType(); + _docTypeCache[this.SkinSrc] = docType == null ? string.Empty : docType.FirstChild.InnerText; } catch (Exception ex) { Exceptions.LogException(ex); @@ -808,7 +808,7 @@ private string CheckIfDoctypeConfigExists() // return if file exists from cache _docTypeCacheLock.EnterReadLock(); try { - return _docTypeCache[SkinSrc]; + return _docTypeCache[this.SkinSrc]; } finally { _docTypeCacheLock.ExitReadLock(); } @@ -819,14 +819,14 @@ XmlDocument LoadDocType() var xmlSkinDocType = new XmlDocument { XmlResolver = null }; // default to the skinname.doctype.xml to allow the individual skin to override the skin package - var skinFileName = HttpContext.Current.Server.MapPath(SkinSrc.Replace(".ascx", ".doctype.xml")); + var skinFileName = HttpContext.Current.Server.MapPath(this.SkinSrc.Replace(".ascx", ".doctype.xml")); if (File.Exists(skinFileName)) { xmlSkinDocType.Load(skinFileName); return xmlSkinDocType; } // use the skin.doctype.xml file - var packageFileName = HttpContext.Current.Server.MapPath(SkinSrcRegex.Replace(SkinSrc, "skin.doctype.xml")); + var packageFileName = HttpContext.Current.Server.MapPath(SkinSrcRegex.Replace(this.SkinSrc, "skin.doctype.xml")); if (File.Exists(packageFileName)) { xmlSkinDocType.Load(packageFileName); @@ -839,11 +839,11 @@ XmlDocument LoadDocType() private void IconFileGetter(ref string iconFile, string iconRaw) { - if ((!String.IsNullOrEmpty(iconRaw) && iconRaw.StartsWith("~")) || PortalID == Null.NullInteger) + if ((!String.IsNullOrEmpty(iconRaw) && iconRaw.StartsWith("~")) || this.PortalID == Null.NullInteger) { iconFile = iconRaw; } - else if (iconFile == null && !String.IsNullOrEmpty(iconRaw) && PortalID != Null.NullInteger) + else if (iconFile == null && !String.IsNullOrEmpty(iconRaw) && this.PortalID != Null.NullInteger) { IFileInfo fileInfo; if (iconRaw.StartsWith("FileID=", StringComparison.InvariantCultureIgnoreCase)) @@ -853,7 +853,7 @@ private void IconFileGetter(ref string iconFile, string iconRaw) } else { - fileInfo = FileManager.Instance.GetFile(PortalID, iconRaw); + fileInfo = FileManager.Instance.GetFile(this.PortalID, iconRaw); } iconFile = fileInfo != null ? FileManager.Instance.GetUrl(fileInfo) : iconRaw; @@ -866,12 +866,12 @@ private void IconFileGetter(ref string iconFile, string iconRaw) internal void ClearTabUrls() { - _tabUrls = null; + this._tabUrls = null; } internal void ClearSettingsCache() { - _settings = null; + this._settings = null; } #endregion @@ -880,60 +880,60 @@ internal void ClearSettingsCache() public TabInfo Clone() { - var clonedTab = new TabInfo(_localizedTabNameDictionary, _fullUrlDictionary) - { - TabID = TabID, - TabOrder = TabOrder, - PortalID = PortalID, - TabName = TabName, - IsVisible = IsVisible, - HasBeenPublished = HasBeenPublished, - ParentId = ParentId, - Level = Level, - IconFile = IconFileRaw, - IconFileLarge = IconFileLargeRaw, - DisableLink = DisableLink, - Title = Title, - Description = Description, - KeyWords = KeyWords, - IsDeleted = IsDeleted, - Url = Url, - SkinSrc = SkinSrc, - ContainerSrc = ContainerSrc, - TabPath = TabPath, - StartDate = StartDate, - EndDate = EndDate, - HasChildren = HasChildren, - SkinPath = SkinPath, - ContainerPath = ContainerPath, - IsSuperTab = IsSuperTab, - RefreshInterval = RefreshInterval, - PageHeadText = PageHeadText, - IsSecure = IsSecure, - PermanentRedirect = PermanentRedirect, - IsSystem = IsSystem + var clonedTab = new TabInfo(this._localizedTabNameDictionary, this._fullUrlDictionary) + { + TabID = this.TabID, + TabOrder = this.TabOrder, + PortalID = this.PortalID, + TabName = this.TabName, + IsVisible = this.IsVisible, + HasBeenPublished = this.HasBeenPublished, + ParentId = this.ParentId, + Level = this.Level, + IconFile = this.IconFileRaw, + IconFileLarge = this.IconFileLargeRaw, + DisableLink = this.DisableLink, + Title = this.Title, + Description = this.Description, + KeyWords = this.KeyWords, + IsDeleted = this.IsDeleted, + Url = this.Url, + SkinSrc = this.SkinSrc, + ContainerSrc = this.ContainerSrc, + TabPath = this.TabPath, + StartDate = this.StartDate, + EndDate = this.EndDate, + HasChildren = this.HasChildren, + SkinPath = this.SkinPath, + ContainerPath = this.ContainerPath, + IsSuperTab = this.IsSuperTab, + RefreshInterval = this.RefreshInterval, + PageHeadText = this.PageHeadText, + IsSecure = this.IsSecure, + PermanentRedirect = this.PermanentRedirect, + IsSystem = this.IsSystem }; - if (BreadCrumbs != null) + if (this.BreadCrumbs != null) { clonedTab.BreadCrumbs = new ArrayList(); - foreach (TabInfo t in BreadCrumbs) + foreach (TabInfo t in this.BreadCrumbs) { clonedTab.BreadCrumbs.Add(t.Clone()); } } - Clone(clonedTab, this); + this.Clone(clonedTab, this); //localized properties - clonedTab.UniqueId = UniqueId; - clonedTab.VersionGuid = VersionGuid; - clonedTab.DefaultLanguageGuid = DefaultLanguageGuid; - clonedTab.LocalizedVersionGuid = LocalizedVersionGuid; - clonedTab.CultureCode = CultureCode; + clonedTab.UniqueId = this.UniqueId; + clonedTab.VersionGuid = this.VersionGuid; + clonedTab.DefaultLanguageGuid = this.DefaultLanguageGuid; + clonedTab.LocalizedVersionGuid = this.LocalizedVersionGuid; + clonedTab.CultureCode = this.CultureCode; clonedTab.Panes = new ArrayList(); - clonedTab.Modules = _modules; + clonedTab.Modules = this._modules; return clonedTab; } @@ -948,49 +948,49 @@ public override void Fill(IDataReader dr) { //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); - UniqueId = Null.SetNullGuid(dr["UniqueId"]); - VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); - DefaultLanguageGuid = Null.SetNullGuid(dr["DefaultLanguageGuid"]); - LocalizedVersionGuid = Null.SetNullGuid(dr["LocalizedVersionGuid"]); - CultureCode = Null.SetNullString(dr["CultureCode"]); - - TabOrder = Null.SetNullInteger(dr["TabOrder"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - TabName = Null.SetNullString(dr["TabName"]); - IsVisible = Null.SetNullBoolean(dr["IsVisible"]); - HasBeenPublished = Null.SetNullBoolean(dr["HasBeenPublished"]); - ParentId = Null.SetNullInteger(dr["ParentId"]); - Level = Null.SetNullInteger(dr["Level"]); - IconFile = Null.SetNullString(dr["IconFile"]); - IconFileLarge = Null.SetNullString(dr["IconFileLarge"]); - DisableLink = Null.SetNullBoolean(dr["DisableLink"]); - Title = Null.SetNullString(dr["Title"]); - Description = Null.SetNullString(dr["Description"]); - KeyWords = Null.SetNullString(dr["KeyWords"]); - IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]); - Url = Null.SetNullString(dr["Url"]); - SkinSrc = Null.SetNullString(dr["SkinSrc"]); - ContainerSrc = Null.SetNullString(dr["ContainerSrc"]); - TabPath = Null.SetNullString(dr["TabPath"]); - StartDate = Null.SetNullDateTime(dr["StartDate"]); - EndDate = Null.SetNullDateTime(dr["EndDate"]); - HasChildren = Null.SetNullBoolean(dr["HasChildren"]); - RefreshInterval = Null.SetNullInteger(dr["RefreshInterval"]); - PageHeadText = Null.SetNullString(dr["PageHeadText"]); - IsSecure = Null.SetNullBoolean(dr["IsSecure"]); - PermanentRedirect = Null.SetNullBoolean(dr["PermanentRedirect"]); - SiteMapPriority = Null.SetNullSingle(dr["SiteMapPriority"]); - BreadCrumbs = null; - Modules = null; - IsSystem = Null.SetNullBoolean(dr["IsSystem"]); + this.UniqueId = Null.SetNullGuid(dr["UniqueId"]); + this.VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); + this.DefaultLanguageGuid = Null.SetNullGuid(dr["DefaultLanguageGuid"]); + this.LocalizedVersionGuid = Null.SetNullGuid(dr["LocalizedVersionGuid"]); + this.CultureCode = Null.SetNullString(dr["CultureCode"]); + + this.TabOrder = Null.SetNullInteger(dr["TabOrder"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.TabName = Null.SetNullString(dr["TabName"]); + this.IsVisible = Null.SetNullBoolean(dr["IsVisible"]); + this.HasBeenPublished = Null.SetNullBoolean(dr["HasBeenPublished"]); + this.ParentId = Null.SetNullInteger(dr["ParentId"]); + this.Level = Null.SetNullInteger(dr["Level"]); + this.IconFile = Null.SetNullString(dr["IconFile"]); + this.IconFileLarge = Null.SetNullString(dr["IconFileLarge"]); + this.DisableLink = Null.SetNullBoolean(dr["DisableLink"]); + this.Title = Null.SetNullString(dr["Title"]); + this.Description = Null.SetNullString(dr["Description"]); + this.KeyWords = Null.SetNullString(dr["KeyWords"]); + this.IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]); + this.Url = Null.SetNullString(dr["Url"]); + this.SkinSrc = Null.SetNullString(dr["SkinSrc"]); + this.ContainerSrc = Null.SetNullString(dr["ContainerSrc"]); + this.TabPath = Null.SetNullString(dr["TabPath"]); + this.StartDate = Null.SetNullDateTime(dr["StartDate"]); + this.EndDate = Null.SetNullDateTime(dr["EndDate"]); + this.HasChildren = Null.SetNullBoolean(dr["HasChildren"]); + this.RefreshInterval = Null.SetNullInteger(dr["RefreshInterval"]); + this.PageHeadText = Null.SetNullString(dr["PageHeadText"]); + this.IsSecure = Null.SetNullBoolean(dr["IsSecure"]); + this.PermanentRedirect = Null.SetNullBoolean(dr["PermanentRedirect"]); + this.SiteMapPriority = Null.SetNullSingle(dr["SiteMapPriority"]); + this.BreadCrumbs = null; + this.Modules = null; + this.IsSystem = Null.SetNullBoolean(dr["IsSystem"]); } public string GetCurrentUrl(string cultureCode) { string url = null; - if (_tabUrls != null && _tabUrls.Count > 0) + if (this._tabUrls != null && this._tabUrls.Count > 0) { - TabUrlInfo tabUrl = _tabUrls.CurrentUrl(cultureCode); + TabUrlInfo tabUrl = this._tabUrls.CurrentUrl(cultureCode); if (tabUrl != null) { url = tabUrl.Url; @@ -1001,7 +1001,7 @@ public string GetCurrentUrl(string cultureCode) public string GetTags() { - return string.Join(",", Terms.Select(t => t.Name)); + return string.Join(",", this.Terms.Select(t => t.Name)); } #endregion diff --git a/DNN Platform/Library/Entities/Tabs/TabModulesController.cs b/DNN Platform/Library/Entities/Tabs/TabModulesController.cs index b061f774d6f..49e09787833 100644 --- a/DNN Platform/Library/Entities/Tabs/TabModulesController.cs +++ b/DNN Platform/Library/Entities/Tabs/TabModulesController.cs @@ -76,7 +76,7 @@ public Dictionary GetTabModuleSettingsByName(string settingName) public IList GetTabModuleIdsBySetting(string settingName, string expectedValue) { - var items = GetTabModuleSettingsByName(settingName); + var items = this.GetTabModuleSettingsByName(settingName); var matches = items.Where(e => e.Value.Equals(expectedValue, StringComparison.CurrentCultureIgnoreCase)); var keyValuePairs = matches as KeyValuePair[] ?? matches.ToArray(); if (keyValuePairs.Any()) diff --git a/DNN Platform/Library/Entities/Tabs/TabPublishingController.cs b/DNN Platform/Library/Entities/Tabs/TabPublishingController.cs index 83065dcc605..87ade1fd76f 100644 --- a/DNN Platform/Library/Entities/Tabs/TabPublishingController.cs +++ b/DNN Platform/Library/Entities/Tabs/TabPublishingController.cs @@ -25,7 +25,7 @@ public bool IsTabPublished(int tabID, int portalID) var allUsersRoleId = Int32.Parse(Globals.glbRoleAllUsers); var tab = TabController.Instance.GetTab(tabID, portalID); - var existPermission = GetAlreadyPermission(tab, "VIEW", allUsersRoleId); + var existPermission = this.GetAlreadyPermission(tab, "VIEW", allUsersRoleId); return existPermission != null && existPermission.AllowAccess; } @@ -42,11 +42,11 @@ public void SetTabPublishing(int tabID, int portalID, bool publish) if (publish) { - PublishTabInternal(tab); + this.PublishTabInternal(tab); } else { - UnpublishTabInternal(tab); + this.UnpublishTabInternal(tab); } } @@ -77,15 +77,15 @@ private void PublishTabInternal(TabInfo tab) { var allUsersRoleId = Int32.Parse(Globals.glbRoleAllUsers); - var existPermission = GetAlreadyPermission(tab, "VIEW", allUsersRoleId); + var existPermission = this.GetAlreadyPermission(tab, "VIEW", allUsersRoleId); if (existPermission != null) { tab.TabPermissions.Remove(existPermission); } - tab.TabPermissions.Add(GetTabPermissionByRole(tab.TabID, "VIEW", allUsersRoleId)); + tab.TabPermissions.Add(this.GetTabPermissionByRole(tab.TabID, "VIEW", allUsersRoleId)); TabPermissionController.SaveTabPermissions(tab); - ClearTabCache(tab); + this.ClearTabCache(tab); } private void UnpublishTabInternal(TabInfo tab) @@ -98,7 +98,7 @@ private void UnpublishTabInternal(TabInfo tab) tab.TabPermissions.Remove(tab.TabPermissions.Cast().SingleOrDefault(p => p.TabPermissionID == tabPermissionId)); } TabPermissionController.SaveTabPermissions(tab); - ClearTabCache(tab); + this.ClearTabCache(tab); } private void ClearTabCache(TabInfo tabInfo) diff --git a/DNN Platform/Library/Entities/Tabs/TabUrlInfo.cs b/DNN Platform/Library/Entities/Tabs/TabUrlInfo.cs index c7317a88710..b1ae6006392 100644 --- a/DNN Platform/Library/Entities/Tabs/TabUrlInfo.cs +++ b/DNN Platform/Library/Entities/Tabs/TabUrlInfo.cs @@ -16,7 +16,7 @@ public class TabUrlInfo public TabUrlInfo() { - PortalAliasUsage = PortalAliasUsageType.Default; + this.PortalAliasUsage = PortalAliasUsageType.Default; } #endregion diff --git a/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionBuilder.cs b/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionBuilder.cs index 73799a279ae..82fa5a3d98d 100644 --- a/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionBuilder.cs +++ b/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionBuilder.cs @@ -34,12 +34,12 @@ public class TabVersionBuilder : ServiceLocator m.Value.IsDeleted == false).Select(m => m.Value).ToArray(); + var tab = this._tabController.GetTab(tabId, portalId); + var modules = this._moduleController.GetTabModules(tabId).Where(m => m.Value.IsDeleted == false).Select(m => m.Value).ToArray(); // Check if the page has modules if (!modules.Any()) @@ -67,12 +67,12 @@ public void SetupFirstVersionForExistingTab(int portalId, int tabId) return; } - CreateFirstTabVersion(tabId, tab, modules); + this.CreateFirstTabVersion(tabId, tab, modules); } public void Publish(int portalId, int tabId, int createdByUserId) { - var tabVersion = GetUnPublishedVersion(tabId); + var tabVersion = this.GetUnPublishedVersion(tabId); if (tabVersion == null) { throw new InvalidOperationException(String.Format(Localization.GetString("TabHasNotAnUnpublishedVersion", Localization.ExceptionsResourceFile), tabId)); @@ -82,19 +82,19 @@ public void Publish(int portalId, int tabId, int createdByUserId) throw new InvalidOperationException(String.Format(Localization.GetString("TabVersionAlreadyPublished", Localization.ExceptionsResourceFile), tabId, tabVersion.Version)); } - var previousPublishVersion = GetCurrentVersion(tabId); - PublishVersion(portalId, tabId, createdByUserId, tabVersion); + var previousPublishVersion = this.GetCurrentVersion(tabId); + this.PublishVersion(portalId, tabId, createdByUserId, tabVersion); - if (!_tabVersionSettings.IsVersioningEnabled(portalId, tabId) + if (!this._tabVersionSettings.IsVersioningEnabled(portalId, tabId) && previousPublishVersion != null) { - ForceDeleteVersion(tabId, previousPublishVersion.Version); + this.ForceDeleteVersion(tabId, previousPublishVersion.Version); } } public void Discard(int tabId, int createdByUserId) { - var tabVersion = GetUnPublishedVersion(tabId); + var tabVersion = this.GetUnPublishedVersion(tabId); if (tabVersion == null) { throw new InvalidOperationException(String.Format(Localization.GetString("TabHasNotAnUnpublishedVersion", Localization.ExceptionsResourceFile), tabId)); @@ -103,105 +103,105 @@ public void Discard(int tabId, int createdByUserId) { throw new InvalidOperationException(String.Format(Localization.GetString("TabVersionAlreadyPublished", Localization.ExceptionsResourceFile), tabId, tabVersion.Version)); } - DiscardVersion(tabId, tabVersion); + this.DiscardVersion(tabId, tabVersion); } private void DiscardVersion(int tabId, TabVersion tabVersion) { - var unPublishedDetails = _tabVersionDetailController.GetTabVersionDetails(tabVersion.TabVersionId); + var unPublishedDetails = this._tabVersionDetailController.GetTabVersionDetails(tabVersion.TabVersionId); - var currentPublishedVersion = GetCurrentVersion(tabId); + var currentPublishedVersion = this.GetCurrentVersion(tabId); TabVersionDetail[] publishedChanges = null; if (currentPublishedVersion != null) { - publishedChanges = GetVersionModulesDetails(tabId, GetCurrentVersion(tabId).Version).ToArray(); + publishedChanges = this.GetVersionModulesDetails(tabId, this.GetCurrentVersion(tabId).Version).ToArray(); } foreach (var unPublishedDetail in unPublishedDetails) { if (publishedChanges == null) { - DiscardDetailWithoutPublishedTabVersions(tabId, unPublishedDetail); + this.DiscardDetailWithoutPublishedTabVersions(tabId, unPublishedDetail); } else { - DiscardDetailWithPublishedTabVersions(tabId, unPublishedDetail, publishedChanges); + this.DiscardDetailWithPublishedTabVersions(tabId, unPublishedDetail, publishedChanges); } } - _tabVersionController.DeleteTabVersion(tabId, tabVersion.TabVersionId); + this._tabVersionController.DeleteTabVersion(tabId, tabVersion.TabVersionId); } public void DeleteVersion(int tabId, int createdByUserId, int version) { - CheckVersioningEnabled(tabId); + this.CheckVersioningEnabled(tabId); - ForceDeleteVersion(tabId, version); + this.ForceDeleteVersion(tabId, version); } public TabVersion RollBackVesion(int tabId, int createdByUserId, int version) { - CheckVersioningEnabled(tabId); + this.CheckVersioningEnabled(tabId); - if (GetUnPublishedVersion(tabId) != null) + if (this.GetUnPublishedVersion(tabId) != null) { throw new InvalidOperationException(String.Format(Localization.GetString("TabVersionCannotBeRolledBack_UnpublishedVersionExists", Localization.ExceptionsResourceFile), tabId, version)); } - var lastTabVersion = _tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version).FirstOrDefault(); + var lastTabVersion = this._tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version).FirstOrDefault(); if (lastTabVersion == null || lastTabVersion.Version == version) { throw new InvalidOperationException(String.Format(Localization.GetString("TabVersionCannotBeRolledBack_LastVersion", Localization.ExceptionsResourceFile), tabId, version)); } - var publishedDetails = GetVersionModulesDetails(tabId, lastTabVersion.Version).ToArray(); + var publishedDetails = this.GetVersionModulesDetails(tabId, lastTabVersion.Version).ToArray(); - var rollbackDetails = CopyVersionDetails(GetVersionModulesDetails(tabId, version)).ToArray(); - var newVersion = CreateNewVersion(tabId, createdByUserId); + var rollbackDetails = this.CopyVersionDetails(this.GetVersionModulesDetails(tabId, version)).ToArray(); + var newVersion = this.CreateNewVersion(tabId, createdByUserId); //Save Reset detail - _tabVersionDetailController.SaveTabVersionDetail(GetResetTabVersionDetail(newVersion), createdByUserId); + this._tabVersionDetailController.SaveTabVersionDetail(this.GetResetTabVersionDetail(newVersion), createdByUserId); foreach (var rollbackDetail in rollbackDetails) { rollbackDetail.TabVersionId = newVersion.TabVersionId; try { - rollbackDetail.ModuleVersion = RollBackDetail(tabId, rollbackDetail); + rollbackDetail.ModuleVersion = this.RollBackDetail(tabId, rollbackDetail); } catch (DnnTabVersionException e) { Logger.Error(string.Format("There was a problem making rollbak of the module {0}. Message: {1}.", rollbackDetail.ModuleId, e.Message)); continue; } - _tabVersionDetailController.SaveTabVersionDetail(rollbackDetail, createdByUserId); + this._tabVersionDetailController.SaveTabVersionDetail(rollbackDetail, createdByUserId); //Check if restoring version contains modules to restore if (publishedDetails.All(tv => tv.ModuleId != rollbackDetail.ModuleId)) { - RestoreModuleInfo(tabId, rollbackDetail); + this.RestoreModuleInfo(tabId, rollbackDetail); } else { - UpdateModuleOrder(tabId, rollbackDetail); + this.UpdateModuleOrder(tabId, rollbackDetail); } } //Check if current version contains modules not existing in restoring version foreach (var publishedDetail in publishedDetails.Where(publishedDetail => rollbackDetails.All(tvd => tvd.ModuleId != publishedDetail.ModuleId))) { - _moduleController.DeleteTabModule(tabId, publishedDetail.ModuleId, true); + this._moduleController.DeleteTabModule(tabId, publishedDetail.ModuleId, true); } // Publish Version - return PublishVersion(GetCurrentPortalId(), tabId, createdByUserId, newVersion); + return this.PublishVersion(this.GetCurrentPortalId(), tabId, createdByUserId, newVersion); } public TabVersion CreateNewVersion(int tabId, int createdByUserId) { - return CreateNewVersion(GetCurrentPortalId(), tabId, createdByUserId); + return this.CreateNewVersion(this.GetCurrentPortalId(), tabId, createdByUserId); } public TabVersion CreateNewVersion(int portalid, int tabId, int createdByUserId) @@ -211,12 +211,12 @@ public TabVersion CreateNewVersion(int portalid, int tabId, int createdByUserId) throw new InvalidOperationException(Localization.GetString("TabVersioningNotEnabled", Localization.ExceptionsResourceFile)); } - SetupFirstVersionForExistingTab(portalid, tabId); + this.SetupFirstVersionForExistingTab(portalid, tabId); - DeleteOldestVersionIfTabHasMaxNumberOfVersions(portalid, tabId); + this.DeleteOldestVersionIfTabHasMaxNumberOfVersions(portalid, tabId); try { - return _tabVersionController.CreateTabVersion(tabId, createdByUserId); + return this._tabVersionController.CreateTabVersion(tabId, createdByUserId); } catch (InvalidOperationException e) { @@ -232,24 +232,24 @@ public TabVersion CreateNewVersion(int portalid, int tabId, int createdByUserId) public IEnumerable GetUnPublishedVersionModules(int tabId) { - var unPublishedVersion = GetUnPublishedVersion(tabId); + var unPublishedVersion = this.GetUnPublishedVersion(tabId); if (unPublishedVersion == null) { return CBO.FillCollection(DataProvider.Instance().GetTabModules(tabId)); } - return GetVersionModules(tabId, unPublishedVersion.TabVersionId); + return this.GetVersionModules(tabId, unPublishedVersion.TabVersionId); } public TabVersion GetCurrentVersion(int tabId, bool ignoreCache = false) { - return _tabVersionController.GetTabVersions(tabId, ignoreCache) + return this._tabVersionController.GetTabVersions(tabId, ignoreCache) .Where(tv => tv.IsPublished).OrderByDescending(tv => tv.CreatedOnDate).FirstOrDefault(); } public TabVersion GetUnPublishedVersion(int tabId) { - return _tabVersionController.GetTabVersions(tabId, true) + return this._tabVersionController.GetTabVersions(tabId, true) .SingleOrDefault(tv => !tv.IsPublished); } @@ -259,17 +259,17 @@ public IEnumerable GetCurrentModules(int tabId) return CBO.GetCachedObject>(new CacheItemArgs(cacheKey, DataCache.PublishedTabModuleCacheTimeOut, DataCache.PublishedTabModuleCachePriority), - c => GetCurrentModulesInternal(tabId)); + c => this.GetCurrentModulesInternal(tabId)); } public IEnumerable GetVersionModules(int tabId, int version) { - return ConvertToModuleInfo(GetVersionModulesDetails(tabId, version), tabId); + return this.ConvertToModuleInfo(this.GetVersionModulesDetails(tabId, version), tabId); } public int GetModuleContentLatestVersion(ModuleInfo module) { - var versionableController = GetVersionableController(module); + var versionableController = this.GetVersionableController(module); return versionableController != null ? versionableController.GetLatestVersion(module.ModuleID) : DefaultVersionNumber; } #endregion @@ -277,8 +277,8 @@ public int GetModuleContentLatestVersion(ModuleInfo module) #region Private Methods private IEnumerable GetCurrentModulesInternal(int tabId) { - var versioningEnabled = _portalSettings != null && - _tabVersionSettings.IsVersioningEnabled(_portalSettings.PortalId, tabId); + var versioningEnabled = this._portalSettings != null && + this._tabVersionSettings.IsVersioningEnabled(this._portalSettings.PortalId, tabId); if (!versioningEnabled) { return CBO.FillCollection(DataProvider.Instance().GetTabModules(tabId)); @@ -286,29 +286,29 @@ private IEnumerable GetCurrentModulesInternal(int tabId) // If versionins is enabled but the tab doesn't have versions history, // then it's a tab never edited after version enabling. - var tabWithoutVersions = !_tabVersionController.GetTabVersions(tabId).Any(); + var tabWithoutVersions = !this._tabVersionController.GetTabVersions(tabId).Any(); if (tabWithoutVersions) { return CBO.FillCollection(DataProvider.Instance().GetTabModules(tabId)); } - var currentVersion = GetCurrentVersion(tabId); + var currentVersion = this.GetCurrentVersion(tabId); if (currentVersion == null) { //Only when a tab is on a first version and it is not published, the currentVersion object can be null return new List(); } - return GetVersionModules(tabId, currentVersion.Version); + return this.GetVersionModules(tabId, currentVersion.Version); } private void DiscardDetailWithoutPublishedTabVersions(int tabId, TabVersionDetail unPublishedDetail) { if (unPublishedDetail.ModuleVersion != Null.NullInteger) { - DiscardDetail(tabId, unPublishedDetail); + this.DiscardDetail(tabId, unPublishedDetail); } - _moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true); + this._moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true); } private void DiscardDetailWithPublishedTabVersions(int tabId, TabVersionDetail unPublishedDetail, @@ -319,14 +319,14 @@ private void DiscardDetailWithPublishedTabVersions(int tabId, TabVersionDetail u var restoredModuleDetail = publishedChanges.SingleOrDefault(tv => tv.ModuleId == unPublishedDetail.ModuleId); if (restoredModuleDetail != null) { - RestoreModuleInfo(tabId, restoredModuleDetail); + this.RestoreModuleInfo(tabId, restoredModuleDetail); } return; } if (publishedChanges.All(tv => tv.ModuleId != unPublishedDetail.ModuleId)) { - _moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true); + this._moduleController.DeleteTabModule(tabId, unPublishedDetail.ModuleId, true); return; } @@ -336,20 +336,20 @@ private void DiscardDetailWithPublishedTabVersions(int tabId, TabVersionDetail u if (publishDetail.PaneName != unPublishedDetail.PaneName || publishDetail.ModuleOrder != unPublishedDetail.ModuleOrder) { - _moduleController.UpdateModuleOrder(tabId, publishDetail.ModuleId, publishDetail.ModuleOrder, + this._moduleController.UpdateModuleOrder(tabId, publishDetail.ModuleId, publishDetail.ModuleOrder, publishDetail.PaneName); } if (unPublishedDetail.ModuleVersion != Null.NullInteger) { - DiscardDetail(tabId, unPublishedDetail); + this.DiscardDetail(tabId, unPublishedDetail); } } } private void ForceDeleteVersion(int tabId, int version) { - var unpublishedVersion = GetUnPublishedVersion(tabId); + var unpublishedVersion = this.GetUnPublishedVersion(tabId); if (unpublishedVersion != null && unpublishedVersion.Version == version) { @@ -359,7 +359,7 @@ private void ForceDeleteVersion(int tabId, int version) Localization.ExceptionsResourceFile), tabId, version)); } - var tabVersions = _tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version); + var tabVersions = this._tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version); if (tabVersions.Count() <= 1) { throw new InvalidOperationException( @@ -374,29 +374,29 @@ private void ForceDeleteVersion(int tabId, int version) if (versionToDelete.Version == version) { var restoreMaxNumberOfVersions = false; - var portalId = _portalSettings.PortalId; - var maxNumberOfVersions = _tabVersionSettings.GetMaxNumberOfVersions(portalId); + var portalId = this._portalSettings.PortalId; + var maxNumberOfVersions = this._tabVersionSettings.GetMaxNumberOfVersions(portalId); // If we already have reached the maxNumberOfVersions we need to extend to 1 this limit to allow the tmp version if (tabVersions.Count() == maxNumberOfVersions) { - _tabVersionSettings.SetMaxNumberOfVersions(portalId, maxNumberOfVersions + 1); + this._tabVersionSettings.SetMaxNumberOfVersions(portalId, maxNumberOfVersions + 1); restoreMaxNumberOfVersions = true; } try { var previousVersion = tabVersions.ElementAt(1); - var previousVersionDetails = GetVersionModulesDetails(tabId, previousVersion.Version).ToArray(); + var previousVersionDetails = this.GetVersionModulesDetails(tabId, previousVersion.Version).ToArray(); var versionToDeleteDetails = - _tabVersionDetailController.GetTabVersionDetails(versionToDelete.TabVersionId); + this._tabVersionDetailController.GetTabVersionDetails(versionToDelete.TabVersionId); foreach (var versionToDeleteDetail in versionToDeleteDetails) { switch (versionToDeleteDetail.Action) { case TabVersionDetailAction.Added: - _moduleController.DeleteTabModule(tabId, versionToDeleteDetail.ModuleId, true); + this._moduleController.DeleteTabModule(tabId, versionToDeleteDetail.ModuleId, true); break; case TabVersionDetailAction.Modified: var peviousVersionDetail = @@ -405,27 +405,27 @@ private void ForceDeleteVersion(int tabId, int version) (peviousVersionDetail.PaneName != versionToDeleteDetail.PaneName || peviousVersionDetail.ModuleOrder != versionToDeleteDetail.ModuleOrder)) { - _moduleController.UpdateModuleOrder(tabId, peviousVersionDetail.ModuleId, + this._moduleController.UpdateModuleOrder(tabId, peviousVersionDetail.ModuleId, peviousVersionDetail.ModuleOrder, peviousVersionDetail.PaneName); } if (versionToDeleteDetail.ModuleVersion != Null.NullInteger) { - DiscardDetail(tabId, versionToDeleteDetail); + this.DiscardDetail(tabId, versionToDeleteDetail); } break; } } - DeleteTmpVersionIfExists(tabId, versionToDelete); - _tabVersionController.DeleteTabVersion(tabId, versionToDelete.TabVersionId); - ManageModulesToBeRestored(tabId, previousVersionDetails); - _moduleController.ClearCache(tabId); + this.DeleteTmpVersionIfExists(tabId, versionToDelete); + this._tabVersionController.DeleteTabVersion(tabId, versionToDelete.TabVersionId); + this.ManageModulesToBeRestored(tabId, previousVersionDetails); + this._moduleController.ClearCache(tabId); } finally { if (restoreMaxNumberOfVersions) { - _tabVersionSettings.SetMaxNumberOfVersions(portalId, maxNumberOfVersions); + this._tabVersionSettings.SetMaxNumberOfVersions(portalId, maxNumberOfVersions); } } } @@ -435,8 +435,8 @@ private void ForceDeleteVersion(int tabId, int version) { if (tabVersions.ElementAt(i).Version == version) { - CreateSnapshotOverVersion(tabId, tabVersions.ElementAtOrDefault(i - 1), tabVersions.ElementAt(i)); - _tabVersionController.DeleteTabVersion(tabId, tabVersions.ElementAt(i).TabVersionId); + this.CreateSnapshotOverVersion(tabId, tabVersions.ElementAtOrDefault(i - 1), tabVersions.ElementAt(i)); + this._tabVersionController.DeleteTabVersion(tabId, tabVersions.ElementAt(i).TabVersionId); break; } } @@ -447,47 +447,47 @@ private void ManageModulesToBeRestored(int tabId, TabVersionDetail[] versionDeta { foreach (var detail in versionDetails) { - var module = _moduleController.GetModule(detail.ModuleId, tabId, true); + var module = this._moduleController.GetModule(detail.ModuleId, tabId, true); if (module.IsDeleted) { - _moduleController.RestoreModule(module); + this._moduleController.RestoreModule(module); } } } private void DeleteTmpVersionIfExists(int tabId, TabVersion versionToDelete) { - var tmpVersion = _tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version).FirstOrDefault(); + var tmpVersion = this._tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version).FirstOrDefault(); if (tmpVersion != null && tmpVersion.Version > versionToDelete.Version) { - _tabVersionController.DeleteTabVersion(tabId, tmpVersion.TabVersionId); + this._tabVersionController.DeleteTabVersion(tabId, tmpVersion.TabVersionId); } } private void DeleteOldestVersionIfTabHasMaxNumberOfVersions(int portalId, int tabId) { - var maxVersionsAllowed = GetMaxNumberOfVersions(portalId); - var tabVersionsOrdered = _tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version); + var maxVersionsAllowed = this.GetMaxNumberOfVersions(portalId); + var tabVersionsOrdered = this._tabVersionController.GetTabVersions(tabId).OrderByDescending(tv => tv.Version); if (tabVersionsOrdered.Count() < maxVersionsAllowed) return; //The last existing version is going to be deleted, therefore we need to add the snapshot to the previous one var snapShotTabVersion = tabVersionsOrdered.ElementAtOrDefault(maxVersionsAllowed - 2); - CreateSnapshotOverVersion(tabId, snapShotTabVersion); - DeleteOldVersions(tabVersionsOrdered, snapShotTabVersion); + this.CreateSnapshotOverVersion(tabId, snapShotTabVersion); + this.DeleteOldVersions(tabVersionsOrdered, snapShotTabVersion); } private int GetMaxNumberOfVersions(int portalId) { - return _tabVersionSettings.GetMaxNumberOfVersions(portalId); + return this._tabVersionSettings.GetMaxNumberOfVersions(portalId); } private void UpdateModuleOrder(int tabId, TabVersionDetail detailToRestore) { - var restoredModule = _moduleController.GetModule(detailToRestore.ModuleId, tabId, true); + var restoredModule = this._moduleController.GetModule(detailToRestore.ModuleId, tabId, true); if (restoredModule != null) { - UpdateModuleInfoOrder(restoredModule, detailToRestore); + this.UpdateModuleInfoOrder(restoredModule, detailToRestore); } } @@ -495,7 +495,7 @@ private void UpdateModuleInfoOrder(ModuleInfo module, TabVersionDetail detailToR { module.PaneName = detailToRestore.PaneName; module.ModuleOrder = detailToRestore.ModuleOrder; - _moduleController.UpdateModule(module); + this._moduleController.UpdateModule(module); } private TabVersionDetail GetResetTabVersionDetail(TabVersion tabVersion) @@ -512,39 +512,39 @@ private TabVersionDetail GetResetTabVersionDetail(TabVersion tabVersion) private void RestoreModuleInfo(int tabId, TabVersionDetail detailsToRestore ) { - var restoredModule = _moduleController.GetModule(detailsToRestore.ModuleId, tabId, true); + var restoredModule = this._moduleController.GetModule(detailsToRestore.ModuleId, tabId, true); if (restoredModule != null) { - _moduleController.RestoreModule(restoredModule); - UpdateModuleInfoOrder(restoredModule, detailsToRestore); + this._moduleController.RestoreModule(restoredModule); + this.UpdateModuleInfoOrder(restoredModule, detailsToRestore); } } private IEnumerable GetVersionModulesDetails(int tabId, int version) { - var tabVersionDetails = _tabVersionDetailController.GetVersionHistory(tabId, version); + var tabVersionDetails = this._tabVersionDetailController.GetVersionHistory(tabId, version); return GetSnapShot(tabVersionDetails); } private TabVersion PublishVersion(int portalId, int tabId, int createdByUserID, TabVersion tabVersion) { - var unPublishedDetails = _tabVersionDetailController.GetTabVersionDetails(tabVersion.TabVersionId); + var unPublishedDetails = this._tabVersionDetailController.GetTabVersionDetails(tabVersion.TabVersionId); foreach (var unPublishedDetail in unPublishedDetails) { if (unPublishedDetail.ModuleVersion != Null.NullInteger) { - PublishDetail(tabId, unPublishedDetail); + this.PublishDetail(tabId, unPublishedDetail); } } tabVersion.IsPublished = true; - _tabVersionController.SaveTabVersion(tabVersion, tabVersion.CreatedByUserID, createdByUserID); + this._tabVersionController.SaveTabVersion(tabVersion, tabVersion.CreatedByUserID, createdByUserID); var tab = TabController.Instance.GetTab(tabId, portalId); if (!tab.HasBeenPublished) { TabController.Instance.MarkAsPublished(tab); } - _moduleController.ClearCache(tabId); + this._moduleController.ClearCache(tabId); return tabVersion; } @@ -562,12 +562,12 @@ private IEnumerable CopyVersionDetails(IEnumerable 0; i--) { @@ -591,32 +591,32 @@ private void CreateSnapshotOverVersion(int tabId, TabVersion snapshotTabVersion, { if (snapShotTabVersionDetails.All(tvd => tvd.TabVersionDetailId != existingDetail.TabVersionDetailId)) { - _tabVersionDetailController.DeleteTabVersionDetail(existingDetail.TabVersionId, + this._tabVersionDetailController.DeleteTabVersionDetail(existingDetail.TabVersionId, existingDetail.TabVersionDetailId); } } else if (existingDetail.Action == TabVersionDetailAction.Deleted) { - IEnumerable deletedTabVersionDetails = _tabVersionDetailController.GetTabVersionDetails(deletedTabVersion.TabVersionId); + IEnumerable deletedTabVersionDetails = this._tabVersionDetailController.GetTabVersionDetails(deletedTabVersion.TabVersionId); var moduleAddedAndDeleted = deletedTabVersionDetails.Any( deleteDetail => deleteDetail.ModuleId == existingDetail.ModuleId && deleteDetail.Action == TabVersionDetailAction.Added); if (moduleAddedAndDeleted) { - _tabVersionDetailController.DeleteTabVersionDetail(existingDetail.TabVersionId, + this._tabVersionDetailController.DeleteTabVersionDetail(existingDetail.TabVersionId, existingDetail.TabVersionDetailId); } } } - UpdateDeletedTabDetails(snapshotTabVersion, deletedTabVersion, snapShotTabVersionDetails); + this.UpdateDeletedTabDetails(snapshotTabVersion, deletedTabVersion, snapShotTabVersionDetails); } private void UpdateDeletedTabDetails(TabVersion snapshotTabVersion, TabVersion deletedTabVersion, TabVersionDetail[] snapShotTabVersionDetails) { - var tabVersionDetailsToBeUpdated = deletedTabVersion != null ? _tabVersionDetailController.GetTabVersionDetails(deletedTabVersion.TabVersionId).ToArray() + var tabVersionDetailsToBeUpdated = deletedTabVersion != null ? this._tabVersionDetailController.GetTabVersionDetails(deletedTabVersion.TabVersionId).ToArray() : snapShotTabVersionDetails; foreach (var tabVersionDetail in tabVersionDetailsToBeUpdated) @@ -630,8 +630,8 @@ private void UpdateDeletedTabDetails(TabVersion snapshotTabVersion, TabVersion d { var previousTabVersionId = tabVersionDetail.TabVersionId; tabVersionDetail.TabVersionId = snapshotTabVersion.TabVersionId; - _tabVersionDetailController.SaveTabVersionDetail(tabVersionDetail); - _tabVersionDetailController.ClearCache(previousTabVersionId); + this._tabVersionDetailController.SaveTabVersionDetail(tabVersionDetail); + this._tabVersionDetailController.ClearCache(previousTabVersionId); } } @@ -643,13 +643,13 @@ private void DeleteOldVersions(IEnumerable tabVersionsOrdered, TabVe for (var i = oldVersions.Count(); i > 0; i--) { var oldVersion = oldVersions.ElementAtOrDefault(i - 1); - var oldVersionDetails = _tabVersionDetailController.GetTabVersionDetails(oldVersion.TabVersionId).ToArray(); + var oldVersionDetails = this._tabVersionDetailController.GetTabVersionDetails(oldVersion.TabVersionId).ToArray(); for (var j = oldVersionDetails.Count(); j > 0; j--) { var oldVersionDetail = oldVersionDetails.ElementAtOrDefault(j - 1); - _tabVersionDetailController.DeleteTabVersionDetail(oldVersionDetail.TabVersionId, oldVersionDetail.TabVersionDetailId); + this._tabVersionDetailController.DeleteTabVersionDetail(oldVersionDetail.TabVersionId, oldVersionDetail.TabVersionDetailId); } - _tabVersionController.DeleteTabVersion(oldVersion.TabId, oldVersion.TabVersionId); + this._tabVersionController.DeleteTabVersion(oldVersion.TabId, oldVersion.TabVersionId); } } @@ -660,12 +660,12 @@ private IEnumerable ConvertToModuleInfo(IEnumerable ConvertToModuleInfo(IEnumerable modules) { - var tabVersion = _tabVersionController.CreateTabVersion(tabId, tab.CreatedByUserID, true); + var tabVersion = this._tabVersionController.CreateTabVersion(tabId, tab.CreatedByUserID, true); foreach (var module in modules) { - var moduleVersion = GetModuleContentPublishedVersion(module); - _tabVersionDetailController.SaveTabVersionDetail(new TabVersionDetail + var moduleVersion = this.GetModuleContentPublishedVersion(module); + this._tabVersionDetailController.SaveTabVersionDetail(new TabVersionDetail { Action = TabVersionDetailAction.Added, ModuleId = module.ModuleID, @@ -818,7 +818,7 @@ private void CreateFirstTabVersion(int tabId, TabInfo tab, IEnumerable tv.TabVersionId == tabVersionId); + return this.GetTabVersions(tabId, ignoreCache).SingleOrDefault(tv => tv.TabVersionId == tabVersionId); } public IEnumerable GetTabVersions(int tabId, bool ignoreCache = false) @@ -43,23 +43,23 @@ public IEnumerable GetTabVersions(int tabId, bool ignoreCache = fals } public void SaveTabVersion(TabVersion tabVersion) { - SaveTabVersion(tabVersion, tabVersion.CreatedByUserID, tabVersion.LastModifiedByUserID); + this.SaveTabVersion(tabVersion, tabVersion.CreatedByUserID, tabVersion.LastModifiedByUserID); } public void SaveTabVersion(TabVersion tabVersion, int createdByUserID) { - SaveTabVersion(tabVersion, createdByUserID, createdByUserID); + this.SaveTabVersion(tabVersion, createdByUserID, createdByUserID); } public void SaveTabVersion(TabVersion tabVersion, int createdByUserID, int modifiedByUserID) { tabVersion.TabVersionId = Provider.SaveTabVersion(tabVersion.TabVersionId, tabVersion.TabId, tabVersion.TimeStamp, tabVersion.Version, tabVersion.IsPublished, createdByUserID, modifiedByUserID); - ClearCache(tabVersion.TabId); + this.ClearCache(tabVersion.TabId); } public TabVersion CreateTabVersion(int tabId, int createdByUserID, bool isPublished = false) { - var lastTabVersion = GetTabVersions(tabId).OrderByDescending(tv => tv.Version).FirstOrDefault(); + var lastTabVersion = this.GetTabVersions(tabId).OrderByDescending(tv => tv.Version).FirstOrDefault(); var newVersion = 1; if (lastTabVersion != null) @@ -72,15 +72,15 @@ public TabVersion CreateTabVersion(int tabId, int createdByUserID, bool isPublis } var tabVersionId = Provider.SaveTabVersion(0, tabId, DateTime.UtcNow, newVersion, isPublished, createdByUserID, createdByUserID); - ClearCache(tabId); + this.ClearCache(tabId); - return GetTabVersion(tabVersionId, tabId); + return this.GetTabVersion(tabVersionId, tabId); } public void DeleteTabVersion(int tabId, int tabVersionId) { Provider.DeleteTabVersion(tabVersionId); - ClearCache(tabId); + this.ClearCache(tabId); } public void DeleteTabVersionDetailByModule(int moduleId) diff --git a/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionDetailController.cs b/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionDetailController.cs index be5e39639a1..5678b5b63a7 100644 --- a/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionDetailController.cs +++ b/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionDetailController.cs @@ -18,7 +18,7 @@ public class TabVersionDetailController: ServiceLocator tvd.TabVersionDetailId == tabVersionDetailId); + return this.GetTabVersionDetails(tabVersionId, ignoreCache).SingleOrDefault(tvd => tvd.TabVersionDetailId == tabVersionDetailId); } public IEnumerable GetTabVersionDetails(int tabVersionId, bool ignoreCache = false) @@ -42,12 +42,12 @@ public IEnumerable GetVersionHistory(int tabId, int version) public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail) { - SaveTabVersionDetail(tabVersionDetail, tabVersionDetail.CreatedByUserID, tabVersionDetail.LastModifiedByUserID); + this.SaveTabVersionDetail(tabVersionDetail, tabVersionDetail.CreatedByUserID, tabVersionDetail.LastModifiedByUserID); } public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail, int createdByUserID) { - SaveTabVersionDetail(tabVersionDetail, createdByUserID, createdByUserID); + this.SaveTabVersionDetail(tabVersionDetail, createdByUserID, createdByUserID); } public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail, int createdByUserID, int modifiedByUserID) @@ -56,13 +56,13 @@ public void SaveTabVersionDetail(TabVersionDetail tabVersionDetail, int createdB tabVersionDetail.TabVersionId, tabVersionDetail.ModuleId, tabVersionDetail.ModuleVersion, tabVersionDetail.PaneName, tabVersionDetail.ModuleOrder, (int)tabVersionDetail.Action, createdByUserID, modifiedByUserID); - ClearCache(tabVersionDetail.TabVersionId); + this.ClearCache(tabVersionDetail.TabVersionId); } public void DeleteTabVersionDetail(int tabVersionId, int tabVersionDetailId) { Provider.DeleteTabVersionDetail(tabVersionDetailId); - ClearCache(tabVersionId); + this.ClearCache(tabVersionId); } public void ClearCache(int tabVersionId) diff --git a/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionSettings.cs b/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionSettings.cs index 1aa8bc4f014..61fbece9441 100644 --- a/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionSettings.cs +++ b/DNN Platform/Library/Entities/Tabs/TabVersions/TabVersionSettings.cs @@ -56,7 +56,7 @@ public bool IsVersioningEnabled(int portalId, int tabId) Requires.NotNegative("portalId", portalId); Requires.NotNegative("tabId", tabId); - if (!IsVersioningEnabled(portalId)) + if (!this.IsVersioningEnabled(portalId)) { return false; } diff --git a/DNN Platform/Library/Entities/Tabs/TabWorkflowSettings.cs b/DNN Platform/Library/Entities/Tabs/TabWorkflowSettings.cs index 75e2844e2b3..39198134516 100644 --- a/DNN Platform/Library/Entities/Tabs/TabWorkflowSettings.cs +++ b/DNN Platform/Library/Entities/Tabs/TabWorkflowSettings.cs @@ -28,8 +28,8 @@ public class TabWorkflowSettings : ServiceLocator public TabWorkflowTracker() { - _tabController = TabController.Instance; - _workflowEngine = WorkflowEngine.Instance; - _workflowManager = WorkflowManager.Instance; - _tabWorkflowSettings = TabWorkflowSettings.Instance; + this._tabController = TabController.Instance; + this._workflowEngine = WorkflowEngine.Instance; + this._workflowManager = WorkflowManager.Instance; + this._tabWorkflowSettings = TabWorkflowSettings.Instance; } protected override Func GetFactory() @@ -47,7 +47,7 @@ protected override Func GetFactory() /// User Id related with the workflow instance public void TrackModuleAddition(ModuleInfo module, int moduleVersion, int userId) { - NotifyWorkflowAboutChanges(module.PortalID, module.TabID, userId); + this.NotifyWorkflowAboutChanges(module.PortalID, module.TabID, userId); } /// @@ -58,7 +58,7 @@ public void TrackModuleAddition(ModuleInfo module, int moduleVersion, int userId /// User Id related with the workflow instance public void TrackModuleModification(ModuleInfo module, int moduleVersion, int userId) { - NotifyWorkflowAboutChanges(module.PortalID, module.TabID, userId); + this.NotifyWorkflowAboutChanges(module.PortalID, module.TabID, userId); } @@ -70,7 +70,7 @@ public void TrackModuleModification(ModuleInfo module, int moduleVersion, int us /// User Id related with the workflow instance public void TrackModuleDeletion(ModuleInfo module, int moduleVersion, int userId) { - NotifyWorkflowAboutChanges(module.PortalID, module.TabID, userId); + this.NotifyWorkflowAboutChanges(module.PortalID, module.TabID, userId); } /// @@ -82,7 +82,7 @@ public void TrackModuleDeletion(ModuleInfo module, int moduleVersion, int userId /// User Id related with the workflow instance public void TrackModuleCopy(ModuleInfo module, int moduleVersion, int originalTabId, int userId) { - TrackModuleAddition(module, moduleVersion, userId); + this.TrackModuleAddition(module, moduleVersion, userId); } @@ -95,7 +95,7 @@ public void TrackModuleCopy(ModuleInfo module, int moduleVersion, int originalTa /// User Id related with the workflow instance public void TrackModuleUncopy(ModuleInfo module, int moduleVersion, int originalTabId, int userId) { - TrackModuleDeletion(module, moduleVersion, userId); + this.TrackModuleDeletion(module, moduleVersion, userId); } #region Private Statics Methods @@ -103,18 +103,18 @@ private void NotifyWorkflowAboutChanges(int portalId, int tabId, int userId) { try { - var tabInfo = _tabController.GetTab(tabId, portalId); - if (tabInfo!= null && !tabInfo.IsDeleted && _workflowEngine.IsWorkflowCompleted(tabInfo)) + var tabInfo = this._tabController.GetTab(tabId, portalId); + if (tabInfo!= null && !tabInfo.IsDeleted && this._workflowEngine.IsWorkflowCompleted(tabInfo)) { - var workflow = GetCurrentOrDefaultWorkflow(tabInfo, portalId); + var workflow = this.GetCurrentOrDefaultWorkflow(tabInfo, portalId); if (workflow == null) { Logger.Warn("Current Workflow and Default workflow are not found on NotifyWorkflowAboutChanges"); return; } - _workflowEngine.StartWorkflow(workflow.WorkflowID, tabInfo.ContentItemId, userId); - _tabController.RefreshCache(portalId, tabId); + this._workflowEngine.StartWorkflow(workflow.WorkflowID, tabInfo.ContentItemId, userId); + this._tabController.RefreshCache(portalId, tabId); } } catch (Exception ex) @@ -128,11 +128,11 @@ private Workflow GetCurrentOrDefaultWorkflow(ContentItem item, int portalId) { if (item.StateID != Null.NullInteger) { - return _workflowManager.GetWorkflow(item); + return this._workflowManager.GetWorkflow(item); } - var defaultWorkflow = _tabWorkflowSettings.GetDefaultTabWorkflowId(portalId); - return _workflowManager.GetWorkflow(defaultWorkflow); + var defaultWorkflow = this._tabWorkflowSettings.GetDefaultTabWorkflowId(portalId); + return this._workflowManager.GetWorkflow(defaultWorkflow); } #endregion } diff --git a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs index 437669355f1..37cb6839f2f 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs @@ -45,12 +45,12 @@ internal AdvancedFriendlyUrlProvider(NameValueCollection attributes) internal override string FriendlyUrl(TabInfo tab, string path) { - return FriendlyUrl(tab, path, Globals.glbDefaultPage, PortalController.Instance.GetCurrentPortalSettings()); + return this.FriendlyUrl(tab, path, Globals.glbDefaultPage, PortalController.Instance.GetCurrentPortalSettings()); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName) { - return FriendlyUrl(tab, path, pageName, PortalController.Instance.GetCurrentPortalSettings()); + return this.FriendlyUrl(tab, path, pageName, PortalController.Instance.GetCurrentPortalSettings()); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings portalSettings) @@ -59,12 +59,12 @@ internal override string FriendlyUrl(TabInfo tab, string path, string pageName, { throw new ArgumentNullException("portalSettings"); } - return FriendlyUrlInternal(tab, path, pageName, String.Empty, (PortalSettings)portalSettings); + return this.FriendlyUrlInternal(tab, path, pageName, String.Empty, (PortalSettings)portalSettings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) { - return FriendlyUrlInternal(tab, path, pageName, portalAlias, null); + return this.FriendlyUrlInternal(tab, path, pageName, portalAlias, null); } #endregion diff --git a/DNN Platform/Library/Entities/Urls/AdvancedUrlRewriter.cs b/DNN Platform/Library/Entities/Urls/AdvancedUrlRewriter.cs index 75df09cae53..bb3bd4c8f9b 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedUrlRewriter.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedUrlRewriter.cs @@ -63,9 +63,9 @@ internal override void RewriteUrl(object sender, EventArgs e) if (ignoreForInstall == false) { - _settings = new FriendlyUrlSettings(-1); + this._settings = new FriendlyUrlSettings(-1); - SecurityCheck(app); + this.SecurityCheck(app); } } @@ -78,7 +78,7 @@ internal override void RewriteUrl(object sender, EventArgs e) { ShowDebugData(app.Context, app.Request.Url.AbsoluteUri, null, ex); var action = new UrlAction(app.Request) { Action = ActionType.Output404 }; - Handle404OrException(_settings, app.Context, ex, action, false, debug); + Handle404OrException(this._settings, app.Context, ex, action, false, debug); } else { @@ -97,11 +97,11 @@ internal override void RewriteUrl(object sender, EventArgs e) IsSSLOffloaded = UrlUtils.IsSslOffloadEnabled(request), RawUrl = request.RawUrl }; - ProcessRequest(app.Context, + this.ProcessRequest(app.Context, app.Context.Request.Url, Host.Host.UseFriendlyUrls, result, - _settings, + this._settings, true, parentTraceId); } @@ -118,8 +118,8 @@ public void ProcessTestRequestWithContext(HttpContext context, FriendlyUrlSettings settings) { Guid parentTraceId = Guid.Empty; - _settings = settings; - ProcessRequest(context, + this._settings = settings; + this.ProcessRequest(context, requestUri, useFriendlyUrls, result, @@ -230,7 +230,7 @@ private void ProcessRequest(HttpContext context, //find the portal alias first string wrongAlias; bool isPrimaryAlias; - var requestedAlias = GetPortalAlias(settings, fullUrl, out redirectAlias, out isPrimaryAlias, out wrongAlias); + var requestedAlias = this.GetPortalAlias(settings, fullUrl, out redirectAlias, out isPrimaryAlias, out wrongAlias); if (requestedAlias != null) { @@ -295,7 +295,7 @@ private void ProcessRequest(HttpContext context, //check the portal alias again. This time, in more depth now that the portal Id is known //this check handles browser types/language specific aliases & mobile aliases string primaryHttpAlias; - if (!redirectAlias && IsPortalAliasIncorrect(context, request, requestUri, result, queryStringCol, settings, parentTraceId, out primaryHttpAlias)) + if (!redirectAlias && this.IsPortalAliasIncorrect(context, request, requestUri, result, queryStringCol, settings, parentTraceId, out primaryHttpAlias)) { //it was an incorrect alias PortalAliasInfo primaryAlias = PortalAliasController.Instance.GetPortalAlias(primaryHttpAlias); @@ -411,7 +411,7 @@ private void ProcessRequest(HttpContext context, //confirm which portal the request is for if (!finished) { - IdentifyPortalAlias(context, request, requestUri, result, queryStringCol, settings, parentTraceId); + this.IdentifyPortalAlias(context, request, requestUri, result, queryStringCol, settings, parentTraceId); if (result.Action == ActionType.Redirect302Now) { //performs a 302 redirect if requested @@ -548,7 +548,7 @@ private void ProcessRequest(HttpContext context, } //check if a secure redirection is needed //this would be done earlier in the piece, but need to know the portal settings, tabid etc before processing it - bool redirectSecure = CheckForSecureRedirect(portalSettings, requestUri, result, queryStringCol, settings); + bool redirectSecure = this.CheckForSecureRedirect(portalSettings, requestUri, result, queryStringCol, settings); if (redirectSecure) { if (response != null) @@ -1552,7 +1552,7 @@ private bool CheckForSecureRedirect(PortalSettings portalSettings, stdUrl = result.HttpAlias; } url = url.Replace("http://", "https://"); - url = ReplaceDomainName(url, stdUrl, sslUrl); + url = this.ReplaceDomainName(url, stdUrl, sslUrl); } } //check ssl enforced @@ -1571,7 +1571,7 @@ private bool CheckForSecureRedirect(PortalSettings portalSettings, string stdUrl = portalSettings.STDURL; string sslUrl = portalSettings.SSLURL; url = url.Replace("https://", "http://"); - url = ReplaceDomainName(url, sslUrl, stdUrl); + url = this.ReplaceDomainName(url, sslUrl, stdUrl); redirectSecure = true; } } @@ -2172,7 +2172,7 @@ private void IdentifyPortalAlias(HttpContext context, { string primaryAlias; //checking again in case the rewriting operation changed the values for the valid portal alias - bool incorrectAlias = IsPortalAliasIncorrect(context, request, requestUri, result, queryStringCol, settings, parentTraceId, out primaryAlias); + bool incorrectAlias = this.IsPortalAliasIncorrect(context, request, requestUri, result, queryStringCol, settings, parentTraceId, out primaryAlias); if (incorrectAlias) RedirectPortalAlias(primaryAlias, ref result, settings); } } diff --git a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs index df69647993f..173f4eafd83 100644 --- a/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/BasicFriendlyUrlProvider.cs @@ -32,26 +32,26 @@ internal BasicFriendlyUrlProvider(NameValueCollection attributes) : base(attributes) { //Read the attributes for this provider - _includePageName = String.IsNullOrEmpty(attributes["includePageName"]) || bool.Parse(attributes["includePageName"]); - _regexMatch = !String.IsNullOrEmpty(attributes["regexMatch"]) ? attributes["regexMatch"] : RegexMatchExpression; - _fileExtension = !String.IsNullOrEmpty(attributes["fileExtension"]) ? attributes["fileExtension"] : ".aspx"; + this._includePageName = String.IsNullOrEmpty(attributes["includePageName"]) || bool.Parse(attributes["includePageName"]); + this._regexMatch = !String.IsNullOrEmpty(attributes["regexMatch"]) ? attributes["regexMatch"] : RegexMatchExpression; + this._fileExtension = !String.IsNullOrEmpty(attributes["fileExtension"]) ? attributes["fileExtension"] : ".aspx"; } #region Public Properties public string FileExtension { - get { return _fileExtension; } + get { return this._fileExtension; } } public bool IncludePageName { - get { return _includePageName; } + get { return this._includePageName; } } public string RegexMatch { - get { return _regexMatch; } + get { return this._regexMatch; } } #endregion @@ -219,7 +219,7 @@ private string GetFriendlyQueryString(TabInfo tab, string path, string pageName) { if ((!String.IsNullOrEmpty(pair[1]))) { - if ((Regex.IsMatch(pair[1], _regexMatch) == false)) + if ((Regex.IsMatch(pair[1], this._regexMatch) == false)) { //Contains Non-AlphaNumeric Characters if ((pair[0].ToLowerInvariant() == "tabid")) @@ -231,7 +231,7 @@ private string GetFriendlyQueryString(TabInfo tab, string path, string pageName) int tabId = Convert.ToInt32(pair[1]); if ((tab.TabID == tabId)) { - if ((string.IsNullOrEmpty(tab.TabPath) == false) && IncludePageName) + if ((string.IsNullOrEmpty(tab.TabPath) == false) && this.IncludePageName) { pathToAppend = tab.TabPath.Replace("//", "/").TrimStart('/') + "/" + pathToAppend; } @@ -265,9 +265,9 @@ private string GetFriendlyQueryString(TabInfo tab, string path, string pageName) } if ((!String.IsNullOrEmpty(queryStringSpecialChars))) { - return AddPage(friendlyPath, pageName) + "?" + queryStringSpecialChars; + return this.AddPage(friendlyPath, pageName) + "?" + queryStringSpecialChars; } - return AddPage(friendlyPath, pageName); + return this.AddPage(friendlyPath, pageName); } private Dictionary GetQueryStringDictionary(string path) @@ -296,23 +296,23 @@ private Dictionary GetQueryStringDictionary(string path) internal override string FriendlyUrl(TabInfo tab, string path) { PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return FriendlyUrl(tab, path, Globals.glbDefaultPage, _portalSettings); + return this.FriendlyUrl(tab, path, Globals.glbDefaultPage, _portalSettings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName) { PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return FriendlyUrl(tab, path, pageName, _portalSettings); + return this.FriendlyUrl(tab, path, pageName, _portalSettings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, IPortalSettings settings) { - return FriendlyUrl(tab, path, pageName, ((PortalSettings)settings)?.PortalAlias.HTTPAlias, settings); + return this.FriendlyUrl(tab, path, pageName, ((PortalSettings)settings)?.PortalAlias.HTTPAlias, settings); } internal override string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias) { - return FriendlyUrl(tab, path, pageName, portalAlias, null); + return this.FriendlyUrl(tab, path, pageName, portalAlias, null); } private string FriendlyUrl(TabInfo tab, string path, string pageName, string portalAlias, IPortalSettings portalSettings) @@ -320,27 +320,27 @@ private string FriendlyUrl(TabInfo tab, string path, string pageName, string por string friendlyPath = path; bool isPagePath = (tab != null); - if ((UrlFormat == UrlFormatType.HumanFriendly)) + if ((this.UrlFormat == UrlFormatType.HumanFriendly)) { if ((tab != null)) { - Dictionary queryStringDic = GetQueryStringDictionary(path); + Dictionary queryStringDic = this.GetQueryStringDictionary(path); if ((queryStringDic.Count == 0 || (queryStringDic.Count == 1 && queryStringDic.ContainsKey("tabid")))) { - friendlyPath = GetFriendlyAlias("~/" + tab.TabPath.Replace("//", "/").TrimStart('/') + ".aspx", portalAlias, true); + friendlyPath = this.GetFriendlyAlias("~/" + tab.TabPath.Replace("//", "/").TrimStart('/') + ".aspx", portalAlias, true); } else if ((queryStringDic.Count == 2 && queryStringDic.ContainsKey("tabid") && queryStringDic.ContainsKey("language"))) { if (!tab.IsNeutralCulture) { - friendlyPath = GetFriendlyAlias("~/" + tab.CultureCode + "/" + tab.TabPath.Replace("//", "/").TrimStart('/') + ".aspx", + friendlyPath = this.GetFriendlyAlias("~/" + tab.CultureCode + "/" + tab.TabPath.Replace("//", "/").TrimStart('/') + ".aspx", portalAlias, true) .ToLowerInvariant(); } else { - friendlyPath = GetFriendlyAlias("~/" + queryStringDic["language"] + "/" + tab.TabPath.Replace("//", "/").TrimStart('/') + ".aspx", + friendlyPath = this.GetFriendlyAlias("~/" + queryStringDic["language"] + "/" + tab.TabPath.Replace("//", "/").TrimStart('/') + ".aspx", portalAlias, true) .ToLowerInvariant(); @@ -353,30 +353,30 @@ private string FriendlyUrl(TabInfo tab, string path, string pageName, string por switch (queryStringDic["ctl"].ToLowerInvariant()) { case "terms": - friendlyPath = GetFriendlyAlias("~/terms.aspx", portalAlias, true); + friendlyPath = this.GetFriendlyAlias("~/terms.aspx", portalAlias, true); break; case "privacy": - friendlyPath = GetFriendlyAlias("~/privacy.aspx", portalAlias, true); + friendlyPath = this.GetFriendlyAlias("~/privacy.aspx", portalAlias, true); break; case "login": friendlyPath = (queryStringDic.ContainsKey("returnurl")) - ? GetFriendlyAlias("~/login.aspx?ReturnUrl=" + queryStringDic["returnurl"], portalAlias, true) - : GetFriendlyAlias("~/login.aspx", portalAlias, true); + ? this.GetFriendlyAlias("~/login.aspx?ReturnUrl=" + queryStringDic["returnurl"], portalAlias, true) + : this.GetFriendlyAlias("~/login.aspx", portalAlias, true); break; case "register": friendlyPath = (queryStringDic.ContainsKey("returnurl")) - ? GetFriendlyAlias("~/register.aspx?returnurl=" + queryStringDic["returnurl"], portalAlias, true) - : GetFriendlyAlias("~/register.aspx", portalAlias, true); + ? this.GetFriendlyAlias("~/register.aspx?returnurl=" + queryStringDic["returnurl"], portalAlias, true) + : this.GetFriendlyAlias("~/register.aspx", portalAlias, true); break; default: //Return Search engine friendly version - return GetFriendlyQueryString(tab, GetFriendlyAlias(path, portalAlias, true), pageName); + return this.GetFriendlyQueryString(tab, this.GetFriendlyAlias(path, portalAlias, true), pageName); } } else { //Return Search engine friendly version - return GetFriendlyQueryString(tab, GetFriendlyAlias(path, portalAlias, true), pageName); + return this.GetFriendlyQueryString(tab, this.GetFriendlyAlias(path, portalAlias, true), pageName); } } } @@ -384,10 +384,10 @@ private string FriendlyUrl(TabInfo tab, string path, string pageName, string por else { //Return Search engine friendly version - friendlyPath = GetFriendlyQueryString(tab, GetFriendlyAlias(path, portalAlias, isPagePath), pageName); + friendlyPath = this.GetFriendlyQueryString(tab, this.GetFriendlyAlias(path, portalAlias, isPagePath), pageName); } - friendlyPath = CheckPathLength(Globals.ResolveUrl(friendlyPath), path); + friendlyPath = this.CheckPathLength(Globals.ResolveUrl(friendlyPath), path); // Replace http:// by https:// if SSL is enabled and site is marked as secure // (i.e. requests to http://... will be redirected to https://...) diff --git a/DNN Platform/Library/Entities/Urls/CacheController.cs b/DNN Platform/Library/Entities/Urls/CacheController.cs index a6c5926fd72..b3ad3a70e28 100644 --- a/DNN Platform/Library/Entities/Urls/CacheController.cs +++ b/DNN Platform/Library/Entities/Urls/CacheController.cs @@ -515,16 +515,16 @@ internal void StoreFriendlyUrlIndexInCache(SharedDictionary tabDictiona FriendlyUrlSettings settings, string reason) { - onRemovePageIndex = settings.LogCacheMessages ? (CacheItemRemovedCallback) RemovedPageIndexCallBack : null; + this.onRemovePageIndex = settings.LogCacheMessages ? (CacheItemRemovedCallback) this.RemovedPageIndexCallBack : null; //get list of portal ids for the portals we are storing in the page index var portalIds = new List(); @@ -714,7 +714,7 @@ internal void StorePageIndexInCache(SharedDictionary tabDictiona } //783 : use cache dependency to manage page index instead of triggerDictionaryRebuild regex. - SetPageCache(PageIndexKey, tabDictionary, new DNNCacheDependency(GetTabsCacheDependency(portalIds)), settings, onRemovePageIndex); + SetPageCache(PageIndexKey, tabDictionary, new DNNCacheDependency(this.GetTabsCacheDependency(portalIds)), settings, this.onRemovePageIndex); SetPageCache(PageIndexDepthKey, portalDepthInfo, settings); @@ -750,7 +750,7 @@ internal void StoreTabPathsInCache(int portalId, SharedDictionary { portalId })), + new DNNCacheDependency(this.GetTabsCacheDependency(new List { portalId })), settings, null); } diff --git a/DNN Platform/Library/Entities/Urls/Config/RewriterConfiguration.cs b/DNN Platform/Library/Entities/Urls/Config/RewriterConfiguration.cs index cef7994f5c7..4b7b125fa6c 100644 --- a/DNN Platform/Library/Entities/Urls/Config/RewriterConfiguration.cs +++ b/DNN Platform/Library/Entities/Urls/Config/RewriterConfiguration.cs @@ -30,11 +30,11 @@ public RewriterRuleCollection Rules { get { - return _rules; + return this._rules; } set { - _rules = value; + this._rules = value; } } diff --git a/DNN Platform/Library/Entities/Urls/Config/RewriterRule.cs b/DNN Platform/Library/Entities/Urls/Config/RewriterRule.cs index 143c374fc53..d8cd991599f 100644 --- a/DNN Platform/Library/Entities/Urls/Config/RewriterRule.cs +++ b/DNN Platform/Library/Entities/Urls/Config/RewriterRule.cs @@ -25,14 +25,14 @@ public string LookFor { get { - return _lookFor; + return this._lookFor; } set { - if (_lookFor != value) + if (this._lookFor != value) { - _lookFor = value; - _matchRx = null; + this._lookFor = value; + this._matchRx = null; } } } @@ -41,11 +41,11 @@ public string SendTo { get { - return _sendTo; + return this._sendTo; } set { - _sendTo = value; + this._sendTo = value; } } @@ -53,8 +53,8 @@ public string SendTo // also don't worry about locking; the worst case this will be created more than once public Regex GetRuleRegex(string applicationPath) { - return _matchRx ?? (_matchRx = - RegexUtils.GetCachedRegex("^" + RewriterUtils.ResolveUrl(applicationPath, LookFor) + "$", + return this._matchRx ?? (this._matchRx = + RegexUtils.GetCachedRegex("^" + RewriterUtils.ResolveUrl(applicationPath, this.LookFor) + "$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)); } } diff --git a/DNN Platform/Library/Entities/Urls/Config/RewriterRuleCollection.cs b/DNN Platform/Library/Entities/Urls/Config/RewriterRuleCollection.cs index 28c5f8300b5..a7376401e9a 100644 --- a/DNN Platform/Library/Entities/Urls/Config/RewriterRuleCollection.cs +++ b/DNN Platform/Library/Entities/Urls/Config/RewriterRuleCollection.cs @@ -18,17 +18,17 @@ public virtual RewriterRule this[int index] { get { - return (RewriterRule) List[index]; + return (RewriterRule) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public void Add(RewriterRule r) { - InnerList.Add(r); + this.InnerList.Add(r); } } } diff --git a/DNN Platform/Library/Entities/Urls/DupKeyCheck.cs b/DNN Platform/Library/Entities/Urls/DupKeyCheck.cs index 8b0c8b294d0..d63df40a678 100644 --- a/DNN Platform/Library/Entities/Urls/DupKeyCheck.cs +++ b/DNN Platform/Library/Entities/Urls/DupKeyCheck.cs @@ -11,10 +11,10 @@ internal class DupKeyCheck { public DupKeyCheck(string tabKey, string tabIdOriginal, string tabPath, bool isDeleted) { - TabKey = tabKey; - TabIdOriginal = tabIdOriginal; - TabPath = tabPath; - IsDeleted = isDeleted; + this.TabKey = tabKey; + this.TabIdOriginal = tabIdOriginal; + this.TabPath = tabPath; + this.IsDeleted = isDeleted; } public string TabKey { get; set; } diff --git a/DNN Platform/Library/Entities/Urls/ExtensionUrlProviderInfo.cs b/DNN Platform/Library/Entities/Urls/ExtensionUrlProviderInfo.cs index a37642fbaaa..6884d1e5f8f 100644 --- a/DNN Platform/Library/Entities/Urls/ExtensionUrlProviderInfo.cs +++ b/DNN Platform/Library/Entities/Urls/ExtensionUrlProviderInfo.cs @@ -16,15 +16,15 @@ public class ExtensionUrlProviderInfo : IHydratable { public ExtensionUrlProviderInfo() { - ExtensionUrlProviderId = -1; - Settings = new Dictionary(); - TabIds = new List(); + this.ExtensionUrlProviderId = -1; + this.Settings = new Dictionary(); + this.TabIds = new List(); } /// /// When true, the module provider will be used for all tabs in the current portal. Including a specific tabid switches value to false. /// - public bool AllTabs { get { return TabIds.Count == 0; } } + public bool AllTabs { get { return this.TabIds.Count == 0; } } /// /// The DesktopModuleId is used to associate a particular Extension Url Provider with a specific DotNetNuke extension. @@ -78,16 +78,16 @@ public ExtensionUrlProviderInfo() public void Fill(IDataReader dr) { - ExtensionUrlProviderId = Null.SetNullInteger(dr["ExtensionUrlProviderId"]); - PortalId = Null.SetNullInteger(dr["PortalId"]); - DesktopModuleId = Null.SetNullInteger(dr["DesktopModuleId"]); - ProviderName = Null.SetNullString(dr["ProviderName"]); - ProviderType = Null.SetNullString(dr["ProviderType"]); - SettingsControlSrc = Null.SetNullString(dr["SettingsControlSrc"]); - IsActive = Null.SetNullBoolean(dr["IsActive"]); - RewriteAllUrls = Null.SetNullBoolean(dr["RewriteAllUrls"]); - RedirectAllUrls = Null.SetNullBoolean(dr["RedirectAllUrls"]); - ReplaceAllUrls = Null.SetNullBoolean(dr["ReplaceAllUrls"]); + this.ExtensionUrlProviderId = Null.SetNullInteger(dr["ExtensionUrlProviderId"]); + this.PortalId = Null.SetNullInteger(dr["PortalId"]); + this.DesktopModuleId = Null.SetNullInteger(dr["DesktopModuleId"]); + this.ProviderName = Null.SetNullString(dr["ProviderName"]); + this.ProviderType = Null.SetNullString(dr["ProviderType"]); + this.SettingsControlSrc = Null.SetNullString(dr["SettingsControlSrc"]); + this.IsActive = Null.SetNullBoolean(dr["IsActive"]); + this.RewriteAllUrls = Null.SetNullBoolean(dr["RewriteAllUrls"]); + this.RedirectAllUrls = Null.SetNullBoolean(dr["RedirectAllUrls"]); + this.ReplaceAllUrls = Null.SetNullBoolean(dr["ReplaceAllUrls"]); } } diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlOptions.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlOptions.cs index c5625e2a878..4e2563ccda5 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlOptions.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlOptions.cs @@ -41,15 +41,15 @@ public bool CanGenerateNonStandardPath get { bool result = false; - if (string.IsNullOrEmpty(PunctuationReplacement) == false) + if (string.IsNullOrEmpty(this.PunctuationReplacement) == false) { result = true; } - else if (ReplaceCharWithChar != null && ReplaceCharWithChar.Count > 0) + else if (this.ReplaceCharWithChar != null && this.ReplaceCharWithChar.Count > 0) { result = true; } - else if (ConvertDiacriticChars) + else if (this.ConvertDiacriticChars) { result = true; } @@ -86,15 +86,15 @@ public FriendlyUrlOptions Clone() { var cloned = new FriendlyUrlOptions { - PunctuationReplacement = PunctuationReplacement, - SpaceEncoding = SpaceEncoding, - MaxUrlPathLength = MaxUrlPathLength, - ConvertDiacriticChars = ConvertDiacriticChars, - PageExtension = PageExtension, - RegexMatch = RegexMatch, - ReplaceCharWithChar = ReplaceCharWithChar, - IllegalChars = IllegalChars, - ReplaceChars = ReplaceChars + PunctuationReplacement = this.PunctuationReplacement, + SpaceEncoding = this.SpaceEncoding, + MaxUrlPathLength = this.MaxUrlPathLength, + ConvertDiacriticChars = this.ConvertDiacriticChars, + PageExtension = this.PageExtension, + RegexMatch = this.RegexMatch, + ReplaceCharWithChar = this.ReplaceCharWithChar, + IllegalChars = this.IllegalChars, + ReplaceChars = this.ReplaceChars }; return cloned; } diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs index 0baccedb792..55db5ff3f5c 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlProviderBase.cs @@ -25,17 +25,17 @@ internal FriendlyUrlProviderBase(NameValueCollection attributes) switch (attributes["urlFormat"].ToLowerInvariant()) { case "searchfriendly": - UrlFormat = UrlFormatType.SearchFriendly; + this.UrlFormat = UrlFormatType.SearchFriendly; break; case "humanfriendly": - UrlFormat = UrlFormatType.HumanFriendly; + this.UrlFormat = UrlFormatType.HumanFriendly; break; case "advanced": case "customonly": - UrlFormat = UrlFormatType.Advanced; + this.UrlFormat = UrlFormatType.Advanced; break; default: - UrlFormat = UrlFormatType.SearchFriendly; + this.UrlFormat = UrlFormatType.SearchFriendly; break; } } diff --git a/DNN Platform/Library/Entities/Urls/FriendlyUrlSettings.cs b/DNN Platform/Library/Entities/Urls/FriendlyUrlSettings.cs index ed42e8524b6..c6c2413c357 100644 --- a/DNN Platform/Library/Entities/Urls/FriendlyUrlSettings.cs +++ b/DNN Platform/Library/Entities/Urls/FriendlyUrlSettings.cs @@ -133,19 +133,19 @@ public List ProcessRequestList { get { - if (_processRequestList == null) + if (this._processRequestList == null) { - var processRequests = GetStringSetting(ProcessRequestsSetting, null); + var processRequests = this.GetStringSetting(ProcessRequestsSetting, null); if (processRequests != null) { processRequests = processRequests.ToLowerInvariant(); - _processRequestList = !string.IsNullOrEmpty(processRequests) + this._processRequestList = !string.IsNullOrEmpty(processRequests) ? new List(processRequests.Split(';')) : new List(); } } - return _processRequestList; + return this._processRequestList; } } @@ -159,13 +159,13 @@ public bool AllowDebugCode { get { - if (!_allowDebugCode.HasValue) + if (!this._allowDebugCode.HasValue) { //703 default debug code to false - _allowDebugCode = Host.Host.DebugMode; + this._allowDebugCode = Host.Host.DebugMode; } - return _allowDebugCode.Value; + return this._allowDebugCode.Value; } } @@ -173,25 +173,25 @@ public bool AutoAsciiConvert { get { - if (!_autoAsciiConvert.HasValue) + if (!this._autoAsciiConvert.HasValue) { //urls to be modified in the output html stream - _autoAsciiConvert = GetBooleanSetting(AutoAsciiConvertSetting, false); + this._autoAsciiConvert = this.GetBooleanSetting(AutoAsciiConvertSetting, false); } - return _autoAsciiConvert.Value; + return this._autoAsciiConvert.Value; } - internal set { _autoAsciiConvert = value; } + internal set { this._autoAsciiConvert = value; } } public TimeSpan CacheTime { get { - if (!_cacheTime.HasValue) + if (!this._cacheTime.HasValue) { - _cacheTime = new TimeSpan(0, GetIntegerSetting(CacheTimeSetting, 1440), 0); + this._cacheTime = new TimeSpan(0, this.GetIntegerSetting(CacheTimeSetting, 1440), 0); } - return _cacheTime.Value; + return this._cacheTime.Value; } } @@ -199,12 +199,12 @@ public bool CheckForDuplicateUrls { get { - if (!_checkForDuplicateUrls.HasValue) + if (!this._checkForDuplicateUrls.HasValue) { //793 : checkforDupUrls not being read - _checkForDuplicateUrls = GetBooleanSetting(CheckForDuplicatedUrlsSetting, true); + this._checkForDuplicateUrls = this.GetBooleanSetting(CheckForDuplicatedUrlsSetting, true); } - return _checkForDuplicateUrls.Value; + return this._checkForDuplicateUrls.Value; } } @@ -212,20 +212,20 @@ public DeletedTabHandlingType DeletedTabHandlingType { get { - if (_deletedTabHandling == null) + if (this._deletedTabHandling == null) { - _deletedTabHandling = PortalController.GetPortalSetting( - DeletedTabHandlingTypeSetting, PortalId, DeletedTabHandlingType.Do404Error.ToString()); + this._deletedTabHandling = PortalController.GetPortalSetting( + DeletedTabHandlingTypeSetting, this.PortalId, DeletedTabHandlingType.Do404Error.ToString()); } - return "do301redirecttoportalhome".Equals(_deletedTabHandling, StringComparison.InvariantCultureIgnoreCase) + return "do301redirecttoportalhome".Equals(this._deletedTabHandling, StringComparison.InvariantCultureIgnoreCase) ? DeletedTabHandlingType.Do301RedirectToPortalHome : DeletedTabHandlingType.Do404Error; } internal set { var newValue = value.ToString(); - _deletedTabHandling = newValue; + this._deletedTabHandling = newValue; } } @@ -235,12 +235,12 @@ public string DoNotIncludeInPathRegex { //661 : do not include in path //742 : was not reading and saving value when 'doNotIncludeInPathRegex' used - return _doNotIncludeInPathRegex ?? - (_doNotIncludeInPathRegex = - GetStringSetting(KeepInQueryStringRegexSetting, + return this._doNotIncludeInPathRegex ?? + (this._doNotIncludeInPathRegex = + this.GetStringSetting(KeepInQueryStringRegexSetting, @"/nomo/\d+|/runningDefault/[^/]+|/popup/(?:true|false)|/(?:page|category|sort|tags)/[^/]+|tou/[^/]+|(/utm[^/]+/[^/]+)+")); } - internal set { _doNotIncludeInPathRegex = value; } + internal set { this._doNotIncludeInPathRegex = value; } } public string DoNotRedirectRegex @@ -248,10 +248,10 @@ public string DoNotRedirectRegex get { //541 moved doNotRedirect and doNotRedirectRegex from under 'redirectUnfriendly' code - return _doNotRedirectRegex ?? (_doNotRedirectRegex = GetStringSetting(DoNotRedirectUrlRegexSetting, + return this._doNotRedirectRegex ?? (this._doNotRedirectRegex = this.GetStringSetting(DoNotRedirectUrlRegexSetting, @"(\.axd)|/Rss\.aspx|/SiteMap\.aspx|\.ashx|/LinkClick\.aspx|/Providers/|/DesktopModules/|ctl=MobilePreview|/ctl/MobilePreview|/API/")); } - internal set { _doNotRedirectRegex = value; } + internal set { this._doNotRedirectRegex = value; } } public string DoNotRedirectSecureRegex @@ -259,53 +259,53 @@ public string DoNotRedirectSecureRegex get { //541 moved doNotRedirect and doNotRedirectRegex from under 'redirectUnfriendly' code - return _doNotRedirectSecureRegex ?? (_doNotRedirectSecureRegex = GetStringSetting(DoNotRedirectHttpsUrlRegexSetting, string.Empty)); + return this._doNotRedirectSecureRegex ?? (this._doNotRedirectSecureRegex = this.GetStringSetting(DoNotRedirectHttpsUrlRegexSetting, string.Empty)); } - internal set { _doNotRedirectSecureRegex = value; } + internal set { this._doNotRedirectSecureRegex = value; } } public string DoNotRewriteRegex { get { - return _doNotRewriteRegex ?? - (_doNotRewriteRegex = - GetStringSetting(DoNotRewriteRegExSetting, @"/DesktopModules/|/Providers/|/LinkClick\.aspx|/profilepic\.ashx|/DnnImageHandler\.ashx|/__browserLink/|/API/")); + return this._doNotRewriteRegex ?? + (this._doNotRewriteRegex = + this.GetStringSetting(DoNotRewriteRegExSetting, @"/DesktopModules/|/Providers/|/LinkClick\.aspx|/profilepic\.ashx|/DnnImageHandler\.ashx|/__browserLink/|/API/")); } - internal set { _doNotRewriteRegex = value; } + internal set { this._doNotRewriteRegex = value; } } public bool ForceLowerCase { get { - if (!_forceLowerCase.HasValue) + if (!this._forceLowerCase.HasValue) { - _forceLowerCase = GetBooleanSetting(ForceLowerCaseSetting, false); + this._forceLowerCase = this.GetBooleanSetting(ForceLowerCaseSetting, false); } - return _forceLowerCase.Value; + return this._forceLowerCase.Value; } - internal set { _forceLowerCase = value; } + internal set { this._forceLowerCase = value; } } public string ForceLowerCaseRegex { - get { return _forceLowerCaseRegex ?? (_forceLowerCaseRegex = GetStringSetting(PreventLowerCaseUrlRegexSetting, string.Empty)); } - internal set { _forceLowerCaseRegex = value; } + get { return this._forceLowerCaseRegex ?? (this._forceLowerCaseRegex = this.GetStringSetting(PreventLowerCaseUrlRegexSetting, string.Empty)); } + internal set { this._forceLowerCaseRegex = value; } } public bool ForcePortalDefaultLanguage { get { - if (!_forcePortalDefaultLanguage.HasValue) + if (!this._forcePortalDefaultLanguage.HasValue) { //810 : allow forcing of default language in rewrites - _forcePortalDefaultLanguage = GetBooleanSetting(UsePortalDefaultLanguageSetting, true); + this._forcePortalDefaultLanguage = this.GetBooleanSetting(UsePortalDefaultLanguageSetting, true); } - return _forcePortalDefaultLanguage.Value; + return this._forcePortalDefaultLanguage.Value; } - internal set { _forcePortalDefaultLanguage = value; } + internal set { this._forcePortalDefaultLanguage = value; } } public DNNPageForwardType ForwardExternalUrlsType @@ -320,25 +320,25 @@ public bool FriendlyAdminHostUrls { get { - if (!_friendlyAdminHostUrls.HasValue) + if (!this._friendlyAdminHostUrls.HasValue) { - _friendlyAdminHostUrls = GetBooleanSetting(FriendlyAdminHostUrlsSetting, true); + this._friendlyAdminHostUrls = this.GetBooleanSetting(FriendlyAdminHostUrlsSetting, true); } - return _friendlyAdminHostUrls.Value; + return this._friendlyAdminHostUrls.Value; } - internal set { _friendlyAdminHostUrls = value; } + internal set { this._friendlyAdminHostUrls = value; } } public bool EnableCustomProviders { get { - if (!_enableCustomProviders.HasValue) + if (!this._enableCustomProviders.HasValue) { //894 : new switch to disable custom providers if necessary - _enableCustomProviders = GetBooleanSetting(EnableCustomProvidersSetting, true); + this._enableCustomProviders = this.GetBooleanSetting(EnableCustomProvidersSetting, true); } - return _enableCustomProviders.Value; + return this._enableCustomProviders.Value; } } @@ -346,12 +346,12 @@ public string IgnoreRegex { get { - return _ignoreRegex ?? - (_ignoreRegex = - GetStringSetting(IgnoreRegexSetting, + return this._ignoreRegex ?? + (this._ignoreRegex = + this.GetStringSetting(IgnoreRegexSetting, @"(?/\?:&=+|%#")); + return this._illegalChars ?? (this._illegalChars = this.GetStringSetting(IllegalCharsSetting, @"<>/\?:&=+|%#")); } } @@ -367,25 +367,25 @@ public bool IncludePageName { get { - if (!_includePageName.HasValue) + if (!this._includePageName.HasValue) { - _includePageName = GetBooleanSetting(IncludePageNameSetting, true); + this._includePageName = this.GetBooleanSetting(IncludePageNameSetting, true); } - return _includePageName.Value; + return this._includePageName.Value; } - internal set { _includePageName = value; } + internal set { this._includePageName = value; } } public bool LogCacheMessages { get { - if (!_logCacheMessages.HasValue) + if (!this._logCacheMessages.HasValue) { - _logCacheMessages = GetBooleanSetting(LogCacheMessagesSetting, false); + this._logCacheMessages = this.GetBooleanSetting(LogCacheMessagesSetting, false); } - return _logCacheMessages.Value; + return this._logCacheMessages.Value; } } @@ -394,28 +394,28 @@ public string NoFriendlyUrlRegex get { //655 : new noFriendlyUrlRegex value to ignore generation of certain urls - return _noFriendlyUrlRegex ?? (_noFriendlyUrlRegex = GetStringSetting(DoNotUseFriendlyUrlRegexSetting, @"/Rss\.aspx")); + return this._noFriendlyUrlRegex ?? (this._noFriendlyUrlRegex = this.GetStringSetting(DoNotUseFriendlyUrlRegexSetting, @"/Rss\.aspx")); } - internal set { _noFriendlyUrlRegex = value; } + internal set { this._noFriendlyUrlRegex = value; } } public string PageExtension { - get { return _pageExtension ?? (_pageExtension = GetStringSetting(PageExtensionSetting, ".aspx")); } - internal set { _pageExtension = value; } + get { return this._pageExtension ?? (this._pageExtension = this.GetStringSetting(PageExtensionSetting, ".aspx")); } + internal set { this._pageExtension = value; } } public PageExtensionUsageType PageExtensionUsageType { get { - if (_pageExtensionUsage == null) + if (this._pageExtensionUsage == null) { - _pageExtensionUsage = GetStringSetting(PageExtensionUsageSetting, PageExtensionUsageType.Never.ToString()); + this._pageExtensionUsage = this.GetStringSetting(PageExtensionUsageSetting, PageExtensionUsageType.Never.ToString()); } PageExtensionUsageType val; - switch (_pageExtensionUsage.ToLowerInvariant()) + switch (this._pageExtensionUsage.ToLowerInvariant()) { case "always": case "alwaysuse": @@ -436,7 +436,7 @@ public PageExtensionUsageType PageExtensionUsageType internal set { var newValue = value.ToString(); - _pageExtensionUsage = newValue; + this._pageExtensionUsage = newValue; } } @@ -444,75 +444,75 @@ public bool RedirectDefaultPage { get { - if (!_redirectDefaultPage.HasValue) + if (!this._redirectDefaultPage.HasValue) { - _redirectDefaultPage = GetBooleanSetting(RedirectDefaultPageSetting, false); + this._redirectDefaultPage = this.GetBooleanSetting(RedirectDefaultPageSetting, false); } - return _redirectDefaultPage.Value; + return this._redirectDefaultPage.Value; } - internal set { _redirectUnfriendly = value; } + internal set { this._redirectUnfriendly = value; } } public bool RedirectOldProfileUrl { get { - if (!_redirectOldProfileUrl.HasValue) + if (!this._redirectOldProfileUrl.HasValue) { - _redirectOldProfileUrl = PortalController.GetPortalSettingAsBoolean(RedirectOldProfileUrlSetting, PortalId, true); + this._redirectOldProfileUrl = PortalController.GetPortalSettingAsBoolean(RedirectOldProfileUrlSetting, this.PortalId, true); } - return _redirectOldProfileUrl.Value; + return this._redirectOldProfileUrl.Value; } - internal set { _redirectOldProfileUrl = value; } + internal set { this._redirectOldProfileUrl = value; } } public bool RedirectUnfriendly { get { - if (!_redirectUnfriendly.HasValue) + if (!this._redirectUnfriendly.HasValue) { - _redirectUnfriendly = GetBooleanSetting(RedirectUnfriendlySetting, true); + this._redirectUnfriendly = this.GetBooleanSetting(RedirectUnfriendlySetting, true); } - return _redirectUnfriendly.Value; + return this._redirectUnfriendly.Value; } - internal set { _redirectUnfriendly = value; } + internal set { this._redirectUnfriendly = value; } } public bool RedirectWrongCase { get { - if (!_redirectWrongCase.HasValue) + if (!this._redirectWrongCase.HasValue) { - _redirectWrongCase = GetBooleanSetting(RedirectMixedCaseSetting, false); + this._redirectWrongCase = this.GetBooleanSetting(RedirectMixedCaseSetting, false); } - return _redirectWrongCase.Value; + return this._redirectWrongCase.Value; } - internal set { _redirectWrongCase = value; } + internal set { this._redirectWrongCase = value; } } public string Regex404 { - get { return _regex404 ?? (_regex404 = GetStringSetting(Regex404Setting, string.Empty)); } + get { return this._regex404 ?? (this._regex404 = this.GetStringSetting(Regex404Setting, string.Empty)); } } public string RegexMatch { - get { return _regexMatch ?? (_regexMatch = GetStringSetting(ValidFriendlyUrlRegexSetting, @"[^\w\d _-]")); } - internal set { _regexMatch = value; } + get { return this._regexMatch ?? (this._regexMatch = this.GetStringSetting(ValidFriendlyUrlRegexSetting, @"[^\w\d _-]")); } + internal set { this._regexMatch = value; } } public Dictionary ReplaceCharacterDictionary { get { - if (_replaceCharacterDictionary == null) + if (this._replaceCharacterDictionary == null) { - var replaceCharwithChar = GetStringSetting(ReplaceCharWithCharSetting, string.Empty); - _replaceCharacterDictionary = CollectionExtensions.CreateDictionaryFromString(replaceCharwithChar == "[]" ? string.Empty : replaceCharwithChar, ';', ','); + var replaceCharwithChar = this.GetStringSetting(ReplaceCharWithCharSetting, string.Empty); + this._replaceCharacterDictionary = CollectionExtensions.CreateDictionaryFromString(replaceCharwithChar == "[]" ? string.Empty : replaceCharwithChar, ';', ','); } - return _replaceCharacterDictionary; + return this._replaceCharacterDictionary; } } @@ -521,7 +521,7 @@ public string ReplaceChars get { //922 : new options for allowing user-configured replacement of characters - return _replaceChars ?? (_replaceChars = GetStringSetting(ReplaceCharsSetting, @" &$+,/?~#<>()¿¡«»!""")); + return this._replaceChars ?? (this._replaceChars = this.GetStringSetting(ReplaceCharsSetting, @" &$+,/?~#<>()¿¡«»!""")); } } @@ -529,12 +529,12 @@ public bool ReplaceDoubleChars { get { - if (!_replaceDoubleChars.HasValue) + if (!this._replaceDoubleChars.HasValue) { //922 : new options for allowing user-configured replacement of characters - _replaceDoubleChars = GetBooleanSetting(ReplaceDoubleCharsSetting, true); + this._replaceDoubleChars = this.GetBooleanSetting(ReplaceDoubleCharsSetting, true); } - return _replaceDoubleChars.Value; + return this._replaceDoubleChars.Value; } } @@ -543,28 +543,28 @@ public string ReplaceSpaceWith get { //791 : use threadlocking option - return _replaceSpaceWith ?? (_replaceSpaceWith = GetStringSetting(ReplaceSpaceWithSetting, "-")); + return this._replaceSpaceWith ?? (this._replaceSpaceWith = this.GetStringSetting(ReplaceSpaceWithSetting, "-")); } - internal set { _replaceSpaceWith = value; } + internal set { this._replaceSpaceWith = value; } } public string SpaceEncodingValue { - get { return _spaceEncodingValue ?? (_spaceEncodingValue = GetStringSetting(SpaceEncodingValueSetting, SpaceEncodingHex)); } - internal set { _spaceEncodingValue = value; } + get { return this._spaceEncodingValue ?? (this._spaceEncodingValue = this.GetStringSetting(SpaceEncodingValueSetting, SpaceEncodingHex)); } + internal set { this._spaceEncodingValue = value; } } public bool SSLClientRedirect { get { - if (!_sslClientRedirect.HasValue) + if (!this._sslClientRedirect.HasValue) { - _sslClientRedirect = GetBooleanSetting(SslClientRedirectSetting, false); + this._sslClientRedirect = this.GetBooleanSetting(SslClientRedirectSetting, false); } - return _sslClientRedirect.Value; + return this._sslClientRedirect.Value; } - internal set { _sslClientRedirect = value; } + internal set { this._sslClientRedirect = value; } } public int TabId404 { get; private set; } @@ -573,50 +573,50 @@ public bool SSLClientRedirect public string Url404 { - get { return _url404 ?? (_url404 = GetStringSetting(Url404Setting, string.Empty)); } + get { return this._url404 ?? (this._url404 = this.GetStringSetting(Url404Setting, string.Empty)); } } public string Url500 { - get { return _url500 ?? (_url500 = GetStringSetting(Url500Setting, null) ?? Url404); } + get { return this._url500 ?? (this._url500 = this.GetStringSetting(Url500Setting, null) ?? this.Url404); } } public string UrlFormat { get { - return _urlFormat ?? (_urlFormat = GetStringSetting(UrlFormatSetting, "advanced")); + return this._urlFormat ?? (this._urlFormat = this.GetStringSetting(UrlFormatSetting, "advanced")); } - internal set { _urlFormat = value; } + internal set { this._urlFormat = value; } } public string UseBaseFriendlyUrls { get { - if (_useBaseFriendlyUrls == null) + if (this._useBaseFriendlyUrls == null) { - _useBaseFriendlyUrls = GetStringSetting(UseBaseFriendlyUrlsSetting, string.Empty); - if (!string.IsNullOrEmpty(UseBaseFriendlyUrls) && !UseBaseFriendlyUrls.EndsWith(";")) + this._useBaseFriendlyUrls = this.GetStringSetting(UseBaseFriendlyUrlsSetting, string.Empty); + if (!string.IsNullOrEmpty(this.UseBaseFriendlyUrls) && !this.UseBaseFriendlyUrls.EndsWith(";")) { - _useBaseFriendlyUrls += ";"; + this._useBaseFriendlyUrls += ";"; } } - return _useBaseFriendlyUrls; + return this._useBaseFriendlyUrls; } - internal set { _useBaseFriendlyUrls = value; } + internal set { this._useBaseFriendlyUrls = value; } } public string UseSiteUrlsRegex { get { - return _useSiteUrlsRegex ?? - (_useSiteUrlsRegex = - GetStringSetting(SiteUrlsOnlyRegexSetting, + return this._useSiteUrlsRegex ?? + (this._useSiteUrlsRegex = + this.GetStringSetting(SiteUrlsOnlyRegexSetting, @"/rss\.aspx|Telerik.RadUploadProgressHandler\.ashx|BannerClickThrough\.aspx|(?:/[^/]+)*/Tabid/\d+/.*default\.aspx")); } - internal set { _useSiteUrlsRegex = value; } + internal set { this._useSiteUrlsRegex = value; } } public string ValidExtensionlessUrlsRegex @@ -624,35 +624,35 @@ public string ValidExtensionlessUrlsRegex get { //893 : new extensionless Urls check for validating urls which have no extension but aren't 404 - return _validExtensionlessUrlsRegex ?? - (_validExtensionlessUrlsRegex = GetStringSetting(UrlsWithNoExtensionRegexSetting, @"\.asmx/|\.ashx/|\.svc/|\.aspx/|\.axd/")); + return this._validExtensionlessUrlsRegex ?? + (this._validExtensionlessUrlsRegex = this.GetStringSetting(UrlsWithNoExtensionRegexSetting, @"\.asmx/|\.ashx/|\.svc/|\.aspx/|\.axd/")); } - internal set { _validExtensionlessUrlsRegex = value; } + internal set { this._validExtensionlessUrlsRegex = value; } } public string InternalAliases { get { - if (_internalAliases == null) + if (this._internalAliases == null) { // allow for a list of internal aliases - InternalAliases = GetStringSetting(InternalAliasesSetting, string.Empty); // calls the setter + this.InternalAliases = this.GetStringSetting(InternalAliasesSetting, string.Empty); // calls the setter } - return _internalAliases; + return this._internalAliases; } internal set { - _internalAliases = value; - ParseInternalAliases(); //splits into list + this._internalAliases = value; + this.ParseInternalAliases(); //splits into list } } public string VanityUrlPrefix { - get { return _vanityUrlPrefix ?? (_vanityUrlPrefix = GetStringSetting(VanityUrlPrefixSetting, "users")); } - internal set { _vanityUrlPrefix = value; } + get { return this._vanityUrlPrefix ?? (this._vanityUrlPrefix = this.GetStringSetting(VanityUrlPrefixSetting, "users")); } + internal set { this._vanityUrlPrefix = value; } } #endregion @@ -662,12 +662,12 @@ public string VanityUrlPrefix private bool GetBooleanSetting(string key, bool defaultValue) { //First Get the Host Value using the passed in value as default - var returnValue = _hostControllerInstance.GetBoolean(key, defaultValue); + var returnValue = this._hostControllerInstance.GetBoolean(key, defaultValue); - if (PortalId > -1) + if (this.PortalId > -1) { //Next check if there is a Portal Value, using the Host value as default - returnValue = PortalController.GetPortalSettingAsBoolean(key, PortalId, returnValue); + returnValue = PortalController.GetPortalSettingAsBoolean(key, this.PortalId, returnValue); } return returnValue; @@ -676,12 +676,12 @@ private bool GetBooleanSetting(string key, bool defaultValue) private int GetIntegerSetting(string key, int defaultValue) { //First Get the Host Value using the passed in value as default - var returnValue = _hostControllerInstance.GetInteger(key, defaultValue); + var returnValue = this._hostControllerInstance.GetInteger(key, defaultValue); - if (PortalId > -1) + if (this.PortalId > -1) { //Next check if there is a Portal Value, using the Host value as default - returnValue = PortalController.GetPortalSettingAsInteger(key, PortalId, returnValue); + returnValue = PortalController.GetPortalSettingAsInteger(key, this.PortalId, returnValue); } return returnValue; @@ -690,12 +690,12 @@ private int GetIntegerSetting(string key, int defaultValue) private string GetStringSetting(string key, string defaultValue) { //First Get the Host Value using the passed in value as default - var returnValue = _hostControllerInstance.GetString(key, defaultValue); + var returnValue = this._hostControllerInstance.GetString(key, defaultValue); - if (PortalId > -1) + if (this.PortalId > -1) { //Next check if there is a Portal Value, using the Host value as default - returnValue = PortalController.GetPortalSetting(key, PortalId, returnValue); + returnValue = PortalController.GetPortalSetting(key, this.PortalId, returnValue); } return returnValue; @@ -707,40 +707,40 @@ private string GetStringSetting(string key, string defaultValue) public FriendlyUrlSettings(int portalId) { - PortalId = portalId < -1 ? -1 : portalId; - IsDirty = false; - IsLoading = false; + this.PortalId = portalId < -1 ? -1 : portalId; + this.IsDirty = false; + this.IsLoading = false; - PortalValues = new List(); + this.PortalValues = new List(); - TabId500 = TabId404 = -1; + this.TabId500 = this.TabId404 = -1; if (portalId > -1) { var portal = PortalController.Instance.GetPortal(portalId); - TabId500 = TabId404 = portal.Custom404TabId; + this.TabId500 = this.TabId404 = portal.Custom404TabId; - if (TabId500 == -1) + if (this.TabId500 == -1) { - TabId500 = TabId404; + this.TabId500 = this.TabId404; } } } private void ParseInternalAliases() { - if (!string.IsNullOrEmpty(_internalAliases)) + if (!string.IsNullOrEmpty(this._internalAliases)) { - InternalAliasList = new List(); - var raw = _internalAliases.Split(';'); + this.InternalAliasList = new List(); + var raw = this._internalAliases.Split(';'); foreach (var rawVal in raw) { if (rawVal.Length > 0) { var ia = new InternalAlias { HttpAlias = rawVal }; - if (InternalAliasList.Contains(ia) == false) + if (this.InternalAliasList.Contains(ia) == false) { - InternalAliasList.Add(ia); + this.InternalAliasList.Add(ia); } } } diff --git a/DNN Platform/Library/Entities/Urls/PagingInfo.cs b/DNN Platform/Library/Entities/Urls/PagingInfo.cs index f1626a54da1..3b45b8d7832 100644 --- a/DNN Platform/Library/Entities/Urls/PagingInfo.cs +++ b/DNN Platform/Library/Entities/Urls/PagingInfo.cs @@ -11,8 +11,8 @@ public class PagingInfo { public PagingInfo(int pageNumber, int pageSize) { - PageNumber = pageNumber; - PageSize = pageSize; + this.PageNumber = pageNumber; + this.PageSize = pageSize; } public int PageNumber { get; private set; } @@ -31,7 +31,7 @@ public bool IsLastPage { get { - if (LastRow >= (TotalRows)) + if (this.LastRow >= (this.TotalRows)) { return true; } @@ -44,10 +44,10 @@ public bool IsLastPage public void UpdatePageResults(int firstRow, int lastRow, int totalRows, int totalPages) { - FirstRow = firstRow; - LastRow = lastRow; - TotalRows = totalRows; - TotalPages = totalPages; + this.FirstRow = firstRow; + this.LastRow = lastRow; + this.TotalRows = totalRows; + this.TotalPages = totalPages; } } } diff --git a/DNN Platform/Library/Entities/Urls/PathSizes.cs b/DNN Platform/Library/Entities/Urls/PathSizes.cs index 344a14ccb13..de438f91fde 100644 --- a/DNN Platform/Library/Entities/Urls/PathSizes.cs +++ b/DNN Platform/Library/Entities/Urls/PathSizes.cs @@ -21,25 +21,25 @@ public class PathSizes public void SetAliasDepth(string httpAlias) { int aliasPathDepth = httpAlias.Length - httpAlias.Replace("/", "").Length; - if (aliasPathDepth > MaxAliasDepth) + if (aliasPathDepth > this.MaxAliasDepth) { - MaxAliasDepth = aliasPathDepth; + this.MaxAliasDepth = aliasPathDepth; } - if (aliasPathDepth < MinAliasDepth) + if (aliasPathDepth < this.MinAliasDepth) { - MinAliasDepth = aliasPathDepth; + this.MinAliasDepth = aliasPathDepth; } } public void SetTabPathDepth(int tabPathDepth) { - if (tabPathDepth > MaxTabPathDepth) + if (tabPathDepth > this.MaxTabPathDepth) { - MaxTabPathDepth = tabPathDepth; + this.MaxTabPathDepth = tabPathDepth; } - if (tabPathDepth < MinTabPathDepth) + if (tabPathDepth < this.MinTabPathDepth) { - MinTabPathDepth = tabPathDepth; + this.MinTabPathDepth = tabPathDepth; } } } diff --git a/DNN Platform/Library/Entities/Urls/UrlAction.cs b/DNN Platform/Library/Entities/Urls/UrlAction.cs index 95ca6916e6b..d2ff3f95b6b 100644 --- a/DNN Platform/Library/Entities/Urls/UrlAction.cs +++ b/DNN Platform/Library/Entities/Urls/UrlAction.cs @@ -24,9 +24,9 @@ public class UrlAction //829 add in constructor that works around physical path length restriction public UrlAction(HttpRequest request) { - BrowserType = BrowserTypes.Normal; - CanRewrite = StateBoolean.NotSet; - Action = ActionType.Continue; + this.BrowserType = BrowserTypes.Normal; + this.CanRewrite = StateBoolean.NotSet; + this.Action = ActionType.Continue; string physicalPath = ""; try { @@ -36,52 +36,52 @@ public UrlAction(HttpRequest request) { //don't handle exception, but put something into the physical path physicalPath = request.ApplicationPath; //will be no file for this location - VirtualPath = StateBoolean.True; + this.VirtualPath = StateBoolean.True; } catch (ArgumentException) { //don't handle exception, but put something into the physical path physicalPath = request.ApplicationPath; //will be no file for this location - VirtualPath = StateBoolean.True; + this.VirtualPath = StateBoolean.True; } finally { - Constructor(request.Url.Scheme, request.ApplicationPath, physicalPath); + this.Constructor(request.Url.Scheme, request.ApplicationPath, physicalPath); } } public UrlAction(string scheme, string applicationPath, string physicalPath) { - BrowserType = BrowserTypes.Normal; - CanRewrite = StateBoolean.NotSet; - Action = ActionType.Continue; - Constructor(scheme, applicationPath, physicalPath); + this.BrowserType = BrowserTypes.Normal; + this.CanRewrite = StateBoolean.NotSet; + this.Action = ActionType.Continue; + this.Constructor(scheme, applicationPath, physicalPath); } private void Constructor(string scheme, string applicationPath, string physicalPath) { if (scheme.EndsWith("://") == false) { - Scheme = scheme + "://"; + this.Scheme = scheme + "://"; } else { - Scheme = scheme; + this.Scheme = scheme; } - ApplicationPath = applicationPath; + this.ApplicationPath = applicationPath; string domainPath = applicationPath.Replace(scheme, ""); - DomainName = domainPath.Contains("/") ? domainPath.Substring(0, domainPath.IndexOf('/')) : domainPath; - PhysicalPath = physicalPath; - PortalId = -1; - TabId = -1; - Reason = RedirectReason.Not_Redirected; - FriendlyRewrite = false; - BypassCachedDictionary = false; - VirtualPath = StateBoolean.NotSet; - IsSecureConnection = false; - IsSSLOffloaded = false; - DebugMessages = new List(); - CultureCode = null; + this.DomainName = domainPath.Contains("/") ? domainPath.Substring(0, domainPath.IndexOf('/')) : domainPath; + this.PhysicalPath = physicalPath; + this.PortalId = -1; + this.TabId = -1; + this.Reason = RedirectReason.Not_Redirected; + this.FriendlyRewrite = false; + this.BypassCachedDictionary = false; + this.VirtualPath = StateBoolean.NotSet; + this.IsSecureConnection = false; + this.IsSSLOffloaded = false; + this.DebugMessages = new List(); + this.CultureCode = null; } #region Private Members @@ -138,15 +138,15 @@ private void Constructor(string scheme, string applicationPath, string physicalP //the alias for the current request public PortalAliasInfo PortalAlias { - get { return _portalAlias; } + get { return this._portalAlias; } set { if (value != null) { - PortalId = value.PortalID; - HttpAlias = value.HTTPAlias; + this.PortalId = value.PortalID; + this.HttpAlias = value.HTTPAlias; } - _portalAlias = value; + this._portalAlias = value; } } //the primary alias, if different to the current alias @@ -177,16 +177,16 @@ public void SetActionWithNoDowngrade(ActionType newAction) switch (newAction) { case ActionType.CheckFor301: - if (Action != ActionType.Redirect301 - && Action != ActionType.Redirect302 - && Action != ActionType.Redirect302Now - && Action != ActionType.Output404) + if (this.Action != ActionType.Redirect301 + && this.Action != ActionType.Redirect302 + && this.Action != ActionType.Redirect302Now + && this.Action != ActionType.Output404) { - Action = newAction; + this.Action = newAction; } break; default: - Action = newAction; + this.Action = newAction; break; } } @@ -194,38 +194,38 @@ public void SetActionWithNoDowngrade(ActionType newAction) public void AddLicensedProviders(List licensedProviders) { - if (_licensedProviders == null) + if (this._licensedProviders == null) { - _licensedProviders = new List(); + this._licensedProviders = new List(); } foreach (string lp in licensedProviders) { - if (_licensedProviders.Contains(lp.ToLowerInvariant()) == false) + if (this._licensedProviders.Contains(lp.ToLowerInvariant()) == false) { - _licensedProviders.Add(lp.ToLowerInvariant()); + this._licensedProviders.Add(lp.ToLowerInvariant()); } } } public void AddLicensedProvider(string providerName) { - if (_licensedProviders == null) + if (this._licensedProviders == null) { - _licensedProviders = new List(); + this._licensedProviders = new List(); } - if (_licensedProviders.Contains(providerName.ToLowerInvariant()) == false) + if (this._licensedProviders.Contains(providerName.ToLowerInvariant()) == false) { - _licensedProviders.Add(providerName.ToLowerInvariant()); + this._licensedProviders.Add(providerName.ToLowerInvariant()); } } public bool IsProviderLicensed(string providerName) { - if (_licensedProviders == null) + if (this._licensedProviders == null) { return false; } - return _licensedProviders.Contains(providerName.ToLowerInvariant()); + return this._licensedProviders.Contains(providerName.ToLowerInvariant()); } /// @@ -235,11 +235,11 @@ public bool IsProviderLicensed(string providerName) /// public void SetOriginalPath(string path, FriendlyUrlSettings settings) { - OriginalPath = path; - OriginalPathNoAlias = path; - if (!string.IsNullOrEmpty(HttpAlias) && path.Contains(HttpAlias)) + this.OriginalPath = path; + this.OriginalPathNoAlias = path; + if (!string.IsNullOrEmpty(this.HttpAlias) && path.Contains(this.HttpAlias)) { - OriginalPathNoAlias = path.Substring(path.IndexOf(HttpAlias, StringComparison.Ordinal) + HttpAlias.Length); + this.OriginalPathNoAlias = path.Substring(path.IndexOf(this.HttpAlias, StringComparison.Ordinal) + this.HttpAlias.Length); } } @@ -248,7 +248,7 @@ public void SetBrowserType(HttpRequest request, HttpResponse response, FriendlyU //set the mobile browser type if (request != null && response != null && settings != null) { - BrowserType = FriendlyUrlController.GetBrowserType(request, response, settings); + this.BrowserType = FriendlyUrlController.GetBrowserType(request, response, settings); } } @@ -260,20 +260,20 @@ public void SetRedirectAllowed(string path, FriendlyUrlSettings settings) if (!string.IsNullOrEmpty(regexExpr)) { //if a regex match, redirect Not allowed - RedirectAllowed = !Regex.IsMatch(path, regexExpr, RegexOptions.IgnoreCase); + this.RedirectAllowed = !Regex.IsMatch(path, regexExpr, RegexOptions.IgnoreCase); } else { - RedirectAllowed = true; + this.RedirectAllowed = true; } } catch (Exception ex) { - RedirectAllowed = true; //default : true, unless regex allows it. So if regex causes an exception + this.RedirectAllowed = true; //default : true, unless regex allows it. So if regex causes an exception //then we should allow the redirect UrlRewriterUtils.LogExceptionInRequest(ex, "Not Set", this); - Ex = ex; + this.Ex = ex; } } diff --git a/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordController.cs b/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordController.cs index f5ffd97c16d..fc0e0197352 100644 --- a/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordController.cs +++ b/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordController.cs @@ -29,7 +29,7 @@ private void AddPasswordHistory(int userId, string password, int passwordsRetain { using (HashAlgorithm ha = HashAlgorithm.Create()) { - byte[] newSalt = GetRandomSaltValue(); + byte[] newSalt = this.GetRandomSaltValue(); byte[] bytePassword = Encoding.Unicode.GetBytes(password); var inputBuffer = new byte[bytePassword.Length + 16]; Buffer.BlockCopy(bytePassword, 0, inputBuffer, 0, bytePassword.Length); @@ -37,7 +37,7 @@ private void AddPasswordHistory(int userId, string password, int passwordsRetain byte[] bhashedPassword = ha.ComputeHash(inputBuffer); string hashedPassword = Convert.ToBase64String(bhashedPassword); - _dataProvider.AddPasswordHistory(userId, hashedPassword, Convert.ToBase64String(newSalt), passwordsRetained, daysRetained); + this._dataProvider.AddPasswordHistory(userId, hashedPassword, Convert.ToBase64String(newSalt), passwordsRetained, daysRetained); } } @@ -59,7 +59,7 @@ private byte[] GetRandomSaltValue() /// list of PasswordHistory objects public List GetPasswordHistory(int userId) { - return GetPasswordHistory(userId, Null.NullInteger); + return this.GetPasswordHistory(userId, Null.NullInteger); } /// @@ -71,7 +71,7 @@ public List GetPasswordHistory(int userId, int portalId) { var settings = new MembershipPasswordSettings(portalId); List history = - CBO.FillCollection(_dataProvider.GetPasswordHistory(userId, settings.NumberOfPasswordsStored, settings.NumberOfDaysBeforePasswordReuse)); + CBO.FillCollection(this._dataProvider.GetPasswordHistory(userId, settings.NumberOfPasswordsStored, settings.NumberOfDaysBeforePasswordReuse)); return history; } @@ -83,7 +83,7 @@ public List GetPasswordHistory(int userId, int portalId) /// true if password has not been used in users history, false otherwise public bool IsPasswordInHistory(int userId, int portalId, string newPassword) { - return IsPasswordInHistory(userId, portalId, newPassword, true); + return this.IsPasswordInHistory(userId, portalId, newPassword, true); } /// @@ -100,11 +100,11 @@ public bool IsPasswordInHistory(int userId, int portalId, string newPassword, bo var settings = new MembershipPasswordSettings(portalId); if (settings.EnablePasswordHistory) { - if (!IsPasswordPreviouslyUsed(userId, newPassword)) + if (!this.IsPasswordPreviouslyUsed(userId, newPassword)) { if (autoAdd) { - AddPasswordHistory(userId, newPassword, settings.NumberOfPasswordsStored, settings.NumberOfDaysBeforePasswordReuse); + this.AddPasswordHistory(userId, newPassword, settings.NumberOfPasswordsStored, settings.NumberOfDaysBeforePasswordReuse); } } else @@ -126,7 +126,7 @@ public bool IsPasswordPreviouslyUsed(int userId, string password) //use default algorithm (SHA1CryptoServiceProvider ) using (HashAlgorithm ha = HashAlgorithm.Create()) { - List history = GetPasswordHistory(userId); + List history = this.GetPasswordHistory(userId); foreach (PasswordHistory ph in history) { string oldEncodedPassword = ph.Password; diff --git a/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordSettings.cs b/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordSettings.cs index 8e80d8d1a97..5f85329fa81 100644 --- a/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordSettings.cs +++ b/DNN Platform/Library/Entities/Users/Membership/MembershipPasswordSettings.cs @@ -82,24 +82,24 @@ public string ValidationExpression public MembershipPasswordSettings(int portalId) { //portalId not used currently - left in place for potential site specific settings - PortalId = portalId; + this.PortalId = portalId; if (HttpContext.Current != null && !IsInstallRequest(HttpContext.Current.Request)) { - EnableBannedList = Host.Host.EnableBannedList; - EnableStrengthMeter = Host.Host.EnableStrengthMeter; - EnableIPChecking = Host.Host.EnableIPChecking; - EnablePasswordHistory = Host.Host.EnablePasswordHistory; - - ResetLinkValidity = Host.Host.MembershipResetLinkValidity; - NumberOfPasswordsStored = Host.Host.MembershipNumberPasswords; - NumberOfDaysBeforePasswordReuse = Host.Host.MembershipDaysBeforePasswordReuse; + this.EnableBannedList = Host.Host.EnableBannedList; + this.EnableStrengthMeter = Host.Host.EnableStrengthMeter; + this.EnableIPChecking = Host.Host.EnableIPChecking; + this.EnablePasswordHistory = Host.Host.EnablePasswordHistory; + + this.ResetLinkValidity = Host.Host.MembershipResetLinkValidity; + this.NumberOfPasswordsStored = Host.Host.MembershipNumberPasswords; + this.NumberOfDaysBeforePasswordReuse = Host.Host.MembershipDaysBeforePasswordReuse; } else //setup default values during install process. { - EnableStrengthMeter = true; - EnableBannedList = true; - EnablePasswordHistory = true; + this.EnableStrengthMeter = true; + this.EnableBannedList = true; + this.EnablePasswordHistory = true; } } diff --git a/DNN Platform/Library/Entities/Users/Membership/MembershipPropertyAccess.cs b/DNN Platform/Library/Entities/Users/Membership/MembershipPropertyAccess.cs index f5700d9b33d..6d807ef366f 100644 --- a/DNN Platform/Library/Entities/Users/Membership/MembershipPropertyAccess.cs +++ b/DNN Platform/Library/Entities/Users/Membership/MembershipPropertyAccess.cs @@ -19,17 +19,17 @@ public class MembershipPropertyAccess : IPropertyAccess public MembershipPropertyAccess(UserInfo User) { - objUser = User; + this.objUser = User; } #region IPropertyAccess Members public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo AccessingUser, Scope CurrentScope, ref bool PropertyNotFound) { - UserMembership objMembership = objUser.Membership; - bool UserQueriesHimself = (objUser.UserID == AccessingUser.UserID && objUser.UserID != -1); + UserMembership objMembership = this.objUser.Membership; + bool UserQueriesHimself = (this.objUser.UserID == AccessingUser.UserID && this.objUser.UserID != -1); if (CurrentScope < Scope.DefaultSettings || (CurrentScope == Scope.DefaultSettings && !UserQueriesHimself) || - ((CurrentScope != Scope.SystemMessages || objUser.IsSuperUser) + ((CurrentScope != Scope.SystemMessages || this.objUser.IsSuperUser) && (propertyName.Equals("password", StringComparison.InvariantCultureIgnoreCase) || propertyName.Equals("passwordanswer", StringComparison.InvariantCultureIgnoreCase) || propertyName.Equals("passwordquestion", StringComparison.InvariantCultureIgnoreCase)) )) { @@ -68,15 +68,15 @@ public string GetProperty(string propertyName, string format, CultureInfo format case "passwordquestion": return PropertyAccess.FormatString(objMembership.PasswordQuestion, format); case "passwordresettoken": - return PropertyAccess.FormatString(Convert.ToString(objUser.PasswordResetToken), format); + return PropertyAccess.FormatString(Convert.ToString(this.objUser.PasswordResetToken), format); case "passwordresetexpiration": - return PropertyAccess.FormatString(objUser.PasswordResetExpiration.ToString(formatProvider), format); + return PropertyAccess.FormatString(this.objUser.PasswordResetExpiration.ToString(formatProvider), format); case "updatepassword": return (PropertyAccess.Boolean2LocalizedYesNo(objMembership.UpdatePassword, formatProvider)); case "username": - return (PropertyAccess.FormatString(objUser.Username, format)); + return (PropertyAccess.FormatString(this.objUser.Username, format)); case "email": - return (PropertyAccess.FormatString(objUser.Email, format)); + return (PropertyAccess.FormatString(this.objUser.Email, format)); } return PropertyAccess.GetObjectProperty(objMembership, propertyName, format, formatProvider, ref PropertyNotFound); } diff --git a/DNN Platform/Library/Entities/Users/Membership/PasswordHistory.cs b/DNN Platform/Library/Entities/Users/Membership/PasswordHistory.cs index e53e47e1739..b5fcde26a7e 100644 --- a/DNN Platform/Library/Entities/Users/Membership/PasswordHistory.cs +++ b/DNN Platform/Library/Entities/Users/Membership/PasswordHistory.cs @@ -28,7 +28,7 @@ public void Fill(IDataReader dr) this.PasswordSalt = (dr["PasswordSalt"]).ToString(); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } diff --git a/DNN Platform/Library/Entities/Users/Membership/UserMembership.cs b/DNN Platform/Library/Entities/Users/Membership/UserMembership.cs index 1abc4e98dac..c6fd7913913 100644 --- a/DNN Platform/Library/Entities/Users/Membership/UserMembership.cs +++ b/DNN Platform/Library/Entities/Users/Membership/UserMembership.cs @@ -37,8 +37,8 @@ public UserMembership() : this(new UserInfo()) public UserMembership(UserInfo user) { - _approved = true; - _user = user; + this._approved = true; + this._user = user; } /// ----------------------------------------------------------------------------- @@ -50,16 +50,16 @@ public bool Approved { get { - return _approved; + return this._approved; } set { - if (!_approved && value) + if (!this._approved && value) { - Approving = true; + this.Approving = true; } - _approved = value; + this._approved = value; } } @@ -67,7 +67,7 @@ public bool Approved internal void ConfirmApproved() { - Approving = false; + this.Approving = false; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs b/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs index 29eb6cfb2dd..c21ac8e16df 100644 --- a/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs +++ b/DNN Platform/Library/Entities/Users/Profile/ProfilePropertyAccess.cs @@ -78,25 +78,25 @@ private static bool IsUser(UserInfo accessingUser, UserInfo targetUser) public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound) { - if (currentScope >= Scope.DefaultSettings && user != null && user.Profile != null) + if (currentScope >= Scope.DefaultSettings && this.user != null && this.user.Profile != null) { - var profile = user.Profile; + var profile = this.user.Profile; var property = profile.ProfileProperties.Cast() .SingleOrDefault(p => String.Equals(p.PropertyName, propertyName, StringComparison.CurrentCultureIgnoreCase)); if(property != null) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - if (CheckAccessLevel(portalSettings, property, accessingUser, user)) + if (CheckAccessLevel(portalSettings, property, accessingUser, this.user)) { switch (property.PropertyName.ToLowerInvariant()) { case "photo": - return user.Profile.PhotoURL; + return this.user.Profile.PhotoURL; case "country": - return user.Profile.Country; + return this.user.Profile.Country; case "region": - return user.Profile.Region; + return this.user.Profile.Region; default: return GetRichValue(property, format, formatProvider); } diff --git a/DNN Platform/Library/Entities/Users/Profile/UserProfile.cs b/DNN Platform/Library/Entities/Users/Profile/UserProfile.cs index 813bac662e1..84007613ae9 100644 --- a/DNN Platform/Library/Entities/Users/Profile/UserProfile.cs +++ b/DNN Platform/Library/Entities/Users/Profile/UserProfile.cs @@ -82,7 +82,7 @@ public UserProfile() public UserProfile(UserInfo user) { - _user = user; + this._user = user; } #region Public Properties @@ -96,11 +96,11 @@ public string Cell { get { - return GetPropertyValue(USERPROFILE_Cell); + return this.GetPropertyValue(USERPROFILE_Cell); } set { - SetProfileProperty(USERPROFILE_Cell, value); + this.SetProfileProperty(USERPROFILE_Cell, value); } } @@ -113,11 +113,11 @@ public string City { get { - return GetPropertyValue(USERPROFILE_City); + return this.GetPropertyValue(USERPROFILE_City); } set { - SetProfileProperty(USERPROFILE_City, value); + this.SetProfileProperty(USERPROFILE_City, value); } } @@ -130,11 +130,11 @@ public string Country { get { - return GetPropertyValue(USERPROFILE_Country); + return this.GetPropertyValue(USERPROFILE_Country); } set { - SetProfileProperty(USERPROFILE_Country, value); + this.SetProfileProperty(USERPROFILE_Country, value); } } @@ -147,11 +147,11 @@ public string Fax { get { - return GetPropertyValue(USERPROFILE_Fax); + return this.GetPropertyValue(USERPROFILE_Fax); } set { - SetProfileProperty(USERPROFILE_Fax, value); + this.SetProfileProperty(USERPROFILE_Fax, value); } } @@ -164,11 +164,11 @@ public string FirstName { get { - return GetPropertyValue(USERPROFILE_FirstName); + return this.GetPropertyValue(USERPROFILE_FirstName); } set { - SetProfileProperty(USERPROFILE_FirstName, value); + this.SetProfileProperty(USERPROFILE_FirstName, value); } } @@ -181,7 +181,7 @@ public string FullName { get { - return FirstName + " " + LastName; + return this.FirstName + " " + this.LastName; } } @@ -194,11 +194,11 @@ public string IM { get { - return GetPropertyValue(USERPROFILE_IM); + return this.GetPropertyValue(USERPROFILE_IM); } set { - SetProfileProperty(USERPROFILE_IM, value); + this.SetProfileProperty(USERPROFILE_IM, value); } } @@ -211,7 +211,7 @@ public bool IsDirty { get { - return _IsDirty; + return this._IsDirty; } } @@ -224,11 +224,11 @@ public string LastName { get { - return GetPropertyValue(USERPROFILE_LastName); + return this.GetPropertyValue(USERPROFILE_LastName); } set { - SetProfileProperty(USERPROFILE_LastName, value); + this.SetProfileProperty(USERPROFILE_LastName, value); } } @@ -236,11 +236,11 @@ public string Photo { get { - return GetPropertyValue(USERPROFILE_Photo); + return this.GetPropertyValue(USERPROFILE_Photo); } set { - SetProfileProperty(USERPROFILE_Photo, value); + this.SetProfileProperty(USERPROFILE_Photo, value); } } @@ -252,13 +252,13 @@ public string PhotoURL get { string photoURL = Globals.ApplicationPath + "/images/no_avatar.gif"; - ProfilePropertyDefinition photoProperty = GetProperty(USERPROFILE_Photo); + ProfilePropertyDefinition photoProperty = this.GetProperty(USERPROFILE_Photo); if ((photoProperty != null)) { UserInfo user = UserController.Instance.GetCurrentUserInfo(); PortalSettings settings = PortalController.Instance.GetCurrentPortalSettings(); - bool isVisible = ProfilePropertyAccess.CheckAccessLevel(settings, photoProperty, user, _user); + bool isVisible = ProfilePropertyAccess.CheckAccessLevel(settings, photoProperty, user, this._user); if (!string.IsNullOrEmpty(photoProperty.PropertyValue) && isVisible) { var fileInfo = FileManager.Instance.GetFile(int.Parse(photoProperty.PropertyValue)); @@ -281,13 +281,13 @@ public string PhotoURLFile get { string photoURLFile = Globals.ApplicationPath + "/images/no_avatar.gif"; - ProfilePropertyDefinition photoProperty = GetProperty(USERPROFILE_Photo); + ProfilePropertyDefinition photoProperty = this.GetProperty(USERPROFILE_Photo); if ((photoProperty != null)) { UserInfo user = UserController.Instance.GetCurrentUserInfo(); PortalSettings settings = PortalController.Instance.GetCurrentPortalSettings(); - bool isVisible = (user.UserID == _user.UserID); + bool isVisible = (user.UserID == this._user.UserID); if (!isVisible) { switch (photoProperty.ProfileVisibility.VisibilityMode) @@ -336,11 +336,11 @@ public string PostalCode { get { - return GetPropertyValue(USERPROFILE_PostalCode); + return this.GetPropertyValue(USERPROFILE_PostalCode); } set { - SetProfileProperty(USERPROFILE_PostalCode, value); + this.SetProfileProperty(USERPROFILE_PostalCode, value); } } @@ -353,11 +353,11 @@ public string PreferredLocale { get { - return GetPropertyValue(USERPROFILE_PreferredLocale); + return this.GetPropertyValue(USERPROFILE_PreferredLocale); } set { - SetProfileProperty(USERPROFILE_PreferredLocale, value); + this.SetProfileProperty(USERPROFILE_PreferredLocale, value); } } @@ -370,7 +370,7 @@ public TimeZoneInfo PreferredTimeZone TimeZoneInfo _TimeZone = TimeZoneInfo.Local; //Next check if there is a Property Setting - string _TimeZoneId = GetPropertyValue(USERPROFILE_PreferredTimeZone); + string _TimeZoneId = this.GetPropertyValue(USERPROFILE_PreferredTimeZone); if (!string.IsNullOrEmpty(_TimeZoneId)) { _TimeZone = TimeZoneInfo.FindSystemTimeZoneById(_TimeZoneId); @@ -392,7 +392,7 @@ public TimeZoneInfo PreferredTimeZone { if (value != null) { - SetProfileProperty(USERPROFILE_PreferredTimeZone, value.Id); + this.SetProfileProperty(USERPROFILE_PreferredTimeZone, value.Id); } } } @@ -404,7 +404,7 @@ public TimeZoneInfo PreferredTimeZone /// ----------------------------------------------------------------------------- public ProfilePropertyDefinitionCollection ProfileProperties { - get { return _profileProperties ?? (_profileProperties = new ProfilePropertyDefinitionCollection()); } + get { return this._profileProperties ?? (this._profileProperties = new ProfilePropertyDefinitionCollection()); } } /// ----------------------------------------------------------------------------- @@ -416,11 +416,11 @@ public string Region { get { - return GetPropertyValue(USERPROFILE_Region); + return this.GetPropertyValue(USERPROFILE_Region); } set { - SetProfileProperty(USERPROFILE_Region, value); + this.SetProfileProperty(USERPROFILE_Region, value); } } @@ -433,11 +433,11 @@ public string Street { get { - return GetPropertyValue(USERPROFILE_Street); + return this.GetPropertyValue(USERPROFILE_Street); } set { - SetProfileProperty(USERPROFILE_Street, value); + this.SetProfileProperty(USERPROFILE_Street, value); } } @@ -450,11 +450,11 @@ public string Telephone { get { - return GetPropertyValue(USERPROFILE_Telephone); + return this.GetPropertyValue(USERPROFILE_Telephone); } set { - SetProfileProperty(USERPROFILE_Telephone, value); + this.SetProfileProperty(USERPROFILE_Telephone, value); } } @@ -467,11 +467,11 @@ public string Title { get { - return GetPropertyValue(USERPROFILE_Title); + return this.GetPropertyValue(USERPROFILE_Title); } set { - SetProfileProperty(USERPROFILE_Title, value); + this.SetProfileProperty(USERPROFILE_Title, value); } } @@ -484,11 +484,11 @@ public string Unit { get { - return GetPropertyValue(USERPROFILE_Unit); + return this.GetPropertyValue(USERPROFILE_Unit); } set { - SetProfileProperty(USERPROFILE_Unit, value); + this.SetProfileProperty(USERPROFILE_Unit, value); } } @@ -501,11 +501,11 @@ public string Website { get { - return GetPropertyValue(USERPROFILE_Website); + return this.GetPropertyValue(USERPROFILE_Website); } set { - SetProfileProperty(USERPROFILE_Website, value); + this.SetProfileProperty(USERPROFILE_Website, value); } } @@ -520,8 +520,8 @@ public string Website /// ----------------------------------------------------------------------------- public void ClearIsDirty() { - _IsDirty = false; - foreach (ProfilePropertyDefinition profProperty in ProfileProperties) + this._IsDirty = false; + foreach (ProfilePropertyDefinition profProperty in this.ProfileProperties) { profProperty?.ClearIsDirty(); } @@ -536,7 +536,7 @@ public void ClearIsDirty() /// ----------------------------------------------------------------------------- public ProfilePropertyDefinition GetProperty(string propName) { - return ProfileProperties[propName]; + return this.ProfileProperties[propName]; } /// ----------------------------------------------------------------------------- @@ -549,7 +549,7 @@ public ProfilePropertyDefinition GetProperty(string propName) public string GetPropertyValue(string propName) { string propValue = Null.NullString; - ProfilePropertyDefinition profileProp = GetProperty(propName); + ProfilePropertyDefinition profileProp = this.GetProperty(propName); if (profileProp != null) { propValue = profileProp.PropertyValue; @@ -560,7 +560,7 @@ public string GetPropertyValue(string propName) var dataType = controller.GetListEntryInfo("DataType", profileProp.DataType); if (dataType.Value == "Country" || dataType.Value == "Region") { - propValue = GetListValue(dataType.Value, propValue); + propValue = this.GetListValue(dataType.Value, propValue); } } } @@ -591,7 +591,7 @@ private string GetListValue(string listName, string value) /// ----------------------------------------------------------------------------- public void InitialiseProfile(int portalId) { - InitialiseProfile(portalId, true); + this.InitialiseProfile(portalId, true); } /// ----------------------------------------------------------------------------- @@ -605,10 +605,10 @@ public void InitialiseProfile(int portalId) /// ----------------------------------------------------------------------------- public void InitialiseProfile(int portalId, bool useDefaults) { - _profileProperties = ProfileController.GetPropertyDefinitionsByPortal(portalId, true, false); + this._profileProperties = ProfileController.GetPropertyDefinitionsByPortal(portalId, true, false); if (useDefaults) { - foreach (ProfilePropertyDefinition ProfileProperty in _profileProperties) + foreach (ProfilePropertyDefinition ProfileProperty in this._profileProperties) { ProfileProperty.PropertyValue = ProfileProperty.DefaultValue; } @@ -625,7 +625,7 @@ public void InitialiseProfile(int portalId, bool useDefaults) /// ----------------------------------------------------------------------------- public void SetProfileProperty(string propName, string propValue) { - ProfilePropertyDefinition profileProp = GetProperty(propName); + ProfilePropertyDefinition profileProp = this.GetProperty(propName); if (profileProp != null) { profileProp.PropertyValue = propValue; @@ -633,7 +633,7 @@ public void SetProfileProperty(string propName, string propValue) //Set the IsDirty flag if (profileProp.IsDirty) { - _IsDirty = true; + this._IsDirty = true; } } } @@ -644,11 +644,11 @@ public string Biography { get { - return GetPropertyValue(USERPROFILE_Biography); + return this.GetPropertyValue(USERPROFILE_Biography); } set { - SetProfileProperty(USERPROFILE_Biography, value); + this.SetProfileProperty(USERPROFILE_Biography, value); } } @@ -658,7 +658,7 @@ public object this[string name] { get { - return GetPropertyValue(name); + return this.GetPropertyValue(name); } set { @@ -677,7 +677,7 @@ public object this[string name] { stringValue = Convert.ToString(value); } - SetProfileProperty(name, stringValue); + this.SetProfileProperty(name, stringValue); } } diff --git a/DNN Platform/Library/Entities/Users/RelationshipEventArgs.cs b/DNN Platform/Library/Entities/Users/RelationshipEventArgs.cs index 7ef435820f5..8b6a80b457a 100644 --- a/DNN Platform/Library/Entities/Users/RelationshipEventArgs.cs +++ b/DNN Platform/Library/Entities/Users/RelationshipEventArgs.cs @@ -12,8 +12,8 @@ public class RelationshipEventArgs : EventArgs { internal RelationshipEventArgs(UserRelationship relationship, int portalId) { - Relationship = relationship; - PortalID = portalId; + this.Relationship = relationship; + this.PortalID = portalId; } public UserRelationship Relationship { get; private set; } diff --git a/DNN Platform/Library/Entities/Users/Social/Data/DataService.cs b/DNN Platform/Library/Entities/Users/Social/Data/DataService.cs index 2b13c2817d2..28e5c85981f 100644 --- a/DNN Platform/Library/Entities/Users/Social/Data/DataService.cs +++ b/DNN Platform/Library/Entities/Users/Social/Data/DataService.cs @@ -24,22 +24,22 @@ internal class DataService : ComponentBase, IDataServ public IDataReader GetAllRelationshipTypes() { - return _provider.ExecuteReader("GetAllRelationshipTypes"); + return this._provider.ExecuteReader("GetAllRelationshipTypes"); } public IDataReader GetRelationshipType(int relationshipTypeId) { - return _provider.ExecuteReader("GetRelationshipType", relationshipTypeId); + return this._provider.ExecuteReader("GetRelationshipType", relationshipTypeId); } public void DeleteRelationshipType(int relationshipTypeId) { - _provider.ExecuteNonQuery("DeleteRelationshipType", relationshipTypeId); + this._provider.ExecuteNonQuery("DeleteRelationshipType", relationshipTypeId); } public int SaveRelationshipType(RelationshipType relationshipType, int createUpdateUserId) { - return _provider.ExecuteScalar("SaveRelationshipType", relationshipType.RelationshipTypeId, relationshipType.Direction, relationshipType.Name, relationshipType.Description, createUpdateUserId); + return this._provider.ExecuteScalar("SaveRelationshipType", relationshipType.RelationshipTypeId, relationshipType.Direction, relationshipType.Name, relationshipType.Description, createUpdateUserId); } #endregion @@ -48,27 +48,27 @@ public int SaveRelationshipType(RelationshipType relationshipType, int createUpd public void DeleteRelationship(int relationshipId) { - _provider.ExecuteNonQuery("DeleteRelationship", relationshipId); + this._provider.ExecuteNonQuery("DeleteRelationship", relationshipId); } public IDataReader GetRelationship(int relationshipId) { - return _provider.ExecuteReader("GetRelationship", relationshipId); + return this._provider.ExecuteReader("GetRelationship", relationshipId); } public IDataReader GetRelationshipsByUserId(int userId) { - return _provider.ExecuteReader("GetRelationshipsByUserID", userId); + return this._provider.ExecuteReader("GetRelationshipsByUserID", userId); } public IDataReader GetRelationshipsByPortalId(int portalId) { - return _provider.ExecuteReader("GetRelationshipsByPortalID", portalId); + return this._provider.ExecuteReader("GetRelationshipsByPortalID", portalId); } public int SaveRelationship(Relationship relationship, int createUpdateUserId) { - return _provider.ExecuteScalar("SaveRelationship", relationship.RelationshipId, relationship.RelationshipTypeId, relationship.Name, relationship.Description, _provider.GetNull(relationship.UserId), _provider.GetNull(relationship.PortalId), relationship.DefaultResponse, createUpdateUserId); + return this._provider.ExecuteScalar("SaveRelationship", relationship.RelationshipId, relationship.RelationshipTypeId, relationship.Name, relationship.Description, this._provider.GetNull(relationship.UserId), this._provider.GetNull(relationship.PortalId), relationship.DefaultResponse, createUpdateUserId); } #endregion @@ -77,32 +77,32 @@ public int SaveRelationship(Relationship relationship, int createUpdateUserId) public void DeleteUserRelationship(int userRelationshipId) { - _provider.ExecuteNonQuery("DeleteUserRelationship", userRelationshipId); + this._provider.ExecuteNonQuery("DeleteUserRelationship", userRelationshipId); } public IDataReader GetUserRelationship(int userRelationshipId) { - return _provider.ExecuteReader("GetUserRelationship", userRelationshipId); + return this._provider.ExecuteReader("GetUserRelationship", userRelationshipId); } public IDataReader GetUserRelationship(int userId, int relatedUserId, int relationshipId, RelationshipDirection relationshipDirection) { - return _provider.ExecuteReader("GetUserRelationshipsByMultipleIDs", userId, relatedUserId, relationshipId, relationshipDirection); + return this._provider.ExecuteReader("GetUserRelationshipsByMultipleIDs", userId, relatedUserId, relationshipId, relationshipDirection); } public IDataReader GetUserRelationships(int userId) { - return _provider.ExecuteReader("GetUserRelationships", userId); + return this._provider.ExecuteReader("GetUserRelationships", userId); } public IDataReader GetUserRelationshipsByRelationshipId(int relationshipId) { - return _provider.ExecuteReader("GetUserRelationshipsByRelationshipID", relationshipId); + return this._provider.ExecuteReader("GetUserRelationshipsByRelationshipID", relationshipId); } public int SaveUserRelationship(UserRelationship userRelationship, int createUpdateUserId) { - return _provider.ExecuteScalar("SaveUserRelationship", userRelationship.UserRelationshipId, userRelationship.UserId, userRelationship.RelatedUserId, userRelationship.RelationshipId, userRelationship.Status, createUpdateUserId); + return this._provider.ExecuteScalar("SaveUserRelationship", userRelationship.UserRelationshipId, userRelationship.UserId, userRelationship.RelatedUserId, userRelationship.RelationshipId, userRelationship.Status, createUpdateUserId); } #endregion @@ -111,22 +111,22 @@ public int SaveUserRelationship(UserRelationship userRelationship, int createUpd public IDataReader GetUserRelationshipPreferenceById(int preferenceId) { - return _provider.ExecuteReader("GetUserRelationshipPreferenceByID", preferenceId); + return this._provider.ExecuteReader("GetUserRelationshipPreferenceByID", preferenceId); } public IDataReader GetUserRelationshipPreference(int userId, int relationshipId) { - return _provider.ExecuteReader("GetUserRelationshipPreference", userId, relationshipId); + return this._provider.ExecuteReader("GetUserRelationshipPreference", userId, relationshipId); } public void DeleteUserRelationshipPreference(int preferenceId) { - _provider.ExecuteNonQuery("DeleteUserRelationshipPreference", preferenceId); + this._provider.ExecuteNonQuery("DeleteUserRelationshipPreference", preferenceId); } public int SaveUserRelationshipPreference(UserRelationshipPreference userRelationshipPreference, int createUpdateUserId) { - return _provider.ExecuteScalar("SaveUserRelationshipPreference", userRelationshipPreference.PreferenceId, userRelationshipPreference.UserId, userRelationshipPreference.RelationshipId, userRelationshipPreference.DefaultResponse, createUpdateUserId); + return this._provider.ExecuteScalar("SaveUserRelationshipPreference", userRelationshipPreference.PreferenceId, userRelationshipPreference.UserId, userRelationshipPreference.RelationshipId, userRelationshipPreference.DefaultResponse, createUpdateUserId); } #endregion diff --git a/DNN Platform/Library/Entities/Users/Social/FollowersControllerImpl.cs b/DNN Platform/Library/Entities/Users/Social/FollowersControllerImpl.cs index 8311caa93aa..10cc2f8a2a7 100644 --- a/DNN Platform/Library/Entities/Users/Social/FollowersControllerImpl.cs +++ b/DNN Platform/Library/Entities/Users/Social/FollowersControllerImpl.cs @@ -30,7 +30,7 @@ internal class FollowersControllerImpl : IFollowersController /// ----------------------------------------------------------------------------- public void FollowUser(UserInfo targetUser) { - FollowUser(UserController.Instance.GetCurrentUserInfo(), targetUser); + this.FollowUser(UserController.Instance.GetCurrentUserInfo(), targetUser); } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/Entities/Users/Social/FriendsControllerImpl.cs b/DNN Platform/Library/Entities/Users/Social/FriendsControllerImpl.cs index 625e9113a74..d0fad648052 100644 --- a/DNN Platform/Library/Entities/Users/Social/FriendsControllerImpl.cs +++ b/DNN Platform/Library/Entities/Users/Social/FriendsControllerImpl.cs @@ -55,7 +55,7 @@ public void AcceptFriend(UserInfo targetUser) public void AddFriend(UserInfo targetUser) { var initiatingUser = UserController.Instance.GetCurrentUserInfo(); - AddFriend(initiatingUser, targetUser); + this.AddFriend(initiatingUser, targetUser); } /// ----------------------------------------------------------------------------- @@ -99,7 +99,7 @@ public void AddFriend(UserInfo initiatingUser, UserInfo targetUser) public void DeleteFriend(UserInfo targetUser) { var initiatingUser = UserController.Instance.GetCurrentUserInfo(); - DeleteFriend(initiatingUser, targetUser); + this.DeleteFriend(initiatingUser, targetUser); } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/Entities/Users/Social/Relationship.cs b/DNN Platform/Library/Entities/Users/Social/Relationship.cs index 6b9eca6ee62..dfdaa7293fd 100644 --- a/DNN Platform/Library/Entities/Users/Social/Relationship.cs +++ b/DNN Platform/Library/Entities/Users/Social/Relationship.cs @@ -35,7 +35,7 @@ public class Relationship : BaseEntityInfo, IHydratable { public Relationship() { - RelationshipId = -1; + this.RelationshipId = -1; } /// @@ -88,7 +88,7 @@ public bool IsPortalList { get { - return UserId == Null.NullInteger && PortalId >= 0; + return this.UserId == Null.NullInteger && this.PortalId >= 0; } } @@ -100,7 +100,7 @@ public bool IsHostList { get { - return UserId == Null.NullInteger && PortalId == Null.NullInteger; + return this.UserId == Null.NullInteger && this.PortalId == Null.NullInteger; } } @@ -112,7 +112,7 @@ public bool IsUserList { get { - return UserId > 0 && PortalId >= 0; + return this.UserId > 0 && this.PortalId >= 0; } } /// @@ -146,7 +146,7 @@ public void Fill(IDataReader dr) this.RelationshipTypeId = Convert.ToInt32(dr["RelationshipTypeID"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Entities/Users/Social/RelationshipControllerImpl.cs b/DNN Platform/Library/Entities/Users/Social/RelationshipControllerImpl.cs index b89a6c64803..f8b794d5d29 100644 --- a/DNN Platform/Library/Entities/Users/Social/RelationshipControllerImpl.cs +++ b/DNN Platform/Library/Entities/Users/Social/RelationshipControllerImpl.cs @@ -51,8 +51,8 @@ public RelationshipControllerImpl(IDataService dataService, IEventLogController Requires.NotNull("dataService", dataService); Requires.NotNull("eventLogController", eventLogController); - _dataService = dataService; - _eventLogController = eventLogController; + this._dataService = dataService; + this._eventLogController = eventLogController; } #endregion @@ -65,13 +65,13 @@ public void DeleteRelationshipType(RelationshipType relationshipType) { Requires.NotNull("relationshipType", relationshipType); - _dataService.DeleteRelationshipType(relationshipType.RelationshipTypeId); + this._dataService.DeleteRelationshipType(relationshipType.RelationshipTypeId); //log event string logContent = string.Format(Localization.GetString("RelationshipType_Deleted", Localization.GlobalResourceFile), relationshipType.Name, relationshipType.RelationshipTypeId); - AddLog(logContent); + this.AddLog(logContent); //clear cache DataCache.RemoveCache(DataCache.RelationshipTypesCacheKey); @@ -85,12 +85,12 @@ public IList GetAllRelationshipTypes() return CBO.GetCachedObject>(cacheArgs, c => CBO.FillCollection( - _dataService.GetAllRelationshipTypes())); + this._dataService.GetAllRelationshipTypes())); } public RelationshipType GetRelationshipType(int relationshipTypeId) { - return GetAllRelationshipTypes().FirstOrDefault(r => r.RelationshipTypeId == relationshipTypeId); + return this.GetAllRelationshipTypes().FirstOrDefault(r => r.RelationshipTypeId == relationshipTypeId); } public void SaveRelationshipType(RelationshipType relationshipType) @@ -101,14 +101,14 @@ public void SaveRelationshipType(RelationshipType relationshipType) ? "RelationshipType_Added" : "RelationshipType_Updated"; - relationshipType.RelationshipTypeId = _dataService.SaveRelationshipType(relationshipType, + relationshipType.RelationshipTypeId = this._dataService.SaveRelationshipType(relationshipType, UserController.Instance.GetCurrentUserInfo(). UserID); //log event string logContent = string.Format(Localization.GetString(localizationKey, Localization.GlobalResourceFile), relationshipType.Name); - AddLog(logContent); + this.AddLog(logContent); //clear cache DataCache.RemoveCache(DataCache.RelationshipTypesCacheKey); @@ -122,26 +122,26 @@ public void DeleteRelationship(Relationship relationship) { Requires.NotNull("relationship", relationship); - _dataService.DeleteRelationship(relationship.RelationshipId); + this._dataService.DeleteRelationship(relationship.RelationshipId); //log event string logContent = string.Format(Localization.GetString("Relationship_Deleted", Localization.GlobalResourceFile), relationship.Name, relationship.RelationshipId); - AddLog(logContent); + this.AddLog(logContent); //clear cache - ClearRelationshipCache(relationship); + this.ClearRelationshipCache(relationship); } public Relationship GetRelationship(int relationshipId) { - return CBO.FillCollection(_dataService.GetRelationship(relationshipId)).FirstOrDefault(); + return CBO.FillCollection(this._dataService.GetRelationship(relationshipId)).FirstOrDefault(); } public IList GetRelationshipsByUserId(int userId) { - return CBO.FillCollection(_dataService.GetRelationshipsByUserId(userId)); + return CBO.FillCollection(this._dataService.GetRelationshipsByUserId(userId)); } public IList GetRelationshipsByPortalId(int portalId) @@ -158,7 +158,7 @@ public IList GetRelationshipsByPortalId(int portalId) return CBO.GetCachedObject>(cacheArgs, c => CBO.FillCollection( - _dataService.GetRelationshipsByPortalId( + this._dataService.GetRelationshipsByPortalId( (int) c.ParamList[0]))); } @@ -170,16 +170,16 @@ public void SaveRelationship(Relationship relationship) ? "Relationship_Added" : "Relationship_Updated"; - relationship.RelationshipId = _dataService.SaveRelationship(relationship, + relationship.RelationshipId = this._dataService.SaveRelationship(relationship, UserController.Instance.GetCurrentUserInfo().UserID); //log event string logContent = string.Format(Localization.GetString(localizationKey, Localization.GlobalResourceFile), relationship.Name); - AddLog(logContent); + this.AddLog(logContent); //clear cache - ClearRelationshipCache(relationship); + this.ClearRelationshipCache(relationship); } #endregion @@ -190,22 +190,22 @@ public void DeleteUserRelationship(UserRelationship userRelationship) { Requires.NotNull("userRelationship", userRelationship); - _dataService.DeleteUserRelationship(userRelationship.UserRelationshipId); + this._dataService.DeleteUserRelationship(userRelationship.UserRelationshipId); //log event string logContent = string.Format(Localization.GetString("UserRelationship_Deleted", Localization.GlobalResourceFile), userRelationship.UserRelationshipId, userRelationship.UserId, userRelationship.RelatedUserId); - AddLog(logContent); + this.AddLog(logContent); //cache clear - ClearUserCache(userRelationship); + this.ClearUserCache(userRelationship); } public UserRelationship GetUserRelationship(int userRelationshipId) { - return CBO.FillObject(_dataService.GetUserRelationship(userRelationshipId)); + return CBO.FillObject(this._dataService.GetUserRelationship(userRelationshipId)); } public UserRelationship GetUserRelationship(UserInfo user, UserInfo relatedUser, Relationship relationship) @@ -213,9 +213,9 @@ public UserRelationship GetUserRelationship(UserInfo user, UserInfo relatedUser, UserRelationship userRelationship = null; if (relationship != null) { - userRelationship = CBO.FillObject(_dataService.GetUserRelationship(user.UserID, relatedUser.UserID, + userRelationship = CBO.FillObject(this._dataService.GetUserRelationship(user.UserID, relatedUser.UserID, relationship.RelationshipId, - GetRelationshipType( + this.GetRelationshipType( relationship.RelationshipTypeId). Direction)); } @@ -225,7 +225,7 @@ public UserRelationship GetUserRelationship(UserInfo user, UserInfo relatedUser, public IList GetUserRelationships(UserInfo user) { - return CBO.FillCollection(_dataService.GetUserRelationships(user.UserID)); + return CBO.FillCollection(this._dataService.GetUserRelationships(user.UserID)); } public void SaveUserRelationship(UserRelationship userRelationship) @@ -236,7 +236,7 @@ public void SaveUserRelationship(UserRelationship userRelationship) ? "UserRelationship_Added" : "UserRelationship_Updated"; - userRelationship.UserRelationshipId = _dataService.SaveUserRelationship(userRelationship, + userRelationship.UserRelationshipId = this._dataService.SaveUserRelationship(userRelationship, UserController.Instance.GetCurrentUserInfo(). UserID); @@ -244,10 +244,10 @@ public void SaveUserRelationship(UserRelationship userRelationship) string logContent = string.Format(Localization.GetString(localizationKey, Localization.GlobalResourceFile), userRelationship.UserRelationshipId, userRelationship.UserId, userRelationship.RelatedUserId); - AddLog(logContent); + this.AddLog(logContent); //cache clear - ClearUserCache(userRelationship); + this.ClearUserCache(userRelationship); } #endregion @@ -258,7 +258,7 @@ public void DeleteUserRelationshipPreference(UserRelationshipPreference userRela { Requires.NotNull("userRelationshipPreference", userRelationshipPreference); - _dataService.DeleteUserRelationshipPreference(userRelationshipPreference.PreferenceId); + this._dataService.DeleteUserRelationshipPreference(userRelationshipPreference.PreferenceId); //log event string logContent = @@ -266,19 +266,19 @@ public void DeleteUserRelationshipPreference(UserRelationshipPreference userRela Localization.GetString("UserRelationshipPreference_Deleted", Localization.GlobalResourceFile), userRelationshipPreference.PreferenceId, userRelationshipPreference.UserId, userRelationshipPreference.RelationshipId); - AddLog(logContent); + this.AddLog(logContent); } public UserRelationshipPreference GetUserRelationshipPreference(int preferenceId) { return - CBO.FillObject(_dataService.GetUserRelationshipPreferenceById(preferenceId)); + CBO.FillObject(this._dataService.GetUserRelationshipPreferenceById(preferenceId)); } public UserRelationshipPreference GetUserRelationshipPreference(int userId, int relationshipId) { return - CBO.FillObject(_dataService.GetUserRelationshipPreference(userId, + CBO.FillObject(this._dataService.GetUserRelationshipPreference(userId, relationshipId)); } @@ -291,14 +291,14 @@ public void SaveUserRelationshipPreference(UserRelationshipPreference userRelati : "UserRelationshipPreference_Updated"; userRelationshipPreference.PreferenceId = - _dataService.SaveUserRelationshipPreference(userRelationshipPreference, + this._dataService.SaveUserRelationshipPreference(userRelationshipPreference, UserController.Instance.GetCurrentUserInfo().UserID); //log event string logContent = string.Format(Localization.GetString(localizationKey, Localization.GlobalResourceFile), userRelationshipPreference.PreferenceId, userRelationshipPreference.UserId, userRelationshipPreference.RelationshipId); - AddLog(logContent); + this.AddLog(logContent); } #endregion @@ -355,7 +355,7 @@ public UserRelationship InitiateUserRelationship(UserInfo initiatingUser, UserIn } //check for existing UserRelationship record - UserRelationship existingRelationship = GetUserRelationship(initiatingUser, targetUser, relationship); + UserRelationship existingRelationship = this.GetUserRelationship(initiatingUser, targetUser, relationship); if (existingRelationship != null) { throw new UserRelationshipExistsException(Localization.GetExceptionMessage( @@ -371,7 +371,7 @@ public UserRelationship InitiateUserRelationship(UserInfo initiatingUser, UserIn RelationshipStatus status = relationship.DefaultResponse; - UserRelationshipPreference preference = GetUserRelationshipPreference(targetUser.UserID, + UserRelationshipPreference preference = this.GetUserRelationshipPreference(targetUser.UserID, relationship.RelationshipId); if (preference != null) { @@ -393,7 +393,7 @@ public UserRelationship InitiateUserRelationship(UserInfo initiatingUser, UserIn Status = status }; - SaveUserRelationship(userRelationship); + this.SaveUserRelationship(userRelationship); return userRelationship; } @@ -409,7 +409,7 @@ public UserRelationship InitiateUserRelationship(UserInfo initiatingUser, UserIn /// ----------------------------------------------------------------------------- public void AcceptUserRelationship(int userRelationshipId) { - ManageUserRelationshipStatus(userRelationshipId, RelationshipStatus.Accepted); + this.ManageUserRelationshipStatus(userRelationshipId, RelationshipStatus.Accepted); } /// ----------------------------------------------------------------------------- @@ -423,10 +423,10 @@ public void AcceptUserRelationship(int userRelationshipId) /// ----------------------------------------------------------------------------- public void RemoveUserRelationship(int userRelationshipId) { - UserRelationship userRelationship = VerifyUserRelationshipExist(userRelationshipId); + UserRelationship userRelationship = this.VerifyUserRelationshipExist(userRelationshipId); if (userRelationship != null) { - DeleteUserRelationship(userRelationship); + this.DeleteUserRelationship(userRelationship); } } @@ -446,7 +446,7 @@ public void RemoveUserRelationship(int userRelationshipId) /// ----------------------------------------------------------------------------- public UserRelationship GetFollowerRelationship(UserInfo targetUser) { - return GetFollowerRelationship(UserController.Instance.GetCurrentUserInfo(), targetUser); + return this.GetFollowerRelationship(UserController.Instance.GetCurrentUserInfo(), targetUser); } /// ----------------------------------------------------------------------------- @@ -465,8 +465,8 @@ public UserRelationship GetFollowerRelationship(UserInfo initiatingUser, UserInf Requires.NotNull("user1", initiatingUser); Requires.NotNull("user2", targetUser); - return GetUserRelationship(initiatingUser, targetUser, - GetFollowersRelationshipByPortal(initiatingUser.PortalID)); + return this.GetUserRelationship(initiatingUser, targetUser, + this.GetFollowersRelationshipByPortal(initiatingUser.PortalID)); } /// ----------------------------------------------------------------------------- @@ -481,7 +481,7 @@ public UserRelationship GetFollowerRelationship(UserInfo initiatingUser, UserInf /// ----------------------------------------------------------------------------- public UserRelationship GetFollowingRelationship(UserInfo targetUser) { - return GetFollowingRelationship(UserController.Instance.GetCurrentUserInfo(), targetUser); + return this.GetFollowingRelationship(UserController.Instance.GetCurrentUserInfo(), targetUser); } /// ----------------------------------------------------------------------------- @@ -500,8 +500,8 @@ public UserRelationship GetFollowingRelationship(UserInfo initiatingUser, UserIn Requires.NotNull("user1", initiatingUser); Requires.NotNull("user2", targetUser); - return GetUserRelationship(targetUser, initiatingUser, - GetFollowersRelationshipByPortal(initiatingUser.PortalID)); + return this.GetUserRelationship(targetUser, initiatingUser, + this.GetFollowersRelationshipByPortal(initiatingUser.PortalID)); } /// ----------------------------------------------------------------------------- @@ -516,7 +516,7 @@ public UserRelationship GetFollowingRelationship(UserInfo initiatingUser, UserIn /// ----------------------------------------------------------------------------- public UserRelationship GetFriendRelationship(UserInfo targetUser) { - return GetFriendRelationship(UserController.Instance.GetCurrentUserInfo(), targetUser); + return this.GetFriendRelationship(UserController.Instance.GetCurrentUserInfo(), targetUser); } /// ----------------------------------------------------------------------------- @@ -535,8 +535,8 @@ public UserRelationship GetFriendRelationship(UserInfo initiatingUser, UserInfo Requires.NotNull("user1", initiatingUser); Requires.NotNull("user2", targetUser); - return GetUserRelationship(initiatingUser, targetUser, - GetFriendsRelationshipByPortal(initiatingUser.PortalID)); + return this.GetUserRelationship(initiatingUser, targetUser, + this.GetFriendsRelationshipByPortal(initiatingUser.PortalID)); } #endregion @@ -544,7 +544,7 @@ public UserRelationship GetFriendRelationship(UserInfo initiatingUser, UserInfo public void CreateDefaultRelationshipsForPortal(int portalId) { //create default Friend Relationship - if (GetFriendsRelationshipByPortal(portalId) == null) + if (this.GetFriendsRelationshipByPortal(portalId) == null) { var friendRelationship = new Relationship { @@ -557,11 +557,11 @@ public void CreateDefaultRelationshipsForPortal(int portalId) //default response is None RelationshipTypeId = (int) DefaultRelationshipTypes.Friends }; - SaveRelationship(friendRelationship); + this.SaveRelationship(friendRelationship); } //create default Follower Relationship - if (GetFollowersRelationshipByPortal(portalId) == null) + if (this.GetFollowersRelationshipByPortal(portalId) == null) { var followerRelationship = new Relationship { @@ -574,19 +574,19 @@ public void CreateDefaultRelationshipsForPortal(int portalId) //default response is Accepted RelationshipTypeId = (int) DefaultRelationshipTypes.Followers }; - SaveRelationship(followerRelationship); + this.SaveRelationship(followerRelationship); } } public Relationship GetFriendsRelationshipByPortal(int portalId) { - return GetRelationshipsByPortalId(portalId).FirstOrDefault(re => re.RelationshipTypeId == (int)DefaultRelationshipTypes.Friends); + return this.GetRelationshipsByPortalId(portalId).FirstOrDefault(re => re.RelationshipTypeId == (int)DefaultRelationshipTypes.Friends); } public Relationship GetFollowersRelationshipByPortal(int portalId) { - return GetRelationshipsByPortalId(portalId).FirstOrDefault(re => re.RelationshipTypeId == (int)DefaultRelationshipTypes.Followers); + return this.GetRelationshipsByPortalId(portalId).FirstOrDefault(re => re.RelationshipTypeId == (int)DefaultRelationshipTypes.Followers); } @@ -596,7 +596,7 @@ public Relationship GetFollowersRelationshipByPortal(int portalId) private void AddLog(string logContent) { - _eventLogController.AddLog("Message", logContent, EventLogController.EventLogType.ADMIN_ALERT); + this._eventLogController.AddLog("Message", logContent, EventLogController.EventLogType.ADMIN_ALERT); } private void ClearRelationshipCache(Relationship relationship) @@ -634,7 +634,7 @@ private void ClearUserCache(UserRelationship userRelationship) private void ManageUserRelationshipStatus(int userRelationshipId, RelationshipStatus newStatus) { - UserRelationship userRelationship = VerifyUserRelationshipExist(userRelationshipId); + UserRelationship userRelationship = this.VerifyUserRelationshipExist(userRelationshipId); if (userRelationship == null) { return; @@ -658,13 +658,13 @@ private void ManageUserRelationshipStatus(int userRelationshipId, RelationshipSt if (save) { userRelationship.Status = newStatus; - SaveUserRelationship(userRelationship); + this.SaveUserRelationship(userRelationship); } } private UserRelationship VerifyUserRelationshipExist(int userRelationshipId) { - UserRelationship userRelationship = GetUserRelationship(userRelationshipId); + UserRelationship userRelationship = this.GetUserRelationship(userRelationshipId); if (userRelationship == null) { throw new UserRelationshipDoesNotExistException( diff --git a/DNN Platform/Library/Entities/Users/Social/RelationshipType.cs b/DNN Platform/Library/Entities/Users/Social/RelationshipType.cs index 8334c94dbc4..d3858412f39 100644 --- a/DNN Platform/Library/Entities/Users/Social/RelationshipType.cs +++ b/DNN Platform/Library/Entities/Users/Social/RelationshipType.cs @@ -35,11 +35,11 @@ public int RelationshipTypeId { get { - return _relationshipTypeId; + return this._relationshipTypeId; } set { - _relationshipTypeId = value; + this._relationshipTypeId = value; } } @@ -89,7 +89,7 @@ public void Fill(IDataReader dr) this.Direction = (RelationshipDirection)Convert.ToInt32(dr["Direction"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Entities/Users/Social/UserRelationship.cs b/DNN Platform/Library/Entities/Users/Social/UserRelationship.cs index fc63ddebe7f..5ea7e5f1aa6 100644 --- a/DNN Platform/Library/Entities/Users/Social/UserRelationship.cs +++ b/DNN Platform/Library/Entities/Users/Social/UserRelationship.cs @@ -92,7 +92,7 @@ public void Fill(IDataReader dr) this.Status = (RelationshipStatus)Convert.ToInt32(dr["Status"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Entities/Users/Social/UserRelationshipPreference.cs b/DNN Platform/Library/Entities/Users/Social/UserRelationshipPreference.cs index 4d87634a964..df041be7c21 100644 --- a/DNN Platform/Library/Entities/Users/Social/UserRelationshipPreference.cs +++ b/DNN Platform/Library/Entities/Users/Social/UserRelationshipPreference.cs @@ -27,7 +27,7 @@ public class UserRelationshipPreference : BaseEntityInfo, IHydratable { public UserRelationshipPreference() { - PreferenceId = -1; + this.PreferenceId = -1; } /// @@ -62,11 +62,11 @@ public int KeyID { get { - return PreferenceId; + return this.PreferenceId; } set { - PreferenceId = value; + this.PreferenceId = value; } } @@ -76,13 +76,13 @@ public int KeyID /// the data reader. public void Fill(IDataReader dr) { - PreferenceId = Convert.ToInt32(dr["PreferenceID"]); - UserId = Convert.ToInt32(dr["UserID"]); - RelationshipId = Convert.ToInt32(dr["RelationshipID"]); - DefaultResponse = (RelationshipStatus)Convert.ToInt32(dr["DefaultResponse"]); + this.PreferenceId = Convert.ToInt32(dr["PreferenceID"]); + this.UserId = Convert.ToInt32(dr["UserID"]); + this.RelationshipId = Convert.ToInt32(dr["RelationshipID"]); + this.DefaultResponse = (RelationshipStatus)Convert.ToInt32(dr["DefaultResponse"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Entities/Users/Social/UserSocial.cs b/DNN Platform/Library/Entities/Users/Social/UserSocial.cs index 66be62dcc42..8087fe6d147 100644 --- a/DNN Platform/Library/Entities/Users/Social/UserSocial.cs +++ b/DNN Platform/Library/Entities/Users/Social/UserSocial.cs @@ -42,7 +42,7 @@ public class UserSocial public UserSocial(UserInfo userInfo) { - _userInfo = userInfo; + this._userInfo = userInfo; } #endregion @@ -56,15 +56,15 @@ public UserRelationship Friend { get { - var _friendsRelationship = RelationshipController.Instance.GetFriendsRelationshipByPortal(_userInfo.PortalID); + var _friendsRelationship = RelationshipController.Instance.GetFriendsRelationshipByPortal(this._userInfo.PortalID); var currentUser = UserController.Instance.GetCurrentUserInfo(); - return UserRelationships.SingleOrDefault(ur => (ur.RelationshipId == _friendsRelationship.RelationshipId + return this.UserRelationships.SingleOrDefault(ur => (ur.RelationshipId == _friendsRelationship.RelationshipId && - (ur.UserId == _userInfo.UserID && + (ur.UserId == this._userInfo.UserID && ur.RelatedUserId == currentUser.UserID || (ur.UserId == currentUser.UserID && - ur.RelatedUserId == _userInfo.UserID) + ur.RelatedUserId == this._userInfo.UserID) ))); } } @@ -76,11 +76,11 @@ public UserRelationship Follower { get { - var _followerRelationship = RelationshipController.Instance.GetFollowersRelationshipByPortal(_userInfo.PortalID); + var _followerRelationship = RelationshipController.Instance.GetFollowersRelationshipByPortal(this._userInfo.PortalID); var currentUser = UserController.Instance.GetCurrentUserInfo(); - return UserRelationships.SingleOrDefault(ur => (ur.RelationshipId == _followerRelationship.RelationshipId + return this.UserRelationships.SingleOrDefault(ur => (ur.RelationshipId == _followerRelationship.RelationshipId && - (ur.UserId == _userInfo.UserID && + (ur.UserId == this._userInfo.UserID && ur.RelatedUserId == currentUser.UserID ))); } @@ -93,12 +93,12 @@ public UserRelationship Following { get { - var _followerRelationship = RelationshipController.Instance.GetFollowersRelationshipByPortal(_userInfo.PortalID); + var _followerRelationship = RelationshipController.Instance.GetFollowersRelationshipByPortal(this._userInfo.PortalID); var currentUser = UserController.Instance.GetCurrentUserInfo(); - return UserRelationships.SingleOrDefault(ur => (ur.RelationshipId == _followerRelationship.RelationshipId + return this.UserRelationships.SingleOrDefault(ur => (ur.RelationshipId == _followerRelationship.RelationshipId && (ur.UserId == currentUser.UserID && - ur.RelatedUserId == _userInfo.UserID + ur.RelatedUserId == this._userInfo.UserID ))); } } @@ -108,7 +108,7 @@ public UserRelationship Following /// public IList UserRelationships { - get { return _userRelationships ?? (_userRelationships = RelationshipController.Instance.GetUserRelationships(_userInfo)); } + get { return this._userRelationships ?? (this._userRelationships = RelationshipController.Instance.GetUserRelationships(this._userInfo)); } } /// @@ -119,17 +119,17 @@ public IList Relationships { get { - if (_relationships == null) + if (this._relationships == null) { - _relationships = RelationshipController.Instance.GetRelationshipsByPortalId(_userInfo.PortalID); + this._relationships = RelationshipController.Instance.GetRelationshipsByPortalId(this._userInfo.PortalID); - foreach (var r in RelationshipController.Instance.GetRelationshipsByUserId(_userInfo.UserID)) + foreach (var r in RelationshipController.Instance.GetRelationshipsByUserId(this._userInfo.UserID)) { - _relationships.Add(r); + this._relationships.Add(r); } } - return _relationships; + return this._relationships; } } @@ -141,9 +141,9 @@ public IList Roles { get { - return _roles ?? (_roles = (_userInfo.PortalID == -1 && _userInfo.UserID == -1) + return this._roles ?? (this._roles = (this._userInfo.PortalID == -1 && this._userInfo.UserID == -1) ? new List(0) - : RoleController.Instance.GetUserRoles(_userInfo, true) + : RoleController.Instance.GetUserRoles(this._userInfo, true) ); } } diff --git a/DNN Platform/Library/Entities/Users/UserController.cs b/DNN Platform/Library/Entities/Users/UserController.cs index fedfe666a4d..adca9ac0d61 100644 --- a/DNN Platform/Library/Entities/Users/UserController.cs +++ b/DNN Platform/Library/Entities/Users/UserController.cs @@ -561,7 +561,7 @@ public string GetUserProfilePictureUrl(int portalId, int userId, int width, int { var url = $"/DnnImageHandler.ashx?mode=profilepic&userId={userId}&h={width}&w={height}"; - var childPortalAlias = Globals.ResolveUrl(GetUserProfilePictureUrl(userId, width, height)); + var childPortalAlias = Globals.ResolveUrl(this.GetUserProfilePictureUrl(userId, width, height)); var cdv = GetProfilePictureCdv(portalId, userId); return childPortalAlias.StartsWith(Globals.ApplicationPath) @@ -632,12 +632,12 @@ private static string GetProfilePictureCdv(int portalId, int userId) /// ----------------------------------------------------------------------------- public void UpdateDisplayNames() { - int portalId = GetEffectivePortalId(PortalId); + int portalId = GetEffectivePortalId(this.PortalId); - var arrUsers = GetUsers(PortalId); + var arrUsers = GetUsers(this.PortalId); foreach (UserInfo objUser in arrUsers) { - objUser.UpdateDisplayName(DisplayFormat); + objUser.UpdateDisplayName(this.DisplayFormat); UpdateUser(portalId, objUser); } } diff --git a/DNN Platform/Library/Entities/Users/UserInfo.cs b/DNN Platform/Library/Entities/Users/UserInfo.cs index d702549dfb8..488d043bd27 100644 --- a/DNN Platform/Library/Entities/Users/UserInfo.cs +++ b/DNN Platform/Library/Entities/Users/UserInfo.cs @@ -51,11 +51,11 @@ public class UserInfo : BaseEntityInfo, IPropertyAccess public UserInfo() { - IsDeleted = Null.NullBoolean; - UserID = Null.NullInteger; - PortalID = Null.NullInteger; - IsSuperUser = Null.NullBoolean; - AffiliateID = Null.NullInteger; + this.IsDeleted = Null.NullBoolean; + this.UserID = Null.NullInteger; + this.PortalID = Null.NullInteger; + this.IsSuperUser = Null.NullBoolean; + this.AffiliateID = Null.NullInteger; } #endregion @@ -94,8 +94,8 @@ public UserInfo() [SortOrder(1), MaxLength(50)] public string FirstName { - get { return Profile.FirstName; } - set { Profile.FirstName = value; } + get { return this.Profile.FirstName; } + set { this.Profile.FirstName = value; } } /// ----------------------------------------------------------------------------- @@ -122,12 +122,12 @@ public bool IsAdmin { get { - if (IsSuperUser) + if (this.IsSuperUser) { return true; } - PortalInfo ps = PortalController.Instance.GetPortal(PortalID); - return ps != null && IsInRole(ps.AdministratorRoleName); + PortalInfo ps = PortalController.Instance.GetPortal(this.PortalID); + return ps != null && this.IsInRole(ps.AdministratorRoleName); } } @@ -147,8 +147,8 @@ public bool IsAdmin [SortOrder(2), MaxLength(50)] public string LastName { - get { return Profile.LastName; } - set { Profile.LastName = value; } + get { return this.Profile.LastName; } + set { this.Profile.LastName = value; } } /// ----------------------------------------------------------------------------- @@ -161,17 +161,17 @@ public UserMembership Membership { get { - if (_membership == null) + if (this._membership == null) { - _membership = new UserMembership(this); - if ((Username != null) && (!String.IsNullOrEmpty(Username))) + this._membership = new UserMembership(this); + if ((this.Username != null) && (!String.IsNullOrEmpty(this.Username))) { UserController.GetUserMembership(this); } } - return _membership; + return this._membership; } - set { _membership = value; } + set { this._membership = value; } } /// @@ -229,15 +229,15 @@ public UserProfile Profile { get { - if (_profile == null) + if (this._profile == null) { - _profile = new UserProfile(this); + this._profile = new UserProfile(this); UserInfo userInfo = this; ProfileController.GetUserProfile(ref userInfo); } - return _profile; + return this._profile; } - set { _profile = value; } + set { this._profile = value; } } [Browsable(false)] @@ -245,11 +245,11 @@ public string[] Roles { get { - var socialRoles = Social.Roles; + var socialRoles = this.Social.Roles; if (socialRoles.Count == 0) return new string[0]; - return (from r in Social.Roles + return (from r in this.Social.Roles where r.Status == RoleStatus.Approved && (r.EffectiveDate < DateTime.Now || Null.IsNull(r.EffectiveDate)) && @@ -270,7 +270,7 @@ public UserSocial Social { get { - return _social.GetOrAdd(PortalID, i => new UserSocial(this)); + return this._social.GetOrAdd(this.PortalID, i => new UserSocial(this)); } } @@ -308,11 +308,11 @@ public UserSocial Social public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound) { Scope internScope; - if (UserID == -1 && currentScope > Scope.Configuration) + if (this.UserID == -1 && currentScope > Scope.Configuration) { internScope = Scope.Configuration; //anonymous users only get access to displayname } - else if (UserID != accessingUser.UserID && !isAdminUser(ref accessingUser) && currentScope > Scope.DefaultSettings) + else if (this.UserID != accessingUser.UserID && !this.isAdminUser(ref accessingUser) && currentScope > Scope.DefaultSettings) { internScope = Scope.DefaultSettings; //registerd users can access username and userID as well } @@ -330,7 +330,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format return PropertyAccess.ContentLocked; } var ps = PortalSecurity.Instance; - var code = ps.Encrypt(Config.GetDecryptionkey(), PortalID + "-" + GetMembershipUserId()); + var code = ps.Encrypt(Config.GetDecryptionkey(), this.PortalID + "-" + this.GetMembershipUserId()); return code.Replace("+", ".").Replace("/", "-").Replace("=", "_"); case "affiliateid": if (internScope < Scope.SystemMessages) @@ -338,77 +338,77 @@ public string GetProperty(string propertyName, string format, CultureInfo format propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (AffiliateID.ToString(outputFormat, formatProvider)); + return (this.AffiliateID.ToString(outputFormat, formatProvider)); case "displayname": if (internScope < Scope.Configuration) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return PropertyAccess.FormatString(DisplayName, format); + return PropertyAccess.FormatString(this.DisplayName, format); case "email": if (internScope < Scope.DefaultSettings) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PropertyAccess.FormatString(Email, format)); + return (PropertyAccess.FormatString(this.Email, format)); case "firstname": //using profile property is recommended! if (internScope < Scope.DefaultSettings) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PropertyAccess.FormatString(FirstName, format)); + return (PropertyAccess.FormatString(this.FirstName, format)); case "issuperuser": if (internScope < Scope.Debug) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (IsSuperUser.ToString(formatProvider)); + return (this.IsSuperUser.ToString(formatProvider)); case "lastname": //using profile property is recommended! if (internScope < Scope.DefaultSettings) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PropertyAccess.FormatString(LastName, format)); + return (PropertyAccess.FormatString(this.LastName, format)); case "portalid": if (internScope < Scope.Configuration) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PortalID.ToString(outputFormat, formatProvider)); + return (this.PortalID.ToString(outputFormat, formatProvider)); case "userid": if (internScope < Scope.DefaultSettings) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (UserID.ToString(outputFormat, formatProvider)); + return (this.UserID.ToString(outputFormat, formatProvider)); case "username": if (internScope < Scope.DefaultSettings) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PropertyAccess.FormatString(Username, format)); + return (PropertyAccess.FormatString(this.Username, format)); case "fullname": //fullname is obsolete, it will return DisplayName if (internScope < Scope.Configuration) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PropertyAccess.FormatString(DisplayName, format)); + return (PropertyAccess.FormatString(this.DisplayName, format)); case "roles": if (currentScope < Scope.SystemMessages) { propertyNotFound = true; return PropertyAccess.ContentLocked; } - return (PropertyAccess.FormatString(string.Join(", ", Roles), format)); + return (PropertyAccess.FormatString(string.Join(", ", this.Roles), format)); } propertyNotFound = true; return string.Empty; @@ -440,12 +440,12 @@ private bool isAdminUser(ref UserInfo accessingUser) { return false; } - if (String.IsNullOrEmpty(_administratorRoleName)) + if (String.IsNullOrEmpty(this._administratorRoleName)) { PortalInfo ps = PortalController.Instance.GetPortal(accessingUser.PortalID); - _administratorRoleName = ps.AdministratorRoleName; + this._administratorRoleName = ps.AdministratorRoleName; } - return accessingUser.IsInRole(_administratorRoleName) || accessingUser.IsSuperUser; + return accessingUser.IsInRole(this._administratorRoleName) || accessingUser.IsSuperUser; } private string GetMembershipUserId() @@ -467,7 +467,7 @@ private string GetMembershipUserId() public bool IsInRole(string role) { //super users should always be verified. - if (IsSuperUser) + if (this.IsSuperUser) { return role != "Unverified Users"; } @@ -476,16 +476,16 @@ public bool IsInRole(string role) { return true; } - if (UserID == Null.NullInteger && role == Globals.glbRoleUnauthUserName) + if (this.UserID == Null.NullInteger && role == Globals.glbRoleUnauthUserName) { return true; } - if ("[" + UserID + "]" == role) + if ("[" + this.UserID + "]" == role) { return true; } - var roles = Roles; + var roles = this.Roles; if (roles != null) { return roles.Any(s => s == role); @@ -500,7 +500,7 @@ public bool IsInRole(string role) /// ----------------------------------------------------------------------------- public DateTime LocalTime() { - return LocalTime(DateUtils.GetDatabaseUtcTime()); + return this.LocalTime(DateUtils.GetDatabaseUtcTime()); } /// ----------------------------------------------------------------------------- @@ -511,9 +511,9 @@ public DateTime LocalTime() /// ----------------------------------------------------------------------------- public DateTime LocalTime(DateTime utcTime) { - if (UserID > Null.NullInteger) + if (this.UserID > Null.NullInteger) { - return TimeZoneInfo.ConvertTime(utcTime, TimeZoneInfo.Utc, Profile.PreferredTimeZone); + return TimeZoneInfo.ConvertTime(utcTime, TimeZoneInfo.Utc, this.Profile.PreferredTimeZone); } return TimeZoneInfo.ConvertTime(utcTime, TimeZoneInfo.Utc, PortalController.Instance.GetCurrentPortalSettings().TimeZone); } @@ -527,11 +527,11 @@ public DateTime LocalTime(DateTime utcTime) public void UpdateDisplayName(string format) { //Replace Tokens - format = format.Replace("[USERID]", UserID.ToString(CultureInfo.InvariantCulture)); - format = format.Replace("[FIRSTNAME]", FirstName); - format = format.Replace("[LASTNAME]", LastName); - format = format.Replace("[USERNAME]", Username); - DisplayName = format; + format = format.Replace("[USERID]", this.UserID.ToString(CultureInfo.InvariantCulture)); + format = format.Replace("[FIRSTNAME]", this.FirstName); + format = format.Replace("[LASTNAME]", this.LastName); + format = format.Replace("[USERNAME]", this.Username); + this.DisplayName = format; } #endregion diff --git a/DNN Platform/Library/Entities/Users/UserRoleInfo.cs b/DNN Platform/Library/Entities/Users/UserRoleInfo.cs index fb87e263b2a..6b6165860c6 100644 --- a/DNN Platform/Library/Entities/Users/UserRoleInfo.cs +++ b/DNN Platform/Library/Entities/Users/UserRoleInfo.cs @@ -53,17 +53,17 @@ public override void Fill(IDataReader dr) base.Fill(dr); //Fill this class properties - UserRoleID = Null.SetNullInteger(dr["UserRoleID"]); - UserID = Null.SetNullInteger(dr["UserID"]); - FullName = Null.SetNullString(dr["DisplayName"]); - Email = Null.SetNullString(dr["Email"]); - EffectiveDate = Null.SetNullDateTime(dr["EffectiveDate"]); - ExpiryDate = Null.SetNullDateTime(dr["ExpiryDate"]); - IsOwner = Null.SetNullBoolean(dr["IsOwner"]); - IsTrialUsed = Null.SetNullBoolean(dr["IsTrialUsed"]); - if (UserRoleID > Null.NullInteger) + this.UserRoleID = Null.SetNullInteger(dr["UserRoleID"]); + this.UserID = Null.SetNullInteger(dr["UserID"]); + this.FullName = Null.SetNullString(dr["DisplayName"]); + this.Email = Null.SetNullString(dr["Email"]); + this.EffectiveDate = Null.SetNullDateTime(dr["EffectiveDate"]); + this.ExpiryDate = Null.SetNullDateTime(dr["ExpiryDate"]); + this.IsOwner = Null.SetNullBoolean(dr["IsOwner"]); + this.IsTrialUsed = Null.SetNullBoolean(dr["IsTrialUsed"]); + if (this.UserRoleID > Null.NullInteger) { - Subscribed = true; + this.Subscribed = true; } } } diff --git a/DNN Platform/Library/Entities/Users/Users Online/AnonymousUserInfo.cs b/DNN Platform/Library/Entities/Users/Users Online/AnonymousUserInfo.cs index 32cc14b5e74..c0d6a7ef14f 100644 --- a/DNN Platform/Library/Entities/Users/Users Online/AnonymousUserInfo.cs +++ b/DNN Platform/Library/Entities/Users/Users Online/AnonymousUserInfo.cs @@ -36,11 +36,11 @@ public string UserID { get { - return _UserID; + return this._UserID; } set { - _UserID = value; + this._UserID = value; } } } diff --git a/DNN Platform/Library/Entities/Users/Users Online/BaseUserInfo.cs b/DNN Platform/Library/Entities/Users/Users Online/BaseUserInfo.cs index 980862479c9..42e7441332c 100644 --- a/DNN Platform/Library/Entities/Users/Users Online/BaseUserInfo.cs +++ b/DNN Platform/Library/Entities/Users/Users Online/BaseUserInfo.cs @@ -40,11 +40,11 @@ public int PortalID { get { - return _PortalID; + return this._PortalID; } set { - _PortalID = value; + this._PortalID = value; } } @@ -58,11 +58,11 @@ public int TabID { get { - return _TabID; + return this._TabID; } set { - _TabID = value; + this._TabID = value; } } @@ -76,11 +76,11 @@ public DateTime CreationDate { get { - return _CreationDate; + return this._CreationDate; } set { - _CreationDate = value; + this._CreationDate = value; } } @@ -94,11 +94,11 @@ public DateTime LastActiveDate { get { - return _LastActiveDate; + return this._LastActiveDate; } set { - _LastActiveDate = value; + this._LastActiveDate = value; } } } diff --git a/DNN Platform/Library/Entities/Users/Users Online/OnlineUserInfo.cs b/DNN Platform/Library/Entities/Users/Users Online/OnlineUserInfo.cs index f5afe78ebd0..1c97ce367df 100644 --- a/DNN Platform/Library/Entities/Users/Users Online/OnlineUserInfo.cs +++ b/DNN Platform/Library/Entities/Users/Users Online/OnlineUserInfo.cs @@ -37,11 +37,11 @@ public int UserID { get { - return _UserID; + return this._UserID; } set { - _UserID = value; + this._UserID = value; } } } diff --git a/DNN Platform/Library/Entities/Users/Users Online/PurgeUsersOnline.cs b/DNN Platform/Library/Entities/Users/Users Online/PurgeUsersOnline.cs index a3c3309df51..485c363ddea 100644 --- a/DNN Platform/Library/Entities/Users/Users Online/PurgeUsersOnline.cs +++ b/DNN Platform/Library/Entities/Users/Users Online/PurgeUsersOnline.cs @@ -39,7 +39,7 @@ public class PurgeUsersOnline : SchedulerClient [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] public PurgeUsersOnline(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } /// ----------------------------------------------------------------------------- @@ -56,10 +56,10 @@ private void UpdateUsersOnline() if ((objUserOnlineController.IsEnabled())) { //Update the Users Online records from Cache - Status = "Updating Users Online"; + this.Status = "Updating Users Online"; objUserOnlineController.UpdateUsersOnline(); - Status = "Update Users Online Successfully"; - ScheduleHistoryItem.Succeeded = true; + this.Status = "Update Users Online Successfully"; + this.ScheduleHistoryItem.Succeeded = true; } } @@ -74,18 +74,18 @@ public override void DoWork() try { //notification that the event is progressing - Progressing(); //OPTIONAL - UpdateUsersOnline(); - ScheduleHistoryItem.Succeeded = true; //REQUIRED - ScheduleHistoryItem.AddLogNote("UsersOnline purge completed."); + this.Progressing(); //OPTIONAL + this.UpdateUsersOnline(); + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("UsersOnline purge completed."); } catch (Exception exc) //REQUIRED { - ScheduleHistoryItem.Succeeded = false; //REQUIRED - ScheduleHistoryItem.AddLogNote("UsersOnline purge failed." + exc); + this.ScheduleHistoryItem.Succeeded = false; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("UsersOnline purge failed." + exc); //notification that we have errored - Errored(ref exc); + this.Errored(ref exc); //log the exception Exceptions.LogException(exc); diff --git a/DNN Platform/Library/Entities/Users/Users Online/UserOnlineController.cs b/DNN Platform/Library/Entities/Users/Users Online/UserOnlineController.cs index 3e99219099f..66faf68eb3e 100644 --- a/DNN Platform/Library/Entities/Users/Users Online/UserOnlineController.cs +++ b/DNN Platform/Library/Entities/Users/Users Online/UserOnlineController.cs @@ -104,7 +104,7 @@ public bool IsEnabled() public bool IsUserOnline(UserInfo user) { bool isOnline = false; - if (IsEnabled()) + if (this.IsEnabled()) { isOnline = memberProvider.IsUserOnline(user); } @@ -138,7 +138,7 @@ private void TrackAnonymousUser(HttpContext context) return; } AnonymousUserInfo user; - Hashtable userList = GetUserList(); + Hashtable userList = this.GetUserList(); string userID; //Check if the Tracking cookie exists @@ -230,7 +230,7 @@ private void TrackAuthenticatedUser(HttpContext context) UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); //Get user list - Hashtable userList = GetUserList(); + Hashtable userList = this.GetUserList(); var user = new OnlineUserInfo(); if (objUserInfo.UserID > 0) @@ -245,7 +245,7 @@ private void TrackAuthenticatedUser(HttpContext context) user.CreationDate = user.LastActiveDate; } userList[objUserInfo.UserID.ToString()] = user; - SetUserList(userList); + this.SetUserList(userList); } /// ----------------------------------------------------------------------------- @@ -269,11 +269,11 @@ public void TrackUsers() } if ((context.Request.IsAuthenticated)) { - TrackAuthenticatedUser(context); + this.TrackAuthenticatedUser(context); } else if ((context.Request.Browser.Cookies)) { - TrackAnonymousUser(context); + this.TrackAnonymousUser(context); } } @@ -286,13 +286,13 @@ public void TrackUsers() public void UpdateUsersOnline() { //Get a Current User List - Hashtable userList = GetUserList(); + Hashtable userList = this.GetUserList(); //Create a shallow copy of the list to Process var listToProcess = (Hashtable) userList.Clone(); //Clear the list - ClearUserList(); + this.ClearUserList(); //Persist the current User List try @@ -306,7 +306,7 @@ public void UpdateUsersOnline() } //Remove users that have expired - memberProvider.DeleteUsersOnline(GetOnlineTimeWindow()); + memberProvider.DeleteUsersOnline(this.GetOnlineTimeWindow()); } } } diff --git a/DNN Platform/Library/ExtensionPoints/ContextMenuItemExtensionControl.cs b/DNN Platform/Library/ExtensionPoints/ContextMenuItemExtensionControl.cs index 7ef64c05c1d..fbe63d1d570 100644 --- a/DNN Platform/Library/ExtensionPoints/ContextMenuItemExtensionControl.cs +++ b/DNN Platform/Library/ExtensionPoints/ContextMenuItemExtensionControl.cs @@ -27,7 +27,7 @@ protected override void OnInit(EventArgs e) StringBuilder str = new StringBuilder(); - foreach (var extension in extensionPointManager.GetContextMenuItemExtensionPoints(Module, Group)) + foreach (var extension in extensionPointManager.GetContextMenuItemExtensionPoints(this.Module, this.Group)) { var icon = extension.Icon; if (icon.StartsWith("~/")) @@ -43,12 +43,12 @@ protected override void OnInit(EventArgs e) "); } - content = str.ToString(); + this.content = str.ToString(); } protected override void RenderContents(HtmlTextWriter output) { - output.Write(content); + output.Write(this.content); } } } diff --git a/DNN Platform/Library/ExtensionPoints/DefaultExtensionControl.cs b/DNN Platform/Library/ExtensionPoints/DefaultExtensionControl.cs index 56b1f2b3fee..0bee846d23f 100644 --- a/DNN Platform/Library/ExtensionPoints/DefaultExtensionControl.cs +++ b/DNN Platform/Library/ExtensionPoints/DefaultExtensionControl.cs @@ -19,12 +19,12 @@ public string Module { get { - var s = (string)ViewState["Module"]; + var s = (string)this.ViewState["Module"]; return s ?? string.Empty; } set { - ViewState["Module"] = value; + this.ViewState["Module"] = value; } } @@ -34,12 +34,12 @@ public string Group { get { - var s = (string)ViewState["Group"]; + var s = (string)this.ViewState["Group"]; return s ?? string.Empty; } set { - ViewState["Group"] = value; + this.ViewState["Group"] = value; } } @@ -49,12 +49,12 @@ public string Name { get { - var s = (string)ViewState["Name"]; + var s = (string)this.ViewState["Name"]; return s ?? string.Empty; } set { - ViewState["Name"] = value; + this.ViewState["Name"] = value; } } diff --git a/DNN Platform/Library/ExtensionPoints/EditPagePanelExtensionControl.cs b/DNN Platform/Library/ExtensionPoints/EditPagePanelExtensionControl.cs index 0032808b93a..f48c8c98610 100644 --- a/DNN Platform/Library/ExtensionPoints/EditPagePanelExtensionControl.cs +++ b/DNN Platform/Library/ExtensionPoints/EditPagePanelExtensionControl.cs @@ -17,10 +17,10 @@ public class EditPagePanelExtensionControl : DefaultExtensionControl private void LoadControl(IEditPagePanelExtensionPoint extension) { var editPanel = new PanelEditPagePanelExtensionControl { PanelId = extension.EditPagePanelId, Text = extension.Text, CssClass = extension.CssClass }; - var control = Page.LoadControl(extension.UserControlSrc); + var control = this.Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); editPanel.Controls.Add(control); - Controls.Add(editPanel); + this.Controls.Add(editPanel); } @@ -29,21 +29,21 @@ protected override void OnInit(EventArgs e) base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); - if (!String.IsNullOrEmpty(Name)) + if (!String.IsNullOrEmpty(this.Name)) { - var extension = extensionPointManager.GetEditPagePanelExtensionPointFirstByPriority(Module, Name); + var extension = extensionPointManager.GetEditPagePanelExtensionPointFirstByPriority(this.Module, this.Name); if (extension != null) { - LoadControl(extension); + this.LoadControl(extension); } } else { - foreach (var extension in extensionPointManager.GetEditPagePanelExtensionPoints(Module, Group)) + foreach (var extension in extensionPointManager.GetEditPagePanelExtensionPoints(this.Module, this.Group)) { if (extension != null) { - LoadControl(extension); + this.LoadControl(extension); } } } @@ -51,7 +51,7 @@ protected override void OnInit(EventArgs e) public void BindAction(int portalId, int tabId, int moduleId) { - foreach (var control in Controls) + foreach (var control in this.Controls) { var panelcontrol = control as PanelEditPagePanelExtensionControl; if (panelcontrol != null) @@ -70,7 +70,7 @@ public void BindAction(int portalId, int tabId, int moduleId) public void SaveAction(int portalId, int tabId, int moduleId) { - foreach (var control in Controls) + foreach (var control in this.Controls) { var panelcontrol = control as PanelEditPagePanelExtensionControl; if (panelcontrol != null) @@ -89,7 +89,7 @@ public void SaveAction(int portalId, int tabId, int moduleId) public void CancelAction(int portalId, int tabId, int moduleId) { - foreach (var control in Controls) + foreach (var control in this.Controls) { var panelcontrol = control as PanelEditPagePanelExtensionControl; if (panelcontrol != null) @@ -115,9 +115,9 @@ public class PanelEditPagePanelExtensionControl : WebControl protected override void RenderContents(HtmlTextWriter op) { - op.Write(@"
    -

    -"+Text+@" + op.Write(@"
    +

    +"+this.Text+@"

    "); base.RenderContents(op); diff --git a/DNN Platform/Library/ExtensionPoints/EditPageTabExtensionControl.cs b/DNN Platform/Library/ExtensionPoints/EditPageTabExtensionControl.cs index d349dc383d3..e216b4da5b3 100644 --- a/DNN Platform/Library/ExtensionPoints/EditPageTabExtensionControl.cs +++ b/DNN Platform/Library/ExtensionPoints/EditPageTabExtensionControl.cs @@ -21,12 +21,12 @@ public string TabControlId { get { - var s = (String)ViewState["TabControlId"]; + var s = (String)this.ViewState["TabControlId"]; return (s ?? String.Empty); } set { - ViewState["TabControlId"] = value; + this.ViewState["TabControlId"] = value; } } @@ -36,12 +36,12 @@ public string PanelControlId { get { - var s = (String)ViewState["PanelControlId"]; + var s = (String)this.ViewState["PanelControlId"]; return (s ?? String.Empty); } set { - ViewState["PanelControlId"] = value; + this.ViewState["PanelControlId"] = value; } } @@ -49,10 +49,10 @@ protected override void OnInit(EventArgs e) { var extensionPointManager = new ExtensionPointManager(); - var tabs = (HtmlGenericControl)Parent.FindControl(TabControlId); - var panel = Parent.FindControl(PanelControlId); + var tabs = (HtmlGenericControl)this.Parent.FindControl(this.TabControlId); + var panel = this.Parent.FindControl(this.PanelControlId); - foreach (var extension in extensionPointManager.GetEditPageTabExtensionPoints(Module, Group)) + foreach (var extension in extensionPointManager.GetEditPageTabExtensionPoints(this.Module, this.Group)) { if (extension.Visible) { @@ -64,7 +64,7 @@ protected override void OnInit(EventArgs e) tabs.Controls.Add(liElement); var container = new PanelTabExtensionControl { PanelId = extension.EditPageTabId }; - var control = Page.LoadControl(extension.UserControlSrc); + var control = this.Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); container.Controls.Add(control); panel.Controls.Add(container); @@ -74,7 +74,7 @@ protected override void OnInit(EventArgs e) public void BindAction(int portalId, int tabId, int moduleId) { - var panel = Parent.FindControl(PanelControlId); + var panel = this.Parent.FindControl(this.PanelControlId); foreach (var control in panel.Controls) { @@ -95,7 +95,7 @@ public void BindAction(int portalId, int tabId, int moduleId) public void SaveAction(int portalId, int tabId, int moduleId) { - var panel = Parent.FindControl(PanelControlId); + var panel = this.Parent.FindControl(this.PanelControlId); foreach (var control in panel.Controls) { @@ -116,7 +116,7 @@ public void SaveAction(int portalId, int tabId, int moduleId) public void CancelAction(int portalId, int tabId, int moduleId) { - var panel = Parent.FindControl(PanelControlId); + var panel = this.Parent.FindControl(this.PanelControlId); foreach (var control in panel.Controls) { @@ -153,7 +153,7 @@ public override void RenderEndTag(HtmlTextWriter writer) protected override void RenderContents(HtmlTextWriter op) { - op.Write("
    "); + op.Write("
    "); base.RenderContents(op); op.Write("
    "); } diff --git a/DNN Platform/Library/ExtensionPoints/ExtensionPointManager.cs b/DNN Platform/Library/ExtensionPoints/ExtensionPointManager.cs index c45cf5e58ed..016c35cf2f8 100644 --- a/DNN Platform/Library/ExtensionPoints/ExtensionPointManager.cs +++ b/DNN Platform/Library/ExtensionPoints/ExtensionPointManager.cs @@ -71,12 +71,12 @@ public static void ComposeParts(params object[] attributeParts) public IEnumerable GetEditPageTabExtensionPoints(string module) { - return GetEditPageTabExtensionPoints(module, null); + return this.GetEditPageTabExtensionPoints(module, null); } public IEnumerable GetEditPageTabExtensionPoints(string module, string group) { - return from e in _editPageTabExtensionPoint + return from e in this._editPageTabExtensionPoint where e.Metadata.Module == module && (string.IsNullOrEmpty(@group) || e.Metadata.Group == @group) orderby e.Value.Order @@ -85,25 +85,25 @@ orderby e.Value.Order public IEnumerable GetToolBarButtonExtensionPoints(string module) { - return GetToolBarButtonExtensionPoints(module, null); + return this.GetToolBarButtonExtensionPoints(module, null); } public IEnumerable GetToolBarButtonExtensionPoints(string module, string group) { - return GetToolBarButtonExtensionPoints(module, group, new NoFilter()); + return this.GetToolBarButtonExtensionPoints(module, group, new NoFilter()); } public IEnumerable GetToolBarButtonExtensionPoints(string module, string group, IExtensionPointFilter filter) { - return from e in _toolbarButtonExtensionPoints - where FilterCondition(e.Metadata, module, @group) && filter.Condition(e.Metadata) + return from e in this._toolbarButtonExtensionPoints + where this.FilterCondition(e.Metadata, module, @group) && filter.Condition(e.Metadata) orderby e.Value.Order select e.Value; } public IToolBarButtonExtensionPoint GetToolBarButtonExtensionPointFirstByPriority(string module, string name) { - return (from e in _toolbarButtonExtensionPoints + return (from e in this._toolbarButtonExtensionPoints where e.Metadata.Module == module && e.Metadata.Name == name orderby e.Metadata.Priority select e.Value).FirstOrDefault(); @@ -112,12 +112,12 @@ orderby e.Metadata.Priority public IEnumerable GetScriptItemExtensionPoints(string module) { - return GetScriptItemExtensionPoints(module, null); + return this.GetScriptItemExtensionPoints(module, null); } public IEnumerable GetScriptItemExtensionPoints(string module, string group) { - return from e in _scripts + return from e in this._scripts where e.Metadata.Module == module && (string.IsNullOrEmpty(@group) || e.Metadata.Group == @group) orderby e.Value.Order @@ -126,12 +126,12 @@ orderby e.Value.Order public IEnumerable GetEditPagePanelExtensionPoints(string module) { - return GetEditPagePanelExtensionPoints(module, null); + return this.GetEditPagePanelExtensionPoints(module, null); } public IEnumerable GetEditPagePanelExtensionPoints(string module, string group) { - return from e in _editPagePanelExtensionPoints + return from e in this._editPagePanelExtensionPoints where e.Metadata.Module == module && (string.IsNullOrEmpty(@group) || e.Metadata.Group == @group) orderby e.Value.Order @@ -140,7 +140,7 @@ orderby e.Value.Order public IEditPagePanelExtensionPoint GetEditPagePanelExtensionPointFirstByPriority(string module, string name) { - return (from e in _editPagePanelExtensionPoints + return (from e in this._editPagePanelExtensionPoints where e.Metadata.Module == module && e.Metadata.Name == name orderby e.Metadata.Priority select e.Value).FirstOrDefault(); @@ -148,12 +148,12 @@ orderby e.Metadata.Priority public IEnumerable GetContextMenuItemExtensionPoints(string module) { - return GetContextMenuItemExtensionPoints(module, null); + return this.GetContextMenuItemExtensionPoints(module, null); } public IEnumerable GetContextMenuItemExtensionPoints(string module, string group) { - return from e in _ctxMenuItemExtensionPoints + return from e in this._ctxMenuItemExtensionPoints where e.Metadata.Module == module && (string.IsNullOrEmpty(@group) || e.Metadata.Group == @group) orderby e.Value.Order @@ -162,7 +162,7 @@ orderby e.Value.Order public IUserControlExtensionPoint GetUserControlExtensionPointFirstByPriority(string module, string name) { - return (from e in _userControlExtensionPoints + return (from e in this._userControlExtensionPoints where e.Metadata.Module == module && e.Metadata.Name == name orderby e.Metadata.Priority select e.Value).FirstOrDefault(); @@ -170,7 +170,7 @@ orderby e.Metadata.Priority public IEnumerable GetUserControlExtensionPoints(string module, string group) { - return from e in _userControlExtensionPoints + return from e in this._userControlExtensionPoints where e.Metadata.Module == module && e.Metadata.Group == @group orderby e.Value.Order select e.Value; @@ -178,36 +178,36 @@ orderby e.Value.Order public IEnumerable GetMenuItemExtensionPoints(string module) { - return GetMenuItemExtensionPoints(module, null); + return this.GetMenuItemExtensionPoints(module, null); } public IEnumerable GetMenuItemExtensionPoints(string module, string group) { - return GetMenuItemExtensionPoints(module, group, new NoFilter()); + return this.GetMenuItemExtensionPoints(module, group, new NoFilter()); } public IEnumerable GetMenuItemExtensionPoints(string module, string group, IExtensionPointFilter filter) { - return from e in _menuItems - where FilterCondition(e.Metadata, module, @group) && filter.Condition(e.Metadata) + return from e in this._menuItems + where this.FilterCondition(e.Metadata, module, @group) && filter.Condition(e.Metadata) orderby e.Value.Order select e.Value; } public IEnumerable GetGridColumnExtensionPoints(string module) { - return GetGridColumnExtensionPoints(module, null); + return this.GetGridColumnExtensionPoints(module, null); } public IEnumerable GetGridColumnExtensionPoints(string module, string group) { - return GetGridColumnExtensionPoints(module, group, new NoFilter()); + return this.GetGridColumnExtensionPoints(module, group, new NoFilter()); } public IEnumerable GetGridColumnExtensionPoints(string module, string group, IExtensionPointFilter filter) { - return from e in _gridColumns - where FilterCondition(e.Metadata, module, @group) && filter.Condition(e.Metadata) + return from e in this._gridColumns + where this.FilterCondition(e.Metadata, module, @group) && filter.Condition(e.Metadata) orderby e.Value.Order select e.Value; } diff --git a/DNN Platform/Library/ExtensionPoints/Filters/CompositeFilter.cs b/DNN Platform/Library/ExtensionPoints/Filters/CompositeFilter.cs index 845cadca52d..8e5df7c7d7b 100644 --- a/DNN Platform/Library/ExtensionPoints/Filters/CompositeFilter.cs +++ b/DNN Platform/Library/ExtensionPoints/Filters/CompositeFilter.cs @@ -13,18 +13,18 @@ public class CompositeFilter : IExtensionPointFilter public CompositeFilter() { - filters = new List(); + this.filters = new List(); } public CompositeFilter And(IExtensionPointFilter filter) { - filters.Add(filter); + this.filters.Add(filter); return this; } public bool Condition(IExtensionPointData m) { - return filters.All(f => f.Condition(m)); + return this.filters.All(f => f.Condition(m)); } } } diff --git a/DNN Platform/Library/ExtensionPoints/Filters/FilterByHostMenu.cs b/DNN Platform/Library/ExtensionPoints/Filters/FilterByHostMenu.cs index 1e9eba3d46d..d849350cd97 100644 --- a/DNN Platform/Library/ExtensionPoints/Filters/FilterByHostMenu.cs +++ b/DNN Platform/Library/ExtensionPoints/Filters/FilterByHostMenu.cs @@ -15,7 +15,7 @@ public FilterByHostMenu(bool isHostMenu) public bool Condition(IExtensionPointData m) { - return !isHostMenu || !m.DisableOnHost; + return !this.isHostMenu || !m.DisableOnHost; } } } diff --git a/DNN Platform/Library/ExtensionPoints/Filters/FilterByUnauthenticated.cs b/DNN Platform/Library/ExtensionPoints/Filters/FilterByUnauthenticated.cs index e4b8c3c2e0d..4b2ac50b57c 100644 --- a/DNN Platform/Library/ExtensionPoints/Filters/FilterByUnauthenticated.cs +++ b/DNN Platform/Library/ExtensionPoints/Filters/FilterByUnauthenticated.cs @@ -15,7 +15,7 @@ public FilterByUnauthenticated(bool isAuthenticated) public bool Condition(IExtensionPointData m) { - return isAuthenticated || !m.DisableUnauthenticated; + return this.isAuthenticated || !m.DisableUnauthenticated; } } } diff --git a/DNN Platform/Library/ExtensionPoints/SafeDirectoryCatalog.cs b/DNN Platform/Library/ExtensionPoints/SafeDirectoryCatalog.cs index e23ded423f8..221a6b5b34f 100644 --- a/DNN Platform/Library/ExtensionPoints/SafeDirectoryCatalog.cs +++ b/DNN Platform/Library/ExtensionPoints/SafeDirectoryCatalog.cs @@ -19,7 +19,7 @@ public SafeDirectoryCatalog(string directory) { var files = Directory.EnumerateFiles(directory, "*.dll", SearchOption.AllDirectories); - _catalog = new AggregateCatalog(); + this._catalog = new AggregateCatalog(); foreach (var file in files) { @@ -29,7 +29,7 @@ public SafeDirectoryCatalog(string directory) //Force MEF to load the plugin and figure out if there are any exports // good assemblies will not throw the RTLE exception and can be added to the catalog - if (asmCat.Parts.ToList().Count > 0) _catalog.Catalogs.Add(asmCat); + if (asmCat.Parts.ToList().Count > 0) this._catalog.Catalogs.Add(asmCat); } catch (ReflectionTypeLoadException) { @@ -48,7 +48,7 @@ public override IQueryable Parts { get { - return _catalog.Parts; + return this._catalog.Parts; } } } diff --git a/DNN Platform/Library/ExtensionPoints/ToolBarButtonExtensionControl.cs b/DNN Platform/Library/ExtensionPoints/ToolBarButtonExtensionControl.cs index c9c00c7a27f..572b80c180d 100644 --- a/DNN Platform/Library/ExtensionPoints/ToolBarButtonExtensionControl.cs +++ b/DNN Platform/Library/ExtensionPoints/ToolBarButtonExtensionControl.cs @@ -31,18 +31,18 @@ protected override void RenderContents(HtmlTextWriter output) .And(new FilterByHostMenu(this.IsHost)) .And(new FilterByUnauthenticated(HttpContext.Current.Request.IsAuthenticated)); - foreach (var extension in extensionPointManager.GetToolBarButtonExtensionPoints(Module, Group, filter)) + foreach (var extension in extensionPointManager.GetToolBarButtonExtensionPoints(this.Module, this.Group, filter)) { if (extension is IToolBarMenuButtonExtensionPoint) { - btnRenderer = new ToolBarMenuButtonRenderer(); - str.AppendFormat(btnRenderer.GetOutput(extension)); + this.btnRenderer = new ToolBarMenuButtonRenderer(); + str.AppendFormat(this.btnRenderer.GetOutput(extension)); } else { - extension.ModuleContext = ModuleContext; - btnRenderer = new ToolBarButtonRenderer(); - str.AppendFormat(btnRenderer.GetOutput(extension)); + extension.ModuleContext = this.ModuleContext; + this.btnRenderer = new ToolBarButtonRenderer(); + str.AppendFormat(this.btnRenderer.GetOutput(extension)); } } @@ -51,7 +51,7 @@ protected override void RenderContents(HtmlTextWriter output) protected override void Render(HtmlTextWriter writer) { - RenderContents(writer); + this.RenderContents(writer); } } } diff --git a/DNN Platform/Library/ExtensionPoints/ToolBarMenuButtonRenderer.cs b/DNN Platform/Library/ExtensionPoints/ToolBarMenuButtonRenderer.cs index 4f7d85435a2..4677bd076ca 100644 --- a/DNN Platform/Library/ExtensionPoints/ToolBarMenuButtonRenderer.cs +++ b/DNN Platform/Library/ExtensionPoints/ToolBarMenuButtonRenderer.cs @@ -45,7 +45,7 @@ public string GetOutput(IExtensionPoint extensionPoint) str.AppendLine("
      "); foreach (var item in extension.Items) { - str.AppendLine(GetItemOutput(item)); + str.AppendLine(this.GetItemOutput(item)); } str.AppendLine("
    "); diff --git a/DNN Platform/Library/ExtensionPoints/UserControlExtensionControl.cs b/DNN Platform/Library/ExtensionPoints/UserControlExtensionControl.cs index 79a118d8d74..11b64b68946 100644 --- a/DNN Platform/Library/ExtensionPoints/UserControlExtensionControl.cs +++ b/DNN Platform/Library/ExtensionPoints/UserControlExtensionControl.cs @@ -15,9 +15,9 @@ public class UserControlExtensionControl : DefaultExtensionControl { private void LoadControl(IUserControlExtensionPoint extension) { - var control = Page.LoadControl(extension.UserControlSrc); + var control = this.Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); - Controls.Add(control); + this.Controls.Add(control); } protected override void OnInit(EventArgs e) @@ -25,23 +25,23 @@ protected override void OnInit(EventArgs e) base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); - if (!String.IsNullOrEmpty(Name)) + if (!String.IsNullOrEmpty(this.Name)) { - var extension = extensionPointManager.GetUserControlExtensionPointFirstByPriority(Module, Name); - LoadControl(extension); + var extension = extensionPointManager.GetUserControlExtensionPointFirstByPriority(this.Module, this.Name); + this.LoadControl(extension); } else { - foreach (var extension in extensionPointManager.GetUserControlExtensionPoints(Module, Group)) + foreach (var extension in extensionPointManager.GetUserControlExtensionPoints(this.Module, this.Group)) { - LoadControl(extension); + this.LoadControl(extension); } } } public void BindAction(int portalId, int tabId, int moduleId) { - foreach (var control in Controls) + foreach (var control in this.Controls) { var actionsControl = control as IUserControlActions; if (actionsControl != null) @@ -53,7 +53,7 @@ public void BindAction(int portalId, int tabId, int moduleId) public void SaveAction(int portalId, int tabId, int moduleId) { - foreach (var control in Controls) + foreach (var control in this.Controls) { var actionsControl = control as IUserControlActions; if (actionsControl != null) @@ -65,7 +65,7 @@ public void SaveAction(int portalId, int tabId, int moduleId) public void CancelAction(int portalId, int tabId, int moduleId) { - foreach (var control in Controls) + foreach (var control in this.Controls) { var actionsControl = control as IUserControlActions; if (actionsControl != null) diff --git a/DNN Platform/Library/Framework/BaseHttpHandler.cs b/DNN Platform/Library/Framework/BaseHttpHandler.cs index 24fdf49b49f..5064b15d44b 100644 --- a/DNN Platform/Library/Framework/BaseHttpHandler.cs +++ b/DNN Platform/Library/Framework/BaseHttpHandler.cs @@ -25,7 +25,7 @@ public HttpContext Context { get { - return _context; + return this._context; } } @@ -36,7 +36,7 @@ public HttpRequest Request { get { - return Context.Request; + return this.Context.Request; } } @@ -48,7 +48,7 @@ public HttpResponse Response { get { - return Context.Response; + return this.Context.Response; } } @@ -59,8 +59,8 @@ public string Content { get { - Request.InputStream.Position = 0; - using (var Reader = new StreamReader(Request.InputStream)) + this.Request.InputStream.Position = 0; + using (var Reader = new StreamReader(this.Request.InputStream)) { return Reader.ReadToEnd(); } @@ -99,7 +99,7 @@ public virtual bool HasPermission { get { - return Context.User.Identity.IsAuthenticated; + return this.Context.User.Identity.IsAuthenticated; } } @@ -135,26 +135,26 @@ public virtual Encoding ContentEncoding /// Context. public void ProcessRequest(HttpContext context) { - _context = context; + this._context = context; - SetResponseCachePolicy(Response.Cache); + this.SetResponseCachePolicy(this.Response.Cache); - if (!ValidateParameters()) + if (!this.ValidateParameters()) { - RespondInternalError(); + this.RespondInternalError(); return; } - if (RequiresAuthentication && !HasPermission) + if (this.RequiresAuthentication && !this.HasPermission) { - RespondForbidden(); + this.RespondForbidden(); return; } - Response.ContentType = ContentMimeType; - Response.ContentEncoding = ContentEncoding; + this.Response.ContentType = this.ContentMimeType; + this.Response.ContentEncoding = this.ContentEncoding; - HandleRequest(); + this.HandleRequest(); } public virtual bool IsReusable @@ -223,8 +223,8 @@ public virtual void SetResponseCachePolicy(HttpCachePolicy cache) ///

    protected void RespondFileNotFound() { - Response.StatusCode = Convert.ToInt32(HttpStatusCode.NotFound); - Response.End(); + this.Response.StatusCode = Convert.ToInt32(HttpStatusCode.NotFound); + this.Response.End(); } /// @@ -235,8 +235,8 @@ protected void RespondInternalError() { // It's really too bad that StatusCode property // is not of type HttpStatusCode. - Response.StatusCode = Convert.ToInt32(HttpStatusCode.InternalServerError); - Response.End(); + this.Response.StatusCode = Convert.ToInt32(HttpStatusCode.InternalServerError); + this.Response.End(); } /// @@ -246,8 +246,8 @@ protected void RespondInternalError() /// protected void RespondForbidden() { - Response.StatusCode = Convert.ToInt32(HttpStatusCode.Forbidden); - Response.End(); + this.Response.StatusCode = Convert.ToInt32(HttpStatusCode.Forbidden); + this.Response.End(); } } } diff --git a/DNN Platform/Library/Framework/CDefault.cs b/DNN Platform/Library/Framework/CDefault.cs index 2c0b2b0503f..2d52a1ffb6d 100644 --- a/DNN Platform/Library/Framework/CDefault.cs +++ b/DNN Platform/Library/Framework/CDefault.cs @@ -38,11 +38,11 @@ public class CDefault : PageBase protected override void RegisterAjaxScript() { - if (Page.Form != null) + if (this.Page.Form != null) { if (ServicesFrameworkInternal.Instance.IsAjaxScriptSupportRequired) { - ServicesFrameworkInternal.Instance.RegisterAjaxScript(Page); + ServicesFrameworkInternal.Instance.RegisterAjaxScript(this.Page); } } } @@ -59,7 +59,7 @@ public void ScrollToControl(Control objControl) { JavaScript.RegisterClientReference(this, ClientAPI.ClientNamespaceReferences.dnn_dom_positioning); ClientAPI.RegisterClientVariable(this, "ScrollToControl", objControl.ClientID, true); - DNNClientAPI.SetScrollTop(Page); + DNNClientAPI.SetScrollTop(this.Page); } } @@ -83,13 +83,13 @@ protected string AdvancedSettingsPageUrl get { string result ; - var tab = TabController.Instance.GetTabByName("Advanced Settings", PortalSettings.PortalId); + var tab = TabController.Instance.GetTabByName("Advanced Settings", this.PortalSettings.PortalId); var modules = ModuleController.Instance.GetTabModules(tab.TabID).Values; if (modules.Count > 0) { var pmb = new PortalModuleBase(); - result = pmb.EditUrl(tab.TabID, "", false, string.Concat("mid=", modules.ElementAt(0).ModuleID), "popUp=true", string.Concat("ReturnUrl=", Server.UrlEncode(TestableGlobals.Instance.NavigateURL()))); + result = pmb.EditUrl(tab.TabID, "", false, string.Concat("mid=", modules.ElementAt(0).ModuleID), "popUp=true", string.Concat("ReturnUrl=", this.Server.UrlEncode(TestableGlobals.Instance.NavigateURL()))); } else { diff --git a/DNN Platform/Library/Framework/CachePageStatePersister.cs b/DNN Platform/Library/Framework/CachePageStatePersister.cs index 19695b8c8e9..0e97ebf0c08 100644 --- a/DNN Platform/Library/Framework/CachePageStatePersister.cs +++ b/DNN Platform/Library/Framework/CachePageStatePersister.cs @@ -46,7 +46,7 @@ public CachePageStatePersister(Page page) : base(page) public override void Load() { //Get the cache key from the web form data - string key = Page.Request.Params[VIEW_STATE_CACHEKEY]; + string key = this.Page.Request.Params[VIEW_STATE_CACHEKEY]; //Abort if cache key is not available or valid if (string.IsNullOrEmpty(key) || !key.StartsWith("VS_")) @@ -57,11 +57,11 @@ public override void Load() if (state != null) { //Set view state and control state - ViewState = state.First; - ControlState = state.Second; + this.ViewState = state.First; + this.ControlState = state.Second; } //Remove this ViewState from the cache as it has served its purpose - if (!Page.IsCallback) + if (!this.Page.IsCallback) { DataCache.RemoveCache(key); } @@ -75,7 +75,7 @@ public override void Load() public override void Save() { //No processing needed if no states available - if (ViewState == null && ControlState == null) + if (this.ViewState == null && this.ControlState == null) { return; } @@ -84,20 +84,20 @@ public override void Save() var key = new StringBuilder(); { key.Append("VS_"); - key.Append(Page.Session == null ? Guid.NewGuid().ToString() : Page.Session.SessionID); + key.Append(this.Page.Session == null ? Guid.NewGuid().ToString() : this.Page.Session.SessionID); key.Append("_"); key.Append(DateTime.Now.Ticks.ToString()); } //Save view state and control state separately - var state = new Pair(ViewState, ControlState); + var state = new Pair(this.ViewState, this.ControlState); //Add view state and control state to cache DNNCacheDependency objDependency = null; - DataCache.SetCache(key.ToString(), state, objDependency, DateTime.Now.AddMinutes(Page.Session.Timeout), Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, null); + DataCache.SetCache(key.ToString(), state, objDependency, DateTime.Now.AddMinutes(this.Page.Session.Timeout), Cache.NoSlidingExpiration, CacheItemPriority.NotRemovable, null); //Register hidden field to store cache key in - Page.ClientScript.RegisterHiddenField(VIEW_STATE_CACHEKEY, key.ToString()); + this.Page.ClientScript.RegisterHiddenField(VIEW_STATE_CACHEKEY, key.ToString()); } } } diff --git a/DNN Platform/Library/Framework/DiskPageStatePersister.cs b/DNN Platform/Library/Framework/DiskPageStatePersister.cs index f6b597e4688..3033c41ecc3 100644 --- a/DNN Platform/Library/Framework/DiskPageStatePersister.cs +++ b/DNN Platform/Library/Framework/DiskPageStatePersister.cs @@ -65,11 +65,11 @@ public string StateFileName var key = new StringBuilder(); { key.Append("VIEWSTATE_"); - key.Append(Page.Session.SessionID); + key.Append(this.Page.Session.SessionID); key.Append("_"); - key.Append(Page.Request.RawUrl); + key.Append(this.Page.Request.RawUrl); } - return CacheDirectory + "\\" + Globals.CleanFileName(key.ToString()) + ".txt"; + return this.CacheDirectory + "\\" + Globals.CleanFileName(key.ToString()) + ".txt"; } } @@ -84,17 +84,17 @@ public override void Load() //Read the state string, using the StateFormatter. try { - reader = new StreamReader(StateFileName); + reader = new StreamReader(this.StateFileName); string serializedStatePair = reader.ReadToEnd(); - IStateFormatter formatter = StateFormatter; + IStateFormatter formatter = this.StateFormatter; //Deserialize returns the Pair object that is serialized in //the Save method. var statePair = (Pair) formatter.Deserialize(serializedStatePair); - ViewState = statePair.First; - ControlState = statePair.Second; + this.ViewState = statePair.First; + this.ControlState = statePair.Second; } finally { @@ -113,22 +113,22 @@ public override void Load() public override void Save() { //No processing needed if no states available - if (ViewState == null && ControlState == null) + if (this.ViewState == null && this.ControlState == null) { return; } - if (Page.Session != null) + if (this.Page.Session != null) { - if (!Directory.Exists(CacheDirectory)) + if (!Directory.Exists(this.CacheDirectory)) { - Directory.CreateDirectory(CacheDirectory); + Directory.CreateDirectory(this.CacheDirectory); } //Write a state string, using the StateFormatter. - using (var writer = new StreamWriter(StateFileName, false)) + using (var writer = new StreamWriter(this.StateFileName, false)) { - IStateFormatter formatter = StateFormatter; - var statePair = new Pair(ViewState, ControlState); + IStateFormatter formatter = this.StateFormatter; + var statePair = new Pair(this.ViewState, this.ControlState); string serializedState = formatter.Serialize(statePair); writer.Write(serializedState); writer.Close(); diff --git a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibrary.cs b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibrary.cs index 2f844fb0f10..4c6534f15af 100644 --- a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibrary.cs +++ b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibrary.cs @@ -78,31 +78,31 @@ public void ReadXml(XmlReader reader) case "javaScriptLibrary": break; case "libraryName": - LibraryName = reader.ReadElementContentAsString(); + this.LibraryName = reader.ReadElementContentAsString(); break; case "objectName": - ObjectName = reader.ReadElementContentAsString(); + this.ObjectName = reader.ReadElementContentAsString(); break; case "fileName": - FileName = reader.ReadElementContentAsString(); + this.FileName = reader.ReadElementContentAsString(); break; case "preferredScriptLocation": var location = reader.ReadElementContentAsString(); switch (location) { case "BodyTop": - PreferredScriptLocation = ScriptLocation.BodyTop; + this.PreferredScriptLocation = ScriptLocation.BodyTop; break; case "BodyBottom": - PreferredScriptLocation = ScriptLocation.BodyBottom; + this.PreferredScriptLocation = ScriptLocation.BodyBottom; break; default: - PreferredScriptLocation = ScriptLocation.PageHead; + this.PreferredScriptLocation = ScriptLocation.PageHead; break; } break; case "CDNPath": - CDNPath = reader.ReadElementContentAsString(); + this.CDNPath = reader.ReadElementContentAsString(); break; default: if(reader.NodeType == XmlNodeType.Element && !String.IsNullOrEmpty(reader.Name)) @@ -127,11 +127,11 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("javaScriptLibrary"); //write out properties - writer.WriteElementString("libraryName", LibraryName); - writer.WriteElementString("fileName", FileName); - writer.WriteElementString("objectName", ObjectName); - writer.WriteElementString("preferredScriptLocation", PreferredScriptLocation.ToString()); - writer.WriteElementString("CDNPath", CDNPath); + writer.WriteElementString("libraryName", this.LibraryName); + writer.WriteElementString("fileName", this.FileName); + writer.WriteElementString("objectName", this.ObjectName); + writer.WriteElementString("preferredScriptLocation", this.PreferredScriptLocation.ToString()); + writer.WriteElementString("CDNPath", this.CDNPath); //Write end of main element writer.WriteEndElement(); diff --git a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibraryController.cs b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibraryController.cs index f1f0e90ef9c..5dba629de31 100644 --- a/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibraryController.cs +++ b/DNN Platform/Library/Framework/JavaScriptLibraries/JavaScriptLibraryController.cs @@ -32,7 +32,7 @@ protected override Func GetFactory() public void DeleteLibrary(JavaScriptLibrary library) { DataProvider.Instance().ExecuteNonQuery("DeleteJavaScriptLibrary", library.JavaScriptLibraryID); - ClearCache(); + this.ClearCache(); } /// Get information about the latest version of a that matches the given @@ -43,7 +43,7 @@ public void DeleteLibrary(JavaScriptLibrary library) /// The highest version instance that matches the , or null if no library matches public JavaScriptLibrary GetLibrary(Func predicate) { - return GetLibraries(predicate).OrderByDescending(l => l.Version).FirstOrDefault(); + return this.GetLibraries(predicate).OrderByDescending(l => l.Version).FirstOrDefault(); } /// Gets all of the instances matching the given @@ -54,7 +54,7 @@ public JavaScriptLibrary GetLibrary(Func predicate) /// A sequence of instances public IEnumerable GetLibraries(Func predicate) { - return GetLibraries().Where(predicate); + return this.GetLibraries().Where(predicate); } /// Gets all of the instances @@ -80,7 +80,7 @@ public void SaveLibrary(JavaScriptLibrary library) library.ObjectName, library.PreferredScriptLocation, library.CDNPath); - ClearCache(); + this.ClearCache(); } #endregion diff --git a/DNN Platform/Library/Framework/PageBase.cs b/DNN Platform/Library/Framework/PageBase.cs index fa2d8df0d9d..9af2f1a7f41 100644 --- a/DNN Platform/Library/Framework/PageBase.cs +++ b/DNN Platform/Library/Framework/PageBase.cs @@ -68,7 +68,7 @@ public abstract class PageBase : Page /// ----------------------------------------------------------------------------- protected PageBase() { - _localizedControls = new ArrayList(); + this._localizedControls = new ArrayList(); } #endregion @@ -86,25 +86,25 @@ protected override PageStatePersister PageStatePersister get { //Set ViewState Persister to default (as defined in Base Class) - if (_persister == null) + if (this._persister == null) { - _persister = base.PageStatePersister; + this._persister = base.PageStatePersister; if (Globals.Status == Globals.UpgradeStatus.None) { switch (Host.PageStatePersister) { case "M": - _persister = new CachePageStatePersister(this); + this._persister = new CachePageStatePersister(this); break; case "D": - _persister = new DiskPageStatePersister(this); + this._persister = new DiskPageStatePersister(this); break; } } } - return _persister; + return this._persister; } } @@ -124,7 +124,7 @@ public NameValueCollection HtmlAttributes { get { - return _htmlAttributes; + return this._htmlAttributes; } } @@ -132,7 +132,7 @@ public CultureInfo PageCulture { get { - return _pageCulture ?? (_pageCulture = Localization.GetPageLocale(PortalSettings)); + return this._pageCulture ?? (this._pageCulture = Localization.GetPageLocale(this.PortalSettings)); } } @@ -141,20 +141,20 @@ public string LocalResourceFile get { string fileRoot; - var page = Request.ServerVariables["SCRIPT_NAME"].Split('/'); - if (String.IsNullOrEmpty(_localResourceFile)) + var page = this.Request.ServerVariables["SCRIPT_NAME"].Split('/'); + if (String.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = string.Concat(TemplateSourceDirectory, "/", Localization.LocalResourceDirectory, "/", page[page.GetUpperBound(0)], ".resx"); + fileRoot = string.Concat(this.TemplateSourceDirectory, "/", Localization.LocalResourceDirectory, "/", page[page.GetUpperBound(0)], ".resx"); } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -171,7 +171,7 @@ public string LocalResourceFile private string GetErrorUrl(string url, Exception exc, bool hideContent = true) { - if (Request.QueryString["error"] != null) + if (this.Request.QueryString["error"] != null) { url += string.Concat((url.IndexOf("?", StringComparison.Ordinal) == -1 ? "?" : "&"), "error=terminate"); } @@ -180,7 +180,7 @@ private string GetErrorUrl(string url, Exception exc, bool hideContent = true) url += string.Concat( (url.IndexOf("?", StringComparison.Ordinal) == -1 ? "?" : "&"), "error=", - (exc == null || UserController.Instance.GetCurrentUserInfo() == null || !UserController.Instance.GetCurrentUserInfo().IsSuperUser ? "An unexpected error has occurred" : Server.UrlEncode(exc.Message)) + (exc == null || UserController.Instance.GetCurrentUserInfo() == null || !UserController.Instance.GetCurrentUserInfo().IsSuperUser ? "An unexpected error has occurred" : this.Server.UrlEncode(exc.Message)) ); if (!Globals.IsAdminControl() && hideContent) { @@ -193,27 +193,27 @@ private string GetErrorUrl(string url, Exception exc, bool hideContent = true) private bool IsViewStateFailure(Exception e) { - return !User.Identity.IsAuthenticated && e != null && e.InnerException is ViewStateException; + return !this.User.Identity.IsAuthenticated && e != null && e.InnerException is ViewStateException; } private void IterateControls(ControlCollection controls, ArrayList affectedControls, string resourceFileRoot) { foreach (Control c in controls) { - ProcessControl(c, affectedControls, true, resourceFileRoot); - LogDnnTrace("PageBase.IterateControls","Info", $"ControlId: {c.ID}"); + this.ProcessControl(c, affectedControls, true, resourceFileRoot); + this.LogDnnTrace("PageBase.IterateControls","Info", $"ControlId: {c.ID}"); } } private void LogDnnTrace(string origin, string action, string message) { var tabId = -1; - if (PortalSettings?.ActiveTab != null) + if (this.PortalSettings?.ActiveTab != null) { - tabId = PortalSettings.ActiveTab.TabID; + tabId = this.PortalSettings.ActiveTab.TabID; } - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"{origin} {action} (TabId:{tabId},{message})"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"{origin} {action} (TabId:{tabId},{message})"); } #endregion @@ -224,18 +224,18 @@ protected virtual void RegisterAjaxScript() { if (ServicesFrameworkInternal.Instance.IsAjaxScriptSupportRequired) { - ServicesFrameworkInternal.Instance.RegisterAjaxScript(Page); + ServicesFrameworkInternal.Instance.RegisterAjaxScript(this.Page); } } protected override void OnError(EventArgs e) { base.OnError(e); - Exception exc = Server.GetLastError(); + Exception exc = this.Server.GetLastError(); Logger.Fatal("An error has occurred while loading page.", exc); string strURL = Globals.ApplicationURL(); - if (exc is HttpException && !IsViewStateFailure(exc)) + if (exc is HttpException && !this.IsViewStateFailure(exc)) { try { @@ -243,12 +243,12 @@ protected override void OnError(EventArgs e) var statusCode = (exc as HttpException).GetHttpCode(); if (statusCode == 404) { - UrlUtils.Handle404Exception(Response, PortalSettings); + UrlUtils.Handle404Exception(this.Response, this.PortalSettings); } - if (PortalSettings?.ErrorPage500 != -1) + if (this.PortalSettings?.ErrorPage500 != -1) { - var url = GetErrorUrl(string.Concat("~/Default.aspx?tabid=", PortalSettings.ErrorPage500), exc, + var url = this.GetErrorUrl(string.Concat("~/Default.aspx?tabid=", this.PortalSettings.ErrorPage500), exc, false); HttpContext.Current.Response.Redirect(url); } @@ -266,7 +266,7 @@ protected override void OnError(EventArgs e) } } - strURL = GetErrorUrl(strURL, exc); + strURL = this.GetErrorUrl(strURL, exc); Exceptions.ProcessPageLoadException(exc, strURL); } @@ -275,7 +275,7 @@ protected override void OnInit(EventArgs e) var isInstallPage = HttpContext.Current.Request.Url.LocalPath.ToLowerInvariant().Contains("installwizard.aspx"); if (!isInstallPage) { - Localization.SetThreadCultures(PageCulture, PortalSettings); + Localization.SetThreadCultures(this.PageCulture, this.PortalSettings); } if (ScriptManager.GetCurrent(this) == null) @@ -319,22 +319,22 @@ protected override void OnPreRender(EventArgs e) if (ServicesFrameworkInternal.Instance.IsAjaxAntiForgerySupportRequired) { - ServicesFrameworkInternal.Instance.RegisterAjaxAntiForgery(Page); + ServicesFrameworkInternal.Instance.RegisterAjaxAntiForgery(this.Page); } - RegisterAjaxScript(); + this.RegisterAjaxScript(); } protected override void Render(HtmlTextWriter writer) { - LogDnnTrace("PageBase.Render", "Start", $"{Page.Request.Url.AbsoluteUri}"); + this.LogDnnTrace("PageBase.Render", "Start", $"{this.Page.Request.Url.AbsoluteUri}"); - IterateControls(Controls, _localizedControls, LocalResourceFile); - RemoveKeyAttribute(_localizedControls); + this.IterateControls(this.Controls, this._localizedControls, this.LocalResourceFile); + RemoveKeyAttribute(this._localizedControls); AJAX.RemoveScriptManager(this); base.Render(writer); - LogDnnTrace("PageBase.Render", "End", $"{Page.Request.Url.AbsoluteUri}"); + this.LogDnnTrace("PageBase.Render", "End", $"{this.Page.Request.Url.AbsoluteUri}"); } @@ -424,7 +424,7 @@ private void LocalizeControl(Control control, string value) { if ((match.Groups[match.Groups.Count - 2].Value.IndexOf("~", StringComparison.Ordinal) == -1)) continue; - var resolvedUrl = Page.ResolveUrl(match.Groups[match.Groups.Count - 2].Value); + var resolvedUrl = this.Page.ResolveUrl(match.Groups[match.Groups.Count - 2].Value); value = value.Replace(match.Groups[match.Groups.Count - 2].Value, resolvedUrl); } linkButton.Text = value; @@ -502,7 +502,7 @@ internal void ProcessControl(Control control, ArrayList affectedControls, bool i { //Translation starts here .... var value = Localization.GetString(key, resourceFileRoot); - LocalizeControl(control, value); + this.LocalizeControl(control, value); } //Translate listcontrol items here @@ -536,7 +536,7 @@ internal void ProcessControl(Control control, ArrayList affectedControls, bool i { if (image.ImageUrl.IndexOf("~", StringComparison.Ordinal) != -1) { - image.ImageUrl = Page.ResolveUrl(image.ImageUrl); + image.ImageUrl = this.Page.ResolveUrl(image.ImageUrl); } //Check for IconKey @@ -556,7 +556,7 @@ internal void ProcessControl(Control control, ArrayList affectedControls, bool i { if (htmlImage.Src.IndexOf("~", StringComparison.Ordinal) != -1) { - htmlImage.Src = Page.ResolveUrl(htmlImage.Src); + htmlImage.Src = this.Page.ResolveUrl(htmlImage.Src); } //Check for IconKey @@ -576,11 +576,11 @@ internal void ProcessControl(Control control, ArrayList affectedControls, bool i { if ((ctrl.NavigateUrl.IndexOf("~", StringComparison.Ordinal) != -1)) { - ctrl.NavigateUrl = Page.ResolveUrl(ctrl.NavigateUrl); + ctrl.NavigateUrl = this.Page.ResolveUrl(ctrl.NavigateUrl); } if ((ctrl.ImageUrl.IndexOf("~", StringComparison.Ordinal) != -1)) { - ctrl.ImageUrl = Page.ResolveUrl(ctrl.ImageUrl); + ctrl.ImageUrl = this.Page.ResolveUrl(ctrl.ImageUrl); } //Check for IconKey @@ -606,18 +606,18 @@ internal void ProcessControl(Control control, ArrayList affectedControls, bool i var pv = pi.GetValue(control, null); //If controls has a LocalResourceFile property use this, otherwise pass the resource file root - IterateControls(control.Controls, affectedControls, pv == null ? resourceFileRoot : pv.ToString()); + this.IterateControls(control.Controls, affectedControls, pv == null ? resourceFileRoot : pv.ToString()); } else { //Pass Resource File Root through - IterateControls(control.Controls, affectedControls, resourceFileRoot); + this.IterateControls(control.Controls, affectedControls, resourceFileRoot); } } else { //Get Resource File Root from Controls LocalResourceFile Property - IterateControls(control.Controls, affectedControls, objModuleControl.LocalResourceFile); + this.IterateControls(control.Controls, affectedControls, objModuleControl.LocalResourceFile); } } diff --git a/DNN Platform/Library/Framework/Providers/Provider.cs b/DNN Platform/Library/Framework/Providers/Provider.cs index 7f46cda3d3d..fdd1c26a56a 100644 --- a/DNN Platform/Library/Framework/Providers/Provider.cs +++ b/DNN Platform/Library/Framework/Providers/Provider.cs @@ -20,17 +20,17 @@ public class Provider public Provider(XmlAttributeCollection Attributes) { //Set the name of the provider - _ProviderName = Attributes["name"].Value; + this._ProviderName = Attributes["name"].Value; //Set the type of the provider - _ProviderType = Attributes["type"].Value; + this._ProviderType = Attributes["type"].Value; //Store all the attributes in the attributes bucket foreach (XmlAttribute Attribute in Attributes) { if (Attribute.Name != "name" && Attribute.Name != "type") { - _ProviderAttributes.Add(Attribute.Name, Attribute.Value); + this._ProviderAttributes.Add(Attribute.Name, Attribute.Value); } } } @@ -39,7 +39,7 @@ public string Name { get { - return _ProviderName; + return this._ProviderName; } } @@ -47,7 +47,7 @@ public string Type { get { - return _ProviderType; + return this._ProviderType; } } @@ -55,7 +55,7 @@ public NameValueCollection Attributes { get { - return _ProviderAttributes; + return this._ProviderAttributes; } } } diff --git a/DNN Platform/Library/Framework/Providers/ProviderConfiguration.cs b/DNN Platform/Library/Framework/Providers/ProviderConfiguration.cs index 850cdb61af7..6c813ae9b3c 100644 --- a/DNN Platform/Library/Framework/Providers/ProviderConfiguration.cs +++ b/DNN Platform/Library/Framework/Providers/ProviderConfiguration.cs @@ -22,7 +22,7 @@ public string DefaultProvider { get { - return _DefaultProvider; + return this._DefaultProvider; } } @@ -30,7 +30,7 @@ public Hashtable Providers { get { - return _Providers; + return this._Providers; } } @@ -44,14 +44,14 @@ internal void LoadValuesFromConfigurationXml(XmlNode node) XmlAttributeCollection attributeCollection = node.Attributes; //Get the default provider - _DefaultProvider = attributeCollection["defaultProvider"].Value; + this._DefaultProvider = attributeCollection["defaultProvider"].Value; //Read child nodes foreach (XmlNode child in node.ChildNodes) { if (child.Name == "providers") { - GetProviders(child); + this.GetProviders(child); } } } @@ -63,13 +63,13 @@ internal void GetProviders(XmlNode node) switch (Provider.Name) { case "add": - Providers.Add(Provider.Attributes["name"].Value, new Provider(Provider.Attributes)); + this.Providers.Add(Provider.Attributes["name"].Value, new Provider(Provider.Attributes)); break; case "remove": - Providers.Remove(Provider.Attributes["name"].Value); + this.Providers.Remove(Provider.Attributes["name"].Value); break; case "clear": - Providers.Clear(); + this.Providers.Clear(); break; } } diff --git a/DNN Platform/Library/Framework/Reflections/AssemblyWrapper.cs b/DNN Platform/Library/Framework/Reflections/AssemblyWrapper.cs index be906dfe15b..f026d61cd26 100644 --- a/DNN Platform/Library/Framework/Reflections/AssemblyWrapper.cs +++ b/DNN Platform/Library/Framework/Reflections/AssemblyWrapper.cs @@ -15,12 +15,12 @@ public class AssemblyWrapper : IAssembly public AssemblyWrapper(Assembly assembly) { - _assembly = assembly; + this._assembly = assembly; } public Type[] GetTypes() { - return _assembly.GetTypes(); + return this._assembly.GetTypes(); } } } diff --git a/DNN Platform/Library/Framework/Reflections/TypeLocator.cs b/DNN Platform/Library/Framework/Reflections/TypeLocator.cs index 9e67a05140b..8ef02cbebae 100644 --- a/DNN Platform/Library/Framework/Reflections/TypeLocator.cs +++ b/DNN Platform/Library/Framework/Reflections/TypeLocator.cs @@ -19,13 +19,13 @@ public class TypeLocator : ITypeLocator, IAssemblyLocator internal IAssemblyLocator AssemblyLocator { - get { return _assemblyLocator ?? (_assemblyLocator = this); } - set { _assemblyLocator = value; } + get { return this._assemblyLocator ?? (this._assemblyLocator = this); } + set { this._assemblyLocator = value; } } public IEnumerable GetAllMatchingTypes(Predicate predicate) { - foreach (var assembly in AssemblyLocator.Assemblies) + foreach (var assembly in this.AssemblyLocator.Assemblies) { Type[] types; try @@ -116,7 +116,7 @@ IEnumerable IAssemblyLocator.Assemblies get { return (from assembly in AppDomain.CurrentDomain.GetAssemblies() - where CanScan(assembly) + where this.CanScan(assembly) select new AssemblyWrapper(assembly)); } } diff --git a/DNN Platform/Library/Framework/ServicesFrameworkImpl.cs b/DNN Platform/Library/Framework/ServicesFrameworkImpl.cs index 84f160aae30..69d4bab2f4f 100644 --- a/DNN Platform/Library/Framework/ServicesFrameworkImpl.cs +++ b/DNN Platform/Library/Framework/ServicesFrameworkImpl.cs @@ -21,7 +21,7 @@ internal class ServicesFrameworkImpl : IServicesFramework, IServiceFrameworkInte public void RequestAjaxAntiForgerySupport() { - RequestAjaxScriptSupport(); + this.RequestAjaxScriptSupport(); SetKey(AntiForgeryKey); } diff --git a/DNN Platform/Library/Framework/UserControlBase.cs b/DNN Platform/Library/Framework/UserControlBase.cs index 5942cbe32ff..fca766de230 100644 --- a/DNN Platform/Library/Framework/UserControlBase.cs +++ b/DNN Platform/Library/Framework/UserControlBase.cs @@ -27,7 +27,7 @@ public bool IsHostMenu { get { - return Globals.IsHostTab(PortalSettings.ActiveTab.TabID); + return Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID); } } diff --git a/DNN Platform/Library/Modules/NavigationProvider.cs b/DNN Platform/Library/Modules/NavigationProvider.cs index db151b8d463..7e6cb34dc87 100644 --- a/DNN Platform/Library/Modules/NavigationProvider.cs +++ b/DNN Platform/Library/Modules/NavigationProvider.cs @@ -946,33 +946,33 @@ public virtual void ClearNodes() protected void RaiseEvent_NodeClick(DNNNode objNode) { - if (NodeClick != null) + if (this.NodeClick != null) { - NodeClick(new NavigationEventArgs(objNode.ID, objNode)); + this.NodeClick(new NavigationEventArgs(objNode.ID, objNode)); } } protected void RaiseEvent_NodeClick(string strID) { - if (NodeClick != null) + if (this.NodeClick != null) { - NodeClick(new NavigationEventArgs(strID, null)); + this.NodeClick(new NavigationEventArgs(strID, null)); } } protected void RaiseEvent_PopulateOnDemand(DNNNode objNode) { - if (PopulateOnDemand != null) + if (this.PopulateOnDemand != null) { - PopulateOnDemand(new NavigationEventArgs(objNode.ID, objNode)); + this.PopulateOnDemand(new NavigationEventArgs(objNode.ID, objNode)); } } protected void RaiseEvent_PopulateOnDemand(string strID) { - if (PopulateOnDemand != null) + if (this.PopulateOnDemand != null) { - PopulateOnDemand(new NavigationEventArgs(strID, null)); + this.PopulateOnDemand(new NavigationEventArgs(strID, null)); } } @@ -986,8 +986,8 @@ public class NavigationEventArgs public NavigationEventArgs(string strID, DNNNode objNode) { - ID = strID; - Node = objNode; + this.ID = strID; + this.Node = objNode; } } } diff --git a/DNN Platform/Library/Obsolete/ModuleController.cs b/DNN Platform/Library/Obsolete/ModuleController.cs index e9f5923a502..3f7855588e8 100644 --- a/DNN Platform/Library/Obsolete/ModuleController.cs +++ b/DNN Platform/Library/Obsolete/ModuleController.cs @@ -49,14 +49,14 @@ public partial class ModuleController [Obsolete("Deprecated in DotNetNuke 7.3. No longer neccessary. Scheduled removal in v10.0.0.")] public void CopyTabModuleSettings(ModuleInfo fromModule, ModuleInfo toModule) { - CopyTabModuleSettingsInternal(fromModule, toModule); + this.CopyTabModuleSettingsInternal(fromModule, toModule); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DNN 7.3. Use an alternate overload. Scheduled removal in v10.0.0.")] public void DeleteAllModules(int moduleId, int tabId, List fromTabs) { - DeleteAllModules(moduleId, tabId, fromTabs, true, false, false); + this.DeleteAllModules(moduleId, tabId, fromTabs, true, false, false); } [EditorBrowsable(EditorBrowsableState.Never)] @@ -67,7 +67,7 @@ public void DeleteModuleSettings(int moduleId) var log = new LogInfo {LogTypeKey = EventLogController.EventLogType.MODULE_SETTING_DELETED.ToString()}; log.LogProperties.Add(new LogDetailInfo("ModuleId", moduleId.ToString())); LogController.Instance.AddLog(log); - UpdateTabModuleVersionsByModuleID(moduleId); + this.UpdateTabModuleVersionsByModuleID(moduleId); ClearModuleSettingsCache(moduleId); } @@ -122,14 +122,14 @@ public Hashtable GetModuleSettings(int ModuleId) [Obsolete("Deprecated in DNN 7.3. Replaced by GetTabModulesByModule(moduleID). Scheduled removal in v10.0.0.")] public ArrayList GetModuleTabs(int moduleID) { - return new ArrayList(GetTabModulesByModule(moduleID).ToArray()); + return new ArrayList(this.GetTabModulesByModule(moduleID).ToArray()); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DNN 7.3. Replaced by GetModules(portalId). Scheduled removal in v10.0.0.")] public ArrayList GetRecycleModules(int portalID) { - return GetModules(portalID); + return this.GetModules(portalID); } [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/DNN Platform/Library/Obsolete/PortalController.cs b/DNN Platform/Library/Obsolete/PortalController.cs index 0202028212a..2d84cfaadfb 100644 --- a/DNN Platform/Library/Obsolete/PortalController.cs +++ b/DNN Platform/Library/Obsolete/PortalController.cs @@ -54,7 +54,7 @@ public int CreatePortal(string portalName, string firstName, string lastName, st adminUser.Membership.Approved = true; adminUser.Profile.FirstName = firstName; adminUser.Profile.LastName = lastName; - return CreatePortal(portalName, adminUser, description, keyWords, templatePath, templateFile, homeDirectory, portalAlias, serverPath, childPath, isChildPortal); + return this.CreatePortal(portalName, adminUser, description, keyWords, templatePath, templateFile, homeDirectory, portalAlias, serverPath, childPath, isChildPortal); } [EditorBrowsable(EditorBrowsableState.Never)] @@ -63,9 +63,9 @@ public int CreatePortal(string portalName, UserInfo adminUser, string descriptio string templateFile, string homeDirectory, string portalAlias, string serverPath, string childPath, bool isChildPortal) { - var template = GetPortalTemplate(Path.Combine(templatePath, templateFile), null); + var template = this.GetPortalTemplate(Path.Combine(templatePath, templateFile), null); - return CreatePortal(portalName, adminUser, description, keyWords, template, homeDirectory, portalAlias, + return this.CreatePortal(portalName, adminUser, description, keyWords, template, homeDirectory, portalAlias, serverPath, childPath, isChildPortal); } @@ -101,28 +101,28 @@ public static Dictionary GetPortalSettingsDictionary(int portalI [Obsolete("Deprecated in DotNetNuke 7.3.0. Use one of the alternate overloads. Scheduled removal in v10.0.0.")] public void ParseTemplate(int portalId, string templatePath, string templateFile, int administratorId, PortalTemplateModuleAction mergeTabs, bool isNewPortal) { - ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal); + this.ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DotNetNuke 7.3.0. Use one of the other overloads. Scheduled removal in v10.0.0.")] public void ParseTemplate(int portalId, string templatePath, string templateFile, int administratorId, PortalTemplateModuleAction mergeTabs, bool isNewPortal, out LocaleCollection localeCollection) { - ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal, out localeCollection); + this.ParseTemplateInternal(portalId, templatePath, templateFile, administratorId, mergeTabs, isNewPortal, out localeCollection); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DotNetNuke 7.3. Replaced by UpdatePortalExpiry(int, string). Scheduled removal in v10.0.0.")] public void UpdatePortalExpiry(int portalId) { - UpdatePortalExpiry(portalId, GetActivePortalLanguage(portalId)); + this.UpdatePortalExpiry(portalId, GetActivePortalLanguage(portalId)); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DotNetNuke 7.3.0. Use one of the alternate overloads. Scheduled removal in v10.0.0.")] public void UpdatePortalInfo(PortalInfo portal, bool clearCache) { - UpdatePortalInternal(portal, clearCache); + this.UpdatePortalInternal(portal, clearCache); } } } diff --git a/DNN Platform/Library/Obsolete/RoleController.cs b/DNN Platform/Library/Obsolete/RoleController.cs index 17e393c6423..e8021bd1c35 100644 --- a/DNN Platform/Library/Obsolete/RoleController.cs +++ b/DNN Platform/Library/Obsolete/RoleController.cs @@ -32,22 +32,22 @@ public static void AddUserRole(UserInfo user, RoleInfo role, PortalSettings port [Obsolete("Deprecated in DotNetNuke 7.3. This function has been replaced by overload with extra parameters. Scheduled removal in v10.0.0.")] public void AddUserRole(int portalId, int userId, int roleId, DateTime expiryDate) { - AddUserRole(portalId, userId, roleId, RoleStatus.Approved, false, Null.NullDate, expiryDate); + this.AddUserRole(portalId, userId, roleId, RoleStatus.Approved, false, Null.NullDate, expiryDate); } public void AddUserRole(int portalId, int userId, int roleId, DateTime effectiveDate, DateTime expiryDate) { - AddUserRole(portalId, userId, roleId, RoleStatus.Approved, false, effectiveDate, expiryDate); + this.AddUserRole(portalId, userId, roleId, RoleStatus.Approved, false, effectiveDate, expiryDate); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DotNetNuke 7.3. This function has been replaced by DeleteRole(role). Scheduled removal in v10.0.0.")] public void DeleteRole(int roleId, int portalId) { - RoleInfo role = GetRole(portalId, r => r.RoleID == roleId); + RoleInfo role = this.GetRole(portalId, r => r.RoleID == roleId); if (role != null) { - DeleteRole(role); + this.DeleteRole(role); } } @@ -62,7 +62,7 @@ public ArrayList GetPortalRoles(int portalId) [Obsolete("Deprecated in DotNetNuke 7.3. This method has been replacd by GetRoleById. Scheduled removal in v10.0.0.")] public RoleInfo GetRole(int roleId, int portalId) { - return GetRoleById(portalId, roleId); + return this.GetRoleById(portalId, roleId); } [EditorBrowsable(EditorBrowsableState.Never)] @@ -95,14 +95,14 @@ public void UpdateRole(RoleInfo role) [Obsolete("Deprecated in DotNetNuke 7.3. This function has been replaced by overload with extra parameters. Scheduled removal in v10.0.0.")] public void UpdateUserRole(int portalId, int userId, int roleId) { - UpdateUserRole(portalId, userId, roleId, RoleStatus.Approved, false, false); + this.UpdateUserRole(portalId, userId, roleId, RoleStatus.Approved, false, false); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DotNetNuke 7.3. This function has been replaced by overload with extra parameters. Scheduled removal in v10.0.0.")] public void UpdateUserRole(int portalId, int userId, int roleId, bool cancel) { - UpdateUserRole(portalId, userId, roleId, RoleStatus.Approved, false, cancel); + this.UpdateUserRole(portalId, userId, roleId, RoleStatus.Approved, false, cancel); } diff --git a/DNN Platform/Library/Obsolete/TabController.cs b/DNN Platform/Library/Obsolete/TabController.cs index 08f788139f1..7a8ee400367 100644 --- a/DNN Platform/Library/Obsolete/TabController.cs +++ b/DNN Platform/Library/Obsolete/TabController.cs @@ -42,7 +42,7 @@ public void CreateLocalizedCopy(List tabs, Locale locale) { foreach (TabInfo t in tabs) { - CreateLocalizedCopy(t, locale, true); + this.CreateLocalizedCopy(t, locale, true); } } @@ -50,21 +50,21 @@ public void CreateLocalizedCopy(List tabs, Locale locale) [Obsolete("Deprecated in DotNetNuke 7.3. RUse alternate overload. Scheduled removal in v10.0.0.")] public void CreateLocalizedCopy(TabInfo originalTab, Locale locale) { - CreateLocalizedCopy(originalTab, locale, true); + this.CreateLocalizedCopy(originalTab, locale, true); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DNN 7.3. Method is not scalable. Use GetTabsByPortal. Scheduled removal in v10.0.0.")] public ArrayList GetAllTabs() { - return CBO.FillCollection(_dataProvider.GetAllTabs(), typeof(TabInfo)); + return CBO.FillCollection(this._dataProvider.GetAllTabs(), typeof(TabInfo)); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DNN 7.3. Method is not neccessary. Use LINQ and GetPortalTabs(). Scheduled removal in v10.0.0.")] public List GetCultureTabList(int portalid) { - return (from kvp in GetTabsByPortal(portalid) + return (from kvp in this.GetTabsByPortal(portalid) where !kvp.Value.TabPath.StartsWith("//Admin") && kvp.Value.CultureCode == PortalController.Instance.GetCurrentPortalSettings().DefaultLanguage && !kvp.Value.IsDeleted @@ -75,7 +75,7 @@ public List GetCultureTabList(int portalid) [Obsolete("Deprecated in DNN 7.3. Method is not neccessary. Use LINQ and GetPortalTabs(). Scheduled removal in v10.0.0.")] public List GetDefaultCultureTabList(int portalid) { - return (from kvp in GetTabsByPortal(portalid) + return (from kvp in this.GetTabsByPortal(portalid) where !kvp.Value.TabPath.StartsWith("//Admin") && !kvp.Value.IsDeleted select kvp.Value).ToList(); @@ -85,21 +85,21 @@ public List GetDefaultCultureTabList(int portalid) [Obsolete("This method is obsolete. It has been replaced by GetTab(ByVal TabId As Integer, ByVal PortalId As Integer, ByVal ignoreCache As Boolean) . Scheduled removal in v10.0.0.")] public TabInfo GetTab(int tabId) { - return GetTab(tabId, GetPortalId(tabId, Null.NullInteger), false); + return this.GetTab(tabId, GetPortalId(tabId, Null.NullInteger), false); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DNN 7.3. Use LINQ queries on tab collections thata re cached. Scheduled removal in v10.0.0.")] public TabInfo GetTabByUniqueID(Guid uniqueID) { - return CBO.FillObject(_dataProvider.GetTabByUniqueID(uniqueID)); + return CBO.FillObject(this._dataProvider.GetTabByUniqueID(uniqueID)); } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Deprecated in DNN 7.3. Use GetTabsByPortal(portalId).Count. Scheduled removal in v10.0.0.")] public int GetTabCount(int portalId) { - return GetTabsByPortal(portalId).Count; + return this.GetTabsByPortal(portalId).Count; } [EditorBrowsable(EditorBrowsableState.Never)] @@ -114,30 +114,30 @@ public ArrayList GetTabsByParentId(int parentId) public void MoveTab(TabInfo tab, TabMoveType type) { //Get the List of tabs with the same parent - IOrderedEnumerable siblingTabs = GetSiblingTabs(tab).OrderBy(t => t.TabOrder); + IOrderedEnumerable siblingTabs = this.GetSiblingTabs(tab).OrderBy(t => t.TabOrder); int tabIndex = GetIndexOfTab(tab, siblingTabs); switch (type) { case TabMoveType.Top: - MoveTabBefore(tab, siblingTabs.First().TabID); + this.MoveTabBefore(tab, siblingTabs.First().TabID); break; case TabMoveType.Bottom: - MoveTabAfter(tab, siblingTabs.Last().TabID); + this.MoveTabAfter(tab, siblingTabs.Last().TabID); break; case TabMoveType.Up: - MoveTabBefore(tab, siblingTabs.ElementAt(tabIndex - 1).TabID); + this.MoveTabBefore(tab, siblingTabs.ElementAt(tabIndex - 1).TabID); break; case TabMoveType.Down: - MoveTabAfter(tab, siblingTabs.ElementAt(tabIndex + 1).TabID); + this.MoveTabAfter(tab, siblingTabs.ElementAt(tabIndex + 1).TabID); break; case TabMoveType.Promote: - MoveTabAfter(tab, tab.ParentId); + this.MoveTabAfter(tab, tab.ParentId); break; case TabMoveType.Demote: - MoveTabToParent(tab, siblingTabs.ElementAt(tabIndex - 1).TabID); + this.MoveTabToParent(tab, siblingTabs.ElementAt(tabIndex - 1).TabID); break; } - ClearCache(tab.PortalID); + this.ClearCache(tab.PortalID); } } } diff --git a/DNN Platform/Library/Security/Cookies/AuthCookieController.cs b/DNN Platform/Library/Security/Cookies/AuthCookieController.cs index 823b5dfbbde..63d09566374 100644 --- a/DNN Platform/Library/Security/Cookies/AuthCookieController.cs +++ b/DNN Platform/Library/Security/Cookies/AuthCookieController.cs @@ -25,7 +25,7 @@ public void Update(string cookieValue, DateTime utcExpiry, int userId) if (string.IsNullOrEmpty(cookieValue)) return; DataCache.ClearCache(GetKey(cookieValue)); - _dataProvider.UpdateAuthCookie(cookieValue, utcExpiry, userId); + this._dataProvider.UpdateAuthCookie(cookieValue, utcExpiry, userId); } public PersistedAuthCookie Find(string cookieValue) @@ -34,7 +34,7 @@ public PersistedAuthCookie Find(string cookieValue) return CBO.Instance.GetCachedObject( new CacheItemArgs(GetKey(cookieValue), (int)FormsAuthentication.Timeout.TotalMinutes, CacheItemPriority.AboveNormal), - _ => CBO.Instance.FillObject(_dataProvider.FindAuthCookie(cookieValue)), false); + _ => CBO.Instance.FillObject(this._dataProvider.FindAuthCookie(cookieValue)), false); } public void DeleteByValue(string cookieValue) @@ -43,12 +43,12 @@ public void DeleteByValue(string cookieValue) // keep in cache so hacking tries don't hit the database; it will expire automatically //DataCache.ClearCache(GetKey(cookieValue)); - _dataProvider.DeleteAuthCookie(cookieValue); + this._dataProvider.DeleteAuthCookie(cookieValue); } public void DeleteExpired(DateTime utcExpiredBefore) { - _dataProvider.DeleteExpiredAuthCookies(utcExpiredBefore); + this._dataProvider.DeleteExpiredAuthCookies(utcExpiredBefore); } private static string GetKey(string cookieValue) diff --git a/DNN Platform/Library/Security/Cookies/PersistedAuthCookie.cs b/DNN Platform/Library/Security/Cookies/PersistedAuthCookie.cs index cdf54df539e..a1c0d4da49b 100644 --- a/DNN Platform/Library/Security/Cookies/PersistedAuthCookie.cs +++ b/DNN Platform/Library/Security/Cookies/PersistedAuthCookie.cs @@ -22,22 +22,22 @@ public class PersistedAuthCookie : IHydratable public int KeyID { - get { return CookieId; } - set { CookieId = value; } + get { return this.CookieId; } + set { this.CookieId = value; } } public void Fill(IDataReader dr) { - CookieId = Null.SetNullInteger(dr[nameof(CookieId)]); - CookieValue = Null.SetNullString(dr[nameof(CookieValue)]); - ExpiresOn = Null.SetNullDateTime(dr[nameof(ExpiresOn)]); + this.CookieId = Null.SetNullInteger(dr[nameof(this.CookieId)]); + this.CookieValue = Null.SetNullString(dr[nameof(this.CookieValue)]); + this.ExpiresOn = Null.SetNullDateTime(dr[nameof(this.ExpiresOn)]); - if (ExpiresOn.Kind != DateTimeKind.Utc) + if (this.ExpiresOn.Kind != DateTimeKind.Utc) { - ExpiresOn = new DateTime( - ExpiresOn.Year, ExpiresOn.Month, ExpiresOn.Day, - ExpiresOn.Hour, ExpiresOn.Minute, ExpiresOn.Second, - ExpiresOn.Millisecond, DateTimeKind.Utc); + this.ExpiresOn = new DateTime( + this.ExpiresOn.Year, this.ExpiresOn.Month, this.ExpiresOn.Day, + this.ExpiresOn.Hour, this.ExpiresOn.Minute, this.ExpiresOn.Second, + this.ExpiresOn.Millisecond, DateTimeKind.Utc); } } } diff --git a/DNN Platform/Library/Security/Membership/AspNetMembershipProvider.cs b/DNN Platform/Library/Security/Membership/AspNetMembershipProvider.cs index 48ae898c023..8d0689bd1cd 100644 --- a/DNN Platform/Library/Security/Membership/AspNetMembershipProvider.cs +++ b/DNN Platform/Library/Security/Membership/AspNetMembershipProvider.cs @@ -212,7 +212,7 @@ private UserCreateStatus CreateDNNUser(ref UserInfo user) try { user.UserID = - Convert.ToInt32(_dataProvider.AddUser(user.PortalID, + Convert.ToInt32(this._dataProvider.AddUser(user.PortalID, user.Username, user.FirstName, user.LastName, @@ -613,7 +613,7 @@ private static object GetMembershipUserByUserKeyCallBack(CacheItemArgs cacheItem public override UserInfo GetUserByAuthToken(int portalId, string userToken, string authType) { - IDataReader dr = _dataProvider.GetUserByAuthToken(portalId, userToken, authType); + IDataReader dr = this._dataProvider.GetUserByAuthToken(portalId, userToken, authType); UserInfo objUserInfo = FillUserInfo(portalId, dr, true); return objUserInfo; } @@ -712,7 +712,7 @@ public override void AddUserPortal(int portalId, int userId) { Requires.NotNullOrEmpty("portalId", portalId.ToString()); Requires.NotNullOrEmpty("userId", userId.ToString()); - _dataProvider.AddUserPortal(portalId, userId); + this._dataProvider.AddUserPortal(portalId, userId); } /// @@ -749,7 +749,7 @@ public override void ChangeUsername(int userId, string newUsername) var settings = UserController.GetUserSettings(portalSettings.PortalId); //User Name Validation - var userNameValidator = GetStringSetting(settings, "Security_UserNameValidation"); + var userNameValidator = this.GetStringSetting(settings, "Security_UserNameValidation"); if (!string.IsNullOrEmpty(userNameValidator)) { var regExp = RegexUtils.GetCachedRegex(userNameValidator, RegexOptions.IgnoreCase | RegexOptions.Multiline); @@ -761,7 +761,7 @@ public override void ChangeUsername(int userId, string newUsername) } } - _dataProvider.ChangeUsername(userId, userName); + this._dataProvider.ChangeUsername(userId, userName); EventLogController.Instance.AddLog("userId", userId.ToString(), @@ -799,7 +799,7 @@ public override bool ChangePassword(UserInfo user, string oldPassword, string ne oldPassword = aspnetUser.GetPassword(); } bool retValue = aspnetUser.ChangePassword(oldPassword, newPassword); - if (retValue && PasswordRetrievalEnabled && !RequiresQuestionAndAnswer) + if (retValue && this.PasswordRetrievalEnabled && !this.RequiresQuestionAndAnswer) { string confirmPassword = aspnetUser.GetPassword(); if (confirmPassword == newPassword) @@ -871,7 +871,7 @@ private void ValidateForDuplicateDisplayName(UserInfo user, ref UserCreateStatus if (requireUniqueDisplayName) { - UserInfo duplicateUser = GetUserByDisplayName(user.PortalID, user.DisplayName); + UserInfo duplicateUser = this.GetUserByDisplayName(user.PortalID, user.DisplayName); if (duplicateUser != null) { createStatus = UserCreateStatus.DuplicateDisplayName; @@ -890,12 +890,12 @@ private void ValidateForDuplicateDisplayName(UserInfo user, ref UserCreateStatus /// ----------------------------------------------------------------------------- public override UserCreateStatus CreateUser(ref UserInfo user) { - UserCreateStatus createStatus = ValidateForProfanity(user); + UserCreateStatus createStatus = this.ValidateForProfanity(user); string service = HttpContext.Current != null ? HttpContext.Current.Request.Params["state"] : string.Empty; if (createStatus == UserCreateStatus.AddUser) { - ValidateForDuplicateDisplayName(user, ref createStatus); + this.ValidateForDuplicateDisplayName(user, ref createStatus); } if (createStatus == UserCreateStatus.AddUser) @@ -903,7 +903,7 @@ public override UserCreateStatus CreateUser(ref UserInfo user) try { //check if username exists in database for any portal - UserInfo objVerifyUser = GetUserByUserName(Null.NullInteger, user.Username); + UserInfo objVerifyUser = this.GetUserByUserName(Null.NullInteger, user.Username); if (objVerifyUser != null) { //DNN-4016 @@ -911,7 +911,7 @@ public override UserCreateStatus CreateUser(ref UserInfo user) if (ValidateUser(user.Username, user.Membership.Password)) { //check if user exists for the portal specified - objVerifyUser = GetUserByUserName(user.PortalID, user.Username); + objVerifyUser = this.GetUserByUserName(user.PortalID, user.Username); if (objVerifyUser != null) { if (objVerifyUser.PortalID == user.PortalID && (!user.IsSuperUser || user.PortalID == Null.NullInteger)) @@ -952,7 +952,7 @@ public override UserCreateStatus CreateUser(ref UserInfo user) if (createStatus == UserCreateStatus.Success || createStatus == UserCreateStatus.AddUserToPortal) { //Create the DNN User Record - createStatus = CreateDNNUser(ref user); + createStatus = this.CreateDNNUser(ref user); if (createStatus == UserCreateStatus.Success) { //Persist the Profile to the Data Store @@ -984,7 +984,7 @@ public override bool DeleteUser(UserInfo user) bool retValue = true; try { - _dataProvider.DeleteUserFromPortal(user.UserID, user.PortalID); + this._dataProvider.DeleteUserFromPortal(user.UserID, user.PortalID); } catch (Exception ex) { @@ -1006,7 +1006,7 @@ public override bool DeleteUser(UserInfo user) [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] public override void DeleteUsersOnline(int timeWindow) { - _dataProvider.DeleteUsersOnline(timeWindow); + this._dataProvider.DeleteUsersOnline(timeWindow); } /// ----------------------------------------------------------------------------- @@ -1017,7 +1017,7 @@ public override void DeleteUsersOnline(int timeWindow) /// ----------------------------------------------------------------------------- public override string GeneratePassword() { - return GeneratePassword(MinPasswordLength + 4); + return this.GeneratePassword(this.MinPasswordLength + 4); } /// ----------------------------------------------------------------------------- @@ -1029,12 +1029,12 @@ public override string GeneratePassword() /// ----------------------------------------------------------------------------- public override string GeneratePassword(int length) { - return System.Web.Security.Membership.GeneratePassword(length, MinNonAlphanumericCharacters); + return System.Web.Security.Membership.GeneratePassword(length, this.MinNonAlphanumericCharacters); } public override ArrayList GetDeletedUsers(int portalId) { - return FillUserCollection(portalId, _dataProvider.GetDeletedUsers(portalId)); + return FillUserCollection(portalId, this._dataProvider.GetDeletedUsers(portalId)); } /// ----------------------------------------------------------------------------- @@ -1048,7 +1048,7 @@ public override ArrayList GetDeletedUsers(int portalId) public override ArrayList GetOnlineUsers(int portalId) { int totalRecords = 0; - return FillUserCollection(portalId, _dataProvider.GetOnlineUsers(portalId), ref totalRecords); + return FillUserCollection(portalId, this._dataProvider.GetOnlineUsers(portalId), ref totalRecords); } /// ----------------------------------------------------------------------------- @@ -1069,18 +1069,18 @@ public override string GetPassword(UserInfo user, string passwordAnswer) { AutoUnlockUser(aspnetUser); } - return RequiresQuestionAndAnswer ? aspnetUser.GetPassword(passwordAnswer) : aspnetUser.GetPassword(); + return this.RequiresQuestionAndAnswer ? aspnetUser.GetPassword(passwordAnswer) : aspnetUser.GetPassword(); } public override ArrayList GetUnAuthorizedUsers(int portalId) { - return GetUnAuthorizedUsers(portalId, false, false); + return this.GetUnAuthorizedUsers(portalId, false, false); } public override ArrayList GetUnAuthorizedUsers(int portalId, bool includeDeleted, bool superUsersOnly) { return FillUserCollection(portalId, - _dataProvider.GetUnAuthorizedUsers(portalId, includeDeleted, superUsersOnly)); + this._dataProvider.GetUnAuthorizedUsers(portalId, includeDeleted, superUsersOnly)); } /// ----------------------------------------------------------------------------- @@ -1095,7 +1095,7 @@ public override ArrayList GetUnAuthorizedUsers(int portalId, bool includeDeleted /// ----------------------------------------------------------------------------- public override UserInfo GetUser(int portalId, int userId) { - IDataReader dr = _dataProvider.GetUser(portalId, userId); + IDataReader dr = this._dataProvider.GetUser(portalId, userId); UserInfo objUserInfo = FillUserInfo(portalId, dr, true); return objUserInfo; } @@ -1112,7 +1112,7 @@ public override UserInfo GetUser(int portalId, int userId) /// ----------------------------------------------------------------------------- public override UserInfo GetUserByDisplayName(int portalId, string displayName) { - IDataReader dr = _dataProvider.GetUserByDisplayName(portalId, displayName); + IDataReader dr = this._dataProvider.GetUserByDisplayName(portalId, displayName); UserInfo objUserInfo = FillUserInfo(portalId, dr, true); return objUserInfo; } @@ -1134,7 +1134,7 @@ public override UserInfo GetUserByUserName(int portalId, string username) DataCache.UserCacheTimeOut, DataCache.UserCachePriority), _ => { - return GetUserByUserNameFromDataStore(portalId, username); + return this.GetUserByUserNameFromDataStore(portalId, username); }); return objUserInfo; } @@ -1154,7 +1154,7 @@ public override UserInfo GetUserByVanityUrl(int portalId, string vanityUrl) UserInfo user = null; if (!String.IsNullOrEmpty(vanityUrl)) { - IDataReader dr = _dataProvider.GetUserByVanityUrl(portalId, vanityUrl); + IDataReader dr = this._dataProvider.GetUserByVanityUrl(portalId, vanityUrl); user = FillUserInfo(portalId, dr, true); } return user; @@ -1175,7 +1175,7 @@ public override UserInfo GetUserByPasswordResetToken(int portalId, string resetT UserInfo user = null; if (!String.IsNullOrEmpty(resetToken)) { - IDataReader dr = _dataProvider.GetUserByPasswordResetToken(portalId, resetToken); + IDataReader dr = this._dataProvider.GetUserByPasswordResetToken(portalId, resetToken); user = FillUserInfo(portalId, dr, true); } return user; @@ -1194,7 +1194,7 @@ public override UserInfo GetUserByProviderUserKey(int portalId, string providerU return null; } - return GetUserByUserName(portalId, userName); + return this.GetUserByUserName(portalId, userName); } /// ----------------------------------------------------------------------------- @@ -1208,7 +1208,7 @@ public override UserInfo GetUserByProviderUserKey(int portalId, string providerU /// ----------------------------------------------------------------------------- public override int GetUserCountByPortal(int portalId) { - return _dataProvider.GetUserCountByPortal(portalId); + return this._dataProvider.GetUserCountByPortal(portalId); } /// ----------------------------------------------------------------------------- @@ -1228,7 +1228,7 @@ public override void GetUserMembership(ref UserInfo user) FillUserMembership(aspnetUser, user); //Get Online Status - user.Membership.IsOnLine = IsUserOnline(user); + user.Membership.IsOnLine = this.IsUserOnline(user); } /// ----------------------------------------------------------------------------- @@ -1244,7 +1244,7 @@ public override void GetUserMembership(ref UserInfo user) /// ----------------------------------------------------------------------------- public override ArrayList GetUsers(int portalId, int pageIndex, int pageSize, ref int totalRecords) { - return GetUsers(portalId, pageIndex, pageSize, ref totalRecords, false, false); + return this.GetUsers(portalId, pageIndex, pageSize, ref totalRecords, false, false); } /// ----------------------------------------------------------------------------- @@ -1269,7 +1269,7 @@ public override ArrayList GetUsers(int portalId, int pageIndex, int pageSize, re pageSize = int.MaxValue; } - return FillUserCollection(portalId, _dataProvider.GetAllUsers(portalId, pageIndex, pageSize, includeDeleted, + return FillUserCollection(portalId, this._dataProvider.GetAllUsers(portalId, pageIndex, pageSize, includeDeleted, superUsersOnly), ref totalRecords); } @@ -1297,7 +1297,7 @@ public override IList GetUsersAdvancedSearch(int portalId, int userId, string propertyValues) { return FillUserList(portalId, - _dataProvider.GetUsersAdvancedSearch(portalId, userId, filterUserId, filterRoleId, + this._dataProvider.GetUsersAdvancedSearch(portalId, userId, filterUserId, filterRoleId, relationshipTypeId, isAdmin, pageIndex, pageSize, sortColumn, sortAscending, propertyNames, propertyValues)); @@ -1318,7 +1318,7 @@ public override IList GetUsersBasicSearch(int portalId, int pageIndex, bool sortAscending, string propertyName, string propertyValue) { - return FillUserList(portalId, _dataProvider.GetUsersBasicSearch(portalId, pageIndex, pageSize, + return FillUserList(portalId, this._dataProvider.GetUsersBasicSearch(portalId, pageIndex, pageSize, sortColumn, sortAscending, propertyName, propertyValue)); } @@ -1339,7 +1339,7 @@ public override IList GetUsersBasicSearch(int portalId, int pageIndex, public override ArrayList GetUsersByEmail(int portalId, string emailToMatch, int pageIndex, int pageSize, ref int totalRecords) { - return GetUsersByEmail(portalId, emailToMatch, pageIndex, pageSize, ref totalRecords, false, false); + return this.GetUsersByEmail(portalId, emailToMatch, pageIndex, pageSize, ref totalRecords, false, false); } /// ----------------------------------------------------------------------------- @@ -1367,7 +1367,7 @@ public override ArrayList GetUsersByEmail(int portalId, string emailToMatch, int } return FillUserCollection(portalId, - _dataProvider.GetUsersByEmail(portalId, emailToMatch, pageIndex, pageSize, + this._dataProvider.GetUsersByEmail(portalId, emailToMatch, pageIndex, pageSize, includeDeleted, superUsersOnly), ref totalRecords); } @@ -1387,7 +1387,7 @@ public override ArrayList GetUsersByEmail(int portalId, string emailToMatch, int public override ArrayList GetUsersByUserName(int portalId, string userNameToMatch, int pageIndex, int pageSize, ref int totalRecords) { - return GetUsersByUserName(portalId, userNameToMatch, pageIndex, pageSize, ref totalRecords, false, false); + return this.GetUsersByUserName(portalId, userNameToMatch, pageIndex, pageSize, ref totalRecords, false, false); } /// ----------------------------------------------------------------------------- @@ -1415,7 +1415,7 @@ public override ArrayList GetUsersByUserName(int portalId, string userNameToMatc } return FillUserCollection(portalId, - _dataProvider.GetUsersByUsername(portalId, userNameToMatch, pageIndex, pageSize, + this._dataProvider.GetUsersByUsername(portalId, userNameToMatch, pageIndex, pageSize, includeDeleted, superUsersOnly), ref totalRecords); } @@ -1444,7 +1444,7 @@ public override ArrayList GetUsersByDisplayName(int portalId, string nameToMatch } return FillUserCollection(portalId, - _dataProvider.GetUsersByDisplayname(portalId, nameToMatch, pageIndex, pageSize, + this._dataProvider.GetUsersByDisplayname(portalId, nameToMatch, pageIndex, pageSize, includeDeleted, superUsersOnly), ref totalRecords); } @@ -1466,7 +1466,7 @@ public override ArrayList GetUsersByDisplayName(int portalId, string nameToMatch public override ArrayList GetUsersByProfileProperty(int portalId, string propertyName, string propertyValue, int pageIndex, int pageSize, ref int totalRecords) { - return GetUsersByProfileProperty(portalId, propertyName, propertyValue, pageIndex, pageSize, + return this.GetUsersByProfileProperty(portalId, propertyName, propertyValue, pageIndex, pageSize, ref totalRecords, false, false); } @@ -1498,7 +1498,7 @@ public override ArrayList GetUsersByProfileProperty(int portalId, string propert } return FillUserCollection(portalId, - _dataProvider.GetUsersByProfileProperty(portalId, propertyName, propertyValue, + this._dataProvider.GetUsersByProfileProperty(portalId, propertyName, propertyValue, pageIndex, pageSize, includeDeleted, superUsersOnly), ref totalRecords); } @@ -1528,7 +1528,7 @@ public override bool IsUserOnline(UserInfo user) else { //Next try the Database - onlineUser = CBO.FillObject(_dataProvider.GetOnlineUser(user.UserID)); + onlineUser = CBO.FillObject(this._dataProvider.GetOnlineUser(user.UserID)); if (onlineUser != null) { isOnline = true; @@ -1549,10 +1549,10 @@ public override bool RemoveUser(UserInfo user) RelationshipController.Instance.DeleteUserRelationship(relationship); } - _dataProvider.RemoveUser(user.UserID, user.PortalID); + this._dataProvider.RemoveUser(user.UserID, user.PortalID); //Prior to removing membership, ensure user is not present in any other portal - UserInfo otherUser = GetUserByUserNameFromDataStore(Null.NullInteger, user.Username); + UserInfo otherUser = this.GetUserByUserNameFromDataStore(Null.NullInteger, user.Username); if (otherUser == null) { DeleteMembershipUser(user); @@ -1582,7 +1582,7 @@ public override string ResetPassword(UserInfo user, string passwordAnswer) //Get AspNet MembershipUser MembershipUser aspnetUser = GetMembershipUser(user); - return RequiresQuestionAndAnswer ? aspnetUser.ResetPassword(passwordAnswer) : aspnetUser.ResetPassword(); + return this.RequiresQuestionAndAnswer ? aspnetUser.ResetPassword(passwordAnswer) : aspnetUser.ResetPassword(); } /// @@ -1594,12 +1594,12 @@ public override string ResetPassword(UserInfo user, string passwordAnswer) /// public override bool ResetAndChangePassword(UserInfo user, string newPassword) { - return ResetAndChangePassword(user, newPassword, string.Empty); + return this.ResetAndChangePassword(user, newPassword, string.Empty); } public override bool ResetAndChangePassword(UserInfo user, string newPassword, string answer) { - if (RequiresQuestionAndAnswer && string.IsNullOrEmpty(answer)) + if (this.RequiresQuestionAndAnswer && string.IsNullOrEmpty(answer)) { return false; } @@ -1611,7 +1611,7 @@ public override bool ResetAndChangePassword(UserInfo user, string newPassword, s aspnetUser.UnlockUser(); } - string resetPassword = ResetPassword(user, answer); + string resetPassword = this.ResetPassword(user, answer); return aspnetUser.ChangePassword(resetPassword, newPassword); } @@ -1621,7 +1621,7 @@ public override bool RestoreUser(UserInfo user) try { - _dataProvider.RestoreUser(user.UserID, user.PortalID); + this._dataProvider.RestoreUser(user.UserID, user.PortalID); } catch (Exception ex) { @@ -1663,7 +1663,7 @@ public override bool UnLockUser(UserInfo user) /// ----------------------------------------------------------------------------- public override void UserAgreedToTerms(UserInfo user) { - _dataProvider.UserAgreedToTerms(PortalController.GetEffectivePortalId(user.PortalID), user.UserID); + this._dataProvider.UserAgreedToTerms(PortalController.GetEffectivePortalId(user.PortalID), user.UserID); } /// ----------------------------------------------------------------------------- @@ -1676,7 +1676,7 @@ public override void UserAgreedToTerms(UserInfo user) /// ----------------------------------------------------------------------------- public override void ResetTermsAgreement(int portalId) { - _dataProvider.ResetTermsAgreement(portalId); + this._dataProvider.ResetTermsAgreement(portalId); } private static Random random = new Random(); @@ -1694,7 +1694,7 @@ private string RandomString(int length) /// True if user requests removal, false if the value needs to be reset. public override void UserRequestsRemoval(UserInfo user, bool remove) { - _dataProvider.UserRequestsRemoval(user.PortalID, user.UserID, remove); + this._dataProvider.UserRequestsRemoval(user.PortalID, user.UserID, remove); } /// ----------------------------------------------------------------------------- @@ -1750,7 +1750,7 @@ public override void UpdateUser(UserInfo user) UpdateUserMembership(user); //Persist the DNN User to the Database - _dataProvider.UpdateUser(user.UserID, + this._dataProvider.UpdateUser(user.UserID, user.PortalID, firstName, lastName, @@ -1781,7 +1781,7 @@ public override void UpdateUser(UserInfo user) [Obsolete("Support for users online was removed in 8.x, other solutions exist outside of the DNN Platform. Scheduled removal in v11.0.0.")] public override void UpdateUsersOnline(Hashtable userList) { - _dataProvider.UpdateUsersOnline(userList); + this._dataProvider.UpdateUsersOnline(userList); } /// ----------------------------------------------------------------------------- @@ -1800,7 +1800,7 @@ public override void UpdateUsersOnline(Hashtable userList) public override UserInfo UserLogin(int portalId, string username, string password, string verificationCode, ref UserLoginStatus loginStatus) { - return UserLogin(portalId, username, password, "DNN", verificationCode, ref loginStatus); + return this.UserLogin(portalId, username, password, "DNN", verificationCode, ref loginStatus); } /// ----------------------------------------------------------------------------- @@ -1831,8 +1831,8 @@ public override UserInfo UserLogin(int portalId, string username, string passwor //Get a light-weight (unhydrated) DNN User from the Database, we will hydrate it later if neccessary UserInfo user = (authType == "DNN") - ? GetUserByUserName(portalId, username) - : GetUserByAuthToken(portalId, verificationCode, authType); + ? this.GetUserByUserName(portalId, username) + : this.GetUserByAuthToken(portalId, verificationCode, authType); if (user != null && !user.IsDeleted) { //Get AspNet MembershipUser @@ -1860,7 +1860,7 @@ public override UserInfo UserLogin(int portalId, string username, string passwor { //Check Verification code (skip for FB, Google, Twitter, LiveID as it has no verification code) - if (_socialAuthProviders.Contains(authType) && String.IsNullOrEmpty(verificationCode)) + if (this._socialAuthProviders.Contains(authType) && String.IsNullOrEmpty(verificationCode)) { if (PortalController.Instance.GetCurrentPortalSettings().UserRegistration == (int)Globals.PortalRegistrationType.PublicRegistration) @@ -1961,7 +1961,7 @@ public static ArrayList FillUserCollection(int portalId, IDataReader dr) /// ----------------------------------------------------------------------------- private UserInfo GetUserByUserNameFromDataStore(int portalId, string username) { - using (var dr = _dataProvider.GetUserByUsername(portalId, username)) + using (var dr = this._dataProvider.GetUserByUsername(portalId, username)) { return FillUserInfo(portalId, dr, true); } diff --git a/DNN Platform/Library/Security/Permissions/Controls/DesktopModulePermissionsGrid.cs b/DNN Platform/Library/Security/Permissions/Controls/DesktopModulePermissionsGrid.cs index 9f223a605ce..2d9269c09d5 100644 --- a/DNN Platform/Library/Security/Permissions/Controls/DesktopModulePermissionsGrid.cs +++ b/DNN Platform/Library/Security/Permissions/Controls/DesktopModulePermissionsGrid.cs @@ -35,11 +35,11 @@ protected override List PermissionsList { get { - if (_PermissionsList == null && _DesktopModulePermissions != null) + if (this._PermissionsList == null && this._DesktopModulePermissions != null) { - _PermissionsList = _DesktopModulePermissions.ToList(); + this._PermissionsList = this._DesktopModulePermissions.ToList(); } - return _PermissionsList; + return this._PermissionsList; } } @@ -57,10 +57,10 @@ public DesktopModulePermissionCollection Permissions get { //First Update Permissions in case they have been changed - UpdatePermissions(); + this.UpdatePermissions(); //Return the DesktopModulePermissions - return _DesktopModulePermissions; + return this._DesktopModulePermissions; } } @@ -73,15 +73,15 @@ public int PortalDesktopModuleID { get { - return _PortalDesktopModuleID; + return this._PortalDesktopModuleID; } set { - int oldValue = _PortalDesktopModuleID; - _PortalDesktopModuleID = value; - if (_DesktopModulePermissions == null || oldValue != value) + int oldValue = this._PortalDesktopModuleID; + this._PortalDesktopModuleID = value; + if (this._DesktopModulePermissions == null || oldValue != value) { - GetDesktopModulePermissions(); + this.GetDesktopModulePermissions(); } } } @@ -97,7 +97,7 @@ public int PortalDesktopModuleID /// ----------------------------------------------------------------------------- private void GetDesktopModulePermissions() { - _DesktopModulePermissions = new DesktopModulePermissionCollection(DesktopModulePermissionController.GetDesktopModulePermissions(PortalDesktopModuleID)); + this._DesktopModulePermissions = new DesktopModulePermissionCollection(DesktopModulePermissionController.GetDesktopModulePermissions(this.PortalDesktopModuleID)); } /// ----------------------------------------------------------------------------- @@ -120,7 +120,7 @@ private DesktopModulePermissionInfo ParseKeys(string[] Settings) { objDesktopModulePermission.DesktopModulePermissionID = Convert.ToInt32(Settings[2]); } - objDesktopModulePermission.PortalDesktopModuleID = PortalDesktopModuleID; + objDesktopModulePermission.PortalDesktopModuleID = this.PortalDesktopModuleID; return objDesktopModulePermission; } @@ -131,16 +131,16 @@ private DesktopModulePermissionInfo ParseKeys(string[] Settings) protected override void AddPermission(PermissionInfo permission, int roleId, string roleName, int userId, string displayName, bool allowAccess) { var objPermission = new DesktopModulePermissionInfo(permission); - objPermission.PortalDesktopModuleID = PortalDesktopModuleID; + objPermission.PortalDesktopModuleID = this.PortalDesktopModuleID; objPermission.RoleID = roleId; objPermission.RoleName = roleName; objPermission.AllowAccess = allowAccess; objPermission.UserID = userId; objPermission.DisplayName = displayName; - _DesktopModulePermissions.Add(objPermission, true); + this._DesktopModulePermissions.Add(objPermission, true); //Clear Permission List - _PermissionsList = null; + this._PermissionsList = null; } /// ----------------------------------------------------------------------------- @@ -154,7 +154,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) { //Search DesktopModulePermission Collection for the user bool isMatch = false; - foreach (DesktopModulePermissionInfo objDesktopModulePermission in _DesktopModulePermissions) + foreach (DesktopModulePermissionInfo objDesktopModulePermission in this._DesktopModulePermissions) { if (objDesktopModulePermission.UserID == user.UserID) { @@ -170,7 +170,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) { if (objPermission.PermissionKey == "DEPLOY") { - AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); + this.AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); } } } @@ -186,7 +186,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) protected override void AddPermission(ArrayList permissions, RoleInfo role) { //Search TabPermission Collection for the user - if (_DesktopModulePermissions.Cast().Any(p => p.RoleID == role.RoleID)) + if (this._DesktopModulePermissions.Cast().Any(p => p.RoleID == role.RoleID)) { return; } @@ -196,7 +196,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) { if (objPermission.PermissionKey == "DEPLOY") { - AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); + this.AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); } } } @@ -233,13 +233,13 @@ protected override void LoadViewState(object savedState) //Load DesktopModuleId if (myState[1] != null) { - PortalDesktopModuleID = Convert.ToInt32(myState[1]); + this.PortalDesktopModuleID = Convert.ToInt32(myState[1]); } //Load DesktopModulePermissions if (myState[2] != null) { - _DesktopModulePermissions = new DesktopModulePermissionCollection(); + this._DesktopModulePermissions = new DesktopModulePermissionCollection(); string state = Convert.ToString(myState[2]); if (!String.IsNullOrEmpty(state)) { @@ -248,7 +248,7 @@ protected override void LoadViewState(object savedState) foreach (string key in permissionKeys) { string[] Settings = key.Split('|'); - _DesktopModulePermissions.Add(ParseKeys(Settings)); + this._DesktopModulePermissions.Add(this.ParseKeys(Settings)); } } } @@ -257,9 +257,9 @@ protected override void LoadViewState(object savedState) protected override void RemovePermission(int permissionID, int roleID, int userID) { - _DesktopModulePermissions.Remove(permissionID, roleID, userID); + this._DesktopModulePermissions.Remove(permissionID, roleID, userID); //Clear Permission List - _PermissionsList = null; + this._PermissionsList = null; } /// ----------------------------------------------------------------------------- @@ -275,14 +275,14 @@ protected override object SaveViewState() allStates[0] = base.SaveViewState(); //Save the DesktopModule Id - allStates[1] = PortalDesktopModuleID; + allStates[1] = this.PortalDesktopModuleID; //Persist the DesktopModulePermisisons var sb = new StringBuilder(); - if (_DesktopModulePermissions != null) + if (this._DesktopModulePermissions != null) { bool addDelimiter = false; - foreach (DesktopModulePermissionInfo objDesktopModulePermission in _DesktopModulePermissions) + foreach (DesktopModulePermissionInfo objDesktopModulePermission in this._DesktopModulePermissions) { if (addDelimiter) { @@ -292,7 +292,7 @@ protected override object SaveViewState() { addDelimiter = true; } - sb.Append(BuildKey(objDesktopModulePermission.AllowAccess, + sb.Append(this.BuildKey(objDesktopModulePermission.AllowAccess, objDesktopModulePermission.PermissionID, objDesktopModulePermission.DesktopModulePermissionID, objDesktopModulePermission.RoleID, @@ -321,8 +321,8 @@ protected override bool SupportsDenyPermissions(PermissionInfo permissionInfo) public void ResetPermissions() { - GetDesktopModulePermissions(); - _PermissionsList = null; + this.GetDesktopModulePermissions(); + this._PermissionsList = null; } public override void GenerateDataGrid() diff --git a/DNN Platform/Library/Security/Permissions/Controls/FolderPermissionsGrid.cs b/DNN Platform/Library/Security/Permissions/Controls/FolderPermissionsGrid.cs index 922b934dce2..d89dad73a41 100644 --- a/DNN Platform/Library/Security/Permissions/Controls/FolderPermissionsGrid.cs +++ b/DNN Platform/Library/Security/Permissions/Controls/FolderPermissionsGrid.cs @@ -40,11 +40,11 @@ protected override List PermissionsList { get { - if (_permissionsList == null && FolderPermissions != null) + if (this._permissionsList == null && this.FolderPermissions != null) { - _permissionsList = FolderPermissions.ToList(); + this._permissionsList = this.FolderPermissions.ToList(); } - return _permissionsList; + return this._permissionsList; } } @@ -52,7 +52,7 @@ protected override bool RefreshGrid { get { - return _refreshGrid; + return this._refreshGrid; } } @@ -69,13 +69,13 @@ public string FolderPath { get { - return _folderPath; + return this._folderPath; } set { - _folderPath = value; - _refreshGrid = true; - GetFolderPermissions(); + this._folderPath = value; + this._refreshGrid = true; + this.GetFolderPermissions(); } } @@ -89,10 +89,10 @@ public FolderPermissionCollection Permissions get { //First Update Permissions in case they have been changed - UpdatePermissions(); + this.UpdatePermissions(); //Return the FolderPermissions - return FolderPermissions; + return this.FolderPermissions; } } @@ -107,8 +107,8 @@ public FolderPermissionCollection Permissions /// ----------------------------------------------------------------------------- protected virtual void GetFolderPermissions() { - FolderPermissions = new FolderPermissionCollection(FolderPermissionController.GetFolderPermissionsCollectionByFolder(PortalId, FolderPath)); - _permissionsList = null; + this.FolderPermissions = new FolderPermissionCollection(FolderPermissionController.GetFolderPermissionsCollectionByFolder(this.PortalId, this.FolderPath)); + this._permissionsList = null; } /// ----------------------------------------------------------------------------- @@ -131,7 +131,7 @@ private FolderPermissionInfo ParseKeys(string[] settings) { objFolderPermission.FolderPermissionID = Convert.ToInt32(settings[2]); } - objFolderPermission.FolderPath = FolderPath; + objFolderPermission.FolderPath = this.FolderPath; return objFolderPermission; } @@ -142,7 +142,7 @@ private void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventA if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.SelectedItem) { var roleID = Int32.Parse(((DataRowView)item.DataItem)[0].ToString()); - if (IsImplicitRole(PortalSettings.Current.PortalId, roleID)) + if (this.IsImplicitRole(PortalSettings.Current.PortalId, roleID)) { var actionImage = item.Controls.Cast().Last().Controls[0] as ImageButton; if (actionImage != null) @@ -160,24 +160,24 @@ private void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventA protected override void CreateChildControls() { base.CreateChildControls(); - rolePermissionsGrid.ItemDataBound += rolePermissionsGrid_ItemDataBound; + this.rolePermissionsGrid.ItemDataBound += this.rolePermissionsGrid_ItemDataBound; } protected override void AddPermission(PermissionInfo permission, int roleId, string roleName, int userId, string displayName, bool allowAccess) { var objPermission = new FolderPermissionInfo(permission) { - FolderPath = FolderPath, + FolderPath = this.FolderPath, RoleID = roleId, RoleName = roleName, AllowAccess = allowAccess, UserID = userId, DisplayName = displayName }; - FolderPermissions.Add(objPermission, true); + this.FolderPermissions.Add(objPermission, true); //Clear Permission List - _permissionsList = null; + this._permissionsList = null; } /// ----------------------------------------------------------------------------- @@ -190,7 +190,7 @@ protected override void AddPermission(PermissionInfo permission, int roleId, str protected override void AddPermission(ArrayList permissions, UserInfo user) { bool isMatch = false; - foreach (FolderPermissionInfo objFolderPermission in FolderPermissions) + foreach (FolderPermissionInfo objFolderPermission in this.FolderPermissions) { if (objFolderPermission.UserID == user.UserID) { @@ -206,7 +206,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) { if (objPermission.PermissionKey == "READ") { - AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); + this.AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); } } } @@ -222,7 +222,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) protected override void AddPermission(ArrayList permissions, RoleInfo role) { //Search TabPermission Collection for the user - if (FolderPermissions.Cast().Any(p => p.RoleID == role.RoleID)) + if (this.FolderPermissions.Cast().Any(p => p.RoleID == role.RoleID)) { return; } @@ -232,7 +232,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) { if (objPermission.PermissionKey == "READ") { - AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); + this.AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); } } } @@ -247,7 +247,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) /// ----------------------------------------------------------------------------- protected override bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int column) { - return !IsImplicitRole(role.PortalID, role.RoleID); + return !this.IsImplicitRole(role.PortalID, role.RoleID); } /// ----------------------------------------------------------------------------- @@ -263,7 +263,7 @@ protected override bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int co protected override string GetPermission(PermissionInfo objPerm, RoleInfo role, int column, string defaultState) { string permission; - if (role.RoleID == AdministratorRoleId && IsPermissionAlwaysGrantedToAdmin(objPerm)) + if (role.RoleID == this.AdministratorRoleId && this.IsPermissionAlwaysGrantedToAdmin(objPerm)) { permission = PermissionTypeGrant; } @@ -287,12 +287,12 @@ protected override bool IsViewPermisison(PermissionInfo permissionInfo) private bool IsPermissionAlwaysGrantedToAdmin(PermissionInfo permissionInfo) { - return IsSystemFolderPermission(permissionInfo); + return this.IsSystemFolderPermission(permissionInfo); } private bool IsSystemFolderPermission(PermissionInfo permissionInfo) { - return _systemFolderPermissions.Any(pi => pi.PermissionID == permissionInfo.PermissionID); + return this._systemFolderPermissions.Any(pi => pi.PermissionID == permissionInfo.PermissionID); } private bool IsImplicitRole(int portalId, int roleId) @@ -308,7 +308,7 @@ private bool IsImplicitRole(int portalId, int roleId) protected override ArrayList GetPermissions() { ArrayList perms = PermissionController.GetPermissionsByFolder(); - _systemFolderPermissions = perms.Cast().ToList(); + this._systemFolderPermissions = perms.Cast().ToList(); return perms; } @@ -334,13 +334,13 @@ protected override void LoadViewState(object savedState) //Load FolderPath if (myState[1] != null) { - _folderPath = Convert.ToString(myState[1]); + this._folderPath = Convert.ToString(myState[1]); } //Load FolderPermissions if (myState[2] != null) { - FolderPermissions = new FolderPermissionCollection(); + this.FolderPermissions = new FolderPermissionCollection(); string state = Convert.ToString(myState[2]); if (!String.IsNullOrEmpty(state)) { @@ -349,7 +349,7 @@ protected override void LoadViewState(object savedState) foreach (string key in permissionKeys) { string[] settings = key.Split('|'); - FolderPermissions.Add(ParseKeys(settings)); + this.FolderPermissions.Add(this.ParseKeys(settings)); } } } @@ -358,9 +358,9 @@ protected override void LoadViewState(object savedState) protected override void RemovePermission(int permissionID, int roleID, int userID) { - FolderPermissions.Remove(permissionID, roleID, userID); + this.FolderPermissions.Remove(permissionID, roleID, userID); //Clear Permission List - _permissionsList = null; + this._permissionsList = null; } /// ----------------------------------------------------------------------------- @@ -376,14 +376,14 @@ protected override object SaveViewState() allStates[0] = base.SaveViewState(); //Save the Tab Id - allStates[1] = FolderPath; + allStates[1] = this.FolderPath; //Persist the TabPermisisons var sb = new StringBuilder(); - if (FolderPermissions != null) + if (this.FolderPermissions != null) { bool addDelimiter = false; - foreach (FolderPermissionInfo objFolderPermission in FolderPermissions) + foreach (FolderPermissionInfo objFolderPermission in this.FolderPermissions) { if (addDelimiter) { @@ -393,7 +393,7 @@ protected override object SaveViewState() { addDelimiter = true; } - sb.Append(BuildKey(objFolderPermission.AllowAccess, + sb.Append(this.BuildKey(objFolderPermission.AllowAccess, objFolderPermission.PermissionID, objFolderPermission.FolderPermissionID, objFolderPermission.RoleID, @@ -413,7 +413,7 @@ protected override object SaveViewState() /// ----------------------------------------------------------------------------- protected override bool SupportsDenyPermissions(PermissionInfo permissionInfo) { - return IsSystemFolderPermission(permissionInfo); + return this.IsSystemFolderPermission(permissionInfo); } #endregion diff --git a/DNN Platform/Library/Security/Permissions/Controls/ModulePermissionsGrid.cs b/DNN Platform/Library/Security/Permissions/Controls/ModulePermissionsGrid.cs index e78198541a3..1608589ffd6 100644 --- a/DNN Platform/Library/Security/Permissions/Controls/ModulePermissionsGrid.cs +++ b/DNN Platform/Library/Security/Permissions/Controls/ModulePermissionsGrid.cs @@ -35,7 +35,7 @@ public class ModulePermissionsGrid : PermissionsGrid public ModulePermissionsGrid() { - TabId = -1; + this.TabId = -1; } #endregion @@ -46,11 +46,11 @@ protected override List PermissionsList { get { - if (_PermissionsList == null && _ModulePermissions != null) + if (this._PermissionsList == null && this._ModulePermissions != null) { - _PermissionsList = _ModulePermissions.ToList(); + this._PermissionsList = this._ModulePermissions.ToList(); } - return _PermissionsList; + return this._PermissionsList; } } @@ -67,12 +67,12 @@ public bool InheritViewPermissionsFromTab { get { - return _InheritViewPermissionsFromTab; + return this._InheritViewPermissionsFromTab; } set { - _InheritViewPermissionsFromTab = value; - _PermissionsList = null; + this._InheritViewPermissionsFromTab = value; + this._PermissionsList = null; } } @@ -85,14 +85,14 @@ public int ModuleID { get { - return _ModuleID; + return this._ModuleID; } set { - _ModuleID = value; - if (!Page.IsPostBack) + this._ModuleID = value; + if (!this.Page.IsPostBack) { - GetModulePermissions(); + this.GetModulePermissions(); } } } @@ -114,10 +114,10 @@ public ModulePermissionCollection Permissions get { //First Update Permissions in case they have been changed - UpdatePermissions(); + this.UpdatePermissions(); //Return the ModulePermissions - return _ModulePermissions; + return this._ModulePermissions; } } @@ -138,8 +138,8 @@ private bool IsImplicitRole(int portalId, int roleId) /// ----------------------------------------------------------------------------- private void GetModulePermissions() { - _ModulePermissions = new ModulePermissionCollection(ModulePermissionController.GetModulePermissions(ModuleID, TabId)); - _PermissionsList = null; + this._ModulePermissions = new ModulePermissionCollection(ModulePermissionController.GetModulePermissions(this.ModuleID, this.TabId)); + this._PermissionsList = null; } /// ----------------------------------------------------------------------------- @@ -162,7 +162,7 @@ private ModulePermissionInfo ParseKeys(string[] Settings) { objModulePermission.ModulePermissionID = Convert.ToInt32(Settings[2]); } - objModulePermission.ModuleID = ModuleID; + objModulePermission.ModuleID = this.ModuleID; return objModulePermission; } @@ -174,7 +174,7 @@ private void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventA if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.SelectedItem) { var roleID = Int32.Parse(((DataRowView)item.DataItem)[0].ToString()); - if (IsImplicitRole(PortalSettings.Current.PortalId, roleID)) + if (this.IsImplicitRole(PortalSettings.Current.PortalId, roleID)) { var actionImage = item.Controls.Cast().Last().Controls[0] as ImageButton; if (actionImage != null) @@ -193,7 +193,7 @@ private void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventA protected override void CreateChildControls() { base.CreateChildControls(); - rolePermissionsGrid.ItemDataBound += rolePermissionsGrid_ItemDataBound; + this.rolePermissionsGrid.ItemDataBound += this.rolePermissionsGrid_ItemDataBound; } /// ----------------------------------------------------------------------------- @@ -205,7 +205,7 @@ protected override void CreateChildControls() /// ----------------------------------------------------------------------------- protected override void AddPermission(ArrayList permissions, UserInfo user) { - bool isMatch = _ModulePermissions.Cast() + bool isMatch = this._ModulePermissions.Cast() .Any(objModulePermission => objModulePermission.UserID == user.UserID); //user not found so add new @@ -215,7 +215,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) { if (objPermission.PermissionKey == "VIEW") { - AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); + this.AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); } } } @@ -232,7 +232,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) { //Search TabPermission Collection for the user if ( - _ModulePermissions.Cast().Any(p => p.RoleID == role.RoleID)) + this._ModulePermissions.Cast().Any(p => p.RoleID == role.RoleID)) { return; } @@ -242,7 +242,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) { if (objPermission.PermissionKey == "VIEW") { - AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); + this.AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); } } } @@ -251,22 +251,22 @@ protected override void AddPermission(PermissionInfo permission, int roleId, str { var objPermission = new ModulePermissionInfo(permission) { - ModuleID = ModuleID, + ModuleID = this.ModuleID, RoleID = roleId, RoleName = roleName, AllowAccess = allowAccess, UserID = userId, DisplayName = displayName }; - _ModulePermissions.Add(objPermission, true); + this._ModulePermissions.Add(objPermission, true); //Clear Permission List - _PermissionsList = null; + this._PermissionsList = null; } protected override void UpdatePermission(PermissionInfo permission, int roleId, string roleName, string stateKey) { - if (InheritViewPermissionsFromTab && permission.PermissionKey == "VIEW") + if (this.InheritViewPermissionsFromTab && permission.PermissionKey == "VIEW") { return; } @@ -275,7 +275,7 @@ protected override void UpdatePermission(PermissionInfo permission, int roleId, protected override void UpdatePermission(PermissionInfo permission, string displayName, int userId, string stateKey) { - if (InheritViewPermissionsFromTab && permission.PermissionKey == "VIEW") + if (this.InheritViewPermissionsFromTab && permission.PermissionKey == "VIEW") { return; } @@ -293,13 +293,13 @@ protected override void UpdatePermission(PermissionInfo permission, string displ protected override bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int column) { bool enabled; - if (InheritViewPermissionsFromTab && column == _ViewColumnIndex) + if (this.InheritViewPermissionsFromTab && column == this._ViewColumnIndex) { enabled = false; } else { - enabled = !IsImplicitRole(role.PortalID, role.RoleID); + enabled = !this.IsImplicitRole(role.PortalID, role.RoleID); } return enabled; } @@ -315,7 +315,7 @@ protected override bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int co protected override bool GetEnabled(PermissionInfo objPerm, UserInfo user, int column) { bool enabled; - if (InheritViewPermissionsFromTab && column == _ViewColumnIndex) + if (this.InheritViewPermissionsFromTab && column == this._ViewColumnIndex) { enabled = false; } @@ -339,13 +339,13 @@ protected override bool GetEnabled(PermissionInfo objPerm, UserInfo user, int co protected override string GetPermission(PermissionInfo objPerm, RoleInfo role, int column, string defaultState) { string permission; - if (InheritViewPermissionsFromTab && column == _ViewColumnIndex) + if (this.InheritViewPermissionsFromTab && column == this._ViewColumnIndex) { permission = PermissionTypeNull; } else { - permission = role.RoleID == AdministratorRoleId + permission = role.RoleID == this.AdministratorRoleId ? PermissionTypeGrant : base.GetPermission(objPerm, role, column, defaultState); } @@ -365,7 +365,7 @@ protected override string GetPermission(PermissionInfo objPerm, RoleInfo role, i protected override string GetPermission(PermissionInfo objPerm, UserInfo user, int column, string defaultState) { string permission; - if (InheritViewPermissionsFromTab && column == _ViewColumnIndex) + if (this.InheritViewPermissionsFromTab && column == this._ViewColumnIndex) { permission = PermissionTypeNull; } @@ -384,10 +384,10 @@ protected override string GetPermission(PermissionInfo objPerm, UserInfo user, i /// ----------------------------------------------------------------------------- protected override ArrayList GetPermissions() { - var moduleInfo = ModuleController.Instance.GetModule(ModuleID, TabId, false); + var moduleInfo = ModuleController.Instance.GetModule(this.ModuleID, this.TabId, false); var permissionController = new PermissionController(); - var permissions = permissionController.GetPermissionsByModule(ModuleID, TabId); + var permissions = permissionController.GetPermissionsByModule(this.ModuleID, this.TabId); var permissionList = new ArrayList(); for (int i = 0; i <= permissions.Count - 1; i++) @@ -395,7 +395,7 @@ protected override ArrayList GetPermissions() var permission = (PermissionInfo)permissions[i]; if (permission.PermissionKey == "VIEW") { - _ViewColumnIndex = i + 1; + this._ViewColumnIndex = i + 1; permissionList.Add(permission); } else @@ -441,25 +441,25 @@ protected override void LoadViewState(object savedState) //Load ModuleID if (myState[1] != null) { - ModuleID = Convert.ToInt32(myState[1]); + this.ModuleID = Convert.ToInt32(myState[1]); } //Load TabId if (myState[2] != null) { - TabId = Convert.ToInt32(myState[2]); + this.TabId = Convert.ToInt32(myState[2]); } //Load InheritViewPermissionsFromTab if (myState[3] != null) { - InheritViewPermissionsFromTab = Convert.ToBoolean(myState[3]); + this.InheritViewPermissionsFromTab = Convert.ToBoolean(myState[3]); } //Load ModulePermissions if (myState[4] != null) { - _ModulePermissions = new ModulePermissionCollection(); + this._ModulePermissions = new ModulePermissionCollection(); string state = Convert.ToString(myState[4]); if (!String.IsNullOrEmpty(state)) { @@ -468,7 +468,7 @@ protected override void LoadViewState(object savedState) foreach (string key in permissionKeys) { string[] Settings = key.Split('|'); - _ModulePermissions.Add(ParseKeys(Settings)); + this._ModulePermissions.Add(this.ParseKeys(Settings)); } } } @@ -477,9 +477,9 @@ protected override void LoadViewState(object savedState) protected override void RemovePermission(int permissionID, int roleID, int userID) { - _ModulePermissions.Remove(permissionID, roleID, userID); + this._ModulePermissions.Remove(permissionID, roleID, userID); //Clear Permission List - _PermissionsList = null; + this._PermissionsList = null; } /// ----------------------------------------------------------------------------- @@ -495,20 +495,20 @@ protected override object SaveViewState() allStates[0] = base.SaveViewState(); //Save the ModuleID - allStates[1] = ModuleID; + allStates[1] = this.ModuleID; //Save the TabID - allStates[2] = TabId; + allStates[2] = this.TabId; //Save the InheritViewPermissionsFromTab - allStates[3] = InheritViewPermissionsFromTab; + allStates[3] = this.InheritViewPermissionsFromTab; //Persist the ModulePermissions var sb = new StringBuilder(); - if (_ModulePermissions != null) + if (this._ModulePermissions != null) { bool addDelimiter = false; - foreach (ModulePermissionInfo modulePermission in _ModulePermissions) + foreach (ModulePermissionInfo modulePermission in this._ModulePermissions) { if (addDelimiter) { @@ -518,7 +518,7 @@ protected override object SaveViewState() { addDelimiter = true; } - sb.Append(BuildKey(modulePermission.AllowAccess, + sb.Append(this.BuildKey(modulePermission.AllowAccess, modulePermission.PermissionID, modulePermission.ModulePermissionID, modulePermission.RoleID, diff --git a/DNN Platform/Library/Security/Permissions/Controls/PermissionsGrid.cs b/DNN Platform/Library/Security/Permissions/Controls/PermissionsGrid.cs index 79b30f3e7bc..2795bd38670 100644 --- a/DNN Platform/Library/Security/Permissions/Controls/PermissionsGrid.cs +++ b/DNN Platform/Library/Security/Permissions/Controls/PermissionsGrid.cs @@ -63,8 +63,8 @@ public abstract class PermissionsGrid : Control, INamingContainer #region Constructor public PermissionsGrid() { - dtUserPermissions = new DataTable(); - dtRolePermissions = new DataTable(); + this.dtUserPermissions = new DataTable(); + this.dtRolePermissions = new DataTable(); } #endregion @@ -73,7 +73,7 @@ public PermissionsGrid() private int unAuthUsersRoleId = Int32.Parse(Globals.glbRoleUnauthUser); private int UnAuthUsersRoleId { - get { return unAuthUsersRoleId; } + get { return this.unAuthUsersRoleId; } } private int allUsersRoleId = Int32.Parse(Globals.glbRoleAllUsers); @@ -81,7 +81,7 @@ private int AllUsersRoleId { get { - return allUsersRoleId; + return this.allUsersRoleId; } } #endregion @@ -117,7 +117,7 @@ protected virtual bool RefreshGrid /// public void RegisterScriptsForAjaxPanel() { - PermissionTriState.RegisterScripts(Page, this); + PermissionTriState.RegisterScripts(this.Page, this); } #region "DataGrid Properties" @@ -126,7 +126,7 @@ public TableItemStyle AlternatingItemStyle { get { - return rolePermissionsGrid.AlternatingItemStyle; + return this.rolePermissionsGrid.AlternatingItemStyle; } } @@ -134,12 +134,12 @@ public bool AutoGenerateColumns { get { - return rolePermissionsGrid.AutoGenerateColumns; + return this.rolePermissionsGrid.AutoGenerateColumns; } set { - rolePermissionsGrid.AutoGenerateColumns = value; - userPermissionsGrid.AutoGenerateColumns = value; + this.rolePermissionsGrid.AutoGenerateColumns = value; + this.userPermissionsGrid.AutoGenerateColumns = value; } } @@ -147,12 +147,12 @@ public int CellSpacing { get { - return rolePermissionsGrid.CellSpacing; + return this.rolePermissionsGrid.CellSpacing; } set { - rolePermissionsGrid.CellSpacing = value; - userPermissionsGrid.CellSpacing = value; + this.rolePermissionsGrid.CellSpacing = value; + this.userPermissionsGrid.CellSpacing = value; } } @@ -160,7 +160,7 @@ public DataGridColumnCollection Columns { get { - return rolePermissionsGrid.Columns; + return this.rolePermissionsGrid.Columns; } } @@ -168,7 +168,7 @@ public TableItemStyle FooterStyle { get { - return rolePermissionsGrid.FooterStyle; + return this.rolePermissionsGrid.FooterStyle; } } @@ -176,12 +176,12 @@ public GridLines GridLines { get { - return rolePermissionsGrid.GridLines; + return this.rolePermissionsGrid.GridLines; } set { - rolePermissionsGrid.GridLines = value; - userPermissionsGrid.GridLines = value; + this.rolePermissionsGrid.GridLines = value; + this.userPermissionsGrid.GridLines = value; } } @@ -189,7 +189,7 @@ public TableItemStyle HeaderStyle { get { - return rolePermissionsGrid.HeaderStyle; + return this.rolePermissionsGrid.HeaderStyle; } } @@ -197,7 +197,7 @@ public TableItemStyle ItemStyle { get { - return rolePermissionsGrid.ItemStyle; + return this.rolePermissionsGrid.ItemStyle; } } @@ -205,7 +205,7 @@ public DataGridItemCollection Items { get { - return rolePermissionsGrid.Items; + return this.rolePermissionsGrid.Items; } } @@ -213,7 +213,7 @@ public TableItemStyle SelectedItemStyle { get { - return rolePermissionsGrid.SelectedItemStyle; + return this.rolePermissionsGrid.SelectedItemStyle; } } @@ -248,11 +248,11 @@ public bool DynamicColumnAdded { get { - return ViewState["ColumnAdded"] != null; + return this.ViewState["ColumnAdded"] != null; } set { - ViewState["ColumnAdded"] = value; + this.ViewState["ColumnAdded"] = value; } } @@ -313,54 +313,54 @@ public int PortalId private void BindData() { - EnsureChildControls(); - BindRolesGrid(); - BindUsersGrid(); + this.EnsureChildControls(); + this.BindRolesGrid(); + this.BindUsersGrid(); } private void BindRolesGrid() { - dtRolePermissions.Columns.Clear(); - dtRolePermissions.Rows.Clear(); + this.dtRolePermissions.Columns.Clear(); + this.dtRolePermissions.Rows.Clear(); //Add Roles Column - dtRolePermissions.Columns.Add(new DataColumn("RoleId")); + this.dtRolePermissions.Columns.Add(new DataColumn("RoleId")); //Add Roles Column - dtRolePermissions.Columns.Add(new DataColumn("RoleName")); + this.dtRolePermissions.Columns.Add(new DataColumn("RoleName")); - for (int i = 0; i <= _permissions.Count - 1; i++) + for (int i = 0; i <= this._permissions.Count - 1; i++) { - var permissionInfo = (PermissionInfo)_permissions[i]; + var permissionInfo = (PermissionInfo)this._permissions[i]; //Add Enabled Column - dtRolePermissions.Columns.Add(new DataColumn(permissionInfo.PermissionName + "_Enabled")); + this.dtRolePermissions.Columns.Add(new DataColumn(permissionInfo.PermissionName + "_Enabled")); //Add Permission Column - dtRolePermissions.Columns.Add(new DataColumn(permissionInfo.PermissionName)); + this.dtRolePermissions.Columns.Add(new DataColumn(permissionInfo.PermissionName)); } - GetRoles(); + this.GetRoles(); - UpdateRolePermissions(); - for (int i = 0; i <= Roles.Count - 1; i++) + this.UpdateRolePermissions(); + for (int i = 0; i <= this.Roles.Count - 1; i++) { - var role = (RoleInfo)Roles[i]; - var row = dtRolePermissions.NewRow(); + var role = (RoleInfo)this.Roles[i]; + var row = this.dtRolePermissions.NewRow(); row["RoleId"] = role.RoleID; row["RoleName"] = Localization.LocalizeRole(role.RoleName); int j; - for (j = 0; j <= _permissions.Count - 1; j++) + for (j = 0; j <= this._permissions.Count - 1; j++) { PermissionInfo objPerm; - objPerm = (PermissionInfo)_permissions[j]; - row[objPerm.PermissionName + "_Enabled"] = GetEnabled(objPerm, role, j + 1); - if (SupportsDenyPermissions(objPerm)) + objPerm = (PermissionInfo)this._permissions[j]; + row[objPerm.PermissionName + "_Enabled"] = this.GetEnabled(objPerm, role, j + 1); + if (this.SupportsDenyPermissions(objPerm)) { - row[objPerm.PermissionName] = GetPermission(objPerm, role, j + 1, PermissionTypeNull); + row[objPerm.PermissionName] = this.GetPermission(objPerm, role, j + 1, PermissionTypeNull); } else { - if (GetPermission(objPerm, role, j + 1)) + if (this.GetPermission(objPerm, role, j + 1)) { row[objPerm.PermissionName] = PermissionTypeGrant; } @@ -370,65 +370,65 @@ private void BindRolesGrid() } } } - dtRolePermissions.Rows.Add(row); + this.dtRolePermissions.Rows.Add(row); } - rolePermissionsGrid.DataSource = dtRolePermissions; - rolePermissionsGrid.DataBind(); + this.rolePermissionsGrid.DataSource = this.dtRolePermissions; + this.rolePermissionsGrid.DataBind(); } private void BindUsersGrid() { - dtUserPermissions.Columns.Clear(); - dtUserPermissions.Rows.Clear(); + this.dtUserPermissions.Columns.Clear(); + this.dtUserPermissions.Rows.Clear(); //Add Roles Column var col = new DataColumn("UserId"); - dtUserPermissions.Columns.Add(col); + this.dtUserPermissions.Columns.Add(col); //Add Roles Column col = new DataColumn("DisplayName"); - dtUserPermissions.Columns.Add(col); + this.dtUserPermissions.Columns.Add(col); int i; - for (i = 0; i <= _permissions.Count - 1; i++) + for (i = 0; i <= this._permissions.Count - 1; i++) { PermissionInfo objPerm; - objPerm = (PermissionInfo)_permissions[i]; + objPerm = (PermissionInfo)this._permissions[i]; //Add Enabled Column col = new DataColumn(objPerm.PermissionName + "_Enabled"); - dtUserPermissions.Columns.Add(col); + this.dtUserPermissions.Columns.Add(col); //Add Permission Column col = new DataColumn(objPerm.PermissionName); - dtUserPermissions.Columns.Add(col); + this.dtUserPermissions.Columns.Add(col); } - if (userPermissionsGrid != null) + if (this.userPermissionsGrid != null) { - _users = GetUsers(); + this._users = this.GetUsers(); - if (_users.Count != 0) + if (this._users.Count != 0) { - userPermissionsGrid.Visible = true; + this.userPermissionsGrid.Visible = true; DataRow row; - for (i = 0; i <= _users.Count - 1; i++) + for (i = 0; i <= this._users.Count - 1; i++) { - var user = (UserInfo)_users[i]; - row = dtUserPermissions.NewRow(); + var user = (UserInfo)this._users[i]; + row = this.dtUserPermissions.NewRow(); row["UserId"] = user.UserID; row["DisplayName"] = user.DisplayName; int j; - for (j = 0; j <= _permissions.Count - 1; j++) + for (j = 0; j <= this._permissions.Count - 1; j++) { PermissionInfo objPerm; - objPerm = (PermissionInfo)_permissions[j]; - row[objPerm.PermissionName + "_Enabled"] = GetEnabled(objPerm, user, j + 1); - if (SupportsDenyPermissions(objPerm)) + objPerm = (PermissionInfo)this._permissions[j]; + row[objPerm.PermissionName + "_Enabled"] = this.GetEnabled(objPerm, user, j + 1); + if (this.SupportsDenyPermissions(objPerm)) { - row[objPerm.PermissionName] = GetPermission(objPerm, user, j + 1, PermissionTypeNull); + row[objPerm.PermissionName] = this.GetPermission(objPerm, user, j + 1, PermissionTypeNull); } else { - if (GetPermission(objPerm, user, j + 1)) + if (this.GetPermission(objPerm, user, j + 1)) { row[objPerm.PermissionName] = PermissionTypeGrant; } @@ -438,62 +438,62 @@ private void BindUsersGrid() } } } - dtUserPermissions.Rows.Add(row); + this.dtUserPermissions.Rows.Add(row); } - userPermissionsGrid.DataSource = dtUserPermissions; - userPermissionsGrid.DataBind(); + this.userPermissionsGrid.DataSource = this.dtUserPermissions; + this.userPermissionsGrid.DataBind(); } else { - dtUserPermissions.Rows.Clear(); - userPermissionsGrid.DataSource = dtUserPermissions; - userPermissionsGrid.DataBind(); - userPermissionsGrid.Visible = false; + this.dtUserPermissions.Rows.Clear(); + this.userPermissionsGrid.DataSource = this.dtUserPermissions; + this.userPermissionsGrid.DataBind(); + this.userPermissionsGrid.Visible = false; } } } private void EnsureRole(RoleInfo role) { - if (Roles.Cast().All(r => r.RoleID != role.RoleID)) + if (this.Roles.Cast().All(r => r.RoleID != role.RoleID)) { - Roles.Add(role); + this.Roles.Add(role); } } private void GetRoles() { - var checkedRoles = GetCheckedRoles(); + var checkedRoles = this.GetCheckedRoles(); var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - Roles = new ArrayList(RoleController.Instance.GetRoles(portalSettings.PortalId, r => r.SecurityMode != SecurityMode.SocialGroup && r.Status == RoleStatus.Approved && checkedRoles.Contains(r.RoleID)).ToArray()); + this.Roles = new ArrayList(RoleController.Instance.GetRoles(portalSettings.PortalId, r => r.SecurityMode != SecurityMode.SocialGroup && r.Status == RoleStatus.Approved && checkedRoles.Contains(r.RoleID)).ToArray()); - if (checkedRoles.Contains(UnAuthUsersRoleId)) + if (checkedRoles.Contains(this.UnAuthUsersRoleId)) { - Roles.Add(new RoleInfo { RoleID = UnAuthUsersRoleId, RoleName = Globals.glbRoleUnauthUserName }); + this.Roles.Add(new RoleInfo { RoleID = this.UnAuthUsersRoleId, RoleName = Globals.glbRoleUnauthUserName }); } - if (checkedRoles.Contains(AllUsersRoleId)) + if (checkedRoles.Contains(this.AllUsersRoleId)) { - Roles.Add(new RoleInfo { RoleID = AllUsersRoleId, PortalID = portalSettings.PortalId, RoleName=Globals.glbRoleAllUsersName }); + this.Roles.Add(new RoleInfo { RoleID = this.AllUsersRoleId, PortalID = portalSettings.PortalId, RoleName=Globals.glbRoleAllUsersName }); } //Administrators Role always has implicit permissions, then it should be always in - EnsureRole(RoleController.Instance.GetRoleById(portalSettings.PortalId, portalSettings.AdministratorRoleId)); + this.EnsureRole(RoleController.Instance.GetRoleById(portalSettings.PortalId, portalSettings.AdministratorRoleId)); //Show also default roles - EnsureRole(RoleController.Instance.GetRoleById(portalSettings.PortalId, portalSettings.RegisteredRoleId)); - EnsureRole(new RoleInfo { RoleID = AllUsersRoleId, PortalID = portalSettings.PortalId, RoleName = Globals.glbRoleAllUsersName }); + this.EnsureRole(RoleController.Instance.GetRoleById(portalSettings.PortalId, portalSettings.RegisteredRoleId)); + this.EnsureRole(new RoleInfo { RoleID = this.AllUsersRoleId, PortalID = portalSettings.PortalId, RoleName = Globals.glbRoleAllUsersName }); - Roles.Reverse(); - Roles.Sort(new RoleComparer()); + this.Roles.Reverse(); + this.Roles.Sort(new RoleComparer()); } private IEnumerable GetCheckedRoles() { - if (PermissionsList == null) + if (this.PermissionsList == null) { return new List(); } - return PermissionsList.Select(r => r.RoleID).Distinct(); + return this.PermissionsList.Select(r => r.RoleID).Distinct(); } private void SetUpGrid(DataGrid grid, string nameColumnDataField, string idColumnDataField, string permissionHeaderText) @@ -516,19 +516,19 @@ private void SetUpGrid(DataGrid grid, string nameColumnDataField, string idColum }; grid.Columns.Add(idColumn); - foreach (PermissionInfo permission in _permissions) + foreach (PermissionInfo permission in this._permissions) { var templateCol = new TemplateColumn(); var columnTemplate = new PermissionTriStateTemplate(permission) { - IsFullControl = IsFullControl(permission), - IsView = IsViewPermisison(permission), - SupportDenyMode = SupportsDenyPermissions(permission) + IsFullControl = this.IsFullControl(permission), + IsView = this.IsViewPermisison(permission), + SupportDenyMode = this.SupportsDenyPermissions(permission) }; templateCol.ItemTemplate = columnTemplate; var locName = (permission.ModuleDefID <= 0) ? Localization.GetString(permission.PermissionName + ".Permission", PermissionProvider.Instance().LocalResourceFile) //system permission - : (!String.IsNullOrEmpty(ResourceFile) ? Localization.GetString(permission.PermissionName + ".Permission", ResourceFile) //custom permission + : (!String.IsNullOrEmpty(this.ResourceFile) ? Localization.GetString(permission.PermissionName + ".Permission", this.ResourceFile) //custom permission : ""); templateCol.HeaderText = !String.IsNullOrEmpty(locName) ? locName : permission.PermissionName; templateCol.HeaderStyle.Wrap = true; @@ -544,26 +544,26 @@ private void SetUpGrid(DataGrid grid, string nameColumnDataField, string idColum HeaderText = Localization.GetString("PermissionActionsHeader.Text", PermissionProvider.Instance().LocalResourceFile) }; grid.Columns.Add(actionsColumn); - grid.ItemCommand += grid_ItemCommand; + grid.ItemCommand += this.grid_ItemCommand; } void grid_ItemCommand(object source, DataGridCommandEventArgs e) { var entityID = int.Parse(e.CommandArgument.ToString()); - var command = GetGridCommand(e.CommandName); - var entityType = GetCommandType(e.CommandName); + var command = this.GetGridCommand(e.CommandName); + var entityType = this.GetCommandType(e.CommandName); switch (command) { case "DELETE": if (entityType == "ROLE") { - DeleteRolePermissions(entityID); + this.DeleteRolePermissions(entityID); } else if (entityType == "USER") { - DeleteUserPermissions(entityID); + this.DeleteUserPermissions(entityID); } - BindData(); + this.BindData(); break; } } @@ -571,18 +571,18 @@ void grid_ItemCommand(object source, DataGridCommandEventArgs e) private void DeleteRolePermissions(int entityID) { //PermissionsList.RemoveAll(p => p.RoleID == entityID); - var permissionToDelete = PermissionsList.Where(p => p.RoleID == entityID); + var permissionToDelete = this.PermissionsList.Where(p => p.RoleID == entityID); foreach (PermissionInfoBase permission in permissionToDelete) { - RemovePermission(permission.PermissionID, entityID, permission.UserID); + this.RemovePermission(permission.PermissionID, entityID, permission.UserID); } } private void DeleteUserPermissions(int entityID) { - var permissionToDelete = PermissionsList.Where(p => p.UserID == entityID); + var permissionToDelete = this.PermissionsList.Where(p => p.UserID == entityID); foreach (PermissionInfoBase permission in permissionToDelete) { - RemovePermission(permission.PermissionID, permission.RoleID, entityID); + this.RemovePermission(permission.PermissionID, permission.RoleID, entityID); } } @@ -608,50 +608,50 @@ private string GetGridCommand(string commandName) private void SetUpRolesGrid() { - SetUpGrid(rolePermissionsGrid, "RoleName", "roleid", Localization.GetString("PermissionRoleHeader.Text", PermissionProvider.Instance().LocalResourceFile)); + this.SetUpGrid(this.rolePermissionsGrid, "RoleName", "roleid", Localization.GetString("PermissionRoleHeader.Text", PermissionProvider.Instance().LocalResourceFile)); } private void SetUpUsersGrid() { - if (userPermissionsGrid != null) + if (this.userPermissionsGrid != null) { - SetUpGrid(userPermissionsGrid, "DisplayName", "userid", Localization.GetString("PermissionUserHeader.Text", PermissionProvider.Instance().LocalResourceFile)); + this.SetUpGrid(this.userPermissionsGrid, "DisplayName", "userid", Localization.GetString("PermissionUserHeader.Text", PermissionProvider.Instance().LocalResourceFile)); } } private void FillSelectRoleComboBox(int selectedRoleGroupId) { - cboSelectRole.Items.Clear(); + this.cboSelectRole.Items.Clear(); var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var groupRoles = (selectedRoleGroupId > -2) ? RoleController.Instance.GetRoles(portalSettings.PortalId, r => r.RoleGroupID == selectedRoleGroupId && r.SecurityMode != SecurityMode.SocialGroup && r.Status == RoleStatus.Approved) : RoleController.Instance.GetRoles(portalSettings.PortalId, r => r.SecurityMode != SecurityMode.SocialGroup && r.Status == RoleStatus.Approved); if (selectedRoleGroupId < 0) { - groupRoles.Add(new RoleInfo { RoleID = UnAuthUsersRoleId, RoleName = Globals.glbRoleUnauthUserName }); - groupRoles.Add(new RoleInfo { RoleID = AllUsersRoleId, RoleName = Globals.glbRoleAllUsersName }); + groupRoles.Add(new RoleInfo { RoleID = this.UnAuthUsersRoleId, RoleName = Globals.glbRoleUnauthUserName }); + groupRoles.Add(new RoleInfo { RoleID = this.AllUsersRoleId, RoleName = Globals.glbRoleAllUsersName }); } foreach (var role in groupRoles.OrderBy( r => r.RoleName)) { - cboSelectRole.Items.Add(new ListItem(role.RoleName, role.RoleID.ToString(CultureInfo.InvariantCulture))); + this.cboSelectRole.Items.Add(new ListItem(role.RoleName, role.RoleID.ToString(CultureInfo.InvariantCulture))); } - int[] defaultRoleIds = {AllUsersRoleId, portalSettings.RegisteredRoleId, portalSettings.AdministratorRoleId}; - var itemToSelect = cboSelectRole.Items.Cast().FirstOrDefault(i => !defaultRoleIds.Contains(int.Parse(i.Value))); + int[] defaultRoleIds = {this.AllUsersRoleId, portalSettings.RegisteredRoleId, portalSettings.AdministratorRoleId}; + var itemToSelect = this.cboSelectRole.Items.Cast().FirstOrDefault(i => !defaultRoleIds.Contains(int.Parse(i.Value))); if (itemToSelect != null) { - cboSelectRole.SelectedValue = itemToSelect.Value; + this.cboSelectRole.SelectedValue = itemToSelect.Value; } } private void SetErrorMessage(string errorKey) { - lblErrorMessage = new Label + this.lblErrorMessage = new Label { //TODO Remove DEBUG test Text = "
    " + (errorKey.StartsWith("DEBUG")? errorKey: Localization.GetString(errorKey)), CssClass = "NormalRed" }; - pnlPermissions.Controls.Add(lblErrorMessage); + this.pnlPermissions.Controls.Add(this.lblErrorMessage); } #endregion @@ -690,7 +690,7 @@ protected virtual void AddPermission(ArrayList permissions, RoleInfo role) /// The role name protected string BuildKey(bool allowAccess, int permissionId, int objectPermissionId, int roleId, string roleName) { - return BuildKey(allowAccess, permissionId, objectPermissionId, roleId, roleName, Null.NullInteger, Null.NullString); + return this.BuildKey(allowAccess, permissionId, objectPermissionId, roleId, roleName, Null.NullInteger, Null.NullString); } /// @@ -733,14 +733,14 @@ protected string BuildKey(bool allowAccess, int permissionId, int objectPermissi /// protected override void CreateChildControls() { - _permissions = GetPermissions(); + this._permissions = this.GetPermissions(); - pnlPermissions = new Panel { CssClass = "dnnGrid dnnPermissionsGrid" }; + this.pnlPermissions = new Panel { CssClass = "dnnGrid dnnPermissionsGrid" }; //Optionally Add Role Group Filter - CreateAddRoleControls(); + this.CreateAddRoleControls(); - rolePermissionsGrid = new DataGrid + this.rolePermissionsGrid = new DataGrid { AutoGenerateColumns = false, CellSpacing = 0, @@ -748,51 +748,51 @@ protected override void CreateChildControls() GridLines = GridLines.None, CssClass = "dnnPermissionsGrid" }; - rolePermissionsGrid.FooterStyle.CssClass = "dnnGridFooter"; - rolePermissionsGrid.HeaderStyle.CssClass = "dnnGridHeader"; - rolePermissionsGrid.ItemStyle.CssClass = "dnnGridItem"; - rolePermissionsGrid.AlternatingItemStyle.CssClass = "dnnGridAltItem"; - rolePermissionsGrid.ItemDataBound += rolePermissionsGrid_ItemDataBound; - SetUpRolesGrid(); - pnlPermissions.Controls.Add(rolePermissionsGrid); - - _users = GetUsers(); - if (_users != null) + this.rolePermissionsGrid.FooterStyle.CssClass = "dnnGridFooter"; + this.rolePermissionsGrid.HeaderStyle.CssClass = "dnnGridHeader"; + this.rolePermissionsGrid.ItemStyle.CssClass = "dnnGridItem"; + this.rolePermissionsGrid.AlternatingItemStyle.CssClass = "dnnGridAltItem"; + this.rolePermissionsGrid.ItemDataBound += this.rolePermissionsGrid_ItemDataBound; + this.SetUpRolesGrid(); + this.pnlPermissions.Controls.Add(this.rolePermissionsGrid); + + this._users = this.GetUsers(); + if (this._users != null) { - userPermissionsGrid = new DataGrid + this.userPermissionsGrid = new DataGrid { AutoGenerateColumns = false, CellSpacing = 0, GridLines = GridLines.None, CssClass = "dnnPermissionsGrid" }; - userPermissionsGrid.FooterStyle.CssClass = "dnnGridFooter"; - userPermissionsGrid.HeaderStyle.CssClass = "dnnGridHeader"; - userPermissionsGrid.ItemStyle.CssClass = "dnnGridItem"; - userPermissionsGrid.AlternatingItemStyle.CssClass = "dnnGridAltItem"; + this.userPermissionsGrid.FooterStyle.CssClass = "dnnGridFooter"; + this.userPermissionsGrid.HeaderStyle.CssClass = "dnnGridHeader"; + this.userPermissionsGrid.ItemStyle.CssClass = "dnnGridItem"; + this.userPermissionsGrid.AlternatingItemStyle.CssClass = "dnnGridAltItem"; - SetUpUsersGrid(); - pnlPermissions.Controls.Add(userPermissionsGrid); + this.SetUpUsersGrid(); + this.pnlPermissions.Controls.Add(this.userPermissionsGrid); var divAddUser = new Panel { CssClass = "dnnFormItem" }; - lblErrorMessage = new Label { Text = Localization.GetString("DisplayName") }; - txtUser = new TextBox { ID = "txtUser" }; - lblErrorMessage.AssociatedControlID = txtUser.ID; + this.lblErrorMessage = new Label { Text = Localization.GetString("DisplayName") }; + this.txtUser = new TextBox { ID = "txtUser" }; + this.lblErrorMessage.AssociatedControlID = this.txtUser.ID; - hiddenUserIds = new HiddenField { ID = "hiddenUserIds" }; + this.hiddenUserIds = new HiddenField { ID = "hiddenUserIds" }; - divAddUser.Controls.Add(lblErrorMessage); - divAddUser.Controls.Add(txtUser); - divAddUser.Controls.Add(hiddenUserIds); + divAddUser.Controls.Add(this.lblErrorMessage); + divAddUser.Controls.Add(this.txtUser); + divAddUser.Controls.Add(this.hiddenUserIds); - cmdUser = new LinkButton { Text = Localization.GetString("Add"), CssClass = "dnnSecondaryAction" }; - divAddUser.Controls.Add(cmdUser); - cmdUser.Click += AddUser; + this.cmdUser = new LinkButton { Text = Localization.GetString("Add"), CssClass = "dnnSecondaryAction" }; + divAddUser.Controls.Add(this.cmdUser); + this.cmdUser.Click += this.AddUser; - pnlPermissions.Controls.Add(divAddUser); + this.pnlPermissions.Controls.Add(divAddUser); } - Controls.Add(pnlPermissions); + this.Controls.Add(this.pnlPermissions); } void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventArgs e) @@ -802,7 +802,7 @@ void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventArgs e) if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.SelectedItem) { var roleID = Int32.Parse(((DataRowView)item.DataItem)[0].ToString()); - if (roleID == PortalSettings.Current.AdministratorRoleId || roleID == AllUsersRoleId || roleID == PortalSettings.Current.RegisteredRoleId) + if (roleID == PortalSettings.Current.AdministratorRoleId || roleID == this.AllUsersRoleId || roleID == PortalSettings.Current.RegisteredRoleId) { var actionImage = item.Controls.Cast().Last().Controls[0] as ImageButton; if (actionImage != null) @@ -822,39 +822,39 @@ private void CreateAddRoleControls() var divRoleGroups = new Panel {CssClass = "leftGroup"}; var divSelectRole = new Panel { CssClass = "rightGroup" }; - lblGroups = new Label {Text = Localization.GetString("RoleGroupFilter")}; - cboRoleGroups = new DropDownList { AutoPostBack = true, ID = "cboRoleGroups", ViewStateMode = ViewStateMode.Disabled }; - lblGroups.AssociatedControlID = cboRoleGroups.ID; - divRoleGroups.Controls.Add(lblGroups); + this.lblGroups = new Label {Text = Localization.GetString("RoleGroupFilter")}; + this.cboRoleGroups = new DropDownList { AutoPostBack = true, ID = "cboRoleGroups", ViewStateMode = ViewStateMode.Disabled }; + this.lblGroups.AssociatedControlID = this.cboRoleGroups.ID; + divRoleGroups.Controls.Add(this.lblGroups); - cboRoleGroups.SelectedIndexChanged += RoleGroupsSelectedIndexChanged; - cboRoleGroups.Items.Add(new ListItem(Localization.GetString("AllRoles"), "-2")); + this.cboRoleGroups.SelectedIndexChanged += this.RoleGroupsSelectedIndexChanged; + this.cboRoleGroups.Items.Add(new ListItem(Localization.GetString("AllRoles"), "-2")); var liItem = new ListItem(Localization.GetString("GlobalRoles"), "-1") {Selected = true}; - cboRoleGroups.Items.Add(liItem); + this.cboRoleGroups.Items.Add(liItem); foreach (RoleGroupInfo roleGroup in arrGroups) { - cboRoleGroups.Items.Add(new ListItem(roleGroup.RoleGroupName, roleGroup.RoleGroupID.ToString(CultureInfo.InvariantCulture))); + this.cboRoleGroups.Items.Add(new ListItem(roleGroup.RoleGroupName, roleGroup.RoleGroupID.ToString(CultureInfo.InvariantCulture))); } - divRoleGroups.Controls.Add(cboRoleGroups); + divRoleGroups.Controls.Add(this.cboRoleGroups); addRoleControls.Controls.Add(divRoleGroups); - lblSelectRole = new Label { Text = Localization.GetString("RoleSelect") }; - cboSelectRole = new DropDownList { ID = "cboSelectRole", ViewStateMode = ViewStateMode.Disabled }; - lblSelectRole.AssociatedControlID = cboSelectRole.ID; - divSelectRole.Controls.Add(lblSelectRole); + this.lblSelectRole = new Label { Text = Localization.GetString("RoleSelect") }; + this.cboSelectRole = new DropDownList { ID = "cboSelectRole", ViewStateMode = ViewStateMode.Disabled }; + this.lblSelectRole.AssociatedControlID = this.cboSelectRole.ID; + divSelectRole.Controls.Add(this.lblSelectRole); - FillSelectRoleComboBox(-1); //Default Role Group is Global Roles - divSelectRole.Controls.Add(cboSelectRole); + this.FillSelectRoleComboBox(-1); //Default Role Group is Global Roles + divSelectRole.Controls.Add(this.cboSelectRole); - cmdRole = new LinkButton { Text = Localization.GetString("Add"), CssClass = "dnnSecondaryAction" }; - cmdRole.Click += AddRole; - divSelectRole.Controls.Add(cmdRole); - roleField = new HiddenField() {ID = "roleField"}; - addRoleControls.Controls.Add(roleField); + this.cmdRole = new LinkButton { Text = Localization.GetString("Add"), CssClass = "dnnSecondaryAction" }; + this.cmdRole.Click += this.AddRole; + divSelectRole.Controls.Add(this.cmdRole); + this.roleField = new HiddenField() {ID = "roleField"}; + addRoleControls.Controls.Add(this.roleField); addRoleControls.Controls.Add(divSelectRole); - pnlPermissions.Controls.Add(addRoleControls); + this.pnlPermissions.Controls.Add(addRoleControls); } /// @@ -887,7 +887,7 @@ protected virtual bool GetEnabled(PermissionInfo objPerm, UserInfo user, int col /// The column of the Grid protected virtual bool GetPermission(PermissionInfo objPerm, RoleInfo role, int column) { - return Convert.ToBoolean(GetPermission(objPerm, role, column, PermissionTypeDeny)); + return Convert.ToBoolean(this.GetPermission(objPerm, role, column, PermissionTypeDeny)); } /// @@ -900,9 +900,9 @@ protected virtual bool GetPermission(PermissionInfo objPerm, RoleInfo role, int protected virtual string GetPermission(PermissionInfo objPerm, RoleInfo role, int column, string defaultState) { string stateKey = defaultState; - if (PermissionsList != null) + if (this.PermissionsList != null) { - foreach (PermissionInfoBase permission in PermissionsList) + foreach (PermissionInfoBase permission in this.PermissionsList) { if (permission.PermissionID == objPerm.PermissionID && permission.RoleID == role.RoleID) { @@ -929,7 +929,7 @@ protected virtual string GetPermission(PermissionInfo objPerm, RoleInfo role, in /// The column of the Grid protected virtual bool GetPermission(PermissionInfo objPerm, UserInfo user, int column) { - return Convert.ToBoolean(GetPermission(objPerm, user, column, PermissionTypeDeny)); + return Convert.ToBoolean(this.GetPermission(objPerm, user, column, PermissionTypeDeny)); } /// @@ -942,9 +942,9 @@ protected virtual bool GetPermission(PermissionInfo objPerm, UserInfo user, int protected virtual string GetPermission(PermissionInfo objPerm, UserInfo user, int column, string defaultState) { var stateKey = defaultState; - if (PermissionsList != null) + if (this.PermissionsList != null) { - foreach (var permission in PermissionsList) + foreach (var permission in this.PermissionsList) { if (permission.PermissionID == objPerm.PermissionID && permission.UserID == user.UserID) { @@ -978,9 +978,9 @@ protected virtual ArrayList GetUsers() { var arrUsers = new ArrayList(); UserInfo objUser; - if (PermissionsList != null) + if (this.PermissionsList != null) { - foreach (var permission in PermissionsList) + foreach (var permission in this.PermissionsList) { if (!Null.IsNull(permission.UserID)) { @@ -1022,10 +1022,10 @@ protected override void OnInit(EventArgs e) ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/Components/Tokeninput/jquery.tokeninput.js"); - ClientResourceManager.RegisterScript(Page, "~/js/dnn.permissiongrid.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Components/Tokeninput/jquery.tokeninput.js"); + ClientResourceManager.RegisterScript(this.Page, "~/js/dnn.permissiongrid.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/Components/Tokeninput/Themes/token-input-facebook.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/Components/Tokeninput/Themes/token-input-facebook.css", FileOrder.Css.ResourceCss); } /// @@ -1033,17 +1033,17 @@ protected override void OnInit(EventArgs e) /// protected override void OnPreRender(EventArgs e) { - BindData(); + this.BindData(); - var script = "var pgm = new dnn.permissionGridManager('" + ClientID + "');"; - if (ScriptManager.GetCurrent(Page) != null) + var script = "var pgm = new dnn.permissionGridManager('" + this.ClientID + "');"; + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), ClientID + "PermissionGridManager", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), this.ClientID + "PermissionGridManager", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), ClientID + "PermissionGridManager", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID + "PermissionGridManager", script, true); } } @@ -1078,7 +1078,7 @@ protected virtual bool SupportsDenyPermissions(PermissionInfo permissionInfo) /// The value of the permission protected virtual void UpdatePermission(PermissionInfo permission, int roleId, string roleName, bool allowAccess) { - UpdatePermission(permission, roleId, roleName, allowAccess ? PermissionTypeGrant : PermissionTypeNull); + this.UpdatePermission(permission, roleId, roleName, allowAccess ? PermissionTypeGrant : PermissionTypeNull); } /// @@ -1090,14 +1090,14 @@ protected virtual void UpdatePermission(PermissionInfo permission, int roleId, s /// The permission state protected virtual void UpdatePermission(PermissionInfo permission, int roleId, string roleName, string stateKey) { - RemovePermission(permission.PermissionID, roleId, Null.NullInteger); + this.RemovePermission(permission.PermissionID, roleId, Null.NullInteger); switch (stateKey) { case PermissionTypeGrant: - AddPermission(permission, roleId, roleName, Null.NullInteger, Null.NullString, true); + this.AddPermission(permission, roleId, roleName, Null.NullInteger, Null.NullString, true); break; case PermissionTypeDeny: - AddPermission(permission, roleId, roleName, Null.NullInteger, Null.NullString, false); + this.AddPermission(permission, roleId, roleName, Null.NullInteger, Null.NullString, false); break; } } @@ -1111,7 +1111,7 @@ protected virtual void UpdatePermission(PermissionInfo permission, int roleId, s /// The value of the permission protected virtual void UpdatePermission(PermissionInfo permission, string displayName, int userId, bool allowAccess) { - UpdatePermission(permission, displayName, userId, allowAccess ? PermissionTypeGrant : PermissionTypeNull); + this.UpdatePermission(permission, displayName, userId, allowAccess ? PermissionTypeGrant : PermissionTypeNull); } /// @@ -1123,14 +1123,14 @@ protected virtual void UpdatePermission(PermissionInfo permission, string displa /// The permission state protected virtual void UpdatePermission(PermissionInfo permission, string displayName, int userId, string stateKey) { - RemovePermission(permission.PermissionID, int.Parse(Globals.glbRoleNothing), userId); + this.RemovePermission(permission.PermissionID, int.Parse(Globals.glbRoleNothing), userId); switch (stateKey) { case PermissionTypeGrant: - AddPermission(permission, int.Parse(Globals.glbRoleNothing), Null.NullString, userId, displayName, true); + this.AddPermission(permission, int.Parse(Globals.glbRoleNothing), Null.NullString, userId, displayName, true); break; case PermissionTypeDeny: - AddPermission(permission, int.Parse(Globals.glbRoleNothing), Null.NullString, userId, displayName, false); + this.AddPermission(permission, int.Parse(Globals.glbRoleNothing), Null.NullString, userId, displayName, false); break; } } @@ -1139,11 +1139,11 @@ protected virtual void UpdatePermission(PermissionInfo permission, string displa /// protected void UpdatePermissions() { - EnsureChildControls(); - GetRoles(); - UpdateRolePermissions(); - _users = GetUsers(); - UpdateUserPermissions(); + this.EnsureChildControls(); + this.GetRoles(); + this.UpdateRolePermissions(); + this._users = this.GetUsers(); + this.UpdateUserPermissions(); } /// @@ -1151,10 +1151,10 @@ protected void UpdatePermissions() /// protected void UpdateRolePermissions() { - if (rolePermissionsGrid != null && !RefreshGrid) + if (this.rolePermissionsGrid != null && !this.RefreshGrid) { - var rolesList = Roles.Cast().ToList(); - foreach (DataGridItem dgi in rolePermissionsGrid.Items) + var rolesList = this.Roles.Cast().ToList(); + foreach (DataGridItem dgi in this.rolePermissionsGrid.Items) { var roleId = int.Parse(dgi.Cells[1].Text); if (rolesList.All(r => r.RoleID != roleId)) @@ -1166,15 +1166,15 @@ protected void UpdateRolePermissions() //all except first two cells which is role names and role ids and last column is Actions if (dgi.Cells[i].Controls.Count > 0) { - var permissionInfo = (PermissionInfo)_permissions[i - 2]; + var permissionInfo = (PermissionInfo)this._permissions[i - 2]; var triState = (PermissionTriState)dgi.Cells[i].Controls[0]; - if (SupportsDenyPermissions(permissionInfo)) + if (this.SupportsDenyPermissions(permissionInfo)) { - UpdatePermission(permissionInfo, roleId, dgi.Cells[0].Text, triState.Value); + this.UpdatePermission(permissionInfo, roleId, dgi.Cells[0].Text, triState.Value); } else { - UpdatePermission(permissionInfo, roleId, dgi.Cells[0].Text, triState.Value == PermissionTypeGrant); + this.UpdatePermission(permissionInfo, roleId, dgi.Cells[0].Text, triState.Value == PermissionTypeGrant); } } } @@ -1187,10 +1187,10 @@ protected void UpdateRolePermissions() /// protected void UpdateUserPermissions() { - if (userPermissionsGrid != null && !RefreshGrid) + if (this.userPermissionsGrid != null && !this.RefreshGrid) { - var usersList = _users.Cast().ToList(); - foreach (DataGridItem dgi in userPermissionsGrid.Items) + var usersList = this._users.Cast().ToList(); + foreach (DataGridItem dgi in this.userPermissionsGrid.Items) { var userId = int.Parse(dgi.Cells[1].Text); if (usersList.All(u => u.UserID != userId)) @@ -1202,15 +1202,15 @@ protected void UpdateUserPermissions() //all except first two cells which is displayname and userid and Last column is Actions if (dgi.Cells[i].Controls.Count > 0) { - var permissionInfo = (PermissionInfo)_permissions[i - 2]; + var permissionInfo = (PermissionInfo)this._permissions[i - 2]; var triState = (PermissionTriState)dgi.Cells[i].Controls[0]; - if (SupportsDenyPermissions(permissionInfo)) + if (this.SupportsDenyPermissions(permissionInfo)) { - UpdatePermission(permissionInfo, dgi.Cells[0].Text, userId, triState.Value); + this.UpdatePermission(permissionInfo, dgi.Cells[0].Text, userId, triState.Value); } else { - UpdatePermission(permissionInfo, dgi.Cells[0].Text, userId, triState.Value == PermissionTypeGrant); + this.UpdatePermission(permissionInfo, dgi.Cells[0].Text, userId, triState.Value == PermissionTypeGrant); } } } @@ -1227,7 +1227,7 @@ protected void UpdateUserPermissions() /// protected virtual void RoleGroupsSelectedIndexChanged(object sender, EventArgs e) { - FillSelectRoleComboBox(Int32.Parse(cboRoleGroups.SelectedValue)); + this.FillSelectRoleComboBox(Int32.Parse(this.cboRoleGroups.SelectedValue)); } /// @@ -1235,21 +1235,21 @@ protected virtual void RoleGroupsSelectedIndexChanged(object sender, EventArgs e /// protected virtual void AddUser(object sender, EventArgs e) { - UpdatePermissions(); - if (!string.IsNullOrEmpty(hiddenUserIds.Value)) + this.UpdatePermissions(); + if (!string.IsNullOrEmpty(this.hiddenUserIds.Value)) { - foreach (var id in hiddenUserIds.Value.Split(',')) + foreach (var id in this.hiddenUserIds.Value.Split(',')) { var userId = Convert.ToInt32(id); - var user = UserController.GetUserById(PortalId, userId); + var user = UserController.GetUserById(this.PortalId, userId); if (user != null) { - AddPermission(_permissions, user); - BindData(); + this.AddPermission(this._permissions, user); + this.BindData(); } } - txtUser.Text = hiddenUserIds.Value = string.Empty; + this.txtUser.Text = this.hiddenUserIds.Value = string.Empty; } } @@ -1258,51 +1258,51 @@ protected virtual void AddUser(object sender, EventArgs e) /// void AddRole(object sender, EventArgs e) { - UpdatePermissions(); + this.UpdatePermissions(); int selectedRoleId; - if (!Int32.TryParse(roleField.Value, out selectedRoleId)) + if (!Int32.TryParse(this.roleField.Value, out selectedRoleId)) { //Role not selected - SetErrorMessage("InvalidRoleId"); + this.SetErrorMessage("InvalidRoleId"); return; } //verify role - var role = GetSelectedRole(selectedRoleId); + var role = this.GetSelectedRole(selectedRoleId); if (role != null) { - AddPermission(_permissions, role); - BindData(); + this.AddPermission(this._permissions, role); + this.BindData(); } else { //role does not exist - SetErrorMessage("RoleNotFound"); + this.SetErrorMessage("RoleNotFound"); } } private RoleInfo GetSelectedRole(int selectedRoleId) { RoleInfo role = null; - if (selectedRoleId == AllUsersRoleId) + if (selectedRoleId == this.AllUsersRoleId) { role = new RoleInfo { - RoleID = AllUsersRoleId, + RoleID = this.AllUsersRoleId, RoleName = Globals.glbRoleAllUsersName }; } - else if (selectedRoleId == UnAuthUsersRoleId) + else if (selectedRoleId == this.UnAuthUsersRoleId) { role = new RoleInfo { - RoleID = UnAuthUsersRoleId, + RoleID = this.UnAuthUsersRoleId, RoleName = Globals.glbRoleUnauthUserName }; } else { - role = RoleController.Instance.GetRoleById(PortalId, selectedRoleId); + role = RoleController.Instance.GetRoleById(this.PortalId, selectedRoleId); } return role; } diff --git a/DNN Platform/Library/Security/Permissions/Controls/TabPermissionsGrid.cs b/DNN Platform/Library/Security/Permissions/Controls/TabPermissionsGrid.cs index c82a373b906..ec67a4c7fc1 100644 --- a/DNN Platform/Library/Security/Permissions/Controls/TabPermissionsGrid.cs +++ b/DNN Platform/Library/Security/Permissions/Controls/TabPermissionsGrid.cs @@ -49,11 +49,11 @@ protected override List PermissionsList { get { - if (_PermissionsList == null && _TabPermissions != null) + if (this._PermissionsList == null && this._TabPermissions != null) { - _PermissionsList = _TabPermissions.ToList(); + this._PermissionsList = this._TabPermissions.ToList(); } - return _PermissionsList; + return this._PermissionsList; } } @@ -67,10 +67,10 @@ public TabPermissionCollection Permissions get { //First Update Permissions in case they have been changed - UpdatePermissions(); + this.UpdatePermissions(); //Return the TabPermissions - return _TabPermissions; + return this._TabPermissions; } } @@ -83,14 +83,14 @@ public int TabID { get { - return _TabID; + return this._TabID; } set { - _TabID = value; - if (!Page.IsPostBack) + this._TabID = value; + if (!this.Page.IsPostBack) { - GetTabPermissions(); + this.GetTabPermissions(); } } } @@ -102,13 +102,13 @@ public int TabID /// ----------------------------------------------------------------------------- private void GetTabPermissions() { - _TabPermissions = new TabPermissionCollection(TabPermissionController.GetTabPermissions(TabID, PortalId)); - _PermissionsList = null; + this._TabPermissions = new TabPermissionCollection(TabPermissionController.GetTabPermissions(this.TabID, this.PortalId)); + this._PermissionsList = null; } public override void DataBind() { - GetTabPermissions(); + this.GetTabPermissions(); base.DataBind(); } @@ -132,7 +132,7 @@ private TabPermissionInfo ParseKeys(string[] Settings) { objTabPermission.TabPermissionID = Convert.ToInt32(Settings[2]); } - objTabPermission.TabID = TabID; + objTabPermission.TabID = this.TabID; return objTabPermission; } @@ -144,7 +144,7 @@ private void rolePermissionsGrid_ItemDataBound(object sender, DataGridItemEventA if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.SelectedItem) { var roleID = Int32.Parse(((DataRowView)item.DataItem)[0].ToString()); - if (IsImplicitRole(PortalSettings.Current.PortalId, roleID)) + if (this.IsImplicitRole(PortalSettings.Current.PortalId, roleID)) { var actionImage = item.Controls.Cast().Last().Controls[0] as ImageButton; if (actionImage != null) @@ -163,22 +163,22 @@ private bool IsImplicitRole(int portalId, int roleId) protected override void CreateChildControls() { base.CreateChildControls(); - rolePermissionsGrid.ItemDataBound += rolePermissionsGrid_ItemDataBound; + this.rolePermissionsGrid.ItemDataBound += this.rolePermissionsGrid_ItemDataBound; } protected override void AddPermission(PermissionInfo permission, int roleId, string roleName, int userId, string displayName, bool allowAccess) { var objPermission = new TabPermissionInfo(permission); - objPermission.TabID = TabID; + objPermission.TabID = this.TabID; objPermission.RoleID = roleId; objPermission.RoleName = roleName; objPermission.AllowAccess = allowAccess; objPermission.UserID = userId; objPermission.DisplayName = displayName; - _TabPermissions.Add(objPermission, true); + this._TabPermissions.Add(objPermission, true); //Clear Permission List - _PermissionsList = null; + this._PermissionsList = null; } /// ----------------------------------------------------------------------------- @@ -192,7 +192,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) { //Search TabPermission Collection for the user bool isMatch = false; - foreach (TabPermissionInfo objTabPermission in _TabPermissions) + foreach (TabPermissionInfo objTabPermission in this._TabPermissions) { if (objTabPermission.UserID == user.UserID) { @@ -208,7 +208,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) { if (objPermission.PermissionKey == "VIEW") { - AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); + this.AddPermission(objPermission, int.Parse(Globals.glbRoleNothing), Null.NullString, user.UserID, user.DisplayName, true); } } } @@ -224,7 +224,7 @@ protected override void AddPermission(ArrayList permissions, UserInfo user) protected override void AddPermission(ArrayList permissions, RoleInfo role) { //Search TabPermission Collection for the user - if (_TabPermissions.Cast().Any(objTabPermission => objTabPermission.RoleID == role.RoleID)) + if (this._TabPermissions.Cast().Any(objTabPermission => objTabPermission.RoleID == role.RoleID)) { return; } @@ -234,7 +234,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) { if (objPermission.PermissionKey == "VIEW") { - AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); + this.AddPermission(objPermission, role.RoleID, role.RoleName, Null.NullInteger, Null.NullString, true); } } } @@ -249,7 +249,7 @@ protected override void AddPermission(ArrayList permissions, RoleInfo role) /// ----------------------------------------------------------------------------- protected override bool GetEnabled(PermissionInfo objPerm, RoleInfo role, int column) { - return !IsImplicitRole(role.PortalID, role.RoleID); + return !this.IsImplicitRole(role.PortalID, role.RoleID); } /// ----------------------------------------------------------------------------- @@ -266,7 +266,7 @@ protected override string GetPermission(PermissionInfo objPerm, RoleInfo role, i { string permission; - if (role.RoleID == AdministratorRoleId) + if (role.RoleID == this.AdministratorRoleId) { permission = PermissionTypeGrant; } @@ -310,13 +310,13 @@ protected override void LoadViewState(object savedState) //Load TabId if (myState[1] != null) { - TabID = Convert.ToInt32(myState[1]); + this.TabID = Convert.ToInt32(myState[1]); } //Load TabPermissions if (myState[2] != null) { - _TabPermissions = new TabPermissionCollection(); + this._TabPermissions = new TabPermissionCollection(); string state = Convert.ToString(myState[2]); if (!String.IsNullOrEmpty(state)) { @@ -325,7 +325,7 @@ protected override void LoadViewState(object savedState) foreach (string key in permissionKeys) { string[] Settings = key.Split('|'); - _TabPermissions.Add(ParseKeys(Settings)); + this._TabPermissions.Add(this.ParseKeys(Settings)); } } } @@ -334,9 +334,9 @@ protected override void LoadViewState(object savedState) protected override void RemovePermission(int permissionID, int roleID, int userID) { - _TabPermissions.Remove(permissionID, roleID, userID); + this._TabPermissions.Remove(permissionID, roleID, userID); //Clear Permission List - _PermissionsList = null; + this._PermissionsList = null; } /// ----------------------------------------------------------------------------- @@ -352,14 +352,14 @@ protected override object SaveViewState() allStates[0] = base.SaveViewState(); //Save the Tab Id - allStates[1] = TabID; + allStates[1] = this.TabID; //Persist the TabPermisisons var sb = new StringBuilder(); - if (_TabPermissions != null) + if (this._TabPermissions != null) { bool addDelimiter = false; - foreach (TabPermissionInfo objTabPermission in _TabPermissions) + foreach (TabPermissionInfo objTabPermission in this._TabPermissions) { if (addDelimiter) { @@ -369,7 +369,7 @@ protected override object SaveViewState() { addDelimiter = true; } - sb.Append(BuildKey(objTabPermission.AllowAccess, + sb.Append(this.BuildKey(objTabPermission.AllowAccess, objTabPermission.PermissionID, objTabPermission.TabPermissionID, objTabPermission.RoleID, diff --git a/DNN Platform/Library/Security/Permissions/DesktopModulePermissionCollection.cs b/DNN Platform/Library/Security/Permissions/DesktopModulePermissionCollection.cs index 1eee2229fd3..823ffa51fb4 100644 --- a/DNN Platform/Library/Security/Permissions/DesktopModulePermissionCollection.cs +++ b/DNN Platform/Library/Security/Permissions/DesktopModulePermissionCollection.cs @@ -33,12 +33,12 @@ public DesktopModulePermissionCollection() public DesktopModulePermissionCollection(ArrayList DesktopModulePermissions) { - AddRange(DesktopModulePermissions); + this.AddRange(DesktopModulePermissions); } public DesktopModulePermissionCollection(DesktopModulePermissionCollection DesktopModulePermissions) { - AddRange(DesktopModulePermissions); + this.AddRange(DesktopModulePermissions); } public DesktopModulePermissionCollection(ArrayList DesktopModulePermissions, int DesktopModulePermissionID) @@ -47,7 +47,7 @@ public DesktopModulePermissionCollection(ArrayList DesktopModulePermissions, int { if (permission.DesktopModulePermissionID == DesktopModulePermissionID) { - Add(permission); + this.Add(permission); } } } @@ -56,17 +56,17 @@ public DesktopModulePermissionInfo this[int index] { get { - return (DesktopModulePermissionInfo) List[index]; + return (DesktopModulePermissionInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public int Add(DesktopModulePermissionInfo value) { - return List.Add(value); + return this.List.Add(value); } public int Add(DesktopModulePermissionInfo value, bool checkForDuplicates) @@ -74,12 +74,12 @@ public int Add(DesktopModulePermissionInfo value, bool checkForDuplicates) int id = Null.NullInteger; if (!checkForDuplicates) { - id = Add(value); + id = this.Add(value); } else { bool isMatch = false; - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == value.PermissionID && permission.UserID == value.UserID && permission.RoleID == value.RoleID) { @@ -89,7 +89,7 @@ public int Add(DesktopModulePermissionInfo value, bool checkForDuplicates) } if (!isMatch) { - id = Add(value); + id = this.Add(value); } } @@ -100,7 +100,7 @@ public void AddRange(ArrayList DesktopModulePermissions) { foreach (DesktopModulePermissionInfo permission in DesktopModulePermissions) { - Add(permission); + this.Add(permission); } } @@ -108,19 +108,19 @@ public void AddRange(DesktopModulePermissionCollection DesktopModulePermissions) { foreach (DesktopModulePermissionInfo permission in DesktopModulePermissions) { - Add(permission); + this.Add(permission); } } public bool CompareTo(DesktopModulePermissionCollection objDesktopModulePermissionCollection) { - if (objDesktopModulePermissionCollection.Count != Count) + if (objDesktopModulePermissionCollection.Count != this.Count) { return false; } - InnerList.Sort(new CompareDesktopModulePermissions()); + this.InnerList.Sort(new CompareDesktopModulePermissions()); objDesktopModulePermissionCollection.InnerList.Sort(new CompareDesktopModulePermissions()); - for (int i = 0; i <= Count - 1; i++) + for (int i = 0; i <= this.Count - 1; i++) { if (objDesktopModulePermissionCollection[i].DesktopModulePermissionID != this[i].DesktopModulePermissionID || objDesktopModulePermissionCollection[i].AllowAccess != this[i].AllowAccess) { @@ -132,31 +132,31 @@ public bool CompareTo(DesktopModulePermissionCollection objDesktopModulePermissi public bool Contains(DesktopModulePermissionInfo value) { - return List.Contains(value); + return this.List.Contains(value); } public int IndexOf(DesktopModulePermissionInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } public void Insert(int index, DesktopModulePermissionInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } public void Remove(DesktopModulePermissionInfo value) { - List.Remove(value); + this.List.Remove(value); } public void Remove(int permissionID, int roleID, int userID) { - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == permissionID && permission.UserID == userID && permission.RoleID == roleID) { - List.Remove(permission); + this.List.Remove(permission); break; } } @@ -165,7 +165,7 @@ public void Remove(int permissionID, int roleID, int userID) public List ToList() { var list = new List(); - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { list.Add(permission); } @@ -174,7 +174,7 @@ public List ToList() public string ToString(string key) { - return PermissionController.BuildPermissions(List, key); + return PermissionController.BuildPermissions(this.List, key); } } } diff --git a/DNN Platform/Library/Security/Permissions/DesktopModulePermissionInfo.cs b/DNN Platform/Library/Security/Permissions/DesktopModulePermissionInfo.cs index 4b841bb5b19..629ce98dd2f 100644 --- a/DNN Platform/Library/Security/Permissions/DesktopModulePermissionInfo.cs +++ b/DNN Platform/Library/Security/Permissions/DesktopModulePermissionInfo.cs @@ -44,8 +44,8 @@ public class DesktopModulePermissionInfo : PermissionInfoBase, IHydratable /// ----------------------------------------------------------------------------- public DesktopModulePermissionInfo() { - _desktopModulePermissionID = Null.NullInteger; - _portalDesktopModuleID = Null.NullInteger; + this._desktopModulePermissionID = Null.NullInteger; + this._portalDesktopModuleID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -56,11 +56,11 @@ public DesktopModulePermissionInfo() /// ----------------------------------------------------------------------------- public DesktopModulePermissionInfo(PermissionInfo permission) : this() { - ModuleDefID = permission.ModuleDefID; - PermissionCode = permission.PermissionCode; - PermissionID = permission.PermissionID; - PermissionKey = permission.PermissionKey; - PermissionName = permission.PermissionName; + this.ModuleDefID = permission.ModuleDefID; + this.PermissionCode = permission.PermissionCode; + this.PermissionID = permission.PermissionID; + this.PermissionKey = permission.PermissionKey; + this.PermissionName = permission.PermissionName; } #endregion @@ -77,11 +77,11 @@ public int DesktopModulePermissionID { get { - return _desktopModulePermissionID; + return this._desktopModulePermissionID; } set { - _desktopModulePermissionID = value; + this._desktopModulePermissionID = value; } } @@ -95,11 +95,11 @@ public int PortalDesktopModuleID { get { - return _portalDesktopModuleID; + return this._portalDesktopModuleID; } set { - _portalDesktopModuleID = value; + this._portalDesktopModuleID = value; } } @@ -116,8 +116,8 @@ public int PortalDesktopModuleID public void Fill(IDataReader dr) { base.FillInternal(dr); - DesktopModulePermissionID = Null.SetNullInteger(dr["DesktopModulePermissionID"]); - PortalDesktopModuleID = Null.SetNullInteger(dr["PortalDesktopModuleID"]); + this.DesktopModulePermissionID = Null.SetNullInteger(dr["DesktopModulePermissionID"]); + this.PortalDesktopModuleID = Null.SetNullInteger(dr["PortalDesktopModuleID"]); } /// ----------------------------------------------------------------------------- @@ -130,11 +130,11 @@ public int KeyID { get { - return DesktopModulePermissionID; + return this.DesktopModulePermissionID; } set { - DesktopModulePermissionID = value; + this.DesktopModulePermissionID = value; } } @@ -166,7 +166,7 @@ public bool Equals(DesktopModulePermissionInfo other) { return true; } - return (AllowAccess == other.AllowAccess) && (PortalDesktopModuleID == other.PortalDesktopModuleID) && (RoleID == other.RoleID) && (PermissionID == other.PermissionID); + return (this.AllowAccess == other.AllowAccess) && (this.PortalDesktopModuleID == other.PortalDesktopModuleID) && (this.RoleID == other.RoleID) && (this.PermissionID == other.PermissionID); } /// ----------------------------------------------------------------------------- @@ -197,14 +197,14 @@ public override bool Equals(object obj) { return false; } - return Equals((DesktopModulePermissionInfo) obj); + return this.Equals((DesktopModulePermissionInfo) obj); } public override int GetHashCode() { unchecked { - return (_desktopModulePermissionID*397) ^ _portalDesktopModuleID; + return (this._desktopModulePermissionID*397) ^ this._portalDesktopModuleID; } } diff --git a/DNN Platform/Library/Security/Permissions/FolderPermissionCollection.cs b/DNN Platform/Library/Security/Permissions/FolderPermissionCollection.cs index daf3ff074c3..a4afd878099 100644 --- a/DNN Platform/Library/Security/Permissions/FolderPermissionCollection.cs +++ b/DNN Platform/Library/Security/Permissions/FolderPermissionCollection.cs @@ -23,12 +23,12 @@ public FolderPermissionCollection() public FolderPermissionCollection(ArrayList folderPermissions) { - AddRange(folderPermissions); + this.AddRange(folderPermissions); } public FolderPermissionCollection(FolderPermissionCollection folderPermissions) { - AddRange(folderPermissions); + this.AddRange(folderPermissions); } public FolderPermissionCollection(ArrayList folderPermissions, string FolderPath) @@ -37,7 +37,7 @@ public FolderPermissionCollection(ArrayList folderPermissions, string FolderPath { if (permission.FolderPath.Equals(FolderPath, StringComparison.InvariantCultureIgnoreCase)) { - Add(permission); + this.Add(permission); } } } @@ -46,17 +46,17 @@ public FolderPermissionInfo this[int index] { get { - return (FolderPermissionInfo) List[index]; + return (FolderPermissionInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public int Add(FolderPermissionInfo value) { - return List.Add(value); + return this.List.Add(value); } public int Add(FolderPermissionInfo value, bool checkForDuplicates) @@ -64,12 +64,12 @@ public int Add(FolderPermissionInfo value, bool checkForDuplicates) int id = Null.NullInteger; if (!checkForDuplicates) { - id = Add(value); + id = this.Add(value); } else { bool isMatch = false; - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == value.PermissionID && permission.UserID == value.UserID && permission.RoleID == value.RoleID) { @@ -79,7 +79,7 @@ public int Add(FolderPermissionInfo value, bool checkForDuplicates) } if (!isMatch) { - id = Add(value); + id = this.Add(value); } } @@ -90,7 +90,7 @@ public void AddRange(ArrayList folderPermissions) { foreach (FolderPermissionInfo permission in folderPermissions) { - List.Add(permission); + this.List.Add(permission); } } @@ -98,32 +98,32 @@ public void AddRange(FolderPermissionCollection folderPermissions) { foreach (FolderPermissionInfo permission in folderPermissions) { - List.Add(permission); + this.List.Add(permission); } } public int IndexOf(FolderPermissionInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } public void Insert(int index, FolderPermissionInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } public void Remove(FolderPermissionInfo value) { - List.Remove(value); + this.List.Remove(value); } public void Remove(int permissionID, int roleID, int userID) { - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == permissionID && permission.UserID == userID && permission.RoleID == roleID) { - List.Remove(permission); + this.List.Remove(permission); break; } } @@ -131,13 +131,13 @@ public void Remove(int permissionID, int roleID, int userID) public bool Contains(FolderPermissionInfo value) { - return List.Contains(value); + return this.List.Contains(value); } public bool Contains(string key, int folderId, int roleId, int userId) { bool result = Null.NullBoolean; - foreach (FolderPermissionInfo permission in List) + foreach (FolderPermissionInfo permission in this.List) { if (permission.PermissionKey == key && permission.FolderID == folderId && permission.RoleID == roleId && permission.UserID == userId) { @@ -151,13 +151,13 @@ public bool Contains(string key, int folderId, int roleId, int userId) public bool CompareTo(FolderPermissionCollection objFolderPermissionCollection) { - if (objFolderPermissionCollection.Count != Count) + if (objFolderPermissionCollection.Count != this.Count) { return false; } - InnerList.Sort(new CompareFolderPermissions()); + this.InnerList.Sort(new CompareFolderPermissions()); objFolderPermissionCollection.InnerList.Sort(new CompareFolderPermissions()); - for (int i = 0; i <= Count - 1; i++) + for (int i = 0; i <= this.Count - 1; i++) { if (objFolderPermissionCollection[i].FolderPermissionID != this[i].FolderPermissionID || objFolderPermissionCollection[i].AllowAccess != this[i].AllowAccess) { @@ -170,7 +170,7 @@ public bool CompareTo(FolderPermissionCollection objFolderPermissionCollection) public List ToList() { var list = new List(); - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { list.Add(permission); } @@ -179,7 +179,7 @@ public List ToList() public string ToString(string key) { - return PermissionController.BuildPermissions(List, key); + return PermissionController.BuildPermissions(this.List, key); } } } diff --git a/DNN Platform/Library/Security/Permissions/FolderPermissionInfo.cs b/DNN Platform/Library/Security/Permissions/FolderPermissionInfo.cs index 53d89e95bab..768c561d2c1 100644 --- a/DNN Platform/Library/Security/Permissions/FolderPermissionInfo.cs +++ b/DNN Platform/Library/Security/Permissions/FolderPermissionInfo.cs @@ -37,10 +37,10 @@ public class FolderPermissionInfo : PermissionInfoBase, IHydratable /// ----------------------------------------------------------------------------- public FolderPermissionInfo() { - _folderPermissionID = Null.NullInteger; - _folderPath = Null.NullString; - _portalID = Null.NullInteger; - _folderID = Null.NullInteger; + this._folderPermissionID = Null.NullInteger; + this._folderPath = Null.NullString; + this._portalID = Null.NullInteger; + this._folderID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -51,11 +51,11 @@ public FolderPermissionInfo() /// ----------------------------------------------------------------------------- public FolderPermissionInfo(PermissionInfo permission) : this() { - ModuleDefID = permission.ModuleDefID; - PermissionCode = permission.PermissionCode; - PermissionID = permission.PermissionID; - PermissionKey = permission.PermissionKey; - PermissionName = permission.PermissionName; + this.ModuleDefID = permission.ModuleDefID; + this.PermissionCode = permission.PermissionCode; + this.PermissionID = permission.PermissionID; + this.PermissionKey = permission.PermissionKey; + this.PermissionName = permission.PermissionName; } #endregion @@ -67,11 +67,11 @@ public int FolderPermissionID { get { - return _folderPermissionID; + return this._folderPermissionID; } set { - _folderPermissionID = value; + this._folderPermissionID = value; } } @@ -80,11 +80,11 @@ public int FolderID { get { - return _folderID; + return this._folderID; } set { - _folderID = value; + this._folderID = value; } } @@ -93,11 +93,11 @@ public int PortalID { get { - return _portalID; + return this._portalID; } set { - _portalID = value; + this._portalID = value; } } @@ -106,11 +106,11 @@ public string FolderPath { get { - return _folderPath; + return this._folderPath; } set { - _folderPath = value; + this._folderPath = value; } } @@ -127,10 +127,10 @@ public string FolderPath public void Fill(IDataReader dr) { base.FillInternal(dr); - FolderPermissionID = Null.SetNullInteger(dr["FolderPermissionID"]); - FolderID = Null.SetNullInteger(dr["FolderID"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - FolderPath = Null.SetNullString(dr["FolderPath"]); + this.FolderPermissionID = Null.SetNullInteger(dr["FolderPermissionID"]); + this.FolderID = Null.SetNullInteger(dr["FolderID"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.FolderPath = Null.SetNullString(dr["FolderPath"]); } /// ----------------------------------------------------------------------------- @@ -144,11 +144,11 @@ public int KeyID { get { - return FolderPermissionID; + return this.FolderPermissionID; } set { - FolderPermissionID = value; + this.FolderPermissionID = value; } } diff --git a/DNN Platform/Library/Security/Permissions/ModulePermissionCollection.cs b/DNN Platform/Library/Security/Permissions/ModulePermissionCollection.cs index d10af6e3f25..0cbccd58cc6 100644 --- a/DNN Platform/Library/Security/Permissions/ModulePermissionCollection.cs +++ b/DNN Platform/Library/Security/Permissions/ModulePermissionCollection.cs @@ -35,12 +35,12 @@ public ModulePermissionCollection() public ModulePermissionCollection(ArrayList modulePermissions) { - AddRange(modulePermissions); + this.AddRange(modulePermissions); } public ModulePermissionCollection(ModulePermissionCollection modulePermissions) { - AddRange(modulePermissions); + this.AddRange(modulePermissions); } public ModulePermissionCollection(ArrayList modulePermissions, int ModuleID) @@ -49,7 +49,7 @@ public ModulePermissionCollection(ArrayList modulePermissions, int ModuleID) { if (permission.ModuleID == ModuleID) { - Add(permission); + this.Add(permission); } } } @@ -60,7 +60,7 @@ public ModulePermissionCollection(ModuleInfo objModule) { if (permission.ModuleID == objModule.ModuleID) { - Add(permission); + this.Add(permission); } } } @@ -69,17 +69,17 @@ public ModulePermissionInfo this[int index] { get { - return (ModulePermissionInfo) List[index]; + return (ModulePermissionInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public int Add(ModulePermissionInfo value) { - return List.Add(value); + return this.List.Add(value); } public int Add(ModulePermissionInfo value, bool checkForDuplicates) @@ -87,12 +87,12 @@ public int Add(ModulePermissionInfo value, bool checkForDuplicates) int id = Null.NullInteger; if (!checkForDuplicates) { - id = Add(value); + id = this.Add(value); } else { bool isMatch = false; - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == value.PermissionID && permission.UserID == value.UserID && permission.RoleID == value.RoleID) { @@ -102,7 +102,7 @@ public int Add(ModulePermissionInfo value, bool checkForDuplicates) } if (!isMatch) { - id = Add(value); + id = this.Add(value); } } @@ -113,7 +113,7 @@ public void AddRange(ArrayList modulePermissions) { foreach (ModulePermissionInfo permission in modulePermissions) { - Add(permission); + this.Add(permission); } } @@ -121,19 +121,19 @@ public void AddRange(ModulePermissionCollection modulePermissions) { foreach (ModulePermissionInfo permission in modulePermissions) { - Add(permission); + this.Add(permission); } } public bool CompareTo(ModulePermissionCollection objModulePermissionCollection) { - if (objModulePermissionCollection.Count != Count) + if (objModulePermissionCollection.Count != this.Count) { return false; } - InnerList.Sort(new CompareModulePermissions()); + this.InnerList.Sort(new CompareModulePermissions()); objModulePermissionCollection.InnerList.Sort(new CompareModulePermissions()); - for (int i = 0; i <= Count - 1; i++) + for (int i = 0; i <= this.Count - 1; i++) { if (objModulePermissionCollection[i].ModulePermissionID != this[i].ModulePermissionID || objModulePermissionCollection[i].AllowAccess != this[i].AllowAccess) { @@ -145,32 +145,32 @@ public bool CompareTo(ModulePermissionCollection objModulePermissionCollection) public bool Contains(ModulePermissionInfo value) { - return List.Contains(value); + return this.List.Contains(value); } public int IndexOf(ModulePermissionInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } public void Insert(int index, ModulePermissionInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } public void Remove(ModulePermissionInfo value) { - List.Remove(value); + this.List.Remove(value); } public void Remove(int permissionID, int roleID, int userID) { var idx = 0; - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == permissionID && permission.UserID == userID && permission.RoleID == roleID) { - List.RemoveAt(idx); + this.List.RemoveAt(idx); break; } idx++; @@ -180,7 +180,7 @@ public void Remove(int permissionID, int roleID, int userID) public List ToList() { var list = new List(); - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { list.Add(permission); } @@ -189,7 +189,7 @@ public List ToList() public string ToString(string key) { - return PermissionController.BuildPermissions(List, key); + return PermissionController.BuildPermissions(this.List, key); } public IEnumerable Where(Func predicate) diff --git a/DNN Platform/Library/Security/Permissions/ModulePermissionInfo.cs b/DNN Platform/Library/Security/Permissions/ModulePermissionInfo.cs index f5f07b9363c..e3b6dbd40c7 100644 --- a/DNN Platform/Library/Security/Permissions/ModulePermissionInfo.cs +++ b/DNN Platform/Library/Security/Permissions/ModulePermissionInfo.cs @@ -45,8 +45,8 @@ public class ModulePermissionInfo : PermissionInfoBase, IHydratable /// ----------------------------------------------------------------------------- public ModulePermissionInfo() { - _modulePermissionID = Null.NullInteger; - _moduleID = Null.NullInteger; + this._modulePermissionID = Null.NullInteger; + this._moduleID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -57,11 +57,11 @@ public ModulePermissionInfo() /// ----------------------------------------------------------------------------- public ModulePermissionInfo(PermissionInfo permission) : this() { - ModuleDefID = permission.ModuleDefID; - PermissionCode = permission.PermissionCode; - PermissionID = permission.PermissionID; - PermissionKey = permission.PermissionKey; - PermissionName = permission.PermissionName; + this.ModuleDefID = permission.ModuleDefID; + this.PermissionCode = permission.PermissionCode; + this.PermissionID = permission.PermissionID; + this.PermissionKey = permission.PermissionKey; + this.PermissionName = permission.PermissionName; } #endregion @@ -79,11 +79,11 @@ public int ModulePermissionID { get { - return _modulePermissionID; + return this._modulePermissionID; } set { - _modulePermissionID = value; + this._modulePermissionID = value; } } @@ -98,11 +98,11 @@ public int ModuleID { get { - return _moduleID; + return this._moduleID; } set { - _moduleID = value; + this._moduleID = value; } } @@ -119,8 +119,8 @@ public int ModuleID public void Fill(IDataReader dr) { base.FillInternal(dr); - ModulePermissionID = Null.SetNullInteger(dr["ModulePermissionID"]); - ModuleID = Null.SetNullInteger(dr["ModuleID"]); + this.ModulePermissionID = Null.SetNullInteger(dr["ModulePermissionID"]); + this.ModuleID = Null.SetNullInteger(dr["ModuleID"]); } /// ----------------------------------------------------------------------------- @@ -134,11 +134,11 @@ public int KeyID { get { - return ModulePermissionID; + return this.ModulePermissionID; } set { - ModulePermissionID = value; + this.ModulePermissionID = value; } } @@ -170,7 +170,7 @@ public bool Equals(ModulePermissionInfo other) { return true; } - return (AllowAccess == other.AllowAccess) && (ModuleID == other.ModuleID) && (RoleID == other.RoleID) && (PermissionID == other.PermissionID); + return (this.AllowAccess == other.AllowAccess) && (this.ModuleID == other.ModuleID) && (this.RoleID == other.RoleID) && (this.PermissionID == other.PermissionID); } /// ----------------------------------------------------------------------------- @@ -201,14 +201,14 @@ public override bool Equals(object obj) { return false; } - return Equals((ModulePermissionInfo) obj); + return this.Equals((ModulePermissionInfo) obj); } public override int GetHashCode() { unchecked { - return (_moduleID*397) ^ _modulePermissionID; + return (this._moduleID*397) ^ this._modulePermissionID; } } diff --git a/DNN Platform/Library/Security/Permissions/PermissionController.cs b/DNN Platform/Library/Security/Permissions/PermissionController.cs index ef7e392fad0..c124556ff26 100644 --- a/DNN Platform/Library/Security/Permissions/PermissionController.cs +++ b/DNN Platform/Library/Security/Permissions/PermissionController.cs @@ -52,7 +52,7 @@ public int AddPermission(PermissionInfo permission) permission.PermissionName, UserController.Instance.GetCurrentUserInfo().UserID)); - ClearCache(); + this.ClearCache(); return permissionId; } @@ -64,7 +64,7 @@ public void DeletePermission(int permissionID) UserController.Instance.GetCurrentUserInfo().UserID, EventLogController.EventLogType.PERMISSION_DELETED); provider.DeletePermission(permissionID); - ClearCache(); + this.ClearCache(); } public PermissionInfo GetPermission(int permissionID) @@ -99,7 +99,7 @@ public void UpdatePermission(PermissionInfo permission) permission.PermissionKey, permission.PermissionName, UserController.Instance.GetCurrentUserInfo().UserID); - ClearCache(); + this.ClearCache(); } #endregion @@ -167,7 +167,7 @@ public static ArrayList GetPermissionsByTab() public T RemapPermission(T permission, int portalId) where T : PermissionInfoBase { - PermissionInfo permissionInfo = GetPermissionByCodeAndKey(permission.PermissionCode, permission.PermissionKey).ToArray().Cast().FirstOrDefault(); + PermissionInfo permissionInfo = this.GetPermissionByCodeAndKey(permission.PermissionCode, permission.PermissionKey).ToArray().Cast().FirstOrDefault(); T result = null; if ((permissionInfo != null)) @@ -229,7 +229,7 @@ public ArrayList GetPermissionsByModuleID(int moduleId) { var module = ModuleController.Instance.GetModule(moduleId, Null.NullInteger, true); - return GetPermissionsByModuleDefID(module.ModuleDefID); + return this.GetPermissionsByModuleDefID(module.ModuleDefID); } } } diff --git a/DNN Platform/Library/Security/Permissions/PermissionInfo.cs b/DNN Platform/Library/Security/Permissions/PermissionInfo.cs index d7eecff95c2..4f79b4106c6 100644 --- a/DNN Platform/Library/Security/Permissions/PermissionInfo.cs +++ b/DNN Platform/Library/Security/Permissions/PermissionInfo.cs @@ -91,11 +91,11 @@ public class PermissionInfo : BaseEntityInfo protected override void FillInternal(IDataReader dr) { base.FillInternal(dr); - PermissionID = Null.SetNullInteger(dr["PermissionID"]); - ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); - PermissionCode = Null.SetNullString(dr["PermissionCode"]); - PermissionKey = Null.SetNullString(dr["PermissionKey"]); - PermissionName = Null.SetNullString(dr["PermissionName"]); + this.PermissionID = Null.SetNullInteger(dr["PermissionID"]); + this.ModuleDefID = Null.SetNullInteger(dr["ModuleDefID"]); + this.PermissionCode = Null.SetNullString(dr["PermissionCode"]); + this.PermissionKey = Null.SetNullString(dr["PermissionKey"]); + this.PermissionName = Null.SetNullString(dr["PermissionName"]); } #endregion diff --git a/DNN Platform/Library/Security/Permissions/PermissionInfoBase.cs b/DNN Platform/Library/Security/Permissions/PermissionInfoBase.cs index 74ca875dc7f..17df6847070 100644 --- a/DNN Platform/Library/Security/Permissions/PermissionInfoBase.cs +++ b/DNN Platform/Library/Security/Permissions/PermissionInfoBase.cs @@ -52,12 +52,12 @@ public abstract class PermissionInfoBase : PermissionInfo public PermissionInfoBase() { - _RoleID = int.Parse(Globals.glbRoleNothing); - _AllowAccess = false; - _RoleName = Null.NullString; - _UserID = Null.NullInteger; - _Username = Null.NullString; - _DisplayName = Null.NullString; + this._RoleID = int.Parse(Globals.glbRoleNothing); + this._AllowAccess = false; + this._RoleName = Null.NullString; + this._UserID = Null.NullInteger; + this._Username = Null.NullString; + this._DisplayName = Null.NullString; } #endregion @@ -75,11 +75,11 @@ public bool AllowAccess { get { - return _AllowAccess; + return this._AllowAccess; } set { - _AllowAccess = value; + this._AllowAccess = value; } } @@ -94,11 +94,11 @@ public string DisplayName { get { - return _DisplayName; + return this._DisplayName; } set { - _DisplayName = value; + this._DisplayName = value; } } @@ -113,11 +113,11 @@ public int RoleID { get { - return _RoleID; + return this._RoleID; } set { - _RoleID = value; + this._RoleID = value; } } @@ -132,11 +132,11 @@ public string RoleName { get { - return _RoleName; + return this._RoleName; } set { - _RoleName = value; + this._RoleName = value; } } @@ -151,11 +151,11 @@ public int UserID { get { - return _UserID; + return this._UserID; } set { - _UserID = value; + this._UserID = value; } } @@ -170,11 +170,11 @@ public string Username { get { - return _Username; + return this._Username; } set { - _Username = value; + this._Username = value; } } @@ -193,20 +193,20 @@ protected override void FillInternal(IDataReader dr) //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); - UserID = Null.SetNullInteger(dr["UserID"]); - Username = Null.SetNullString(dr["Username"]); - DisplayName = Null.SetNullString(dr["DisplayName"]); - if (UserID == Null.NullInteger) + this.UserID = Null.SetNullInteger(dr["UserID"]); + this.Username = Null.SetNullString(dr["Username"]); + this.DisplayName = Null.SetNullString(dr["DisplayName"]); + if (this.UserID == Null.NullInteger) { - RoleID = Null.SetNullInteger(dr["RoleID"]); - RoleName = Null.SetNullString(dr["RoleName"]); + this.RoleID = Null.SetNullInteger(dr["RoleID"]); + this.RoleName = Null.SetNullString(dr["RoleName"]); } else { - RoleID = int.Parse(Globals.glbRoleNothing); - RoleName = ""; + this.RoleID = int.Parse(Globals.glbRoleNothing); + this.RoleName = ""; } - AllowAccess = Null.SetNullBoolean(dr["AllowAccess"]); + this.AllowAccess = Null.SetNullBoolean(dr["AllowAccess"]); } #endregion diff --git a/DNN Platform/Library/Security/Permissions/PermissionProvider.cs b/DNN Platform/Library/Security/Permissions/PermissionProvider.cs index 30e68d2166d..c2fc4658ad4 100644 --- a/DNN Platform/Library/Security/Permissions/PermissionProvider.cs +++ b/DNN Platform/Library/Security/Permissions/PermissionProvider.cs @@ -194,7 +194,7 @@ private Dictionary GetModulePermissions(int tab { string cacheKey = string.Format(DataCache.ModulePermissionCacheKey, tabID); return CBO.GetCachedObject>( - new CacheItemArgs(cacheKey, DataCache.ModulePermissionCacheTimeOut, DataCache.ModulePermissionCachePriority, tabID), GetModulePermissionsCallBack); + new CacheItemArgs(cacheKey, DataCache.ModulePermissionCacheTimeOut, DataCache.ModulePermissionCachePriority, tabID), this.GetModulePermissionsCallBack); } /// ----------------------------------------------------------------------------- @@ -208,7 +208,7 @@ private Dictionary GetModulePermissions(int tab private object GetModulePermissionsCallBack(CacheItemArgs cacheItemArgs) { var tabID = (int)cacheItemArgs.ParamList[0]; - IDataReader dr = dataProvider.GetModulePermissionsByTabID(tabID); + IDataReader dr = this.dataProvider.GetModulePermissionsByTabID(tabID); var dic = new Dictionary(); try { @@ -257,7 +257,7 @@ private Dictionary GetTabPermissions(int portalID) { string cacheKey = string.Format(DataCache.TabPermissionCacheKey, portalID); return CBO.GetCachedObject>(new CacheItemArgs(cacheKey, DataCache.TabPermissionCacheTimeOut, DataCache.TabPermissionCachePriority, portalID), - GetTabPermissionsCallBack); + this.GetTabPermissionsCallBack); } /// ----------------------------------------------------------------------------- @@ -275,7 +275,7 @@ private object GetTabPermissionsCallBack(CacheItemArgs cacheItemArgs) if (portalID > -1) { - IDataReader dr = dataProvider.GetTabPermissionsByPortal(portalID); + IDataReader dr = this.dataProvider.GetTabPermissionsByPortal(portalID); try { while (dr.Read()) @@ -458,23 +458,23 @@ private IEnumerable DefaultImplicitRoles(int portalId) protected bool HasModulePermission(ModuleInfo moduleConfiguration, string permissionKey) { - return CanViewModule(moduleConfiguration) && - (HasModulePermission(moduleConfiguration.ModulePermissions, permissionKey) - || HasModulePermission(moduleConfiguration.ModulePermissions, "EDIT")); + return this.CanViewModule(moduleConfiguration) && + (this.HasModulePermission(moduleConfiguration.ModulePermissions, permissionKey) + || this.HasModulePermission(moduleConfiguration.ModulePermissions, "EDIT")); } protected bool IsDeniedModulePermission(ModuleInfo moduleConfiguration, string permissionKey) { - return IsDeniedModulePermission(moduleConfiguration.ModulePermissions, "VIEW") - || IsDeniedModulePermission(moduleConfiguration.ModulePermissions, permissionKey) - || IsDeniedModulePermission(moduleConfiguration.ModulePermissions, "EDIT"); + return this.IsDeniedModulePermission(moduleConfiguration.ModulePermissions, "VIEW") + || this.IsDeniedModulePermission(moduleConfiguration.ModulePermissions, permissionKey) + || this.IsDeniedModulePermission(moduleConfiguration.ModulePermissions, "EDIT"); } protected bool IsDeniedTabPermission(TabInfo tab, string permissionKey) { - return IsDeniedTabPermission(tab.TabPermissions, "VIEW") - || IsDeniedTabPermission(tab.TabPermissions, permissionKey) - || IsDeniedTabPermission(tab.TabPermissions, "EDIT"); + return this.IsDeniedTabPermission(tab.TabPermissions, "VIEW") + || this.IsDeniedTabPermission(tab.TabPermissions, permissionKey) + || this.IsDeniedTabPermission(tab.TabPermissions, "EDIT"); } #endregion @@ -505,7 +505,7 @@ public virtual bool IsPortalEditor() /// A flag indicating whether the user has permission public virtual bool CanAddFolder(FolderInfo folder) { - return HasFolderPermission(folder, AddFolderPermissionKey); + return this.HasFolderPermission(folder, AddFolderPermissionKey); } /// @@ -539,7 +539,7 @@ public virtual bool CanAdminFolder(FolderInfo folder) /// A flag indicating whether the user has permission public virtual bool CanCopyFolder(FolderInfo folder) { - return HasFolderPermission(folder, CopyFolderPermissionKey); + return this.HasFolderPermission(folder, CopyFolderPermissionKey); } /// @@ -549,7 +549,7 @@ public virtual bool CanCopyFolder(FolderInfo folder) /// A flag indicating whether the user has permission public virtual bool CanDeleteFolder(FolderInfo folder) { - return HasFolderPermission(folder, DeleteFolderPermissionKey); + return this.HasFolderPermission(folder, DeleteFolderPermissionKey); } /// @@ -559,7 +559,7 @@ public virtual bool CanDeleteFolder(FolderInfo folder) /// A flag indicating whether the user has permission public virtual bool CanManageFolder(FolderInfo folder) { - return HasFolderPermission(folder, ManageFolderPermissionKey); + return this.HasFolderPermission(folder, ManageFolderPermissionKey); } /// @@ -569,12 +569,12 @@ public virtual bool CanManageFolder(FolderInfo folder) /// A flag indicating whether the user has permission public virtual bool CanViewFolder(FolderInfo folder) { - return HasFolderPermission(folder, ViewFolderPermissionKey); + return this.HasFolderPermission(folder, ViewFolderPermissionKey); } public virtual void DeleteFolderPermissionsByUser(UserInfo objUser) { - dataProvider.DeleteFolderPermissionsByUserID(objUser.PortalID, objUser.UserID); + this.dataProvider.DeleteFolderPermissionsByUserID(objUser.PortalID, objUser.UserID); } public virtual FolderPermissionCollection GetFolderPermissionsCollectionByFolder(int PortalID, string Folder) @@ -609,7 +609,7 @@ public virtual FolderPermissionCollection GetFolderPermissionsCollectionByFolder var collection = new FolderPermissionCollection(); try { - using (var dr = dataProvider.GetFolderPermissionsByPortalAndPath(PortalID, Folder)) + using (var dr = this.dataProvider.GetFolderPermissionsByPortalAndPath(PortalID, Folder)) { while (dr.Read()) { @@ -638,7 +638,7 @@ public virtual bool HasFolderPermission(FolderPermissionCollection objFolderPerm /// The Folder to update public virtual void SaveFolderPermissions(FolderInfo folder) { - SaveFolderPermissions((IFolderInfo)folder); + this.SaveFolderPermissions((IFolderInfo)folder); } /// ----------------------------------------------------------------------------- @@ -701,10 +701,10 @@ public virtual void SaveFolderPermissions(IFolderInfo folder) folder.FolderPermissions.Add(folderPermission, true); } - dataProvider.DeleteFolderPermissionsByFolderPath(folder.PortalID, folder.FolderPath); + this.dataProvider.DeleteFolderPermissionsByFolderPath(folder.PortalID, folder.FolderPath); foreach (FolderPermissionInfo folderPermission in folder.FolderPermissions) { - dataProvider.AddFolderPermission(folder.FolderID, + this.dataProvider.AddFolderPermission(folder.FolderID, folderPermission.PermissionID, folderPermission.RoleID, folderPermission.AllowAccess, @@ -807,7 +807,7 @@ public virtual bool CanViewModule(ModuleInfo module) /// ----------------------------------------------------------------------------- public virtual void DeleteModulePermissionsByUser(UserInfo user) { - dataProvider.DeleteModulePermissionsByUserID(user.PortalID, user.UserID); + this.dataProvider.DeleteModulePermissionsByUserID(user.PortalID, user.UserID); DataCache.ClearModulePermissionsCachesByPortal(user.PortalID); } @@ -821,7 +821,7 @@ public virtual void DeleteModulePermissionsByUser(UserInfo user) public virtual ModulePermissionCollection GetModulePermissions(int moduleID, int tabID) { //Get the Tab ModulePermission Dictionary - Dictionary dictionary = GetModulePermissions(tabID); + Dictionary dictionary = this.GetModulePermissions(tabID); //Get the Collection from the Dictionary ModulePermissionCollection modulePermissions; @@ -886,7 +886,7 @@ public virtual bool HasModuleAccess(SecurityAccessLevel accessLevel, string perm //Need to check for Deny Edit at the Module Level if (permissionKey == "CONTENT") { - isAuthorized = !IsDeniedModulePermission(moduleConfiguration, permissionKey); + isAuthorized = !this.IsDeniedModulePermission(moduleConfiguration, permissionKey); } else { @@ -896,9 +896,9 @@ public virtual bool HasModuleAccess(SecurityAccessLevel accessLevel, string perm else { // Need to check if it was denied at Tab level - if (!IsDeniedTabPermission(tab, "CONTENT,EDIT")) + if (!this.IsDeniedTabPermission(tab, "CONTENT,EDIT")) { - isAuthorized = HasModulePermission(moduleConfiguration, permissionKey); + isAuthorized = this.HasModulePermission(moduleConfiguration, permissionKey); } } } @@ -957,17 +957,17 @@ public virtual void SaveModulePermissions(ModuleInfo module) ModulePermissionCollection modulePermissions = ModulePermissionController.GetModulePermissions(module.ModuleID, module.TabID); if (!modulePermissions.CompareTo(module.ModulePermissions)) { - dataProvider.DeleteModulePermissionsByModuleID(module.ModuleID, module.PortalID); + this.dataProvider.DeleteModulePermissionsByModuleID(module.ModuleID, module.PortalID); foreach (ModulePermissionInfo modulePermission in module.ModulePermissions) { if (!module.IsShared && module.InheritViewPermissions && modulePermission.PermissionKey == "VIEW") { - dataProvider.DeleteModulePermission(modulePermission.ModulePermissionID); + this.dataProvider.DeleteModulePermission(modulePermission.ModulePermissionID); } else { - dataProvider.AddModulePermission(module.ModuleID, + this.dataProvider.AddModulePermission(module.ModuleID, module.PortalID, modulePermission.PermissionID, modulePermission.RoleID, @@ -991,7 +991,7 @@ public virtual void SaveModulePermissions(ModuleInfo module) /// A List with the implicit roles public virtual IEnumerable ImplicitRolesForPages(int portalId) { - return DefaultImplicitRoles(portalId); + return this.DefaultImplicitRoles(portalId); } /// @@ -1001,7 +1001,7 @@ public virtual IEnumerable ImplicitRolesForPages(int portalId) /// A List with the implicit roles public virtual IEnumerable ImplicitRolesForFolders(int portalId) { - return DefaultImplicitRoles(portalId); + return this.DefaultImplicitRoles(portalId); } /// @@ -1011,7 +1011,7 @@ public virtual IEnumerable ImplicitRolesForFolders(int portalId) /// A flag indicating whether the user has permission public virtual bool CanAddContentToPage(TabInfo tab) { - return HasPagePermission(tab, ContentPagePermissionKey); + return this.HasPagePermission(tab, ContentPagePermissionKey); } /// @@ -1021,7 +1021,7 @@ public virtual bool CanAddContentToPage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanAddPage(TabInfo tab) { - return HasPagePermission(tab, AddPagePermissionKey); + return this.HasPagePermission(tab, AddPagePermissionKey); } /// @@ -1041,7 +1041,7 @@ public virtual bool CanAdminPage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanCopyPage(TabInfo tab) { - return HasPagePermission(tab, CopyPagePermissionKey); + return this.HasPagePermission(tab, CopyPagePermissionKey); } /// @@ -1051,7 +1051,7 @@ public virtual bool CanCopyPage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanDeletePage(TabInfo tab) { - return HasPagePermission(tab, DeletePagePermissionKey); + return this.HasPagePermission(tab, DeletePagePermissionKey); } /// @@ -1061,7 +1061,7 @@ public virtual bool CanDeletePage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanExportPage(TabInfo tab) { - return HasPagePermission(tab, ExportPagePermissionKey); + return this.HasPagePermission(tab, ExportPagePermissionKey); } /// @@ -1071,7 +1071,7 @@ public virtual bool CanExportPage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanImportPage(TabInfo tab) { - return HasPagePermission(tab, ImportPagePermissionKey); + return this.HasPagePermission(tab, ImportPagePermissionKey); } /// @@ -1081,7 +1081,7 @@ public virtual bool CanImportPage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanManagePage(TabInfo tab) { - return HasPagePermission(tab, ManagePagePermissionKey); + return this.HasPagePermission(tab, ManagePagePermissionKey); } /// @@ -1091,7 +1091,7 @@ public virtual bool CanManagePage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanNavigateToPage(TabInfo tab) { - return HasPagePermission(tab, NavigatePagePermissionKey) || HasPagePermission(tab, ViewPagePermissionKey); + return this.HasPagePermission(tab, NavigatePagePermissionKey) || this.HasPagePermission(tab, ViewPagePermissionKey); } /// @@ -1101,7 +1101,7 @@ public virtual bool CanNavigateToPage(TabInfo tab) /// A flag indicating whether the user has permission public virtual bool CanViewPage(TabInfo tab) { - return HasPagePermission(tab, ViewPagePermissionKey); + return this.HasPagePermission(tab, ViewPagePermissionKey); } /// ----------------------------------------------------------------------------- @@ -1112,7 +1112,7 @@ public virtual bool CanViewPage(TabInfo tab) /// ----------------------------------------------------------------------------- public virtual void DeleteTabPermissionsByUser(UserInfo user) { - dataProvider.DeleteTabPermissionsByUserID(user.PortalID, user.UserID); + this.dataProvider.DeleteTabPermissionsByUserID(user.PortalID, user.UserID); DataCache.ClearTabPermissionsCache(user.PortalID); } @@ -1126,7 +1126,7 @@ public virtual void DeleteTabPermissionsByUser(UserInfo user) public virtual TabPermissionCollection GetTabPermissions(int tabId, int portalId) { //Get the Portal TabPermission Dictionary - Dictionary dicTabPermissions = GetTabPermissions(portalId); + Dictionary dicTabPermissions = this.GetTabPermissions(portalId); //Get the Collection from the Dictionary TabPermissionCollection tabPermissions; @@ -1178,7 +1178,7 @@ public virtual bool HasTabPermission(TabPermissionCollection tabPermissions, str /// ----------------------------------------------------------------------------- public virtual void SaveTabPermissions(TabInfo tab) { - TabPermissionCollection objCurrentTabPermissions = GetTabPermissions(tab.TabID, tab.PortalID); + TabPermissionCollection objCurrentTabPermissions = this.GetTabPermissions(tab.TabID, tab.PortalID); if (!objCurrentTabPermissions.CompareTo(tab.TabPermissions)) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -1186,7 +1186,7 @@ public virtual void SaveTabPermissions(TabInfo tab) if (objCurrentTabPermissions.Count > 0) { - dataProvider.DeleteTabPermissionsByTabID(tab.TabID); + this.dataProvider.DeleteTabPermissionsByTabID(tab.TabID); EventLogController.Instance.AddLog(tab, portalSettings, userId, "", EventLogController.EventLogType.TABPERMISSION_DELETED); } @@ -1194,7 +1194,7 @@ public virtual void SaveTabPermissions(TabInfo tab) { foreach (TabPermissionInfo objTabPermission in tab.TabPermissions) { - objTabPermission.TabPermissionID = dataProvider.AddTabPermission( + objTabPermission.TabPermissionID = this.dataProvider.AddTabPermission( tab.TabID, objTabPermission.PermissionID, objTabPermission.RoleID, diff --git a/DNN Platform/Library/Security/Permissions/TabPermissionCollection.cs b/DNN Platform/Library/Security/Permissions/TabPermissionCollection.cs index 72eede6331a..e0750a8c58e 100644 --- a/DNN Platform/Library/Security/Permissions/TabPermissionCollection.cs +++ b/DNN Platform/Library/Security/Permissions/TabPermissionCollection.cs @@ -36,12 +36,12 @@ public TabPermissionCollection() public TabPermissionCollection(ArrayList tabPermissions) { - AddRange(tabPermissions); + this.AddRange(tabPermissions); } public TabPermissionCollection(TabPermissionCollection tabPermissions) { - AddRange(tabPermissions); + this.AddRange(tabPermissions); } public TabPermissionCollection(ArrayList tabPermissions, int TabId) @@ -50,7 +50,7 @@ public TabPermissionCollection(ArrayList tabPermissions, int TabId) { if (permission.TabID == TabId) { - Add(permission); + this.Add(permission); } } } @@ -59,17 +59,17 @@ public TabPermissionInfo this[int index] { get { - return (TabPermissionInfo) List[index]; + return (TabPermissionInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } public int Add(TabPermissionInfo value) { - return List.Add(value); + return this.List.Add(value); } public int Add(TabPermissionInfo value, bool checkForDuplicates) @@ -78,12 +78,12 @@ public int Add(TabPermissionInfo value, bool checkForDuplicates) if (!checkForDuplicates) { - id = Add(value); + id = this.Add(value); } else { bool isMatch = false; - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == value.PermissionID && permission.UserID == value.UserID && permission.RoleID == value.RoleID) { @@ -93,7 +93,7 @@ public int Add(TabPermissionInfo value, bool checkForDuplicates) } if (!isMatch) { - id = Add(value); + id = this.Add(value); } } @@ -104,7 +104,7 @@ public void AddRange(ArrayList tabPermissions) { foreach (TabPermissionInfo permission in tabPermissions) { - Add(permission); + this.Add(permission); } } @@ -112,7 +112,7 @@ public void AddRange(IEnumerable tabPermissions) { foreach (TabPermissionInfo permission in tabPermissions) { - Add(permission); + this.Add(permission); } } @@ -120,19 +120,19 @@ public void AddRange(TabPermissionCollection tabPermissions) { foreach (TabPermissionInfo permission in tabPermissions) { - Add(permission); + this.Add(permission); } } public bool CompareTo(TabPermissionCollection objTabPermissionCollection) { - if (objTabPermissionCollection.Count != Count) + if (objTabPermissionCollection.Count != this.Count) { return false; } - InnerList.Sort(new CompareTabPermissions()); + this.InnerList.Sort(new CompareTabPermissions()); objTabPermissionCollection.InnerList.Sort(new CompareTabPermissions()); - for (int i = 0; i <= Count - 1; i++) + for (int i = 0; i <= this.Count - 1; i++) { if (objTabPermissionCollection[i].TabPermissionID != this[i].TabPermissionID || objTabPermissionCollection[i].PermissionID != this[i].PermissionID @@ -148,31 +148,31 @@ public bool CompareTo(TabPermissionCollection objTabPermissionCollection) public bool Contains(TabPermissionInfo value) { - return List.Contains(value); + return this.List.Contains(value); } public int IndexOf(TabPermissionInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } public void Insert(int index, TabPermissionInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } public void Remove(TabPermissionInfo value) { - List.Remove(value); + this.List.Remove(value); } public void Remove(int permissionID, int roleID, int userID) { - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == permissionID && permission.UserID == userID && permission.RoleID == roleID) { - List.Remove(permission); + this.List.Remove(permission); break; } } @@ -181,7 +181,7 @@ public void Remove(int permissionID, int roleID, int userID) public List ToList() { var list = new List(); - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { list.Add(permission); } @@ -190,7 +190,7 @@ public List ToList() public string ToString(string key) { - return PermissionController.BuildPermissions(List, key); + return PermissionController.BuildPermissions(this.List, key); } public IEnumerable Where(Func predicate) diff --git a/DNN Platform/Library/Security/Permissions/TabPermissionInfo.cs b/DNN Platform/Library/Security/Permissions/TabPermissionInfo.cs index b2d2fed4251..3657d9b72e9 100644 --- a/DNN Platform/Library/Security/Permissions/TabPermissionInfo.cs +++ b/DNN Platform/Library/Security/Permissions/TabPermissionInfo.cs @@ -45,8 +45,8 @@ public class TabPermissionInfo : PermissionInfoBase, IHydratable /// ----------------------------------------------------------------------------- public TabPermissionInfo() { - _TabPermissionID = Null.NullInteger; - _TabID = Null.NullInteger; + this._TabPermissionID = Null.NullInteger; + this._TabID = Null.NullInteger; } /// ----------------------------------------------------------------------------- @@ -57,11 +57,11 @@ public TabPermissionInfo() /// ----------------------------------------------------------------------------- public TabPermissionInfo(PermissionInfo permission) : this() { - ModuleDefID = permission.ModuleDefID; - PermissionCode = permission.PermissionCode; - PermissionID = permission.PermissionID; - PermissionKey = permission.PermissionKey; - PermissionName = permission.PermissionName; + this.ModuleDefID = permission.ModuleDefID; + this.PermissionCode = permission.PermissionCode; + this.PermissionID = permission.PermissionID; + this.PermissionKey = permission.PermissionKey; + this.PermissionName = permission.PermissionName; } #endregion @@ -79,11 +79,11 @@ public int TabPermissionID { get { - return _TabPermissionID; + return this._TabPermissionID; } set { - _TabPermissionID = value; + this._TabPermissionID = value; } } @@ -98,11 +98,11 @@ public int TabID { get { - return _TabID; + return this._TabID; } set { - _TabID = value; + this._TabID = value; } } @@ -120,8 +120,8 @@ public void Fill(IDataReader dr) { //Call the base classes fill method to ppoulate base class proeprties base.FillInternal(dr); - TabPermissionID = Null.SetNullInteger(dr["TabPermissionID"]); - TabID = Null.SetNullInteger(dr["TabID"]); + this.TabPermissionID = Null.SetNullInteger(dr["TabPermissionID"]); + this.TabID = Null.SetNullInteger(dr["TabID"]); } /// ----------------------------------------------------------------------------- @@ -135,11 +135,11 @@ public int KeyID { get { - return TabPermissionID; + return this.TabPermissionID; } set { - TabPermissionID = value; + this.TabPermissionID = value; } } diff --git a/DNN Platform/Library/Security/PortalSecurity.cs b/DNN Platform/Library/Security/PortalSecurity.cs index b923b465f49..293a2e84078 100644 --- a/DNN Platform/Library/Security/PortalSecurity.cs +++ b/DNN Platform/Library/Security/PortalSecurity.cs @@ -476,7 +476,7 @@ public string InputFilter(string userInput, FilterFlag filterType) } if ((filterType & FilterFlag.NoScripting) == FilterFlag.NoScripting) { - tempInput = FormatDisableScripting(tempInput); + tempInput = this.FormatDisableScripting(tempInput); } if ((filterType & FilterFlag.MultiLine) == FilterFlag.MultiLine) { @@ -484,7 +484,7 @@ public string InputFilter(string userInput, FilterFlag filterType) } if ((filterType & FilterFlag.NoProfanity) == FilterFlag.NoProfanity) { - tempInput = Replace(tempInput, ConfigType.ListController, "ProfanityFilter", FilterScope.SystemAndPortalList); + tempInput = this.Replace(tempInput, ConfigType.ListController, "ProfanityFilter", FilterScope.SystemAndPortalList); } return tempInput; } @@ -805,7 +805,7 @@ private static void InvalidateAspNetSession(HttpContext context) ///----------------------------------------------------------------------------- public bool ValidateInput(string userInput, FilterFlag filterType) { - string filteredInput = InputFilter(userInput, filterType); + string filteredInput = this.InputFilter(userInput, filterType); return (userInput == filteredInput); } diff --git a/DNN Platform/Library/Security/Profile/DNNProfileProvider.cs b/DNN Platform/Library/Security/Profile/DNNProfileProvider.cs index ffacf6ea236..eff747dc4ba 100644 --- a/DNN Platform/Library/Security/Profile/DNNProfileProvider.cs +++ b/DNN Platform/Library/Security/Profile/DNNProfileProvider.cs @@ -58,7 +58,7 @@ private void UpdateTimeZoneInfo(UserInfo user, ProfilePropertyDefinitionCollecti int.TryParse(oldTimeZone.PropertyValue, out oldOffset); TimeZoneInfo timeZoneInfo = Localization.ConvertLegacyTimeZoneOffsetToTimeZoneInfo(oldOffset); newTimeZone.PropertyValue = timeZoneInfo.Id; - UpdateUserProfile(user); + this.UpdateUserProfile(user); } //It's also possible that the new value is set but not the old value. We need to make them backwards compatible else if (!string.IsNullOrEmpty(newTimeZone.PropertyValue) && string.IsNullOrEmpty(oldTimeZone.PropertyValue)) @@ -108,7 +108,7 @@ public override void GetUserProfile(ref UserInfo user) //Load the Profile properties if (user.UserID > Null.NullInteger) { - var key = GetProfileCacheKey(user); + var key = this.GetProfileCacheKey(user); var cachedProperties = (ProfilePropertyDefinitionCollection)DataCache.GetCache(key); if (cachedProperties != null) { @@ -116,7 +116,7 @@ public override void GetUserProfile(ref UserInfo user) } else { - using (var dr = _dataProvider.GetUserProfile(user.UserID)) + using (var dr = this._dataProvider.GetUserProfile(user.UserID)) { while (dr.Read()) { @@ -169,7 +169,7 @@ public override void GetUserProfile(ref UserInfo user) user.Profile.ClearIsDirty(); //Ensure old and new TimeZone properties are in synch - UpdateTimeZoneInfo(user, properties); + this.UpdateTimeZoneInfo(user, properties); } /// ----------------------------------------------------------------------------- @@ -182,7 +182,7 @@ public override void GetUserProfile(ref UserInfo user) /// ----------------------------------------------------------------------------- public override void UpdateUserProfile(UserInfo user) { - var key = GetProfileCacheKey(user); + var key = this.GetProfileCacheKey(user); DataCache.ClearCache(key); ProfilePropertyDefinitionCollection properties = user.Profile.ProfileProperties; @@ -213,7 +213,7 @@ public override void UpdateUserProfile(UserInfo user) { var objSecurity = PortalSecurity.Instance; string propertyValue = objSecurity.InputFilter(profProperty.PropertyValue, PortalSecurity.FilterFlag.NoScripting); - _dataProvider.UpdateProfileProperty(Null.NullInteger, user.UserID, profProperty.PropertyDefinitionId, + this._dataProvider.UpdateProfileProperty(Null.NullInteger, user.UserID, profProperty.PropertyDefinitionId, propertyValue, (int) profProperty.ProfileVisibility.VisibilityMode, profProperty.ProfileVisibility.ExtendedVisibilityString(), DateTime.Now); EventLogController.Instance.AddLog(user, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, "", "USERPROFILE_UPDATED"); diff --git a/DNN Platform/Library/Security/RegistrationSettings.cs b/DNN Platform/Library/Security/RegistrationSettings.cs index 808b79be873..0ffff1f3f20 100644 --- a/DNN Platform/Library/Security/RegistrationSettings.cs +++ b/DNN Platform/Library/Security/RegistrationSettings.cs @@ -38,48 +38,48 @@ public class RegistrationSettings public RegistrationSettings() { - RandomPassword = false; - RedirectAfterRegistration = -1; - RedirectAfterLogout = -1; - RedirectAfterLogin = -1; - RegistrationFields = string.Empty; - ExcludeTerms = string.Empty; - ExcludeTermsRegex = Null.NullString; - RegistrationFormType = 0; - RequirePasswordConfirm = true; - RequireUniqueDisplayName = false; - UseAuthProviders = false; - UseEmailAsUserName = false; - UseProfanityFilter = false; - RequireValidProfile = false; - RequireValidProfileAtLogin = true; - UseCaptcha = false; - UserNameValidator = Globals.glbUserNameRegEx; - DisplayNameFormat = string.Empty; - EmailValidator = Globals.glbEmailRegEx; + this.RandomPassword = false; + this.RedirectAfterRegistration = -1; + this.RedirectAfterLogout = -1; + this.RedirectAfterLogin = -1; + this.RegistrationFields = string.Empty; + this.ExcludeTerms = string.Empty; + this.ExcludeTermsRegex = Null.NullString; + this.RegistrationFormType = 0; + this.RequirePasswordConfirm = true; + this.RequireUniqueDisplayName = false; + this.UseAuthProviders = false; + this.UseEmailAsUserName = false; + this.UseProfanityFilter = false; + this.RequireValidProfile = false; + this.RequireValidProfileAtLogin = true; + this.UseCaptcha = false; + this.UserNameValidator = Globals.glbUserNameRegEx; + this.DisplayNameFormat = string.Empty; + this.EmailValidator = Globals.glbEmailRegEx; } public RegistrationSettings(Dictionary settings): this() { - RandomPassword = settings.GetValueOrDefault("Registration_RandomPassword", RandomPassword); - RedirectAfterRegistration = settings.GetValueOrDefault("Redirect_AfterRegistration", RedirectAfterRegistration); - RedirectAfterLogout = settings.GetValueOrDefault("Redirect_AfterLogout", RedirectAfterLogout); - RedirectAfterLogin = settings.GetValueOrDefault("Redirect_AfterLogin", RedirectAfterLogin); - RegistrationFields = settings.GetValueOrDefault("Registration_RegistrationFields", RegistrationFields); - ExcludeTerms = settings.GetValueOrDefault("Registration_ExcludeTerms", ExcludeTerms); - RegistrationFormType = settings.GetValueOrDefault("Registration_RegistrationFormType", RegistrationFormType); - RequirePasswordConfirm = settings.GetValueOrDefault("Registration_RequireConfirmPassword", RequirePasswordConfirm); - RequireUniqueDisplayName = settings.GetValueOrDefault("Registration_RequireUniqueDisplayName", RequireUniqueDisplayName); - UseAuthProviders = settings.GetValueOrDefault("Registration_UseAuthProviders", UseAuthProviders); - UseEmailAsUserName = settings.GetValueOrDefault("Registration_UseEmailAsUserName", UseEmailAsUserName); - UseProfanityFilter = settings.GetValueOrDefault("Registration_UseProfanityFilter", UseProfanityFilter); - RequireValidProfile = settings.GetValueOrDefault("Security_RequireValidProfile", RequireValidProfile); - RequireValidProfileAtLogin = settings.GetValueOrDefault("Security_RequireValidProfileAtLogin", RequireValidProfileAtLogin); - UseCaptcha = settings.GetValueOrDefault("Security_CaptchaRegister", UseCaptcha); - UserNameValidator = settings.GetValueOrDefault("Security_UserNameValidation", UserNameValidator); - DisplayNameFormat = settings.GetValueOrDefault("Security_DisplayNameFormat", DisplayNameFormat); - EmailValidator = settings.GetValueOrDefault("Security_EmailValidation", EmailValidator); + this.RandomPassword = settings.GetValueOrDefault("Registration_RandomPassword", this.RandomPassword); + this.RedirectAfterRegistration = settings.GetValueOrDefault("Redirect_AfterRegistration", this.RedirectAfterRegistration); + this.RedirectAfterLogout = settings.GetValueOrDefault("Redirect_AfterLogout", this.RedirectAfterLogout); + this.RedirectAfterLogin = settings.GetValueOrDefault("Redirect_AfterLogin", this.RedirectAfterLogin); + this.RegistrationFields = settings.GetValueOrDefault("Registration_RegistrationFields", this.RegistrationFields); + this.ExcludeTerms = settings.GetValueOrDefault("Registration_ExcludeTerms", this.ExcludeTerms); + this.RegistrationFormType = settings.GetValueOrDefault("Registration_RegistrationFormType", this.RegistrationFormType); + this.RequirePasswordConfirm = settings.GetValueOrDefault("Registration_RequireConfirmPassword", this.RequirePasswordConfirm); + this.RequireUniqueDisplayName = settings.GetValueOrDefault("Registration_RequireUniqueDisplayName", this.RequireUniqueDisplayName); + this.UseAuthProviders = settings.GetValueOrDefault("Registration_UseAuthProviders", this.UseAuthProviders); + this.UseEmailAsUserName = settings.GetValueOrDefault("Registration_UseEmailAsUserName", this.UseEmailAsUserName); + this.UseProfanityFilter = settings.GetValueOrDefault("Registration_UseProfanityFilter", this.UseProfanityFilter); + this.RequireValidProfile = settings.GetValueOrDefault("Security_RequireValidProfile", this.RequireValidProfile); + this.RequireValidProfileAtLogin = settings.GetValueOrDefault("Security_RequireValidProfileAtLogin", this.RequireValidProfileAtLogin); + this.UseCaptcha = settings.GetValueOrDefault("Security_CaptchaRegister", this.UseCaptcha); + this.UserNameValidator = settings.GetValueOrDefault("Security_UserNameValidation", this.UserNameValidator); + this.DisplayNameFormat = settings.GetValueOrDefault("Security_DisplayNameFormat", this.DisplayNameFormat); + this.EmailValidator = settings.GetValueOrDefault("Security_EmailValidation", this.EmailValidator); - ExcludeTermsRegex = "^(?:(?!" + ExcludeTerms.Replace(" ", "").Replace(",", "|") + ").)*$\\r?\\n?"; + this.ExcludeTermsRegex = "^(?:(?!" + this.ExcludeTerms.Replace(" ", "").Replace(",", "|") + ").)*$\\r?\\n?"; } #endregion diff --git a/DNN Platform/Library/Security/Roles/DNNRoleProvider.cs b/DNN Platform/Library/Security/Roles/DNNRoleProvider.cs index 903e97661c9..90ac7e14107 100644 --- a/DNN Platform/Library/Security/Roles/DNNRoleProvider.cs +++ b/DNN Platform/Library/Security/Roles/DNNRoleProvider.cs @@ -45,7 +45,7 @@ public class DNNRoleProvider : RoleProvider private void AddDNNUserRole(UserRoleInfo userRole) { //Add UserRole to DNN - userRole.UserRoleID = Convert.ToInt32(dataProvider.AddUserRole(userRole.PortalID, userRole.UserID, userRole.RoleID, + userRole.UserRoleID = Convert.ToInt32(this.dataProvider.AddUserRole(userRole.PortalID, userRole.UserID, userRole.RoleID, (int)userRole.Status, userRole.IsOwner, userRole.EffectiveDate, userRole.ExpiryDate, UserController.Instance.GetCurrentUserInfo().UserID)); @@ -71,7 +71,7 @@ public override bool CreateRole(RoleInfo role) try { role.RoleID = - Convert.ToInt32(dataProvider.AddRole(role.PortalID, + Convert.ToInt32(this.dataProvider.AddRole(role.PortalID, role.RoleGroupID, role.RoleName.Trim(), (role.Description ?? "").Trim(), @@ -106,7 +106,7 @@ public override bool CreateRole(RoleInfo role) /// ----------------------------------------------------------------------------- public override void DeleteRole(RoleInfo role) { - dataProvider.DeleteRole(role.RoleID); + this.dataProvider.DeleteRole(role.RoleID); } /// ----------------------------------------------------------------------------- @@ -120,20 +120,20 @@ public override void DeleteRole(RoleInfo role) public override ArrayList GetRoles(int portalId) { var arrRoles = CBO.FillCollection(portalId == Null.NullInteger - ? dataProvider.GetRoles() - : dataProvider.GetPortalRoles(portalId), typeof (RoleInfo)); + ? this.dataProvider.GetRoles() + : this.dataProvider.GetPortalRoles(portalId), typeof (RoleInfo)); return arrRoles; } public override IList GetRolesBasicSearch(int portalID, int pageSize, string filterBy) { - return CBO.FillCollection(dataProvider.GetRolesBasicSearch(portalID, -1, pageSize, filterBy)); + return CBO.FillCollection(this.dataProvider.GetRolesBasicSearch(portalID, -1, pageSize, filterBy)); } public override IDictionary GetRoleSettings(int roleId) { var settings = new Dictionary { }; - using (IDataReader dr = dataProvider.GetRoleSettings(roleId)) { + using (IDataReader dr = this.dataProvider.GetRoleSettings(roleId)) { while (dr.Read()) { settings.Add(dr["SettingName"].ToString(), dr["SettingValue"].ToString()); } @@ -150,7 +150,7 @@ public override IDictionary GetRoleSettings(int roleId) /// ----------------------------------------------------------------------------- public override void UpdateRole(RoleInfo role) { - dataProvider.UpdateRole(role.RoleID, + this.dataProvider.UpdateRole(role.RoleID, role.RoleGroupID, role.RoleName.Trim(), (role.Description ?? "").Trim(), @@ -178,13 +178,13 @@ public override void UpdateRole(RoleInfo role) /// ----------------------------------------------------------------------------- public override void UpdateRoleSettings(RoleInfo role) { - var currentSettings = GetRoleSettings(role.RoleID); + var currentSettings = this.GetRoleSettings(role.RoleID); foreach (var setting in role.Settings) { if (!currentSettings.ContainsKey(setting.Key) || currentSettings[setting.Key] != setting.Value) { - dataProvider.UpdateRoleSetting(role.RoleID, setting.Key, setting.Value, UserController.Instance.GetCurrentUserInfo().UserID); + this.dataProvider.UpdateRoleSetting(role.RoleID, setting.Key, setting.Value, UserController.Instance.GetCurrentUserInfo().UserID); } } } @@ -210,7 +210,7 @@ public override bool AddUserToRole(int portalId, UserInfo user, UserRoleInfo use try { //Add UserRole to DNN - AddDNNUserRole(userRole); + this.AddDNNUserRole(userRole); } catch (Exception exc) { @@ -235,7 +235,7 @@ public override bool AddUserToRole(int portalId, UserInfo user, UserRoleInfo use /// ----------------------------------------------------------------------------- public override UserRoleInfo GetUserRole(int portalId, int userId, int roleId) { - return CBO.FillObject(dataProvider.GetUserRole(portalId, userId, roleId)); + return CBO.FillObject(this.dataProvider.GetUserRole(portalId, userId, roleId)); } /// @@ -249,8 +249,8 @@ public override IList GetUserRoles(UserInfo user, bool includePriv Requires.NotNull("user", user); return CBO.FillCollection(includePrivate - ? dataProvider.GetUserRoles(user.PortalID, user.UserID) - : dataProvider.GetServices(user.PortalID, user.UserID)); + ? this.dataProvider.GetUserRoles(user.PortalID, user.UserID) + : this.dataProvider.GetServices(user.PortalID, user.UserID)); } /// ----------------------------------------------------------------------------- @@ -266,7 +266,7 @@ public override IList GetUserRoles(UserInfo user, bool includePriv /// ----------------------------------------------------------------------------- public override ArrayList GetUserRoles(int portalId, string userName, string roleName) { - return CBO.FillCollection(dataProvider.GetUserRolesByUsername(portalId, userName, roleName), typeof (UserRoleInfo)); + return CBO.FillCollection(this.dataProvider.GetUserRolesByUsername(portalId, userName, roleName), typeof (UserRoleInfo)); } /// ----------------------------------------------------------------------------- @@ -280,7 +280,7 @@ public override ArrayList GetUserRoles(int portalId, string userName, string rol /// ----------------------------------------------------------------------------- public override ArrayList GetUsersByRoleName(int portalId, string roleName) { - return AspNetMembershipProvider.FillUserCollection(portalId, dataProvider.GetUsersByRolename(portalId, roleName)); + return AspNetMembershipProvider.FillUserCollection(portalId, this.dataProvider.GetUsersByRolename(portalId, roleName)); } /// ----------------------------------------------------------------------------- @@ -295,7 +295,7 @@ public override ArrayList GetUsersByRoleName(int portalId, string roleName) /// ----------------------------------------------------------------------------- public override void RemoveUserFromRole(int portalId, UserInfo user, UserRoleInfo userRole) { - dataProvider.DeleteUserRole(userRole.UserID, userRole.RoleID); + this.dataProvider.DeleteUserRole(userRole.UserID, userRole.RoleID); } /// ----------------------------------------------------------------------------- @@ -306,7 +306,7 @@ public override void RemoveUserFromRole(int portalId, UserInfo user, UserRoleInf /// ----------------------------------------------------------------------------- public override void UpdateUserRole(UserRoleInfo userRole) { - dataProvider.UpdateUserRole(userRole.UserRoleID, + this.dataProvider.UpdateUserRole(userRole.UserRoleID, (int)userRole.Status, userRole.IsOwner, userRole.EffectiveDate, userRole.ExpiryDate, UserController.Instance.GetCurrentUserInfo().UserID); @@ -318,7 +318,7 @@ public override void UpdateUserRole(UserRoleInfo userRole) private void ClearRoleGroupCache(int portalId) { - DataCache.ClearCache(GetRoleGroupsCacheKey(portalId)); + DataCache.ClearCache(this.GetRoleGroupsCacheKey(portalId)); } private string GetRoleGroupsCacheKey(int portalId) @@ -337,10 +337,10 @@ private string GetRoleGroupsCacheKey(int portalId) /// ----------------------------------------------------------------------------- public override int CreateRoleGroup(RoleGroupInfo roleGroup) { - var roleGroupId = dataProvider.AddRoleGroup(roleGroup.PortalID, roleGroup.RoleGroupName.Trim(), + var roleGroupId = this.dataProvider.AddRoleGroup(roleGroup.PortalID, roleGroup.RoleGroupName.Trim(), (roleGroup.Description ?? "").Trim(), UserController.Instance.GetCurrentUserInfo().UserID); - ClearRoleGroupCache(roleGroup.PortalID); + this.ClearRoleGroupCache(roleGroup.PortalID); return roleGroupId; } @@ -352,8 +352,8 @@ public override int CreateRoleGroup(RoleGroupInfo roleGroup) /// ----------------------------------------------------------------------------- public override void DeleteRoleGroup(RoleGroupInfo roleGroup) { - dataProvider.DeleteRoleGroup(roleGroup.RoleGroupID); - ClearRoleGroupCache(roleGroup.PortalID); + this.dataProvider.DeleteRoleGroup(roleGroup.RoleGroupID); + this.ClearRoleGroupCache(roleGroup.PortalID); } /// ----------------------------------------------------------------------------- @@ -366,13 +366,13 @@ public override void DeleteRoleGroup(RoleGroupInfo roleGroup) /// ----------------------------------------------------------------------------- public override RoleGroupInfo GetRoleGroup(int portalId, int roleGroupId) { - return GetRoleGroupsInternal(portalId).SingleOrDefault(r => r.RoleGroupID == roleGroupId); + return this.GetRoleGroupsInternal(portalId).SingleOrDefault(r => r.RoleGroupID == roleGroupId); } public override RoleGroupInfo GetRoleGroupByName(int portalId, string roleGroupName) { roleGroupName = roleGroupName.Trim(); - return GetRoleGroupsInternal(portalId).SingleOrDefault( + return this.GetRoleGroupsInternal(portalId).SingleOrDefault( r => roleGroupName.Equals(r.RoleGroupName.Trim(), StringComparison.InvariantCultureIgnoreCase)); } @@ -385,17 +385,17 @@ public override RoleGroupInfo GetRoleGroupByName(int portalId, string roleGroupN /// ----------------------------------------------------------------------------- public override ArrayList GetRoleGroups(int portalId) { - return new ArrayList(GetRoleGroupsInternal(portalId).ToList()); + return new ArrayList(this.GetRoleGroupsInternal(portalId).ToList()); } private IEnumerable GetRoleGroupsInternal(int portalId) { - var cacheArgs = new CacheItemArgs(GetRoleGroupsCacheKey(portalId), + var cacheArgs = new CacheItemArgs(this.GetRoleGroupsCacheKey(portalId), DataCache.RoleGroupsCacheTimeOut, DataCache.RoleGroupsCachePriority); return CBO.GetCachedObject>(cacheArgs, c => - CBO.FillCollection(dataProvider.GetRoleGroups(portalId))); + CBO.FillCollection(this.dataProvider.GetRoleGroups(portalId))); } /// ----------------------------------------------------------------------------- @@ -406,9 +406,9 @@ private IEnumerable GetRoleGroupsInternal(int portalId) /// ----------------------------------------------------------------------------- public override void UpdateRoleGroup(RoleGroupInfo roleGroup) { - dataProvider.UpdateRoleGroup(roleGroup.RoleGroupID, roleGroup.RoleGroupName.Trim(), + this.dataProvider.UpdateRoleGroup(roleGroup.RoleGroupID, roleGroup.RoleGroupName.Trim(), (roleGroup.Description ?? "").Trim(), UserController.Instance.GetCurrentUserInfo().UserID); - ClearRoleGroupCache(roleGroup.PortalID); + this.ClearRoleGroupCache(roleGroup.PortalID); } diff --git a/DNN Platform/Library/Security/Roles/RoleController.cs b/DNN Platform/Library/Security/Roles/RoleController.cs index 314719ea84f..bc2e0c50eba 100644 --- a/DNN Platform/Library/Security/Roles/RoleController.cs +++ b/DNN Platform/Library/Security/Roles/RoleController.cs @@ -71,7 +71,7 @@ private void AutoAssignUsers(RoleInfo role) { try { - AddUserRole(role.PortalID, objUser.UserID, role.RoleID, RoleStatus.Approved, false, Null.NullDate, Null.NullDate); + this.AddUserRole(role.PortalID, objUser.UserID, role.RoleID, RoleStatus.Approved, false, Null.NullDate, Null.NullDate); } catch (Exception exc) { @@ -171,14 +171,14 @@ int IRoleController.AddRole(RoleInfo role, bool addToExistUsers) var roleId = -1; if (provider.CreateRole(role)) { - AddMessage(role, EventLogController.EventLogType.ROLE_CREATED); + this.AddMessage(role, EventLogController.EventLogType.ROLE_CREATED); if (addToExistUsers) { - AutoAssignUsers(role); + this.AutoAssignUsers(role); } roleId = role.RoleID; - ClearRoleCache(role.PortalID); + this.ClearRoleCache(role.PortalID); EventManager.Instance.OnRoleCreated(new RoleEventArgs() { Role = role }); } @@ -189,7 +189,7 @@ int IRoleController.AddRole(RoleInfo role, bool addToExistUsers) public void AddUserRole(int portalId, int userId, int roleId, RoleStatus status, bool isOwner, DateTime effectiveDate, DateTime expiryDate) { UserInfo user = UserController.GetUserById(portalId, userId); - UserRoleInfo userRole = GetUserRole(portalId, userId, roleId); + UserRoleInfo userRole = this.GetUserRole(portalId, userId, roleId); if (userRole == null) { //Create new UserRole @@ -216,7 +216,7 @@ public void AddUserRole(int portalId, int userId, int roleId, RoleStatus status, EventLogController.Instance.AddLog(userRole, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, "", EventLogController.EventLogType.USER_ROLE_UPDATED); } - EventManager.Instance.OnRoleJoined(new RoleEventArgs() { Role = GetRoleById(portalId, roleId), User = user }); + EventManager.Instance.OnRoleJoined(new RoleEventArgs() { Role = this.GetRoleById(portalId, roleId), User = user }); //Remove the UserInfo and Roles from the Cache, as they have been modified DataCache.ClearUserCache(portalId, user.Username); Instance.ClearRoleCache(portalId); @@ -235,7 +235,7 @@ public void DeleteRole(RoleInfo role) { Requires.NotNull("role", role); - AddMessage(role, EventLogController.EventLogType.ROLE_DELETED); + this.AddMessage(role, EventLogController.EventLogType.ROLE_DELETED); if (role.SecurityMode != SecurityMode.SecurityRole) { @@ -255,7 +255,7 @@ public void DeleteRole(RoleInfo role) } //Get users before deleting role - var users = role.UserCount > 0 ? GetUsersByRole(role.PortalID, role.RoleName) : Enumerable.Empty(); + var users = role.UserCount > 0 ? this.GetUsersByRole(role.PortalID, role.RoleName) : Enumerable.Empty(); provider.DeleteRole(role); @@ -267,7 +267,7 @@ public void DeleteRole(RoleInfo role) DataCache.ClearUserCache(role.PortalID, user.Username); } - ClearRoleCache(role.PortalID); + this.ClearRoleCache(role.PortalID); // queue remove role/group from search index var document = new SearchDocumentToDelete @@ -281,18 +281,18 @@ public void DeleteRole(RoleInfo role) public RoleInfo GetRole(int portalId, Func predicate) { - return GetRoles(portalId).Where(predicate).FirstOrDefault(); + return this.GetRoles(portalId).Where(predicate).FirstOrDefault(); } public RoleInfo GetRoleById(int portalId, int roleId) { - return GetRole(portalId, r => r.RoleID == roleId); + return this.GetRole(portalId, r => r.RoleID == roleId); } public RoleInfo GetRoleByName(int portalId, string roleName) { roleName = roleName.Trim(); - return GetRoles(portalId).SingleOrDefault(r => roleName.Equals(r.RoleName.Trim(), StringComparison.InvariantCultureIgnoreCase) && r.PortalID == portalId); + return this.GetRoles(portalId).SingleOrDefault(r => roleName.Equals(r.RoleName.Trim(), StringComparison.InvariantCultureIgnoreCase) && r.PortalID == portalId); } public IList GetRoles(int portalId) @@ -304,7 +304,7 @@ public IList GetRoles(int portalId) public IList GetRoles(int portalId, Func predicate) { - return GetRoles(portalId).Where(predicate).ToList(); + return this.GetRoles(portalId).Where(predicate).ToList(); } public IList GetRolesBasicSearch(int portalId, int pageSize, string filterBy) @@ -352,7 +352,7 @@ public IList GetUsersByRole(int portalId, string roleName) void IRoleController.UpdateRole(RoleInfo role) { - UpdateRole(role, true); + this.UpdateRole(role, true); } public void UpdateRole(RoleInfo role, bool addToExistUsers) @@ -360,14 +360,14 @@ public void UpdateRole(RoleInfo role, bool addToExistUsers) Requires.NotNull("role", role); provider.UpdateRole(role); - AddMessage(role, EventLogController.EventLogType.ROLE_UPDATED); + this.AddMessage(role, EventLogController.EventLogType.ROLE_UPDATED); if (addToExistUsers) { - AutoAssignUsers(role); + this.AutoAssignUsers(role); } - ClearRoleCache(role.PortalID); + this.ClearRoleCache(role.PortalID); } public void UpdateRoleSettings(RoleInfo role, bool clearCache) @@ -376,14 +376,14 @@ public void UpdateRoleSettings(RoleInfo role, bool clearCache) if (clearCache) { - ClearRoleCache(role.PortalID); + this.ClearRoleCache(role.PortalID); } } public void UpdateUserRole(int portalId, int userId, int roleId, RoleStatus status, bool isOwner, bool cancel) { UserInfo user = UserController.GetUserById(portalId, userId); - UserRoleInfo userRole = GetUserRole(portalId, userId, roleId); + UserRoleInfo userRole = this.GetUserRole(portalId, userId, roleId); if (cancel) { if (userRole != null && userRole.ServiceFee > 0.0 && userRole.IsTrialUsed) @@ -481,7 +481,7 @@ public void UpdateUserRole(int portalId, int userId, int roleId, RoleStatus stat } else { - AddUserRole(portalId, userId, roleId, status, isOwner, EffectiveDate, ExpiryDate); + this.AddUserRole(portalId, userId, roleId, status, isOwner, EffectiveDate, ExpiryDate); } } //Remove the UserInfo from the Cache, as it has been modified diff --git a/DNN Platform/Library/Security/Roles/RoleGroupInfo.cs b/DNN Platform/Library/Security/Roles/RoleGroupInfo.cs index 023bd131ec9..aa66d1fc9ff 100644 --- a/DNN Platform/Library/Security/Roles/RoleGroupInfo.cs +++ b/DNN Platform/Library/Security/Roles/RoleGroupInfo.cs @@ -50,11 +50,11 @@ public RoleGroupInfo() public RoleGroupInfo(int roleGroupID, int portalID, bool loadRoles) { - _PortalID = portalID; - _RoleGroupID = roleGroupID; + this._PortalID = portalID; + this._RoleGroupID = roleGroupID; if (loadRoles) { - GetRoles(); + this.GetRoles(); } } @@ -72,11 +72,11 @@ public int RoleGroupID { get { - return _RoleGroupID; + return this._RoleGroupID; } set { - _RoleGroupID = value; + this._RoleGroupID = value; } } @@ -90,11 +90,11 @@ public int PortalID { get { - return _PortalID; + return this._PortalID; } set { - _PortalID = value; + this._PortalID = value; } } @@ -108,11 +108,11 @@ public string RoleGroupName { get { - return _RoleGroupName; + return this._RoleGroupName; } set { - _RoleGroupName = value; + this._RoleGroupName = value; } } @@ -126,11 +126,11 @@ public string Description { get { - return _Description; + return this._Description; } set { - _Description = value; + this._Description = value; } } @@ -144,11 +144,11 @@ public Dictionary Roles { get { - if (_Roles == null && RoleGroupID > Null.NullInteger) + if (this._Roles == null && this.RoleGroupID > Null.NullInteger) { - GetRoles(); + this.GetRoles(); } - return _Roles; + return this._Roles; } } @@ -164,13 +164,13 @@ public Dictionary Roles /// ----------------------------------------------------------------------------- public void Fill(IDataReader dr) { - RoleGroupID = Null.SetNullInteger(dr["RoleGroupId"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - RoleGroupName = Null.SetNullString(dr["RoleGroupName"]); - Description = Null.SetNullString(dr["Description"]); + this.RoleGroupID = Null.SetNullInteger(dr["RoleGroupId"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.RoleGroupName = Null.SetNullString(dr["RoleGroupName"]); + this.Description = Null.SetNullString(dr["Description"]); //Fill base class fields - FillInternal(dr); + this.FillInternal(dr); } /// ----------------------------------------------------------------------------- @@ -183,11 +183,11 @@ public int KeyID { get { - return RoleGroupID; + return this.RoleGroupID; } set { - RoleGroupID = value; + this.RoleGroupID = value; } } @@ -232,14 +232,14 @@ public void ReadXml(XmlReader reader) case "roles": if (!reader.IsEmptyElement) { - ReadRoles(reader); + this.ReadRoles(reader); } break; case "rolegroupname": - RoleGroupName = reader.ReadElementContentAsString(); + this.RoleGroupName = reader.ReadElementContentAsString(); break; case "description": - Description = reader.ReadElementContentAsString(); + this.Description = reader.ReadElementContentAsString(); break; default: if(reader.NodeType == XmlNodeType.Element && !String.IsNullOrEmpty(reader.Name)) @@ -264,16 +264,16 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("rolegroup"); //write out properties - writer.WriteElementString("rolegroupname", RoleGroupName); - writer.WriteElementString("description", Description); + writer.WriteElementString("rolegroupname", this.RoleGroupName); + writer.WriteElementString("description", this.Description); //Write start of roles writer.WriteStartElement("roles"); //Iterate through roles - if (Roles != null) + if (this.Roles != null) { - foreach (RoleInfo role in Roles.Values) + foreach (RoleInfo role in this.Roles.Values) { role.WriteXml(writer); } @@ -290,10 +290,10 @@ public void WriteXml(XmlWriter writer) private void GetRoles() { - _Roles = new Dictionary(); - foreach (var role in RoleController.Instance.GetRoles(PortalID, r => r.RoleGroupID == RoleGroupID)) + this._Roles = new Dictionary(); + foreach (var role in RoleController.Instance.GetRoles(this.PortalID, r => r.RoleGroupID == this.RoleGroupID)) { - _Roles[role.RoleName] = role; + this._Roles[role.RoleName] = role; } } @@ -306,13 +306,13 @@ private void GetRoles() private void ReadRoles(XmlReader reader) { reader.ReadStartElement("roles"); - _Roles = new Dictionary(); + this._Roles = new Dictionary(); do { reader.ReadStartElement("role"); var role = new RoleInfo(); role.ReadXml(reader); - _Roles.Add(role.RoleName, role); + this._Roles.Add(role.RoleName, role); } while (reader.ReadToNextSibling("role")); } } diff --git a/DNN Platform/Library/Security/Roles/RoleInfo.cs b/DNN Platform/Library/Security/Roles/RoleInfo.cs index b1da177a756..34f0b133a9c 100644 --- a/DNN Platform/Library/Security/Roles/RoleInfo.cs +++ b/DNN Platform/Library/Security/Roles/RoleInfo.cs @@ -45,10 +45,10 @@ public class RoleInfo : BaseEntityInfo, IHydratable, IXmlSerializable, IProperty public RoleInfo() { - TrialFrequency = "N"; - BillingFrequency = "N"; - RoleID = Null.NullInteger; - IsSystemRole = false; + this.TrialFrequency = "N"; + this.BillingFrequency = "N"; + this.RoleID = Null.NullInteger; + this.IsSystemRole = false; } #region Public Properties @@ -160,12 +160,12 @@ public RoleType RoleType { get { - if (!_RoleTypeSet) + if (!this._RoleTypeSet) { - GetRoleType(); - _RoleTypeSet = true; + this.GetRoleType(); + this._RoleTypeSet = true; } - return _RoleType; + return this._RoleType; } } @@ -204,9 +204,9 @@ public Dictionary Settings { get { - return _settings ?? (_settings = (RoleID == Null.NullInteger) + return this._settings ?? (this._settings = (this.RoleID == Null.NullInteger) ? new Dictionary() - : RoleController.Instance.GetRoleSettings(RoleID) as + : RoleController.Instance.GetRoleSettings(this.RoleID) as Dictionary); } } @@ -266,12 +266,12 @@ public string PhotoURL { string photoURL = Globals.ApplicationPath + "/images/sample-group-profile.jpg"; - if ((IconFile != null)) + if ((this.IconFile != null)) { - if (!string.IsNullOrEmpty(IconFile)) + if (!string.IsNullOrEmpty(this.IconFile)) { IFileInfo fileInfo = - FileManager.Instance.GetFile(int.Parse(IconFile.Replace("FileID=", string.Empty))); + FileManager.Instance.GetFile(int.Parse(this.IconFile.Replace("FileID=", string.Empty))); if ((fileInfo != null)) { photoURL = FileManager.Instance.GetUrl(fileInfo); @@ -288,22 +288,22 @@ public string PhotoURL private void GetRoleType() { - var portal = PortalController.Instance.GetPortal(PortalID); - if (RoleID == portal.AdministratorRoleId) + var portal = PortalController.Instance.GetPortal(this.PortalID); + if (this.RoleID == portal.AdministratorRoleId) { - _RoleType = RoleType.Administrator; + this._RoleType = RoleType.Administrator; } - else if (RoleID == portal.RegisteredRoleId) + else if (this.RoleID == portal.RegisteredRoleId) { - _RoleType = RoleType.RegisteredUser; + this._RoleType = RoleType.RegisteredUser; } - else if (RoleName == "Subscribers") + else if (this.RoleName == "Subscribers") { - _RoleType = RoleType.Subscriber; + this._RoleType = RoleType.Subscriber; } - else if (RoleName == "Unverified Users") + else if (this.RoleName == "Unverified Users") { - _RoleType = RoleType.UnverifiedUser; + this._RoleType = RoleType.UnverifiedUser; } } @@ -319,21 +319,21 @@ private void GetRoleType() /// ----------------------------------------------------------------------------- public virtual void Fill(IDataReader dr) { - RoleID = Null.SetNullInteger(dr["RoleId"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - RoleGroupID = Null.SetNullInteger(dr["RoleGroupId"]); - RoleName = Null.SetNullString(dr["RoleName"]); - Description = Null.SetNullString(dr["Description"]); - ServiceFee = Null.SetNullSingle(dr["ServiceFee"]); - BillingPeriod = Null.SetNullInteger(dr["BillingPeriod"]); - BillingFrequency = Null.SetNullString(dr["BillingFrequency"]); - TrialFee = Null.SetNullSingle(dr["TrialFee"]); - TrialPeriod = Null.SetNullInteger(dr["TrialPeriod"]); - TrialFrequency = Null.SetNullString(dr["TrialFrequency"]); - IsPublic = Null.SetNullBoolean(dr["IsPublic"]); - AutoAssignment = Null.SetNullBoolean(dr["AutoAssignment"]); - RSVPCode = Null.SetNullString(dr["RSVPCode"]); - IconFile = Null.SetNullString(dr["IconFile"]); + this.RoleID = Null.SetNullInteger(dr["RoleId"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.RoleGroupID = Null.SetNullInteger(dr["RoleGroupId"]); + this.RoleName = Null.SetNullString(dr["RoleName"]); + this.Description = Null.SetNullString(dr["Description"]); + this.ServiceFee = Null.SetNullSingle(dr["ServiceFee"]); + this.BillingPeriod = Null.SetNullInteger(dr["BillingPeriod"]); + this.BillingFrequency = Null.SetNullString(dr["BillingFrequency"]); + this.TrialFee = Null.SetNullSingle(dr["TrialFee"]); + this.TrialPeriod = Null.SetNullInteger(dr["TrialPeriod"]); + this.TrialFrequency = Null.SetNullString(dr["TrialFrequency"]); + this.IsPublic = Null.SetNullBoolean(dr["IsPublic"]); + this.AutoAssignment = Null.SetNullBoolean(dr["AutoAssignment"]); + this.RSVPCode = Null.SetNullString(dr["RSVPCode"]); + this.IconFile = Null.SetNullString(dr["IconFile"]); //New properties may not be present if called before 6.2 Upgrade has been executed try @@ -342,13 +342,13 @@ public virtual void Fill(IDataReader dr) switch (mode) { case 0: - SecurityMode = SecurityMode.SecurityRole; + this.SecurityMode = SecurityMode.SecurityRole; break; case 1: - SecurityMode = SecurityMode.SocialGroup; + this.SecurityMode = SecurityMode.SocialGroup; break; default: - SecurityMode = SecurityMode.Both; + this.SecurityMode = SecurityMode.Both; break; } @@ -357,13 +357,13 @@ public virtual void Fill(IDataReader dr) switch (status) { case -1: - Status = RoleStatus.Pending; + this.Status = RoleStatus.Pending; break; case 0: - Status = RoleStatus.Disabled; + this.Status = RoleStatus.Disabled; break; default: - Status = RoleStatus.Approved; + this.Status = RoleStatus.Approved; break; } //check for values only relevant to UserRoles @@ -372,11 +372,11 @@ public virtual void Fill(IDataReader dr) { if (schema.Select("ColumnName = 'UserCount'").Length > 0) { - UserCount = Null.SetNullInteger(dr["UserCount"]); + this.UserCount = Null.SetNullInteger(dr["UserCount"]); } if (schema.Select("ColumnName = 'IsSystemRole'").Length > 0) { - IsSystemRole = Null.SetNullBoolean(dr["IsSystemRole"]); + this.IsSystemRole = Null.SetNullBoolean(dr["IsSystemRole"]); } } @@ -389,7 +389,7 @@ public virtual void Fill(IDataReader dr) //Fill base class fields - FillInternal(dr); + this.FillInternal(dr); } /// ----------------------------------------------------------------------------- @@ -400,8 +400,8 @@ public virtual void Fill(IDataReader dr) /// ----------------------------------------------------------------------------- public virtual int KeyID { - get { return RoleID; } - set { RoleID = value; } + get { return this.RoleID; } + set { this.RoleID = value; } } #endregion @@ -429,55 +429,55 @@ public string GetProperty(string propertyName, string format, CultureInfo format switch (propName) { case "roleid": - return PropertyAccess.FormatString(RoleID.ToString(), format); + return PropertyAccess.FormatString(this.RoleID.ToString(), format); case "groupid": - return PropertyAccess.FormatString(RoleID.ToString(), format); + return PropertyAccess.FormatString(this.RoleID.ToString(), format); case "status": - return PropertyAccess.FormatString(Status.ToString(), format); + return PropertyAccess.FormatString(this.Status.ToString(), format); case "groupname": - return PropertyAccess.FormatString(RoleName, format); + return PropertyAccess.FormatString(this.RoleName, format); case "rolename": - return PropertyAccess.FormatString(RoleName, format); + return PropertyAccess.FormatString(this.RoleName, format); case "groupdescription": - return PropertyAccess.FormatString(Description, format); + return PropertyAccess.FormatString(this.Description, format); case "description": - return PropertyAccess.FormatString(Description, format); + return PropertyAccess.FormatString(this.Description, format); case "usercount": - return PropertyAccess.FormatString(UserCount.ToString(), format); + return PropertyAccess.FormatString(this.UserCount.ToString(), format); case "street": - return PropertyAccess.FormatString(GetString("Street", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("Street", string.Empty), format); case "city": - return PropertyAccess.FormatString(GetString("City", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("City", string.Empty), format); case "region": - return PropertyAccess.FormatString(GetString("Region", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("Region", string.Empty), format); case "country": - return PropertyAccess.FormatString(GetString("Country", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("Country", string.Empty), format); case "postalcode": - return PropertyAccess.FormatString(GetString("PostalCode", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("PostalCode", string.Empty), format); case "website": - return PropertyAccess.FormatString(GetString("Website", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("Website", string.Empty), format); case "datecreated": - return PropertyAccess.FormatString(CreatedOnDate.ToString(), format); + return PropertyAccess.FormatString(this.CreatedOnDate.ToString(), format); case "photourl": - return PropertyAccess.FormatString(FormatUrl(PhotoURL), format); + return PropertyAccess.FormatString(this.FormatUrl(this.PhotoURL), format); case "stat_status": - return PropertyAccess.FormatString(GetString("stat_status", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("stat_status", string.Empty), format); case "stat_photo": - return PropertyAccess.FormatString(GetString("stat_photo", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("stat_photo", string.Empty), format); case "stat_file": - return PropertyAccess.FormatString(GetString("stat_file", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("stat_file", string.Empty), format); case "url": - return PropertyAccess.FormatString(FormatUrl(GetString("URL", string.Empty)), format); + return PropertyAccess.FormatString(this.FormatUrl(this.GetString("URL", string.Empty)), format); case "issystemrole": - return PropertyAccess.Boolean2LocalizedYesNo(IsSystemRole, formatProvider); + return PropertyAccess.Boolean2LocalizedYesNo(this.IsSystemRole, formatProvider); case "grouptype": - return IsPublic ? "Public.Text" : "Private.Text"; + return this.IsPublic ? "Public.Text" : "Private.Text"; case "groupcreatorname": - return PropertyAccess.FormatString(GetString("GroupCreatorName", string.Empty), format); + return PropertyAccess.FormatString(this.GetString("GroupCreatorName", string.Empty), format); default: - if (Settings.ContainsKey(propertyName)) + if (this.Settings.ContainsKey(propertyName)) { - return PropertyAccess.FormatString(GetString(propertyName, string.Empty), format); + return PropertyAccess.FormatString(this.GetString(propertyName, string.Empty), format); } propertyNotFound = true; @@ -508,7 +508,7 @@ public XmlSchema GetSchema() public void ReadXml(XmlReader reader) { //Set status to approved by default - Status = RoleStatus.Approved; + this.Status = RoleStatus.Approved; while (reader.Read()) { @@ -527,92 +527,92 @@ public void ReadXml(XmlReader reader) case "role": break; case "rolename": - RoleName = reader.ReadElementContentAsString(); + this.RoleName = reader.ReadElementContentAsString(); break; case "description": - Description = reader.ReadElementContentAsString(); + this.Description = reader.ReadElementContentAsString(); break; case "billingfrequency": - BillingFrequency = reader.ReadElementContentAsString(); - if (string.IsNullOrEmpty(BillingFrequency)) + this.BillingFrequency = reader.ReadElementContentAsString(); + if (string.IsNullOrEmpty(this.BillingFrequency)) { - BillingFrequency = "N"; + this.BillingFrequency = "N"; } break; case "billingperiod": - BillingPeriod = reader.ReadElementContentAsInt(); + this.BillingPeriod = reader.ReadElementContentAsInt(); break; case "servicefee": - ServiceFee = reader.ReadElementContentAsFloat(); - if (ServiceFee < 0) + this.ServiceFee = reader.ReadElementContentAsFloat(); + if (this.ServiceFee < 0) { - ServiceFee = 0; + this.ServiceFee = 0; } break; case "trialfrequency": - TrialFrequency = reader.ReadElementContentAsString(); - if (string.IsNullOrEmpty(TrialFrequency)) + this.TrialFrequency = reader.ReadElementContentAsString(); + if (string.IsNullOrEmpty(this.TrialFrequency)) { - TrialFrequency = "N"; + this.TrialFrequency = "N"; } break; case "trialperiod": - TrialPeriod = reader.ReadElementContentAsInt(); + this.TrialPeriod = reader.ReadElementContentAsInt(); break; case "trialfee": - TrialFee = reader.ReadElementContentAsFloat(); - if (TrialFee < 0) + this.TrialFee = reader.ReadElementContentAsFloat(); + if (this.TrialFee < 0) { - TrialFee = 0; + this.TrialFee = 0; } break; case "ispublic": - IsPublic = reader.ReadElementContentAsBoolean(); + this.IsPublic = reader.ReadElementContentAsBoolean(); break; case "autoassignment": - AutoAssignment = reader.ReadElementContentAsBoolean(); + this.AutoAssignment = reader.ReadElementContentAsBoolean(); break; case "rsvpcode": - RSVPCode = reader.ReadElementContentAsString(); + this.RSVPCode = reader.ReadElementContentAsString(); break; case "iconfile": - IconFile = reader.ReadElementContentAsString(); + this.IconFile = reader.ReadElementContentAsString(); break; case "issystemrole": - IsSystemRole = reader.ReadElementContentAsBoolean(); + this.IsSystemRole = reader.ReadElementContentAsBoolean(); break; case "roletype": switch (reader.ReadElementContentAsString()) { case "adminrole": - _RoleType = RoleType.Administrator; + this._RoleType = RoleType.Administrator; break; case "registeredrole": - _RoleType = RoleType.RegisteredUser; + this._RoleType = RoleType.RegisteredUser; break; case "subscriberrole": - _RoleType = RoleType.Subscriber; + this._RoleType = RoleType.Subscriber; break; case "unverifiedrole": - _RoleType = RoleType.UnverifiedUser; + this._RoleType = RoleType.UnverifiedUser; break; default: - _RoleType = RoleType.None; + this._RoleType = RoleType.None; break; } - _RoleTypeSet = true; + this._RoleTypeSet = true; break; case "securitymode": switch (reader.ReadElementContentAsString()) { case "securityrole": - SecurityMode = SecurityMode.SecurityRole; + this.SecurityMode = SecurityMode.SecurityRole; break; case "socialgroup": - SecurityMode = SecurityMode.SocialGroup; + this.SecurityMode = SecurityMode.SocialGroup; break; case "both": - SecurityMode = SecurityMode.Both; + this.SecurityMode = SecurityMode.Both; break; } break; @@ -620,13 +620,13 @@ public void ReadXml(XmlReader reader) switch (reader.ReadElementContentAsString()) { case "pending": - Status = RoleStatus.Pending; + this.Status = RoleStatus.Pending; break; case "disabled": - Status = RoleStatus.Disabled; + this.Status = RoleStatus.Disabled; break; default: - Status = RoleStatus.Approved; + this.Status = RoleStatus.Approved; break; } break; @@ -653,20 +653,20 @@ public void WriteXml(XmlWriter writer) writer.WriteStartElement("role"); //write out properties - writer.WriteElementString("rolename", RoleName); - writer.WriteElementString("description", Description); - writer.WriteElementString("billingfrequency", BillingFrequency); - writer.WriteElementString("billingperiod", BillingPeriod.ToString(CultureInfo.InvariantCulture)); - writer.WriteElementString("servicefee", ServiceFee.ToString(CultureInfo.InvariantCulture)); - writer.WriteElementString("trialfrequency", TrialFrequency); - writer.WriteElementString("trialperiod", TrialPeriod.ToString(CultureInfo.InvariantCulture)); - writer.WriteElementString("trialfee", TrialFee.ToString(CultureInfo.InvariantCulture)); - writer.WriteElementString("ispublic", IsPublic.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); - writer.WriteElementString("autoassignment", AutoAssignment.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); - writer.WriteElementString("rsvpcode", RSVPCode); - writer.WriteElementString("iconfile", IconFile); - writer.WriteElementString("issystemrole", IsSystemRole.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); - switch (RoleType) + writer.WriteElementString("rolename", this.RoleName); + writer.WriteElementString("description", this.Description); + writer.WriteElementString("billingfrequency", this.BillingFrequency); + writer.WriteElementString("billingperiod", this.BillingPeriod.ToString(CultureInfo.InvariantCulture)); + writer.WriteElementString("servicefee", this.ServiceFee.ToString(CultureInfo.InvariantCulture)); + writer.WriteElementString("trialfrequency", this.TrialFrequency); + writer.WriteElementString("trialperiod", this.TrialPeriod.ToString(CultureInfo.InvariantCulture)); + writer.WriteElementString("trialfee", this.TrialFee.ToString(CultureInfo.InvariantCulture)); + writer.WriteElementString("ispublic", this.IsPublic.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); + writer.WriteElementString("autoassignment", this.AutoAssignment.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); + writer.WriteElementString("rsvpcode", this.RSVPCode); + writer.WriteElementString("iconfile", this.IconFile); + writer.WriteElementString("issystemrole", this.IsSystemRole.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()); + switch (this.RoleType) { case RoleType.Administrator: writer.WriteElementString("roletype", "adminrole"); @@ -685,7 +685,7 @@ public void WriteXml(XmlWriter writer) break; } - switch (SecurityMode) + switch (this.SecurityMode) { case SecurityMode.SecurityRole: writer.WriteElementString("securitymode", "securityrole"); @@ -697,7 +697,7 @@ public void WriteXml(XmlWriter writer) writer.WriteElementString("securitymode", "both"); break; } - switch (Status) + switch (this.Status) { case RoleStatus.Pending: writer.WriteElementString("status", "pending"); @@ -718,13 +718,13 @@ public void WriteXml(XmlWriter writer) private string GetString(string keyName, string defaultValue) { - if (Settings == null) + if (this.Settings == null) { return defaultValue; } - if (Settings.ContainsKey(keyName)) + if (this.Settings.ContainsKey(keyName)) { - return Settings[keyName]; + return this.Settings[keyName]; } return defaultValue; diff --git a/DNN Platform/Library/Services/Analytics/AnalyticsEngineBase.cs b/DNN Platform/Library/Services/Analytics/AnalyticsEngineBase.cs index 47c731e96ca..ca31a57baf7 100644 --- a/DNN Platform/Library/Services/Analytics/AnalyticsEngineBase.cs +++ b/DNN Platform/Library/Services/Analytics/AnalyticsEngineBase.cs @@ -28,7 +28,7 @@ public string ReplaceTokens(string s) public AnalyticsConfiguration GetConfig() { - return AnalyticsConfiguration.GetConfig(EngineName); + return AnalyticsConfiguration.GetConfig(this.EngineName); } public virtual string RenderCustomScript(AnalyticsConfiguration config) diff --git a/DNN Platform/Library/Services/Analytics/Config/AnalyticsConfiguration.cs b/DNN Platform/Library/Services/Analytics/Config/AnalyticsConfiguration.cs index 05f6cf9d87b..0bc940161b3 100644 --- a/DNN Platform/Library/Services/Analytics/Config/AnalyticsConfiguration.cs +++ b/DNN Platform/Library/Services/Analytics/Config/AnalyticsConfiguration.cs @@ -37,11 +37,11 @@ public AnalyticsSettingCollection Settings { get { - return _settings; + return this._settings; } set { - _settings = value; + this._settings = value; } } @@ -49,11 +49,11 @@ public AnalyticsRuleCollection Rules { get { - return _rules; + return this._rules; } set { - _rules = value; + this._rules = value; } } diff --git a/DNN Platform/Library/Services/Analytics/Config/AnalyticsRule.cs b/DNN Platform/Library/Services/Analytics/Config/AnalyticsRule.cs index af85874e1fa..c65c3b97a63 100644 --- a/DNN Platform/Library/Services/Analytics/Config/AnalyticsRule.cs +++ b/DNN Platform/Library/Services/Analytics/Config/AnalyticsRule.cs @@ -21,11 +21,11 @@ public int RoleId { get { - return _roleId; + return this._roleId; } set { - _roleId = value; + this._roleId = value; } } @@ -33,11 +33,11 @@ public int TabId { get { - return _tabId; + return this._tabId; } set { - _tabId = value; + this._tabId = value; } } @@ -45,11 +45,11 @@ public string Label { get { - return _label; + return this._label; } set { - _label = value; + this._label = value; } } diff --git a/DNN Platform/Library/Services/Analytics/Config/AnalyticsRuleCollection.cs b/DNN Platform/Library/Services/Analytics/Config/AnalyticsRuleCollection.cs index 3965345b30b..6f2afd7f86b 100644 --- a/DNN Platform/Library/Services/Analytics/Config/AnalyticsRuleCollection.cs +++ b/DNN Platform/Library/Services/Analytics/Config/AnalyticsRuleCollection.cs @@ -28,7 +28,7 @@ public virtual AnalyticsRule this[int index] public void Add(AnalyticsRule r) { - InnerList.Add(r); + this.InnerList.Add(r); } } } diff --git a/DNN Platform/Library/Services/Analytics/Config/AnalyticsSetting.cs b/DNN Platform/Library/Services/Analytics/Config/AnalyticsSetting.cs index d4e785b5546..bbf041a7806 100644 --- a/DNN Platform/Library/Services/Analytics/Config/AnalyticsSetting.cs +++ b/DNN Platform/Library/Services/Analytics/Config/AnalyticsSetting.cs @@ -20,11 +20,11 @@ public string SettingName { get { - return _settingName; + return this._settingName; } set { - _settingName = value; + this._settingName = value; } } @@ -32,11 +32,11 @@ public string SettingValue { get { - return _settingValue; + return this._settingValue; } set { - _settingValue = value; + this._settingValue = value; } } } diff --git a/DNN Platform/Library/Services/Analytics/Config/AnalyticsSettingCollection.cs b/DNN Platform/Library/Services/Analytics/Config/AnalyticsSettingCollection.cs index 67ad2fb2f1b..7f207273035 100644 --- a/DNN Platform/Library/Services/Analytics/Config/AnalyticsSettingCollection.cs +++ b/DNN Platform/Library/Services/Analytics/Config/AnalyticsSettingCollection.cs @@ -28,7 +28,7 @@ public virtual AnalyticsSetting this[int index] public void Add(AnalyticsSetting r) { - InnerList.Add(r); + this.InnerList.Add(r); } } } diff --git a/DNN Platform/Library/Services/Analytics/GenericAnalyticsEngine.cs b/DNN Platform/Library/Services/Analytics/GenericAnalyticsEngine.cs index cf0fbfb02f5..b8bdf64b55d 100644 --- a/DNN Platform/Library/Services/Analytics/GenericAnalyticsEngine.cs +++ b/DNN Platform/Library/Services/Analytics/GenericAnalyticsEngine.cs @@ -16,7 +16,7 @@ public override string EngineName public override string RenderScript(string scriptTemplate) { - return ReplaceTokens(scriptTemplate); + return this.ReplaceTokens(scriptTemplate); } } } diff --git a/DNN Platform/Library/Services/Analytics/GoogleAnalyticsController.cs b/DNN Platform/Library/Services/Analytics/GoogleAnalyticsController.cs index 933fe29db07..e447ae4d039 100644 --- a/DNN Platform/Library/Services/Analytics/GoogleAnalyticsController.cs +++ b/DNN Platform/Library/Services/Analytics/GoogleAnalyticsController.cs @@ -49,7 +49,7 @@ public void UpgradeModule(string Version) { case "05.06.00": //previous module versions - using (StreamReader fileReader = GetConfigFile()) + using (StreamReader fileReader = this.GetConfigFile()) { if (fileReader != null) { diff --git a/DNN Platform/Library/Services/Analytics/GoogleAnalyticsEngine.cs b/DNN Platform/Library/Services/Analytics/GoogleAnalyticsEngine.cs index a6bd5d8be09..f513cd67a97 100644 --- a/DNN Platform/Library/Services/Analytics/GoogleAnalyticsEngine.cs +++ b/DNN Platform/Library/Services/Analytics/GoogleAnalyticsEngine.cs @@ -25,7 +25,7 @@ public override string EngineName public override string RenderScript(string scriptTemplate) { - AnalyticsConfiguration config = GetConfig(); + AnalyticsConfiguration config = this.GetConfig(); if (config == null) { @@ -80,7 +80,7 @@ public override string RenderScript(string scriptTemplate) scriptTemplate = scriptTemplate.Replace("[PAGE_URL]", ""); } - scriptTemplate = scriptTemplate.Replace("[CUSTOM_SCRIPT]", RenderCustomScript(config)); + scriptTemplate = scriptTemplate.Replace("[CUSTOM_SCRIPT]", this.RenderCustomScript(config)); return scriptTemplate; } diff --git a/DNN Platform/Library/Services/Assets/AssetManager.cs b/DNN Platform/Library/Services/Assets/AssetManager.cs index 509c515ea5e..1fdf2ca8f53 100644 --- a/DNN Platform/Library/Services/Assets/AssetManager.cs +++ b/DNN Platform/Library/Services/Assets/AssetManager.cs @@ -41,7 +41,7 @@ public class AssetManager : ComponentBase, IAssetMa public ContentPage GetFolderContent(int folderId, int startIndex, int numItems, string sortExpression = null, SubfolderFilter subfolderFilter = SubfolderFilter.IncludeSubfoldersFolderStructure) { - var folder = GetFolderInfo(folderId); + var folder = this.GetFolderInfo(folderId); if (!FolderPermissionController.CanBrowseFolder((FolderInfo)folder)) { @@ -58,11 +58,11 @@ public ContentPage GetFolderContent(int folderId, int startIndex, int numItems, } else { - folders = GetFolders(folder, sortProperties.Column == "ItemName" ? "FolderName" : sortProperties.Column, sortProperties.Ascending).ToList(); + folders = this.GetFolders(folder, sortProperties.Column == "ItemName" ? "FolderName" : sortProperties.Column, sortProperties.Ascending).ToList(); } var recursive = subfolderFilter == SubfolderFilter.IncludeSubfoldersFilesOnly; - var files = GetFiles(folder, sortProperties, startIndex, recursive).ToList(); + var files = this.GetFiles(folder, sortProperties, startIndex, recursive).ToList(); IEnumerable content; if (startIndex + numItems <= folders.Count()) @@ -91,7 +91,7 @@ public ContentPage GetFolderContent(int folderId, int startIndex, int numItems, public ContentPage SearchFolderContent(int folderId, string pattern, int startIndex, int numItems, string sortExpression = null, SubfolderFilter subfolderFilter = SubfolderFilter.IncludeSubfoldersFolderStructure) { var recursive = subfolderFilter != SubfolderFilter.ExcludeSubfolders; - var folder = GetFolderInfo(folderId); + var folder = this.GetFolderInfo(folderId); var files = FolderManager.Instance.SearchFiles(folder, pattern, recursive); var sortProperties = SortProperties.Parse(sortExpression); @@ -198,13 +198,13 @@ public IFileInfo RenameFile(int fileId, string newFileName) } // Chech if the new name has invalid chars - if (IsInvalidName(filteredName)) + if (this.IsInvalidName(filteredName)) { - throw new AssetManagerException(GetInvalidCharsErrorText()); + throw new AssetManagerException(this.GetInvalidCharsErrorText()); } // Check if the new name is a reserved name - if (IsReservedName(filteredName)) + if (this.IsReservedName(filteredName)) { throw new AssetManagerException(Localization.Localization.GetExceptionMessage("FolderFileNameIsReserved", FolderFileNameIsReservedDefaultMessage)); } @@ -234,18 +234,18 @@ public IFolderInfo RenameFolder(int folderId, string newFolderName) newFolderName = CleanDotsAtTheEndOfTheName(newFolderName); // Check if the new name has invalid chars - if (IsInvalidName(newFolderName)) + if (this.IsInvalidName(newFolderName)) { - throw new AssetManagerException(GetInvalidCharsErrorText()); + throw new AssetManagerException(this.GetInvalidCharsErrorText()); } // Check if the name is reserved - if (IsReservedName(newFolderName)) + if (this.IsReservedName(newFolderName)) { throw new AssetManagerException(Localization.Localization.GetExceptionMessage("FolderFileNameIsReserved", FolderFileNameIsReservedDefaultMessage)); } - var folder = GetFolderInfo(folderId); + var folder = this.GetFolderInfo(folderId); // Check if user has appropiate permissions if (!HasPermission(folder, "MANAGE")) @@ -260,11 +260,11 @@ public IFolderInfo RenameFolder(int folderId, string newFolderName) } if (folder.FolderName.Equals(newFolderName, StringComparison.InvariantCultureIgnoreCase)) { - folder.FolderPath = ReplaceFolderName(folder.FolderPath, folder.FolderName, newFolderName); + folder.FolderPath = this.ReplaceFolderName(folder.FolderPath, folder.FolderName, newFolderName); return FolderManager.Instance.UpdateFolder(folder); } - var newFolderPath = GetNewFolderPath(newFolderName, folder); + var newFolderPath = this.GetNewFolderPath(newFolderName, folder); // Check if the new folder already exists if (FolderManager.Instance.FolderExists(folder.PortalID, newFolderPath)) { @@ -281,18 +281,18 @@ public IFolderInfo CreateFolder(string folderName, int folderParentId, int folde var filterFolderName = CleanDotsAtTheEndOfTheName(folderName); - if (IsInvalidName(filterFolderName)) + if (this.IsInvalidName(filterFolderName)) { - throw new AssetManagerException(GetInvalidCharsErrorText()); + throw new AssetManagerException(this.GetInvalidCharsErrorText()); } // Check if the new name is a reserved name - if (IsReservedName(filterFolderName)) + if (this.IsReservedName(filterFolderName)) { throw new AssetManagerException(Localization.Localization.GetExceptionMessage("FolderFileNameIsReserved", FolderFileNameIsReservedDefaultMessage)); } - var parentFolder = GetFolderInfo(folderParentId); + var parentFolder = this.GetFolderInfo(folderParentId); if (!HasPermission(parentFolder, "ADD")) { @@ -338,7 +338,7 @@ public bool DeleteFolder(int folderId, bool onlyUnlink, ICollection } else { - DeleteFolder(folder, nonDeletedSubfolders); + this.DeleteFolder(folder, nonDeletedSubfolders); } } @@ -383,7 +383,7 @@ private static string CleanDotsAtTheEndOfTheName(string name) private bool IsInvalidName(string itemName) { - var invalidFilenameChars = RegexUtils.GetCachedRegex("[" + Regex.Escape(GetInvalidChars()) + "]"); + var invalidFilenameChars = RegexUtils.GetCachedRegex("[" + Regex.Escape(this.GetInvalidChars()) + "]"); return invalidFilenameChars.IsMatch(itemName); } diff --git a/DNN Platform/Library/Services/Assets/FolderPathComparer.cs b/DNN Platform/Library/Services/Assets/FolderPathComparer.cs index 08654ab8908..3fa1d2cd0d2 100644 --- a/DNN Platform/Library/Services/Assets/FolderPathComparer.cs +++ b/DNN Platform/Library/Services/Assets/FolderPathComparer.cs @@ -28,13 +28,13 @@ public int Compare(int folderIdA, int folderIdB) private string GetFolderPath(int folderId) { - if (!cache.ContainsKey(folderId)) + if (!this.cache.ContainsKey(folderId)) { var folder = FolderManager.Instance.GetFolder(folderId); - cache.Add(folderId, folder.FolderPath); + this.cache.Add(folderId, folder.FolderPath); } - return cache[folderId]; + return this.cache[folderId]; } } } diff --git a/DNN Platform/Library/Services/Authentication/AuthenticationConfig.cs b/DNN Platform/Library/Services/Authentication/AuthenticationConfig.cs index b1b1c1bf2c6..2fe5fea473b 100644 --- a/DNN Platform/Library/Services/Authentication/AuthenticationConfig.cs +++ b/DNN Platform/Library/Services/Authentication/AuthenticationConfig.cs @@ -28,19 +28,19 @@ public class AuthenticationConfig : AuthenticationConfigBase protected AuthenticationConfig(int portalID) : base(portalID) { - UseCaptcha = Null.NullBoolean; - Enabled = true; + this.UseCaptcha = Null.NullBoolean; + this.Enabled = true; try { string setting = Null.NullString; if (PortalController.Instance.GetPortalSettings(portalID).TryGetValue("DNN_Enabled", out setting)) { - Enabled = bool.Parse(setting); + this.Enabled = bool.Parse(setting); } setting = Null.NullString; if (PortalController.Instance.GetPortalSettings(portalID).TryGetValue("DNN_UseCaptcha", out setting)) { - UseCaptcha = bool.Parse(setting); + this.UseCaptcha = bool.Parse(setting); } } catch (Exception ex) diff --git a/DNN Platform/Library/Services/Authentication/AuthenticationConfigBase.cs b/DNN Platform/Library/Services/Authentication/AuthenticationConfigBase.cs index 280546beada..a206530dbce 100644 --- a/DNN Platform/Library/Services/Authentication/AuthenticationConfigBase.cs +++ b/DNN Platform/Library/Services/Authentication/AuthenticationConfigBase.cs @@ -33,13 +33,13 @@ public abstract class AuthenticationConfigBase public AuthenticationConfigBase() { - DependencyProvider = Globals.DependencyProvider; + this.DependencyProvider = Globals.DependencyProvider; } protected AuthenticationConfigBase(int portalID) : this() { - PortalID = portalID; + this.PortalID = portalID; } [Browsable(false)] diff --git a/DNN Platform/Library/Services/Authentication/AuthenticationInfo.cs b/DNN Platform/Library/Services/Authentication/AuthenticationInfo.cs index c7e990e0cb8..daa554cdca5 100644 --- a/DNN Platform/Library/Services/Authentication/AuthenticationInfo.cs +++ b/DNN Platform/Library/Services/Authentication/AuthenticationInfo.cs @@ -28,11 +28,11 @@ public class AuthenticationInfo : BaseEntityInfo, IHydratable public AuthenticationInfo() { - LogoffControlSrc = Null.NullString; - LoginControlSrc = Null.NullString; - SettingsControlSrc = Null.NullString; - AuthenticationType = Null.NullString; - AuthenticationID = Null.NullInteger; + this.LogoffControlSrc = Null.NullString; + this.LoginControlSrc = Null.NullString; + this.SettingsControlSrc = Null.NullString; + this.AuthenticationType = Null.NullString; + this.AuthenticationID = Null.NullInteger; } #endregion @@ -100,16 +100,16 @@ public AuthenticationInfo() /// ----------------------------------------------------------------------------- public virtual void Fill(IDataReader dr) { - AuthenticationID = Null.SetNullInteger(dr["AuthenticationID"]); - PackageID = Null.SetNullInteger(dr["PackageID"]); - IsEnabled = Null.SetNullBoolean(dr["IsEnabled"]); - AuthenticationType = Null.SetNullString(dr["AuthenticationType"]); - SettingsControlSrc = Null.SetNullString(dr["SettingsControlSrc"]); - LoginControlSrc = Null.SetNullString(dr["LoginControlSrc"]); - LogoffControlSrc = Null.SetNullString(dr["LogoffControlSrc"]); + this.AuthenticationID = Null.SetNullInteger(dr["AuthenticationID"]); + this.PackageID = Null.SetNullInteger(dr["PackageID"]); + this.IsEnabled = Null.SetNullBoolean(dr["IsEnabled"]); + this.AuthenticationType = Null.SetNullString(dr["AuthenticationType"]); + this.SettingsControlSrc = Null.SetNullString(dr["SettingsControlSrc"]); + this.LoginControlSrc = Null.SetNullString(dr["LoginControlSrc"]); + this.LogoffControlSrc = Null.SetNullString(dr["LogoffControlSrc"]); //Fill base class fields - FillInternal(dr); + this.FillInternal(dr); } /// ----------------------------------------------------------------------------- @@ -122,11 +122,11 @@ public virtual int KeyID { get { - return AuthenticationID; + return this.AuthenticationID; } set { - AuthenticationID = value; + this.AuthenticationID = value; } } diff --git a/DNN Platform/Library/Services/Authentication/AuthenticationLoginBase.cs b/DNN Platform/Library/Services/Authentication/AuthenticationLoginBase.cs index 318b953f725..55e3eff5c18 100644 --- a/DNN Platform/Library/Services/Authentication/AuthenticationLoginBase.cs +++ b/DNN Platform/Library/Services/Authentication/AuthenticationLoginBase.cs @@ -28,9 +28,9 @@ public abstract class AuthenticationLoginBase : UserModuleBase protected AuthenticationLoginBase() { - RedirectURL = Null.NullString; - AuthenticationType = Null.NullString; - Mode = AuthMode.Login; + this.RedirectURL = Null.NullString; + this.AuthenticationType = Null.NullString; + this.Mode = AuthMode.Login; } /// ----------------------------------------------------------------------------- @@ -90,9 +90,9 @@ public string IPAddress protected virtual void OnUserAuthenticated(UserAuthenticatedEventArgs ea) { - if (UserAuthenticated != null) + if (this.UserAuthenticated != null) { - UserAuthenticated(null, ea); + this.UserAuthenticated(null, ea); } } diff --git a/DNN Platform/Library/Services/Authentication/AuthenticationLogoffBase.cs b/DNN Platform/Library/Services/Authentication/AuthenticationLogoffBase.cs index 5607ab0e2d5..a9e742810f2 100644 --- a/DNN Platform/Library/Services/Authentication/AuthenticationLogoffBase.cs +++ b/DNN Platform/Library/Services/Authentication/AuthenticationLogoffBase.cs @@ -35,7 +35,7 @@ public abstract class AuthenticationLogoffBase : UserModuleBase public AuthenticationLogoffBase() { - DependencyProvider = Globals.DependencyProvider; + this.DependencyProvider = Globals.DependencyProvider; } /// ----------------------------------------------------------------------------- @@ -47,11 +47,11 @@ public string AuthenticationType { get { - return _AuthenticationType; + return this._AuthenticationType; } set { - _AuthenticationType = value; + this._AuthenticationType = value; } } @@ -60,17 +60,17 @@ public string AuthenticationType protected virtual void OnLogOff(EventArgs a) { - if (LogOff != null) + if (this.LogOff != null) { - LogOff(null, a); + this.LogOff(null, a); } } protected virtual void OnRedirect(EventArgs a) { - if (Redirect != null) + if (this.Redirect != null) { - Redirect(null, a); + this.Redirect(null, a); } } } diff --git a/DNN Platform/Library/Services/Authentication/AuthenticationSettingsBase.cs b/DNN Platform/Library/Services/Authentication/AuthenticationSettingsBase.cs index 617d6fb7409..c995a392dd4 100644 --- a/DNN Platform/Library/Services/Authentication/AuthenticationSettingsBase.cs +++ b/DNN Platform/Library/Services/Authentication/AuthenticationSettingsBase.cs @@ -30,11 +30,11 @@ public string AuthenticationType { get { - return _AuthenticationType; + return this._AuthenticationType; } set { - _AuthenticationType = value; + this._AuthenticationType = value; } } diff --git a/DNN Platform/Library/Services/Authentication/OAuth/OAuthClientBase.cs b/DNN Platform/Library/Services/Authentication/OAuth/OAuthClientBase.cs index 8e9fe75a200..f7f8c393634 100644 --- a/DNN Platform/Library/Services/Authentication/OAuth/OAuthClientBase.cs +++ b/DNN Platform/Library/Services/Authentication/OAuth/OAuthClientBase.cs @@ -73,14 +73,14 @@ protected OAuthClientBase(int portalId, AuthMode mode, string service) //Set default Expiry to 14 days //oAuth v1 tokens do not expire //oAuth v2 tokens have an expiry - AuthTokenExpiry = new TimeSpan(14, 0, 0, 0); - Service = service; + this.AuthTokenExpiry = new TimeSpan(14, 0, 0, 0); + this.Service = service; - APIKey = OAuthConfigBase.GetConfig(Service, portalId).APIKey; - APISecret = OAuthConfigBase.GetConfig(Service, portalId).APISecret; - Mode = mode; + this.APIKey = OAuthConfigBase.GetConfig(this.Service, portalId).APIKey; + this.APISecret = OAuthConfigBase.GetConfig(this.Service, portalId).APISecret; + this.Mode = mode; - CallbackUri = Mode == AuthMode.Login + this.CallbackUri = this.Mode == AuthMode.Login ? new Uri(Globals.LoginURL(String.Empty, false)) : new Uri(Globals.RegisterURL(String.Empty, String.Empty)); } @@ -153,13 +153,13 @@ public virtual bool AutoMatchExistingUsers private AuthorisationResult AuthorizeV1() { - if (!IsCurrentUserAuthorized()) + if (!this.IsCurrentUserAuthorized()) { - if (!HaveVerificationCode()) + if (!this.HaveVerificationCode()) { string ret = null; - string response = RequestToken(); + string response = this.RequestToken(); if (!string.IsNullOrWhiteSpace(response)) { @@ -176,11 +176,11 @@ private AuthorisationResult AuthorizeV1() if (qs[OAuthTokenKey] != null) { - ret = AuthorizationEndpoint + "?" + OAuthTokenKey + "=" + qs[OAuthTokenKey]; + ret = this.AuthorizationEndpoint + "?" + OAuthTokenKey + "=" + qs[OAuthTokenKey]; - AuthToken = qs[OAuthTokenKey]; - TokenSecret = qs[OAuthTokenSecretKey]; - SaveTokenCookie("_request"); + this.AuthToken = qs[OAuthTokenKey]; + this.TokenSecret = qs[OAuthTokenSecretKey]; + this.SaveTokenCookie("_request"); } } @@ -192,7 +192,7 @@ private AuthorisationResult AuthorizeV1() return AuthorisationResult.RequestingCode; } - ExchangeRequestTokenForToken(); + this.ExchangeRequestTokenForToken(); } return AuthorisationResult.Authorized; @@ -207,24 +207,24 @@ private AuthorisationResult AuthorizeV2() return AuthorisationResult.Denied; } - if (!HaveVerificationCode()) + if (!this.HaveVerificationCode()) { var parameters = new List { - new QueryParameter("scope", Scope), - new QueryParameter(OAuthClientIdKey, APIKey), - new QueryParameter(OAuthRedirectUriKey, HttpContext.Current.Server.UrlEncode(CallbackUri.ToString())), - new QueryParameter("state", Service), + new QueryParameter("scope", this.Scope), + new QueryParameter(OAuthClientIdKey, this.APIKey), + new QueryParameter(OAuthRedirectUriKey, HttpContext.Current.Server.UrlEncode(this.CallbackUri.ToString())), + new QueryParameter("state", this.Service), new QueryParameter("response_type", "code") }; - HttpContext.Current.Response.Redirect(AuthorizationEndpoint + "?" + parameters.ToNormalizedString(), false); + HttpContext.Current.Response.Redirect(this.AuthorizationEndpoint + "?" + parameters.ToNormalizedString(), false); return AuthorisationResult.RequestingCode; } - ExchangeCodeForToken(); + this.ExchangeCodeForToken(); - return String.IsNullOrEmpty(AuthToken) ? AuthorisationResult.Denied : AuthorisationResult.Authorized; + return String.IsNullOrEmpty(this.AuthToken) ? AuthorisationResult.Denied : AuthorisationResult.Authorized; } private string ComputeHash(HashAlgorithm hashAlgorithm, string data) @@ -248,30 +248,30 @@ private string ComputeHash(HashAlgorithm hashAlgorithm, string data) private void ExchangeCodeForToken() { IList parameters = new List(); - parameters.Add(new QueryParameter(OAuthClientIdKey, APIKey)); - parameters.Add(new QueryParameter(OAuthRedirectUriKey, HttpContext.Current.Server.UrlEncode(CallbackUri.ToString()))); + parameters.Add(new QueryParameter(OAuthClientIdKey, this.APIKey)); + parameters.Add(new QueryParameter(OAuthRedirectUriKey, HttpContext.Current.Server.UrlEncode(this.CallbackUri.ToString()))); //DNN-6265 Support for OAuth V2 Secrets which are not URL Friendly - parameters.Add(new QueryParameter(OAuthClientSecretKey, HttpContext.Current.Server.UrlEncode(APISecret.ToString()))); + parameters.Add(new QueryParameter(OAuthClientSecretKey, HttpContext.Current.Server.UrlEncode(this.APISecret.ToString()))); parameters.Add(new QueryParameter(OAuthGrantTyepKey, "authorization_code")); - parameters.Add(new QueryParameter(OAuthCodeKey, VerificationCode)); + parameters.Add(new QueryParameter(OAuthCodeKey, this.VerificationCode)); //DNN-6265 Support for OAuth V2 optional parameter - if (!String.IsNullOrEmpty(APIResource)) + if (!String.IsNullOrEmpty(this.APIResource)) { - parameters.Add(new QueryParameter("resource", APIResource)); + parameters.Add(new QueryParameter("resource", this.APIResource)); } - string responseText = ExecuteWebRequest(TokenMethod, TokenEndpoint, parameters.ToNormalizedString(), String.Empty); + string responseText = this.ExecuteWebRequest(this.TokenMethod, this.TokenEndpoint, parameters.ToNormalizedString(), String.Empty); - AuthToken = GetToken(responseText); - AuthTokenExpiry = GetExpiry(responseText); + this.AuthToken = this.GetToken(responseText); + this.AuthTokenExpiry = this.GetExpiry(responseText); } private void ExchangeRequestTokenForToken() { - LoadTokenCookie("_request"); + this.LoadTokenCookie("_request"); - string response = ExecuteAuthorizedRequest(HttpMethod.POST, TokenEndpoint); + string response = this.ExecuteAuthorizedRequest(HttpMethod.POST, this.TokenEndpoint); if (response.Length > 0) { @@ -279,15 +279,15 @@ private void ExchangeRequestTokenForToken() NameValueCollection qs = HttpUtility.ParseQueryString(response); if (qs[OAuthTokenKey] != null) { - AuthToken = qs[OAuthTokenKey]; + this.AuthToken = qs[OAuthTokenKey]; } if (qs[OAuthTokenSecretKey] != null) { - TokenSecret = qs[OAuthTokenSecretKey]; + this.TokenSecret = qs[OAuthTokenSecretKey]; } - if (qs[UserGuidKey] != null) + if (qs[this.UserGuidKey] != null) { - UserGuid = qs[UserGuidKey]; + this.UserGuid = qs[this.UserGuidKey]; } } } @@ -297,14 +297,14 @@ private string ExecuteAuthorizedRequest(HttpMethod method, Uri uri) string outUrl; List requestParameters; - string nonce = GenerateNonce(); - string timeStamp = GenerateTimeStamp(); + string nonce = this.GenerateNonce(); + string timeStamp = this.GenerateTimeStamp(); - string verifier = (uri == TokenEndpoint) ? OAuthVerifier: String.Empty; + string verifier = (uri == this.TokenEndpoint) ? this.OAuthVerifier: String.Empty; //Generate Signature - string sig = GenerateSignature(uri, - AuthToken, - TokenSecret, + string sig = this.GenerateSignature(uri, + this.AuthToken, + this.TokenSecret, String.Empty, verifier, method.ToString(), @@ -316,20 +316,20 @@ private string ExecuteAuthorizedRequest(HttpMethod method, Uri uri) var headerParameters = new List { - new QueryParameter(OAuthConsumerKeyKey, APIKey), + new QueryParameter(OAuthConsumerKeyKey, this.APIKey), new QueryParameter(OAuthNonceKey, nonce), new QueryParameter(OAuthSignatureKey, sig), new QueryParameter(OAuthSignatureMethodKey, HMACSHA1SignatureType), new QueryParameter(OAuthTimestampKey, timeStamp), - new QueryParameter(OAuthTokenKey, AuthToken), - new QueryParameter(OAuthVersionKey, OAuthVersion) + new QueryParameter(OAuthTokenKey, this.AuthToken), + new QueryParameter(OAuthVersionKey, this.OAuthVersion) }; - if (uri == TokenEndpoint) + if (uri == this.TokenEndpoint) { - headerParameters.Add(new QueryParameter(OAuthVerifierKey, OAuthVerifier)); + headerParameters.Add(new QueryParameter(OAuthVerifierKey, this.OAuthVerifier)); } - string ret = ExecuteWebRequest(method, uri, String.Empty, headerParameters.ToAuthorizationString()); + string ret = this.ExecuteWebRequest(method, uri, String.Empty, headerParameters.ToAuthorizationString()); return ret; } @@ -348,12 +348,12 @@ private string ExecuteWebRequest(HttpMethod method, Uri uri, string parameters, //request.ContentType = "text/xml"; request.ContentLength = byteArray.Length; - if (!String.IsNullOrEmpty(OAuthHeaderCode)) + if (!String.IsNullOrEmpty(this.OAuthHeaderCode)) { - byte[] API64 = Encoding.UTF8.GetBytes(APIKey + ":" + APISecret); + byte[] API64 = Encoding.UTF8.GetBytes(this.APIKey + ":" + this.APISecret); string Api64Encoded = System.Convert.ToBase64String(API64); //Authentication providers needing an "Authorization: Basic/bearer base64(clientID:clientSecret)" header. OAuthHeaderCode might be: Basic/Bearer/empty. - request.Headers.Add("Authorization: " + OAuthHeaderCode + " " + Api64Encoded); + request.Headers.Add("Authorization: " + this.OAuthHeaderCode + " " + Api64Encoded); } if (!String.IsNullOrEmpty(parameters)) @@ -365,7 +365,7 @@ private string ExecuteWebRequest(HttpMethod method, Uri uri, string parameters, } else { - request = WebRequest.CreateDefault(GenerateRequestUri(uri.ToString(), parameters)); + request = WebRequest.CreateDefault(this.GenerateRequestUri(uri.ToString(), parameters)); } //Add Headers @@ -418,12 +418,12 @@ private string GenerateSignatureBase(Uri url, string token, string callbackurl, throw new ArgumentNullException("httpMethod"); } - requestParameters = GetQueryParameters(url.Query); - requestParameters.Add(new QueryParameter(OAuthVersionKey, OAuthVersion)); + requestParameters = this.GetQueryParameters(url.Query); + requestParameters.Add(new QueryParameter(OAuthVersionKey, this.OAuthVersion)); requestParameters.Add(new QueryParameter(OAuthNonceKey, nonce)); requestParameters.Add(new QueryParameter(OAuthTimestampKey, timeStamp)); requestParameters.Add(new QueryParameter(OAuthSignatureMethodKey, HMACSHA1SignatureType)); - requestParameters.Add(new QueryParameter(OAuthConsumerKeyKey, APIKey)); + requestParameters.Add(new QueryParameter(OAuthConsumerKeyKey, this.APIKey)); if (!string.IsNullOrEmpty(callbackurl)) { @@ -460,7 +460,7 @@ private string GenerateSignatureBase(Uri url, string token, string callbackurl, private string GenerateSignatureUsingHash(string signatureBase, HashAlgorithm hash) { - return ComputeHash(hash, signatureBase); + return this.ComputeHash(hash, signatureBase); } private List GetQueryParameters(string parameters) @@ -500,15 +500,15 @@ private string RequestToken() string outUrl; List requestParameters; - string nonce = GenerateNonce(); - string timeStamp = GenerateTimeStamp(); + string nonce = this.GenerateNonce(); + string timeStamp = this.GenerateTimeStamp(); - string sig = GenerateSignature(RequestTokenEndpoint, + string sig = this.GenerateSignature(this.RequestTokenEndpoint, String.Empty, String.Empty, - CallbackUri.OriginalString, + this.CallbackUri.OriginalString, String.Empty, - RequestTokenMethod.ToString(), + this.RequestTokenMethod.ToString(), timeStamp, nonce, out outUrl, @@ -516,28 +516,28 @@ private string RequestToken() var headerParameters = new List { - new QueryParameter(OAuthCallbackKey, CallbackUri.OriginalString), - new QueryParameter(OAuthConsumerKeyKey, APIKey), + new QueryParameter(OAuthCallbackKey, this.CallbackUri.OriginalString), + new QueryParameter(OAuthConsumerKeyKey, this.APIKey), new QueryParameter(OAuthNonceKey, nonce), new QueryParameter(OAuthSignatureKey, sig), new QueryParameter(OAuthSignatureMethodKey, HMACSHA1SignatureType), new QueryParameter(OAuthTimestampKey, timeStamp), - new QueryParameter(OAuthVersionKey, OAuthVersion) + new QueryParameter(OAuthVersionKey, this.OAuthVersion) }; - string ret = ExecuteWebRequest(RequestTokenMethod, new Uri(outUrl), String.Empty, headerParameters.ToAuthorizationString()); + string ret = this.ExecuteWebRequest(this.RequestTokenMethod, new Uri(outUrl), String.Empty, headerParameters.ToAuthorizationString()); return ret; } private void SaveTokenCookie(string suffix) { - var authTokenCookie = new HttpCookie(AuthTokenName + suffix) { Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }; - authTokenCookie.Values[OAuthTokenKey] = AuthToken; - authTokenCookie.Values[OAuthTokenSecretKey] = TokenSecret; - authTokenCookie.Values[UserGuidKey] = UserGuid; + var authTokenCookie = new HttpCookie(this.AuthTokenName + suffix) { Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }; + authTokenCookie.Values[OAuthTokenKey] = this.AuthToken; + authTokenCookie.Values[OAuthTokenSecretKey] = this.TokenSecret; + authTokenCookie.Values[this.UserGuidKey] = this.UserGuid; - authTokenCookie.Expires = DateTime.Now.Add(AuthTokenExpiry); + authTokenCookie.Expires = DateTime.Now.Add(this.AuthTokenExpiry); HttpContext.Current.Response.SetCookie(authTokenCookie); } @@ -573,7 +573,7 @@ protected virtual string GenerateTimeStamp() protected virtual string GenerateNonce() { // Just a simple implementation of a random number between 123400 and 9999999 - return random.Next(123400, 9999999).ToString(CultureInfo.InvariantCulture); + return this.random.Next(123400, 9999999).ToString(CultureInfo.InvariantCulture); } protected virtual TimeSpan GetExpiry(string responseText) @@ -588,14 +588,14 @@ protected virtual string GetToken(string responseText) protected void LoadTokenCookie(string suffix) { - HttpCookie authTokenCookie = HttpContext.Current.Request.Cookies[AuthTokenName + suffix]; + HttpCookie authTokenCookie = HttpContext.Current.Request.Cookies[this.AuthTokenName + suffix]; if (authTokenCookie != null) { if (authTokenCookie.HasKeys) { - AuthToken = authTokenCookie.Values[OAuthTokenKey]; - TokenSecret = authTokenCookie.Values[OAuthTokenSecretKey]; - UserGuid = authTokenCookie.Values[UserGuidKey]; + this.AuthToken = authTokenCookie.Values[OAuthTokenKey]; + this.TokenSecret = authTokenCookie.Values[OAuthTokenSecretKey]; + this.UserGuid = authTokenCookie.Values[this.UserGuidKey]; } } } @@ -606,33 +606,33 @@ public virtual void AuthenticateUser(UserData user, PortalSettings settings, str { var loginStatus = UserLoginStatus.LOGIN_FAILURE; - string userName = PrefixServiceToUserName ? Service + "-" + user.Id : user.Id; - string token = Service + "-" + user.Id; + string userName = this.PrefixServiceToUserName ? this.Service + "-" + user.Id : user.Id; + string token = this.Service + "-" + user.Id; UserInfo objUserInfo; - if (AutoMatchExistingUsers) + if (this.AutoMatchExistingUsers) { objUserInfo = MembershipProvider.Instance().GetUserByUserName(settings.PortalId, userName); if (objUserInfo != null) { //user already exists... lets check for a token next... - var dnnAuthToken = MembershipProvider.Instance().GetUserByAuthToken(settings.PortalId, token, Service); + var dnnAuthToken = MembershipProvider.Instance().GetUserByAuthToken(settings.PortalId, token, this.Service); if (dnnAuthToken == null) { - DataProvider.Instance().AddUserAuthentication(objUserInfo.UserID, Service, token, objUserInfo.UserID); + DataProvider.Instance().AddUserAuthentication(objUserInfo.UserID, this.Service, token, objUserInfo.UserID); } } } objUserInfo = UserController.ValidateUser(settings.PortalId, userName, "", - Service, token, + this.Service, token, settings.PortalName, IPAddress, ref loginStatus); //Raise UserAuthenticated Event - var eventArgs = new UserAuthenticatedEventArgs(objUserInfo, token, loginStatus, Service) + var eventArgs = new UserAuthenticatedEventArgs(objUserInfo, token, loginStatus, this.Service) { AutoRegister = true, UserName = userName, @@ -698,9 +698,9 @@ public virtual void AuthenticateUser(UserData user, PortalSettings settings, str eventArgs.Profile = profileProperties; - if (Mode == AuthMode.Login) + if (this.Mode == AuthMode.Login) { - SaveTokenCookie(String.Empty); + this.SaveTokenCookie(String.Empty); } onAuthenticated(eventArgs); @@ -708,11 +708,11 @@ public virtual void AuthenticateUser(UserData user, PortalSettings settings, str public virtual AuthorisationResult Authorize() { - if (OAuthVersion == "1.0") + if (this.OAuthVersion == "1.0") { - return AuthorizeV1(); + return this.AuthorizeV1(); } - return AuthorizeV2(); + return this.AuthorizeV2(); } /// @@ -731,55 +731,55 @@ public virtual AuthorisationResult Authorize() /// A base64 string of the hash value public string GenerateSignature(Uri url, string token, string tokenSecret, string callbackurl, string oauthVerifier, string httpMethod, string timeStamp, string nonce, out string normalizedUrl, out List requestParameters) { - string signatureBase = GenerateSignatureBase(url, token, callbackurl, oauthVerifier, httpMethod, timeStamp, nonce, out normalizedUrl, out requestParameters); + string signatureBase = this.GenerateSignatureBase(url, token, callbackurl, oauthVerifier, httpMethod, timeStamp, nonce, out normalizedUrl, out requestParameters); var hmacsha1 = new HMACSHA1 { - Key = Encoding.ASCII.GetBytes(string.Format("{0}&{1}", UrlEncode(APISecret), + Key = Encoding.ASCII.GetBytes(string.Format("{0}&{1}", UrlEncode(this.APISecret), string.IsNullOrEmpty(tokenSecret) ? "" : UrlEncode(tokenSecret))) }; - return GenerateSignatureUsingHash(signatureBase, hmacsha1); + return this.GenerateSignatureUsingHash(signatureBase, hmacsha1); } public virtual TUserData GetCurrentUser() where TUserData : UserData { - LoadTokenCookie(String.Empty); + this.LoadTokenCookie(String.Empty); - if (!IsCurrentUserAuthorized()) + if (!this.IsCurrentUserAuthorized()) { return null; } - var accessToken = string.IsNullOrEmpty(AccessToken) ? "access_token=" + AuthToken : AccessToken + "=" + AuthToken; - string responseText = (OAuthVersion == "1.0") - ? ExecuteAuthorizedRequest(HttpMethod.GET, MeGraphEndpoint) - : ExecuteWebRequest(HttpMethod.GET, GenerateRequestUri(MeGraphEndpoint.ToString(), accessToken), null, String.Empty); + var accessToken = string.IsNullOrEmpty(this.AccessToken) ? "access_token=" + this.AuthToken : this.AccessToken + "=" + this.AuthToken; + string responseText = (this.OAuthVersion == "1.0") + ? this.ExecuteAuthorizedRequest(HttpMethod.GET, this.MeGraphEndpoint) + : this.ExecuteWebRequest(HttpMethod.GET, this.GenerateRequestUri(this.MeGraphEndpoint.ToString(), accessToken), null, String.Empty); var user = Json.Deserialize(responseText); return user; } public bool HaveVerificationCode() { - return (OAuthVersion == "1.0") ? (OAuthVerifier != null) : (VerificationCode != null); + return (this.OAuthVersion == "1.0") ? (this.OAuthVerifier != null) : (this.VerificationCode != null); } public bool IsCurrentService() { string service = HttpContext.Current.Request.Params["state"]; - return !String.IsNullOrEmpty(service) && service == Service; + return !String.IsNullOrEmpty(service) && service == this.Service; } public Boolean IsCurrentUserAuthorized() { - return !String.IsNullOrEmpty(AuthToken); + return !String.IsNullOrEmpty(this.AuthToken); } public void RemoveToken() { - var authTokenCookie = new HttpCookie(AuthTokenName) + var authTokenCookie = new HttpCookie(this.AuthTokenName) { Expires = DateTime.Now.AddDays(-30), Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") diff --git a/DNN Platform/Library/Services/Authentication/OAuth/OAuthConfigBase.cs b/DNN Platform/Library/Services/Authentication/OAuth/OAuthConfigBase.cs index e3eab75bf6c..3d0bd7827a0 100644 --- a/DNN Platform/Library/Services/Authentication/OAuth/OAuthConfigBase.cs +++ b/DNN Platform/Library/Services/Authentication/OAuth/OAuthConfigBase.cs @@ -23,7 +23,7 @@ public class OAuthConfigBase : AuthenticationConfigBase protected OAuthConfigBase(string service, int portalId) : base(portalId) { - Service = service; + this.Service = service; var portalApiKey = PortalController.GetPortalSetting(this.Service + "_APIKey", portalId, ""); var hostApiKey = ""; @@ -31,24 +31,24 @@ protected OAuthConfigBase(string service, int portalId) if (string.IsNullOrEmpty(portalApiKey)) { hostApiKey = HostController.Instance.GetString(this.Service + "_APIKey", ""); - HostConfig = !string.IsNullOrEmpty(hostApiKey); + this.HostConfig = !string.IsNullOrEmpty(hostApiKey); } else { - HostConfig = false; + this.HostConfig = false; } - if (HostConfig) + if (this.HostConfig) { - APIKey = hostApiKey; - APISecret = HostController.Instance.GetString(Service + "_APISecret", ""); - Enabled = HostController.Instance.GetBoolean(Service + "_Enabled", false); + this.APIKey = hostApiKey; + this.APISecret = HostController.Instance.GetString(this.Service + "_APISecret", ""); + this.Enabled = HostController.Instance.GetBoolean(this.Service + "_Enabled", false); } else { - APIKey = portalApiKey; - APISecret = PortalController.GetPortalSetting(Service + "_APISecret", portalId, ""); - Enabled = PortalController.GetPortalSettingAsBoolean(Service + "_Enabled", portalId, false); + this.APIKey = portalApiKey; + this.APISecret = PortalController.GetPortalSetting(this.Service + "_APISecret", portalId, ""); + this.Enabled = PortalController.GetPortalSettingAsBoolean(this.Service + "_Enabled", portalId, false); } } diff --git a/DNN Platform/Library/Services/Authentication/OAuth/OAuthLoginBase.cs b/DNN Platform/Library/Services/Authentication/OAuth/OAuthLoginBase.cs index 1084230bacc..2ae4d444d45 100644 --- a/DNN Platform/Library/Services/Authentication/OAuth/OAuthLoginBase.cs +++ b/DNN Platform/Library/Services/Authentication/OAuth/OAuthLoginBase.cs @@ -33,27 +33,27 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (!IsPostBack) + if (!this.IsPostBack) { //Save the return Url in the cookie - HttpContext.Current.Response.Cookies.Set(new HttpCookie("returnurl", RedirectURL) + HttpContext.Current.Response.Cookies.Set(new HttpCookie("returnurl", this.RedirectURL) { Expires = DateTime.Now.AddMinutes(5), Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }); } - bool shouldAuthorize = OAuthClient.IsCurrentService() && OAuthClient.HaveVerificationCode(); - if(Mode == AuthMode.Login) + bool shouldAuthorize = this.OAuthClient.IsCurrentService() && this.OAuthClient.HaveVerificationCode(); + if(this.Mode == AuthMode.Login) { - shouldAuthorize = shouldAuthorize || OAuthClient.IsCurrentUserAuthorized(); + shouldAuthorize = shouldAuthorize || this.OAuthClient.IsCurrentUserAuthorized(); } if (shouldAuthorize) { - if (OAuthClient.Authorize() == AuthorisationResult.Authorized) + if (this.OAuthClient.Authorize() == AuthorisationResult.Authorized) { - OAuthClient.AuthenticateUser(GetCurrentUser(), PortalSettings, IPAddress, AddCustomProperties, OnUserAuthenticated); + this.OAuthClient.AuthenticateUser(this.GetCurrentUser(), this.PortalSettings, this.IPAddress, this.AddCustomProperties, this.OnUserAuthenticated); } } } @@ -62,7 +62,7 @@ protected override void OnLoad(EventArgs e) public override bool Enabled { - get { return OAuthConfigBase.GetConfig(AuthSystemApplicationName, PortalId).Enabled; } + get { return OAuthConfigBase.GetConfig(this.AuthSystemApplicationName, this.PortalId).Enabled; } } #endregion diff --git a/DNN Platform/Library/Services/Authentication/OAuth/OAuthSettingsBase.cs b/DNN Platform/Library/Services/Authentication/OAuth/OAuthSettingsBase.cs index 4913cb327c5..e4064658f51 100644 --- a/DNN Platform/Library/Services/Authentication/OAuth/OAuthSettingsBase.cs +++ b/DNN Platform/Library/Services/Authentication/OAuth/OAuthSettingsBase.cs @@ -16,9 +16,9 @@ public class OAuthSettingsBase : AuthenticationSettingsBase public override void UpdateSettings() { - if (SettingsEditor.IsValid && SettingsEditor.IsDirty) + if (this.SettingsEditor.IsValid && this.SettingsEditor.IsDirty) { - var config = (OAuthConfigBase)SettingsEditor.DataSource; + var config = (OAuthConfigBase)this.SettingsEditor.DataSource; OAuthConfigBase.UpdateConfig(config); } } @@ -27,9 +27,9 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - OAuthConfigBase config = OAuthConfigBase.GetConfig(AuthSystemApplicationName, PortalId); - SettingsEditor.DataSource = config; - SettingsEditor.DataBind(); + OAuthConfigBase config = OAuthConfigBase.GetConfig(this.AuthSystemApplicationName, this.PortalId); + this.SettingsEditor.DataSource = config; + this.SettingsEditor.DataBind(); } } } diff --git a/DNN Platform/Library/Services/Authentication/OAuth/UserData.cs b/DNN Platform/Library/Services/Authentication/OAuth/UserData.cs index 16137f52475..438dddb37c6 100644 --- a/DNN Platform/Library/Services/Authentication/OAuth/UserData.cs +++ b/DNN Platform/Library/Services/Authentication/OAuth/UserData.cs @@ -22,7 +22,7 @@ public virtual string DisplayName { get { - return Name; + return this.Name; } set { } } @@ -37,9 +37,9 @@ public virtual string FirstName { get { - return (!String.IsNullOrEmpty(Name) && Name.IndexOf(" ", StringComparison.Ordinal) > 0) ? Name.Substring(0, Name.IndexOf(" ", StringComparison.Ordinal)) : String.Empty; + return (!String.IsNullOrEmpty(this.Name) && this.Name.IndexOf(" ", StringComparison.Ordinal) > 0) ? this.Name.Substring(0, this.Name.IndexOf(" ", StringComparison.Ordinal)) : String.Empty; } - set { Name = value + " " + LastName; } + set { this.Name = value + " " + this.LastName; } } [DataMember(Name = "gender")] @@ -49,9 +49,9 @@ public virtual string LastName { get { - return (!String.IsNullOrEmpty(Name) && Name.IndexOf(" ", StringComparison.Ordinal) > 0) ? Name.Substring(Name.IndexOf(" ", StringComparison.Ordinal) + 1) : Name; + return (!String.IsNullOrEmpty(this.Name) && this.Name.IndexOf(" ", StringComparison.Ordinal) > 0) ? this.Name.Substring(this.Name.IndexOf(" ", StringComparison.Ordinal) + 1) : this.Name; } - set { Name = FirstName + " " + value; } + set { this.Name = this.FirstName + " " + value; } } @@ -65,11 +65,11 @@ public string PreferredEmail { get { - if (Emails == null) + if (this.Emails == null) { - return Email; + return this.Email; } - return Emails.PreferredEmail; + return this.Emails.PreferredEmail; } } diff --git a/DNN Platform/Library/Services/Authentication/UserAuthenticatedEventArgs.cs b/DNN Platform/Library/Services/Authentication/UserAuthenticatedEventArgs.cs index d71bc67b651..554dd55d86c 100644 --- a/DNN Platform/Library/Services/Authentication/UserAuthenticatedEventArgs.cs +++ b/DNN Platform/Library/Services/Authentication/UserAuthenticatedEventArgs.cs @@ -34,15 +34,15 @@ public class UserAuthenticatedEventArgs : EventArgs /// ----------------------------------------------------------------------------- public UserAuthenticatedEventArgs(UserInfo user, string token, UserLoginStatus status, string type) { - Profile = new NameValueCollection(); - Message = String.Empty; - AutoRegister = false; - Authenticated = true; - User = user; - LoginStatus = status; - UserToken = token; - AuthenticationType = type; - RememberMe = false; + this.Profile = new NameValueCollection(); + this.Message = String.Empty; + this.AutoRegister = false; + this.Authenticated = true; + this.User = user; + this.LoginStatus = status; + this.UserToken = token; + this.AuthenticationType = type; + this.RememberMe = false; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/Services/Authentication/UserAuthenticationInfo.cs b/DNN Platform/Library/Services/Authentication/UserAuthenticationInfo.cs index 6af74f3bc81..8c338ff13f4 100644 --- a/DNN Platform/Library/Services/Authentication/UserAuthenticationInfo.cs +++ b/DNN Platform/Library/Services/Authentication/UserAuthenticationInfo.cs @@ -28,9 +28,9 @@ public class UserAuthenticationInfo : BaseEntityInfo, IHydratable public UserAuthenticationInfo() { - AuthenticationToken = Null.NullString; - AuthenticationType = Null.NullString; - UserAuthenticationID = Null.NullInteger; + this.AuthenticationToken = Null.NullString; + this.AuthenticationType = Null.NullString; + this.UserAuthenticationID = Null.NullInteger; } #endregion @@ -77,13 +77,13 @@ public UserAuthenticationInfo() /// ----------------------------------------------------------------------------- public virtual void Fill(IDataReader dr) { - UserAuthenticationID = Null.SetNullInteger(dr["UserAuthenticationID"]); - UserID = Null.SetNullInteger(dr["UserID"]); - AuthenticationType = Null.SetNullString(dr["AuthenticationType"]); - AuthenticationToken = Null.SetNullString(dr["AuthenticationToken"]); + this.UserAuthenticationID = Null.SetNullInteger(dr["UserAuthenticationID"]); + this.UserID = Null.SetNullInteger(dr["UserID"]); + this.AuthenticationType = Null.SetNullString(dr["AuthenticationType"]); + this.AuthenticationToken = Null.SetNullString(dr["AuthenticationToken"]); //Fill base class fields - FillInternal(dr); + this.FillInternal(dr); } /// ----------------------------------------------------------------------------- @@ -96,11 +96,11 @@ public virtual int KeyID { get { - return UserAuthenticationID; + return this.UserAuthenticationID; } set { - UserAuthenticationID = value; + this.UserAuthenticationID = value; } } diff --git a/DNN Platform/Library/Services/Cache/CachingProvider.cs b/DNN Platform/Library/Services/Cache/CachingProvider.cs index 6e395dca641..f98c623bc47 100644 --- a/DNN Platform/Library/Services/Cache/CachingProvider.cs +++ b/DNN Platform/Library/Services/Cache/CachingProvider.cs @@ -154,12 +154,12 @@ private void ClearCacheInternal(string prefix, bool clearRuntime) if (clearRuntime) { //remove item from runtime cache - RemoveInternal(Convert.ToString(objDictionaryEntry.Key)); + this.RemoveInternal(Convert.ToString(objDictionaryEntry.Key)); } else { //Call provider's remove method - Remove(Convert.ToString(objDictionaryEntry.Key)); + this.Remove(Convert.ToString(objDictionaryEntry.Key)); } } } @@ -167,60 +167,60 @@ private void ClearCacheInternal(string prefix, bool clearRuntime) private void ClearCacheKeysByPortalInternal(int portalId, bool clearRuntime) { - RemoveFormattedCacheKey(DataCache.PortalCacheKey, clearRuntime, Null.NullInteger, string.Empty); - RemoveFormattedCacheKey(DataCache.LocalesCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.ProfileDefinitionsCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.ListsCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.SkinsCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.PortalUserCountCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.PackagesCacheKey, clearRuntime, portalId); - - RemoveCacheKey(DataCache.AllPortalsCacheKey, clearRuntime); + this.RemoveFormattedCacheKey(DataCache.PortalCacheKey, clearRuntime, Null.NullInteger, string.Empty); + this.RemoveFormattedCacheKey(DataCache.LocalesCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.ProfileDefinitionsCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.ListsCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.SkinsCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.PortalUserCountCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.PackagesCacheKey, clearRuntime, portalId); + + this.RemoveCacheKey(DataCache.AllPortalsCacheKey, clearRuntime); } private void ClearDesktopModuleCacheInternal(int portalId, bool clearRuntime) { - RemoveFormattedCacheKey(DataCache.DesktopModuleCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.PortalDesktopModuleCacheKey, clearRuntime, portalId); - RemoveCacheKey(DataCache.ModuleDefinitionCacheKey, clearRuntime); - RemoveCacheKey(DataCache.ModuleControlsCacheKey, clearRuntime); + this.RemoveFormattedCacheKey(DataCache.DesktopModuleCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.PortalDesktopModuleCacheKey, clearRuntime, portalId); + this.RemoveCacheKey(DataCache.ModuleDefinitionCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.ModuleControlsCacheKey, clearRuntime); } private void ClearFolderCacheInternal(int portalId, bool clearRuntime) { - RemoveFormattedCacheKey(DataCache.FolderCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.FolderCacheKey, clearRuntime, portalId); // FolderUserCacheKey also includes permissions and userId but we don't have that information // here so we remove them using a prefix var folderUserCachePrefix = GetCacheKey(string.Format("Folders|{0}|", portalId)); - ClearCacheInternal(folderUserCachePrefix, clearRuntime); + this.ClearCacheInternal(folderUserCachePrefix, clearRuntime); PermissionProvider.ResetCacheDependency(portalId, - () => RemoveFormattedCacheKey(DataCache.FolderPermissionCacheKey, clearRuntime, portalId)); + () => this.RemoveFormattedCacheKey(DataCache.FolderPermissionCacheKey, clearRuntime, portalId)); } private void ClearHostCacheInternal(bool clearRuntime) { - RemoveCacheKey(DataCache.HostSettingsCacheKey, clearRuntime); - RemoveCacheKey(DataCache.SecureHostSettingsCacheKey, clearRuntime); - RemoveCacheKey(DataCache.UnSecureHostSettingsCacheKey, clearRuntime); - RemoveCacheKey(DataCache.PortalAliasCacheKey, clearRuntime); - RemoveCacheKey("CSS", clearRuntime); - RemoveCacheKey("StyleSheets", clearRuntime); - RemoveCacheKey(DataCache.DesktopModulePermissionCacheKey, clearRuntime); - RemoveCacheKey("GetRoles", clearRuntime); - RemoveCacheKey("CompressionConfig", clearRuntime); - RemoveCacheKey(DataCache.SubscriptionTypesCacheKey, clearRuntime); - RemoveCacheKey(DataCache.PackageTypesCacheKey, clearRuntime); - RemoveCacheKey(DataCache.PermissionsCacheKey, clearRuntime); - RemoveCacheKey(DataCache.ContentTypesCacheKey, clearRuntime); - RemoveCacheKey(DataCache.JavaScriptLibrariesCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.HostSettingsCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.SecureHostSettingsCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.UnSecureHostSettingsCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.PortalAliasCacheKey, clearRuntime); + this.RemoveCacheKey("CSS", clearRuntime); + this.RemoveCacheKey("StyleSheets", clearRuntime); + this.RemoveCacheKey(DataCache.DesktopModulePermissionCacheKey, clearRuntime); + this.RemoveCacheKey("GetRoles", clearRuntime); + this.RemoveCacheKey("CompressionConfig", clearRuntime); + this.RemoveCacheKey(DataCache.SubscriptionTypesCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.PackageTypesCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.PermissionsCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.ContentTypesCacheKey, clearRuntime); + this.RemoveCacheKey(DataCache.JavaScriptLibrariesCacheKey, clearRuntime); //Clear "portal keys" for Host - ClearFolderCacheInternal(-1, clearRuntime); - ClearDesktopModuleCacheInternal(-1, clearRuntime); - ClearCacheKeysByPortalInternal(-1, clearRuntime); - ClearTabCacheInternal(-1, clearRuntime); + this.ClearFolderCacheInternal(-1, clearRuntime); + this.ClearDesktopModuleCacheInternal(-1, clearRuntime); + this.ClearCacheKeysByPortalInternal(-1, clearRuntime); + this.ClearTabCacheInternal(-1, clearRuntime); } private void ClearModuleCacheInternal(int tabId, bool clearRuntime) @@ -233,95 +233,95 @@ private void ClearModuleCacheInternal(int tabId, bool clearRuntime) { cacheKey = string.Format(DataCache.SingleTabModuleCacheKey, moduleInfo.TabModuleID); if (clearRuntime) - RemoveInternal(cacheKey); + this.RemoveInternal(cacheKey); else - Remove(cacheKey); + this.Remove(cacheKey); } } - RemoveFormattedCacheKey(DataCache.TabModuleCacheKey, clearRuntime, tabId); - RemoveFormattedCacheKey(DataCache.PublishedTabModuleCacheKey, clearRuntime, tabId); - RemoveFormattedCacheKey(DataCache.ModulePermissionCacheKey, clearRuntime, tabId); - RemoveFormattedCacheKey(DataCache.ModuleSettingsCacheKey, clearRuntime, tabId); + this.RemoveFormattedCacheKey(DataCache.TabModuleCacheKey, clearRuntime, tabId); + this.RemoveFormattedCacheKey(DataCache.PublishedTabModuleCacheKey, clearRuntime, tabId); + this.RemoveFormattedCacheKey(DataCache.ModulePermissionCacheKey, clearRuntime, tabId); + this.RemoveFormattedCacheKey(DataCache.ModuleSettingsCacheKey, clearRuntime, tabId); } private void ClearModulePermissionsCachesByPortalInternal(int portalId, bool clearRuntime) { foreach (var tabPair in TabController.Instance.GetTabsByPortal(portalId)) { - RemoveFormattedCacheKey(DataCache.ModulePermissionCacheKey, clearRuntime, tabPair.Value.TabID); + this.RemoveFormattedCacheKey(DataCache.ModulePermissionCacheKey, clearRuntime, tabPair.Value.TabID); } } private void ClearPortalCacheInternal(int portalId, bool cascade, bool clearRuntime) { - RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, string.Empty); + this.RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, string.Empty); var locales = LocaleController.Instance.GetLocales(portalId); if (locales == null || locales.Count == 0) { //At least attempt to remove default locale string defaultLocale = PortalController.GetPortalDefaultLanguage(portalId); - RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, defaultLocale), clearRuntime); - RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, Null.NullString), clearRuntime); - RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, defaultLocale); + this.RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, defaultLocale), clearRuntime); + this.RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, Null.NullString), clearRuntime); + this.RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, defaultLocale); } else { foreach (Locale portalLocale in LocaleController.Instance.GetLocales(portalId).Values) { - RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, portalLocale.Code), clearRuntime); - RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, portalLocale.Code); + this.RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, portalLocale.Code), clearRuntime); + this.RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, portalLocale.Code); } - RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, Null.NullString), clearRuntime); - RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, Null.NullString); + this.RemoveCacheKey(String.Format(DataCache.PortalCacheKey, portalId, Null.NullString), clearRuntime); + this.RemoveFormattedCacheKey(DataCache.PortalSettingsCacheKey, clearRuntime, portalId, Null.NullString); } if (cascade) { foreach (KeyValuePair tabPair in TabController.Instance.GetTabsByPortal(portalId)) { - ClearModuleCacheInternal(tabPair.Value.TabID, clearRuntime); + this.ClearModuleCacheInternal(tabPair.Value.TabID, clearRuntime); } foreach (ModuleInfo moduleInfo in ModuleController.Instance.GetModules(portalId)) { - RemoveCacheKey("GetModuleSettings" + moduleInfo.ModuleID, clearRuntime); + this.RemoveCacheKey("GetModuleSettings" + moduleInfo.ModuleID, clearRuntime); } } //Clear "portal keys" for Portal - ClearFolderCacheInternal(portalId, clearRuntime); - ClearCacheKeysByPortalInternal(portalId, clearRuntime); - ClearDesktopModuleCacheInternal(portalId, clearRuntime); - ClearTabCacheInternal(portalId, clearRuntime); + this.ClearFolderCacheInternal(portalId, clearRuntime); + this.ClearCacheKeysByPortalInternal(portalId, clearRuntime); + this.ClearDesktopModuleCacheInternal(portalId, clearRuntime); + this.ClearTabCacheInternal(portalId, clearRuntime); - RemoveCacheKey(String.Format(DataCache.RolesCacheKey, portalId), clearRuntime); - RemoveCacheKey(String.Format(DataCache.JournalTypesCacheKey, portalId), clearRuntime); + this.RemoveCacheKey(String.Format(DataCache.RolesCacheKey, portalId), clearRuntime); + this.RemoveCacheKey(String.Format(DataCache.JournalTypesCacheKey, portalId), clearRuntime); } private void ClearTabCacheInternal(int portalId, bool clearRuntime) { - RemoveFormattedCacheKey(DataCache.TabCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.TabAliasSkinCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.TabCustomAliasCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.TabUrlCacheKey, clearRuntime, portalId); - RemoveFormattedCacheKey(DataCache.TabPermissionCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.TabCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.TabAliasSkinCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.TabCustomAliasCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.TabUrlCacheKey, clearRuntime, portalId); + this.RemoveFormattedCacheKey(DataCache.TabPermissionCacheKey, clearRuntime, portalId); Dictionary locales = LocaleController.Instance.GetLocales(portalId); if (locales == null || locales.Count == 0) { //At least attempt to remove default locale string defaultLocale = PortalController.GetPortalDefaultLanguage(portalId); - RemoveCacheKey(string.Format(DataCache.TabPathCacheKey, defaultLocale, portalId), clearRuntime); + this.RemoveCacheKey(string.Format(DataCache.TabPathCacheKey, defaultLocale, portalId), clearRuntime); } else { foreach (Locale portalLocale in LocaleController.Instance.GetLocales(portalId).Values) { - RemoveCacheKey(string.Format(DataCache.TabPathCacheKey, portalLocale.Code, portalId), clearRuntime); + this.RemoveCacheKey(string.Format(DataCache.TabPathCacheKey, portalLocale.Code, portalId), clearRuntime); } } - RemoveCacheKey(string.Format(DataCache.TabPathCacheKey, Null.NullString, portalId), clearRuntime); - RemoveCacheKey(string.Format(DataCache.TabSettingsCacheKey, portalId), clearRuntime); + this.RemoveCacheKey(string.Format(DataCache.TabPathCacheKey, Null.NullString, portalId), clearRuntime); + this.RemoveCacheKey(string.Format(DataCache.TabSettingsCacheKey, portalId), clearRuntime); } private void RemoveCacheKey(string CacheKey, bool clearRuntime) @@ -329,12 +329,12 @@ private void RemoveCacheKey(string CacheKey, bool clearRuntime) if (clearRuntime) { //remove item from runtime cache - RemoveInternal(GetCacheKey(CacheKey)); + this.RemoveInternal(GetCacheKey(CacheKey)); } else { //Call provider's remove method - Remove(GetCacheKey(CacheKey)); + this.Remove(GetCacheKey(CacheKey)); } } @@ -343,12 +343,12 @@ private void RemoveFormattedCacheKey(string CacheKeyBase, bool clearRuntime, par if (clearRuntime) { //remove item from runtime cache - RemoveInternal(string.Format(GetCacheKey(CacheKeyBase), parameters)); + this.RemoveInternal(string.Format(GetCacheKey(CacheKeyBase), parameters)); } else { //Call provider's remove method - Remove(string.Format(GetCacheKey(CacheKeyBase), parameters)); + this.Remove(string.Format(GetCacheKey(CacheKeyBase), parameters)); } } @@ -367,31 +367,31 @@ protected void ClearCacheInternal(string cacheType, string data, bool clearRunti switch (cacheType) { case "Prefix": - ClearCacheInternal(data, clearRuntime); + this.ClearCacheInternal(data, clearRuntime); break; case "Host": - ClearHostCacheInternal(clearRuntime); + this.ClearHostCacheInternal(clearRuntime); break; case "Folder": - ClearFolderCacheInternal(int.Parse(data), clearRuntime); + this.ClearFolderCacheInternal(int.Parse(data), clearRuntime); break; case "Module": - ClearModuleCacheInternal(int.Parse(data), clearRuntime); + this.ClearModuleCacheInternal(int.Parse(data), clearRuntime); break; case "ModulePermissionsByPortal": - ClearModulePermissionsCachesByPortalInternal(int.Parse(data), clearRuntime); + this.ClearModulePermissionsCachesByPortalInternal(int.Parse(data), clearRuntime); break; case "Portal": - ClearPortalCacheInternal(int.Parse(data), false, clearRuntime); + this.ClearPortalCacheInternal(int.Parse(data), false, clearRuntime); break; case "PortalCascade": - ClearPortalCacheInternal(int.Parse(data), true, clearRuntime); + this.ClearPortalCacheInternal(int.Parse(data), true, clearRuntime); break; case "Tab": - ClearTabCacheInternal(int.Parse(data), clearRuntime); + this.ClearTabCacheInternal(int.Parse(data), clearRuntime); break; case "ServiceFrameworkRoutes": - ReloadServicesFrameworkRoutes(); + this.ReloadServicesFrameworkRoutes(); break; } } @@ -426,7 +426,7 @@ protected void RemoveInternal(string cacheKey) /// The data. public virtual void Clear(string type, string data) { - ClearCacheInternal(type, data, false); + this.ClearCacheInternal(type, data, false); } public virtual IDictionaryEnumerator GetEnumerator() @@ -451,7 +451,7 @@ public virtual object GetItem(string cacheKey) /// The object. public virtual void Insert(string cacheKey, object itemToCache) { - Insert(cacheKey, itemToCache, null as DNNCacheDependency, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null); + this.Insert(cacheKey, itemToCache, null as DNNCacheDependency, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null); } /// @@ -462,7 +462,7 @@ public virtual void Insert(string cacheKey, object itemToCache) /// The dependency. public virtual void Insert(string cacheKey, object itemToCache, DNNCacheDependency dependency) { - Insert(cacheKey, itemToCache, dependency, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null); + this.Insert(cacheKey, itemToCache, dependency, System.Web.Caching.Cache.NoAbsoluteExpiration, System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null); } /// @@ -475,7 +475,7 @@ public virtual void Insert(string cacheKey, object itemToCache, DNNCacheDependen /// The sliding expiration. public virtual void Insert(string cacheKey, object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration) { - Insert(cacheKey, itemToCache, dependency, absoluteExpiration, slidingExpiration, CacheItemPriority.Default, null); + this.Insert(cacheKey, itemToCache, dependency, absoluteExpiration, slidingExpiration, CacheItemPriority.Default, null); } /// @@ -520,7 +520,7 @@ public virtual string PurgeCache() /// The cache key. public virtual void Remove(string CacheKey) { - RemoveInternal(CacheKey); + this.RemoveInternal(CacheKey); } #endregion diff --git a/DNN Platform/Library/Services/Cache/DNNCacheDependency.cs b/DNN Platform/Library/Services/Cache/DNNCacheDependency.cs index 4cdac3f9f79..469d640e7b0 100644 --- a/DNN Platform/Library/Services/Cache/DNNCacheDependency.cs +++ b/DNN Platform/Library/Services/Cache/DNNCacheDependency.cs @@ -37,7 +37,7 @@ public class DNNCacheDependency : IDisposable /// The system cache dependency. public DNNCacheDependency(CacheDependency systemCacheDependency) { - _systemCacheDependency = systemCacheDependency; + this._systemCacheDependency = systemCacheDependency; } /// @@ -46,7 +46,7 @@ public DNNCacheDependency(CacheDependency systemCacheDependency) /// public DNNCacheDependency(string filename) { - _fileNames = new[] {filename}; + this._fileNames = new[] {filename}; } /// @@ -55,7 +55,7 @@ public DNNCacheDependency(string filename) /// set the cache depend on muti files. public DNNCacheDependency(string[] filenames) { - _fileNames = filenames; + this._fileNames = filenames; } /// @@ -66,8 +66,8 @@ public DNNCacheDependency(string[] filenames) /// The start. public DNNCacheDependency(string[] filenames, DateTime start) { - _utcStart = start.ToUniversalTime(); - _fileNames = filenames; + this._utcStart = start.ToUniversalTime(); + this._fileNames = filenames; } /// @@ -78,8 +78,8 @@ public DNNCacheDependency(string[] filenames, DateTime start) /// The cachekeys. public DNNCacheDependency(string[] filenames, string[] cachekeys) { - _fileNames = filenames; - _cacheKeys = cachekeys; + this._fileNames = filenames; + this._cacheKeys = cachekeys; } /// @@ -89,10 +89,10 @@ public DNNCacheDependency(string[] filenames, string[] cachekeys) /// The start. public DNNCacheDependency(string filename, DateTime start) { - _utcStart = start.ToUniversalTime(); + this._utcStart = start.ToUniversalTime(); if (filename != null) { - _fileNames = new[] {filename}; + this._fileNames = new[] {filename}; } } @@ -105,9 +105,9 @@ public DNNCacheDependency(string filename, DateTime start) /// The start. public DNNCacheDependency(string[] filenames, string[] cachekeys, DateTime start) { - _utcStart = start.ToUniversalTime(); - _fileNames = filenames; - _cacheKeys = cachekeys; + this._utcStart = start.ToUniversalTime(); + this._fileNames = filenames; + this._cacheKeys = cachekeys; } /// @@ -119,9 +119,9 @@ public DNNCacheDependency(string[] filenames, string[] cachekeys, DateTime start /// The dependency. public DNNCacheDependency(string[] filenames, string[] cachekeys, DNNCacheDependency dependency) { - _fileNames = filenames; - _cacheKeys = cachekeys; - _cacheDependency = dependency; + this._fileNames = filenames; + this._cacheKeys = cachekeys; + this._cacheDependency = dependency; } /// @@ -135,10 +135,10 @@ public DNNCacheDependency(string[] filenames, string[] cachekeys, DNNCacheDepend /// The start. public DNNCacheDependency(string[] filenames, string[] cachekeys, DNNCacheDependency dependency, DateTime start) { - _utcStart = start.ToUniversalTime(); - _fileNames = filenames; - _cacheKeys = cachekeys; - _cacheDependency = dependency; + this._utcStart = start.ToUniversalTime(); + this._fileNames = filenames; + this._cacheKeys = cachekeys; + this._cacheDependency = dependency; } #endregion @@ -152,7 +152,7 @@ public string[] CacheKeys { get { - return _cacheKeys; + return this._cacheKeys; } } @@ -163,7 +163,7 @@ public string[] FileNames { get { - return _fileNames; + return this._fileNames; } } @@ -177,7 +177,7 @@ public bool HasChanged { get { - return SystemCacheDependency.HasChanged; + return this.SystemCacheDependency.HasChanged; } } @@ -188,7 +188,7 @@ public DNNCacheDependency CacheDependency { get { - return _cacheDependency; + return this._cacheDependency; } } @@ -199,7 +199,7 @@ public DateTime StartTime { get { - return _utcStart; + return this._utcStart; } } @@ -210,18 +210,18 @@ public CacheDependency SystemCacheDependency { get { - if (_systemCacheDependency == null) + if (this._systemCacheDependency == null) { - if (_cacheDependency == null) + if (this._cacheDependency == null) { - _systemCacheDependency = new CacheDependency(_fileNames, _cacheKeys, _utcStart); + this._systemCacheDependency = new CacheDependency(this._fileNames, this._cacheKeys, this._utcStart); } else { - _systemCacheDependency = new CacheDependency(_fileNames, _cacheKeys, _cacheDependency.SystemCacheDependency, _utcStart); + this._systemCacheDependency = new CacheDependency(this._fileNames, this._cacheKeys, this._cacheDependency.SystemCacheDependency, this._utcStart); } } - return _systemCacheDependency; + return this._systemCacheDependency; } } @@ -232,7 +232,7 @@ public DateTime UtcLastModified { get { - return SystemCacheDependency.UtcLastModified; + return this.SystemCacheDependency.UtcLastModified; } } @@ -245,7 +245,7 @@ public DateTime UtcLastModified /// public void Dispose() { - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } @@ -255,18 +255,18 @@ protected virtual void Dispose(bool disposing) { if ((disposing)) { - if (_cacheDependency != null) + if (this._cacheDependency != null) { - _cacheDependency.Dispose(disposing); + this._cacheDependency.Dispose(disposing); } - if (_systemCacheDependency != null) + if (this._systemCacheDependency != null) { - _systemCacheDependency.Dispose(); + this._systemCacheDependency.Dispose(); } - _fileNames = null; - _cacheKeys = null; - _cacheDependency = null; - _systemCacheDependency = null; + this._fileNames = null; + this._cacheKeys = null; + this._cacheDependency = null; + this._systemCacheDependency = null; } } diff --git a/DNN Platform/Library/Services/Cache/FBCachingProvider.cs b/DNN Platform/Library/Services/Cache/FBCachingProvider.cs index f127299a981..e76101e20eb 100644 --- a/DNN Platform/Library/Services/Cache/FBCachingProvider.cs +++ b/DNN Platform/Library/Services/Cache/FBCachingProvider.cs @@ -33,7 +33,7 @@ public override void Insert(string cacheKey, object itemToCache, DNNCacheDepende DNNCacheDependency d = dependency; //if web farm is enabled - if (IsWebFarm()) + if (this.IsWebFarm()) { //get hashed file name var f = new string[1]; @@ -61,7 +61,7 @@ public override bool IsWebFarm() public override string PurgeCache() { //called by scheduled job to remove cache files which are no longer active - return PurgeCacheFiles(Globals.HostMapPath + CachingDirectory); + return this.PurgeCacheFiles(Globals.HostMapPath + CachingDirectory); } public override void Remove(string Key) @@ -69,7 +69,7 @@ public override void Remove(string Key) base.Remove(Key); //if web farm is enabled in config file - if (IsWebFarm()) + if (this.IsWebFarm()) { //get hashed filename string f = GetFileName(Key); diff --git a/DNN Platform/Library/Services/Cache/PurgeCache.cs b/DNN Platform/Library/Services/Cache/PurgeCache.cs index ed2d3045c58..8f2909e1e19 100644 --- a/DNN Platform/Library/Services/Cache/PurgeCache.cs +++ b/DNN Platform/Library/Services/Cache/PurgeCache.cs @@ -16,7 +16,7 @@ public class PurgeCache : SchedulerClient { public PurgeCache(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; //REQUIRED + this.ScheduleHistoryItem = objScheduleHistoryItem; //REQUIRED } public override void DoWork() @@ -25,17 +25,17 @@ public override void DoWork() { string str = CachingProvider.Instance().PurgeCache(); - ScheduleHistoryItem.Succeeded = true; //REQUIRED - ScheduleHistoryItem.AddLogNote(str); + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.AddLogNote(str); } catch (Exception exc) //REQUIRED { - ScheduleHistoryItem.Succeeded = false; //REQUIRED + this.ScheduleHistoryItem.Succeeded = false; //REQUIRED - ScheduleHistoryItem.AddLogNote(string.Format("Purging cache task failed: {0}.", exc.ToString())); + this.ScheduleHistoryItem.AddLogNote(string.Format("Purging cache task failed: {0}.", exc.ToString())); //notification that we have errored - Errored(ref exc); //REQUIRED + this.Errored(ref exc); //REQUIRED //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL diff --git a/DNN Platform/Library/Services/ClientCapability/ClientCapability.cs b/DNN Platform/Library/Services/ClientCapability/ClientCapability.cs index aca9ec63d54..cb58fa159d2 100644 --- a/DNN Platform/Library/Services/ClientCapability/ClientCapability.cs +++ b/DNN Platform/Library/Services/ClientCapability/ClientCapability.cs @@ -23,7 +23,7 @@ public class ClientCapability : IClientCapability /// public ClientCapability() { - _capabilities = new Dictionary(); + this._capabilities = new Dictionary(); } #region Implementation of IClientCapability @@ -85,12 +85,12 @@ public IDictionary Capabilities { get { - return _capabilities; + return this._capabilities; } set { - _capabilities = value; + this._capabilities = value; } } diff --git a/DNN Platform/Library/Services/ClientCapability/ClientCapabilityProvider.cs b/DNN Platform/Library/Services/ClientCapability/ClientCapabilityProvider.cs index 18111634870..7bb3671ddff 100644 --- a/DNN Platform/Library/Services/ClientCapability/ClientCapabilityProvider.cs +++ b/DNN Platform/Library/Services/ClientCapability/ClientCapabilityProvider.cs @@ -67,7 +67,7 @@ public virtual bool SupportsTabletDetection /// public virtual IClientCapability GetClientCapability(HttpRequest httpRequest) { - IClientCapability clientCapability = GetClientCapability(httpRequest.UserAgent); + IClientCapability clientCapability = this.GetClientCapability(httpRequest.UserAgent); clientCapability.FacebookRequest = FacebookRequestController.GetFacebookDetailsFromRequest(httpRequest); return clientCapability; diff --git a/DNN Platform/Library/Services/ClientCapability/FacebookRequest.cs b/DNN Platform/Library/Services/ClientCapability/FacebookRequest.cs index cc3b6d8acdd..6445dd1d97d 100644 --- a/DNN Platform/Library/Services/ClientCapability/FacebookRequest.cs +++ b/DNN Platform/Library/Services/ClientCapability/FacebookRequest.cs @@ -107,7 +107,7 @@ public class FacebookRequest #region Public Methods public bool IsValidSignature (string secretKey) { - return FacebookRequestController.IsValidSignature(RawSignedRequest,secretKey); + return FacebookRequestController.IsValidSignature(this.RawSignedRequest,secretKey); } #endregion } diff --git a/DNN Platform/Library/Services/ClientDependency/PurgeClientDependencyFiles.cs b/DNN Platform/Library/Services/ClientDependency/PurgeClientDependencyFiles.cs index 90f792ca20e..cdb96649f50 100644 --- a/DNN Platform/Library/Services/ClientDependency/PurgeClientDependencyFiles.cs +++ b/DNN Platform/Library/Services/ClientDependency/PurgeClientDependencyFiles.cs @@ -16,7 +16,7 @@ class PurgeClientDependencyFiles : SchedulerClient { public PurgeClientDependencyFiles(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; //REQUIRED + this.ScheduleHistoryItem = objScheduleHistoryItem; //REQUIRED } public override void DoWork() @@ -28,17 +28,17 @@ public override void DoWork() { File.Delete(filePath); } - ScheduleHistoryItem.Succeeded = true; //REQUIRED - ScheduleHistoryItem.AddLogNote("Purging client dependency files task succeeded"); + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("Purging client dependency files task succeeded"); } catch (Exception exc) //REQUIRED { - ScheduleHistoryItem.Succeeded = false; //REQUIRED + this.ScheduleHistoryItem.Succeeded = false; //REQUIRED - ScheduleHistoryItem.AddLogNote(string.Format("Purging client dependency files task failed: {0}.", exc.ToString())); + this.ScheduleHistoryItem.AddLogNote(string.Format("Purging client dependency files task failed: {0}.", exc.ToString())); //notification that we have errored - Errored(ref exc); //REQUIRED + this.Errored(ref exc); //REQUIRED //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL diff --git a/DNN Platform/Library/Services/Connections/ConnectionsManager.cs b/DNN Platform/Library/Services/Connections/ConnectionsManager.cs index f91d7d7a95a..aa6cff62d0d 100644 --- a/DNN Platform/Library/Services/Connections/ConnectionsManager.cs +++ b/DNN Platform/Library/Services/Connections/ConnectionsManager.cs @@ -42,7 +42,7 @@ public void RegisterConnections() { if (_processors == null) { - LoadProcessors(); + this.LoadProcessors(); } } } @@ -50,7 +50,7 @@ public void RegisterConnections() public IList GetConnectors() { - return _processors.Values.Where(x => IsPackageInstalled(x.GetType().Assembly)).ToList(); + return _processors.Values.Where(x => this.IsPackageInstalled(x.GetType().Assembly)).ToList(); } #endregion @@ -62,7 +62,7 @@ private void LoadProcessors() _processors = new Dictionary(); var typeLocator = new TypeLocator(); - var types = typeLocator.GetAllMatchingTypes(IsValidFilter); + var types = typeLocator.GetAllMatchingTypes(this.IsValidFilter); foreach (var type in types) { diff --git a/DNN Platform/Library/Services/Connections/DynamicJsonConverter.cs b/DNN Platform/Library/Services/Connections/DynamicJsonConverter.cs index 7f015c7efca..801dcceac97 100644 --- a/DNN Platform/Library/Services/Connections/DynamicJsonConverter.cs +++ b/DNN Platform/Library/Services/Connections/DynamicJsonConverter.cs @@ -43,20 +43,20 @@ public DynamicJsonObject(IDictionary dictionary) { if (dictionary == null) throw new ArgumentNullException("dictionary"); - _dictionary = dictionary; + this._dictionary = dictionary; } public override string ToString() { var sb = new StringBuilder("{"); - ToString(sb); + this.ToString(sb); return sb.ToString(); } private void ToString(StringBuilder sb) { var firstInDictionary = true; - foreach (var pair in _dictionary) + foreach (var pair in this._dictionary) { if (!firstInDictionary) { @@ -112,7 +112,7 @@ private void ToString(StringBuilder sb) public override bool TryGetMember(GetMemberBinder binder, out object result) { - if (!_dictionary.TryGetValue(binder.Name, out result)) + if (!this._dictionary.TryGetValue(binder.Name, out result)) { // return null to avoid exception. caller can check for null this way... result = null; @@ -127,7 +127,7 @@ public override bool TryGetIndex(GetIndexBinder binder, object[] indexes, out ob { if (indexes.Length == 1 && indexes[0] != null) { - if (!_dictionary.TryGetValue(indexes[0].ToString(), out result)) + if (!this._dictionary.TryGetValue(indexes[0].ToString(), out result)) { // return null to avoid exception. caller can check for null this way... result = null; diff --git a/DNN Platform/Library/Services/DependencyInjection/IScopeAccessor.cs b/DNN Platform/Library/Services/DependencyInjection/IScopeAccessor.cs index d5b0606e58c..af02724ede5 100644 --- a/DNN Platform/Library/Services/DependencyInjection/IScopeAccessor.cs +++ b/DNN Platform/Library/Services/DependencyInjection/IScopeAccessor.cs @@ -19,17 +19,17 @@ public class ScopeAccessor : IScopeAccessor public ScopeAccessor() { - _getContextItems = fallbackGetContextItems; + this._getContextItems = fallbackGetContextItems; } public IServiceScope GetScope() { - return HttpContextDependencyInjectionExtensions.GetScope(_getContextItems()); + return HttpContextDependencyInjectionExtensions.GetScope(this._getContextItems()); } internal void SetContextItemsFunc(Func getContextItems) { - _getContextItems = getContextItems ?? fallbackGetContextItems; + this._getContextItems = getContextItems ?? fallbackGetContextItems; } } } diff --git a/DNN Platform/Library/Services/EventQueue/Config/EventQueueConfiguration.cs b/DNN Platform/Library/Services/EventQueue/Config/EventQueueConfiguration.cs index f3f6b53899b..3256bb63392 100644 --- a/DNN Platform/Library/Services/EventQueue/Config/EventQueueConfiguration.cs +++ b/DNN Platform/Library/Services/EventQueue/Config/EventQueueConfiguration.cs @@ -25,8 +25,8 @@ internal class EventQueueConfiguration internal EventQueueConfiguration() { - PublishedEvents = new Dictionary(); - EventQueueSubscribers = new Dictionary(); + this.PublishedEvents = new Dictionary(); + this.EventQueueSubscribers = new Dictionary(); } #endregion @@ -52,7 +52,7 @@ private void Deserialize(string configXml) var oPublishedEvent = new PublishedEvent(); oPublishedEvent.EventName = xmlItem.SelectSingleNode("EventName").InnerText; oPublishedEvent.Subscribers = xmlItem.SelectSingleNode("Subscribers").InnerText; - PublishedEvents.Add(oPublishedEvent.EventName, oPublishedEvent); + this.PublishedEvents.Add(oPublishedEvent.EventName, oPublishedEvent); } foreach (XmlElement xmlItem in xmlDoc.SelectNodes("/EventQueueConfig/EventQueueSubscribers/Subscriber")) { @@ -62,7 +62,7 @@ private void Deserialize(string configXml) oSubscriberInfo.Address = xmlItem.SelectSingleNode("Address").InnerText; oSubscriberInfo.Description = xmlItem.SelectSingleNode("Description").InnerText; oSubscriberInfo.PrivateKey = xmlItem.SelectSingleNode("PrivateKey").InnerText; - EventQueueSubscribers.Add(oSubscriberInfo.ID, oSubscriberInfo); + this.EventQueueSubscribers.Add(oSubscriberInfo.ID, oSubscriberInfo); } } } @@ -94,27 +94,27 @@ private string Serialize() writer.WriteStartElement("EventQueueConfig"); writer.WriteStartElement("PublishedEvents"); - foreach (string key in PublishedEvents.Keys) + foreach (string key in this.PublishedEvents.Keys) { writer.WriteStartElement("Event"); - writer.WriteElementString("EventName", PublishedEvents[key].EventName); - writer.WriteElementString("Subscribers", PublishedEvents[key].Subscribers); + writer.WriteElementString("EventName", this.PublishedEvents[key].EventName); + writer.WriteElementString("Subscribers", this.PublishedEvents[key].Subscribers); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("EventQueueSubscribers"); - foreach (string key in EventQueueSubscribers.Keys) + foreach (string key in this.EventQueueSubscribers.Keys) { writer.WriteStartElement("Subscriber"); - writer.WriteElementString("ID", EventQueueSubscribers[key].ID); - writer.WriteElementString("Name", EventQueueSubscribers[key].Name); - writer.WriteElementString("Address", EventQueueSubscribers[key].Address); - writer.WriteElementString("Description", EventQueueSubscribers[key].Description); - writer.WriteElementString("PrivateKey", EventQueueSubscribers[key].PrivateKey); + writer.WriteElementString("ID", this.EventQueueSubscribers[key].ID); + writer.WriteElementString("Name", this.EventQueueSubscribers[key].Name); + writer.WriteElementString("Address", this.EventQueueSubscribers[key].Address); + writer.WriteElementString("Description", this.EventQueueSubscribers[key].Description); + writer.WriteElementString("PrivateKey", this.EventQueueSubscribers[key].PrivateKey); writer.WriteEndElement(); } writer.WriteEndElement(); diff --git a/DNN Platform/Library/Services/EventQueue/Config/SubscriberInfo.cs b/DNN Platform/Library/Services/EventQueue/Config/SubscriberInfo.cs index a2af85d3532..1aa1dd85bed 100644 --- a/DNN Platform/Library/Services/EventQueue/Config/SubscriberInfo.cs +++ b/DNN Platform/Library/Services/EventQueue/Config/SubscriberInfo.cs @@ -17,17 +17,17 @@ public class SubscriberInfo { public SubscriberInfo() { - ID = Guid.NewGuid().ToString(); - Name = ""; - Description = ""; - Address = ""; + this.ID = Guid.NewGuid().ToString(); + this.Name = ""; + this.Description = ""; + this.Address = ""; var oPortalSecurity = PortalSecurity.Instance; - PrivateKey = oPortalSecurity.CreateKey(16); + this.PrivateKey = oPortalSecurity.CreateKey(16); } public SubscriberInfo(string subscriberName) : this() { - Name = subscriberName; + this.Name = subscriberName; } public string ID { get; set; } diff --git a/DNN Platform/Library/Services/EventQueue/EventMessage.cs b/DNN Platform/Library/Services/EventQueue/EventMessage.cs index f42efbc2992..58228c7826c 100644 --- a/DNN Platform/Library/Services/EventQueue/EventMessage.cs +++ b/DNN Platform/Library/Services/EventQueue/EventMessage.cs @@ -47,7 +47,7 @@ public class EventMessage public EventMessage() { - _attributes = new NameValueCollection(); + this._attributes = new NameValueCollection(); } #endregion @@ -58,11 +58,11 @@ public int EventMessageID { get { - return _eventMessageID; + return this._eventMessageID; } set { - _eventMessageID = value; + this._eventMessageID = value; } } @@ -70,18 +70,18 @@ public string ProcessorType { get { - if (_processorType == null) + if (this._processorType == null) { return string.Empty; } else { - return _processorType; + return this._processorType; } } set { - _processorType = value; + this._processorType = value; } } @@ -89,18 +89,18 @@ public string ProcessorCommand { get { - if (_processorCommand == null) + if (this._processorCommand == null) { return string.Empty; } else { - return _processorCommand; + return this._processorCommand; } } set { - _processorCommand = value; + this._processorCommand = value; } } @@ -108,18 +108,18 @@ public string Body { get { - if (_body == null) + if (this._body == null) { return string.Empty; } else { - return _body; + return this._body; } } set { - _body = value; + this._body = value; } } @@ -127,18 +127,18 @@ public string Sender { get { - if (_sender == null) + if (this._sender == null) { return string.Empty; } else { - return _sender; + return this._sender; } } set { - _sender = value; + this._sender = value; } } @@ -146,18 +146,18 @@ public string Subscribers { get { - if (_subscribers == null) + if (this._subscribers == null) { return string.Empty; } else { - return _subscribers; + return this._subscribers; } } set { - _subscribers = value; + this._subscribers = value; } } @@ -165,18 +165,18 @@ public string AuthorizedRoles { get { - if (_authorizedRoles == null) + if (this._authorizedRoles == null) { return string.Empty; } else { - return _authorizedRoles; + return this._authorizedRoles; } } set { - _authorizedRoles = value; + this._authorizedRoles = value; } } @@ -184,11 +184,11 @@ public MessagePriority Priority { get { - return _priority; + return this._priority; } set { - _priority = value; + this._priority = value; } } @@ -196,18 +196,18 @@ public string ExceptionMessage { get { - if (_exceptionMessage == null) + if (this._exceptionMessage == null) { return string.Empty; } else { - return _exceptionMessage; + return this._exceptionMessage; } } set { - _exceptionMessage = value; + this._exceptionMessage = value; } } @@ -215,11 +215,11 @@ public DateTime SentDate { get { - return _sentDate.ToLocalTime(); + return this._sentDate.ToLocalTime(); } set { - _sentDate = value.ToUniversalTime(); + this._sentDate = value.ToUniversalTime(); } } @@ -227,11 +227,11 @@ public DateTime ExpirationDate { get { - return _expirationDate.ToLocalTime(); + return this._expirationDate.ToLocalTime(); } set { - _expirationDate = value.ToUniversalTime(); + this._expirationDate = value.ToUniversalTime(); } } @@ -239,11 +239,11 @@ public NameValueCollection Attributes { get { - return _attributes; + return this._attributes; } set { - _attributes = value; + this._attributes = value; } } @@ -282,7 +282,7 @@ public void DeserializeAttributes(string configXml) } //Add attribute to the collection - _attributes.Add(attName, attValue); + this._attributes.Add(attName, attValue); } while (reader.ReadToNextSibling("Attribute")); } } @@ -299,7 +299,7 @@ public string SerializeAttributes() { writer.WriteStartElement("Attributes"); - foreach (string key in Attributes.Keys) + foreach (string key in this.Attributes.Keys) { writer.WriteStartElement("Attribute"); @@ -307,16 +307,16 @@ public string SerializeAttributes() writer.WriteElementString("Name", key); //Write the Value element - if (Attributes[key].IndexOfAny("<'>\"&".ToCharArray()) > -1) + if (this.Attributes[key].IndexOfAny("<'>\"&".ToCharArray()) > -1) { writer.WriteStartElement("Value"); - writer.WriteCData(Attributes[key]); + writer.WriteCData(this.Attributes[key]); writer.WriteEndElement(); } else { //Write value - writer.WriteElementString("Value", Attributes[key]); + writer.WriteElementString("Value", this.Attributes[key]); } //Close the Attribute node diff --git a/DNN Platform/Library/Services/EventQueue/EventMessageCollection.cs b/DNN Platform/Library/Services/EventQueue/EventMessageCollection.cs index de85dbd8234..0e21fcc134e 100644 --- a/DNN Platform/Library/Services/EventQueue/EventMessageCollection.cs +++ b/DNN Platform/Library/Services/EventQueue/EventMessageCollection.cs @@ -26,7 +26,7 @@ public virtual EventMessage this[int index] public void Add(EventMessage message) { - InnerList.Add(message); + this.InnerList.Add(message); } } } diff --git a/DNN Platform/Library/Services/Exceptions/BasePortalException.cs b/DNN Platform/Library/Services/Exceptions/BasePortalException.cs index 1eb79df33bc..0ba7119f235 100644 --- a/DNN Platform/Library/Services/Exceptions/BasePortalException.cs +++ b/DNN Platform/Library/Services/Exceptions/BasePortalException.cs @@ -40,39 +40,39 @@ public BasePortalException() //constructor with exception message public BasePortalException(string message) : base(message) { - InitializePrivateVariables(); + this.InitializePrivateVariables(); } //constructor with message and inner exception public BasePortalException(string message, Exception inner) : base(message, inner) { - InitializePrivateVariables(); + this.InitializePrivateVariables(); } protected BasePortalException(SerializationInfo info, StreamingContext context) : base(info, context) { - InitializePrivateVariables(); - AssemblyVersion = info.GetString("m_AssemblyVersion"); - PortalID = info.GetInt32("m_PortalID"); - PortalName = info.GetString("m_PortalName"); - UserID = info.GetInt32("m_UserID"); - UserName = info.GetString("m_Username"); - ActiveTabID = info.GetInt32("m_ActiveTabID"); - ActiveTabName = info.GetString("m_ActiveTabName"); - RawURL = info.GetString("m_RawURL"); - AbsoluteURL = info.GetString("m_AbsoluteURL"); - AbsoluteURLReferrer = info.GetString("m_AbsoluteURLReferrer"); - UserAgent = info.GetString("m_UserAgent"); - DefaultDataProvider = info.GetString("m_DefaultDataProvider"); - ExceptionGUID = info.GetString("m_ExceptionGUID"); - m_InnerExceptionString = info.GetString("m_InnerExceptionString"); - FileName = info.GetString("m_FileName"); - FileLineNumber = info.GetInt32("m_FileLineNumber"); - FileColumnNumber = info.GetInt32("m_FileColumnNumber"); - Method = info.GetString("m_Method"); - m_StackTrace = info.GetString("m_StackTrace"); - m_Message = info.GetString("m_Message"); - m_Source = info.GetString("m_Source"); + this.InitializePrivateVariables(); + this.AssemblyVersion = info.GetString("m_AssemblyVersion"); + this.PortalID = info.GetInt32("m_PortalID"); + this.PortalName = info.GetString("m_PortalName"); + this.UserID = info.GetInt32("m_UserID"); + this.UserName = info.GetString("m_Username"); + this.ActiveTabID = info.GetInt32("m_ActiveTabID"); + this.ActiveTabName = info.GetString("m_ActiveTabName"); + this.RawURL = info.GetString("m_RawURL"); + this.AbsoluteURL = info.GetString("m_AbsoluteURL"); + this.AbsoluteURLReferrer = info.GetString("m_AbsoluteURLReferrer"); + this.UserAgent = info.GetString("m_UserAgent"); + this.DefaultDataProvider = info.GetString("m_DefaultDataProvider"); + this.ExceptionGUID = info.GetString("m_ExceptionGUID"); + this.m_InnerExceptionString = info.GetString("m_InnerExceptionString"); + this.FileName = info.GetString("m_FileName"); + this.FileLineNumber = info.GetInt32("m_FileLineNumber"); + this.FileColumnNumber = info.GetInt32("m_FileColumnNumber"); + this.Method = info.GetString("m_Method"); + this.m_StackTrace = info.GetString("m_StackTrace"); + this.m_Message = info.GetString("m_Message"); + this.m_Source = info.GetString("m_Source"); } public string AssemblyVersion { get; private set; } @@ -126,141 +126,141 @@ private void InitializePrivateVariables() { var context = HttpContext.Current; var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - var innerException = new Exception(Message, this); + var innerException = new Exception(this.Message, this); while (innerException.InnerException != null) { innerException = innerException.InnerException; } var exceptionInfo = Exceptions.GetExceptionInfo(innerException); - AssemblyVersion = DotNetNukeContext.Current.Application.Version.ToString(3); + this.AssemblyVersion = DotNetNukeContext.Current.Application.Version.ToString(3); if (portalSettings != null) { - PortalID = portalSettings.PortalId; - PortalName = portalSettings.PortalName; - ActiveTabID = portalSettings.ActiveTab.TabID; - ActiveTabName = portalSettings.ActiveTab.TabName; + this.PortalID = portalSettings.PortalId; + this.PortalName = portalSettings.PortalName; + this.ActiveTabID = portalSettings.ActiveTab.TabID; + this.ActiveTabName = portalSettings.ActiveTab.TabName; } else { - PortalID = -1; - PortalName = ""; - ActiveTabID = -1; - ActiveTabName = ""; + this.PortalID = -1; + this.PortalName = ""; + this.ActiveTabID = -1; + this.ActiveTabName = ""; } var currentUserInfo = UserController.Instance.GetCurrentUserInfo(); - UserID = (currentUserInfo != null) ? currentUserInfo.UserID : -1; + this.UserID = (currentUserInfo != null) ? currentUserInfo.UserID : -1; - if (UserID != -1) + if (this.UserID != -1) { - currentUserInfo = UserController.GetUserById(PortalID, UserID); - UserName = currentUserInfo != null ? currentUserInfo.Username : ""; + currentUserInfo = UserController.GetUserById(this.PortalID, this.UserID); + this.UserName = currentUserInfo != null ? currentUserInfo.Username : ""; } else { - UserName = ""; + this.UserName = ""; } if (context != null) { - RawURL = HttpUtility.HtmlEncode(context.Request.RawUrl); - AbsoluteURL = HttpUtility.HtmlEncode(context.Request.Url.AbsolutePath); + this.RawURL = HttpUtility.HtmlEncode(context.Request.RawUrl); + this.AbsoluteURL = HttpUtility.HtmlEncode(context.Request.Url.AbsolutePath); if (context.Request.UrlReferrer != null) { - AbsoluteURLReferrer = HttpUtility.HtmlEncode(context.Request.UrlReferrer.AbsoluteUri); + this.AbsoluteURLReferrer = HttpUtility.HtmlEncode(context.Request.UrlReferrer.AbsoluteUri); } - UserAgent = HttpUtility.HtmlEncode(context.Request.UserAgent ?? ""); + this.UserAgent = HttpUtility.HtmlEncode(context.Request.UserAgent ?? ""); } else { - RawURL = ""; - AbsoluteURL = ""; - AbsoluteURLReferrer = ""; - UserAgent = ""; + this.RawURL = ""; + this.AbsoluteURL = ""; + this.AbsoluteURLReferrer = ""; + this.UserAgent = ""; } try { ProviderConfiguration objProviderConfiguration = ProviderConfiguration.GetProviderConfiguration("data"); string strTypeName = ((Provider)objProviderConfiguration.Providers[objProviderConfiguration.DefaultProvider]).Type; - DefaultDataProvider = strTypeName; + this.DefaultDataProvider = strTypeName; } catch (Exception exc) { Logger.Error(exc); - DefaultDataProvider = ""; + this.DefaultDataProvider = ""; } - ExceptionGUID = Guid.NewGuid().ToString(); + this.ExceptionGUID = Guid.NewGuid().ToString(); if (exceptionInfo != null) { - FileName = exceptionInfo.FileName; - FileLineNumber = exceptionInfo.FileLineNumber; - FileColumnNumber = exceptionInfo.FileColumnNumber; - Method = exceptionInfo.Method; + this.FileName = exceptionInfo.FileName; + this.FileLineNumber = exceptionInfo.FileLineNumber; + this.FileColumnNumber = exceptionInfo.FileColumnNumber; + this.Method = exceptionInfo.Method; } else { - FileName = ""; - FileLineNumber = -1; - FileColumnNumber = -1; - Method = ""; + this.FileName = ""; + this.FileLineNumber = -1; + this.FileColumnNumber = -1; + this.Method = ""; } try { - m_StackTrace = StackTrace; + this.m_StackTrace = this.StackTrace; } catch (Exception exc) { Logger.Error(exc); - m_StackTrace = ""; + this.m_StackTrace = ""; } try { - m_Message = Message; + this.m_Message = this.Message; } catch (Exception exc) { Logger.Error(exc); - m_Message = ""; + this.m_Message = ""; } try { - m_Source = Source; + this.m_Source = this.Source; } catch (Exception exc) { Logger.Error(exc); - m_Source = ""; + this.m_Source = ""; } } catch (Exception exc) { - PortalID = -1; - UserID = -1; - AssemblyVersion = "-1"; - ActiveTabID = -1; - ActiveTabName = ""; - RawURL = ""; - AbsoluteURL = ""; - AbsoluteURLReferrer = ""; - UserAgent = ""; - DefaultDataProvider = ""; - ExceptionGUID = ""; - FileName = ""; - FileLineNumber = -1; - FileColumnNumber = -1; - Method = ""; - m_StackTrace = ""; - m_Message = ""; - m_Source = ""; + this.PortalID = -1; + this.UserID = -1; + this.AssemblyVersion = "-1"; + this.ActiveTabID = -1; + this.ActiveTabName = ""; + this.RawURL = ""; + this.AbsoluteURL = ""; + this.AbsoluteURLReferrer = ""; + this.UserAgent = ""; + this.DefaultDataProvider = ""; + this.ExceptionGUID = ""; + this.FileName = ""; + this.FileLineNumber = -1; + this.FileColumnNumber = -1; + this.Method = ""; + this.m_StackTrace = ""; + this.m_Message = ""; + this.m_Source = ""; Logger.Error(exc); } diff --git a/DNN Platform/Library/Services/Exceptions/ErrorContainer.cs b/DNN Platform/Library/Services/Exceptions/ErrorContainer.cs index 04fc6c55b63..db9dc1fd443 100644 --- a/DNN Platform/Library/Services/Exceptions/ErrorContainer.cs +++ b/DNN Platform/Library/Services/Exceptions/ErrorContainer.cs @@ -20,12 +20,12 @@ public class ErrorContainer : Control { public ErrorContainer(string strError) { - Container = FormatException(strError); + this.Container = this.FormatException(strError); } public ErrorContainer(string strError, Exception exc) { - Container = FormatException(strError, exc); + this.Container = this.FormatException(strError, exc); } public ErrorContainer(PortalSettings _PortalSettings, string strError, Exception exc) @@ -33,11 +33,11 @@ public ErrorContainer(PortalSettings _PortalSettings, string strError, Exception UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); if (objUserInfo.IsSuperUser) { - Container = FormatException(strError, exc); + this.Container = this.FormatException(strError, exc); } else { - Container = FormatException(strError); + this.Container = this.FormatException(strError); } } diff --git a/DNN Platform/Library/Services/Exceptions/ExceptionInfo.cs b/DNN Platform/Library/Services/Exceptions/ExceptionInfo.cs index 293c46cdb26..d2c3ae58119 100644 --- a/DNN Platform/Library/Services/Exceptions/ExceptionInfo.cs +++ b/DNN Platform/Library/Services/Exceptions/ExceptionInfo.cs @@ -23,15 +23,15 @@ public ExceptionInfo() { } public ExceptionInfo(Exception e) { - Message = e.Message; - StackTrace = e.StackTrace; - Source = e.Source; + this.Message = e.Message; + this.StackTrace = e.StackTrace; + this.Source = e.Source; if (e.InnerException != null) { - InnerMessage = e.InnerException.Message; - InnerStackTrace = e.InnerException.StackTrace; + this.InnerMessage = e.InnerException.Message; + this.InnerStackTrace = e.InnerException.StackTrace; } - ExceptionHash = e.Hash(); + this.ExceptionHash = e.Hash(); } #endregion @@ -78,7 +78,7 @@ public void Deserialize(string content) { if (reader.Read()) { - ReadXml(reader); + this.ReadXml(reader); } reader.Close(); } @@ -91,55 +91,55 @@ public void ReadXml(XmlReader reader) switch (reader.Name) { case "AssemblyVersion": - AssemblyVersion = reader.ReadContentAsString(); + this.AssemblyVersion = reader.ReadContentAsString(); break; case "PortalId": - PortalId = reader.ReadContentAsInt(); + this.PortalId = reader.ReadContentAsInt(); break; case "UserId": - UserId = reader.ReadContentAsInt(); + this.UserId = reader.ReadContentAsInt(); break; case "TabId": - TabId = reader.ReadContentAsInt(); + this.TabId = reader.ReadContentAsInt(); break; case "RawUrl": - RawUrl = reader.ReadContentAsString(); + this.RawUrl = reader.ReadContentAsString(); break; case "Referrer": - Referrer = reader.ReadContentAsString(); + this.Referrer = reader.ReadContentAsString(); break; case "UserAgent": - UserAgent = reader.ReadContentAsString(); + this.UserAgent = reader.ReadContentAsString(); break; case "ExceptionHash": - ExceptionHash = reader.ReadContentAsString(); + this.ExceptionHash = reader.ReadContentAsString(); break; case "Message": - Message = reader.ReadContentAsString(); + this.Message = reader.ReadContentAsString(); break; case "StackTrace": - StackTrace = reader.ReadContentAsString(); + this.StackTrace = reader.ReadContentAsString(); break; case "InnerMessage": - InnerMessage = reader.ReadContentAsString(); + this.InnerMessage = reader.ReadContentAsString(); break; case "InnerStackTrace": - InnerStackTrace = reader.ReadContentAsString(); + this.InnerStackTrace = reader.ReadContentAsString(); break; case "Source": - Source = reader.ReadContentAsString(); + this.Source = reader.ReadContentAsString(); break; case "FileName": - FileName = reader.ReadContentAsString(); + this.FileName = reader.ReadContentAsString(); break; case "FileLineNumber": - FileLineNumber = reader.ReadContentAsInt(); + this.FileLineNumber = reader.ReadContentAsInt(); break; case "FileColumnNumber": - FileColumnNumber = reader.ReadContentAsInt(); + this.FileColumnNumber = reader.ReadContentAsInt(); break; case "Method": - Method = reader.ReadContentAsString(); + this.Method = reader.ReadContentAsString(); break; } reader.ReadEndElement(); @@ -155,7 +155,7 @@ public string Serialize() var sb = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(sb, settings)) { - WriteXml(writer); + this.WriteXml(writer); writer.Close(); return sb.ToString(); } @@ -164,46 +164,46 @@ public string Serialize() public override string ToString() { var str = new StringBuilder(); - str.Append("

    AssemblyVersion:" + WebUtility.HtmlEncode(AssemblyVersion) + "

    "); - str.Append("

    PortalId:" + PortalId + "

    "); - str.Append("

    UserId:" + UserId + "

    "); - str.Append("

    TabId:" + TabId + "

    "); - str.Append("

    RawUrl:" + WebUtility.HtmlEncode(RawUrl) + "

    "); - str.Append("

    Referrer:" + WebUtility.HtmlEncode(Referrer) + "

    "); - str.Append("

    UserAgent:" + WebUtility.HtmlEncode(UserAgent) + "

    "); - str.Append("

    ExceptionHash:" + WebUtility.HtmlEncode(ExceptionHash) + "

    "); - str.Append("

    Message:" + WebUtility.HtmlEncode(Message) + "

    "); - str.Append("

    StackTrace:

    " + WebUtility.HtmlEncode(StackTrace)?.Replace(") at ", ")
    at ") + "

    "); - str.Append("

    InnerMessage:" + WebUtility.HtmlEncode(InnerMessage) + "

    "); - str.Append("

    InnerStackTrace:

    " + WebUtility.HtmlEncode(InnerStackTrace)?.Replace(") at ",")
    at ") + "

    "); - str.Append("

    Source:" + WebUtility.HtmlEncode(Source) + "

    "); - str.Append("

    FileName:" + WebUtility.HtmlEncode(FileName) + "

    "); - str.Append("

    FileLineNumber:" + FileLineNumber + "

    "); - str.Append("

    FileColumnNumber:" + FileColumnNumber + "

    "); - str.Append("

    Method:" + WebUtility.HtmlEncode(Method) + "

    "); + str.Append("

    AssemblyVersion:" + WebUtility.HtmlEncode(this.AssemblyVersion) + "

    "); + str.Append("

    PortalId:" + this.PortalId + "

    "); + str.Append("

    UserId:" + this.UserId + "

    "); + str.Append("

    TabId:" + this.TabId + "

    "); + str.Append("

    RawUrl:" + WebUtility.HtmlEncode(this.RawUrl) + "

    "); + str.Append("

    Referrer:" + WebUtility.HtmlEncode(this.Referrer) + "

    "); + str.Append("

    UserAgent:" + WebUtility.HtmlEncode(this.UserAgent) + "

    "); + str.Append("

    ExceptionHash:" + WebUtility.HtmlEncode(this.ExceptionHash) + "

    "); + str.Append("

    Message:" + WebUtility.HtmlEncode(this.Message) + "

    "); + str.Append("

    StackTrace:

    " + WebUtility.HtmlEncode(this.StackTrace)?.Replace(") at ", ")
    at ") + "

    "); + str.Append("

    InnerMessage:" + WebUtility.HtmlEncode(this.InnerMessage) + "

    "); + str.Append("

    InnerStackTrace:

    " + WebUtility.HtmlEncode(this.InnerStackTrace)?.Replace(") at ",")
    at ") + "

    "); + str.Append("

    Source:" + WebUtility.HtmlEncode(this.Source) + "

    "); + str.Append("

    FileName:" + WebUtility.HtmlEncode(this.FileName) + "

    "); + str.Append("

    FileLineNumber:" + this.FileLineNumber + "

    "); + str.Append("

    FileColumnNumber:" + this.FileColumnNumber + "

    "); + str.Append("

    Method:" + WebUtility.HtmlEncode(this.Method) + "

    "); return str.ToString(); } public void WriteXml(XmlWriter writer) { writer.WriteStartElement("Exception"); - writer.WriteElementString("AssemblyVersion", AssemblyVersion); - writer.WriteElementString("PortalId", PortalId.ToString()); - writer.WriteElementString("UserId", UserId.ToString()); - writer.WriteElementString("TabId", TabId.ToString()); - writer.WriteElementString("RawUrl", RawUrl); - writer.WriteElementString("Referrer", Referrer); - writer.WriteElementString("UserAgent", UserAgent); - writer.WriteElementString("ExceptionHash", ExceptionHash); - writer.WriteElementString("Message", Message); - writer.WriteElementString("StackTrace", StackTrace); - writer.WriteElementString("InnerMessage", InnerMessage); - writer.WriteElementString("InnerStackTrace", InnerStackTrace); - writer.WriteElementString("Source", Source); - writer.WriteElementString("FileName", FileName); - writer.WriteElementString("FileLineNumber", FileLineNumber.ToString()); - writer.WriteElementString("FileColumnNumber", FileColumnNumber.ToString()); - writer.WriteElementString("Method", Method); + writer.WriteElementString("AssemblyVersion", this.AssemblyVersion); + writer.WriteElementString("PortalId", this.PortalId.ToString()); + writer.WriteElementString("UserId", this.UserId.ToString()); + writer.WriteElementString("TabId", this.TabId.ToString()); + writer.WriteElementString("RawUrl", this.RawUrl); + writer.WriteElementString("Referrer", this.Referrer); + writer.WriteElementString("UserAgent", this.UserAgent); + writer.WriteElementString("ExceptionHash", this.ExceptionHash); + writer.WriteElementString("Message", this.Message); + writer.WriteElementString("StackTrace", this.StackTrace); + writer.WriteElementString("InnerMessage", this.InnerMessage); + writer.WriteElementString("InnerStackTrace", this.InnerStackTrace); + writer.WriteElementString("Source", this.Source); + writer.WriteElementString("FileName", this.FileName); + writer.WriteElementString("FileLineNumber", this.FileLineNumber.ToString()); + writer.WriteElementString("FileColumnNumber", this.FileColumnNumber.ToString()); + writer.WriteElementString("Method", this.Method); writer.WriteEndElement(); } #endregion diff --git a/DNN Platform/Library/Services/Exceptions/ModuleLoadException.cs b/DNN Platform/Library/Services/Exceptions/ModuleLoadException.cs index 339ea92c0ad..24d0d8681ba 100644 --- a/DNN Platform/Library/Services/Exceptions/ModuleLoadException.cs +++ b/DNN Platform/Library/Services/Exceptions/ModuleLoadException.cs @@ -31,28 +31,28 @@ public ModuleLoadException() //constructor with exception message public ModuleLoadException(string message) : base(message) { - InitilizePrivateVariables(); + this.InitilizePrivateVariables(); } //constructor with exception message public ModuleLoadException(string message, Exception inner, ModuleInfo ModuleConfiguration) : base(message, inner) { - m_ModuleConfiguration = ModuleConfiguration; - InitilizePrivateVariables(); + this.m_ModuleConfiguration = ModuleConfiguration; + this.InitilizePrivateVariables(); } //constructor with message and inner exception public ModuleLoadException(string message, Exception inner) : base(message, inner) { - InitilizePrivateVariables(); + this.InitilizePrivateVariables(); } protected ModuleLoadException(SerializationInfo info, StreamingContext context) : base(info, context) { - InitilizePrivateVariables(); - m_ModuleId = info.GetInt32("m_ModuleId"); - m_ModuleDefId = info.GetInt32("m_ModuleDefId"); - m_FriendlyName = info.GetString("m_FriendlyName"); + this.InitilizePrivateVariables(); + this.m_ModuleId = info.GetInt32("m_ModuleId"); + this.m_ModuleDefId = info.GetInt32("m_ModuleDefId"); + this.m_FriendlyName = info.GetString("m_FriendlyName"); } [XmlElement("ModuleID")] @@ -60,7 +60,7 @@ public int ModuleId { get { - return m_ModuleId; + return this.m_ModuleId; } } @@ -69,7 +69,7 @@ public int ModuleDefId { get { - return m_ModuleDefId; + return this.m_ModuleDefId; } } @@ -78,7 +78,7 @@ public string FriendlyName { get { - return m_FriendlyName; + return this.m_FriendlyName; } } @@ -87,7 +87,7 @@ public string ModuleControlSource { get { - return m_ModuleControlSource; + return this.m_ModuleControlSource; } } @@ -95,17 +95,17 @@ private void InitilizePrivateVariables() { //Try and get the Portal settings from context //If an error occurs getting the context then set the variables to -1 - if ((m_ModuleConfiguration != null)) + if ((this.m_ModuleConfiguration != null)) { - m_ModuleId = m_ModuleConfiguration.ModuleID; - m_ModuleDefId = m_ModuleConfiguration.ModuleDefID; - m_FriendlyName = m_ModuleConfiguration.ModuleTitle; - m_ModuleControlSource = m_ModuleConfiguration.ModuleControl.ControlSrc; + this.m_ModuleId = this.m_ModuleConfiguration.ModuleID; + this.m_ModuleDefId = this.m_ModuleConfiguration.ModuleDefID; + this.m_FriendlyName = this.m_ModuleConfiguration.ModuleTitle; + this.m_ModuleControlSource = this.m_ModuleConfiguration.ModuleControl.ControlSrc; } else { - m_ModuleId = -1; - m_ModuleDefId = -1; + this.m_ModuleId = -1; + this.m_ModuleDefId = -1; } } diff --git a/DNN Platform/Library/Services/Exceptions/ObjectHydrationException.cs b/DNN Platform/Library/Services/Exceptions/ObjectHydrationException.cs index 07e02df4ffe..6b37645545b 100644 --- a/DNN Platform/Library/Services/Exceptions/ObjectHydrationException.cs +++ b/DNN Platform/Library/Services/Exceptions/ObjectHydrationException.cs @@ -25,11 +25,11 @@ public ObjectHydrationException(string message, Exception innerException) : base public ObjectHydrationException(string message, Exception innerException, Type type, IDataReader dr) : base(message, innerException) { - _Type = type; - _Columns = new List(); + this._Type = type; + this._Columns = new List(); foreach (DataRow row in dr.GetSchemaTable().Rows) { - _Columns.Add(row["ColumnName"].ToString()); + this._Columns.Add(row["ColumnName"].ToString()); } } @@ -41,11 +41,11 @@ public List Columns { get { - return _Columns; + return this._Columns; } set { - _Columns = value; + this._Columns = value; } } @@ -53,11 +53,11 @@ public Type Type { get { - return _Type; + return this._Type; } set { - _Type = value; + this._Type = value; } } @@ -66,9 +66,9 @@ public override string Message get { string _Message = base.Message; - _Message += " Expecting - " + Type + "."; + _Message += " Expecting - " + this.Type + "."; _Message += " Returned - "; - foreach (string columnName in Columns) + foreach (string columnName in this.Columns) { _Message += columnName + ", "; } diff --git a/DNN Platform/Library/Services/Exceptions/SearchException.cs b/DNN Platform/Library/Services/Exceptions/SearchException.cs index 8569c9a3032..6046bcb436d 100644 --- a/DNN Platform/Library/Services/Exceptions/SearchException.cs +++ b/DNN Platform/Library/Services/Exceptions/SearchException.cs @@ -24,14 +24,14 @@ public SearchException() public SearchException(string message, Exception inner, SearchItemInfo searchItem) : base(message, inner) { - m_SearchItem = searchItem; + this.m_SearchItem = searchItem; } public SearchItemInfo SearchItem { get { - return m_SearchItem; + return this.m_SearchItem; } } } diff --git a/DNN Platform/Library/Services/Exceptions/SecurityException.cs b/DNN Platform/Library/Services/Exceptions/SecurityException.cs index ba5d3fdfbe6..82c423b2c77 100644 --- a/DNN Platform/Library/Services/Exceptions/SecurityException.cs +++ b/DNN Platform/Library/Services/Exceptions/SecurityException.cs @@ -30,20 +30,20 @@ public SecurityException() //constructor with exception message public SecurityException(string message) : base(message) { - InitilizePrivateVariables(); + this.InitilizePrivateVariables(); } //constructor with message and inner exception public SecurityException(string message, Exception inner) : base(message, inner) { - InitilizePrivateVariables(); + this.InitilizePrivateVariables(); } protected SecurityException(SerializationInfo info, StreamingContext context) : base(info, context) { - InitilizePrivateVariables(); - m_IP = info.GetString("m_IP"); - m_Querystring = info.GetString("m_Querystring"); + this.InitilizePrivateVariables(); + this.m_IP = info.GetString("m_IP"); + this.m_Querystring = info.GetString("m_Querystring"); } [XmlElement("IP")] @@ -51,7 +51,7 @@ public string IP { get { - return m_IP; + return this.m_IP; } } @@ -60,7 +60,7 @@ public string Querystring { get { - return m_Querystring; + return this.m_Querystring; } } @@ -71,14 +71,14 @@ private void InitilizePrivateVariables() { if (HttpContext.Current.Request.UserHostAddress != null) { - m_IP = HttpContext.Current.Request.UserHostAddress; + this.m_IP = HttpContext.Current.Request.UserHostAddress; } - m_Querystring = HttpContext.Current.Request.MapPath(Querystring, HttpContext.Current.Request.ApplicationPath, false); + this.m_Querystring = HttpContext.Current.Request.MapPath(this.Querystring, HttpContext.Current.Request.ApplicationPath, false); } catch (Exception exc) { - m_IP = ""; - m_Querystring = ""; + this.m_IP = ""; + this.m_Querystring = ""; Logger.Error(exc); } diff --git a/DNN Platform/Library/Services/FileSystem/FileContentTypeManager.cs b/DNN Platform/Library/Services/FileSystem/FileContentTypeManager.cs index 596f7e0a413..adc0309d8ba 100644 --- a/DNN Platform/Library/Services/FileSystem/FileContentTypeManager.cs +++ b/DNN Platform/Library/Services/FileSystem/FileContentTypeManager.cs @@ -26,26 +26,26 @@ public virtual IDictionary ContentTypes { get { - if (_contentTypes == null) + if (this._contentTypes == null) { lock (_threadLocker) { - if (_contentTypes == null) + if (this._contentTypes == null) { var listController = new ListController(); var listEntries = listController.GetListEntryInfoItems("ContentTypes"); if (listEntries == null || !listEntries.Any()) { - _contentTypes = GetDefaultContentTypes(); + this._contentTypes = this.GetDefaultContentTypes(); } else { - _contentTypes = new Dictionary(); + this._contentTypes = new Dictionary(); if (listEntries != null) { foreach (var contentTypeEntry in listEntries) { - _contentTypes.Add(contentTypeEntry.Value, contentTypeEntry.Text); + this._contentTypes.Add(contentTypeEntry.Value, contentTypeEntry.Text); } } } @@ -53,7 +53,7 @@ public virtual IDictionary ContentTypes } } - return _contentTypes; + return this._contentTypes; } } @@ -63,7 +63,7 @@ public virtual string GetContentType(string extension) if (string.IsNullOrEmpty(extension)) return "application/octet-stream"; var key = extension.TrimStart('.').ToLowerInvariant(); - return ContentTypes.ContainsKey(key) ? ContentTypes[key] : "application/octet-stream"; + return this.ContentTypes.ContainsKey(key) ? this.ContentTypes[key] : "application/octet-stream"; } #endregion diff --git a/DNN Platform/Library/Services/FileSystem/FileInfo.cs b/DNN Platform/Library/Services/FileSystem/FileInfo.cs index 8cdf1206a46..85d56d03e40 100644 --- a/DNN Platform/Library/Services/FileSystem/FileInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FileInfo.cs @@ -49,8 +49,8 @@ public class FileInfo : BaseEntityInfo, IHydratable, IFileInfo public FileInfo() { - UniqueId = Guid.NewGuid(); - VersionGuid = Guid.NewGuid(); + this.UniqueId = Guid.NewGuid(); + this.VersionGuid = Guid.NewGuid(); } public FileInfo(int portalId, string filename, string extension, int filesize, int width, int height, string contentType, string folder, int folderId, int storageLocation, bool cached) @@ -67,20 +67,20 @@ public FileInfo(int portalId, string filename, string extension, int filesize, i public FileInfo(Guid uniqueId, Guid versionGuid, int portalId, string filename, string extension, int filesize, int width, int height, string contentType, string folder, int folderId, int storageLocation, bool cached, string hash) { - UniqueId = uniqueId; - VersionGuid = versionGuid; - PortalId = portalId; - FileName = filename; - Extension = extension; - Size = filesize; - Width = width; - Height = height; - ContentType = contentType; - Folder = folder; - FolderId = folderId; - StorageLocation = storageLocation; - IsCached = cached; - SHA1Hash = hash; + this.UniqueId = uniqueId; + this.VersionGuid = versionGuid; + this.PortalId = portalId; + this.FileName = filename; + this.Extension = extension; + this.Size = filesize; + this.Width = width; + this.Height = height; + this.ContentType = contentType; + this.Folder = folder; + this.FolderId = folderId; + this.StorageLocation = storageLocation; + this.IsCached = cached; + this.SHA1Hash = hash; } #endregion @@ -110,7 +110,7 @@ public string Folder { get { - return _folder; + return this._folder; } set { @@ -120,7 +120,7 @@ public string Folder value = value + "/"; } - _folder = value; + this._folder = value; } } @@ -132,16 +132,16 @@ public int Height { get { - if (FileId != 0 && (!_height.HasValue || _height.Value == Null.NullInteger)) + if (this.FileId != 0 && (!this._height.HasValue || this._height.Value == Null.NullInteger)) { - LoadImageProperties(); + this.LoadImageProperties(); } - return _height.Value; + return this._height.Value; } set { - _height = value; + this._height = value; } } @@ -160,24 +160,24 @@ public string PhysicalPath portalSettings = PortalController.Instance.GetCurrentPortalSettings(); } - if (PortalId == Null.NullInteger) + if (this.PortalId == Null.NullInteger) { - physicalPath = Globals.HostMapPath + RelativePath; + physicalPath = Globals.HostMapPath + this.RelativePath; } else { - if (portalSettings == null || portalSettings.PortalId != PortalId) + if (portalSettings == null || portalSettings.PortalId != this.PortalId) { //Get the PortalInfo based on the Portalid - var portal = PortalController.Instance.GetPortal(PortalId); + var portal = PortalController.Instance.GetPortal(this.PortalId); if ((portal != null)) { - physicalPath = portal.HomeDirectoryMapPath + RelativePath; + physicalPath = portal.HomeDirectoryMapPath + this.RelativePath; } } else { - physicalPath = portalSettings.HomeDirectoryMapPath + RelativePath; + physicalPath = portalSettings.HomeDirectoryMapPath + this.RelativePath; } } @@ -197,7 +197,7 @@ public string RelativePath { get { - return Folder + FileName; + return this.Folder + this.FileName; } } @@ -212,16 +212,16 @@ public int Width { get { - if (FileId != 0 && (!_width.HasValue || _width.Value == Null.NullInteger)) + if (this.FileId != 0 && (!this._width.HasValue || this._width.Value == Null.NullInteger)) { - LoadImageProperties(); + this.LoadImageProperties(); } - return _width.Value; + return this._width.Value; } set { - _width = value; + this._width = value; } } @@ -230,16 +230,16 @@ public string SHA1Hash { get { - if (FileId > 0 && string.IsNullOrEmpty(_sha1Hash)) + if (this.FileId > 0 && string.IsNullOrEmpty(this._sha1Hash)) { - LoadHashProperty(); + this.LoadHashProperty(); } - return _sha1Hash; + return this._sha1Hash; } set { - _sha1Hash = value; + this._sha1Hash = value; } } @@ -249,9 +249,9 @@ public FileAttributes? FileAttributes { FileAttributes? _fileAttributes = null; - if (SupportsFileAttributes) + if (this.SupportsFileAttributes) { - var folderMapping = FolderMappingController.Instance.GetFolderMapping(PortalId, FolderMappingID); + var folderMapping = FolderMappingController.Instance.GetFolderMapping(this.PortalId, this.FolderMappingID); _fileAttributes = FolderProvider.Instance(folderMapping.FolderProviderType).GetFileAttributes(this); } @@ -263,21 +263,21 @@ public bool SupportsFileAttributes { get { - if (!_supportsFileAttributes.HasValue) + if (!this._supportsFileAttributes.HasValue) { - var folderMapping = FolderMappingController.Instance.GetFolderMapping(PortalId, FolderMappingID); + var folderMapping = FolderMappingController.Instance.GetFolderMapping(this.PortalId, this.FolderMappingID); try { - _supportsFileAttributes = FolderProvider.Instance(folderMapping.FolderProviderType).SupportsFileAttributes(); + this._supportsFileAttributes = FolderProvider.Instance(folderMapping.FolderProviderType).SupportsFileAttributes(); } catch { - _supportsFileAttributes = false; + this._supportsFileAttributes = false; } } - return _supportsFileAttributes.Value; + return this._supportsFileAttributes.Value; } } @@ -285,9 +285,9 @@ public DateTime LastModificationTime { get { - if(!_lastModificationTime.HasValue) + if(!this._lastModificationTime.HasValue) { - var folderMapping = FolderMappingController.Instance.GetFolderMapping(PortalId, FolderMappingID); + var folderMapping = FolderMappingController.Instance.GetFolderMapping(this.PortalId, this.FolderMappingID); try { @@ -299,11 +299,11 @@ public DateTime LastModificationTime } } - return _lastModificationTime.Value; + return this._lastModificationTime.Value; } set { - _lastModificationTime = value; + this._lastModificationTime = value; } } @@ -311,41 +311,41 @@ public int FolderMappingID { get { - if (_folderMappingID == 0) + if (this._folderMappingID == 0) { - if (FolderId > 0) + if (this.FolderId > 0) { - var folder = FolderManager.Instance.GetFolder(FolderId); + var folder = FolderManager.Instance.GetFolder(this.FolderId); if (folder != null) { - _folderMappingID = folder.FolderMappingID; - return _folderMappingID; + this._folderMappingID = folder.FolderMappingID; + return this._folderMappingID; } } - switch (StorageLocation) + switch (this.StorageLocation) { case (int)FolderController.StorageLocationTypes.InsecureFileSystem: - _folderMappingID = FolderMappingController.Instance.GetFolderMapping(PortalId, "Standard").FolderMappingID; + this._folderMappingID = FolderMappingController.Instance.GetFolderMapping(this.PortalId, "Standard").FolderMappingID; break; case (int)FolderController.StorageLocationTypes.SecureFileSystem: - _folderMappingID = FolderMappingController.Instance.GetFolderMapping(PortalId, "Secure").FolderMappingID; + this._folderMappingID = FolderMappingController.Instance.GetFolderMapping(this.PortalId, "Secure").FolderMappingID; break; case (int)FolderController.StorageLocationTypes.DatabaseSecure: - _folderMappingID = FolderMappingController.Instance.GetFolderMapping(PortalId, "Database").FolderMappingID; + this._folderMappingID = FolderMappingController.Instance.GetFolderMapping(this.PortalId, "Database").FolderMappingID; break; default: - _folderMappingID = FolderMappingController.Instance.GetDefaultFolderMapping(PortalId).FolderMappingID; + this._folderMappingID = FolderMappingController.Instance.GetDefaultFolderMapping(this.PortalId).FolderMappingID; break; } } - return _folderMappingID; + return this._folderMappingID; } set { - _folderMappingID = value; + this._folderMappingID = value; } } @@ -391,8 +391,8 @@ public bool IsEnabled get { var today = DateTime.Today; - return !EnablePublishPeriod - || (StartDate.Date <= today && (EndDate == Null.NullDate || today <= EndDate.Date)); + return !this.EnablePublishPeriod + || (this.StartDate.Date <= today && (this.EndDate == Null.NullDate || today <= this.EndDate.Date)); } } @@ -407,32 +407,32 @@ public bool IsEnabled public void Fill(IDataReader dr) { - ContentType = Null.SetNullString(dr["ContentType"]); - Extension = Null.SetNullString(dr["Extension"]); - FileId = Null.SetNullInteger(dr["FileId"]); - FileName = Null.SetNullString(dr["FileName"]); - Folder = Null.SetNullString(dr["Folder"]); - FolderId = Null.SetNullInteger(dr["FolderId"]); - Height = Null.SetNullInteger(dr["Height"]); - IsCached = Null.SetNullBoolean(dr["IsCached"]); - PortalId = Null.SetNullInteger(dr["PortalId"]); - SHA1Hash = Null.SetNullString(dr["SHA1Hash"]); - Size = Null.SetNullInteger(dr["Size"]); - StorageLocation = Null.SetNullInteger(dr["StorageLocation"]); - UniqueId = Null.SetNullGuid(dr["UniqueId"]); - VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); - Width = Null.SetNullInteger(dr["Width"]); - LastModificationTime = Null.SetNullDateTime(dr["LastModificationTime"]); - FolderMappingID = Null.SetNullInteger(dr["FolderMappingID"]); - Title = Null.SetNullString(dr["Title"]); - Description = Null.SetNullString(dr["Description"]); - EnablePublishPeriod = Null.SetNullBoolean(dr["EnablePublishPeriod"]); - StartDate = Null.SetNullDateTime(dr["StartDate"]); - EndDate = Null.SetNullDateTime(dr["EndDate"]); - ContentItemID = Null.SetNullInteger(dr["ContentItemID"]); - PublishedVersion = Null.SetNullInteger(dr["PublishedVersion"]); - HasBeenPublished = Convert.ToBoolean(dr["HasBeenPublished"]); - FillBaseProperties(dr); + this.ContentType = Null.SetNullString(dr["ContentType"]); + this.Extension = Null.SetNullString(dr["Extension"]); + this.FileId = Null.SetNullInteger(dr["FileId"]); + this.FileName = Null.SetNullString(dr["FileName"]); + this.Folder = Null.SetNullString(dr["Folder"]); + this.FolderId = Null.SetNullInteger(dr["FolderId"]); + this.Height = Null.SetNullInteger(dr["Height"]); + this.IsCached = Null.SetNullBoolean(dr["IsCached"]); + this.PortalId = Null.SetNullInteger(dr["PortalId"]); + this.SHA1Hash = Null.SetNullString(dr["SHA1Hash"]); + this.Size = Null.SetNullInteger(dr["Size"]); + this.StorageLocation = Null.SetNullInteger(dr["StorageLocation"]); + this.UniqueId = Null.SetNullGuid(dr["UniqueId"]); + this.VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); + this.Width = Null.SetNullInteger(dr["Width"]); + this.LastModificationTime = Null.SetNullDateTime(dr["LastModificationTime"]); + this.FolderMappingID = Null.SetNullInteger(dr["FolderMappingID"]); + this.Title = Null.SetNullString(dr["Title"]); + this.Description = Null.SetNullString(dr["Description"]); + this.EnablePublishPeriod = Null.SetNullBoolean(dr["EnablePublishPeriod"]); + this.StartDate = Null.SetNullDateTime(dr["StartDate"]); + this.EndDate = Null.SetNullDateTime(dr["EndDate"]); + this.ContentItemID = Null.SetNullInteger(dr["ContentItemID"]); + this.PublishedVersion = Null.SetNullInteger(dr["PublishedVersion"]); + this.HasBeenPublished = Convert.ToBoolean(dr["HasBeenPublished"]); + this.FillBaseProperties(dr); } [XmlIgnore] @@ -444,7 +444,7 @@ public int KeyID } set { - FileId = value; + this.FileId = value; } } @@ -457,7 +457,7 @@ private void LoadImageProperties() var fileManager = (FileManager)FileManager.Instance; if (!fileManager.IsImageFile(this)) { - _width = _height = 0; + this._width = this._height = 0; return; } var fileContent = fileManager.GetFileContent(this); @@ -480,14 +480,14 @@ private void LoadImageProperties() { image = fileManager.GetImageFromStream(fileContent); - _width = image.Width; - _height = image.Height; + this._width = image.Width; + this._height = image.Height; } catch { - _width = 0; - _height = 0; - ContentType = "application/octet-stream"; + this._width = 0; + this._height = 0; + this.ContentType = "application/octet-stream"; } finally { @@ -503,10 +503,10 @@ private void LoadImageProperties() private void LoadHashProperty() { var fileManager = (FileManager)FileManager.Instance; - var currentHashCode = FolderProvider.Instance( FolderMappingController.Instance.GetFolderMapping(FolderMappingID).FolderProviderType).GetHashCode(this); - if (currentHashCode != _sha1Hash) + var currentHashCode = FolderProvider.Instance( FolderMappingController.Instance.GetFolderMapping(this.FolderMappingID).FolderProviderType).GetHashCode(this); + if (currentHashCode != this._sha1Hash) { - _sha1Hash = currentHashCode; + this._sha1Hash = currentHashCode; fileManager.UpdateFile(this); } diff --git a/DNN Platform/Library/Services/FileSystem/FileLinkClickController.cs b/DNN Platform/Library/Services/FileSystem/FileLinkClickController.cs index b52b5a5696d..92309dab5b9 100644 --- a/DNN Platform/Library/Services/FileSystem/FileLinkClickController.cs +++ b/DNN Platform/Library/Services/FileSystem/FileLinkClickController.cs @@ -56,14 +56,14 @@ public string GetFileLinkClick(IFileInfo file) { Requires.NotNull("file", file); var portalId = file.PortalId; - var linkClickPortalSettigns = GetPortalSettingsForLinkClick(portalId); + var linkClickPortalSettigns = this.GetPortalSettingsForLinkClick(portalId); return TestableGlobals.Instance.LinkClick(String.Format("fileid={0}", file.FileId), Null.NullInteger, Null.NullInteger, true, false, portalId, linkClickPortalSettigns.EnableUrlLanguage, linkClickPortalSettigns.PortalGUID); } public int GetFileIdFromLinkClick(NameValueCollection queryParams) { - var linkClickPortalSettings = GetPortalSettingsForLinkClick(GetPortalIdFromLinkClick(queryParams)); + var linkClickPortalSettings = this.GetPortalSettingsForLinkClick(this.GetPortalIdFromLinkClick(queryParams)); var strFileId = UrlUtils.DecryptParameter(queryParams["fileticket"], linkClickPortalSettings.PortalGUID); int fileId; return int.TryParse(strFileId, out fileId) ? fileId : -1; diff --git a/DNN Platform/Library/Services/FileSystem/FileManager.cs b/DNN Platform/Library/Services/FileSystem/FileManager.cs index 65e305c1c93..dbc35284b76 100644 --- a/DNN Platform/Library/Services/FileSystem/FileManager.cs +++ b/DNN Platform/Library/Services/FileSystem/FileManager.cs @@ -68,7 +68,7 @@ private void AddFileToFolderProvider(Stream fileContent, string fileName, IFolde { if (!fileContent.CanSeek) { - using (var seekableStream = GetSeekableStream(fileContent)) + using (var seekableStream = this.GetSeekableStream(fileContent)) { provider.AddFile(destinationFolder, fileName, seekableStream); } @@ -167,7 +167,7 @@ private void RotateFlipImage(ref Stream content) { try { - using (var image = GetImageFromStream(content)) + using (var image = this.GetImageFromStream(content)) { if (!image.PropertyIdList.Any(x => x == 274)) return; @@ -286,7 +286,7 @@ private FileExtensionWhitelist WhiteList public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fileContent) { - return AddFile(folder, fileName, fileContent, true, false, false, GetContentType(Path.GetExtension(fileName)), GetCurrentUserID()); + return this.AddFile(folder, fileName, fileContent, true, false, false, this.GetContentType(Path.GetExtension(fileName)), this.GetCurrentUserID()); } /// @@ -299,7 +299,7 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil /// A IFileInfo as specified by the parameters. public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fileContent, bool overwrite) { - return AddFile(folder, fileName, fileContent, overwrite, false, false, GetContentType(Path.GetExtension(fileName)), GetCurrentUserID()); + return this.AddFile(folder, fileName, fileContent, overwrite, false, false, this.GetContentType(Path.GetExtension(fileName)), this.GetCurrentUserID()); } /// @@ -319,7 +319,7 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil /// A IFileInfo as specified by the parameters. public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fileContent, bool overwrite, bool checkPermissions, string contentType) { - return AddFile(folder, fileName, fileContent, overwrite, checkPermissions, false, contentType, GetCurrentUserID()); + return this.AddFile(folder, fileName, fileContent, overwrite, checkPermissions, false, contentType, this.GetCurrentUserID()); } /// @@ -340,7 +340,7 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil /// A IFileInfo as specified by the parameters. public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fileContent, bool overwrite, bool checkPermissions, string contentType, int createdByUserID) { - return AddFile(folder, fileName, fileContent, overwrite, checkPermissions, false, contentType, createdByUserID); + return this.AddFile(folder, fileName, fileContent, overwrite, checkPermissions, false, contentType, createdByUserID); } /// @@ -365,10 +365,10 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil Requires.NotNull("folder", folder); Requires.NotNullOrEmpty("fileName", fileName); - CheckFileAddingRestrictions(folder, fileName, checkPermissions, ignoreWhiteList); + this.CheckFileAddingRestrictions(folder, fileName, checkPermissions, ignoreWhiteList); //DNN-2949 If IgnoreWhiteList is set to true , then file should be copied and info logged into Event Viewer - if (!IsAllowedExtension(fileName) && ignoreWhiteList) + if (!this.IsAllowedExtension(fileName) && ignoreWhiteList) { var log = new LogInfo { LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString() }; log.LogProperties.Add(new LogDetailInfo("Following file was imported/uploaded, but is not an authorized filetype: ", fileName)); @@ -378,16 +378,16 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); var folderProvider = FolderProvider.Instance(folderMapping.FolderProviderType); - bool fileExists = FileExists(folder, fileName, true); + bool fileExists = this.FileExists(folder, fileName, true); bool needToWriteFile = fileContent != null && (overwrite || !folderProvider.FileExists(folder, fileName)); bool usingSeekableStream = false; - if (fileContent != null && !needToWriteFile && FileExists(folder, fileName)) + if (fileContent != null && !needToWriteFile && this.FileExists(folder, fileName)) { - return GetFile(folder, fileName); + return this.GetFile(folder, fileName); } - var oldFile = fileExists ? GetFile(folder, fileName, true) : null; + var oldFile = fileExists ? this.GetFile(folder, fileName, true) : null; var now = DateTime.Now; var extension = Path.GetExtension(fileName); @@ -418,47 +418,47 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil { if (!fileContent.CanSeek) { - fileContent = GetSeekableStream(fileContent); + fileContent = this.GetSeekableStream(fileContent); usingSeekableStream = true; } - CheckFileWritingRestrictions(folder, fileName, fileContent, oldFile, createdByUserID); + this.CheckFileWritingRestrictions(folder, fileName, fileContent, oldFile, createdByUserID); // Retrieve Metadata - SetInitialFileMetadata(ref fileContent, file, folderProvider); + this.SetInitialFileMetadata(ref fileContent, file, folderProvider); // Workflow folderWorkflow = WorkflowManager.Instance.GetWorkflow(folder.WorkflowID); if (folderWorkflow != null) { - SetContentItem(file); + this.SetContentItem(file); file.FileId = oldFile != null ? oldFile.FileId : Null.NullInteger; if (folderWorkflow.WorkflowID == SystemWorkflowManager.Instance.GetDirectPublishWorkflow(folderWorkflow.PortalID).WorkflowID) { if (file.FileId == Null.NullInteger) { - AddFile(file, createdByUserID); + this.AddFile(file, createdByUserID); fileExists = true; } else { //File Events for updating will be not fired. Only events for adding nust be fired - UpdateFile(file, true, false); + this.UpdateFile(file, true, false); } - contentFileName = ProcessVersioning(folder, oldFile, file, createdByUserID); + contentFileName = this.ProcessVersioning(folder, oldFile, file, createdByUserID); } else { - contentFileName = UpdateWhileApproving(folder, createdByUserID, file, oldFile, fileContent); + contentFileName = this.UpdateWhileApproving(folder, createdByUserID, file, oldFile, fileContent); //This case will be to overwrite an existing file or initial file workflow - ManageFileAdding(createdByUserID, folderWorkflow, fileExists, file); + this.ManageFileAdding(createdByUserID, folderWorkflow, fileExists, file); } } // Versioning else { - contentFileName = ProcessVersioning(folder, oldFile, file, createdByUserID); + contentFileName = this.ProcessVersioning(folder, oldFile, file, createdByUserID); } } else @@ -477,7 +477,7 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil { if (folderWorkflow == null || !fileExists) { - ManageFileAdding(createdByUserID, folderWorkflow, fileExists, file); + this.ManageFileAdding(createdByUserID, folderWorkflow, fileExists, file); } if (needToWriteFile) @@ -494,7 +494,7 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil if (folderWorkflow == null || !fileExists) { - ManageFileAdding(createdByUserID, folderWorkflow, fileExists, file); + this.ManageFileAdding(createdByUserID, folderWorkflow, fileExists, file); } } @@ -532,10 +532,10 @@ public virtual IFileInfo AddFile(IFolderInfo folder, string fileName, Stream fil } DataCache.RemoveCache("GetFileById" + file.FileId); - ClearFolderCache(folder.PortalID); - var addedFile = GetFile(file.FileId, true); //The file could be pending to be approved, but it should be returned + this.ClearFolderCache(folder.PortalID); + var addedFile = this.GetFile(file.FileId, true); //The file could be pending to be approved, but it should be returned - NotifyFileAddingEvents(folder, createdByUserID, fileExists, folderWorkflow, addedFile); + this.NotifyFileAddingEvents(folder, createdByUserID, fileExists, folderWorkflow, addedFile); return addedFile; } @@ -557,7 +557,7 @@ private void CheckFileAddingRestrictions(IFolderInfo folder, string fileName, bo "Permissions are not met. The file has not been added.")); } - if (!IsAllowedExtension(fileName) && !(UserController.Instance.GetCurrentUserInfo().IsSuperUser && ignoreWhiteList)) + if (!this.IsAllowedExtension(fileName) && !(UserController.Instance.GetCurrentUserInfo().IsSuperUser && ignoreWhiteList)) { throw new InvalidFileExtensionException( string.Format( @@ -565,7 +565,7 @@ private void CheckFileAddingRestrictions(IFolderInfo folder, string fileName, bo "The extension '{0}' is not allowed. The file has not been added."), Path.GetExtension(fileName))); } - if (!IsValidFilename(fileName)) + if (!this.IsValidFilename(fileName)) { throw new InvalidFilenameException( string.Format( @@ -580,12 +580,12 @@ private void NotifyFileAddingEvents(IFolderInfo folder, int createdByUserID, boo if (fileExists && (folderWorkflow == null || folderWorkflow.WorkflowID == SystemWorkflowManager.Instance.GetDirectPublishWorkflow(folderWorkflow.PortalID).WorkflowID)) { - OnFileOverwritten(file, createdByUserID); + this.OnFileOverwritten(file, createdByUserID); } if (!fileExists) { - OnFileAdded(file, folder, createdByUserID); + this.OnFileAdded(file, folder, createdByUserID); } } @@ -594,7 +594,7 @@ private void SetContentItem(IFileInfo file) // Create Content Item if does not exists if (file.ContentItemID == Null.NullInteger) { - file.ContentItemID = CreateFileContentItem().ContentItemId; + file.ContentItemID = this.CreateFileContentItem().ContentItemId; } } @@ -608,10 +608,10 @@ private void SetInitialFileMetadata(ref Stream fileContent, FileInfo file, Folde file.Width = 0; file.Height = 0; - if (IsImageFile(file)) + if (this.IsImageFile(file)) { - RotateFlipImage(ref fileContent); - SetImageProperties(file, fileContent); + this.RotateFlipImage(ref fileContent); + this.SetImageProperties(file, fileContent); } } @@ -619,7 +619,7 @@ private void SetImageProperties(IFileInfo file, Stream fileContent) { try { - using (var image = GetImageFromStream(fileContent)) + using (var image = this.GetImageFromStream(fileContent)) { file.Width = image.Width; file.Height = image.Height; @@ -664,14 +664,14 @@ private void ManageFileAdding(int createdByUserID, Workflow folderWorkflow, bool { if (folderWorkflow == null || !fileExists) { - AddFile(file, createdByUserID); + this.AddFile(file, createdByUserID); } else { //File Events for updating will not be fired. Only events for adding nust be fired - UpdateFile(file, true, false); + this.UpdateFile(file, true, false); } - if (folderWorkflow != null && StartWorkflow(createdByUserID, folderWorkflow, fileExists, file.ContentItemID)) + if (folderWorkflow != null && this.StartWorkflow(createdByUserID, folderWorkflow, fileExists, file.ContentItemID)) { if (!fileExists) //if file exists it could have been published. So We don't have to update the field { @@ -744,10 +744,10 @@ public virtual IFileInfo CopyFile(IFileInfo file, IFolderInfo destinationFolder) { //check for existing file - var existingFile = GetFile(destinationFolder, file.FileName, true); + var existingFile = this.GetFile(destinationFolder, file.FileName, true); if (existingFile != null) { - DeleteFile(existingFile); + this.DeleteFile(existingFile); } var folder = FolderManager.Instance.GetFolder(file.FolderId); @@ -760,7 +760,7 @@ public virtual IFileInfo CopyFile(IFileInfo file, IFolderInfo destinationFolder) } // copy Content Item - var contentItemID = CopyContentItem(file.ContentItemID); + var contentItemID = this.CopyContentItem(file.ContentItemID); var fileId = DataProvider.Instance().AddFile( file.PortalId, @@ -774,7 +774,7 @@ public virtual IFileInfo CopyFile(IFileInfo file, IFolderInfo destinationFolder) file.ContentType, destinationFolder.FolderPath, destinationFolder.FolderID, - GetCurrentUserID(), + this.GetCurrentUserID(), file.SHA1Hash, DateTime.Now, file.Title, @@ -784,24 +784,24 @@ public virtual IFileInfo CopyFile(IFileInfo file, IFolderInfo destinationFolder) file.EnablePublishPeriod, contentItemID); - var copiedFile = GetFile(fileId, true); + var copiedFile = this.GetFile(fileId, true); // Notify added file event - OnFileAdded(copiedFile, destinationFolder, GetCurrentUserID()); + this.OnFileAdded(copiedFile, destinationFolder, this.GetCurrentUserID()); return copiedFile; } - using (var fileContent = GetFileContent(file)) + using (var fileContent = this.GetFileContent(file)) { //check for existing file - var existingFile = GetFile(destinationFolder, file.FileName, true); + var existingFile = this.GetFile(destinationFolder, file.FileName, true); if (existingFile != null) { - DeleteFile(existingFile); + this.DeleteFile(existingFile); } - return AddFile(destinationFolder, file.FileName, fileContent, true, true, file.ContentType); + return this.AddFile(destinationFolder, file.FileName, fileContent, true, true, file.ContentType); } } @@ -815,9 +815,9 @@ public virtual void DeleteFile(IFileInfo file) { Requires.NotNull("file", file); FileDeletionController.Instance.DeleteFile(file); - ClearFolderCache(file.PortalId); + this.ClearFolderCache(file.PortalId); // Notify File Delete Event - OnFileDeleted(file, GetCurrentUserID()); + this.OnFileDeleted(file, this.GetCurrentUserID()); } /// @@ -832,7 +832,7 @@ public virtual void DeleteFiles(IEnumerable files) foreach (var file in files) { - DeleteFile(file); + this.DeleteFile(file); } } @@ -847,7 +847,7 @@ public virtual void DeleteFiles(IEnumerable files) /// Thrown when the underlying system throw an exception. public virtual bool FileExists(IFolderInfo folder, string fileName) { - return FileExists(folder, fileName, false); + return this.FileExists(folder, fileName, false); } /// @@ -866,7 +866,7 @@ public virtual bool FileExists(IFolderInfo folder, string fileName, bool retriev Requires.NotNull("folder", folder); Requires.NotNullOrEmpty("fileName", fileName); - var file = GetFile(folder, fileName, retrieveUnpublishedFiles); + var file = this.GetFile(folder, fileName, retrieveUnpublishedFiles); var existsFile = file != null; var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); @@ -902,7 +902,7 @@ public virtual string GetContentType(string extension) /// The IFileInfo object with the metadata of the specified file. public virtual IFileInfo GetFile(int fileID) { - return GetFile(fileID, false); + return this.GetFile(fileID, false); } /// @@ -925,7 +925,7 @@ public virtual IFileInfo GetFile(int fileID, bool retrieveUnpublishedFiles) file = CBO.Instance.FillObject(DataProvider.Instance().GetFileById(fileID, retrieveUnpublishedFiles)); if (file != null) { - var intCacheTimeout = 20 * Convert.ToInt32(GetPerformanceSetting()); + var intCacheTimeout = 20 * Convert.ToInt32(this.GetPerformanceSetting()); DataCache.SetCache(strCacheKey, file, TimeSpan.FromMinutes(intCacheTimeout)); } } @@ -940,7 +940,7 @@ public virtual IFileInfo GetFile(int fileID, bool retrieveUnpublishedFiles) /// The IFileInfo object with the metadata of the specified file. public virtual IFileInfo GetFile(IFolderInfo folder, string fileName) { - return GetFile(folder, fileName, false); + return this.GetFile(folder, fileName, false); } /// @@ -968,7 +968,7 @@ public virtual IFileInfo GetFile(IFolderInfo folder, string fileName, bool retri /// The IFileInfo object with the metadata of the specified file. public virtual IFileInfo GetFile(int portalId, string relativePath) { - return GetFile(portalId, relativePath, false); + return this.GetFile(portalId, relativePath, false); } /// @@ -999,7 +999,7 @@ public virtual IFileInfo GetFile(int portalId, string relativePath, bool retriev } var fileName = relativePath.Substring(folderPath.Length); - return GetFile(folderInfo, fileName, retrieveUnpublishedFiles); + return this.GetFile(folderInfo, fileName, retrieveUnpublishedFiles); } /// @@ -1046,7 +1046,7 @@ public virtual Stream GetSeekableStream(Stream stream) if (stream.CanSeek) return stream; - var folderPath = GetHostMapPath(); + var folderPath = this.GetHostMapPath(); string filePath; do @@ -1054,7 +1054,7 @@ public virtual Stream GetSeekableStream(Stream stream) filePath = Path.Combine(folderPath, Path.GetRandomFileName()) + ".resx"; } while (File.Exists(filePath)); - var fileStream = GetAutoDeleteFileStream(filePath); + var fileStream = this.GetAutoDeleteFileStream(filePath); var array = new byte[BufferSize]; @@ -1134,10 +1134,10 @@ public virtual IFileInfo MoveFile(IFileInfo file, IFolderInfo destinationFolder) } //check for existing file - var existingFile = GetFile(destinationFolder, file.FileName, true); + var existingFile = this.GetFile(destinationFolder, file.FileName, true); if (existingFile != null) { - DeleteFile(existingFile); + this.DeleteFile(existingFile); } var destinationFolderMapping = FolderMappingController.Instance.GetFolderMapping(destinationFolder.PortalID, destinationFolder.FolderMappingID); @@ -1154,7 +1154,7 @@ public virtual IFileInfo MoveFile(IFileInfo file, IFolderInfo destinationFolder) else { //Implement Copy/Delete - using (var fileContent = GetFileContent(file)) + using (var fileContent = this.GetFileContent(file)) { if (destinationFolderMapping.MappingName == "Database") { @@ -1162,15 +1162,15 @@ public virtual IFileInfo MoveFile(IFileInfo file, IFolderInfo destinationFolder) } else { - AddFileToFolderProvider(fileContent, file.FileName, destinationFolder, destinationFolderProvider); + this.AddFileToFolderProvider(fileContent, file.FileName, destinationFolder, destinationFolderProvider); } } - DeleteFileFromFolderProvider(file, sourceFolderProvider); + this.DeleteFileFromFolderProvider(file, sourceFolderProvider); } if (file.FolderMappingID == destinationFolder.FolderMappingID) { - MoveVersions(file, destinationFolder, sourceFolderProvider, destinationFolderProvider); + this.MoveVersions(file, destinationFolder, sourceFolderProvider, destinationFolderProvider); } else { @@ -1181,10 +1181,10 @@ public virtual IFileInfo MoveFile(IFileInfo file, IFolderInfo destinationFolder) file.FolderId = destinationFolder.FolderID; file.Folder = destinationFolder.FolderPath; file.FolderMappingID = destinationFolder.FolderMappingID; - file = UpdateFile(file); + file = this.UpdateFile(file); // Notify File Moved event - OnFileMoved(file, oldFilePath, GetCurrentUserID()); + this.OnFileMoved(file, oldFilePath, this.GetCurrentUserID()); return file; } @@ -1205,19 +1205,19 @@ public virtual IFileInfo RenameFile(IFileInfo file, string newFileName) if (file.FileName == newFileName) return file; - if (!IsAllowedExtension(newFileName)) + if (!this.IsAllowedExtension(newFileName)) { throw new InvalidFileExtensionException(string.Format(Localization.Localization.GetExceptionMessage("AddFileExtensionNotAllowed", "The extension '{0}' is not allowed. The file has not been added."), Path.GetExtension(newFileName))); } - if (!IsValidFilename(newFileName)) + if (!this.IsValidFilename(newFileName)) { throw new InvalidFilenameException(string.Format(Localization.Localization.GetExceptionMessage("AddFilenameNotAllowed", "The file name '{0}' is not allowed. The file has not been added."), newFileName)); } var folder = FolderManager.Instance.GetFolder(file.FolderId); - if (FileExists(folder, newFileName)) + if (this.FileExists(folder, newFileName)) { throw new FileAlreadyExistsException(Localization.Localization.GetExceptionMessage("RenameFileAlreadyExists", "This folder already contains a file with the same name. The file has not been renamed.")); } @@ -1241,10 +1241,10 @@ public virtual IFileInfo RenameFile(IFileInfo file, string newFileName) { file.Extension = Path.GetExtension(newFileName).Replace(".", ""); } - var renamedFile = UpdateFile(file); + var renamedFile = this.UpdateFile(file); // Notify File Renamed event - OnFileRenamed(renamedFile, oldfileName, GetCurrentUserID()); + this.OnFileRenamed(renamedFile, oldfileName, this.GetCurrentUserID()); return renamedFile; } @@ -1286,7 +1286,7 @@ public virtual void UnzipFile(IFileInfo file) var destinationFolder = FolderManager.Instance.GetFolder(file.FolderId); - UnzipFile(file, destinationFolder); + this.UnzipFile(file, destinationFolder); } /// @@ -1299,7 +1299,7 @@ public virtual void UnzipFile(IFileInfo file) /// Thrown when file or destination folder are null. public virtual void UnzipFile(IFileInfo file, IFolderInfo destinationFolder) { - UnzipFile(file, destinationFolder, null); + this.UnzipFile(file, destinationFolder, null); } /// @@ -1323,7 +1323,7 @@ public virtual int UnzipFile(IFileInfo file, IFolderInfo destinationFolder, ILis throw new ArgumentException(Localization.Localization.GetExceptionMessage("InvalidZipFile", "The file specified is not a zip compressed file.")); } - return ExtractFiles(file, destinationFolder, invalidFiles); + return this.ExtractFiles(file, destinationFolder, invalidFiles); } /// @@ -1342,7 +1342,7 @@ public virtual IFileInfo UpdateFile(IFileInfo file) throw new InvalidMetadataValuesException(message); } - return UpdateFile(file, true); + return this.UpdateFile(file, true); } /// @@ -1358,13 +1358,13 @@ public virtual IFileInfo UpdateFile(IFileInfo file, Stream fileContent) if (fileContent != null) { - if (IsImageFile(file)) + if (this.IsImageFile(file)) { Image image = null; try { - image = GetImageFromStream(fileContent); + image = this.GetImageFromStream(fileContent); file.Width = image.Width; file.Height = image.Height; @@ -1401,7 +1401,7 @@ public virtual IFileInfo UpdateFile(IFileInfo file, Stream fileContent) Logger.Error(ex); } - return UpdateFile(file); + return this.UpdateFile(file); } /// @@ -1416,7 +1416,7 @@ public virtual void WriteFile(IFileInfo file, Stream stream) Requires.NotNull("file", file); Requires.NotNull("stream", stream); - using (var srcStream = GetFileContent(file)) + using (var srcStream = this.GetFileContent(file)) { const int bufferSize = 4096; var buffer = new byte[bufferSize]; @@ -1448,12 +1448,12 @@ public virtual void WriteFileToResponse(IFileInfo file, ContentDisposition conte throw new PermissionsNotMetException(Localization.Localization.GetExceptionMessage("WriteFileToResponsePermissionsNotMet", "Permissions are not met. The file cannot be downloaded.")); } - if (IsFileAutoSyncEnabled()) + if (this.IsFileAutoSyncEnabled()) { - AutoSyncFile(file); + this.AutoSyncFile(file); } - WriteFileToHttpContext(file, contentDisposition); + this.WriteFileToHttpContext(file, contentDisposition); } #endregion @@ -1465,7 +1465,7 @@ internal virtual int CopyContentItem(int contentItemId) { if (contentItemId == Null.NullInteger) return Null.NullInteger; - var newContentItem = CreateFileContentItem(); + var newContentItem = this.CreateFileContentItem(); // Clone terms var termController = new TermController(); @@ -1519,7 +1519,7 @@ internal virtual void MoveVersions(IFileInfo file, IFolderInfo destinationFolder // This scenario is when the file is in the Database Folder Provider if (fileContent == null) continue; - AddFileToFolderProvider(fileContent, version.FileName, destinationFolder, destinationFolderProvider); + this.AddFileToFolderProvider(fileContent, version.FileName, destinationFolder, destinationFolderProvider); } var fileVersion = new FileInfo @@ -1530,7 +1530,7 @@ internal virtual void MoveVersions(IFileInfo file, IFolderInfo destinationFolder PortalId = folder.PortalID }; - DeleteFileFromFolderProvider(fileVersion, sourceFolderProvider); + this.DeleteFileFromFolderProvider(fileVersion, sourceFolderProvider); } } @@ -1575,7 +1575,7 @@ private string UpdateWhileApproving(IFolderInfo folder, int createdByUserID, IFi return isDatabaseMapping ? FileVersionController.Instance.AddFileVersion(file, createdByUserID, false, false, content) : FileVersionController.Instance.AddFileVersion(file, createdByUserID, false); } - if (CanUpdateWhenApproving(folder, contentController.GetContentItem(file.ContentItemID), createdByUserID)) + if (this.CanUpdateWhenApproving(folder, contentController.GetContentItem(file.ContentItemID), createdByUserID)) { //Update the Unpublished version var versions = FileVersionController.Instance.GetFileVersions(file).ToArray(); @@ -1605,15 +1605,15 @@ internal virtual void AutoSyncFile(IFileInfo file) var newFileSize = folderProvider.GetFileSize(file); if (file.Size != newFileSize) { - using (var fileContent = GetFileContent(file)) + using (var fileContent = this.GetFileContent(file)) { - UpdateFile(file, fileContent); + this.UpdateFile(file, fileContent); } } } else { - DeleteFile(file); + this.DeleteFile(file); } } @@ -1632,7 +1632,7 @@ internal virtual int ExtractFiles(IFileInfo file, IFolderInfo destinationFolder, try { - using (var fileContent = GetFileContent(file)) + using (var fileContent = this.GetFileContent(file)) { zipInputStream = new ZipInputStream(fileContent); @@ -1646,7 +1646,7 @@ internal virtual int ExtractFiles(IFileInfo file, IFolderInfo destinationFolder, exactFilesCount++; var fileName = Path.GetFileName(zipEntry.Name); - EnsureZipFolder(zipEntry.Name, destinationFolder); + this.EnsureZipFolder(zipEntry.Name, destinationFolder); IFolderInfo parentFolder; if (zipEntry.Name.IndexOf("/") == -1) @@ -1661,7 +1661,7 @@ internal virtual int ExtractFiles(IFileInfo file, IFolderInfo destinationFolder, try { - AddFile(parentFolder, fileName, zipInputStream, true); + this.AddFile(parentFolder, fileName, zipInputStream, true); } catch (PermissionsNotMetException exc) { @@ -1809,7 +1809,7 @@ internal virtual bool IsAllowedExtension(string fileName) //regex is meant to block files like "foo.asp;.png" which can take advantage //of a vulnerability in IIS6 which treasts such files as .asp, not .png return !string.IsNullOrEmpty(extension) - && WhiteList.IsAllowedExtension(extension) + && this.WhiteList.IsAllowedExtension(extension) && !Globals.FileExtensionRegex.IsMatch(fileName); } @@ -1851,13 +1851,13 @@ internal virtual void WriteFileToHttpContext(IFileInfo file, ContentDisposition // Do not send negative Content-Length (file.Size could be negative due to integer overflow for files > 2GB) if (file.Size >= 0) objResponse.AppendHeader("Content-Length", file.Size.ToString(CultureInfo.InvariantCulture)); - objResponse.ContentType = GetContentType(file.Extension.Replace(".", "")); + objResponse.ContentType = this.GetContentType(file.Extension.Replace(".", "")); try { - using (var fileContent = GetFileContent(file)) + using (var fileContent = this.GetFileContent(file)) { - WriteStream(objResponse, fileContent); + this.WriteStream(objResponse, fileContent); } } catch (Exception ex) @@ -1917,7 +1917,7 @@ internal virtual void WriteStream(HttpResponse objResponse, Stream objStream) internal virtual IFileInfo UpdateFile(IFileInfo file, bool updateLazyload) { //By default File Events will be fired - return UpdateFile(file, updateLazyload, true); + return this.UpdateFile(file, updateLazyload, true); } @@ -1941,7 +1941,7 @@ internal virtual IFileInfo UpdateFile(IFileInfo file, bool updateLazyload, bool updateLazyload ? file.Height : Null.NullInteger, file.ContentType, file.FolderId, - GetCurrentUserID(), + this.GetCurrentUserID(), updateLazyload ? file.SHA1Hash : Null.NullString, file.LastModificationTime, file.Title, @@ -1952,12 +1952,12 @@ internal virtual IFileInfo UpdateFile(IFileInfo file, bool updateLazyload, bool file.ContentItemID); DataCache.RemoveCache("GetFileById" + file.FileId); - ClearFolderCache(file.PortalId); - var updatedFile = GetFile(file.FileId); + this.ClearFolderCache(file.PortalId); + var updatedFile = this.GetFile(file.FileId); if (fireEvent) { - OnFileMetadataChanged(updatedFile ?? GetFile(file.FileId, true), GetCurrentUserID()); + this.OnFileMetadataChanged(updatedFile ?? this.GetFile(file.FileId, true), this.GetCurrentUserID()); } return updatedFile; } diff --git a/DNN Platform/Library/Services/FileSystem/FileServerHandler.cs b/DNN Platform/Library/Services/FileSystem/FileServerHandler.cs index a4e43b12a0e..5169f934b7f 100644 --- a/DNN Platform/Library/Services/FileSystem/FileServerHandler.cs +++ b/DNN Platform/Library/Services/FileSystem/FileServerHandler.cs @@ -60,7 +60,7 @@ public void ProcessRequest(HttpContext context) catch (Exception) { //The TabId or ModuleId are incorrectly formatted (potential DOS) - Handle404Exception(context, context.Request.RawUrl); + this.Handle404Exception(context, context.Request.RawUrl); } //get Language @@ -114,7 +114,7 @@ public void ProcessRequest(HttpContext context) //verify whether the tab is exist, otherwise throw out 404. if (TabController.Instance.GetTab(int.Parse(URL), _portalSettings.PortalId, false) == null) { - Handle404Exception(context, context.Request.RawUrl); + this.Handle404Exception(context, context.Request.RawUrl); } } if (UrlType != TabType.File) @@ -155,7 +155,7 @@ public void ProcessRequest(HttpContext context) var file = fileManager.GetFile(int.Parse(UrlUtils.GetParameterValue(URL))); if (file != null) { - if (!file.IsEnabled || !HasAPublishedVersion(file)) + if (!file.IsEnabled || !this.HasAPublishedVersion(file)) { if (context.Request.IsAuthenticated) { @@ -211,7 +211,7 @@ public void ProcessRequest(HttpContext context) if (!download) { - Handle404Exception(context, URL); + this.Handle404Exception(context, URL); } break; case TabType.Url: @@ -232,12 +232,12 @@ public void ProcessRequest(HttpContext context) } catch (Exception) { - Handle404Exception(context, URL); + this.Handle404Exception(context, URL); } } else { - Handle404Exception(context, URL); + this.Handle404Exception(context, URL); } } diff --git a/DNN Platform/Library/Services/FileSystem/FileVersionController.cs b/DNN Platform/Library/Services/FileSystem/FileVersionController.cs index 5c002cd4bc7..3bd1cf631ef 100644 --- a/DNN Platform/Library/Services/FileSystem/FileVersionController.cs +++ b/DNN Platform/Library/Services/FileSystem/FileVersionController.cs @@ -71,7 +71,7 @@ public string AddFileVersion(IFileInfo file, int userId, bool published, bool re if (removeOldestVersions) { - RemoveOldestsVersions(file); + this.RemoveOldestsVersions(file); } if (published) @@ -100,7 +100,7 @@ public void SetPublishedVersion(IFileInfo file, int newPublishedVersion) file.FileName); // Notify File Changed - OnFileChanged(file, UserController.Instance.GetCurrentUserInfo().UserID); + this.OnFileChanged(file, UserController.Instance.GetCurrentUserInfo().UserID); } public int DeleteFileVersion(IFileInfo file, int version) @@ -131,7 +131,7 @@ public int DeleteFileVersion(IFileInfo file, int version) } // Notify File Changed - OnFileChanged(file, UserController.Instance.GetCurrentUserInfo().UserID); + this.OnFileChanged(file, UserController.Instance.GetCurrentUserInfo().UserID); } else { @@ -159,7 +159,7 @@ public void DeleteAllUnpublishedVersions(IFileInfo file, bool resetPublishedVers var folderProvider = FolderProvider.Instance(folderMapping.FolderProviderType); - foreach (var version in GetFileVersions(file)) + foreach (var version in this.GetFileVersions(file)) { folderProvider.DeleteFile(new FileInfo { FileName = version.FileName, Folder = file.Folder, FolderMappingID = folderMapping.FolderMappingID, PortalId = folderMapping.PortalID, FolderId = file.FolderId }); DataProvider.Instance().DeleteFileVersion(version.FileId, version.Version); @@ -181,12 +181,12 @@ public IEnumerable GetFileVersions(IFileInfo file) public bool IsFolderVersioned(int folderId) { - return IsFolderVersioned(FolderManager.Instance.GetFolder(folderId)); + return this.IsFolderVersioned(FolderManager.Instance.GetFolder(folderId)); } public bool IsFolderVersioned(IFolderInfo folder) { - return IsFileVersionEnabled(folder.PortalID) && folder.IsVersioned; + return this.IsFileVersionEnabled(folder.PortalID) && folder.IsVersioned; } public bool IsFileVersionEnabled(int portalId) @@ -212,7 +212,7 @@ public Stream GetVersionContent(IFileInfo file, int version) if (folderMapping == null) return null; var folderProvider = FolderProvider.Instance(folderMapping.FolderProviderType); var folder = FolderManager.Instance.GetFolder(file.FolderId); - return GetVersionContent(folderProvider, folder, file, version); + return this.GetVersionContent(folderProvider, folder, file, version); } public void RollbackFileVersion(IFileInfo file, int version, int userId) @@ -222,14 +222,14 @@ public void RollbackFileVersion(IFileInfo file, int version, int userId) var folderProvider = FolderProvider.Instance(folderMapping.FolderProviderType); var folder = FolderManager.Instance.GetFolder(file.FolderId); - using (var content = GetVersionContent(folderProvider, folder, file, version)) + using (var content = this.GetVersionContent(folderProvider, folder, file, version)) { FileManager.Instance.AddFile(folder, file.FileName, content, true, true, file.ContentType, userId); } // We need to refresh the file object file = FileManager.Instance.GetFile(file.FileId); - var fileVersion = GetFileVersion(file, version); + var fileVersion = this.GetFileVersion(file, version); file.Extension = fileVersion.Extension; file.Size = fileVersion.Size; file.SHA1Hash = fileVersion.SHA1Hash; @@ -237,7 +237,7 @@ public void RollbackFileVersion(IFileInfo file, int version, int userId) file.Height = fileVersion.Height; FileManager.Instance.UpdateFile(file); - RemoveOldestsVersions(file); + this.RemoveOldestsVersions(file); } #endregion @@ -261,13 +261,13 @@ private Stream GetVersionContent(FolderProvider provider, IFolderInfo folder, IF private void RemoveOldestsVersions(IFileInfo file) { var portalId = FolderManager.Instance.GetFolder(file.FolderId).PortalID; - var versions = GetFileVersions(file); - var maxVersions = MaxFileVersions(portalId) - 1; // The published version is not in the FileVersions collection + var versions = this.GetFileVersions(file); + var maxVersions = this.MaxFileVersions(portalId) - 1; // The published version is not in the FileVersions collection if (versions.Count() > maxVersions) { foreach (var v in versions.OrderBy(v => v.Version).Take(versions.Count() - maxVersions)) { - DeleteFileVersion(file, v.Version); + this.DeleteFileVersion(file, v.Version); } } } diff --git a/DNN Platform/Library/Services/FileSystem/FileVersionInfo.cs b/DNN Platform/Library/Services/FileSystem/FileVersionInfo.cs index 40fe25e2e9b..e9e564d6b21 100644 --- a/DNN Platform/Library/Services/FileSystem/FileVersionInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FileVersionInfo.cs @@ -15,7 +15,7 @@ public class FileVersionInfo : BaseEntityInfo public FileVersionInfo() { - Version = 1; + this.Version = 1; } #endregion diff --git a/DNN Platform/Library/Services/FileSystem/FolderInfo.cs b/DNN Platform/Library/Services/FileSystem/FolderInfo.cs index b4f66e4b58e..8abbdc91eb4 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderInfo.cs @@ -41,13 +41,13 @@ public FolderInfo(): this(false) internal FolderInfo(bool initialiseEmptyPermissions) { - FolderID = Null.NullInteger; - UniqueId = Guid.NewGuid(); - VersionGuid = Guid.NewGuid(); - WorkflowID = Null.NullInteger; + this.FolderID = Null.NullInteger; + this.UniqueId = Guid.NewGuid(); + this.VersionGuid = Guid.NewGuid(); + this.WorkflowID = Null.NullInteger; if (initialiseEmptyPermissions) { - _folderPermissions = new FolderPermissionCollection(); + this._folderPermissions = new FolderPermissionCollection(); } } #endregion @@ -68,7 +68,7 @@ public string FolderName { get { - string folderName = PathUtils.Instance.RemoveTrailingSlash(FolderPath); + string folderName = PathUtils.Instance.RemoveTrailingSlash(this.FolderPath); if (folderName.Length > 0 && folderName.LastIndexOf("/", StringComparison.Ordinal) > -1) { folderName = folderName.Substring(folderName.LastIndexOf("/", StringComparison.Ordinal) + 1); @@ -94,15 +94,15 @@ public string DisplayName { get { - if (string.IsNullOrEmpty(_displayName)) + if (string.IsNullOrEmpty(this._displayName)) { - _displayName = FolderName; + this._displayName = this.FolderName; } - return _displayName; + return this._displayName; } set { - _displayName = value; + this._displayName = value; } } @@ -114,15 +114,15 @@ public string DisplayPath { get { - if (string.IsNullOrEmpty(_displayPath)) + if (string.IsNullOrEmpty(this._displayPath)) { - _displayPath = FolderPath; + this._displayPath = this.FolderPath; } - return _displayPath; + return this._displayPath; } set { - _displayPath = value; + this._displayPath = value; } } @@ -171,22 +171,22 @@ public string PhysicalPath portalSettings = PortalController.Instance.GetCurrentPortalSettings(); } - if (PortalID == Null.NullInteger) + if (this.PortalID == Null.NullInteger) { - physicalPath = Globals.HostMapPath + FolderPath; + physicalPath = Globals.HostMapPath + this.FolderPath; } else { - if (portalSettings == null || portalSettings.PortalId != PortalID) + if (portalSettings == null || portalSettings.PortalId != this.PortalID) { //Get the PortalInfo based on the Portalid - var portal = PortalController.Instance.GetPortal(PortalID); + var portal = PortalController.Instance.GetPortal(this.PortalID); - physicalPath = portal.HomeDirectoryMapPath + FolderPath; + physicalPath = portal.HomeDirectoryMapPath + this.FolderPath; } else { - physicalPath = portalSettings.HomeDirectoryMapPath + FolderPath; + physicalPath = portalSettings.HomeDirectoryMapPath + this.FolderPath; } } @@ -205,7 +205,7 @@ public FolderPermissionCollection FolderPermissions { get { - return _folderPermissions ?? (_folderPermissions = new FolderPermissionCollection(FolderPermissionController.GetFolderPermissionsCollectionByFolder(PortalID, FolderPath))); + return this._folderPermissions ?? (this._folderPermissions = new FolderPermissionCollection(FolderPermissionController.GetFolderPermissionsCollectionByFolder(this.PortalID, this.FolderPath))); } } @@ -213,30 +213,30 @@ public int FolderMappingID { get { - if (_folderMappingId == 0) + if (this._folderMappingId == 0) { - switch (StorageLocation) + switch (this.StorageLocation) { case (int)FolderController.StorageLocationTypes.InsecureFileSystem: - _folderMappingId = FolderMappingController.Instance.GetFolderMapping(PortalID, "Standard").FolderMappingID; + this._folderMappingId = FolderMappingController.Instance.GetFolderMapping(this.PortalID, "Standard").FolderMappingID; break; case (int)FolderController.StorageLocationTypes.SecureFileSystem: - _folderMappingId = FolderMappingController.Instance.GetFolderMapping(PortalID, "Secure").FolderMappingID; + this._folderMappingId = FolderMappingController.Instance.GetFolderMapping(this.PortalID, "Secure").FolderMappingID; break; case (int)FolderController.StorageLocationTypes.DatabaseSecure: - _folderMappingId = FolderMappingController.Instance.GetFolderMapping(PortalID, "Database").FolderMappingID; + this._folderMappingId = FolderMappingController.Instance.GetFolderMapping(this.PortalID, "Database").FolderMappingID; break; default: - _folderMappingId = FolderMappingController.Instance.GetDefaultFolderMapping(PortalID).FolderMappingID; + this._folderMappingId = FolderMappingController.Instance.GetDefaultFolderMapping(this.PortalID).FolderMappingID; break; } } - return _folderMappingId; + return this._folderMappingId; } set { - _folderMappingId = value; + this._folderMappingId = value; } } @@ -244,7 +244,7 @@ public bool IsStorageSecure { get { - var folderMapping = FolderMappingController.Instance.GetFolderMapping(PortalID, FolderMappingID); + var folderMapping = FolderMappingController.Instance.GetFolderMapping(this.PortalID, this.FolderMappingID); return FolderProvider.Instance(folderMapping.FolderProviderType).IsStorageSecure; } } @@ -261,21 +261,21 @@ public bool IsStorageSecure /// ----------------------------------------------------------------------------- public void Fill(IDataReader dr) { - FolderID = Null.SetNullInteger(dr["FolderID"]); - UniqueId = Null.SetNullGuid(dr["UniqueId"]); - VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - FolderPath = Null.SetNullString(dr["FolderPath"]); - MappedPath = Null.SetNullString(dr["MappedPath"]); - IsCached = Null.SetNullBoolean(dr["IsCached"]); - IsProtected = Null.SetNullBoolean(dr["IsProtected"]); - StorageLocation = Null.SetNullInteger(dr["StorageLocation"]); - LastUpdated = Null.SetNullDateTime(dr["LastUpdated"]); - FolderMappingID = Null.SetNullInteger(dr["FolderMappingID"]); - IsVersioned = Null.SetNullBoolean(dr["IsVersioned"]); - WorkflowID = Null.SetNullInteger(dr["WorkflowID"]); - ParentID = Null.SetNullInteger(dr["ParentID"]); - FillBaseProperties(dr); + this.FolderID = Null.SetNullInteger(dr["FolderID"]); + this.UniqueId = Null.SetNullGuid(dr["UniqueId"]); + this.VersionGuid = Null.SetNullGuid(dr["VersionGuid"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.FolderPath = Null.SetNullString(dr["FolderPath"]); + this.MappedPath = Null.SetNullString(dr["MappedPath"]); + this.IsCached = Null.SetNullBoolean(dr["IsCached"]); + this.IsProtected = Null.SetNullBoolean(dr["IsProtected"]); + this.StorageLocation = Null.SetNullInteger(dr["StorageLocation"]); + this.LastUpdated = Null.SetNullDateTime(dr["LastUpdated"]); + this.FolderMappingID = Null.SetNullInteger(dr["FolderMappingID"]); + this.IsVersioned = Null.SetNullBoolean(dr["IsVersioned"]); + this.WorkflowID = Null.SetNullInteger(dr["WorkflowID"]); + this.ParentID = Null.SetNullInteger(dr["ParentID"]); + this.FillBaseProperties(dr); } /// ----------------------------------------------------------------------------- @@ -289,11 +289,11 @@ public int KeyID { get { - return FolderID; + return this.FolderID; } set { - FolderID = value; + this.FolderID = value; } } @@ -310,17 +310,17 @@ public FolderInfo(int portalId, string folderpath, int storageLocation, bool isP [Obsolete("Deprecated in DNN 7.1. Use the parameterless constructor and object initializers. Scheduled removal in v10.0.0.")] public FolderInfo(Guid uniqueId, int portalId, string folderpath, int storageLocation, bool isProtected, bool isCached, DateTime lastUpdated) { - FolderID = Null.NullInteger; - UniqueId = uniqueId; - VersionGuid = Guid.NewGuid(); - WorkflowID = Null.NullInteger; - - PortalID = portalId; - FolderPath = folderpath; - StorageLocation = storageLocation; - IsProtected = isProtected; - IsCached = isCached; - LastUpdated = lastUpdated; + this.FolderID = Null.NullInteger; + this.UniqueId = uniqueId; + this.VersionGuid = Guid.NewGuid(); + this.WorkflowID = Null.NullInteger; + + this.PortalID = portalId; + this.FolderPath = folderpath; + this.StorageLocation = storageLocation; + this.IsProtected = isProtected; + this.IsCached = isCached; + this.LastUpdated = lastUpdated; } #endregion diff --git a/DNN Platform/Library/Services/FileSystem/FolderManager.cs b/DNN Platform/Library/Services/FileSystem/FolderManager.cs index 97d02c025d2..610f5cec06e 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderManager.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderManager.cs @@ -58,7 +58,7 @@ public virtual string MyFolderName private int AddFolderInternal(IFolderInfo folder) { //Check this is not a duplicate - var tmpfolder = GetFolder(folder.PortalID, folder.FolderPath); + var tmpfolder = this.GetFolder(folder.PortalID, folder.FolderPath); if (tmpfolder != null && folder.FolderID == Null.NullInteger) { @@ -71,7 +71,7 @@ private int AddFolderInternal(IFolderInfo folder) var workflowId = folder.WorkflowID; // Inherit some configuration from its Parent Folder - var parentFolder = GetParentFolder(folder.PortalID, folder.FolderPath); + var parentFolder = this.GetParentFolder(folder.PortalID, folder.FolderPath); var parentId = Null.NullInteger; if (parentFolder != null) { @@ -90,39 +90,39 @@ private int AddFolderInternal(IFolderInfo folder) folder.IsProtected, folder.IsCached, folder.LastUpdated, - GetCurrentUserId(), + this.GetCurrentUserId(), folder.FolderMappingID, isVersioned, workflowId, parentId); //Refetch folder for logging - folder = GetFolder(folder.PortalID, folder.FolderPath); + folder = this.GetFolder(folder.PortalID, folder.FolderPath); - AddLogEntry(folder, EventLogController.EventLogType.FOLDER_CREATED); + this.AddLogEntry(folder, EventLogController.EventLogType.FOLDER_CREATED); if (parentFolder != null) { - UpdateFolderInternal(parentFolder, false); + this.UpdateFolderInternal(parentFolder, false); } else { - UpdateParentFolder(folder.PortalID, folder.FolderPath); + this.UpdateParentFolder(folder.PortalID, folder.FolderPath); } } else { - var parentFolder = GetParentFolder(folder.PortalID, folder.FolderPath); + var parentFolder = this.GetParentFolder(folder.PortalID, folder.FolderPath); if (parentFolder != null) { // Ensure that Parent Id is repaired folder.ParentID = parentFolder.FolderID; } - UpdateFolderInternal(folder, false); + this.UpdateFolderInternal(folder, false); } //Invalidate Cache - ClearFolderCache(folder.PortalID); + this.ClearFolderCache(folder.PortalID); return folder.FolderID; } @@ -134,7 +134,7 @@ private bool GetOnlyUnmap(IFolderInfo folder) return true; } return (FolderProvider.Instance(FolderMappingController.Instance.GetFolderMapping(folder.FolderMappingID).FolderProviderType).SupportsMappedPaths && - GetFolder(folder.ParentID).FolderMappingID != folder.FolderMappingID) ; + this.GetFolder(folder.ParentID).FolderMappingID != folder.FolderMappingID) ; } private void UnmapFolderInternal(IFolderInfo folder, bool isCascadeDeleting) @@ -145,10 +145,10 @@ private void UnmapFolderInternal(IFolderInfo folder, bool isCascadeDeleting) { DirectoryWrapper.Instance.Delete(folder.PhysicalPath, true); } - DeleteFolder(folder.PortalID, folder.FolderPath); + this.DeleteFolder(folder.PortalID, folder.FolderPath); // Notify folder deleted event - OnFolderDeleted(folder, GetCurrentUserId(), isCascadeDeleting); + this.OnFolderDeleted(folder, this.GetCurrentUserId(), isCascadeDeleting); } private void DeleteFolderInternal(IFolderInfo folder, bool isCascadeDeleting) @@ -175,10 +175,10 @@ private void DeleteFolderInternal(IFolderInfo folder, bool isCascadeDeleting) { DirectoryWrapper.Instance.Delete(folder.PhysicalPath, true); } - DeleteFolder(folder.PortalID, folder.FolderPath); + this.DeleteFolder(folder.PortalID, folder.FolderPath); // Notify folder deleted event - OnFolderDeleted(folder, GetCurrentUserId(), isCascadeDeleting); + this.OnFolderDeleted(folder, this.GetCurrentUserId(), isCascadeDeleting); } private IFolderInfo GetParentFolder(int portalId, string folderPath) @@ -186,7 +186,7 @@ private IFolderInfo GetParentFolder(int portalId, string folderPath) if (!String.IsNullOrEmpty(folderPath)) { var parentFolderPath = folderPath.Substring(0, folderPath.Substring(0, folderPath.Length - 1).LastIndexOf("/", StringComparison.Ordinal) + 1); - return GetFolder(portalId, parentFolderPath); + return this.GetFolder(portalId, parentFolderPath); } return null; @@ -201,11 +201,11 @@ private IEnumerable SearchFiles(IFolderInfo folder, Regex regex, bool if (recursive) { - foreach (var subFolder in GetFolders(folder)) + foreach (var subFolder in this.GetFolders(folder)) { if (FolderPermissionController.Instance.CanViewFolder(subFolder)) { - files.AddRange(SearchFiles(subFolder, regex, true)); + files.AddRange(this.SearchFiles(subFolder, regex, true)); } } } @@ -226,7 +226,7 @@ private IFolderInfo UpdateFolderInternal(IFolderInfo folder, bool clearCache) folder.IsProtected, folder.IsCached, folder.LastUpdated, - GetCurrentUserId(), + this.GetCurrentUserId(), folder.FolderMappingID, folder.IsVersioned, folder.WorkflowID, @@ -234,7 +234,7 @@ private IFolderInfo UpdateFolderInternal(IFolderInfo folder, bool clearCache) if (clearCache) { - ClearFolderCache(folder.PortalID); + this.ClearFolderCache(folder.PortalID); } return folder; @@ -270,7 +270,7 @@ private int FindFolderMappingId(MergedTreeItem item, int portalId) if (item.FolderPath.IndexOf('/') != item.FolderPath.LastIndexOf('/')) { var parentPath = item.FolderPath.Substring(0, item.FolderPath.TrimEnd('/').LastIndexOf('/') + 1); - var folder = GetFolder(portalId, parentPath); + var folder = this.GetFolder(portalId, parentPath); if (folder != null) { return folder.FolderMappingID; @@ -286,19 +286,19 @@ private bool DeleteFolderRecursive(IFolderInfo folder, ICollection if (UserSecurityController.Instance.HasFolderPermission(folder, "DELETE")) { - var subfolders = GetFolders(folder); + var subfolders = this.GetFolders(folder); var allSubFoldersHasBeenDeleted = true; foreach (var subfolder in subfolders) { - if (!DeleteFolderRecursive(subfolder, notDeletedSubfolders, false, unmap || GetOnlyUnmap(subfolder))) + if (!this.DeleteFolderRecursive(subfolder, notDeletedSubfolders, false, unmap || this.GetOnlyUnmap(subfolder))) { allSubFoldersHasBeenDeleted = false; } } - var files = GetFiles(folder, false, true); + var files = this.GetFiles(folder, false, true); foreach (var file in files) { if (unmap) @@ -309,18 +309,18 @@ private bool DeleteFolderRecursive(IFolderInfo folder, ICollection { FileDeletionController.Instance.DeleteFile(file); } - OnFileDeleted(file, GetCurrentUserId(), true); + this.OnFileDeleted(file, this.GetCurrentUserId(), true); } if (allSubFoldersHasBeenDeleted) { if (unmap) { - UnmapFolderInternal(folder, !isRecursiveDeletionFolder); + this.UnmapFolderInternal(folder, !isRecursiveDeletionFolder); } else { - DeleteFolderInternal(folder, !isRecursiveDeletionFolder); + this.DeleteFolderInternal(folder, !isRecursiveDeletionFolder); } return true; } @@ -347,7 +347,7 @@ private IEnumerable GetFolders(IFolderInfo parentFolder, bool allSu if (allSubFolders) { var subFolders = - GetFolders(parentFolder.PortalID) + this.GetFolders(parentFolder.PortalID) .Where( f => f.FolderPath.StartsWith(parentFolder.FolderPath, @@ -356,7 +356,7 @@ private IEnumerable GetFolders(IFolderInfo parentFolder, bool allSu return subFolders.Where(f => f.FolderID != parentFolder.FolderID); } - return GetFolders(parentFolder.PortalID).Where(f => f.ParentID == parentFolder.FolderID); + return this.GetFolders(parentFolder.PortalID).Where(f => f.ParentID == parentFolder.FolderID); } #region On Folder Events @@ -425,7 +425,7 @@ private void OnFileDeleted(IFileInfo fileInfo, int userId, bool isCascadeDeletin /// The added folder. public virtual IFolderInfo AddFolder(FolderMappingInfo folderMapping, string folderPath) { - return AddFolder(folderMapping, folderPath, folderPath); + return this.AddFolder(folderMapping, folderPath, folderPath); } /// @@ -444,17 +444,17 @@ public virtual IFolderInfo AddFolder(FolderMappingInfo folderMapping, string fol folderPath = folderPath.Trim(); - if (FolderExists(folderMapping.PortalID, folderPath)) + if (this.FolderExists(folderMapping.PortalID, folderPath)) { throw new FolderAlreadyExistsException(Localization.Localization.GetExceptionMessage("AddFolderAlreadyExists", "The provided folder path already exists. The folder has not been added.")); } - if (!IsValidFolderPath(folderPath)) + if (!this.IsValidFolderPath(folderPath)) { throw new InvalidFolderPathException(Localization.Localization.GetExceptionMessage("AddFolderNotAllowed", "The folder path '{0}' is not allowed. The folder has not been added.", folderPath)); } - var parentFolder = GetParentFolder(folderMapping.PortalID, folderPath); + var parentFolder = this.GetParentFolder(folderMapping.PortalID, folderPath); if (parentFolder != null) { var parentFolderMapping = FolderMappingController.Instance.GetFolderMapping(parentFolder.PortalID, @@ -473,12 +473,12 @@ public virtual IFolderInfo AddFolder(FolderMappingInfo folderMapping, string fol { //Parent foldermapping DOESN'T support mapped path // abd current foldermapping YES support mapped path - mappedPath = PathUtils.Instance.FormatFolderPath(GetDefaultMappedPath(folderMapping) + mappedPath); + mappedPath = PathUtils.Instance.FormatFolderPath(this.GetDefaultMappedPath(folderMapping) + mappedPath); } } else if (FolderProvider.Instance(folderMapping.FolderProviderType).SupportsMappedPaths) { - mappedPath = PathUtils.Instance.FormatFolderPath(GetDefaultMappedPath(folderMapping) + mappedPath); + mappedPath = PathUtils.Instance.FormatFolderPath(this.GetDefaultMappedPath(folderMapping) + mappedPath); } try @@ -492,13 +492,13 @@ public virtual IFolderInfo AddFolder(FolderMappingInfo folderMapping, string fol throw new FolderProviderException(Localization.Localization.GetExceptionMessage("AddFolderUnderlyingSystemError", "The underlying system threw an exception. The folder has not been added."), ex); } - CreateFolderInFileSystem(PathUtils.Instance.GetPhysicalPath(folderMapping.PortalID, folderPath)); - var folderId = CreateFolderInDatabase(folderMapping.PortalID, folderPath, folderMapping.FolderMappingID, mappedPath); + this.CreateFolderInFileSystem(PathUtils.Instance.GetPhysicalPath(folderMapping.PortalID, folderPath)); + var folderId = this.CreateFolderInDatabase(folderMapping.PortalID, folderPath, folderMapping.FolderMappingID, mappedPath); - var folder = GetFolder(folderId); + var folder = this.GetFolder(folderId); // Notify add folder event - OnFolderAdded(folder, GetCurrentUserId()); + this.OnFolderAdded(folder, this.GetCurrentUserId()); return folder; } @@ -524,11 +524,11 @@ public virtual IFolderInfo AddFolder(int portalId, string folderPath) folderPath = PathUtils.Instance.FormatFolderPath(folderPath); var parentFolderPath = folderPath.Substring(0, folderPath.Substring(0, folderPath.Length - 1).LastIndexOf("/", StringComparison.Ordinal) + 1); - var parentFolder = GetFolder(portalId, parentFolderPath) ?? AddFolder(portalId, parentFolderPath); + var parentFolder = this.GetFolder(portalId, parentFolderPath) ?? this.AddFolder(portalId, parentFolderPath); var folderMapping = FolderMappingController.Instance.GetFolderMapping(portalId, parentFolder.FolderMappingID); - return AddFolder(folderMapping, folderPath); + return this.AddFolder(folderMapping, folderPath); } /// @@ -539,12 +539,12 @@ public virtual IFolderInfo AddFolder(int portalId, string folderPath) /// Thrown when the underlying system throw an exception. public virtual void DeleteFolder(IFolderInfo folder) { - DeleteFolderInternal(folder, false); + this.DeleteFolderInternal(folder, false); } public virtual void UnlinkFolder(IFolderInfo folder) { - DeleteFolderRecursive(folder, new Collection(), true, true); + this.DeleteFolderRecursive(folder, new Collection(), true, true); } /// @@ -553,9 +553,9 @@ public virtual void UnlinkFolder(IFolderInfo folder) /// The folder identifier. public virtual void DeleteFolder(int folderId) { - var folder = GetFolder(folderId); + var folder = this.GetFolder(folderId); - DeleteFolder(folder); + this.DeleteFolder(folder); } /// @@ -566,7 +566,7 @@ public virtual void DeleteFolder(int folderId) /// public void DeleteFolder(IFolderInfo folder, ICollection notDeletedSubfolders) { - DeleteFolderRecursive(folder, notDeletedSubfolders, true, GetOnlyUnmap(folder)); + this.DeleteFolderRecursive(folder, notDeletedSubfolders, true, this.GetOnlyUnmap(folder)); } /// @@ -579,7 +579,7 @@ public virtual bool FolderExists(int portalId, string folderPath) { Requires.PropertyNotNull("folderPath", folderPath); - return GetFolder(portalId, folderPath) != null; + return this.GetFolder(portalId, folderPath) != null; } /// @@ -589,7 +589,7 @@ public virtual bool FolderExists(int portalId, string folderPath) /// The list of files contained in the specified folder. public virtual IEnumerable GetFiles(IFolderInfo folder) { - return GetFiles(folder, false); + return this.GetFiles(folder, false); } /// @@ -600,7 +600,7 @@ public virtual IEnumerable GetFiles(IFolderInfo folder) /// The list of files contained in the specified folder. public virtual IEnumerable GetFiles(IFolderInfo folder, bool recursive) { - return GetFiles(folder, recursive, false); + return this.GetFiles(folder, recursive, false); } /// @@ -630,11 +630,11 @@ public virtual IEnumerable GetFileSystemFolders(UserInfo user, stri var portalId = user.PortalID; - var userFolder = GetUserFolder(user); + var userFolder = this.GetUserFolder(user); var defaultFolderMaping = FolderMappingController.Instance.GetDefaultFolderMapping(portalId); - var folders = GetFolders(portalId, permissions, user.UserID).Where(f => f.FolderPath != null && f.FolderMappingID == defaultFolderMaping.FolderMappingID); + var folders = this.GetFolders(portalId, permissions, user.UserID).Where(f => f.FolderPath != null && f.FolderMappingID == defaultFolderMaping.FolderMappingID); foreach (var folder in folders) { @@ -642,8 +642,8 @@ public virtual IEnumerable GetFileSystemFolders(UserInfo user, stri { if (folder.FolderID == userFolder.FolderID) { - folder.DisplayPath = MyFolderName + "/"; - folder.DisplayName = MyFolderName; + folder.DisplayPath = this.MyFolderName + "/"; + folder.DisplayName = this.MyFolderName; } else if (!folder.FolderPath.StartsWith(userFolder.FolderPath, StringComparison.InvariantCultureIgnoreCase)) //Allow UserFolder children { @@ -669,7 +669,7 @@ public virtual IFolderInfo GetFolder(int folderId) var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (portalSettings != null) { - var folders = GetFolders(portalSettings.PortalId); + var folders = this.GetFolders(portalSettings.PortalId); folder = folders.SingleOrDefault(f => f.FolderID == folderId) ?? CBO.Instance.FillObject(DataProvider.Instance().GetFolder(folderId)); } @@ -688,7 +688,7 @@ public virtual IFolderInfo GetFolder(int portalId, string folderPath) folderPath = PathUtils.Instance.FormatFolderPath(folderPath); - var folders = GetFolders(portalId); + var folders = this.GetFolders(portalId); return folders.SingleOrDefault(f => f.FolderPath == folderPath) ?? CBO.Instance.FillObject(DataProvider.Instance().GetFolder(portalId, folderPath)); } @@ -710,7 +710,7 @@ public virtual IFolderInfo GetFolder(Guid uniqueId) /// Thrown when parentFolder is null. public virtual IEnumerable GetFolders(IFolderInfo parentFolder) { - return GetFolders(parentFolder, false); + return this.GetFolders(parentFolder, false); } /// @@ -723,10 +723,10 @@ public virtual IEnumerable GetFolders(int portalId, bool useCache) { if (!useCache) { - ClearFolderCache(portalId); + this.ClearFolderCache(portalId); } - return GetFolders(portalId); + return this.GetFolders(portalId); } /// @@ -739,7 +739,7 @@ public virtual IEnumerable GetFolders(int portalId) var folders = new List(); var cacheKey = string.Format(DataCache.FolderCacheKey, portalId); - CBO.Instance.GetCachedObject>(new CacheItemArgs(cacheKey, DataCache.FolderCacheTimeOut, DataCache.FolderCachePriority, portalId), GetFoldersSortedCallBack, false).ForEach(folders.Add); + CBO.Instance.GetCachedObject>(new CacheItemArgs(cacheKey, DataCache.FolderCacheTimeOut, DataCache.FolderCachePriority, portalId), this.GetFoldersSortedCallBack, false).ForEach(folders.Add); return folders; } @@ -757,7 +757,7 @@ public virtual IEnumerable GetFolders(int portalId, string permissi var cacheKey = string.Format(DataCache.FolderUserCacheKey, portalId, permissions, userId); var cacheItemArgs = new CacheItemArgs(cacheKey, DataCache.FolderUserCacheTimeOut, DataCache.FolderUserCachePriority, portalId, permissions, userId); - CBO.Instance.GetCachedObject>(cacheItemArgs, GetFoldersByPermissionSortedCallBack, false).ForEach(folders.Add); + CBO.Instance.GetCachedObject>(cacheItemArgs, this.GetFoldersByPermissionSortedCallBack, false).ForEach(folders.Add); return folders; } @@ -769,7 +769,7 @@ public virtual IEnumerable GetFolders(int portalId, string permissi /// The list of folders the specified user has read permissions. public virtual IEnumerable GetFolders(UserInfo user) { - return GetFolders(user, "READ"); + return this.GetFolders(user, "READ"); } /// @@ -784,9 +784,9 @@ public virtual IEnumerable GetFolders(UserInfo user, string permiss var portalId = user.PortalID; - var userFolder = GetUserFolder(user); + var userFolder = this.GetUserFolder(user); - foreach (var folder in GetFolders(portalId, permissions, user.UserID).Where(folder => folder.FolderPath != null)) + foreach (var folder in this.GetFolders(portalId, permissions, user.UserID).Where(folder => folder.FolderPath != null)) { if (folder.FolderPath.StartsWith(DefaultUsersFoldersPath + "/", StringComparison.InvariantCultureIgnoreCase)) { @@ -813,7 +813,7 @@ public virtual IFolderInfo GetUserFolder(UserInfo userInfo) int portalId = userInfo.IsSuperUser ? -1 : userInfo.PortalID; string userFolderPath = ((PathUtils)PathUtils.Instance).GetUserFolderPathInternal(userInfo); - return GetFolder(portalId, userFolderPath) ?? AddUserFolder(userInfo); + return this.GetFolder(portalId, userFolderPath) ?? this.AddUserFolder(userInfo); } public virtual IFolderInfo MoveFolder(IFolderInfo folder, IFolderInfo destinationFolder) @@ -825,7 +825,7 @@ public virtual IFolderInfo MoveFolder(IFolderInfo folder, IFolderInfo destinatio if (folder.FolderPath == destinationFolder.FolderPath) return folder; - if(FolderExists(folder.PortalID, newFolderPath)) + if(this.FolderExists(folder.PortalID, newFolderPath)) { throw new InvalidOperationException(string.Format( Localization.Localization.GetExceptionMessage("CannotMoveFolderAlreadyExists", @@ -835,14 +835,14 @@ public virtual IFolderInfo MoveFolder(IFolderInfo folder, IFolderInfo destinatio var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); var destinationFolderMapping = FolderMappingController.Instance.GetFolderMapping(destinationFolder.PortalID, destinationFolder.FolderMappingID); - if(!CanMoveBetweenFolderMappings(folderMapping, destinationFolderMapping)) + if(!this.CanMoveBetweenFolderMappings(folderMapping, destinationFolderMapping)) { throw new InvalidOperationException(string.Format( Localization.Localization.GetExceptionMessage("CannotMoveFolderBetweenFolderType", "The folder with name '{0}' cannot be moved. Move Folder operation between this two folder types is not allowed", folder.FolderName))); } - if (!IsMoveOperationValid(folder, destinationFolder, newFolderPath)) + if (!this.IsMoveOperationValid(folder, destinationFolder, newFolderPath)) { throw new InvalidOperationException(Localization.Localization.GetExceptionMessage("MoveFolderCannotComplete", "The operation cannot be completed.")); } @@ -852,11 +852,11 @@ public virtual IFolderInfo MoveFolder(IFolderInfo folder, IFolderInfo destinatio if ((folder.FolderMappingID == destinationFolder.FolderMappingID && FolderProvider.Instance(folderMapping.FolderProviderType).SupportsMoveFolder) || (IsStandardFolderProviderType(folderMapping) && IsStandardFolderProviderType(destinationFolderMapping))) { - MoveFolderWithinProvider(folder, destinationFolder); + this.MoveFolderWithinProvider(folder, destinationFolder); } else { - MoveFolderBetweenProviders(folder, newFolderPath); + this.MoveFolderBetweenProviders(folder, newFolderPath); } //log the folder moved event. @@ -868,11 +868,11 @@ public virtual IFolderInfo MoveFolder(IFolderInfo folder, IFolderInfo destinatio LogController.Instance.AddLog(log); //Files in cache are obsolete because their physical path is not correct after moving - DeleteFilesFromCache(folder.PortalID, newFolderPath); - var movedFolder = GetFolder(folder.FolderID); + this.DeleteFilesFromCache(folder.PortalID, newFolderPath); + var movedFolder = this.GetFolder(folder.FolderID); // Notify folder moved event - OnFolderMoved(folder, GetCurrentUserId(), currentFolderPath); + this.OnFolderMoved(folder, this.GetCurrentUserId(), currentFolderPath); return movedFolder; } @@ -896,7 +896,7 @@ public virtual void RenameFolder(IFolderInfo folder, string newFolderName) var newFolderPath = folder.FolderPath.Substring(0, folder.FolderPath.LastIndexOf(folder.FolderName, StringComparison.Ordinal)) + PathUtils.Instance.FormatFolderPath(newFolderName); - if (FolderExists(folder.PortalID, newFolderPath)) + if (this.FolderExists(folder.PortalID, newFolderPath)) { throw new FolderAlreadyExistsException(Localization.Localization.GetExceptionMessage("RenameFolderAlreadyExists", "The destination folder already exists. The folder has not been renamed.")); } @@ -904,19 +904,19 @@ public virtual void RenameFolder(IFolderInfo folder, string newFolderName) var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); var provider = FolderProvider.Instance(folderMapping.FolderProviderType); - RenameFolderInFileSystem(folder, newFolderPath); + this.RenameFolderInFileSystem(folder, newFolderPath); //Update Provider provider.RenameFolder(folder, newFolderName); //Update database - UpdateChildFolders(folder, newFolderPath); + this.UpdateChildFolders(folder, newFolderPath); //Files in cache are obsolete because their physical path is not correct after rename - DeleteFilesFromCache(folder.PortalID, newFolderPath); + this.DeleteFilesFromCache(folder.PortalID, newFolderPath); // Notify folder renamed event - OnFolderRenamed(folder, GetCurrentUserId(), currentFolderName); + this.OnFolderRenamed(folder, this.GetCurrentUserId(), currentFolderName); } /// @@ -934,7 +934,7 @@ public virtual IEnumerable SearchFiles(IFolderInfo folder, string pat throw new FolderProviderException("No permission to view the folder"); } - return SearchFiles(folder, WildcardToRegex(pattern), recursive); + return this.SearchFiles(folder, WildcardToRegex(pattern), recursive); } /// @@ -944,7 +944,7 @@ public virtual IEnumerable SearchFiles(IFolderInfo folder, string pat /// The number of folder collisions. public virtual int Synchronize(int portalId) { - var folderCollisions = Synchronize(portalId, "", true, true); + var folderCollisions = this.Synchronize(portalId, "", true, true); DataCache.ClearFolderCache(portalId); @@ -959,7 +959,7 @@ public virtual int Synchronize(int portalId) /// The number of folder collisions. public virtual int Synchronize(int portalId, string relativePath) { - return Synchronize(portalId, relativePath, true, true); + return this.Synchronize(portalId, relativePath, true, true); } /// @@ -975,7 +975,7 @@ public virtual int Synchronize(int portalId, string relativePath, bool isRecursi { Requires.PropertyNotNull("relativePath", relativePath); - if (AreThereFolderMappingsRequiringNetworkConnectivity(portalId, relativePath, isRecursive) && !IsNetworkAvailable()) + if (this.AreThereFolderMappingsRequiringNetworkConnectivity(portalId, relativePath, isRecursive) && !this.IsNetworkAvailable()) { throw new NoNetworkAvailableException(Localization.Localization.GetExceptionMessage("NoNetworkAvailableError", "Network connectivity is needed but there is no network available.")); } @@ -987,22 +987,22 @@ public virtual int Synchronize(int portalId, string relativePath, bool isRecursi { if (HttpContext.Current != null) { - scriptTimeOut = GetCurrentScriptTimeout(); + scriptTimeOut = this.GetCurrentScriptTimeout(); // Synchronization could be a time-consuming process. To not get a time-out, we need to modify the request time-out value - SetScriptTimeout(int.MaxValue); + this.SetScriptTimeout(int.MaxValue); } - var mergedTree = GetMergedTree(portalId, relativePath, isRecursive); + var mergedTree = this.GetMergedTree(portalId, relativePath, isRecursive); // Step 1: Add Folders - InitialiseSyncFoldersData(portalId, relativePath); + this.InitialiseSyncFoldersData(portalId, relativePath); for (var i = 0; i < mergedTree.Count; i++) { var item = mergedTree.Values[i]; - ProcessMergedTreeItemInAddMode(item, portalId); + this.ProcessMergedTreeItemInAddMode(item, portalId); } - RemoveSyncFoldersData(relativePath); + this.RemoveSyncFoldersData(relativePath); // Step 2: Delete Files and Folders for (var i = mergedTree.Count - 1; i >= 0; i--) @@ -1011,10 +1011,10 @@ public virtual int Synchronize(int portalId, string relativePath, bool isRecursi if (syncFiles) { - SynchronizeFiles(item, portalId); + this.SynchronizeFiles(item, portalId); } - ProcessMergedTreeItemInDeleteMode(item, portalId); + this.ProcessMergedTreeItemInDeleteMode(item, portalId); } } finally @@ -1024,7 +1024,7 @@ public virtual int Synchronize(int portalId, string relativePath, bool isRecursi // Restore original time-out if (HttpContext.Current != null && scriptTimeOut != null) { - SetScriptTimeout(scriptTimeOut.Value); + this.SetScriptTimeout(scriptTimeOut.Value); } } @@ -1038,11 +1038,11 @@ public virtual int Synchronize(int portalId, string relativePath, bool isRecursi /// Thrown when folder is null. public virtual IFolderInfo UpdateFolder(IFolderInfo folder) { - var updatedFolder = UpdateFolderInternal(folder, true); + var updatedFolder = this.UpdateFolderInternal(folder, true); - AddLogEntry(updatedFolder, EventLogController.EventLogType.FOLDER_UPDATED); + this.AddLogEntry(updatedFolder, EventLogController.EventLogType.FOLDER_UPDATED); - SaveFolderPermissions(updatedFolder); + this.SaveFolderPermissions(updatedFolder); return updatedFolder; } @@ -1096,7 +1096,7 @@ public virtual void CopyParentFolderPermissions(IFolderInfo folder) var parentFolderPath = folder.FolderPath.Substring(0, folder.FolderPath.Substring(0, folder.FolderPath.Length - 1).LastIndexOf("/", StringComparison.Ordinal) + 1); foreach (FolderPermissionInfo objPermission in - GetFolderPermissionsFromSyncData(folder.PortalID, parentFolderPath)) + this.GetFolderPermissionsFromSyncData(folder.PortalID, parentFolderPath)) { var folderPermission = new FolderPermissionInfo(objPermission) { @@ -1139,7 +1139,7 @@ private FolderPermissionCollection GetFolderPermissionsFromSyncData(int portalId /// The role to assign the permission to public virtual void SetFolderPermission(IFolderInfo folder, int permissionId, int roleId) { - SetFolderPermission(folder, permissionId, roleId, Null.NullInteger); + this.SetFolderPermission(folder, permissionId, roleId, Null.NullInteger); } /// @@ -1199,21 +1199,21 @@ public virtual void SetFolderPermissions(IFolderInfo folder, int administratorRo internal virtual void AddLogEntry(IFolderInfo folder, EventLogController.EventLogType eventLogType) { - EventLogController.Instance.AddLog(folder, PortalController.Instance.GetCurrentPortalSettings(), GetCurrentUserId(), "", eventLogType); + EventLogController.Instance.AddLog(folder, PortalController.Instance.GetCurrentPortalSettings(), this.GetCurrentUserId(), "", eventLogType); } internal virtual void AddLogEntry(string propertyName, string propertyValue, EventLogController.EventLogType eventLogType) { - EventLogController.Instance.AddLog(propertyName, propertyValue, PortalController.Instance.GetCurrentPortalSettings(), GetCurrentUserId(), eventLogType); + EventLogController.Instance.AddLog(propertyName, propertyValue, PortalController.Instance.GetCurrentPortalSettings(), this.GetCurrentUserId(), eventLogType); } /// This member is reserved for internal use and is not intended to be used directly from your code. internal void DeleteFilesFromCache(int portalId, string newFolderPath) { - var folders = GetFolders(portalId).Where(f => f.FolderPath.StartsWith(newFolderPath)); + var folders = this.GetFolders(portalId).Where(f => f.FolderPath.StartsWith(newFolderPath)); foreach (var folderInfo in folders) { - var fileIds = GetFiles(folderInfo).Select(f => f.FileId); + var fileIds = this.GetFiles(folderInfo).Select(f => f.FileId); foreach (var fileId in fileIds) { DataCache.RemoveCache("GetFileById" + fileId); @@ -1230,9 +1230,9 @@ internal virtual IFolderInfo AddUserFolder(UserInfo user) var folderMapping = FolderMappingsConfigController.Instance.GetFolderMapping(portalId, DefaultUsersFoldersPath) ?? FolderMappingController.Instance.GetDefaultFolderMapping(portalId); - if (!FolderExists(portalId, DefaultUsersFoldersPath)) + if (!this.FolderExists(portalId, DefaultUsersFoldersPath)) { - AddFolder(folderMapping, DefaultUsersFoldersPath); + this.AddFolder(folderMapping, DefaultUsersFoldersPath); } #pragma warning disable 612,618 @@ -1241,27 +1241,27 @@ internal virtual IFolderInfo AddUserFolder(UserInfo user) var folderPath = PathUtils.Instance.FormatFolderPath(String.Format(DefaultUsersFoldersPath + "/{0}", rootFolder)); - if (!FolderExists(portalId, folderPath)) + if (!this.FolderExists(portalId, folderPath)) { - AddFolder(folderMapping, folderPath); + this.AddFolder(folderMapping, folderPath); } #pragma warning disable 612,618 folderPath = PathUtils.Instance.FormatFolderPath(String.Concat(folderPath, PathUtils.Instance.GetUserFolderPathElement(user.UserID, PathUtils.UserFolderElement.SubFolder))); #pragma warning restore 612,618 - if (!FolderExists(portalId, folderPath)) + if (!this.FolderExists(portalId, folderPath)) { - AddFolder(folderMapping, folderPath); + this.AddFolder(folderMapping, folderPath); } folderPath = PathUtils.Instance.FormatFolderPath(String.Concat(folderPath, user.UserID.ToString(CultureInfo.InvariantCulture))); - if (!FolderExists(portalId, folderPath)) + if (!this.FolderExists(portalId, folderPath)) { - AddFolder(folderMapping, folderPath); + this.AddFolder(folderMapping, folderPath); - var folder = GetFolder(portalId, folderPath); + var folder = this.GetFolder(portalId, folderPath); foreach (PermissionInfo permission in PermissionController.GetPermissionsByFolder()) { @@ -1279,7 +1279,7 @@ internal virtual IFolderInfo AddUserFolder(UserInfo user) if (permission.PermissionKey.Equals("READ", StringComparison.InvariantCultureIgnoreCase)) { - AddAllUserReadPermission(folder, permission); + this.AddAllUserReadPermission(folder, permission); } } } @@ -1287,13 +1287,13 @@ internal virtual IFolderInfo AddUserFolder(UserInfo user) FolderPermissionController.SaveFolderPermissions((FolderInfo)folder); } - return GetFolder(portalId, folderPath); + return this.GetFolder(portalId, folderPath); } /// This member is reserved for internal use and is not intended to be used directly from your code. internal virtual bool AreThereFolderMappingsRequiringNetworkConnectivity(int portalId, string relativePath, bool isRecursive) { - var folder = GetFolder(portalId, relativePath); + var folder = this.GetFolder(portalId, relativePath); if (folder != null) { @@ -1347,7 +1347,7 @@ internal virtual void ClearFolderCache(int portalId) internal virtual int CreateFolderInDatabase(int portalId, string folderPath, int folderMappingId) { - return CreateFolderInDatabase(portalId, folderPath, folderMappingId, folderPath); + return this.CreateFolderInDatabase(portalId, folderPath, folderMappingId, folderPath); } /// This member is reserved for internal use and is not intended to be used directly from your code. @@ -1383,12 +1383,12 @@ internal virtual int CreateFolderInDatabase(int portalId, string folderPath, int LastUpdated = Null.NullDate }; - folder.FolderID = AddFolderInternal(folder); + folder.FolderID = this.AddFolderInternal(folder); if (portalId != Null.NullInteger) { //Set Folder Permissions to inherit from parent - CopyParentFolderPermissions(folder); + this.CopyParentFolderPermissions(folder); } return folder.FolderID; @@ -1409,8 +1409,8 @@ internal virtual void CreateFolderInFileSystem(string physicalPath) internal virtual void DeleteFolder(int portalId, string folderPath) { DataProvider.Instance().DeleteFolder(portalId, PathUtils.Instance.FormatFolderPath(folderPath)); - AddLogEntry("FolderPath", folderPath, EventLogController.EventLogType.FOLDER_DELETED); - UpdateParentFolder(portalId, folderPath); + this.AddLogEntry("FolderPath", folderPath, EventLogController.EventLogType.FOLDER_DELETED); + this.UpdateParentFolder(portalId, folderPath); DataCache.ClearFolderCache(portalId); } @@ -1420,7 +1420,7 @@ internal virtual void DeleteFoldersFromExternalStorageLocations(Dictionary GetDatabaseFolders(int porta { var databaseFolders = new SortedList(new IgnoreCaseStringComparer()); - var folder = GetFolder(portalId, relativePath); + var folder = this.GetFolder(portalId, relativePath); if (folder != null) { @@ -1476,7 +1476,7 @@ internal virtual SortedList GetDatabaseFolders(int porta } else { - databaseFolders = GetDatabaseFoldersRecursive(folder); + databaseFolders = this.GetDatabaseFoldersRecursive(folder); } } @@ -1509,7 +1509,7 @@ internal virtual SortedList GetDatabaseFoldersRecursive( result.Add(item.FolderPath, item); } - foreach (var subfolder in GetFolders(folderInfo)) + foreach (var subfolder in this.GetFolders(folderInfo)) { stack.Push(subfolder); } @@ -1548,7 +1548,7 @@ internal virtual SortedList GetFileSystemFolders(int por } else { - fileSystemFolders = GetFileSystemFoldersRecursive(portalId, physicalPath); + fileSystemFolders = this.GetFileSystemFoldersRecursive(portalId, physicalPath); } } @@ -1683,14 +1683,14 @@ internal virtual object GetFoldersSortedCallBack(CacheItemArgs cacheItemArgs) /// This member is reserved for internal use and is not intended to be used directly from your code. internal virtual SortedList GetMergedTree(int portalId, string relativePath, bool isRecursive) { - var fileSystemFolders = GetFileSystemFolders(portalId, relativePath, isRecursive); - var databaseFolders = GetDatabaseFolders(portalId, relativePath, isRecursive); + var fileSystemFolders = this.GetFileSystemFolders(portalId, relativePath, isRecursive); + var databaseFolders = this.GetDatabaseFolders(portalId, relativePath, isRecursive); - var mergedTree = MergeFolderLists(fileSystemFolders, databaseFolders); + var mergedTree = this.MergeFolderLists(fileSystemFolders, databaseFolders); var mappedFolders = new SortedList(); //Some providers cache the list of objects for performance - ClearFolderProviderCachedLists(portalId); + this.ClearFolderProviderCachedLists(portalId); foreach (var mergedItem in mergedTree.Values) { @@ -1707,8 +1707,8 @@ internal virtual SortedList GetMergedTree(int portalId, } else { - var folder = GetFolder(portalId, mergedItem.FolderPath); - mappedFolders = MergeFolderLists(mappedFolders, GetFolderMappingFoldersRecursive(folderMapping, folder)); + var folder = this.GetFolder(portalId, mergedItem.FolderPath); + mappedFolders = this.MergeFolderLists(mappedFolders, this.GetFolderMappingFoldersRecursive(folderMapping, folder)); } } else @@ -1717,7 +1717,7 @@ internal virtual SortedList GetMergedTree(int portalId, } } - mergedTree = MergeFolderLists(mergedTree, mappedFolders); + mergedTree = this.MergeFolderLists(mergedTree, mappedFolders); // Update ExistsInFolderMapping if the Parent Does Not ExistsInFolderMapping var margedTreeItems = mergedTree.Values; @@ -1756,7 +1756,7 @@ internal virtual bool IsMoveOperationValid(IFolderInfo folderToMove, IFolderInfo } } - return IsMoveOperationValid(folderToMove, newFolderPath); + return this.IsMoveOperationValid(folderToMove, newFolderPath); } /// This member is reserved for internal use and is not intended to be used directly from your code. internal virtual bool IsMoveOperationValid(IFolderInfo folderToMove, string newFolderPath) @@ -1847,7 +1847,7 @@ internal virtual void MoveDirectory(string source, string target) internal virtual void MoveFolderWithinProvider(IFolderInfo folder, IFolderInfo destinationFolder) { var newFolderPath = destinationFolder.FolderPath + folder.FolderName + "/"; - RenameFolderInFileSystem(folder, newFolderPath); + this.RenameFolderInFileSystem(folder, newFolderPath); //Update provider var newMappedPath = destinationFolder.MappedPath + folder.FolderName + "/"; @@ -1856,25 +1856,25 @@ internal virtual void MoveFolderWithinProvider(IFolderInfo folder, IFolderInfo d provider.MoveFolder(folder.MappedPath, newMappedPath, folderMapping); //Update database - UpdateChildFolders(folder, Path.Combine(destinationFolder.FolderPath, folder.FolderName)); + this.UpdateChildFolders(folder, Path.Combine(destinationFolder.FolderPath, folder.FolderName)); } /// This member is reserved for internal use and is not intended to be used directly from your code. internal virtual void MoveFolderBetweenProviders(IFolderInfo folder, string newFolderPath) { - RenameFolderInFileSystem(folder, newFolderPath); + this.RenameFolderInFileSystem(folder, newFolderPath); - var folderInfos = GetFolders(folder.PortalID).Where(f => f.FolderPath != string.Empty && f.FolderPath.StartsWith(folder.FolderPath)).ToArray(); + var folderInfos = this.GetFolders(folder.PortalID).Where(f => f.FolderPath != string.Empty && f.FolderPath.StartsWith(folder.FolderPath)).ToArray(); var tmpFolderPath = folder.FolderPath; foreach (var folderInfo in folderInfos) { var folderPath = newFolderPath + folderInfo.FolderPath.Substring(tmpFolderPath.Length); - var parentFolder = GetParentFolder(folder.PortalID, folderPath); + var parentFolder = this.GetParentFolder(folder.PortalID, folderPath); folderInfo.ParentID = parentFolder.FolderID; folderInfo.FolderPath = folderPath; - UpdateFolderInternal(folderInfo, true); + this.UpdateFolderInternal(folderInfo, true); } } @@ -1882,7 +1882,7 @@ internal virtual void MoveFolderBetweenProviders(IFolderInfo folder, string newF internal virtual void OverwriteFolder(IFolderInfo sourceFolder, IFolderInfo destinationFolder, Dictionary folderMappings, SortedList foldersToDelete) { var fileManager = FileManager.Instance; - var files = GetFiles(sourceFolder, true); + var files = this.GetFiles(sourceFolder, true); foreach (var file in files) { @@ -1890,11 +1890,11 @@ internal virtual void OverwriteFolder(IFolderInfo sourceFolder, IFolderInfo dest } // Delete source folder in database - DeleteFolder(sourceFolder.PortalID, sourceFolder.FolderPath); + this.DeleteFolder(sourceFolder.PortalID, sourceFolder.FolderPath); - var folderMapping = GetFolderMapping(folderMappings, sourceFolder.FolderMappingID); + var folderMapping = this.GetFolderMapping(folderMappings, sourceFolder.FolderMappingID); - if (IsFolderMappingEditable(folderMapping)) + if (this.IsFolderMappingEditable(folderMapping)) { foldersToDelete.Add(sourceFolder.FolderPath, sourceFolder); } @@ -1909,8 +1909,8 @@ internal virtual void ProcessMergedTreeItemInAddMode(MergedTreeItem item, int po { if (!item.ExistsInDatabase) { - var folderMappingId = FindFolderMappingId(item, portalId); - CreateFolderInDatabase(portalId, item.FolderPath, folderMappingId); + var folderMappingId = this.FindFolderMappingId(item, portalId); + this.CreateFolderInDatabase(portalId, item.FolderPath, folderMappingId); } } else @@ -1919,13 +1919,13 @@ internal virtual void ProcessMergedTreeItemInAddMode(MergedTreeItem item, int po { if (item.ExistsInFolderMapping) { - CreateFolderInFileSystem(PathUtils.Instance.GetPhysicalPath(portalId, item.FolderPath)); + this.CreateFolderInFileSystem(PathUtils.Instance.GetPhysicalPath(portalId, item.FolderPath)); } } else // by exclusion it exists in the Folder Mapping { - CreateFolderInFileSystem(PathUtils.Instance.GetPhysicalPath(portalId, item.FolderPath)); - CreateFolderInDatabase(portalId, item.FolderPath, item.FolderMappingID, item.MappedPath); + this.CreateFolderInFileSystem(PathUtils.Instance.GetPhysicalPath(portalId, item.FolderPath)); + this.CreateFolderInDatabase(portalId, item.FolderPath, item.FolderMappingID, item.MappedPath); } } } @@ -1980,7 +1980,7 @@ internal virtual void ProcessMergedTreeItemInDeleteMode(MergedTreeItem item, int if (folderMapping.IsEditable) { DirectoryWrapper.Instance.Delete(PathUtils.Instance.GetPhysicalPath(portalId, item.FolderPath), false); - DeleteFolder(portalId, item.FolderPath); + this.DeleteFolder(portalId, item.FolderPath); } } } @@ -1989,7 +1989,7 @@ internal virtual void ProcessMergedTreeItemInDeleteMode(MergedTreeItem item, int { if (item.ExistsInDatabase && !item.ExistsInFolderMapping) { - DeleteFolder(portalId, item.FolderPath); + this.DeleteFolder(portalId, item.FolderPath); } } } @@ -1997,7 +1997,7 @@ internal virtual void ProcessMergedTreeItemInDeleteMode(MergedTreeItem item, int /// This member is reserved for internal use and is not intended to be used directly from your code. internal virtual void RemoveOrphanedFiles(IFolderInfo folder) { - var files = GetFiles(folder, false, true); + var files = this.GetFiles(folder, false, true); var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); @@ -2031,7 +2031,7 @@ internal virtual void RenameFolderInFileSystem(IFolderInfo folder, string newFol if (!di.Exists) return; var target = PathUtils.Instance.GetPhysicalPath(folder.PortalID, newFolderPath); - MoveDirectory(source, target); + this.MoveDirectory(source, target); } /// This member is reserved for internal use and is not intended to be used directly from your code. @@ -2049,7 +2049,7 @@ internal virtual void SetScriptTimeout(int timeout) /// This member is reserved for internal use and is not intended to be used directly from your code. internal virtual void SynchronizeFiles(MergedTreeItem item, int portalId) { - var folder = GetFolder(portalId, item.FolderPath); + var folder = this.GetFolder(portalId, item.FolderPath); if (folder == null) { @@ -2100,7 +2100,7 @@ internal virtual void SynchronizeFiles(MergedTreeItem item, int portalId) } } - RemoveOrphanedFiles(folder); + this.RemoveOrphanedFiles(folder); } catch (Exception ex) { @@ -2114,11 +2114,11 @@ internal virtual void UpdateParentFolder(int portalId, string folderPath) if (!String.IsNullOrEmpty(folderPath)) { var parentFolderPath = folderPath.Substring(0, folderPath.Substring(0, folderPath.Length - 1).LastIndexOf("/", StringComparison.Ordinal) + 1); - var objFolder = GetFolder(portalId, parentFolderPath); + var objFolder = this.GetFolder(portalId, parentFolderPath); if (objFolder != null) { //UpdateFolder(objFolder); - UpdateFolderInternal(objFolder, false); + this.UpdateFolderInternal(objFolder, false); } } } @@ -2128,7 +2128,7 @@ internal virtual void UpdateChildFolders(IFolderInfo folder, string newFolderPat { var originalFolderPath = folder.FolderPath; - var folderInfos = GetFolders(folder.PortalID).Where(f => f.FolderPath != string.Empty && f.FolderPath.StartsWith(originalFolderPath)).ToArray(); + var folderInfos = this.GetFolders(folder.PortalID).Where(f => f.FolderPath != string.Empty && f.FolderPath.StartsWith(originalFolderPath)).ToArray(); foreach (var folderInfo in folderInfos) { @@ -2137,7 +2137,7 @@ internal virtual void UpdateChildFolders(IFolderInfo folder, string newFolderPat var folderPath = newFolderPath + (newFolderPath.EndsWith("/") ? "" : "/") + folderInfo.FolderPath.Substring(originalFolderPath.Length); - var parentFolder = GetParentFolder(folder.PortalID, folderPath); + var parentFolder = this.GetParentFolder(folder.PortalID, folderPath); folderInfo.ParentID = parentFolder.FolderID; folderInfo.FolderPath = folderPath; @@ -2168,9 +2168,9 @@ internal virtual void UpdateChildFolders(IFolderInfo folder, string newFolderPat } } - UpdateFolderInternal(folderInfo, false); + this.UpdateFolderInternal(folderInfo, false); } - ClearFolderCache(folder.PortalID); + this.ClearFolderCache(folder.PortalID); } /// This member is reserved for internal use and is not intended to be used directly from your code. @@ -2223,8 +2223,8 @@ internal class MoveFoldersInfo public MoveFoldersInfo(string source, string target) { - Source = source; - Target = target; + this.Source = source; + this.Target = target; } } @@ -2246,15 +2246,15 @@ public virtual IFolderInfo MoveFolder(IFolderInfo folder, string newFolderPath) Requires.NotNullOrEmpty("newFolderPath", newFolderPath); var nameCharIndex = newFolderPath.Substring(0, newFolderPath.Length - 1).LastIndexOf("/", StringComparison.Ordinal) + 1; - var parentFolder = GetFolder(folder.PortalID, newFolderPath.Substring(0, nameCharIndex)); + var parentFolder = this.GetFolder(folder.PortalID, newFolderPath.Substring(0, nameCharIndex)); if (parentFolder.FolderID == folder.ParentID) { var newFolderName = newFolderPath.Substring(nameCharIndex, newFolderPath.Length - nameCharIndex - 1); - RenameFolder(folder, newFolderName); + this.RenameFolder(folder, newFolderName); return folder; } - return MoveFolder(folder, parentFolder); + return this.MoveFolder(folder, parentFolder); } #endregion diff --git a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingController.cs b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingController.cs index 706b4a253d5..4934ba6a4e3 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingController.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingController.cs @@ -39,9 +39,9 @@ internal FolderMappingController() public FolderMappingInfo GetDefaultFolderMapping(int portalId) { var defaultFolderMapping = Config.GetSection("dotnetnuke/folder") != null ? - GetFolderMappings(portalId).Find(fm => fm.FolderProviderType == Config.GetDefaultProvider("folder").Name) : - GetFolderMapping(portalId, "Standard"); - return defaultFolderMapping ?? GetFolderMapping(portalId, "Standard"); + this.GetFolderMappings(portalId).Find(fm => fm.FolderProviderType == Config.GetDefaultProvider("folder").Name) : + this.GetFolderMapping(portalId, "Standard"); + return defaultFolderMapping ?? this.GetFolderMapping(portalId, "Standard"); } public int AddFolderMapping(FolderMappingInfo objFolderMapping) @@ -94,7 +94,7 @@ public void DeleteFolderMapping(int portalID, int folderMappingID) if (folderMappingFolders.Count() > 0) { - var defaultFolderMapping = GetDefaultFolderMapping(portalID); + var defaultFolderMapping = this.GetDefaultFolderMapping(portalID); foreach (var folderMappingFolder in folderMappingFolders) { @@ -127,12 +127,12 @@ public FolderMappingInfo GetFolderMapping(int folderMappingID) public FolderMappingInfo GetFolderMapping(int portalId, int folderMappingID) { - return GetFolderMappings(portalId).SingleOrDefault(fm => fm.FolderMappingID == folderMappingID); + return this.GetFolderMappings(portalId).SingleOrDefault(fm => fm.FolderMappingID == folderMappingID); } public FolderMappingInfo GetFolderMapping(int portalId, string mappingName) { - return GetFolderMappings(portalId).SingleOrDefault(fm => fm.MappingName == mappingName); + return this.GetFolderMappings(portalId).SingleOrDefault(fm => fm.MappingName == mappingName); } public List GetFolderMappings(int portalId) diff --git a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingInfo.cs b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingInfo.cs index 4ac405d62b6..1c7c350e43b 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingInfo.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingInfo.cs @@ -32,18 +32,18 @@ public Hashtable FolderMappingSettings { get { - if (_folderMappingSettings == null) + if (this._folderMappingSettings == null) { - if (FolderMappingID == Null.NullInteger) + if (this.FolderMappingID == Null.NullInteger) { - _folderMappingSettings = new Hashtable(); + this._folderMappingSettings = new Hashtable(); } else { - _folderMappingSettings = FolderMappingController.Instance.GetFolderMappingSettings(FolderMappingID); + this._folderMappingSettings = FolderMappingController.Instance.GetFolderMappingSettings(this.FolderMappingID); } } - return _folderMappingSettings; + return this._folderMappingSettings; } } @@ -52,12 +52,12 @@ public string ImageUrl { get { - if (string.IsNullOrEmpty(_imageUrl)) + if (string.IsNullOrEmpty(this._imageUrl)) { - _imageUrl = FolderProvider.Instance(FolderProviderType).GetFolderProviderIconPath(); + this._imageUrl = FolderProvider.Instance(this.FolderProviderType).GetFolderProviderIconPath(); } - return _imageUrl; + return this._imageUrl; } } @@ -65,7 +65,7 @@ public bool IsEditable { get { - return !DefaultFolderProviders.GetDefaultProviders().Contains(FolderProviderType); + return !DefaultFolderProviders.GetDefaultProviders().Contains(this.FolderProviderType); } } @@ -73,16 +73,16 @@ public bool SyncAllSubFolders { get { - if(FolderMappingSettings.ContainsKey("SyncAllSubFolders")) + if(this.FolderMappingSettings.ContainsKey("SyncAllSubFolders")) { - return bool.Parse(FolderMappingSettings["SyncAllSubFolders"].ToString()); + return bool.Parse(this.FolderMappingSettings["SyncAllSubFolders"].ToString()); } return true; } set { - FolderMappingSettings["SyncAllSubFolders"] = value; + this.FolderMappingSettings["SyncAllSubFolders"] = value; } } @@ -92,16 +92,16 @@ public bool SyncAllSubFolders public FolderMappingInfo() { - FolderMappingID = Null.NullInteger; - PortalID = Null.NullInteger; + this.FolderMappingID = Null.NullInteger; + this.PortalID = Null.NullInteger; } public FolderMappingInfo(int portalID, string mappingName, string folderProviderType) { - FolderMappingID = Null.NullInteger; - PortalID = portalID; - MappingName = mappingName; - FolderProviderType = folderProviderType; + this.FolderMappingID = Null.NullInteger; + this.PortalID = portalID; + this.MappingName = mappingName; + this.FolderProviderType = folderProviderType; } #endregion @@ -114,11 +114,11 @@ public FolderMappingInfo(int portalID, string mappingName, string folderProvider /// The Data Reader to use public void Fill(IDataReader dr) { - FolderMappingID = Null.SetNullInteger(dr["FolderMappingID"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - MappingName = Null.SetNullString(dr["MappingName"]); - FolderProviderType = Null.SetNullString(dr["FolderProviderType"]); - Priority = Null.SetNullInteger(dr["Priority"]); + this.FolderMappingID = Null.SetNullInteger(dr["FolderMappingID"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.MappingName = Null.SetNullString(dr["MappingName"]); + this.FolderProviderType = Null.SetNullString(dr["FolderProviderType"]); + this.Priority = Null.SetNullInteger(dr["Priority"]); } /// @@ -128,11 +128,11 @@ public int KeyID { get { - return FolderMappingID; + return this.FolderMappingID; } set { - FolderMappingID = value; + this.FolderMappingID = value; } } diff --git a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingsConfigController.cs b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingsConfigController.cs index 6ec591f0a24..077aa949d33 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingsConfigController.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderMappingsConfigController.cs @@ -20,9 +20,9 @@ public class FolderMappingsConfigController: ServiceLocator(); - FolderTypes = new List(); - LoadConfig(); + this.FolderMappings = new Dictionary(); + this.FolderTypes = new List(); + this.LoadConfig(); } #endregion @@ -31,29 +31,29 @@ public FolderMappingsConfigController() private void FillFolderMappings(XmlDocument configDocument) { - var folderMappingsNode = configDocument.SelectSingleNode(ConfigNode+"/folderMappings"); + var folderMappingsNode = configDocument.SelectSingleNode(this.ConfigNode+"/folderMappings"); if (folderMappingsNode == null) { return; } - FolderMappings.Clear(); + this.FolderMappings.Clear(); foreach (XmlNode folderMappingNode in folderMappingsNode) { - FolderMappings.Add(XmlUtils.GetNodeValue(folderMappingNode, "folderPath"), XmlUtils.GetNodeValue(folderMappingNode, "folderTypeName")); + this.FolderMappings.Add(XmlUtils.GetNodeValue(folderMappingNode, "folderPath"), XmlUtils.GetNodeValue(folderMappingNode, "folderTypeName")); } } private void FillFolderTypes(XmlDocument configDocument) { - var folderTypesNode = configDocument.SelectSingleNode(ConfigNode+"/folderTypes"); + var folderTypesNode = configDocument.SelectSingleNode(this.ConfigNode+"/folderTypes"); if (folderTypesNode == null) { return; } - FolderTypes.Clear(); + this.FolderTypes.Clear(); foreach (XmlNode folderTypeNode in folderTypesNode) { - FolderTypes.Add(GetFolderMappingFromConfigNode(folderTypeNode)); + this.FolderTypes.Add(this.GetFolderMappingFromConfigNode(folderTypeNode)); } } @@ -105,8 +105,8 @@ public void LoadConfig() { var configDocument = new XmlDocument { XmlResolver = null }; configDocument.Load(defaultConfigFilePath); - FillFolderMappings(configDocument); - FillFolderTypes(configDocument); + this.FillFolderMappings(configDocument); + this.FillFolderTypes(configDocument); } } catch (Exception ex) @@ -119,22 +119,22 @@ public void SaveConfig(string folderMappinsSettings) { if (!File.Exists(defaultConfigFilePath)) { - var folderMappingsConfigContent = "<" + ConfigNode + ">" + folderMappinsSettings + ""; + var folderMappingsConfigContent = "<" + this.ConfigNode + ">" + folderMappinsSettings + ""; File.AppendAllText(defaultConfigFilePath, folderMappingsConfigContent); var configDocument = new XmlDocument { XmlResolver = null }; configDocument.LoadXml(folderMappingsConfigContent); - FillFolderMappings(configDocument); - FillFolderTypes(configDocument); + this.FillFolderMappings(configDocument); + this.FillFolderTypes(configDocument); } } public FolderMappingInfo GetFolderMapping(int portalId, string folderPath) { - if (!FolderMappings.ContainsKey(folderPath)) + if (!this.FolderMappings.ContainsKey(folderPath)) { return null; } - return FolderMappingController.Instance.GetFolderMapping(portalId, FolderMappings[folderPath]); + return FolderMappingController.Instance.GetFolderMapping(portalId, this.FolderMappings[folderPath]); } #endregion diff --git a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderTypeConfig.cs b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderTypeConfig.cs index 99b96147a39..8f8bcc114a2 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderTypeConfig.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderMappings/FolderTypeConfig.cs @@ -24,7 +24,7 @@ public class FolderTypeConfig public FolderTypeConfig() { - Settings = new List(); + this.Settings = new List(); } } } diff --git a/DNN Platform/Library/Services/FileSystem/FolderProvider.cs b/DNN Platform/Library/Services/FileSystem/FolderProvider.cs index 865a5f7609a..e59bcdd8397 100644 --- a/DNN Platform/Library/Services/FileSystem/FolderProvider.cs +++ b/DNN Platform/Library/Services/FileSystem/FolderProvider.cs @@ -175,7 +175,7 @@ private static void MoveFiles(IFolderInfo folder, IFolderInfo newFolder, FolderM public virtual void AddFolder(string folderPath, FolderMappingInfo folderMapping, string mappedPath) { - AddFolder(folderPath, folderMapping); + this.AddFolder(folderPath, folderMapping); } /// @@ -196,18 +196,18 @@ public virtual void CopyFile(string folderPath, string fileName, string newFolde Requires.NotNull("sourceFolder", sourceFolder); Requires.NotNull("destinationFolder", destinationFolder); - using (var fileContent = GetFileStream(sourceFolder, fileName)) + using (var fileContent = this.GetFileStream(sourceFolder, fileName)) { if (!fileContent.CanSeek) { using (var seekableStream = FileManager.Instance.GetSeekableStream(fileContent)) { - AddFile(destinationFolder, fileName, seekableStream); + this.AddFile(destinationFolder, fileName, seekableStream); } } else { - AddFile(destinationFolder, fileName, fileContent); + this.AddFile(destinationFolder, fileName, fileContent); } } } @@ -217,7 +217,7 @@ public virtual void CopyFile(string folderPath, string fileName, string newFolde /// public virtual Stream GetFileStream(IFolderInfo folder, IFileInfo file, int version) { - return GetFileStream(folder, FileVersionController.GetVersionedFilename(file, version)); + return this.GetFileStream(folder, FileVersionController.GetVersionedFilename(file, version)); } /// @@ -231,7 +231,7 @@ public virtual Stream GetFileStream(IFolderInfo folder, IFileInfo file, int vers /// public virtual string GetSettingsControlVirtualPath() { - var provider = Config.GetProvider("folder", _providerName); + var provider = Config.GetProvider("folder", this._providerName); if (provider != null) { @@ -306,9 +306,9 @@ public string EncryptValue(string settingValue) public virtual string GetHashCode(IFileInfo file) { var currentHashCode = String.Empty; - using (var fileContent = GetFileStream(file)) + using (var fileContent = this.GetFileStream(file)) { - currentHashCode = GetHashCode(file, fileContent); + currentHashCode = this.GetHashCode(file, fileContent); } return currentHashCode; } diff --git a/DNN Platform/Library/Services/FileSystem/Internal/FileDeletionController.cs b/DNN Platform/Library/Services/FileSystem/Internal/FileDeletionController.cs index a3f83ce8176..8267dddc986 100644 --- a/DNN Platform/Library/Services/FileSystem/Internal/FileDeletionController.cs +++ b/DNN Platform/Library/Services/FileSystem/Internal/FileDeletionController.cs @@ -34,7 +34,7 @@ public void DeleteFile(IFileInfo file) throw new FolderProviderException(Localization.Localization.GetExceptionMessage("DeleteFileUnderlyingSystemError", "The underlying system threw an exception. The file has not been deleted."), ex); } - DeleteFileData(file); + this.DeleteFileData(file); DataCache.RemoveCache("GetFileById" + file.FileId); } @@ -49,14 +49,14 @@ public void UnlinkFile(IFileInfo file) FileVersionController.Instance.DeleteAllUnpublishedVersions(file, false); - DeleteFileData(file); + this.DeleteFileData(file); } public void DeleteFileData(IFileInfo file) { DataProvider.Instance().DeleteFile(file.PortalId, file.FileName, file.FolderId); - DeleteContentItem(file.ContentItemID); + this.DeleteContentItem(file.ContentItemID); } private void DeleteContentItem(int contentItemId) diff --git a/DNN Platform/Library/Services/FileSystem/Internal/FileLockingController.cs b/DNN Platform/Library/Services/FileSystem/Internal/FileLockingController.cs index 3303d9f9729..fb4675ebd06 100644 --- a/DNN Platform/Library/Services/FileSystem/Internal/FileLockingController.cs +++ b/DNN Platform/Library/Services/FileSystem/Internal/FileLockingController.cs @@ -32,7 +32,7 @@ public bool IsFileLocked(IFileInfo file, out string lockReasonKey) } } - var outOfPublishPeriod = IsFileOutOfPublishPeriod(file); + var outOfPublishPeriod = this.IsFileOutOfPublishPeriod(file); if (outOfPublishPeriod) { lockReasonKey = "FileLockedOutOfPublishPeriodError"; @@ -48,7 +48,7 @@ public bool IsFileOutOfPublishPeriod(IFileInfo file, int portalId, int userId) { return false; } - return IsFileOutOfPublishPeriod(file); + return this.IsFileOutOfPublishPeriod(file); } private bool IsFileOutOfPublishPeriod(IFileInfo file) diff --git a/DNN Platform/Library/Services/FileSystem/Internal/FileSecurityController.cs b/DNN Platform/Library/Services/FileSystem/Internal/FileSecurityController.cs index bae8171aa89..7f918627b77 100644 --- a/DNN Platform/Library/Services/FileSystem/Internal/FileSecurityController.cs +++ b/DNN Platform/Library/Services/FileSystem/Internal/FileSecurityController.cs @@ -31,7 +31,7 @@ public bool Validate(string fileName, Stream fileContent) Requires.NotNull("fileContent", fileContent); var extension = Path.GetExtension(fileName); - var checker = GetSecurityChecker(extension?.ToLowerInvariant().TrimStart('.')); + var checker = this.GetSecurityChecker(extension?.ToLowerInvariant().TrimStart('.')); //when there is no specfic file check for the file type, then treat it as validated. if (checker == null) @@ -40,7 +40,7 @@ public bool Validate(string fileName, Stream fileContent) } //use copy of the stream as we can't make sure how the check process the stream. - using (var copyStream = CopyStream(fileContent)) + using (var copyStream = this.CopyStream(fileContent)) { return checker.Validate(copyStream); } diff --git a/DNN Platform/Library/Services/FileSystem/Internal/UserSecurityController.cs b/DNN Platform/Library/Services/FileSystem/Internal/UserSecurityController.cs index 3504e31664a..a1e7365c574 100644 --- a/DNN Platform/Library/Services/FileSystem/Internal/UserSecurityController.cs +++ b/DNN Platform/Library/Services/FileSystem/Internal/UserSecurityController.cs @@ -14,7 +14,7 @@ public class UserSecurityController : ServiceLocator GetSubFolders(string folderPath, FolderMappi Requires.PropertyNotNull("folderPath", folderPath); Requires.NotNull("folderMapping", folderMapping); - return DirectoryWrapper.Instance.GetDirectories(GetActualPath(folderMapping, folderPath)) - .Select(directory => GetRelativePath(folderMapping, directory)); + return DirectoryWrapper.Instance.GetDirectories(this.GetActualPath(folderMapping, folderPath)) + .Select(directory => this.GetRelativePath(folderMapping, directory)); } public override bool IsInSync(IFileInfo file) { Requires.NotNull("file", file); - return Convert.ToInt32((file.LastModificationTime - GetLastModificationTime(file)).TotalSeconds) == 0; + return Convert.ToInt32((file.LastModificationTime - this.GetLastModificationTime(file)).TotalSeconds) == 0; } public override void MoveFile(IFileInfo file, IFolderInfo destinationFolder) @@ -253,8 +253,8 @@ public override void MoveFile(IFileInfo file, IFolderInfo destinationFolder) if (file.FolderId != destinationFolder.FolderID) { - string oldName = GetActualPath(file); - string newName = GetActualPath(destinationFolder, file.FileName); + string oldName = this.GetActualPath(file); + string newName = this.GetActualPath(destinationFolder, file.FileName); FileWrapper.Instance.Move(oldName, newName); } } @@ -272,8 +272,8 @@ public override void RenameFile(IFileInfo file, string newFileName) if (file.FileName != newFileName) { IFolderInfo folder = FolderManager.Instance.GetFolder(file.FolderId); - string oldName = GetActualPath(file); - string newName = GetActualPath(folder, newFileName); + string oldName = this.GetActualPath(file); + string newName = this.GetActualPath(folder, newFileName); FileWrapper.Instance.Move(oldName, newName); } } @@ -287,7 +287,7 @@ public override void SetFileAttributes(IFileInfo file, FileAttributes fileAttrib { Requires.NotNull("file", file); - FileWrapper.Instance.SetAttributes(GetActualPath(file), fileAttributes); + FileWrapper.Instance.SetAttributes(this.GetActualPath(file), fileAttributes); } public override bool SupportsFileAttributes() @@ -300,7 +300,7 @@ public override void UpdateFile(IFileInfo file, Stream content) Requires.NotNull("file", file); Requires.NotNull("content", content); - UpdateFile(FolderManager.Instance.GetFolder(file.FolderId), file.FileName, content); + this.UpdateFile(FolderManager.Instance.GetFolder(file.FolderId), file.FileName, content); } public override void UpdateFile(IFolderInfo folder, string fileName, Stream content) @@ -310,7 +310,7 @@ public override void UpdateFile(IFolderInfo folder, string fileName, Stream cont Requires.NotNull("content", content); var arrData = new byte[2048]; - var actualPath = GetActualPath(folder, fileName); + var actualPath = this.GetActualPath(folder, fileName); if (FileWrapper.Instance.Exists(actualPath)) { @@ -367,7 +367,7 @@ internal virtual PortalSettings GetPortalSettings(int portalId) /// A windows supported path to the file protected virtual string GetActualPath(FolderMappingInfo folderMapping, string folderPath, string fileName) { - var actualFolderPath = GetActualPath(folderMapping, folderPath); + var actualFolderPath = this.GetActualPath(folderMapping, folderPath); return Path.Combine(actualFolderPath, fileName); } diff --git a/DNN Platform/Library/Services/FileSystem/SynchronizeFileSystem.cs b/DNN Platform/Library/Services/FileSystem/SynchronizeFileSystem.cs index 304bb655cb1..784209dfe92 100644 --- a/DNN Platform/Library/Services/FileSystem/SynchronizeFileSystem.cs +++ b/DNN Platform/Library/Services/FileSystem/SynchronizeFileSystem.cs @@ -20,7 +20,7 @@ public class SynchronizeFileSystem : SchedulerClient { public SynchronizeFileSystem(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } public override void DoWork() @@ -28,22 +28,22 @@ public override void DoWork() try { //notification that the event is progressing - Progressing(); //OPTIONAL + this.Progressing(); //OPTIONAL - Synchronize(); + this.Synchronize(); - ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED - ScheduleHistoryItem.AddLogNote("File System Synchronized."); //OPTIONAL + this.ScheduleHistoryItem.AddLogNote("File System Synchronized."); //OPTIONAL } catch (Exception exc) { - ScheduleHistoryItem.Succeeded = false; + this.ScheduleHistoryItem.Succeeded = false; - ScheduleHistoryItem.AddLogNote("File System Synchronization failed. " + exc); + this.ScheduleHistoryItem.AddLogNote("File System Synchronization failed. " + exc); //notification that we have errored - Errored(ref exc); + this.Errored(ref exc); //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL diff --git a/DNN Platform/Library/Services/FileSystem/Wrappers/DirectoryWrapper.cs b/DNN Platform/Library/Services/FileSystem/Wrappers/DirectoryWrapper.cs index f11a4d248c9..0040c7953b6 100644 --- a/DNN Platform/Library/Services/FileSystem/Wrappers/DirectoryWrapper.cs +++ b/DNN Platform/Library/Services/FileSystem/Wrappers/DirectoryWrapper.cs @@ -12,7 +12,7 @@ public class DirectoryWrapper : ComponentBase, IDi { public void Delete(string path, bool recursive) { - if (Exists(path)) + if (this.Exists(path)) { Directory.Delete(path, recursive); } diff --git a/DNN Platform/Library/Services/GeneratedImage/DiskImageStore.cs b/DNN Platform/Library/Services/GeneratedImage/DiskImageStore.cs index 0b2ee79834f..de38a00276f 100644 --- a/DNN Platform/Library/Services/GeneratedImage/DiskImageStore.cs +++ b/DNN Platform/Library/Services/GeneratedImage/DiskImageStore.cs @@ -83,15 +83,15 @@ private DateTime LastPurge { get { - if (_lastPurge < new DateTime(1990, 1, 1)) + if (this._lastPurge < new DateTime(1990, 1, 1)) { - _lastPurge = DateTime.Now.Subtract(PurgeInterval); + this._lastPurge = DateTime.Now.Subtract(PurgeInterval); } - return _lastPurge; + return this._lastPurge; } set { - _lastPurge = value; + this._lastPurge = value; } } @@ -108,7 +108,7 @@ internal DiskImageStore() { Directory.CreateDirectory(CachePath); } - _lastPurge = DateTime.Now; + this._lastPurge = DateTime.Now; } internal static IImageStore Instance @@ -215,14 +215,14 @@ private void PurgeCallback(object target) #endif } - LastPurge = DateTime.Now; - _purgeQueued = false; + this.LastPurge = DateTime.Now; + this._purgeQueued = false; } private void Add(string id, byte[] data) { var path = BuildFilePath(id); - lock (GetFileLockObject(id)) + lock (this.GetFileLockObject(id)) { try { @@ -239,10 +239,10 @@ private bool TryTransmitIfContains(string id, HttpResponseBase response) { if (EnableAutoPurge) { - QueueAutoPurge(); + this.QueueAutoPurge(); } string path = BuildFilePath(id); - lock (GetFileLockObject(id)) + lock (this.GetFileLockObject(id)) { if (File.Exists(path)) { @@ -256,14 +256,14 @@ private bool TryTransmitIfContains(string id, HttpResponseBase response) private void QueueAutoPurge() { var now = DateTime.Now; - if (!_purgeQueued && now.Subtract(LastPurge) > PurgeInterval) + if (!this._purgeQueued && now.Subtract(this.LastPurge) > PurgeInterval) { - lock (_purgeQueuedLock) + lock (this._purgeQueuedLock) { - if (!_purgeQueued) + if (!this._purgeQueued) { - _purgeQueued = true; - ThreadPool.QueueUserWorkItem(PurgeCallback); + this._purgeQueued = true; + ThreadPool.QueueUserWorkItem(this.PurgeCallback); } } } @@ -284,7 +284,7 @@ private object GetFileLockObject(string id) return lockObject; #else - return _fileLock; + return this._fileLock; #endif } @@ -310,12 +310,12 @@ private static string BuildFilePath(string id) #region IImageStore Members void IImageStore.Add(string id, byte[] data) { - Add(id, data); + this.Add(id, data); } bool IImageStore.TryTransmitIfContains(string id, HttpResponseBase response) { - return TryTransmitIfContains(id, response); + return this.TryTransmitIfContains(id, response); } #endregion } diff --git a/DNN Platform/Library/Services/GeneratedImage/DnnImageHandler.cs b/DNN Platform/Library/Services/GeneratedImage/DnnImageHandler.cs index 245ab2ed9ee..20519725920 100644 --- a/DNN Platform/Library/Services/GeneratedImage/DnnImageHandler.cs +++ b/DNN Platform/Library/Services/GeneratedImage/DnnImageHandler.cs @@ -67,24 +67,24 @@ private Image EmptyImage { var emptyBmp = new Bitmap(1, 1, PixelFormat.Format1bppIndexed); emptyBmp.MakeTransparent(); - ContentType = ImageFormat.Png; + this.ContentType = ImageFormat.Png; - if (string.IsNullOrEmpty(_defaultImageFile)) + if (string.IsNullOrEmpty(this._defaultImageFile)) { return emptyBmp; } try { - var fullFilePath = HttpContext.Current.Server.MapPath(_defaultImageFile); + var fullFilePath = HttpContext.Current.Server.MapPath(this._defaultImageFile); - if (!File.Exists(fullFilePath) || !IsAllowedFilePathImage(_defaultImageFile)) + if (!File.Exists(fullFilePath) || !IsAllowedFilePathImage(this._defaultImageFile)) { return emptyBmp; } - var fi = new System.IO.FileInfo(_defaultImageFile); - ContentType = GetImageFormat(fi.Extension); + var fi = new System.IO.FileInfo(this._defaultImageFile); + this.ContentType = GetImageFormat(fi.Extension); using (var stream = new FileStream(fullFilePath, FileMode.Open)) { @@ -102,26 +102,26 @@ private Image EmptyImage public DnnImageHandler() { // Set default settings here - EnableClientCache = true; - EnableServerCache = true; - AllowStandalone = true; - LogSecurity = false; - EnableIPCount = false; - ImageCompression = 95; + this.EnableClientCache = true; + this.EnableServerCache = true; + this.AllowStandalone = true; + this.LogSecurity = false; + this.EnableIPCount = false; + this.ImageCompression = 95; DiskImageStore.PurgeInterval = new TimeSpan(0, 3, 0); - IPCountPurgeInterval = new TimeSpan(0, 5, 0); - IPCountMaxCount = 500; - ClientCacheExpiration = new TimeSpan(0, 10, 0); - AllowedDomains = new[] { string.Empty }; + this.IPCountPurgeInterval = new TimeSpan(0, 5, 0); + this.IPCountMaxCount = 500; + this.ClientCacheExpiration = new TimeSpan(0, 10, 0); + this.AllowedDomains = new[] { string.Empty }; // read settings from web.config - ReadSettings(); + this.ReadSettings(); } // Add image generation logic here and return an instance of ImageInfo public override ImageInfo GenerateImage(NameValueCollection parameters) { - SetupCulture(); + this.SetupCulture(); //which type of image should be generated ? string mode = string.IsNullOrEmpty(parameters["mode"]) ? "profilepic" : parameters["mode"].ToLowerInvariant(); @@ -147,18 +147,18 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) string text = string.IsNullOrEmpty(parameters["text"]) ? "" : parameters["text"]; // Default Image - _defaultImageFile = string.IsNullOrEmpty(parameters["NoImage"]) ? string.Empty : parameters["NoImage"]; + this._defaultImageFile = string.IsNullOrEmpty(parameters["NoImage"]) ? string.Empty : parameters["NoImage"]; // Do we override caching for this image ? if (!string.IsNullOrEmpty(parameters["NoCache"])) { - EnableClientCache = false; - EnableServerCache = false; + this.EnableClientCache = false; + this.EnableServerCache = false; } try { - ContentType = GetImageFormat(format); + this.ContentType = GetImageFormat(format); switch (mode) { @@ -174,11 +174,11 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) }; IFileInfo photoFile; - ContentType = !uppTrans.TryGetPhotoFile(out photoFile) + this.ContentType = !uppTrans.TryGetPhotoFile(out photoFile) ? ImageFormat.Gif : GetImageFormat(photoFile?.Extension ?? "jpg"); - ImageTransforms.Add(uppTrans); + this.ImageTransforms.Add(uppTrans); break; case "placeholder": @@ -195,7 +195,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) if (!string.IsNullOrEmpty(parameters["BackColor"])) placeHolderTrans.BackColor = backColor; - ImageTransforms.Add(placeHolderTrans); + this.ImageTransforms.Add(placeHolderTrans); break; case "securefile": @@ -206,17 +206,17 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) var file = FileManager.Instance.GetFile(fileId); if (file == null) { - return GetEmptyImageInfo(); + return this.GetEmptyImageInfo(); } var folder = FolderManager.Instance.GetFolder(file.FolderId); if (!secureFileTrans.DoesHaveReadFolderPermission(folder)) { - return GetEmptyImageInfo(); + return this.GetEmptyImageInfo(); } - ContentType = GetImageFormat(file.Extension); + this.ContentType = GetImageFormat(file.Extension); secureFileTrans.SecureFile = file; - secureFileTrans.EmptyImage = EmptyImage; - ImageTransforms.Add(secureFileTrans); + secureFileTrans.EmptyImage = this.EmptyImage; + this.ImageTransforms.Add(secureFileTrans); } break; @@ -232,7 +232,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) var fullFilePath = HttpContext.Current.Server.MapPath(filePath); if (!File.Exists(fullFilePath) || !IsAllowedFilePathImage(filePath)) { - return GetEmptyImageInfo(); + return this.GetEmptyImageInfo(); } imgFile = fullFilePath; } @@ -242,7 +242,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) // allow only site resources when using the url parameter if (!url.StartsWith("http") || !UriBelongsToSite(new Uri(url))) { - return GetEmptyImageInfo(); + return this.GetEmptyImageInfo(); } imgUrl = url; @@ -261,10 +261,10 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) string[] parts = parameters["Url"].Split('.'); extension = parts[parts.Length - 1].ToLowerInvariant(); } - ContentType = GetImageFormat(extension); + this.ContentType = GetImageFormat(extension); } var imageFileTrans = new ImageFileTransform { ImageFilePath = imgFile, ImageUrl = imgUrl}; - ImageTransforms.Add(imageFileTrans); + this.ImageTransforms.Add(imageFileTrans); break; default: @@ -306,14 +306,14 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) } } } - ImageTransforms.Add(imageTransform); + this.ImageTransforms.Add(imageTransform); break; } } catch (Exception ex) { Exceptions.Exceptions.LogException(ex); - return GetEmptyImageInfo(); + return this.GetEmptyImageInfo(); } // Resize-Transformation @@ -375,7 +375,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) MaxHeight = maxHeight, Border = border }; - ImageTransforms.Add(resizeTrans); + this.ImageTransforms.Add(resizeTrans); } } @@ -387,7 +387,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) if (double.TryParse(parameters["Gamma"], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out gamma) && gamma >= 0.2 && gamma <= 5) { gammaTrans.Gamma = gamma; - ImageTransforms.Add(gammaTrans); + this.ImageTransforms.Add(gammaTrans); } } @@ -399,7 +399,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) if (int.TryParse(parameters["Brightness"], out brightness)) { brightnessTrans.Brightness = brightness; - ImageTransforms.Add(brightnessTrans); + this.ImageTransforms.Add(brightnessTrans); } } @@ -411,7 +411,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) if (double.TryParse(parameters["Contrast"], NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out contrast) && (contrast >= -100 && contrast <= 100)) { contrastTrans.Contrast = contrast; - ImageTransforms.Add(contrastTrans); + this.ImageTransforms.Add(contrastTrans); } } @@ -419,14 +419,14 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) if (!string.IsNullOrEmpty(parameters["Greyscale"])) { var greyscaleTrans = new ImageGreyScaleTransform(); - ImageTransforms.Add(greyscaleTrans); + this.ImageTransforms.Add(greyscaleTrans); } // Invert if (!string.IsNullOrEmpty(parameters["Invert"])) { var invertTrans = new ImageInvertTransform(); - ImageTransforms.Add(invertTrans); + this.ImageTransforms.Add(invertTrans); } // Rotate / Flip @@ -435,7 +435,7 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) var rotateFlipTrans = new ImageRotateFlipTransform(); var rotateFlipType = (RotateFlipType)Enum.Parse(typeof(RotateFlipType), parameters["RotateFlip"]); rotateFlipTrans.RotateFlip = rotateFlipType; - ImageTransforms.Add(rotateFlipTrans); + this.ImageTransforms.Add(rotateFlipTrans); } @@ -443,14 +443,14 @@ public override ImageInfo GenerateImage(NameValueCollection parameters) var dummy = new Bitmap(1, 1); using (var ms = new MemoryStream()) { - dummy.Save(ms, ContentType); + dummy.Save(ms, this.ContentType); return new ImageInfo(ms.ToArray()); } } private ImageInfo GetEmptyImageInfo() { - return new ImageInfo(EmptyImage) + return new ImageInfo(this.EmptyImage) { IsEmptyImage = true }; @@ -496,37 +496,37 @@ private void ReadSettings() switch (name) { case "enableclientcache": - EnableClientCache = Convert.ToBoolean(setting[1]); + this.EnableClientCache = Convert.ToBoolean(setting[1]); break; case "clientcacheexpiration": - ClientCacheExpiration = TimeSpan.FromSeconds(Convert.ToInt32(setting[1])); + this.ClientCacheExpiration = TimeSpan.FromSeconds(Convert.ToInt32(setting[1])); break; case "enableservercache": - EnableServerCache = Convert.ToBoolean(setting[1]); + this.EnableServerCache = Convert.ToBoolean(setting[1]); break; case "servercacheexpiration": DiskImageStore.PurgeInterval = TimeSpan.FromSeconds(Convert.ToInt32(setting[1])); break; case "allowstandalone": - AllowStandalone = Convert.ToBoolean(setting[1]); + this.AllowStandalone = Convert.ToBoolean(setting[1]); break; case "logsecurity": - LogSecurity = Convert.ToBoolean(setting[1]); + this.LogSecurity = Convert.ToBoolean(setting[1]); break; case "imagecompression": - ImageCompression = Convert.ToInt32(setting[1]); + this.ImageCompression = Convert.ToInt32(setting[1]); break; case "alloweddomains": - AllowedDomains = setting[1].Split(','); + this.AllowedDomains = setting[1].Split(','); break; case "enableipcount": - EnableIPCount = Convert.ToBoolean(setting[1]); + this.EnableIPCount = Convert.ToBoolean(setting[1]); break; case "ipcountmax": - IPCountMaxCount = Convert.ToInt32(setting[1]); + this.IPCountMaxCount = Convert.ToInt32(setting[1]); break; case "ipcountpurgeinterval": - IPCountPurgeInterval = TimeSpan.FromSeconds(Convert.ToInt32(setting[1])); + this.IPCountPurgeInterval = TimeSpan.FromSeconds(Convert.ToInt32(setting[1])); break; } } diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageBrightnessTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageBrightnessTransform.cs index 3bdb1b6cb95..7adc15c0111 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageBrightnessTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageBrightnessTransform.cs @@ -20,15 +20,15 @@ public class ImageBrightnessTransform : ImageTransform /// /// Provides an Unique String for this class /// - public override string UniqueString => base.UniqueString + "-" + Brightness; + public override string UniqueString => base.UniqueString + "-" + this.Brightness; public ImageBrightnessTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; - Brightness = 0; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; + this.Brightness = 0; } /// @@ -40,17 +40,17 @@ public override Image ProcessImage(Image image) { var temp = (Bitmap)image; var bmap = (Bitmap)temp.Clone(); - if (Brightness < -255) Brightness = -255; - if (Brightness > 255) Brightness = 255; + if (this.Brightness < -255) this.Brightness = -255; + if (this.Brightness > 255) this.Brightness = 255; Color c; for (int i = 0; i < bmap.Width; i++) { for (int j = 0; j < bmap.Height; j++) { c = bmap.GetPixel(i, j); - int cR = c.R + Brightness; - int cG = c.G + Brightness; - int cB = c.B + Brightness; + int cR = c.R + this.Brightness; + int cG = c.G + this.Brightness; + int cB = c.B + this.Brightness; if (cR < 0) cR = 1; if (cR > 255) cR = 255; diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageContrastTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageContrastTransform.cs index 96439d128e2..8dd50a43d8b 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageContrastTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageContrastTransform.cs @@ -20,15 +20,15 @@ public class ImageContrastTransform : ImageTransform /// /// Provides an Unique String for this class /// - public override string UniqueString => base.UniqueString + "-" + Contrast; + public override string UniqueString => base.UniqueString + "-" + this.Contrast; public ImageContrastTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; - Contrast = 0; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; + this.Contrast = 0; } /// @@ -40,10 +40,10 @@ public override Image ProcessImage(Image image) { var temp = (Bitmap)image; var bmap = (Bitmap)temp.Clone(); - if (Contrast < -100) Contrast = -100; - if (Contrast > 100) Contrast = 100; - Contrast = (100.0 + Contrast) / 100.0; - Contrast *= Contrast; + if (this.Contrast < -100) this.Contrast = -100; + if (this.Contrast > 100) this.Contrast = 100; + this.Contrast = (100.0 + this.Contrast) / 100.0; + this.Contrast *= this.Contrast; Color c; for (int i = 0; i < bmap.Width; i++) { @@ -52,7 +52,7 @@ public override Image ProcessImage(Image image) c = bmap.GetPixel(i, j); double pR = c.R / 255.0; pR -= 0.5; - pR *= Contrast; + pR *= this.Contrast; pR += 0.5; pR *= 255; if (pR < 0) pR = 0; @@ -60,7 +60,7 @@ public override Image ProcessImage(Image image) double pG = c.G / 255.0; pG -= 0.5; - pG *= Contrast; + pG *= this.Contrast; pG += 0.5; pG *= 255; if (pG < 0) pG = 0; @@ -68,7 +68,7 @@ public override Image ProcessImage(Image image) double pB = c.B / 255.0; pB -= 0.5; - pB *= Contrast; + pB *= this.Contrast; pB += 0.5; pB *= 255; if (pB < 0) pB = 0; diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGammaTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGammaTransform.cs index 9c37753622f..7786d6aaa0c 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGammaTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGammaTransform.cs @@ -21,15 +21,15 @@ public class ImageGammaTransform : ImageTransform /// /// Provides an Unique String for this class /// - public override string UniqueString => base.UniqueString + "-" + Gamma; + public override string UniqueString => base.UniqueString + "-" + this.Gamma; public ImageGammaTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; - Gamma = 1; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; + this.Gamma = 1; } /// @@ -45,7 +45,7 @@ public override Image ProcessImage(Image image) byte[] gammaArray = new byte[256]; for (var i = 0; i < 256; ++i) { - gammaArray[i] = (byte)Math.Min(255, (int)((255.0 * Math.Pow(i / 255.0, 1.0 / Gamma)) + 0.5)); + gammaArray[i] = (byte)Math.Min(255, (int)((255.0 * Math.Pow(i / 255.0, 1.0 / this.Gamma)) + 0.5)); } for (var i = 0; i < bmap.Width; i++) diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGreyscaleTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGreyscaleTransform.cs index f634121dc39..f4553616746 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGreyscaleTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageGreyscaleTransform.cs @@ -14,10 +14,10 @@ public class ImageGreyScaleTransform : ImageTransform { public ImageGreyScaleTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; } /// diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageInvertTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageInvertTransform.cs index d30604040fd..3b386cafcbb 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageInvertTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageInvertTransform.cs @@ -14,10 +14,10 @@ public class ImageInvertTransform : ImageTransform { public ImageInvertTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; } /// diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageResizeTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageResizeTransform.cs index 9aae6c7116c..d6343871c08 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageResizeTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageResizeTransform.cs @@ -28,12 +28,12 @@ public class ImageResizeTransform : ImageTransform public int Width { get { - return _width; + return this._width; } set { CheckValue(value); - _width = value; + this._width = value; } } @@ -44,12 +44,12 @@ public int MaxWidth { get { - return _maxWidth; + return this._maxWidth; } set { CheckValue(value); - _maxWidth = value; + this._maxWidth = value; } } @@ -58,11 +58,11 @@ public int MaxWidth /// public int Height { get { - return _height; + return this._height; } set { CheckValue(value); - _height = value; + this._height = value; } } @@ -73,12 +73,12 @@ public int MaxHeight { get { - return _maxHeight; + return this._maxHeight; } set { CheckValue(value); - _maxHeight = value; + this._maxHeight = value; } } @@ -89,12 +89,12 @@ public int Border { get { - return _border; + return this._border; } set { CheckValue(value); - _border = value; + this._border = value; } } @@ -104,11 +104,11 @@ public int Border public Color BackColor { get; set; } = Color.White; public ImageResizeTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; - Mode = ImageResizeMode.Fit; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; + this.Mode = ImageResizeMode.Fit; } /// @@ -121,32 +121,32 @@ public override Image ProcessImage(Image image) if (image == null) return null; - if (MaxWidth > 0) + if (this.MaxWidth > 0) { - Width = image.Width > MaxWidth ? MaxWidth : image.Width; + this.Width = image.Width > this.MaxWidth ? this.MaxWidth : image.Width; } - if (MaxHeight > 0) + if (this.MaxHeight > 0) { - Height = image.Height > MaxHeight ? MaxHeight : image.Height; + this.Height = image.Height > this.MaxHeight ? this.MaxHeight : image.Height; } - int scaledHeight = (int)(image.Height * ((float)Width / (float)image.Width)); - int scaledWidth = (int)(image.Width * ((float)Height / (float)image.Height)); + int scaledHeight = (int)(image.Height * ((float)this.Width / (float)image.Width)); + int scaledWidth = (int)(image.Width * ((float)this.Height / (float)image.Height)); Image procImage; - switch (Mode) { + switch (this.Mode) { case ImageResizeMode.Fit: - procImage = FitImage(image, scaledHeight, scaledWidth); + procImage = this.FitImage(image, scaledHeight, scaledWidth); break; case ImageResizeMode.Crop: - procImage = CropImage(image, scaledHeight, scaledWidth); + procImage = this.CropImage(image, scaledHeight, scaledWidth); break; case ImageResizeMode.FitSquare: - procImage = FitSquareImage(image); + procImage = this.FitSquareImage(image); break; case ImageResizeMode.Fill: - procImage = FillImage(image); + procImage = this.FillImage(image); break; default: Debug.Fail("Should not reach this"); @@ -166,35 +166,35 @@ private static void CheckValue(int value) private Image FitImage(Image img, int scaledHeight, int scaledWidth) { int resizeWidth; int resizeHeight; - if (Height == 0) { - resizeWidth = Width; + if (this.Height == 0) { + resizeWidth = this.Width; resizeHeight = scaledHeight; } - else if (Width == 0) { + else if (this.Width == 0) { resizeWidth = scaledWidth; - resizeHeight = Height; + resizeHeight = this.Height; } else { - if (((float)Width / (float)img.Width < Height / (float)img.Height)) { - resizeWidth = Width; + if (((float)this.Width / (float)img.Width < this.Height / (float)img.Height)) { + resizeWidth = this.Width; resizeHeight = scaledHeight; } else { resizeWidth = scaledWidth; - resizeHeight = Height; + resizeHeight = this.Height; } } - var newimage = new Bitmap(resizeWidth + 2 * _border, resizeHeight + 2 * _border); + var newimage = new Bitmap(resizeWidth + 2 * this._border, resizeHeight + 2 * this._border); var graphics = Graphics.FromImage(newimage); graphics.CompositingMode = CompositingMode.SourceCopy; - graphics.CompositingQuality = CompositingQuality; - graphics.InterpolationMode = InterpolationMode; - graphics.SmoothingMode = SmoothingMode; + graphics.CompositingQuality = this.CompositingQuality; + graphics.InterpolationMode = this.InterpolationMode; + graphics.SmoothingMode = this.SmoothingMode; - graphics.FillRectangle(new SolidBrush(BackColor), new Rectangle(0, 0, resizeWidth + 2 * _border, resizeHeight + 2 * _border)); - graphics.DrawImage(img, _border, _border, resizeWidth, resizeHeight); + graphics.FillRectangle(new SolidBrush(this.BackColor), new Rectangle(0, 0, resizeWidth + 2 * this._border, resizeHeight + 2 * this._border)); + graphics.DrawImage(img, this._border, this._border, resizeWidth, resizeHeight); return newimage; } @@ -204,7 +204,7 @@ private Image FitSquareImage(Image img) int resizeWidth; int resizeHeight; - int newDim = Width > 0 ? Width : Height; + int newDim = this.Width > 0 ? this.Width : this.Height; if (img.Height > img.Width) { @@ -217,60 +217,60 @@ private Image FitSquareImage(Image img) resizeHeight = Convert.ToInt32((float)img.Height / (float)img.Width * newDim); } - var newimage = new Bitmap(newDim + 2 * _border, newDim + 2 * _border); + var newimage = new Bitmap(newDim + 2 * this._border, newDim + 2 * this._border); var graphics = Graphics.FromImage(newimage); graphics.CompositingMode = CompositingMode.SourceCopy; - graphics.CompositingQuality = CompositingQuality; - graphics.InterpolationMode = InterpolationMode; - graphics.SmoothingMode = SmoothingMode; + graphics.CompositingQuality = this.CompositingQuality; + graphics.InterpolationMode = this.InterpolationMode; + graphics.SmoothingMode = this.SmoothingMode; - graphics.FillRectangle(new SolidBrush(BackColor),new Rectangle(0,0,newDim + 2*_border ,newDim + 2*_border)); - graphics.DrawImage(img, (newDim - resizeWidth) / 2 + _border, (newDim - resizeHeight) / 2 + _border, resizeWidth, resizeHeight); + graphics.FillRectangle(new SolidBrush(this.BackColor),new Rectangle(0,0,newDim + 2*this._border ,newDim + 2*this._border)); + graphics.DrawImage(img, (newDim - resizeWidth) / 2 + this._border, (newDim - resizeHeight) / 2 + this._border, resizeWidth, resizeHeight); return newimage; } private Image CropImage(Image img, int scaledHeight, int scaledWidth) { int resizeWidth; int resizeHeight; - if ((float)Width / (float)img.Width > Height / (float)img.Height) { - resizeWidth = Width; + if ((float)this.Width / (float)img.Width > this.Height / (float)img.Height) { + resizeWidth = this.Width; resizeHeight = scaledHeight; } else { resizeWidth = scaledWidth; - resizeHeight = Height; + resizeHeight = this.Height; } - var newImage = new Bitmap(Width, Height); + var newImage = new Bitmap(this.Width, this.Height); var graphics = Graphics.FromImage(newImage); graphics.CompositingMode = CompositingMode.SourceCopy; - graphics.CompositingQuality = CompositingQuality; - graphics.InterpolationMode = InterpolationMode; - graphics.SmoothingMode = SmoothingMode; - graphics.PixelOffsetMode = PixelOffsetMode; + graphics.CompositingQuality = this.CompositingQuality; + graphics.InterpolationMode = this.InterpolationMode; + graphics.SmoothingMode = this.SmoothingMode; + graphics.PixelOffsetMode = this.PixelOffsetMode; - graphics.DrawImage(img, (Width - resizeWidth) / 2, (Height - resizeHeight) / 2, resizeWidth, resizeHeight); + graphics.DrawImage(img, (this.Width - resizeWidth) / 2, (this.Height - resizeHeight) / 2, resizeWidth, resizeHeight); return newImage; } private Image FillImage(Image img) { - int resizeHeight = Height; - int resizeWidth = Width; + int resizeHeight = this.Height; + int resizeWidth = this.Width; - var newImage = new Bitmap(Width, Height); + var newImage = new Bitmap(this.Width, this.Height); var graphics = Graphics.FromImage(newImage); graphics.CompositingMode = CompositingMode.SourceCopy; - graphics.CompositingQuality = CompositingQuality; - graphics.InterpolationMode = InterpolationMode; - graphics.SmoothingMode = SmoothingMode; - graphics.PixelOffsetMode = PixelOffsetMode; + graphics.CompositingQuality = this.CompositingQuality; + graphics.InterpolationMode = this.InterpolationMode; + graphics.SmoothingMode = this.SmoothingMode; + graphics.PixelOffsetMode = this.PixelOffsetMode; - graphics.DrawImage(img, (Width - resizeWidth) / 2, (Height - resizeHeight) / 2, resizeWidth, resizeHeight); + graphics.DrawImage(img, (this.Width - resizeWidth) / 2, (this.Height - resizeHeight) / 2, resizeWidth, resizeHeight); return newImage; } @@ -278,7 +278,7 @@ private Image FillImage(Image img) /// Provides an Unique String for this transformation /// [Browsable(false)] - public override string UniqueString => base.UniqueString + Width + InterpolationMode + Height + Mode; + public override string UniqueString => base.UniqueString + this.Width + this.InterpolationMode + this.Height + this.Mode; public override string ToString() { return "ImageResizeTransform"; diff --git a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageRotateFlipTransform.cs b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageRotateFlipTransform.cs index 67137c56be7..ba5d4cb2f0a 100644 --- a/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageRotateFlipTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/FilterTransform/ImageRotateFlipTransform.cs @@ -20,15 +20,15 @@ public class ImageRotateFlipTransform : ImageTransform /// /// Provides an Unique String for this transformation /// - public override string UniqueString => base.UniqueString + "-" + RotateFlip; + public override string UniqueString => base.UniqueString + "-" + this.RotateFlip; public ImageRotateFlipTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; - RotateFlip = RotateFlipType.RotateNoneFlipNone; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; + this.RotateFlip = RotateFlipType.RotateNoneFlipNone; } /// @@ -40,7 +40,7 @@ public override Image ProcessImage(Image image) { var temp = (Bitmap)image; var bmap = (Bitmap)temp.Clone(); - bmap.RotateFlip(RotateFlip); + bmap.RotateFlip(this.RotateFlip); return (Bitmap)bmap.Clone(); } } diff --git a/DNN Platform/Library/Services/GeneratedImage/GeneratedImage.cs b/DNN Platform/Library/Services/GeneratedImage/GeneratedImage.cs index 00e71303368..e05eb5bee96 100644 --- a/DNN Platform/Library/Services/GeneratedImage/GeneratedImage.cs +++ b/DNN Platform/Library/Services/GeneratedImage/GeneratedImage.cs @@ -23,11 +23,11 @@ public string ImageHandlerUrl { get { - return _imageHandlerUrl ?? string.Empty; + return this._imageHandlerUrl ?? string.Empty; } set { - _imageHandlerUrl = value; + this._imageHandlerUrl = value; } } @@ -35,37 +35,37 @@ public string Timestamp { get { - return _timestamp ?? string.Empty; + return this._timestamp ?? string.Empty; } set { - _timestamp = value; + this._timestamp = value; } } public List Parameters { get; } - private new HttpContextBase Context => _context ?? new HttpContextWrapper(HttpContext.Current); + private new HttpContextBase Context => this._context ?? new HttpContextWrapper(HttpContext.Current); - private new Control BindingContainer => _bindingContainer ?? base.BindingContainer; + private new Control BindingContainer => this._bindingContainer ?? base.BindingContainer; public GeneratedImage() { - Parameters = new List(); + this.Parameters = new List(); } internal GeneratedImage(HttpContextBase context, Control bindingContainer) : this() { - _context = context; - _bindingContainer = bindingContainer; + this._context = context; + this._bindingContainer = bindingContainer; } protected override void OnDataBinding(EventArgs e) { base.OnDataBinding(e); - Control bindingContainer = BindingContainer; - foreach (var parameter in Parameters) + Control bindingContainer = this.BindingContainer; + foreach (var parameter in this.Parameters) { parameter.BindingContainer = bindingContainer; parameter.DataBind(); @@ -76,28 +76,28 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (DesignMode) + if (this.DesignMode) { return; } - ImageUrl = BuildImageUrl(); + this.ImageUrl = this.BuildImageUrl(); } private string BuildImageUrl() { var stringBuilder = new StringBuilder(); - stringBuilder.Append(ImageHandlerUrl); + stringBuilder.Append(this.ImageHandlerUrl); var paramAlreadyAdded = false; - foreach (var parameter in Parameters) + foreach (var parameter in this.Parameters) { AddQueryStringParameter(stringBuilder, paramAlreadyAdded, parameter.Name, parameter.Value); paramAlreadyAdded = true; } - string timeStamp = Timestamp?.Trim(); + string timeStamp = this.Timestamp?.Trim(); if (!string.IsNullOrEmpty(timeStamp)) { AddQueryStringParameter(stringBuilder, paramAlreadyAdded, TimestampField, timeStamp); diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageHandler.cs b/DNN Platform/Library/Services/GeneratedImage/ImageHandler.cs index 689b41cb218..e0a761850d6 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageHandler.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageHandler.cs @@ -23,8 +23,8 @@ public abstract class ImageHandler : IHttpHandler /// public bool EnableServerCache { - get { return Implementation.EnableServerCache; } - set { Implementation.EnableServerCache = value; } + get { return this.Implementation.EnableServerCache; } + set { this.Implementation.EnableServerCache = value; } } /// @@ -32,8 +32,8 @@ public bool EnableServerCache /// public bool EnableClientCache { - get { return Implementation.EnableClientCache; } - set { Implementation.EnableClientCache = value; } + get { return this.Implementation.EnableClientCache; } + set { this.Implementation.EnableClientCache = value; } } /// @@ -41,8 +41,8 @@ public bool EnableClientCache /// public TimeSpan ClientCacheExpiration { - get { return Implementation.ClientCacheExpiration; } - set { Implementation.ClientCacheExpiration = value; } + get { return this.Implementation.ClientCacheExpiration; } + set { this.Implementation.ClientCacheExpiration = value; } } /// @@ -50,20 +50,20 @@ public TimeSpan ClientCacheExpiration /// public string[] AllowedDomains { - get { return Implementation.AllowedDomains; } - set { Implementation.AllowedDomains = value; } + get { return this.Implementation.AllowedDomains; } + set { this.Implementation.AllowedDomains = value; } } public bool AllowStandalone { - get { return Implementation.AllowStandalone; } - set { Implementation.AllowStandalone = value; } + get { return this.Implementation.AllowStandalone; } + set { this.Implementation.AllowStandalone = value; } } public bool LogSecurity { - get { return Implementation.LogSecurity; } - set { Implementation.LogSecurity = value; } + get { return this.Implementation.LogSecurity; } + set { this.Implementation.LogSecurity = value; } } /// @@ -71,8 +71,8 @@ public bool LogSecurity /// public ImageFormat ContentType { - get { return Implementation.ContentType; } - set { Implementation.ContentType = value; } + get { return this.Implementation.ContentType; } + set { this.Implementation.ContentType = value; } } /// @@ -80,8 +80,8 @@ public ImageFormat ContentType /// public long ImageCompression { - get { return Implementation.ImageCompression; } - set { Implementation.ImageCompression = value; } + get { return this.Implementation.ImageCompression; } + set { this.Implementation.ImageCompression = value; } } /// @@ -89,8 +89,8 @@ public long ImageCompression /// public bool EnableIPCount { - get { return Implementation.EnableIPCount; } - set { Implementation.EnableIPCount = value; } + get { return this.Implementation.EnableIPCount; } + set { this.Implementation.EnableIPCount = value; } } /// @@ -99,8 +99,8 @@ public bool EnableIPCount /// public int IPCountMaxCount { - get { return Implementation.IPCountMax; } - set { Implementation.IPCountMax = value; } + get { return this.Implementation.IPCountMax; } + set { this.Implementation.IPCountMax = value; } } /// @@ -108,14 +108,14 @@ public int IPCountMaxCount /// public TimeSpan IPCountPurgeInterval { - get { return Implementation.IpCountPurgeInterval; } - set { Implementation.IpCountPurgeInterval = value; } + get { return this.Implementation.IpCountPurgeInterval; } + set { this.Implementation.IpCountPurgeInterval = value; } } /// /// A list of image transforms that will be applied successively to the image /// - protected List ImageTransforms => Implementation.ImageTransforms; + protected List ImageTransforms => this.Implementation.ImageTransforms; protected ImageHandler() : this(new ImageHandlerInternal()) @@ -124,7 +124,7 @@ protected ImageHandler() private ImageHandler(ImageHandlerInternal implementation) { - Implementation = implementation; + this.Implementation = implementation; } internal ImageHandler(IImageStore imageStore, DateTime now) @@ -143,13 +143,13 @@ public void ProcessRequest(HttpContext context) throw new ArgumentNullException(nameof(context)); } HttpContextBase contextWrapper = new HttpContextWrapper(context); - ProcessRequest(contextWrapper); + this.ProcessRequest(contextWrapper); } internal void ProcessRequest(HttpContextBase context) { Debug.Assert(context != null); - Implementation.HandleImageRequest(context, GenerateImage, ToString()); + this.Implementation.HandleImageRequest(context, this.GenerateImage, this.ToString()); } } } diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageHandlerInternal.cs b/DNN Platform/Library/Services/GeneratedImage/ImageHandlerInternal.cs index f102afdedd4..55a91b60ff5 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageHandlerInternal.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageHandlerInternal.cs @@ -35,7 +35,7 @@ public TimeSpan ClientCacheExpiration { get { - return _clientCacheExpiration; + return this._clientCacheExpiration; } set { @@ -43,8 +43,8 @@ public TimeSpan ClientCacheExpiration { throw new ArgumentOutOfRangeException(nameof(value), "ClientCacheExpiration must be positive"); } - _clientCacheExpiration = value; - EnableClientCache = true; + this._clientCacheExpiration = value; + this.EnableClientCache = true; } } @@ -56,7 +56,7 @@ private DateTime DateTime_Now { get { - return _now ?? DateTime.Now; + return this._now ?? DateTime.Now; } } @@ -64,7 +64,7 @@ private IImageStore ImageStore { get { - return _imageStore ?? DiskImageStore.Instance; + return this._imageStore ?? DiskImageStore.Instance; } } @@ -100,17 +100,17 @@ public List ImageTransforms public ImageHandlerInternal() { - ContentType = ImageFormat.Jpeg; - ImageCompression = 95; - ImageTransforms = new List(); - AllowStandalone = false; + this.ContentType = ImageFormat.Jpeg; + this.ImageCompression = 95; + this.ImageTransforms = new List(); + this.AllowStandalone = false; } internal ImageHandlerInternal(IImageStore imageStore, DateTime now) : this() { - _imageStore = imageStore; - _now = now; + this._imageStore = imageStore; + this._now = now; } internal static string GetImageMimeType(ImageFormat format) @@ -152,10 +152,10 @@ public void HandleImageRequest(HttpContextBase context, Func DateTime_Now && etag == cacheId) + if (lastMod + this.ClientCacheExpiration > this.DateTime_Now && etag == cacheId) { context.Response.StatusCode = 304; context.Response.StatusDescription = "Not Modified"; @@ -265,15 +265,15 @@ public void HandleImageRequest(HttpContextBase context, Func userIds; if ((userIds = DataCache.GetCache>(cacheKey)) == null || !userIds.ContainsKey(userId)) return false; - ImageStore.ForcePurgeFromServerCache(cacheId); + this.ImageStore.ForcePurgeFromServerCache(cacheId); DateTime expiry; //The clear mechanism is performed for ClientCacheExpiration timespan so that all active clients clears the cache and don't see old data. - if (!userIds.TryGetValue(userId, out expiry) || DateTime.UtcNow <= expiry.Add(ClientCacheExpiration)) return true; + if (!userIds.TryGetValue(userId, out expiry) || DateTime.UtcNow <= expiry.Add(this.ClientCacheExpiration)) return true; //Remove the userId from the clear list when timespan is > ClientCacheExpiration. userIds.Remove(userId); DataCache.SetCache(cacheKey, userIds); @@ -408,7 +408,7 @@ private Image GetImageThroughTransforms(byte[] buffer) { using (var memoryStream = new MemoryStream(buffer)) { - return GetImageThroughTransforms(Image.FromStream(memoryStream)); + return this.GetImageThroughTransforms(Image.FromStream(memoryStream)); } } @@ -416,7 +416,7 @@ private void RenderImage(Image image, Stream outStream) { try { - if (ContentType == ImageFormat.Gif) + if (this.ContentType == ImageFormat.Gif) { var quantizer = new OctreeQuantizer(255, 8); using (var quantized = quantizer.Quantize(image)) @@ -428,9 +428,9 @@ private void RenderImage(Image image, Stream outStream) { var eps = new EncoderParameters(1) { - Param = { [0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, ImageCompression) } + Param = { [0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, this.ImageCompression) } }; - var ici = GetEncoderInfo(GetImageMimeType(ContentType)); + var ici = GetEncoderInfo(GetImageMimeType(this.ContentType)); image?.Save(outStream, ici, eps); } } diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageInfo.cs b/DNN Platform/Library/Services/GeneratedImage/ImageInfo.cs index 2359f703202..8caa8fdafcd 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageInfo.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageInfo.cs @@ -32,7 +32,7 @@ public class ImageInfo public ImageInfo(HttpStatusCode statusCode) { - HttpStatusCode = statusCode; + this.HttpStatusCode = statusCode; } public ImageInfo(Image image) @@ -41,7 +41,7 @@ public ImageInfo(Image image) { throw new ArgumentNullException(nameof(image)); } - Image = image; + this.Image = image; } public ImageInfo(byte[] imageBuffer) @@ -50,7 +50,7 @@ public ImageInfo(byte[] imageBuffer) { throw new ArgumentNullException(nameof(imageBuffer)); } - ImageByteBuffer = imageBuffer; + this.ImageByteBuffer = imageBuffer; } } } diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageParameter.cs b/DNN Platform/Library/Services/GeneratedImage/ImageParameter.cs index 0ab458e1838..951efcb99da 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageParameter.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageParameter.cs @@ -22,28 +22,28 @@ public class ImageParameter : IDataBindingsAccessor internal void DataBind() { - if (DataBinding != null) + if (this.DataBinding != null) { - DataBinding(this, EventArgs.Empty); + this.DataBinding(this, EventArgs.Empty); } } public override string ToString() { - if (string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(Value)) + if (string.IsNullOrEmpty(this.Name) && string.IsNullOrEmpty(this.Value)) { return base.ToString(); } - return string.Format(CultureInfo.InvariantCulture, "{0} = {1}", Name, Value); + return string.Format(CultureInfo.InvariantCulture, "{0} = {1}", this.Name, this.Value); } public Control BindingContainer { get; internal set; } #region IDataBindingsAccessor Members - DataBindingCollection IDataBindingsAccessor.DataBindings => _dataBindings; + DataBindingCollection IDataBindingsAccessor.DataBindings => this._dataBindings; - bool IDataBindingsAccessor.HasDataBindings => _dataBindings.Count != 0; + bool IDataBindingsAccessor.HasDataBindings => this._dataBindings.Count != 0; #endregion } diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/GrayscaleQuantizer.cs b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/GrayscaleQuantizer.cs index a50b07c6082..aee3c1f75ef 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/GrayscaleQuantizer.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/GrayscaleQuantizer.cs @@ -22,7 +22,7 @@ public class GrayscaleQuantizer : PaletteQuantizer /// public GrayscaleQuantizer () : base( new ArrayList() ) { - _colors = new Color[256]; + this._colors = new Color[256]; int nColors = 256; @@ -42,7 +42,7 @@ public class GrayscaleQuantizer : PaletteQuantizer // Otherwise, use your favorite color reduction algorithm // and an optimum palette for that algorithm generated here. // For example, a color histogram, or a median cut palette. - _colors[i] = Color.FromArgb( (int)Alpha, + this._colors[i] = Color.FromArgb( (int)Alpha, (int)intensity, (int)intensity, (int)intensity ); diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/OctreeQuantizer.cs b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/OctreeQuantizer.cs index b141d6c3ddf..d21ef9e6895 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/OctreeQuantizer.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/OctreeQuantizer.cs @@ -32,8 +32,8 @@ public OctreeQuantizer ( int maxColors , int maxColorBits ) : base ( false ) throw new ArgumentOutOfRangeException ( nameof(maxColorBits) , maxColorBits , "This should be between 1 and 8" ) ; // Construct the octree - _octree = new Octree ( maxColorBits ) ; - _maxColors = maxColors ; + this._octree = new Octree ( maxColorBits ) ; + this._maxColors = maxColors ; } /// @@ -47,7 +47,7 @@ public OctreeQuantizer ( int maxColors , int maxColorBits ) : base ( false ) protected override void InitialQuantizePixel ( Color32 pixel ) { // Add the color to the octree - _octree.AddColor ( pixel ) ; + this._octree.AddColor ( pixel ) ; } /// @@ -57,13 +57,13 @@ protected override void InitialQuantizePixel ( Color32 pixel ) /// The quantized value protected override byte QuantizePixel ( Color32 pixel ) { - byte paletteIndex = (byte)_maxColors ; // The color at [_maxColors] is set to transparent + byte paletteIndex = (byte)this._maxColors ; // The color at [_maxColors] is set to transparent // Get the palette index if this non-transparent if ( pixel.Alpha > 0 ) - paletteIndex = (byte)_octree.GetPaletteIndex ( pixel ) ; + paletteIndex = (byte)this._octree.GetPaletteIndex ( pixel ) ; return paletteIndex ; } @@ -76,14 +76,14 @@ protected override byte QuantizePixel ( Color32 pixel ) protected override ColorPalette GetPalette ( ColorPalette original ) { // First off convert the octree to _maxColors colors - ArrayList palette = _octree.Palletize ( _maxColors - 1 ) ; + ArrayList palette = this._octree.Palletize ( this._maxColors - 1 ) ; // Then convert the palette based on those colors for ( int index = 0 ; index < palette.Count ; index++ ) original.Entries[index] = (Color)palette[index] ; // Add the transparent color - original.Entries[_maxColors] = Color.FromArgb ( 0 , 0 , 0 , 0 ) ; + original.Entries[this._maxColors] = Color.FromArgb ( 0 , 0 , 0 , 0 ) ; return original ; } @@ -109,12 +109,12 @@ private class Octree /// The maximum number of significant bits in the image public Octree ( int maxColorBits ) { - _maxColorBits = maxColorBits ; - _leafCount = 0 ; - _reducibleNodes = new OctreeNode[9] ; - _root = new OctreeNode ( 0 , _maxColorBits , this ) ; - _previousColor = 0 ; - _previousNode = null ; + this._maxColorBits = maxColorBits ; + this._leafCount = 0 ; + this._reducibleNodes = new OctreeNode[9] ; + this._root = new OctreeNode ( 0 , this._maxColorBits , this ) ; + this._previousColor = 0 ; + this._previousNode = null ; } /// @@ -124,23 +124,23 @@ public Octree ( int maxColorBits ) public void AddColor ( Color32 pixel ) { // Check if this request is for the same color as the last - if ( _previousColor == pixel.ARGB ) + if ( this._previousColor == pixel.ARGB ) { // If so, check if I have a previous node setup. This will only ocurr if the first color in the image // happens to be black, with an alpha component of zero. - if ( null == _previousNode ) + if ( null == this._previousNode ) { - _previousColor = pixel.ARGB ; - _root.AddColor ( pixel , _maxColorBits , 0 , this ) ; + this._previousColor = pixel.ARGB ; + this._root.AddColor ( pixel , this._maxColorBits , 0 , this ) ; } else // Just update the previous node - _previousNode.Increment ( pixel ) ; + this._previousNode.Increment ( pixel ) ; } else { - _previousColor = pixel.ARGB ; - _root.AddColor ( pixel , _maxColorBits , 0 , this ) ; + this._previousColor = pixel.ARGB ; + this._root.AddColor ( pixel , this._maxColorBits , 0 , this ) ; } } @@ -152,19 +152,19 @@ public void Reduce() int index; // Find the deepest level containing at least one reducible node - for (index = _maxColorBits - 1; (index > 0) && (null == _reducibleNodes[index]); index--) ; + for (index = this._maxColorBits - 1; (index > 0) && (null == this._reducibleNodes[index]); index--) ; // Reduce the node most recently added to the list at level 'index' - OctreeNode node = _reducibleNodes[index]; - _reducibleNodes[index] = node.NextReducible; + OctreeNode node = this._reducibleNodes[index]; + this._reducibleNodes[index] = node.NextReducible; // Decrement the leaf count after reducing the node - _leafCount -= node.Reduce(); + this._leafCount -= node.Reduce(); // And just in case I've reduced the last color to be added, and the next color to // be added is the same, invalidate the previousNode... - _previousNode = null; + this._previousNode = null; } /// @@ -172,8 +172,8 @@ public void Reduce() /// public int Leaves { - get { return _leafCount ; } - set { _leafCount = value ; } + get { return this._leafCount ; } + set { this._leafCount = value ; } } /// @@ -181,7 +181,7 @@ public int Leaves /// protected OctreeNode[] ReducibleNodes { - get { return _reducibleNodes ; } + get { return this._reducibleNodes ; } } /// @@ -190,7 +190,7 @@ protected OctreeNode[] ReducibleNodes /// The node last quantized protected void TrackPrevious ( OctreeNode node ) { - _previousNode = node ; + this._previousNode = node ; } /// @@ -200,13 +200,13 @@ protected void TrackPrevious ( OctreeNode node ) /// An arraylist with the palettized colors public ArrayList Palletize ( int colorCount ) { - while ( Leaves > colorCount ) - Reduce ( ) ; + while ( this.Leaves > colorCount ) + this.Reduce ( ) ; // Now palettize the nodes - ArrayList palette = new ArrayList ( Leaves ) ; + ArrayList palette = new ArrayList ( this.Leaves ) ; int paletteIndex = 0 ; - _root.ConstructPalette ( palette , ref paletteIndex ) ; + this._root.ConstructPalette ( palette , ref paletteIndex ) ; // And return the palette return palette ; @@ -219,7 +219,7 @@ public ArrayList Palletize ( int colorCount ) /// public int GetPaletteIndex ( Color32 pixel ) { - return _root.GetPaletteIndex ( pixel , 0 ) ; + return this._root.GetPaletteIndex ( pixel , 0 ) ; } /// @@ -271,24 +271,24 @@ protected class OctreeNode public OctreeNode ( int level , int colorBits , Octree octree ) { // Construct the new node - _leaf = ( level == colorBits ) ; + this._leaf = ( level == colorBits ) ; - _red = _green = _blue = 0 ; - _pixelCount = 0 ; + this._red = this._green = this._blue = 0 ; + this._pixelCount = 0 ; // If a leaf, increment the leaf count - if ( _leaf ) + if ( this._leaf ) { octree.Leaves++ ; - _nextReducible = null ; - _children = null ; + this._nextReducible = null ; + this._children = null ; } else { // Otherwise add this to the reducible nodes - _nextReducible = octree.ReducibleNodes[level] ; + this._nextReducible = octree.ReducibleNodes[level] ; octree.ReducibleNodes[level] = this ; - _children = new OctreeNode[8] ; + this._children = new OctreeNode[8] ; } } @@ -302,9 +302,9 @@ public OctreeNode ( int level , int colorBits , Octree octree ) public void AddColor ( Color32 pixel , int colorBits , int level , Octree octree ) { // Update the color information if this is a leaf - if ( _leaf ) + if ( this._leaf ) { - Increment ( pixel ) ; + this.Increment ( pixel ) ; // Setup the previous node octree.TrackPrevious ( this ) ; } @@ -316,13 +316,13 @@ public void AddColor ( Color32 pixel , int colorBits , int level , Octree octree ( ( pixel.Green & mask[level] ) >> ( shift - 1 ) ) | ( ( pixel.Blue & mask[level] ) >> ( shift ) ) ; - OctreeNode child = _children[index] ; + OctreeNode child = this._children[index] ; if ( null == child ) { // Create a new child node & store in the array child = new OctreeNode ( level + 1 , colorBits , octree ) ; - _children[index] = child ; + this._children[index] = child ; } // Add the color to the child node @@ -336,8 +336,8 @@ public void AddColor ( Color32 pixel , int colorBits , int level , Octree octree /// public OctreeNode NextReducible { - get { return _nextReducible ; } - set { _nextReducible = value ; } + get { return this._nextReducible ; } + set { this._nextReducible = value ; } } /// @@ -345,7 +345,7 @@ public OctreeNode NextReducible /// public OctreeNode[] Children { - get { return _children ; } + get { return this._children ; } } /// @@ -354,25 +354,25 @@ public OctreeNode[] Children /// The number of leaves removed public int Reduce ( ) { - _red = _green = _blue = 0 ; + this._red = this._green = this._blue = 0 ; int children = 0 ; // Loop through all children and add their information to this node for ( int index = 0 ; index < 8 ; index++ ) { - if ( null != _children[index] ) + if ( null != this._children[index] ) { - _red += _children[index]._red ; - _green += _children[index]._green ; - _blue += _children[index]._blue ; - _pixelCount += _children[index]._pixelCount ; + this._red += this._children[index]._red ; + this._green += this._children[index]._green ; + this._blue += this._children[index]._blue ; + this._pixelCount += this._children[index]._pixelCount ; ++children ; - _children[index] = null ; + this._children[index] = null ; } } // Now change this to a leaf node - _leaf = true ; + this._leaf = true ; // Return the number of nodes to decrement the leaf count by return ( children - 1 ) ; @@ -385,21 +385,21 @@ public int Reduce ( ) /// The current palette index public void ConstructPalette ( ArrayList palette , ref int paletteIndex ) { - if ( _leaf ) + if ( this._leaf ) { // Consume the next palette index - _paletteIndex = paletteIndex++ ; + this._paletteIndex = paletteIndex++ ; // And set the color of the palette entry - palette.Add ( Color.FromArgb ( _red / _pixelCount , _green / _pixelCount , _blue / _pixelCount ) ) ; + palette.Add ( Color.FromArgb ( this._red / this._pixelCount , this._green / this._pixelCount , this._blue / this._pixelCount ) ) ; } else { // Loop through children looking for leaves for ( int index = 0 ; index < 8 ; index++ ) { - if ( null != _children[index] ) - _children[index].ConstructPalette ( palette , ref paletteIndex ) ; + if ( null != this._children[index] ) + this._children[index].ConstructPalette ( palette , ref paletteIndex ) ; } } } @@ -409,17 +409,17 @@ public void ConstructPalette ( ArrayList palette , ref int paletteIndex ) /// public int GetPaletteIndex ( Color32 pixel , int level ) { - int paletteIndex = _paletteIndex ; + int paletteIndex = this._paletteIndex ; - if ( !_leaf ) + if ( !this._leaf ) { int shift = 7 - level ; int index = ( ( pixel.Red & mask[level] ) >> ( shift - 2 ) ) | ( ( pixel.Green & mask[level] ) >> ( shift - 1 ) ) | ( ( pixel.Blue & mask[level] ) >> ( shift ) ) ; - if ( null != _children[index] ) - paletteIndex = _children[index].GetPaletteIndex ( pixel , level + 1 ) ; + if ( null != this._children[index] ) + paletteIndex = this._children[index].GetPaletteIndex ( pixel , level + 1 ) ; else throw new Exception ( "Didn't expect this!" ) ; } @@ -432,10 +432,10 @@ public int GetPaletteIndex ( Color32 pixel , int level ) /// public void Increment ( Color32 pixel ) { - _pixelCount++ ; - _red += pixel.Red ; - _green += pixel.Green ; - _blue += pixel.Blue ; + this._pixelCount++ ; + this._red += pixel.Red ; + this._green += pixel.Green ; + this._blue += pixel.Blue ; } /// diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/PaletteQuantizer.cs b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/PaletteQuantizer.cs index fdf3accbdbd..f9c138bf9b0 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/PaletteQuantizer.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/PaletteQuantizer.cs @@ -24,10 +24,10 @@ public class PaletteQuantizer : Quantizer /// public PaletteQuantizer ( ArrayList palette ) : base ( true ) { - _colorMap = new Hashtable ( ) ; + this._colorMap = new Hashtable ( ) ; - _colors = new Color[palette.Count] ; - palette.CopyTo ( _colors ) ; + this._colors = new Color[palette.Count] ; + palette.CopyTo ( this._colors ) ; } /// @@ -41,8 +41,8 @@ protected override byte QuantizePixel ( Color32 pixel ) int colorHash = pixel.ARGB ; // Check if the color is in the lookup table - if ( _colorMap.ContainsKey ( colorHash ) ) - colorIndex = (byte)_colorMap[colorHash] ; + if ( this._colorMap.ContainsKey ( colorHash ) ) + colorIndex = (byte)this._colorMap[colorHash] ; else { // Not found - loop through the palette and find the nearest match. @@ -50,9 +50,9 @@ protected override byte QuantizePixel ( Color32 pixel ) if ( 0 == pixel.Alpha ) { // Transparent. Lookup the first color with an alpha value of 0 - for ( int index = 0 ; index < _colors.Length ; index++ ) + for ( int index = 0 ; index < this._colors.Length ; index++ ) { - if ( 0 == _colors[index].A ) + if ( 0 == this._colors[index].A ) { colorIndex = (byte)index ; break ; @@ -68,9 +68,9 @@ protected override byte QuantizePixel ( Color32 pixel ) int blue = pixel.Blue; // Loop through the entire palette, looking for the closest color match - for ( int index = 0 ; index < _colors.Length ; index++ ) + for ( int index = 0 ; index < this._colors.Length ; index++ ) { - Color paletteColor = _colors[index]; + Color paletteColor = this._colors[index]; int redDistance = paletteColor.R - red ; int greenDistance = paletteColor.G - green ; @@ -93,7 +93,7 @@ protected override byte QuantizePixel ( Color32 pixel ) } // Now I have the color, pop it into the hashtable for next time - _colorMap.Add ( colorHash , colorIndex ) ; + this._colorMap.Add ( colorHash , colorIndex ) ; } return colorIndex ; @@ -106,8 +106,8 @@ protected override byte QuantizePixel ( Color32 pixel ) /// The new color palette protected override ColorPalette GetPalette ( ColorPalette palette ) { - for ( int index = 0 ; index < _colors.Length ; index++ ) - palette.Entries[index] = _colors[index] ; + for ( int index = 0 ; index < this._colors.Length ; index++ ) + palette.Entries[index] = this._colors[index] ; return palette ; } diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/Quantizer.cs b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/Quantizer.cs index 24c052c167e..064d25b220c 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/Quantizer.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageQuantization/Quantizer.cs @@ -25,8 +25,8 @@ public abstract class Quantizer /// public Quantizer(bool singlePass) { - _singlePass = singlePass; - _pixelSize = Marshal.SizeOf(typeof (Color32)); + this._singlePass = singlePass; + this._pixelSize = Marshal.SizeOf(typeof (Color32)); } /// @@ -73,16 +73,16 @@ public Bitmap Quantize(Image source) // Call the FirstPass function if not a single pass algorithm. // For something like an octree quantizer, this will run through // all image pixels, build a data structure, and create a palette. - if (!_singlePass) - FirstPass(sourceData, width, height); + if (!this._singlePass) + this.FirstPass(sourceData, width, height); // Then set the color palette on the output bitmap. I'm passing in the current palette // as there's no way to construct a new, empty palette. - output.Palette = GetPalette(output.Palette); + output.Palette = this.GetPalette(output.Palette); // Then call the second pass which actually does the conversion - SecondPass(sourceData, output, width, height, bounds); + this.SecondPass(sourceData, output, width, height, bounds); } finally { @@ -115,8 +115,8 @@ protected virtual void FirstPass(BitmapData sourceData, int width, int height) // And loop through each column for (int col = 0; col < width; col++) { - InitialQuantizePixel(new Color32(pSourcePixel)); - pSourcePixel = (IntPtr)((Int64)pSourcePixel + _pixelSize); + this.InitialQuantizePixel(new Color32(pSourcePixel)); + pSourcePixel = (IntPtr)((Int64)pSourcePixel + this._pixelSize); } // Now I have the pixel, call the FirstPassQuantize function... // Add the stride to the source row @@ -153,7 +153,7 @@ protected virtual void SecondPass(BitmapData sourceData, Bitmap output, int widt // And convert the first pixel, so that I have values going into the loop - byte pixelValue = QuantizePixel(new Color32(pSourcePixel)); + byte pixelValue = this.QuantizePixel(new Color32(pSourcePixel)); // Assign the value of the first pixel Marshal.WriteByte(pDestinationPixel, pixelValue); @@ -175,7 +175,7 @@ protected virtual void SecondPass(BitmapData sourceData, Bitmap output, int widt if (Marshal.ReadByte(pPreviousPixel) != Marshal.ReadByte(pSourcePixel)) { // Quantize the pixel - pixelValue = QuantizePixel(new Color32(pSourcePixel)); + pixelValue = this.QuantizePixel(new Color32(pSourcePixel)); // And setup the previous pointer pPreviousPixel = pSourcePixel; @@ -184,7 +184,7 @@ protected virtual void SecondPass(BitmapData sourceData, Bitmap output, int widt // And set the pixel in the output Marshal.WriteByte(pDestinationPixel, pixelValue); - pSourcePixel = (IntPtr)((long)pSourcePixel + _pixelSize); + pSourcePixel = (IntPtr)((long)pSourcePixel + this._pixelSize); pDestinationPixel = (IntPtr)((long)pDestinationPixel + 1); } @@ -285,7 +285,7 @@ public Color32(IntPtr pSourcePixel) /// public Color Color { - get { return Color.FromArgb(Alpha, Red, Green, Blue); } + get { return Color.FromArgb(this.Alpha, this.Red, this.Green, this.Blue); } } } } diff --git a/DNN Platform/Library/Services/GeneratedImage/ImageTransform.cs b/DNN Platform/Library/Services/GeneratedImage/ImageTransform.cs index 57bda08ef9e..014c54c21cc 100644 --- a/DNN Platform/Library/Services/GeneratedImage/ImageTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/ImageTransform.cs @@ -45,7 +45,7 @@ public abstract class ImageTransform /// /// Provides an Unique String for the image transformation /// - public virtual string UniqueString => GetType().FullName; + public virtual string UniqueString => this.GetType().FullName; /// /// Creates a new image from stream. The created image is independent of the stream. @@ -60,9 +60,9 @@ public virtual Bitmap CopyImage(Stream imgStream) using (var graph = Graphics.FromImage(destImage)) { graph.CompositingMode = CompositingMode.SourceCopy; - graph.CompositingQuality = CompositingQuality; - graph.InterpolationMode = InterpolationMode; - graph.SmoothingMode = SmoothingMode; + graph.CompositingQuality = this.CompositingQuality; + graph.InterpolationMode = this.InterpolationMode; + graph.SmoothingMode = this.SmoothingMode; graph.DrawImage(srcImage, new Rectangle(0, 0, srcImage.Width, srcImage.Height)); } return destImage; diff --git a/DNN Platform/Library/Services/GeneratedImage/StartTransform/ImageFileTransform.cs b/DNN Platform/Library/Services/GeneratedImage/StartTransform/ImageFileTransform.cs index b069bde9e94..52da0d40be9 100644 --- a/DNN Platform/Library/Services/GeneratedImage/StartTransform/ImageFileTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/StartTransform/ImageFileTransform.cs @@ -33,14 +33,14 @@ public class ImageFileTransform : ImageTransform /// /// Provides an Unique String for the image transformation /// - public override string UniqueString => base.UniqueString + "-" + ImageFilePath + ImageUrl; + public override string UniqueString => base.UniqueString + "-" + this.ImageFilePath + this.ImageUrl; public ImageFileTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; } /// @@ -51,30 +51,30 @@ public ImageFileTransform() /// Image result after file image transformation public override Image ProcessImage(Image image) { - return !string.IsNullOrEmpty(ImageUrl) ? - ProcessImageFromUrl() : - ProcessImageFilePath(); + return !string.IsNullOrEmpty(this.ImageUrl) ? + this.ProcessImageFromUrl() : + this.ProcessImageFilePath(); } private Image ProcessImageFilePath() { try { - using (var stream = new FileStream(ImageFilePath, FileMode.Open)) + using (var stream = new FileStream(this.ImageFilePath, FileMode.Open)) { - return CopyImage(stream); + return this.CopyImage(stream); } } catch (Exception ex) { Exceptions.Exceptions.LogException(ex); - return EmptyImage; + return this.EmptyImage; } } private Image ProcessImageFromUrl() { - var httpWebRequest = (HttpWebRequest) WebRequest.Create(ImageUrl); + var httpWebRequest = (HttpWebRequest) WebRequest.Create(this.ImageUrl); try { @@ -82,14 +82,14 @@ private Image ProcessImageFromUrl() { using (var stream = httpWebReponse.GetResponseStream()) { - return CopyImage(stream); + return this.CopyImage(stream); } } } catch (Exception ex) { Exceptions.Exceptions.LogException(ex); - return EmptyImage; + return this.EmptyImage; } } } diff --git a/DNN Platform/Library/Services/GeneratedImage/StartTransform/PlaceHolderTransform.cs b/DNN Platform/Library/Services/GeneratedImage/StartTransform/PlaceHolderTransform.cs index 4e28268bb46..72c8951eeb8 100644 --- a/DNN Platform/Library/Services/GeneratedImage/StartTransform/PlaceHolderTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/StartTransform/PlaceHolderTransform.cs @@ -41,19 +41,19 @@ public class PlaceholderTransform : ImageTransform /// /// Provides an Unique String for the image transformation /// - public override string UniqueString => base.UniqueString + Width + "-" + Height + "-" + Color + "-" + BackColor + "-" + Text; + public override string UniqueString => base.UniqueString + this.Width + "-" + this.Height + "-" + this.Color + "-" + this.BackColor + "-" + this.Text; public PlaceholderTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; - BackColor = Color.LightGray; - Color = Color.LightSlateGray; - Width = 0; - Height = 0; - Text = ""; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; + this.BackColor = Color.LightGray; + this.Color = Color.LightSlateGray; + this.Width = 0; + this.Height = 0; + this.Text = ""; } /// @@ -64,16 +64,16 @@ public PlaceholderTransform() public override Image ProcessImage(Image image) { // Check dimensions - if (Width == 0 && Height > 0) - Width = Height; - if (Width > 0 && Height == 0) - Height = Width; + if (this.Width == 0 && this.Height > 0) + this.Width = this.Height; + if (this.Width > 0 && this.Height == 0) + this.Height = this.Width; - var bitmap = new Bitmap(Width, Height); - Brush backColorBrush = new SolidBrush(BackColor); - Brush colorBrush = new SolidBrush(Color); - var colorPen = new Pen(Color,2); - var text = string.IsNullOrEmpty(Text) ? $"{Width}x{Height}" : Text; + var bitmap = new Bitmap(this.Width, this.Height); + Brush backColorBrush = new SolidBrush(this.BackColor); + Brush colorBrush = new SolidBrush(this.Color); + var colorPen = new Pen(this.Color,2); + var text = string.IsNullOrEmpty(this.Text) ? $"{this.Width}x{this.Height}" : this.Text; using (var objGraphics = Graphics.FromImage(bitmap)) { @@ -84,20 +84,20 @@ public override Image ProcessImage(Image image) // Fill bitmap with backcolor - objGraphics.FillRectangle(backColorBrush,0,0, Width,Height); + objGraphics.FillRectangle(backColorBrush,0,0, this.Width,this.Height); // Draw border - objGraphics.DrawRectangle(colorPen,1,1,Width-3,Height-3); + objGraphics.DrawRectangle(colorPen,1,1,this.Width-3,this.Height-3); // Determine fontsize var fontSize = 13; - if (Width < 101) + if (this.Width < 101) fontSize = 8; - else if (Width < 151) + else if (this.Width < 151) fontSize = 10; - else if (Width < 201) + else if (this.Width < 201) fontSize = 12; - else if (Width < 301) + else if (this.Width < 301) fontSize = 14; else fontSize = 24; @@ -111,7 +111,7 @@ public override Image ProcessImage(Image image) LineAlignment = StringAlignment.Center }; - var rectangle = new Rectangle(5, 5, Width - 10, Height - 10); + var rectangle = new Rectangle(5, 5, this.Width - 10, this.Height - 10); objGraphics.DrawString(text, font, colorBrush, rectangle, stringFormat); // Save indicator to file diff --git a/DNN Platform/Library/Services/GeneratedImage/StartTransform/SecureFileTransform.cs b/DNN Platform/Library/Services/GeneratedImage/StartTransform/SecureFileTransform.cs index d700fcff0d4..76e71cff214 100644 --- a/DNN Platform/Library/Services/GeneratedImage/StartTransform/SecureFileTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/StartTransform/SecureFileTransform.cs @@ -32,15 +32,15 @@ public class SecureFileTransform : ImageTransform /// /// Provides an Unique String for the image transformation /// - public override string UniqueString => base.UniqueString + SecureFile.FileId; + public override string UniqueString => base.UniqueString + this.SecureFile.FileId; #endregion public SecureFileTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; } /// @@ -54,14 +54,14 @@ public SecureFileTransform() public override Image ProcessImage(Image image) { // if SecureFile is no ImageFile return FileType-Image instead - if (!IsImageExtension(SecureFile.Extension)) + if (!IsImageExtension(this.SecureFile.Extension)) { - return GetSecureFileExtensionIconImage(); + return this.GetSecureFileExtensionIconImage(); } - using (var content = FileManager.Instance.GetFileContent(SecureFile)) + using (var content = FileManager.Instance.GetFileContent(this.SecureFile)) { - return CopyImage(content); + return this.CopyImage(content); } } @@ -69,16 +69,16 @@ private Image GetSecureFileExtensionIconImage() { var extensionImageAbsolutePath = Globals.ApplicationMapPath + "\\" + PortalSettings.Current.DefaultIconLocation.Replace("/", "\\") + "\\" + - "Ext" + SecureFile.Extension + "_32x32_Standard.png"; + "Ext" + this.SecureFile.Extension + "_32x32_Standard.png"; if (!File.Exists(extensionImageAbsolutePath)) { - return EmptyImage; + return this.EmptyImage; } using (var stream = new FileStream(extensionImageAbsolutePath, FileMode.Open)) { - return CopyImage(stream); + return this.CopyImage(stream); } } diff --git a/DNN Platform/Library/Services/GeneratedImage/StartTransform/UserProfilePicTransform.cs b/DNN Platform/Library/Services/GeneratedImage/StartTransform/UserProfilePicTransform.cs index f96e59d89c8..522b974a45e 100644 --- a/DNN Platform/Library/Services/GeneratedImage/StartTransform/UserProfilePicTransform.cs +++ b/DNN Platform/Library/Services/GeneratedImage/StartTransform/UserProfilePicTransform.cs @@ -28,7 +28,7 @@ public class UserProfilePicTransform : ImageTransform /// /// Provides an Unique String for the image transformation /// - public override string UniqueString => base.UniqueString + UserID; + public override string UniqueString => base.UniqueString + this.UserID; /// /// Is reusable @@ -38,10 +38,10 @@ public class UserProfilePicTransform : ImageTransform public UserProfilePicTransform() { - InterpolationMode = InterpolationMode.HighQualityBicubic; - SmoothingMode = SmoothingMode.HighQuality; - PixelOffsetMode = PixelOffsetMode.HighQuality; - CompositingQuality = CompositingQuality.HighQuality; + this.InterpolationMode = InterpolationMode.HighQualityBicubic; + this.SmoothingMode = SmoothingMode.HighQuality; + this.PixelOffsetMode = PixelOffsetMode.HighQuality; + this.CompositingQuality = CompositingQuality.HighQuality; } /// @@ -53,19 +53,19 @@ public override Image ProcessImage(Image image) { IFileInfo photoFile; - if (TryGetPhotoFile(out photoFile)) + if (this.TryGetPhotoFile(out photoFile)) { if (!IsImageExtension(photoFile.Extension)) { - return GetNoAvatarImage(); + return this.GetNoAvatarImage(); } using (var content = FileManager.Instance.GetFileContent(photoFile)) { - return CopyImage(content); + return this.CopyImage(content); } } - return GetNoAvatarImage(); + return this.GetNoAvatarImage(); } /// @@ -77,7 +77,7 @@ public Bitmap GetNoAvatarImage() var avatarAbsolutePath = Globals.ApplicationMapPath + @"\images\no_avatar.gif"; using (var content = File.OpenRead(avatarAbsolutePath)) { - return CopyImage(content); + return this.CopyImage(content); } } @@ -91,7 +91,7 @@ public bool TryGetPhotoFile(out IFileInfo photoFile) photoFile = null; var settings = PortalController.Instance.GetCurrentPortalSettings(); - var targetUser = UserController.Instance.GetUser(settings.PortalId, UserID); + var targetUser = UserController.Instance.GetUser(settings.PortalId, this.UserID); if (targetUser == null) { return false; diff --git a/DNN Platform/Library/Services/ImprovementsProgram/BeaconService.cs b/DNN Platform/Library/Services/ImprovementsProgram/BeaconService.cs index d86bb62416f..b79fc12eb54 100644 --- a/DNN Platform/Library/Services/ImprovementsProgram/BeaconService.cs +++ b/DNN Platform/Library/Services/ImprovementsProgram/BeaconService.cs @@ -32,11 +32,11 @@ protected override Func GetFactory() public string GetBeaconEndpoint() { - if (string.IsNullOrEmpty(_beaconEndpoint)) + if (string.IsNullOrEmpty(this._beaconEndpoint)) { var ep = ConfigurationManager.AppSettings["ImprovementProgram.Endpoint"]; #if DEBUG - _beaconEndpoint = string.IsNullOrEmpty(ep) + this._beaconEndpoint = string.IsNullOrEmpty(ep) ? "https://dev.dnnapi.com/beacon" : ep; #else @@ -45,7 +45,7 @@ public string GetBeaconEndpoint() : ep; #endif } - return _beaconEndpoint; + return this._beaconEndpoint; } public bool IsBeaconEnabledForControlBar(UserInfo user) @@ -97,10 +97,10 @@ public string GetBeaconQuery(UserInfo user, string filePath = null) var qparams = new Dictionary { // Remember to URL ENCODE values that can be ambigious - {"h", HttpUtility.UrlEncode(GetHash(Host.GUID))}, - {"p", HttpUtility.UrlEncode(GetHash(portalSettings.GUID.ToString()))}, - {"a", HttpUtility.UrlEncode(GetHash(portalSettings.PortalAlias.HTTPAlias))}, - {"u", HttpUtility.UrlEncode(GetHash(uid))}, + {"h", HttpUtility.UrlEncode(this.GetHash(Host.GUID))}, + {"p", HttpUtility.UrlEncode(this.GetHash(portalSettings.GUID.ToString()))}, + {"a", HttpUtility.UrlEncode(this.GetHash(portalSettings.PortalAlias.HTTPAlias))}, + {"u", HttpUtility.UrlEncode(this.GetHash(uid))}, {"r", roles.ToString("D")}, }; @@ -111,16 +111,16 @@ public string GetBeaconQuery(UserInfo user, string filePath = null) string packageName = DotNetNukeContext.Current.Application.Name; string installVersion = Common.Globals.FormatVersion(DotNetNukeContext.Current.Application.Version, "00", 3, ""); if (!string.IsNullOrEmpty(packageName)) - qparams["n"] = HttpUtility.UrlEncode(GetHash(packageName)); + qparams["n"] = HttpUtility.UrlEncode(this.GetHash(packageName)); if (!string.IsNullOrEmpty(installVersion)) - qparams["v"] = HttpUtility.UrlEncode(GetHash(installVersion)); + qparams["v"] = HttpUtility.UrlEncode(this.GetHash(installVersion)); return "?" + string.Join("&", qparams.Select(kpv => kpv.Key + "=" + kpv.Value)); } public string GetBeaconUrl(UserInfo user, string filePath = null) { - return GetBeaconEndpoint() + GetBeaconQuery(user, filePath); + return this.GetBeaconEndpoint() + this.GetBeaconQuery(user, filePath); } private string GetHash(string data) diff --git a/DNN Platform/Library/Services/Installer/Blocker/InstallBlocker.cs b/DNN Platform/Library/Services/Installer/Blocker/InstallBlocker.cs index 5f4ef3188c2..5eca129c4e6 100644 --- a/DNN Platform/Library/Services/Installer/Blocker/InstallBlocker.cs +++ b/DNN Platform/Library/Services/Installer/Blocker/InstallBlocker.cs @@ -28,28 +28,28 @@ public class InstallBlocker : ServiceLocator, I public void RegisterInstallBegining() { - if(!fileCreated) + if(!this.fileCreated) File.Create(Globals.ApplicationMapPath + installBlockerFile); - fileCreated = true; + this.fileCreated = true; } public bool IsInstallInProgress() { - return fileCreated || File.Exists(Globals.ApplicationMapPath + installBlockerFile); + return this.fileCreated || File.Exists(Globals.ApplicationMapPath + installBlockerFile); } public void RegisterInstallEnd() { var retryable = new RetryableAction(() => { - if (IsInstallInProgress() && fileCreated) + if (this.IsInstallInProgress() && this.fileCreated) { File.Delete(Globals.ApplicationMapPath + installBlockerFile); } }, "Deleting lock file", 60, TimeSpan.FromSeconds(1)); retryable.TryIt(); - fileCreated = false; + this.fileCreated = false; } #endregion diff --git a/DNN Platform/Library/Services/Installer/Dependencies/CoreVersionDependency.cs b/DNN Platform/Library/Services/Installer/Dependencies/CoreVersionDependency.cs index 292c340da02..be5b0dd4c04 100644 --- a/DNN Platform/Library/Services/Installer/Dependencies/CoreVersionDependency.cs +++ b/DNN Platform/Library/Services/Installer/Dependencies/CoreVersionDependency.cs @@ -29,7 +29,7 @@ public override string ErrorMessage { get { - return string.Format(Util.INSTALL_Compatibility,minVersion); + return string.Format(Util.INSTALL_Compatibility,this.minVersion); } } @@ -38,7 +38,7 @@ public override bool IsValid get { bool _IsValid = true; - if (Assembly.GetExecutingAssembly().GetName().Version < minVersion) + if (Assembly.GetExecutingAssembly().GetName().Version < this.minVersion) { _IsValid = false; } @@ -48,7 +48,7 @@ public override bool IsValid public override void ReadManifest(XPathNavigator dependencyNav) { - minVersion = new Version(dependencyNav.Value); + this.minVersion = new Version(dependencyNav.Value); } } } diff --git a/DNN Platform/Library/Services/Installer/Dependencies/InvalidDependency.cs b/DNN Platform/Library/Services/Installer/Dependencies/InvalidDependency.cs index 43bf4ac877b..b34082cb691 100644 --- a/DNN Platform/Library/Services/Installer/Dependencies/InvalidDependency.cs +++ b/DNN Platform/Library/Services/Installer/Dependencies/InvalidDependency.cs @@ -22,14 +22,14 @@ public class InvalidDependency : DependencyBase /// The error message to display. public InvalidDependency(string ErrorMessage) { - _ErrorMessage = ErrorMessage; + this._ErrorMessage = ErrorMessage; } public override string ErrorMessage { get { - return _ErrorMessage; + return this._ErrorMessage; } } diff --git a/DNN Platform/Library/Services/Installer/Dependencies/ManagedPackageDependency.cs b/DNN Platform/Library/Services/Installer/Dependencies/ManagedPackageDependency.cs index 5fce1a51a11..7ce738336f5 100644 --- a/DNN Platform/Library/Services/Installer/Dependencies/ManagedPackageDependency.cs +++ b/DNN Platform/Library/Services/Installer/Dependencies/ManagedPackageDependency.cs @@ -17,7 +17,7 @@ public override string ErrorMessage { get { - return Util.INSTALL_Package + " - " + PackageDependency.PackageName; + return Util.INSTALL_Package + " - " + this.PackageDependency.PackageName; } } @@ -29,8 +29,8 @@ public override bool IsValid //Get Package from DataStore PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, - (p) => p.Name.Equals(PackageDependency.PackageName, StringComparison.OrdinalIgnoreCase) - && p.Version >= PackageDependency.Version); + (p) => p.Name.Equals(this.PackageDependency.PackageName, StringComparison.OrdinalIgnoreCase) + && p.Version >= this.PackageDependency.Version); if (package == null) { _IsValid = false; @@ -41,7 +41,7 @@ public override bool IsValid public override void ReadManifest(XPathNavigator dependencyNav) { - PackageDependency = new PackageDependencyInfo + this.PackageDependency = new PackageDependencyInfo { PackageName = dependencyNav.Value, Version = new Version(Util.ReadAttribute(dependencyNav, "version")) diff --git a/DNN Platform/Library/Services/Installer/Dependencies/PackageDependency.cs b/DNN Platform/Library/Services/Installer/Dependencies/PackageDependency.cs index c08156f8f83..4f855d0b0a2 100644 --- a/DNN Platform/Library/Services/Installer/Dependencies/PackageDependency.cs +++ b/DNN Platform/Library/Services/Installer/Dependencies/PackageDependency.cs @@ -30,7 +30,7 @@ public override string ErrorMessage { get { - return Util.INSTALL_Package + " - " + PackageName; + return Util.INSTALL_Package + " - " + this.PackageName; } } @@ -41,7 +41,7 @@ public override bool IsValid bool _IsValid = true; //Get Package from DataStore - PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, (p) => p.Name.Equals(PackageName, StringComparison.OrdinalIgnoreCase)); + PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, (p) => p.Name.Equals(this.PackageName, StringComparison.OrdinalIgnoreCase)); if (package == null) { _IsValid = false; @@ -52,7 +52,7 @@ public override bool IsValid public override void ReadManifest(XPathNavigator dependencyNav) { - PackageName = dependencyNav.Value; + this.PackageName = dependencyNav.Value; } } } diff --git a/DNN Platform/Library/Services/Installer/Dependencies/PermissionsDependency.cs b/DNN Platform/Library/Services/Installer/Dependencies/PermissionsDependency.cs index e2f19df7e85..db593b082ca 100644 --- a/DNN Platform/Library/Services/Installer/Dependencies/PermissionsDependency.cs +++ b/DNN Platform/Library/Services/Installer/Dependencies/PermissionsDependency.cs @@ -30,7 +30,7 @@ public override string ErrorMessage { get { - return Util.INSTALL_Permissions + " - " + Localization.Localization.GetString(Permission, Localization.Localization.GlobalResourceFile); + return Util.INSTALL_Permissions + " - " + Localization.Localization.GetString(this.Permission, Localization.Localization.GlobalResourceFile); } } @@ -38,13 +38,13 @@ public override bool IsValid { get { - return SecurityPolicy.HasPermissions(Permissions, ref Permission); + return SecurityPolicy.HasPermissions(this.Permissions, ref this.Permission); } } public override void ReadManifest(XPathNavigator dependencyNav) { - Permissions = dependencyNav.Value; + this.Permissions = dependencyNav.Value; } } } diff --git a/DNN Platform/Library/Services/Installer/Dependencies/TypeDependency.cs b/DNN Platform/Library/Services/Installer/Dependencies/TypeDependency.cs index 4a03f2aa08a..1a1cd4ea888 100644 --- a/DNN Platform/Library/Services/Installer/Dependencies/TypeDependency.cs +++ b/DNN Platform/Library/Services/Installer/Dependencies/TypeDependency.cs @@ -29,7 +29,7 @@ public override string ErrorMessage { get { - return Util.INSTALL_Namespace + " - " + _missingDependentType; + return Util.INSTALL_Namespace + " - " + this._missingDependentType; } } @@ -38,15 +38,15 @@ public override bool IsValid get { bool isValid = true; - if (!String.IsNullOrEmpty(_dependentTypes)) + if (!String.IsNullOrEmpty(this._dependentTypes)) { - foreach (string dependentType in (_dependentTypes + ";").Split(';')) + foreach (string dependentType in (this._dependentTypes + ";").Split(';')) { if (!String.IsNullOrEmpty(dependentType.Trim())) { if (Reflection.CreateType(dependentType, true) == null) { - _missingDependentType = dependentType; + this._missingDependentType = dependentType; isValid = false; break; } @@ -59,7 +59,7 @@ public override bool IsValid public override void ReadManifest(XPathNavigator dependencyNav) { - _dependentTypes = dependencyNav.Value; + this._dependentTypes = dependencyNav.Value; } } } diff --git a/DNN Platform/Library/Services/Installer/InstallFile.cs b/DNN Platform/Library/Services/Installer/InstallFile.cs index aadbe2a14a4..263866cac32 100644 --- a/DNN Platform/Library/Services/Installer/InstallFile.cs +++ b/DNN Platform/Library/Services/Installer/InstallFile.cs @@ -45,9 +45,9 @@ public class InstallFile /// ----------------------------------------------------------------------------- public InstallFile(ZipInputStream zip, ZipEntry entry, InstallerInfo info) { - Encoding = TextEncoding.UTF8; - InstallerInfo = info; - ReadZip(zip, entry); + this.Encoding = TextEncoding.UTF8; + this.InstallerInfo = info; + this.ReadZip(zip, entry); } /// ----------------------------------------------------------------------------- @@ -58,8 +58,8 @@ public InstallFile(ZipInputStream zip, ZipEntry entry, InstallerInfo info) /// ----------------------------------------------------------------------------- public InstallFile(string fileName) { - Encoding = TextEncoding.UTF8; - ParseFileName(fileName); + this.Encoding = TextEncoding.UTF8; + this.ParseFileName(fileName); } /// ----------------------------------------------------------------------------- @@ -71,9 +71,9 @@ public InstallFile(string fileName) /// ----------------------------------------------------------------------------- public InstallFile(string fileName, InstallerInfo info) { - Encoding = TextEncoding.UTF8; - ParseFileName(fileName); - InstallerInfo = info; + this.Encoding = TextEncoding.UTF8; + this.ParseFileName(fileName); + this.InstallerInfo = info; } /// ----------------------------------------------------------------------------- @@ -86,10 +86,10 @@ public InstallFile(string fileName, InstallerInfo info) /// ----------------------------------------------------------------------------- public InstallFile(string fileName, string sourceFileName, InstallerInfo info) { - Encoding = TextEncoding.UTF8; - ParseFileName(fileName); - SourceFileName = sourceFileName; - InstallerInfo = info; + this.Encoding = TextEncoding.UTF8; + this.ParseFileName(fileName); + this.SourceFileName = sourceFileName; + this.InstallerInfo = info; } /// ----------------------------------------------------------------------------- @@ -101,9 +101,9 @@ public InstallFile(string fileName, string sourceFileName, InstallerInfo info) /// ----------------------------------------------------------------------------- public InstallFile(string fileName, string filePath) { - Encoding = TextEncoding.UTF8; - Name = fileName; - Path = filePath; + this.Encoding = TextEncoding.UTF8; + this.Name = fileName; + this.Path = filePath; } #endregion @@ -128,7 +128,7 @@ public string BackupFileName { get { - return System.IO.Path.Combine(BackupPath, Name + ".config"); + return System.IO.Path.Combine(this.BackupPath, this.Name + ".config"); } } @@ -142,7 +142,7 @@ public virtual string BackupPath { get { - return System.IO.Path.Combine(InstallerInfo.TempInstallFolder, System.IO.Path.Combine("Backup", Path)); + return System.IO.Path.Combine(this.InstallerInfo.TempInstallFolder, System.IO.Path.Combine("Backup", this.Path)); } } @@ -158,7 +158,7 @@ public string Extension { get { - string ext = System.IO.Path.GetExtension(Name); + string ext = System.IO.Path.GetExtension(this.Name); if (String.IsNullOrEmpty(ext)) { return ""; @@ -177,7 +177,7 @@ public string FullName { get { - return System.IO.Path.Combine(Path, Name); + return System.IO.Path.Combine(this.Path, this.Name); } } @@ -224,12 +224,12 @@ public string TempFileName { get { - string fileName = SourceFileName; + string fileName = this.SourceFileName; if (string.IsNullOrEmpty(fileName)) { - fileName = FullName; + fileName = this.FullName; } - return System.IO.Path.Combine(InstallerInfo.TempInstallFolder, fileName); + return System.IO.Path.Combine(this.InstallerInfo.TempInstallFolder, fileName); } } @@ -264,70 +264,70 @@ private void ParseFileName(string fileName) int i = fileName.Replace("\\", "/").LastIndexOf("/", StringComparison.Ordinal); if (i < 0) { - Name = fileName.Substring(0, fileName.Length); - Path = ""; + this.Name = fileName.Substring(0, fileName.Length); + this.Path = ""; } else { - Name = fileName.Substring(i + 1, fileName.Length - (i + 1)); - Path = fileName.Substring(0, i); + this.Name = fileName.Substring(i + 1, fileName.Length - (i + 1)); + this.Path = fileName.Substring(0, i); } - if (string.IsNullOrEmpty(Path) && fileName.StartsWith("[app_code]")) + if (string.IsNullOrEmpty(this.Path) && fileName.StartsWith("[app_code]")) { - Name = fileName.Substring(10, fileName.Length - 10); - Path = fileName.Substring(0, 10); + this.Name = fileName.Substring(10, fileName.Length - 10); + this.Path = fileName.Substring(0, 10); } - if (Name.Equals("manifest.xml", StringComparison.InvariantCultureIgnoreCase)) + if (this.Name.Equals("manifest.xml", StringComparison.InvariantCultureIgnoreCase)) { - Type = InstallFileType.Manifest; + this.Type = InstallFileType.Manifest; } else { - switch (Extension.ToLowerInvariant()) + switch (this.Extension.ToLowerInvariant()) { case "ascx": - Type = InstallFileType.Ascx; + this.Type = InstallFileType.Ascx; break; case "dll": - Type = InstallFileType.Assembly; + this.Type = InstallFileType.Assembly; break; case "dnn": case "dnn5": case "dnn6": case "dnn7": - Type = InstallFileType.Manifest; + this.Type = InstallFileType.Manifest; break; case "resx": - Type = InstallFileType.Language; + this.Type = InstallFileType.Language; break; case "resources": case "zip": - Type = InstallFileType.Resources; + this.Type = InstallFileType.Resources; break; default: - if (Extension.EndsWith("dataprovider", StringComparison.InvariantCultureIgnoreCase) || Extension.Equals("sql", StringComparison.InvariantCultureIgnoreCase)) + if (this.Extension.EndsWith("dataprovider", StringComparison.InvariantCultureIgnoreCase) || this.Extension.Equals("sql", StringComparison.InvariantCultureIgnoreCase)) { - Type = InstallFileType.Script; + this.Type = InstallFileType.Script; } - else if (Path.StartsWith("[app_code]")) + else if (this.Path.StartsWith("[app_code]")) { - Type = InstallFileType.AppCode; + this.Type = InstallFileType.AppCode; } else { - Type = FileTypeMatchRegex.IsMatch(Name) ? InstallFileType.CleanUp : InstallFileType.Other; + this.Type = FileTypeMatchRegex.IsMatch(this.Name) ? InstallFileType.CleanUp : InstallFileType.Other; } break; } } //remove [app_code] token - Path = Path.Replace("[app_code]", ""); + this.Path = this.Path.Replace("[app_code]", ""); //remove starting "\" - if (Path.StartsWith("\\")) + if (this.Path.StartsWith("\\")) { - Path = Path.Substring(1); + this.Path = this.Path.Substring(1); } } @@ -340,9 +340,9 @@ private void ParseFileName(string fileName) /// ----------------------------------------------------------------------------- private void ReadZip(ZipInputStream unzip, ZipEntry entry) { - ParseFileName(entry.Name); - Util.WriteStream(unzip, TempFileName); - File.SetLastWriteTime(TempFileName, entry.DateTime); + this.ParseFileName(entry.Name); + Util.WriteStream(unzip, this.TempFileName); + File.SetLastWriteTime(this.TempFileName, entry.DateTime); } #endregion @@ -357,7 +357,7 @@ private void ReadZip(ZipInputStream unzip, ZipEntry entry) /// ----------------------------------------------------------------------------- public void SetVersion(Version version) { - Version = version; + this.Version = version; } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installer.cs b/DNN Platform/Library/Services/Installer/Installer.cs index ea964bf7495..e3050e28a2d 100644 --- a/DNN Platform/Library/Services/Installer/Installer.cs +++ b/DNN Platform/Library/Services/Installer/Installer.cs @@ -58,13 +58,13 @@ public class Installer /// ----------------------------------------------------------------------------- public Installer(string tempFolder, string manifest, string physicalSitePath, bool loadManifest) { - Packages = new SortedList(); + this.Packages = new SortedList(); //Called from Interactive installer - default IgnoreWhiteList to false - InstallerInfo = new InstallerInfo(tempFolder, manifest, physicalSitePath) { IgnoreWhiteList = false }; + this.InstallerInfo = new InstallerInfo(tempFolder, manifest, physicalSitePath) { IgnoreWhiteList = false }; if (loadManifest) { - ReadManifest(true); + this.ReadManifest(true); } } @@ -93,16 +93,16 @@ public Installer(Stream inputStream, string physicalSitePath, bool loadManifest) /// ----------------------------------------------------------------------------- public Installer(Stream inputStream, string physicalSitePath, bool loadManifest, bool deleteTemp) { - Packages = new SortedList(); + this.Packages = new SortedList(); - _inputStream = new MemoryStream(); - inputStream.CopyTo(_inputStream); + this._inputStream = new MemoryStream(); + inputStream.CopyTo(this._inputStream); //Called from Batch installer - default IgnoreWhiteList to true - InstallerInfo = new InstallerInfo(inputStream, physicalSitePath) { IgnoreWhiteList = true }; + this.InstallerInfo = new InstallerInfo(inputStream, physicalSitePath) { IgnoreWhiteList = true }; if (loadManifest) { - ReadManifest(deleteTemp); + this.ReadManifest(deleteTemp); } } @@ -115,19 +115,19 @@ public Installer(Stream inputStream, string physicalSitePath, bool loadManifest, /// ----------------------------------------------------------------------------- public Installer(PackageInfo package, string physicalSitePath) { - Packages = new SortedList(); - InstallerInfo = new InstallerInfo(package, physicalSitePath); + this.Packages = new SortedList(); + this.InstallerInfo = new InstallerInfo(package, physicalSitePath); - Packages.Add(Packages.Count, new PackageInstaller(package)); + this.Packages.Add(this.Packages.Count, new PackageInstaller(package)); } public Installer(string manifest, string physicalSitePath, bool loadManifest) { - Packages = new SortedList(); - InstallerInfo = new InstallerInfo(physicalSitePath, InstallMode.ManifestOnly); + this.Packages = new SortedList(); + this.InstallerInfo = new InstallerInfo(physicalSitePath, InstallMode.ManifestOnly); if (loadManifest) { - ReadManifest(new FileStream(manifest, FileMode.Open, FileAccess.Read)); + this.ReadManifest(new FileStream(manifest, FileMode.Open, FileAccess.Read)); } } @@ -153,7 +153,7 @@ public bool IsValid { get { - return InstallerInfo.IsValid; + return this.InstallerInfo.IsValid; } } @@ -175,7 +175,7 @@ public string TempInstallFolder { get { - return InstallerInfo.TempInstallFolder; + return this.InstallerInfo.TempInstallFolder; } } @@ -191,9 +191,9 @@ public string TempInstallFolder private void InstallPackages(ref bool clearClientCache) { //Iterate through all the Packages - for (int index = 0; index <= Packages.Count - 1; index++) + for (int index = 0; index <= this.Packages.Count - 1; index++) { - PackageInstaller installer = Packages.Values[index]; + PackageInstaller installer = this.Packages.Values[index]; //Check if package is valid if (installer.Package.IsValid) { @@ -202,20 +202,20 @@ private void InstallPackages(ref bool clearClientCache) clearClientCache = true; } - InstallerInfo.Log.AddInfo(Util.INSTALL_Start + " - " + installer.Package.Name); + this.InstallerInfo.Log.AddInfo(Util.INSTALL_Start + " - " + installer.Package.Name); installer.Install(); - if (InstallerInfo.Log.Valid) + if (this.InstallerInfo.Log.Valid) { - InstallerInfo.Log.AddInfo(Util.INSTALL_Success + " - " + installer.Package.Name); + this.InstallerInfo.Log.AddInfo(Util.INSTALL_Success + " - " + installer.Package.Name); } else { - InstallerInfo.Log.AddInfo(Util.INSTALL_Failed + " - " + installer.Package.Name); + this.InstallerInfo.Log.AddInfo(Util.INSTALL_Failed + " - " + installer.Package.Name); } } else { - InstallerInfo.Log.AddFailure(Util.INSTALL_Aborted + " - " + installer.Package.Name); + this.InstallerInfo.Log.AddFailure(Util.INSTALL_Aborted + " - " + installer.Package.Name); } } } @@ -233,12 +233,12 @@ private void LogInstallEvent(string package, string eventType) { var log = new LogInfo {LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString()}; - if (InstallerInfo.ManifestFile != null) + if (this.InstallerInfo.ManifestFile != null) { - log.LogProperties.Add(new LogDetailInfo(eventType + " " + package + ":", InstallerInfo.ManifestFile.Name.Replace(".dnn", ""))); + log.LogProperties.Add(new LogDetailInfo(eventType + " " + package + ":", this.InstallerInfo.ManifestFile.Name.Replace(".dnn", ""))); } - foreach (LogEntry objLogEntry in InstallerInfo.Log.Logs) + foreach (LogEntry objLogEntry in this.InstallerInfo.Log.Logs) { log.LogProperties.Add(new LogDetailInfo("Info:", objLogEntry.Description)); } @@ -261,14 +261,14 @@ private void ProcessPackages(XPathNavigator rootNav) //Parse the package nodes foreach (XPathNavigator nav in rootNav.Select("packages/package")) { - int order = Packages.Count; + int order = this.Packages.Count; string name = Util.ReadAttribute(nav, "name"); string installOrder = Util.ReadAttribute(nav, "installOrder"); if (!string.IsNullOrEmpty(installOrder)) { order = int.Parse(installOrder); } - Packages.Add(order, new PackageInstaller(nav.OuterXml, InstallerInfo)); + this.Packages.Add(order, new PackageInstaller(nav.OuterXml, this.InstallerInfo)); } } @@ -291,39 +291,39 @@ private void ReadManifest(Stream stream) } else { - InstallerInfo.Log.AddFailure(Util.PACKAGE_UnRecognizable); + this.InstallerInfo.Log.AddFailure(Util.PACKAGE_UnRecognizable); } switch (packageType.ToLowerInvariant()) { case "package": - InstallerInfo.IsLegacyMode = false; + this.InstallerInfo.IsLegacyMode = false; //Parse the package nodes - ProcessPackages(rootNav); + this.ProcessPackages(rootNav); break; case "module": case "languagepack": case "skinobject": - InstallerInfo.IsLegacyMode = true; - ProcessPackages(ConvertLegacyNavigator(rootNav, InstallerInfo)); + this.InstallerInfo.IsLegacyMode = true; + this.ProcessPackages(ConvertLegacyNavigator(rootNav, this.InstallerInfo)); break; } } private void UnInstallPackages(bool deleteFiles) { - for (int index = 0; index <= Packages.Count - 1; index++) + for (int index = 0; index <= this.Packages.Count - 1; index++) { - PackageInstaller installer = Packages.Values[index]; - InstallerInfo.Log.AddInfo(Util.UNINSTALL_Start + " - " + installer.Package.Name); + PackageInstaller installer = this.Packages.Values[index]; + this.InstallerInfo.Log.AddInfo(Util.UNINSTALL_Start + " - " + installer.Package.Name); installer.DeleteFiles = deleteFiles; installer.UnInstall(); - if (InstallerInfo.Log.HasWarnings) + if (this.InstallerInfo.Log.HasWarnings) { - InstallerInfo.Log.AddWarning(Util.UNINSTALL_Warnings + " - " + installer.Package.Name); + this.InstallerInfo.Log.AddWarning(Util.UNINSTALL_Warnings + " - " + installer.Package.Name); } else { - InstallerInfo.Log.AddInfo(Util.UNINSTALL_Success + " - " + installer.Package.Name); + this.InstallerInfo.Log.AddInfo(Util.UNINSTALL_Success + " - " + installer.Package.Name); } } } @@ -435,14 +435,14 @@ public void DeleteTempFolder() { try { - if (!string.IsNullOrEmpty(TempInstallFolder)) + if (!string.IsNullOrEmpty(this.TempInstallFolder)) { - Directory.Delete(TempInstallFolder, true); + Directory.Delete(this.TempInstallFolder, true); } } catch (Exception ex) { - Logger.Error("Exception deleting folder "+TempInstallFolder+" while installing "+InstallerInfo.ManifestFile.Name, ex); + Logger.Error("Exception deleting folder "+this.TempInstallFolder+" while installing "+this.InstallerInfo.ManifestFile.Name, ex); Exceptions.Exceptions.LogException(ex); } } @@ -454,12 +454,12 @@ public void DeleteTempFolder() /// ----------------------------------------------------------------------------- public bool Install() { - InstallerInfo.Log.StartJob(Util.INSTALL_Start); + this.InstallerInfo.Log.StartJob(Util.INSTALL_Start); bool bStatus = true; try { bool clearClientCache = false; - InstallPackages(ref clearClientCache); + this.InstallPackages(ref clearClientCache); if (clearClientCache) { //Update the version of the client resources - so the cache is cleared @@ -469,37 +469,37 @@ public bool Install() catch (Exception ex) { - InstallerInfo.Log.AddFailure(ex); + this.InstallerInfo.Log.AddFailure(ex); bStatus = false; } finally { //Delete Temp Folder - if (!string.IsNullOrEmpty(TempInstallFolder)) + if (!string.IsNullOrEmpty(this.TempInstallFolder)) { - Globals.DeleteFolderRecursive(TempInstallFolder); + Globals.DeleteFolderRecursive(this.TempInstallFolder); } - InstallerInfo.Log.AddInfo(Util.FOLDER_DeletedBackup); + this.InstallerInfo.Log.AddInfo(Util.FOLDER_DeletedBackup); } - if (InstallerInfo.Log.Valid) + if (this.InstallerInfo.Log.Valid) { - InstallerInfo.Log.EndJob(Util.INSTALL_Success); + this.InstallerInfo.Log.EndJob(Util.INSTALL_Success); } else { - InstallerInfo.Log.EndJob(Util.INSTALL_Failed); + this.InstallerInfo.Log.EndJob(Util.INSTALL_Failed); bStatus = false; } //log installation event - LogInstallEvent("Package", "Install"); + this.LogInstallEvent("Package", "Install"); //when the installer initialized by file stream, we need save the file stream into backup folder. - if (_inputStream != null && bStatus && Packages.Any()) + if (this._inputStream != null && bStatus && this.Packages.Any()) { Task.Run(() => { - BackupStreamIntoFile(_inputStream, Packages[0].Package); + this.BackupStreamIntoFile(this._inputStream, this.Packages[0].Package); }); } @@ -522,19 +522,19 @@ public bool Install() /// ----------------------------------------------------------------------------- public void ReadManifest(bool deleteTemp) { - InstallerInfo.Log.StartJob(Util.DNN_Reading); - if (InstallerInfo.ManifestFile != null) + this.InstallerInfo.Log.StartJob(Util.DNN_Reading); + if (this.InstallerInfo.ManifestFile != null) { - ReadManifest(new FileStream(InstallerInfo.ManifestFile.TempFileName, FileMode.Open, FileAccess.Read)); + this.ReadManifest(new FileStream(this.InstallerInfo.ManifestFile.TempFileName, FileMode.Open, FileAccess.Read)); } - if (InstallerInfo.Log.Valid) + if (this.InstallerInfo.Log.Valid) { - InstallerInfo.Log.EndJob(Util.DNN_Success); + this.InstallerInfo.Log.EndJob(Util.DNN_Success); } else if (deleteTemp) { //Delete Temp Folder - DeleteTempFolder(); + this.DeleteTempFolder(); } } @@ -547,27 +547,27 @@ public void ReadManifest(bool deleteTemp) /// ----------------------------------------------------------------------------- public bool UnInstall(bool deleteFiles) { - InstallerInfo.Log.StartJob(Util.UNINSTALL_Start); + this.InstallerInfo.Log.StartJob(Util.UNINSTALL_Start); try { - UnInstallPackages(deleteFiles); + this.UnInstallPackages(deleteFiles); } catch (Exception ex) { - InstallerInfo.Log.AddFailure(ex); + this.InstallerInfo.Log.AddFailure(ex); return false; } - if (InstallerInfo.Log.HasWarnings) + if (this.InstallerInfo.Log.HasWarnings) { - InstallerInfo.Log.EndJob(Util.UNINSTALL_Warnings); + this.InstallerInfo.Log.EndJob(Util.UNINSTALL_Warnings); } else { - InstallerInfo.Log.EndJob(Util.UNINSTALL_Success); + this.InstallerInfo.Log.EndJob(Util.UNINSTALL_Success); } //log installation event - LogInstallEvent("Package", "UnInstall"); + this.LogInstallEvent("Package", "UnInstall"); return true; } diff --git a/DNN Platform/Library/Services/Installer/InstallerInfo.cs b/DNN Platform/Library/Services/Installer/InstallerInfo.cs index 50074ea20d7..860fcd36a85 100644 --- a/DNN Platform/Library/Services/Installer/InstallerInfo.cs +++ b/DNN Platform/Library/Services/Installer/InstallerInfo.cs @@ -45,8 +45,8 @@ public class InstallerInfo /// ----------------------------------------------------------------------------- public InstallerInfo() { - PhysicalSitePath = Null.NullString; - Initialize(); + this.PhysicalSitePath = Null.NullString; + this.Initialize(); } /// ----------------------------------------------------------------------------- @@ -59,10 +59,10 @@ public InstallerInfo() /// ----------------------------------------------------------------------------- public InstallerInfo(string sitePath, InstallMode mode) { - Initialize(); - TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); - PhysicalSitePath = sitePath; - InstallMode = mode; + this.Initialize(); + this.TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + this.PhysicalSitePath = sitePath; + this.InstallMode = mode; } /// ----------------------------------------------------------------------------- @@ -75,12 +75,12 @@ public InstallerInfo(string sitePath, InstallMode mode) /// ----------------------------------------------------------------------------- public InstallerInfo(Stream inputStream, string sitePath) { - Initialize(); - TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); - PhysicalSitePath = sitePath; + this.Initialize(); + this.TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + this.PhysicalSitePath = sitePath; //Read the Zip file into its component entries - ReadZipStream(inputStream, false); + this.ReadZipStream(inputStream, false); } /// ----------------------------------------------------------------------------- @@ -95,12 +95,12 @@ public InstallerInfo(Stream inputStream, string sitePath) /// ----------------------------------------------------------------------------- public InstallerInfo(string tempFolder, string manifest, string sitePath) { - Initialize(); - TempInstallFolder = tempFolder; - PhysicalSitePath = sitePath; + this.Initialize(); + this.TempInstallFolder = tempFolder; + this.PhysicalSitePath = sitePath; if (!string.IsNullOrEmpty(manifest)) { - ManifestFile = new InstallFile(manifest, this); + this.ManifestFile = new InstallFile(manifest, this); } } @@ -113,11 +113,11 @@ public InstallerInfo(string tempFolder, string manifest, string sitePath) /// ----------------------------------------------------------------------------- public InstallerInfo(PackageInfo package, string sitePath) { - Initialize(); - PhysicalSitePath = sitePath; - TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); - InstallMode = InstallMode.UnInstall; - ManifestFile = new InstallFile(Path.Combine(TempInstallFolder, package.Name + ".dnn")); + this.Initialize(); + this.PhysicalSitePath = sitePath; + this.TempInstallFolder = Globals.InstallMapPath + "Temp\\" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()); + this.InstallMode = InstallMode.UnInstall; + this.ManifestFile = new InstallFile(Path.Combine(this.TempInstallFolder, package.Name + ".dnn")); package.AttachInstallerInfo(this); } @@ -152,7 +152,7 @@ public bool HasValidFiles get { bool _HasValidFiles = true; - if (Files.Values.Any(file => !Util.IsFileValid(file, AllowableFiles))) + if (this.Files.Values.Any(file => !Util.IsFileValid(file, this.AllowableFiles))) { _HasValidFiles = Null.NullBoolean; } @@ -194,7 +194,7 @@ public string InvalidFileExtensions { get { - string _InvalidFileExtensions = Files.Values.Where(file => !Util.IsFileValid(file, AllowableFiles)) + string _InvalidFileExtensions = this.Files.Values.Where(file => !Util.IsFileValid(file, this.AllowableFiles)) .Aggregate(Null.NullString, (current, file) => current + (", " + file.Extension)); if (!string.IsNullOrEmpty(_InvalidFileExtensions)) { @@ -221,7 +221,7 @@ public bool IsValid { get { - return Log.Valid; + return this.Log.Valid; } } @@ -304,22 +304,22 @@ public bool IsValid private void Initialize() { - TempInstallFolder = Null.NullString; - SecurityAccessLevel = SecurityAccessLevel.Host; - RepairInstall = Null.NullBoolean; - PortalID = Null.NullInteger; - PackageID = Null.NullInteger; - Log = new Logger(); - IsLegacyMode = Null.NullBoolean; - IgnoreWhiteList = Null.NullBoolean; - InstallMode = InstallMode.Install; - Installed = Null.NullBoolean; - Files = new Dictionary(); + this.TempInstallFolder = Null.NullString; + this.SecurityAccessLevel = SecurityAccessLevel.Host; + this.RepairInstall = Null.NullBoolean; + this.PortalID = Null.NullInteger; + this.PackageID = Null.NullInteger; + this.Log = new Logger(); + this.IsLegacyMode = Null.NullBoolean; + this.IgnoreWhiteList = Null.NullBoolean; + this.InstallMode = InstallMode.Install; + this.Installed = Null.NullBoolean; + this.Files = new Dictionary(); } private void ReadZipStream(Stream inputStream, bool isEmbeddedZip) { - Log.StartJob(Util.FILES_Reading); + this.Log.StartJob(Util.FILES_Reading); if (inputStream.CanSeek) { inputStream.Seek(0, SeekOrigin.Begin); @@ -337,20 +337,20 @@ private void ReadZipStream(Stream inputStream, bool isEmbeddedZip) if (file.Type == InstallFileType.Resources && (file.Name.Equals("containers.zip", StringComparison.InvariantCultureIgnoreCase) || file.Name.Equals("skins.zip", StringComparison.InvariantCultureIgnoreCase))) { //Temporarily save the TempInstallFolder - string tmpInstallFolder = TempInstallFolder; + string tmpInstallFolder = this.TempInstallFolder; //Create Zip Stream from File using (var zipStream = new FileStream(file.TempFileName, FileMode.Open, FileAccess.Read)) { //Set TempInstallFolder - TempInstallFolder = Path.Combine(TempInstallFolder, Path.GetFileNameWithoutExtension(file.Name)); + this.TempInstallFolder = Path.Combine(this.TempInstallFolder, Path.GetFileNameWithoutExtension(file.Name)); //Extract files from zip - ReadZipStream(zipStream, true); + this.ReadZipStream(zipStream, true); } //Restore TempInstallFolder - TempInstallFolder = tmpInstallFolder; + this.TempInstallFolder = tmpInstallFolder; //Delete zip file var zipFile = new FileInfo(file.TempFileName); @@ -358,50 +358,50 @@ private void ReadZipStream(Stream inputStream, bool isEmbeddedZip) } else { - Files[file.FullName.ToLowerInvariant()] = file; + this.Files[file.FullName.ToLowerInvariant()] = file; if (file.Type == InstallFileType.Manifest && !isEmbeddedZip) { - if (ManifestFile == null) + if (this.ManifestFile == null) { - ManifestFile = file; + this.ManifestFile = file; } else { - if (file.Extension == "dnn7" && (ManifestFile.Extension == "dnn" || ManifestFile.Extension == "dnn5" || ManifestFile.Extension == "dnn6")) + if (file.Extension == "dnn7" && (this.ManifestFile.Extension == "dnn" || this.ManifestFile.Extension == "dnn5" || this.ManifestFile.Extension == "dnn6")) { - ManifestFile = file; + this.ManifestFile = file; } - else if (file.Extension == "dnn6" && (ManifestFile.Extension == "dnn" || ManifestFile.Extension == "dnn5")) + else if (file.Extension == "dnn6" && (this.ManifestFile.Extension == "dnn" || this.ManifestFile.Extension == "dnn5")) { - ManifestFile = file; + this.ManifestFile = file; } - else if (file.Extension == "dnn5" && ManifestFile.Extension == "dnn") + else if (file.Extension == "dnn5" && this.ManifestFile.Extension == "dnn") { - ManifestFile = file; + this.ManifestFile = file; } - else if (file.Extension == ManifestFile.Extension) + else if (file.Extension == this.ManifestFile.Extension) { - Log.AddFailure((Util.EXCEPTION_MultipleDnn + ManifestFile.Name + " and " + file.Name)); + this.Log.AddFailure((Util.EXCEPTION_MultipleDnn + this.ManifestFile.Name + " and " + file.Name)); } } } } - Log.AddInfo(string.Format(Util.FILE_ReadSuccess, file.FullName)); + this.Log.AddInfo(string.Format(Util.FILE_ReadSuccess, file.FullName)); } entry = unzip.GetNextEntry(); } - if (ManifestFile == null) + if (this.ManifestFile == null) { - Log.AddFailure(Util.EXCEPTION_MissingDnn); + this.Log.AddFailure(Util.EXCEPTION_MissingDnn); } - if (Log.Valid) + if (this.Log.Valid) { - Log.EndJob(Util.FILES_ReadingEnd); + this.Log.EndJob(Util.FILES_ReadingEnd); } else { - Log.AddFailure(new Exception(Util.EXCEPTION_FileLoad)); - Log.EndJob(Util.FILES_ReadingEnd); + this.Log.AddFailure(new Exception(Util.EXCEPTION_FileLoad)); + this.Log.EndJob(Util.FILES_ReadingEnd); } //Close the Zip Input Stream as we have finished with it diff --git a/DNN Platform/Library/Services/Installer/Installers/AssemblyInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/AssemblyInstaller.cs index 8add0b7e38e..aba20ba34d3 100644 --- a/DNN Platform/Library/Services/Installer/Installers/AssemblyInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/AssemblyInstaller.cs @@ -81,7 +81,7 @@ protected override string PhysicalBasePath { get { - return PhysicalSitePath + "\\"; + return this.PhysicalSitePath + "\\"; } } @@ -116,18 +116,18 @@ protected override void DeleteFile(InstallFile file) { //Attempt to unregister assembly this will return False if the assembly is used by another package and //cannot be delete andtrue if it is not being used and can be deleted - if (DataProvider.Instance().UnRegisterAssembly(Package.PackageID, file.Name)) + if (DataProvider.Instance().UnRegisterAssembly(this.Package.PackageID, file.Name)) { - Log.AddInfo(Util.ASSEMBLY_UnRegistered + " - " + file.FullName); + this.Log.AddInfo(Util.ASSEMBLY_UnRegistered + " - " + file.FullName); - RemoveBindingRedirect(file); + this.RemoveBindingRedirect(file); //Call base class version to deleteFile file from \bin base.DeleteFile(file); } else { - Log.AddInfo(Util.ASSEMBLY_InUse + " - " + file.FullName); + this.Log.AddInfo(Util.ASSEMBLY_InUse + " - " + file.FullName); } } @@ -151,26 +151,26 @@ protected override bool InstallFile(InstallFile file) bool bSuccess = true; if (file.Action == "UnRegister") { - DeleteFile(file); + this.DeleteFile(file); } else { //Attempt to register assembly this will return False if the assembly exists and true if it does not or is older - int returnCode = DataProvider.Instance().RegisterAssembly(Package.PackageID, file.Name, file.Version.ToString(3)); + int returnCode = DataProvider.Instance().RegisterAssembly(this.Package.PackageID, file.Name, file.Version.ToString(3)); switch (returnCode) { case 0: //Assembly Does Not Exist - Log.AddInfo(Util.ASSEMBLY_Added + " - " + file.FullName); + this.Log.AddInfo(Util.ASSEMBLY_Added + " - " + file.FullName); break; case 1: //Older version of Assembly Exists - Log.AddInfo(Util.ASSEMBLY_Updated + " - " + file.FullName); + this.Log.AddInfo(Util.ASSEMBLY_Updated + " - " + file.FullName); break; case 2: case 3: //Assembly already Registered - Log.AddInfo(Util.ASSEMBLY_Registered + " - " + file.FullName); + this.Log.AddInfo(Util.ASSEMBLY_Registered + " - " + file.FullName); break; } @@ -179,7 +179,7 @@ protected override bool InstallFile(InstallFile file) { //Call base class version to copy file to \bin bSuccess = base.InstallFile(file); - AddOrUpdateBindingRedirect(file); + this.AddOrUpdateBindingRedirect(file); } } return bSuccess; @@ -193,7 +193,7 @@ protected override bool InstallFile(InstallFile file) /// The assembly file. private void AddOrUpdateBindingRedirect(InstallFile file) { - if (ApplyXmlMerge(file, "BindingRedirect.config")) + if (this.ApplyXmlMerge(file, "BindingRedirect.config")) { this.Log.AddInfo(Util.ASSEMBLY_AddedBindingRedirect + " - " + file.FullName); } @@ -203,9 +203,9 @@ private void AddOrUpdateBindingRedirect(InstallFile file) /// The assembly file. private void RemoveBindingRedirect(InstallFile file) { - if (ApplyXmlMerge(file, "RemoveBindingRedirect.config")) + if (this.ApplyXmlMerge(file, "RemoveBindingRedirect.config")) { - Log.AddInfo(Util.ASSEMBLY_RemovedBindingRedirect + " - " + file.FullName); + this.Log.AddInfo(Util.ASSEMBLY_RemovedBindingRedirect + " - " + file.FullName); } } diff --git a/DNN Platform/Library/Services/Installer/Installers/AuthenticationInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/AuthenticationInstaller.cs index d65c38f3424..eb996bd7bc4 100644 --- a/DNN Platform/Library/Services/Installer/Installers/AuthenticationInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/AuthenticationInstaller.cs @@ -61,16 +61,16 @@ private void DeleteAuthentiation() { try { - AuthenticationInfo authSystem = AuthenticationController.GetAuthenticationServiceByPackageID(Package.PackageID); + AuthenticationInfo authSystem = AuthenticationController.GetAuthenticationServiceByPackageID(this.Package.PackageID); if (authSystem != null) { AuthenticationController.DeleteAuthentication(authSystem); } - Log.AddInfo(string.Format(Util.AUTHENTICATION_UnRegistered, authSystem.AuthenticationType)); + this.Log.AddInfo(string.Format(Util.AUTHENTICATION_UnRegistered, authSystem.AuthenticationType)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -100,37 +100,37 @@ public override void Install() try { //Attempt to get the Authentication Service - TempAuthSystem = AuthenticationController.GetAuthenticationServiceByType(AuthSystem.AuthenticationType); + this.TempAuthSystem = AuthenticationController.GetAuthenticationServiceByType(this.AuthSystem.AuthenticationType); - if (TempAuthSystem == null) + if (this.TempAuthSystem == null) { //Enable by default - AuthSystem.IsEnabled = true; + this.AuthSystem.IsEnabled = true; bAdd = true; } else { - AuthSystem.AuthenticationID = TempAuthSystem.AuthenticationID; - AuthSystem.IsEnabled = TempAuthSystem.IsEnabled; + this.AuthSystem.AuthenticationID = this.TempAuthSystem.AuthenticationID; + this.AuthSystem.IsEnabled = this.TempAuthSystem.IsEnabled; } - AuthSystem.PackageID = Package.PackageID; + this.AuthSystem.PackageID = this.Package.PackageID; if (bAdd) { //Add new service - AuthenticationController.AddAuthentication(AuthSystem); + AuthenticationController.AddAuthentication(this.AuthSystem); } else { //Update service - AuthenticationController.UpdateAuthentication(AuthSystem); + AuthenticationController.UpdateAuthentication(this.AuthSystem); } - Completed = true; - Log.AddInfo(string.Format(Util.AUTHENTICATION_Registered, AuthSystem.AuthenticationType)); + this.Completed = true; + this.Log.AddInfo(string.Format(Util.AUTHENTICATION_Registered, this.AuthSystem.AuthenticationType)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -141,23 +141,23 @@ public override void Install() /// ----------------------------------------------------------------------------- public override void ReadManifest(XPathNavigator manifestNav) { - AuthSystem = new AuthenticationInfo(); + this.AuthSystem = new AuthenticationInfo(); //Get the type - AuthSystem.AuthenticationType = Util.ReadElement(manifestNav, "authenticationService/type", Log, Util.AUTHENTICATION_TypeMissing); + this.AuthSystem.AuthenticationType = Util.ReadElement(manifestNav, "authenticationService/type", this.Log, Util.AUTHENTICATION_TypeMissing); //Get the SettingsSrc - AuthSystem.SettingsControlSrc = Util.ReadElement(manifestNav, "authenticationService/settingsControlSrc", Log, Util.AUTHENTICATION_SettingsSrcMissing); + this.AuthSystem.SettingsControlSrc = Util.ReadElement(manifestNav, "authenticationService/settingsControlSrc", this.Log, Util.AUTHENTICATION_SettingsSrcMissing); //Get the LoginSrc - AuthSystem.LoginControlSrc = Util.ReadElement(manifestNav, "authenticationService/loginControlSrc", Log, Util.AUTHENTICATION_LoginSrcMissing); + this.AuthSystem.LoginControlSrc = Util.ReadElement(manifestNav, "authenticationService/loginControlSrc", this.Log, Util.AUTHENTICATION_LoginSrcMissing); //Get the LogoffSrc - AuthSystem.LogoffControlSrc = Util.ReadElement(manifestNav, "authenticationService/logoffControlSrc"); + this.AuthSystem.LogoffControlSrc = Util.ReadElement(manifestNav, "authenticationService/logoffControlSrc"); - if (Log.Valid) + if (this.Log.Valid) { - Log.AddInfo(Util.AUTHENTICATION_ReadSuccess); + this.Log.AddInfo(Util.AUTHENTICATION_ReadSuccess); } } @@ -170,15 +170,15 @@ public override void ReadManifest(XPathNavigator manifestNav) public override void Rollback() { //If Temp Auth System exists then we need to update the DataStore with this - if (TempAuthSystem == null) + if (this.TempAuthSystem == null) { //No Temp Auth System - Delete newly added system - DeleteAuthentiation(); + this.DeleteAuthentiation(); } else { //Temp Auth System - Rollback to Temp - AuthenticationController.UpdateAuthentication(TempAuthSystem); + AuthenticationController.UpdateAuthentication(this.TempAuthSystem); } } @@ -189,7 +189,7 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - DeleteAuthentiation(); + this.DeleteAuthentiation(); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/CleanupInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/CleanupInstaller.cs index 03ee88f7eb2..85f231c4efc 100644 --- a/DNN Platform/Library/Services/Installer/Installers/CleanupInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/CleanupInstaller.cs @@ -51,10 +51,10 @@ public class CleanupInstaller : FileInstaller private bool ProcessCleanupFile() { - Log.AddInfo(string.Format(Util.CLEANUP_Processing, Version.ToString(3))); + this.Log.AddInfo(string.Format(Util.CLEANUP_Processing, this.Version.ToString(3))); try { - var strListFile = Path.Combine(Package.InstallerInfo.TempInstallFolder, _fileName); + var strListFile = Path.Combine(this.Package.InstallerInfo.TempInstallFolder, this._fileName); if (File.Exists(strListFile)) { FileSystemUtils.DeleteFiles(File.ReadAllLines(strListFile)); @@ -62,36 +62,36 @@ private bool ProcessCleanupFile() } catch (Exception ex) { - Log.AddWarning(string.Format(Util.CLEANUP_ProcessError, ex.Message)); + this.Log.AddWarning(string.Format(Util.CLEANUP_ProcessError, ex.Message)); //DNN-9202: MUST NOT fail installation when cleanup files deletion fails //return false; } - Log.AddInfo(string.Format(Util.CLEANUP_ProcessComplete, Version.ToString(3))); + this.Log.AddInfo(string.Format(Util.CLEANUP_ProcessComplete, this.Version.ToString(3))); return true; } private bool ProcessGlob() { - Log.AddInfo(string.Format(Util.CLEANUP_Processing, Version.ToString(3))); + this.Log.AddInfo(string.Format(Util.CLEANUP_Processing, this.Version.ToString(3))); try { - if (_glob.Contains("..")) + if (this._glob.Contains("..")) { - Log.AddWarning(Util.EXCEPTION + " - " + Util.EXCEPTION_GlobDotDotNotSupportedInCleanup); + this.Log.AddWarning(Util.EXCEPTION + " - " + Util.EXCEPTION_GlobDotDotNotSupportedInCleanup); } else { var globs = new Matcher(StringComparison.InvariantCultureIgnoreCase); - globs.AddIncludePatterns(_glob.Split(';')); + globs.AddIncludePatterns(this._glob.Split(';')); var files = globs.GetResultsInFullPath(Globals.ApplicationMapPath).ToArray(); FileSystemUtils.DeleteFiles(files); } } catch (Exception ex) { - Log.AddWarning(string.Format(Util.CLEANUP_ProcessError, ex.Message)); + this.Log.AddWarning(string.Format(Util.CLEANUP_ProcessError, ex.Message)); } - Log.AddInfo(string.Format(Util.CLEANUP_ProcessComplete, Version.ToString(3))); + this.Log.AddInfo(string.Format(Util.CLEANUP_ProcessComplete, this.Version.ToString(3))); return true; } @@ -110,13 +110,13 @@ protected bool CleanupFile(InstallFile insFile) try { //Backup File - if (File.Exists(PhysicalBasePath + insFile.FullName)) + if (File.Exists(this.PhysicalBasePath + insFile.FullName)) { - Util.BackupFile(insFile, PhysicalBasePath, Log); + Util.BackupFile(insFile, this.PhysicalBasePath, this.Log); } //Delete file - Util.DeleteFile(insFile, PhysicalBasePath, Log); + Util.DeleteFile(insFile, this.PhysicalBasePath, this.Log); return true; } catch (Exception exc) @@ -138,7 +138,7 @@ protected override void ProcessFile(InstallFile file, XPathNavigator nav) { if (file != null) { - Files.Add(file); + this.Files.Add(file); } } @@ -157,7 +157,7 @@ protected override void RollbackFile(InstallFile installFile) { if (File.Exists(installFile.BackupFileName)) { - Util.RestoreFile(installFile, PhysicalBasePath, Log); + Util.RestoreFile(installFile, this.PhysicalBasePath, this.Log); } } @@ -188,37 +188,37 @@ public override void Install() try { bool bSuccess = true; - if (string.IsNullOrEmpty(_fileName) && string.IsNullOrEmpty(_glob)) // No attribute: use the xml files definition. + if (string.IsNullOrEmpty(this._fileName) && string.IsNullOrEmpty(this._glob)) // No attribute: use the xml files definition. { - foreach (InstallFile file in Files) + foreach (InstallFile file in this.Files) { - bSuccess = CleanupFile(file); + bSuccess = this.CleanupFile(file); if (!bSuccess) { break; } } } - else if (!string.IsNullOrEmpty(_fileName)) // Cleanup file provided: clean each file in the cleanup text file line one by one. + else if (!string.IsNullOrEmpty(this._fileName)) // Cleanup file provided: clean each file in the cleanup text file line one by one. { - bSuccess = ProcessCleanupFile(); + bSuccess = this.ProcessCleanupFile(); } - else if (!string.IsNullOrEmpty(_glob)) // A globbing pattern was provided, use it to find the files and delete what matches. + else if (!string.IsNullOrEmpty(this._glob)) // A globbing pattern was provided, use it to find the files and delete what matches. { - bSuccess = ProcessGlob(); + bSuccess = this.ProcessGlob(); } - Completed = bSuccess; + this.Completed = bSuccess; } catch (Exception ex) { - Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); + this.Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); } } public override void ReadManifest(XPathNavigator manifestNav) { - _fileName = Util.ReadAttribute(manifestNav, "fileName"); - _glob = Util.ReadAttribute(manifestNav, "glob"); + this._fileName = Util.ReadAttribute(manifestNav, "fileName"); + this._glob = Util.ReadAttribute(manifestNav, "glob"); base.ReadManifest(manifestNav); } diff --git a/DNN Platform/Library/Services/Installer/Installers/ComponentInstallerBase.cs b/DNN Platform/Library/Services/Installer/Installers/ComponentInstallerBase.cs index 6912cb484ee..c43c4b100c4 100644 --- a/DNN Platform/Library/Services/Installer/Installers/ComponentInstallerBase.cs +++ b/DNN Platform/Library/Services/Installer/Installers/ComponentInstallerBase.cs @@ -28,7 +28,7 @@ public abstract class ComponentInstallerBase { protected ComponentInstallerBase() { - Completed = Null.NullBoolean; + this.Completed = Null.NullBoolean; } /// ----------------------------------------------------------------------------- @@ -63,7 +63,7 @@ public InstallMode InstallMode { get { - return Package.InstallMode; + return this.Package.InstallMode; } } @@ -77,7 +77,7 @@ public Logger Log { get { - return Package.Log; + return this.Package.Log; } } @@ -99,7 +99,7 @@ public Dictionary PackageFiles { get { - return Package.Files; + return this.Package.Files; } } @@ -113,7 +113,7 @@ public string PhysicalSitePath { get { - return Package.InstallerInfo.PhysicalSitePath; + return this.Package.InstallerInfo.PhysicalSitePath; } } @@ -130,8 +130,8 @@ public EventMessage ReadEventMessageNode(XPathNavigator manifestNav) ExpirationDate = DateTime.Now.AddYears(-1), SentDate = DateTime.Now, Body = "", - ProcessorType = Util.ReadElement(eventMessageNav, "processorType", Log, Util.EVENTMESSAGE_TypeMissing), - ProcessorCommand = Util.ReadElement(eventMessageNav, "processorCommand", Log, Util.EVENTMESSAGE_CommandMissing) + ProcessorType = Util.ReadElement(eventMessageNav, "processorType", this.Log, Util.EVENTMESSAGE_TypeMissing), + ProcessorCommand = Util.ReadElement(eventMessageNav, "processorCommand", this.Log, Util.EVENTMESSAGE_CommandMissing) }; foreach (XPathNavigator attributeNav in eventMessageNav.Select("attributes/*")) { @@ -148,13 +148,13 @@ public EventMessage ReadEventMessageNode(XPathNavigator manifestNav) switch (version.ToLowerInvariant()) { case "install": - if (Package.InstalledVersion == new Version(0, 0, 0)) + if (this.Package.InstalledVersion == new Version(0, 0, 0)) { attribValue += version + ","; } break; case "upgrade": - if (Package.InstalledVersion > new Version(0, 0, 0)) + if (this.Package.InstalledVersion > new Version(0, 0, 0)) { attribValue += version + ","; } @@ -167,14 +167,14 @@ public EventMessage ReadEventMessageNode(XPathNavigator manifestNav) } catch (FormatException) { - Log.AddWarning(string.Format(Util.MODULE_InvalidVersion, version)); + this.Log.AddWarning(string.Format(Util.MODULE_InvalidVersion, version)); } if (upgradeVersion != null && (Globals.Status == Globals.UpgradeStatus.Install)) //To allow when fresh installing or installresources { attribValue += version + ","; } - else if (upgradeVersion != null && upgradeVersion > Package.InstalledVersion) + else if (upgradeVersion != null && upgradeVersion > this.Package.InstalledVersion) { attribValue += version + ","; } diff --git a/DNN Platform/Library/Services/Installer/Installers/ConfigInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/ConfigInstaller.cs index 9b100167e81..1d2efa5eeec 100644 --- a/DNN Platform/Library/Services/Installer/Installers/ConfigInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/ConfigInstaller.cs @@ -48,7 +48,7 @@ public string InstallConfig { get { - return _InstallConfig; + return this._InstallConfig; } } @@ -62,7 +62,7 @@ public XmlDocument TargetConfig { get { - return _TargetConfig; + return this._TargetConfig; } } @@ -76,7 +76,7 @@ public InstallFile TargetFile { get { - return _TargetFile; + return this._TargetFile; } } @@ -90,7 +90,7 @@ public string UnInstallConfig { get { - return _UnInstallConfig; + return this._UnInstallConfig; } } @@ -108,24 +108,24 @@ public override void Commit() { try { - if (string.IsNullOrEmpty(_FileName) && _xmlMerge.ConfigUpdateChangedNodes) + if (string.IsNullOrEmpty(this._FileName) && this._xmlMerge.ConfigUpdateChangedNodes) { //Save the XmlDocument - Config.Save(TargetConfig, TargetFile.FullName); - Log.AddInfo(Util.CONFIG_Committed + " - " + TargetFile.Name); + Config.Save(this.TargetConfig, this.TargetFile.FullName); + this.Log.AddInfo(Util.CONFIG_Committed + " - " + this.TargetFile.Name); } else { - _xmlMerge.SavePendingConfigs(); - foreach (var key in _xmlMerge.PendingDocuments.Keys) + this._xmlMerge.SavePendingConfigs(); + foreach (var key in this._xmlMerge.PendingDocuments.Keys) { - Log.AddInfo(Util.CONFIG_Committed + " - " + key); + this.Log.AddInfo(Util.CONFIG_Committed + " - " + key); } } } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -138,46 +138,46 @@ public override void Install() { try { - if (string.IsNullOrEmpty(_FileName)) + if (string.IsNullOrEmpty(this._FileName)) { //First backup the config file - Util.BackupFile(TargetFile, PhysicalSitePath, Log); + Util.BackupFile(this.TargetFile, this.PhysicalSitePath, this.Log); //Create an XmlDocument for the config file - _TargetConfig = new XmlDocument { XmlResolver = null }; - TargetConfig.Load(Path.Combine(PhysicalSitePath, TargetFile.FullName)); + this._TargetConfig = new XmlDocument { XmlResolver = null }; + this.TargetConfig.Load(Path.Combine(this.PhysicalSitePath, this.TargetFile.FullName)); //Create XmlMerge instance from InstallConfig source - _xmlMerge = new XmlMerge(new StringReader(InstallConfig), Package.Version.ToString(), Package.Name); + this._xmlMerge = new XmlMerge(new StringReader(this.InstallConfig), this.Package.Version.ToString(), this.Package.Name); //Update the Config file - Note that this method does not save the file - we will save it in Commit - _xmlMerge.UpdateConfig(TargetConfig); - Completed = true; - Log.AddInfo(Util.CONFIG_Updated + " - " + TargetFile.Name); + this._xmlMerge.UpdateConfig(this.TargetConfig); + this.Completed = true; + this.Log.AddInfo(Util.CONFIG_Updated + " - " + this.TargetFile.Name); } else { //Process external file - string strConfigFile = Path.Combine(Package.InstallerInfo.TempInstallFolder, _FileName); + string strConfigFile = Path.Combine(this.Package.InstallerInfo.TempInstallFolder, this._FileName); if (File.Exists(strConfigFile)) { //Create XmlMerge instance from config file source using (var stream = File.OpenText(strConfigFile)) { - _xmlMerge = new XmlMerge(stream, Package.Version.ToString(3), Package.Name + " Install"); + this._xmlMerge = new XmlMerge(stream, this.Package.Version.ToString(3), this.Package.Name + " Install"); //Process merge - _xmlMerge.UpdateConfigs(false); + this._xmlMerge.UpdateConfigs(false); } - Completed = true; - Log.AddInfo(Util.CONFIG_Updated); + this.Completed = true; + this.Log.AddInfo(Util.CONFIG_Updated); } } } catch (Exception ex) { - Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); + this.Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); } } @@ -188,10 +188,10 @@ public override void Install() /// ----------------------------------------------------------------------------- public override void ReadManifest(XPathNavigator manifestNav) { - _FileName = Util.ReadAttribute(manifestNav, "fileName"); - _UninstallFileName = Util.ReadAttribute(manifestNav, "unInstallFileName"); + this._FileName = Util.ReadAttribute(manifestNav, "fileName"); + this._UninstallFileName = Util.ReadAttribute(manifestNav, "unInstallFileName"); - if (string.IsNullOrEmpty(_FileName)) + if (string.IsNullOrEmpty(this._FileName)) { XPathNavigator nav = manifestNav.SelectSingleNode("config"); @@ -200,15 +200,15 @@ public override void ReadManifest(XPathNavigator manifestNav) string targetFileName = nodeNav.Value; if (!string.IsNullOrEmpty(targetFileName)) { - _TargetFile = new InstallFile(targetFileName, "", Package.InstallerInfo); + this._TargetFile = new InstallFile(targetFileName, "", this.Package.InstallerInfo); } //Get the Install config changes nodeNav = nav.SelectSingleNode("install"); - _InstallConfig = nodeNav.InnerXml; + this._InstallConfig = nodeNav.InnerXml; //Get the UnInstall config changes nodeNav = nav.SelectSingleNode("uninstall"); - _UnInstallConfig = nodeNav.InnerXml; + this._UnInstallConfig = nodeNav.InnerXml; } } @@ -221,7 +221,7 @@ public override void ReadManifest(XPathNavigator manifestNav) public override void Rollback() { //Do nothing as the changes are all in memory - Log.AddInfo(Util.CONFIG_RolledBack + " - " + TargetFile.Name); + this.Log.AddInfo(Util.CONFIG_RolledBack + " - " + this.TargetFile.Name); } /// ----------------------------------------------------------------------------- @@ -231,30 +231,30 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - if (string.IsNullOrEmpty(_UninstallFileName)) + if (string.IsNullOrEmpty(this._UninstallFileName)) { - if (!string.IsNullOrEmpty(UnInstallConfig)) + if (!string.IsNullOrEmpty(this.UnInstallConfig)) { //Create an XmlDocument for the config file - _TargetConfig = new XmlDocument { XmlResolver = null }; - TargetConfig.Load(Path.Combine(PhysicalSitePath, TargetFile.FullName)); + this._TargetConfig = new XmlDocument { XmlResolver = null }; + this.TargetConfig.Load(Path.Combine(this.PhysicalSitePath, this.TargetFile.FullName)); //Create XmlMerge instance from UnInstallConfig source - var merge = new XmlMerge(new StringReader(UnInstallConfig), Package.Version.ToString(), Package.Name); + var merge = new XmlMerge(new StringReader(this.UnInstallConfig), this.Package.Version.ToString(), this.Package.Name); //Update the Config file - Note that this method does save the file - merge.UpdateConfig(TargetConfig, TargetFile.FullName); + merge.UpdateConfig(this.TargetConfig, this.TargetFile.FullName); } } else { //Process external file - string strConfigFile = Path.Combine(Package.InstallerInfo.TempInstallFolder, _UninstallFileName); + string strConfigFile = Path.Combine(this.Package.InstallerInfo.TempInstallFolder, this._UninstallFileName); if (File.Exists(strConfigFile)) { //Create XmlMerge instance from config file source StreamReader stream = File.OpenText(strConfigFile); - var merge = new XmlMerge(stream, Package.Version.ToString(3), Package.Name + " UnInstall"); + var merge = new XmlMerge(stream, this.Package.Version.ToString(3), this.Package.Name + " UnInstall"); //Process merge merge.UpdateConfigs(); diff --git a/DNN Platform/Library/Services/Installer/Installers/FileInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/FileInstaller.cs index 228ab199fa4..e7d38096626 100644 --- a/DNN Platform/Library/Services/Installer/Installers/FileInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/FileInstaller.cs @@ -66,7 +66,7 @@ protected List Files { get { - return _Files; + return this._Files; } } @@ -108,7 +108,7 @@ protected virtual string PhysicalBasePath { get { - string _PhysicalBasePath = PhysicalSitePath + "\\" + BasePath; + string _PhysicalBasePath = this.PhysicalSitePath + "\\" + this.BasePath; if (!_PhysicalBasePath.EndsWith("\\")) { _PhysicalBasePath += "\\"; @@ -132,11 +132,11 @@ public bool DeleteFiles { get { - return _DeleteFiles; + return this._DeleteFiles; } set { - _DeleteFiles = value; + this._DeleteFiles = value; } } @@ -176,9 +176,9 @@ protected virtual void CommitFile(InstallFile insFile) /// ----------------------------------------------------------------------------- protected virtual void DeleteFile(InstallFile insFile) { - if (DeleteFiles) + if (this.DeleteFiles) { - Util.DeleteFile(insFile, PhysicalBasePath, Log); + Util.DeleteFile(insFile, this.PhysicalBasePath, this.Log); } } @@ -193,27 +193,27 @@ protected virtual bool InstallFile(InstallFile insFile) try { //Check the White Lists - if ((Package.InstallerInfo.IgnoreWhiteList || Util.IsFileValid(insFile, Package.InstallerInfo.AllowableFiles))) + if ((this.Package.InstallerInfo.IgnoreWhiteList || Util.IsFileValid(insFile, this.Package.InstallerInfo.AllowableFiles))) { //Install File - if (File.Exists(PhysicalBasePath + insFile.FullName)) + if (File.Exists(this.PhysicalBasePath + insFile.FullName)) { - Util.BackupFile(insFile, PhysicalBasePath, Log); + Util.BackupFile(insFile, this.PhysicalBasePath, this.Log); } //Copy file from temp location - Util.CopyFile(insFile, PhysicalBasePath, Log); + Util.CopyFile(insFile, this.PhysicalBasePath, this.Log); return true; } else { - Log.AddFailure(string.Format(Util.FILE_NotAllowed, insFile.FullName)); + this.Log.AddFailure(string.Format(Util.FILE_NotAllowed, insFile.FullName)); return false; } } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); return false; } } @@ -238,12 +238,12 @@ protected virtual bool IsCorrectType(InstallFileType type) /// ----------------------------------------------------------------------------- protected virtual void ProcessFile(InstallFile file, XPathNavigator nav) { - if (file != null && IsCorrectType(file.Type)) + if (file != null && this.IsCorrectType(file.Type)) { - Files.Add(file); + this.Files.Add(file); //Add to the - Package.InstallerInfo.Files[file.FullName.ToLowerInvariant()] = file; + this.Package.InstallerInfo.Files[file.FullName.ToLowerInvariant()] = file; } } @@ -273,7 +273,7 @@ protected virtual InstallFile ReadManifestItem(XPathNavigator nav, bool checkFil XPathNavigator pathNav = nav.SelectSingleNode("path"); if (pathNav == null) { - fileName = DefaultPath; + fileName = this.DefaultPath; } else { @@ -289,8 +289,8 @@ protected virtual InstallFile ReadManifestItem(XPathNavigator nav, bool checkFil //Get the sourceFileName string sourceFileName = Util.ReadElement(nav, "sourceFileName"); - var file = new InstallFile(fileName, sourceFileName, Package.InstallerInfo); - if ((!string.IsNullOrEmpty(BasePath)) && (BasePath.StartsWith("app_code", StringComparison.InvariantCultureIgnoreCase) && file.Type == InstallFileType.Other)) + var file = new InstallFile(fileName, sourceFileName, this.Package.InstallerInfo); + if ((!string.IsNullOrEmpty(this.BasePath)) && (this.BasePath.StartsWith("app_code", StringComparison.InvariantCultureIgnoreCase) && file.Type == InstallFileType.Other)) { file.Type = InstallFileType.AppCode; } @@ -304,7 +304,7 @@ protected virtual InstallFile ReadManifestItem(XPathNavigator nav, bool checkFil } else { - file.SetVersion(Package.Version); + file.SetVersion(this.Package.Version); } //Set the Action @@ -313,15 +313,15 @@ protected virtual InstallFile ReadManifestItem(XPathNavigator nav, bool checkFil { file.Action = strAction; } - if (InstallMode == InstallMode.Install && checkFileExists && file.Action != "UnRegister") + if (this.InstallMode == InstallMode.Install && checkFileExists && file.Action != "UnRegister") { if (File.Exists(file.TempFileName)) { - Log.AddInfo(string.Format(Util.FILE_Found, file.Path, file.Name)); + this.Log.AddInfo(string.Format(Util.FILE_Found, file.Path, file.Name)); } else { - Log.AddFailure(Util.FILE_NotFound + " - " + file.TempFileName); + this.Log.AddFailure(Util.FILE_NotFound + " - " + file.TempFileName); } } } @@ -340,11 +340,11 @@ protected virtual void RollbackFile(InstallFile installFile) { if (File.Exists(installFile.BackupFileName)) { - Util.RestoreFile(installFile, PhysicalBasePath, Log); + Util.RestoreFile(installFile, this.PhysicalBasePath, this.Log); } else { - DeleteFile(installFile); + this.DeleteFile(installFile); } } @@ -356,7 +356,7 @@ protected virtual void RollbackFile(InstallFile installFile) /// ----------------------------------------------------------------------------- protected virtual void UnInstallFile(InstallFile unInstallFile) { - DeleteFile(unInstallFile); + this.DeleteFile(unInstallFile); } #endregion @@ -374,15 +374,15 @@ public override void Commit() { try { - foreach (InstallFile file in Files) + foreach (InstallFile file in this.Files) { - CommitFile(file); + this.CommitFile(file); } - Completed = true; + this.Completed = true; } catch (Exception ex) { - Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); + this.Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); } } @@ -396,19 +396,19 @@ public override void Install() try { bool bSuccess = true; - foreach (InstallFile file in Files) + foreach (InstallFile file in this.Files) { - bSuccess = InstallFile(file); + bSuccess = this.InstallFile(file); if (!bSuccess) { break; } } - Completed = bSuccess; + this.Completed = bSuccess; } catch (Exception ex) { - Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); + this.Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); } } @@ -419,18 +419,18 @@ public override void Install() /// ----------------------------------------------------------------------------- public override void ReadManifest(XPathNavigator manifestNav) { - XPathNavigator rootNav = manifestNav.SelectSingleNode(CollectionNodeName); + XPathNavigator rootNav = manifestNav.SelectSingleNode(this.CollectionNodeName); if (rootNav != null) { XPathNavigator baseNav = rootNav.SelectSingleNode("basePath"); if (baseNav != null) { - BasePath = baseNav.Value; + this.BasePath = baseNav.Value; } - ReadCustomManifest(rootNav); - foreach (XPathNavigator nav in rootNav.Select(ItemNodeName)) + this.ReadCustomManifest(rootNav); + foreach (XPathNavigator nav in rootNav.Select(this.ItemNodeName)) { - ProcessFile(ReadManifestItem(nav, true), nav); + this.ProcessFile(this.ReadManifestItem(nav, true), nav); } } } @@ -445,15 +445,15 @@ public override void Rollback() { try { - foreach (InstallFile file in Files) + foreach (InstallFile file in this.Files) { - RollbackFile(file); + this.RollbackFile(file); } - Completed = true; + this.Completed = true; } catch (Exception ex) { - Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); + this.Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); } } @@ -466,15 +466,15 @@ public override void UnInstall() { try { - foreach (InstallFile file in Files) + foreach (InstallFile file in this.Files) { - UnInstallFile(file); + this.UnInstallFile(file); } - Completed = true; + this.Completed = true; } catch (Exception ex) { - Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); + this.Log.AddFailure(Util.EXCEPTION + " - " + ex.Message); } } diff --git a/DNN Platform/Library/Services/Installer/Installers/JavaScriptFileInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/JavaScriptFileInstaller.cs index 40fbc1cd814..2c0318ee98f 100644 --- a/DNN Platform/Library/Services/Installer/Installers/JavaScriptFileInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/JavaScriptFileInstaller.cs @@ -76,7 +76,7 @@ protected override void ReadCustomManifest(XPathNavigator nav) XPathNavigator libraryNav = nav.SelectSingleNode("libraryFolderName"); if (libraryNav != null) { - BasePath = String.Format("Resources\\Libraries\\{0}\\{1}", libraryNav.Value, Globals.FormatVersion(Package.Version, "00", 3, "_")); + this.BasePath = String.Format("Resources\\Libraries\\{0}\\{1}", libraryNav.Value, Globals.FormatVersion(this.Package.Version, "00", 3, "_")); } } diff --git a/DNN Platform/Library/Services/Installer/Installers/JavaScriptLibraryInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/JavaScriptLibraryInstaller.cs index 39ee3c1e1ca..7d6880c21b3 100644 --- a/DNN Platform/Library/Services/Installer/Installers/JavaScriptLibraryInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/JavaScriptLibraryInstaller.cs @@ -23,18 +23,18 @@ private void DeleteLibrary() try { //Attempt to get the Library - var library = JavaScriptLibraryController.Instance.GetLibrary(l => l.PackageID == Package.PackageID); + var library = JavaScriptLibraryController.Instance.GetLibrary(l => l.PackageID == this.Package.PackageID); if (library != null) { JavaScriptLibraryController.Instance.DeleteLibrary(library); - Log.AddInfo(string.Format(Util.LIBRARY_UnRegistered, library.LibraryName)); + this.Log.AddInfo(string.Format(Util.LIBRARY_UnRegistered, library.LibraryName)); } } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -47,55 +47,55 @@ public override void Install() try { //Attempt to get the JavaScript Library - _installedLibrary = JavaScriptLibraryController.Instance.GetLibrary(l => l.LibraryName == _library.LibraryName && l.Version == _library.Version); + this._installedLibrary = JavaScriptLibraryController.Instance.GetLibrary(l => l.LibraryName == this._library.LibraryName && l.Version == this._library.Version); - if (_installedLibrary != null) + if (this._installedLibrary != null) { - _library.JavaScriptLibraryID = _installedLibrary.JavaScriptLibraryID; + this._library.JavaScriptLibraryID = this._installedLibrary.JavaScriptLibraryID; } //Save JavaScript Library to database - _library.PackageID = Package.PackageID; - JavaScriptLibraryController.Instance.SaveLibrary(_library); + this._library.PackageID = this.Package.PackageID; + JavaScriptLibraryController.Instance.SaveLibrary(this._library); - Completed = true; - Log.AddInfo(string.Format(Util.LIBRARY_Registered, _library.LibraryName)); + this.Completed = true; + this.Log.AddInfo(string.Format(Util.LIBRARY_Registered, this._library.LibraryName)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } public override void ReadManifest(XPathNavigator manifestNav) { //Load the JavaScript Library from the manifest - _library = CBO.DeserializeObject(new StringReader(manifestNav.InnerXml)); - _library.Version = Package.Version; + this._library = CBO.DeserializeObject(new StringReader(manifestNav.InnerXml)); + this._library.Version = this.Package.Version; - if (Log.Valid) + if (this.Log.Valid) { - Log.AddInfo(Util.LIBRARY_ReadSuccess); + this.Log.AddInfo(Util.LIBRARY_ReadSuccess); } } public override void Rollback() { //If Temp Library exists then we need to update the DataStore with this - if (_installedLibrary == null) + if (this._installedLibrary == null) { //No Temp Library - Delete newly added library - DeleteLibrary(); + this.DeleteLibrary(); } else { //Temp Library - Rollback to Temp - JavaScriptLibraryController.Instance.SaveLibrary(_installedLibrary); + JavaScriptLibraryController.Instance.SaveLibrary(this._installedLibrary); } } public override void UnInstall() { - DeleteLibrary(); + this.DeleteLibrary(); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/LanguageInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/LanguageInstaller.cs index f824ecf4e1e..b9438a8dd45 100644 --- a/DNN Platform/Library/Services/Installer/Installers/LanguageInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/LanguageInstaller.cs @@ -37,7 +37,7 @@ public class LanguageInstaller : FileInstaller public LanguageInstaller(LanguagePackType type) { - LanguagePackType = type; + this.LanguagePackType = type; } #region Protected Properties @@ -96,7 +96,7 @@ private void DeleteLanguage() try { //Attempt to get the LanguagePack - LanguagePackInfo tempLanguagePack = LanguagePackController.GetLanguagePackByPackage(Package.PackageID); + LanguagePackInfo tempLanguagePack = LanguagePackController.GetLanguagePackByPackage(this.Package.PackageID); //Attempt to get the Locale Locale language = LocaleController.Instance.GetLocale(tempLanguagePack.LanguageID); @@ -112,11 +112,11 @@ private void DeleteLanguage() // Localization.Localization.DeleteLanguage(language); //} - Log.AddInfo(string.Format(Util.LANGUAGE_UnRegistered, language.Text)); + this.Log.AddInfo(string.Format(Util.LANGUAGE_UnRegistered, language.Text)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -132,17 +132,17 @@ private void DeleteLanguage() /// ----------------------------------------------------------------------------- protected override void ReadCustomManifest(XPathNavigator nav) { - Language = new Locale(); - LanguagePack = new LanguagePackInfo(); + this.Language = new Locale(); + this.LanguagePack = new LanguagePackInfo(); //Get the Skin name - Language.Code = Util.ReadElement(nav, "code"); - Language.Text = Util.ReadElement(nav, "displayName"); - Language.Fallback = Util.ReadElement(nav, "fallback"); + this.Language.Code = Util.ReadElement(nav, "code"); + this.Language.Text = Util.ReadElement(nav, "displayName"); + this.Language.Fallback = Util.ReadElement(nav, "fallback"); - if (LanguagePackType == LanguagePackType.Core) + if (this.LanguagePackType == LanguagePackType.Core) { - LanguagePack.DependentPackageID = -2; + this.LanguagePack.DependentPackageID = -2; } else { @@ -150,7 +150,7 @@ protected override void ReadCustomManifest(XPathNavigator nav) PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.Name.Equals(packageName, StringComparison.OrdinalIgnoreCase)); if (package != null) { - LanguagePack.DependentPackageID = package.PackageID; + this.LanguagePack.DependentPackageID = package.PackageID; } } @@ -170,14 +170,14 @@ protected override void ReadCustomManifest(XPathNavigator nav) /// ----------------------------------------------------------------------------- public override void Commit() { - if (LanguagePackType == LanguagePackType.Core || LanguagePack.DependentPackageID > 0) + if (this.LanguagePackType == LanguagePackType.Core || this.LanguagePack.DependentPackageID > 0) { base.Commit(); } else { - Completed = true; - Skipped = true; + this.Completed = true; + this.Skipped = true; } } @@ -188,50 +188,50 @@ public override void Commit() /// ----------------------------------------------------------------------------- public override void Install() { - if (LanguagePackType == LanguagePackType.Core || LanguagePack.DependentPackageID > 0) + if (this.LanguagePackType == LanguagePackType.Core || this.LanguagePack.DependentPackageID > 0) { try { //Attempt to get the LanguagePack - InstalledLanguagePack = LanguagePackController.GetLanguagePackByPackage(Package.PackageID); - if (InstalledLanguagePack != null) + this.InstalledLanguagePack = LanguagePackController.GetLanguagePackByPackage(this.Package.PackageID); + if (this.InstalledLanguagePack != null) { - LanguagePack.LanguagePackID = InstalledLanguagePack.LanguagePackID; + this.LanguagePack.LanguagePackID = this.InstalledLanguagePack.LanguagePackID; } //Attempt to get the Locale - TempLanguage = LocaleController.Instance.GetLocale(Language.Code); - if (TempLanguage != null) + this.TempLanguage = LocaleController.Instance.GetLocale(this.Language.Code); + if (this.TempLanguage != null) { - Language.LanguageId = TempLanguage.LanguageId; + this.Language.LanguageId = this.TempLanguage.LanguageId; } - if (LanguagePack.PackageType == LanguagePackType.Core) + if (this.LanguagePack.PackageType == LanguagePackType.Core) { //Update language - Localization.Localization.SaveLanguage(Language); + Localization.Localization.SaveLanguage(this.Language); } //Set properties for Language Pack - LanguagePack.PackageID = Package.PackageID; - LanguagePack.LanguageID = Language.LanguageId; + this.LanguagePack.PackageID = this.Package.PackageID; + this.LanguagePack.LanguageID = this.Language.LanguageId; //Update LanguagePack - LanguagePackController.SaveLanguagePack(LanguagePack); + LanguagePackController.SaveLanguagePack(this.LanguagePack); - Log.AddInfo(string.Format(Util.LANGUAGE_Registered, Language.Text)); + this.Log.AddInfo(string.Format(Util.LANGUAGE_Registered, this.Language.Text)); //install (copy the files) by calling the base class base.Install(); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } else { - Completed = true; - Skipped = true; + this.Completed = true; + this.Skipped = true; } } @@ -244,15 +244,15 @@ public override void Install() public override void Rollback() { //If Temp Language exists then we need to update the DataStore with this - if (TempLanguage == null) + if (this.TempLanguage == null) { //No Temp Language - Delete newly added Language - DeleteLanguage(); + this.DeleteLanguage(); } else { //Temp Language - Rollback to Temp - Localization.Localization.SaveLanguage(TempLanguage); + Localization.Localization.SaveLanguage(this.TempLanguage); } //Call base class to prcoess files @@ -266,7 +266,7 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - DeleteLanguage(); + this.DeleteLanguage(); //Call base class to prcoess files base.UnInstall(); diff --git a/DNN Platform/Library/Services/Installer/Installers/ModuleInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/ModuleInstaller.cs index 29371ef522f..51e502e24ec 100644 --- a/DNN Platform/Library/Services/Installer/Installers/ModuleInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/ModuleInstaller.cs @@ -69,19 +69,19 @@ private void DeleteModule() try { //Attempt to get the Desktop Module - DesktopModuleInfo tempDesktopModule = DesktopModuleController.GetDesktopModuleByPackageID(Package.PackageID); + DesktopModuleInfo tempDesktopModule = DesktopModuleController.GetDesktopModuleByPackageID(this.Package.PackageID); if (tempDesktopModule != null) { var modules = ModuleController.Instance.GetModulesByDesktopModuleId(tempDesktopModule.DesktopModuleID); //Remove CodeSubDirectory - if ((_desktopModule != null) && (!string.IsNullOrEmpty(_desktopModule.CodeSubDirectory))) + if ((this._desktopModule != null) && (!string.IsNullOrEmpty(this._desktopModule.CodeSubDirectory))) { - Config.RemoveCodeSubDirectory(_desktopModule.CodeSubDirectory); + Config.RemoveCodeSubDirectory(this._desktopModule.CodeSubDirectory); } var controller = new DesktopModuleController(); - Log.AddInfo(string.Format(Util.MODULE_UnRegistered, tempDesktopModule.ModuleName)); + this.Log.AddInfo(string.Format(Util.MODULE_UnRegistered, tempDesktopModule.ModuleName)); //remove admin/host pages if (!String.IsNullOrEmpty(tempDesktopModule.AdminPage)) { @@ -108,10 +108,10 @@ private void DeleteModule() } if (noOtherTabModule) { - Log.AddInfo(string.Format(Util.MODULE_AdminPageRemoved, tempDesktopModule.AdminPage, portal.PortalID)); + this.Log.AddInfo(string.Format(Util.MODULE_AdminPageRemoved, tempDesktopModule.AdminPage, portal.PortalID)); TabController.Instance.DeleteTab(tabID, portal.PortalID); } - Log.AddInfo(string.Format(Util.MODULE_AdminPagemoduleRemoved, tempDesktopModule.AdminPage, portal.PortalID)); + this.Log.AddInfo(string.Format(Util.MODULE_AdminPagemoduleRemoved, tempDesktopModule.AdminPage, portal.PortalID)); } } @@ -119,8 +119,8 @@ private void DeleteModule() if (!String.IsNullOrEmpty(tempDesktopModule.HostPage)) { Upgrade.Upgrade.RemoveHostPage(tempDesktopModule.HostPage); - Log.AddInfo(string.Format(Util.MODULE_HostPageRemoved, tempDesktopModule.HostPage)); - Log.AddInfo(string.Format(Util.MODULE_HostPagemoduleRemoved, tempDesktopModule.HostPage)); + this.Log.AddInfo(string.Format(Util.MODULE_HostPageRemoved, tempDesktopModule.HostPage)); + this.Log.AddInfo(string.Format(Util.MODULE_HostPagemoduleRemoved, tempDesktopModule.HostPage)); } controller.DeleteDesktopModule(tempDesktopModule); @@ -136,7 +136,7 @@ private void DeleteModule() } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -153,11 +153,11 @@ private void DeleteModule() public override void Commit() { //Add CodeSubDirectory - if (!string.IsNullOrEmpty(_desktopModule.CodeSubDirectory)) + if (!string.IsNullOrEmpty(this._desktopModule.CodeSubDirectory)) { - Config.AddCodeSubDirectory(_desktopModule.CodeSubDirectory); + Config.AddCodeSubDirectory(this._desktopModule.CodeSubDirectory); } - if (_desktopModule.SupportedFeatures == Null.NullInteger) + if (this._desktopModule.SupportedFeatures == Null.NullInteger) { //Set an Event Message so the features are loaded by reflection on restart var oAppStartMessage = new EventMessage @@ -171,65 +171,65 @@ public override void Commit() }; //Add custom Attributes for this message - oAppStartMessage.Attributes.Add("BusinessControllerClass", _desktopModule.BusinessControllerClass); - oAppStartMessage.Attributes.Add("desktopModuleID", _desktopModule.DesktopModuleID.ToString()); + oAppStartMessage.Attributes.Add("BusinessControllerClass", this._desktopModule.BusinessControllerClass); + oAppStartMessage.Attributes.Add("desktopModuleID", this._desktopModule.DesktopModuleID.ToString()); //send it to occur on next App_Start Event EventQueueController.SendMessage(oAppStartMessage, "Application_Start_FirstRequest"); } //Add Event Message - if (_eventMessage != null) + if (this._eventMessage != null) { - if (!String.IsNullOrEmpty(_eventMessage.Attributes["UpgradeVersionsList"])) + if (!String.IsNullOrEmpty(this._eventMessage.Attributes["UpgradeVersionsList"])) { - _eventMessage.Attributes.Set("desktopModuleID", _desktopModule.DesktopModuleID.ToString()); - EventQueueController.SendMessage(_eventMessage, "Application_Start"); + this._eventMessage.Attributes.Set("desktopModuleID", this._desktopModule.DesktopModuleID.ToString()); + EventQueueController.SendMessage(this._eventMessage, "Application_Start"); } } //Add DesktopModule to all portals - if (!_desktopModule.IsPremium) + if (!this._desktopModule.IsPremium) { - DesktopModuleController.AddDesktopModuleToPortals(_desktopModule.DesktopModuleID); + DesktopModuleController.AddDesktopModuleToPortals(this._desktopModule.DesktopModuleID); } //Add DesktopModule to all portals - if (!String.IsNullOrEmpty(_desktopModule.AdminPage)) + if (!String.IsNullOrEmpty(this._desktopModule.AdminPage)) { foreach (PortalInfo portal in PortalController.Instance.GetPortals()) { bool createdNewPage = false, addedNewModule = false; - DesktopModuleController.AddDesktopModulePageToPortal(_desktopModule, _desktopModule.AdminPage, portal.PortalID, ref createdNewPage, ref addedNewModule); + DesktopModuleController.AddDesktopModulePageToPortal(this._desktopModule, this._desktopModule.AdminPage, portal.PortalID, ref createdNewPage, ref addedNewModule); if (createdNewPage) { - Log.AddInfo(string.Format(Util.MODULE_AdminPageAdded, _desktopModule.AdminPage, portal.PortalID)); + this.Log.AddInfo(string.Format(Util.MODULE_AdminPageAdded, this._desktopModule.AdminPage, portal.PortalID)); } if (addedNewModule) { - Log.AddInfo(string.Format(Util.MODULE_AdminPagemoduleAdded, _desktopModule.AdminPage,portal.PortalID)); + this.Log.AddInfo(string.Format(Util.MODULE_AdminPagemoduleAdded, this._desktopModule.AdminPage,portal.PortalID)); } } } //Add host items - if (_desktopModule.Page != null && !String.IsNullOrEmpty(_desktopModule.HostPage)) + if (this._desktopModule.Page != null && !String.IsNullOrEmpty(this._desktopModule.HostPage)) { bool createdNewPage = false, addedNewModule = false; - DesktopModuleController.AddDesktopModulePageToPortal(_desktopModule, _desktopModule.HostPage, Null.NullInteger, ref createdNewPage, ref addedNewModule); + DesktopModuleController.AddDesktopModulePageToPortal(this._desktopModule, this._desktopModule.HostPage, Null.NullInteger, ref createdNewPage, ref addedNewModule); if (createdNewPage) { - Log.AddInfo(string.Format(Util.MODULE_HostPageAdded, _desktopModule.HostPage)); + this.Log.AddInfo(string.Format(Util.MODULE_HostPageAdded, this._desktopModule.HostPage)); } if (addedNewModule) { - Log.AddInfo(string.Format(Util.MODULE_HostPagemoduleAdded, _desktopModule.HostPage)); + this.Log.AddInfo(string.Format(Util.MODULE_HostPagemoduleAdded, this._desktopModule.HostPage)); } } } @@ -244,13 +244,13 @@ public override void Install() try { //Attempt to get the Desktop Module - _installedDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName(_desktopModule.ModuleName, Package.InstallerInfo.PortalID); + this._installedDesktopModule = DesktopModuleController.GetDesktopModuleByModuleName(this._desktopModule.ModuleName, this.Package.InstallerInfo.PortalID); - if (_installedDesktopModule != null) + if (this._installedDesktopModule != null) { - _desktopModule.DesktopModuleID = _installedDesktopModule.DesktopModuleID; + this._desktopModule.DesktopModuleID = this._installedDesktopModule.DesktopModuleID; //save the module's category - _desktopModule.Category = _installedDesktopModule.Category; + this._desktopModule.Category = this._installedDesktopModule.Category; } //Clear ModuleControls and Module Definitions caches in case script has modifed the contents @@ -258,15 +258,15 @@ public override void Install() DataCache.RemoveCache(DataCache.ModuleControlsCacheKey); //Save DesktopModule and child objects to database - _desktopModule.PackageID = Package.PackageID; - _desktopModule.DesktopModuleID = DesktopModuleController.SaveDesktopModule(_desktopModule, true, false); + this._desktopModule.PackageID = this.Package.PackageID; + this._desktopModule.DesktopModuleID = DesktopModuleController.SaveDesktopModule(this._desktopModule, true, false); - Completed = true; - Log.AddInfo(string.Format(Util.MODULE_Registered, _desktopModule.ModuleName)); + this.Completed = true; + this.Log.AddInfo(string.Format(Util.MODULE_Registered, this._desktopModule.ModuleName)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -278,20 +278,20 @@ public override void Install() public override void ReadManifest(XPathNavigator manifestNav) { //Load the Desktop Module from the manifest - _desktopModule = CBO.DeserializeObject(new StringReader(manifestNav.InnerXml)); - - _desktopModule.FriendlyName = Package.FriendlyName; - _desktopModule.Description = Package.Description; - _desktopModule.Version = Globals.FormatVersion(Package.Version, "00", 4, "."); - _desktopModule.CompatibleVersions = Null.NullString; - _desktopModule.Dependencies = Null.NullString; - _desktopModule.Permissions = Null.NullString; - if (string.IsNullOrEmpty(_desktopModule.BusinessControllerClass)) + this._desktopModule = CBO.DeserializeObject(new StringReader(manifestNav.InnerXml)); + + this._desktopModule.FriendlyName = this.Package.FriendlyName; + this._desktopModule.Description = this.Package.Description; + this._desktopModule.Version = Globals.FormatVersion(this.Package.Version, "00", 4, "."); + this._desktopModule.CompatibleVersions = Null.NullString; + this._desktopModule.Dependencies = Null.NullString; + this._desktopModule.Permissions = Null.NullString; + if (string.IsNullOrEmpty(this._desktopModule.BusinessControllerClass)) { - _desktopModule.SupportedFeatures = 0; + this._desktopModule.SupportedFeatures = 0; } - _eventMessage = ReadEventMessageNode(manifestNav); + this._eventMessage = this.ReadEventMessageNode(manifestNav); //Load permissions (to add) foreach (XPathNavigator moduleDefinitionNav in manifestNav.Select("desktopModule/moduleDefinitions/moduleDefinition")) @@ -303,16 +303,16 @@ public override void ReadManifest(XPathNavigator manifestNav) permission.PermissionCode = Util.ReadAttribute(permissionNav, "code"); permission.PermissionKey = Util.ReadAttribute(permissionNav, "key"); permission.PermissionName = Util.ReadAttribute(permissionNav, "name"); - ModuleDefinitionInfo moduleDefinition = _desktopModule.ModuleDefinitions[friendlyName]; + ModuleDefinitionInfo moduleDefinition = this._desktopModule.ModuleDefinitions[friendlyName]; if (moduleDefinition != null) { moduleDefinition.Permissions.Add(permission.PermissionKey, permission); } } } - if (Log.Valid) + if (this.Log.Valid) { - Log.AddInfo(Util.MODULE_ReadSuccess); + this.Log.AddInfo(Util.MODULE_ReadSuccess); } } @@ -325,15 +325,15 @@ public override void ReadManifest(XPathNavigator manifestNav) public override void Rollback() { //If Temp Module exists then we need to update the DataStore with this - if (_installedDesktopModule == null) + if (this._installedDesktopModule == null) { //No Temp Module - Delete newly added module - DeleteModule(); + this.DeleteModule(); } else { //Temp Module - Rollback to Temp - DesktopModuleController.SaveDesktopModule(_installedDesktopModule, true, false); + DesktopModuleController.SaveDesktopModule(this._installedDesktopModule, true, false); } } @@ -344,7 +344,7 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - DeleteModule(); + this.DeleteModule(); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/PackageInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/PackageInstaller.cs index 00bafe1df3e..81dff7e9de6 100644 --- a/DNN Platform/Library/Services/Installer/Installers/PackageInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/PackageInstaller.cs @@ -44,15 +44,15 @@ public class PackageInstaller : ComponentInstallerBase /// ----------------------------------------------------------------------------- public PackageInstaller(PackageInfo package) { - IsValid = true; - DeleteFiles = Null.NullBoolean; - Package = package; + this.IsValid = true; + this.DeleteFiles = Null.NullBoolean; + this.Package = package; if (!string.IsNullOrEmpty(package.Manifest)) { //Create an XPathDocument from the Xml var doc = new XPathDocument(new StringReader(package.Manifest)); XPathNavigator nav = doc.CreateNavigator().SelectSingleNode("package"); - ReadComponents(nav); + this.ReadComponents(nav); } else { @@ -64,7 +64,7 @@ public PackageInstaller(PackageInfo package) //Set type installer.Type = package.PackageType; - _componentInstallers.Add(0, installer); + this._componentInstallers.Add(0, installer); } } } @@ -78,17 +78,17 @@ public PackageInstaller(PackageInfo package) /// ----------------------------------------------------------------------------- public PackageInstaller(string packageManifest, InstallerInfo info) { - IsValid = true; - DeleteFiles = Null.NullBoolean; - Package = new PackageInfo(info); - Package.Manifest = packageManifest; + this.IsValid = true; + this.DeleteFiles = Null.NullBoolean; + this.Package = new PackageInfo(info); + this.Package.Manifest = packageManifest; if (!string.IsNullOrEmpty(packageManifest)) { //Create an XPathDocument from the Xml var doc = new XPathDocument(new StringReader(packageManifest)); XPathNavigator nav = doc.CreateNavigator().SelectSingleNode("package"); - ReadManifest(nav); + this.ReadManifest(nav); } } @@ -124,21 +124,21 @@ public PackageInstaller(string packageManifest, InstallerInfo info) /// ----------------------------------------------------------------------------- private void CheckSecurity() { - PackageType type = PackageController.Instance.GetExtensionPackageType(t => t.PackageType.Equals(Package.PackageType, StringComparison.OrdinalIgnoreCase)); + PackageType type = PackageController.Instance.GetExtensionPackageType(t => t.PackageType.Equals(this.Package.PackageType, StringComparison.OrdinalIgnoreCase)); if (type == null) { //This package type not registered - Log.Logs.Clear(); - Log.AddFailure(Util.SECURITY_NotRegistered + " - " + Package.PackageType); - IsValid = false; + this.Log.Logs.Clear(); + this.Log.AddFailure(Util.SECURITY_NotRegistered + " - " + this.Package.PackageType); + this.IsValid = false; } else { - if (type.SecurityAccessLevel > Package.InstallerInfo.SecurityAccessLevel) + if (type.SecurityAccessLevel > this.Package.InstallerInfo.SecurityAccessLevel) { - Log.Logs.Clear(); - Log.AddFailure(Util.SECURITY_Installer); - IsValid = false; + this.Log.Logs.Clear(); + this.Log.AddFailure(Util.SECURITY_Installer); + this.IsValid = false; } } } @@ -153,10 +153,10 @@ private void ReadComponents(XPathNavigator manifestNav) foreach (XPathNavigator componentNav in manifestNav.CreateNavigator().Select("components/component")) { //Set default order to next value (ie the same as the size of the collection) - int order = _componentInstallers.Count; + int order = this._componentInstallers.Count; string type = componentNav.GetAttribute("type", ""); - if (InstallMode == InstallMode.Install) + if (this.InstallMode == InstallMode.Install) { string installOrder = componentNav.GetAttribute("installOrder", ""); if (!string.IsNullOrEmpty(installOrder)) @@ -172,19 +172,19 @@ private void ReadComponents(XPathNavigator manifestNav) order = int.Parse(unInstallOrder); } } - if (Package.InstallerInfo != null) + if (this.Package.InstallerInfo != null) { - Log.AddInfo(Util.DNN_ReadingComponent + " - " + type); + this.Log.AddInfo(Util.DNN_ReadingComponent + " - " + type); } - ComponentInstallerBase installer = InstallerFactory.GetInstaller(componentNav, Package); + ComponentInstallerBase installer = InstallerFactory.GetInstaller(componentNav, this.Package); if (installer == null) { - Log.AddFailure(Util.EXCEPTION_InstallerCreate); + this.Log.AddFailure(Util.EXCEPTION_InstallerCreate); } else { - _componentInstallers.Add(order, installer); - Package.InstallerInfo.AllowableFiles += ", " + installer.AllowableFiles; + this._componentInstallers.Add(order, installer); + this.Package.InstallerInfo.AllowableFiles += ", " + installer.AllowableFiles; } } } @@ -192,10 +192,10 @@ private void ReadComponents(XPathNavigator manifestNav) private string ReadTextFromFile(string source) { string strText = Null.NullString; - if (Package.InstallerInfo.InstallMode != InstallMode.ManifestOnly) + if (this.Package.InstallerInfo.InstallMode != InstallMode.ManifestOnly) { //Load from file - strText = FileSystemUtils.ReadFile(Package.InstallerInfo.TempInstallFolder + "\\" + source); + strText = FileSystemUtils.ReadFile(this.Package.InstallerInfo.TempInstallFolder + "\\" + source); } return strText; } @@ -211,31 +211,31 @@ private string ReadTextFromFile(string source) /// ----------------------------------------------------------------------------- public override void Commit() { - for (int index = 0; index <= _componentInstallers.Count - 1; index++) + for (int index = 0; index <= this._componentInstallers.Count - 1; index++) { - ComponentInstallerBase compInstaller = _componentInstallers.Values[index]; - if (compInstaller.Version >= Package.InstalledVersion && compInstaller.Completed) + ComponentInstallerBase compInstaller = this._componentInstallers.Values[index]; + if (compInstaller.Version >= this.Package.InstalledVersion && compInstaller.Completed) { compInstaller.Commit(); } } //Add Event Message - if (_eventMessage != null && !String.IsNullOrEmpty(_eventMessage.Attributes["UpgradeVersionsList"])) + if (this._eventMessage != null && !String.IsNullOrEmpty(this._eventMessage.Attributes["UpgradeVersionsList"])) { - _eventMessage.Attributes.Set("desktopModuleID", Null.NullInteger.ToString()); - EventQueueController.SendMessage(_eventMessage, "Application_Start"); + this._eventMessage.Attributes.Set("desktopModuleID", Null.NullInteger.ToString()); + EventQueueController.SendMessage(this._eventMessage, "Application_Start"); } - if (Log.Valid) + if (this.Log.Valid) { - Log.AddInfo(Util.INSTALL_Committed); + this.Log.AddInfo(Util.INSTALL_Committed); } else { - Log.AddFailure(Util.INSTALL_Aborted); + this.Log.AddFailure(Util.INSTALL_Aborted); } - Package.InstallerInfo.PackageID = Package.PackageID; + this.Package.InstallerInfo.PackageID = this.Package.PackageID; } /// ----------------------------------------------------------------------------- @@ -249,36 +249,36 @@ public override void Install() try { //Save the Package Information - if (_installedPackage != null) + if (this._installedPackage != null) { - Package.PackageID = _installedPackage.PackageID; + this.Package.PackageID = this._installedPackage.PackageID; } //Save Package - PackageController.Instance.SaveExtensionPackage(Package); + PackageController.Instance.SaveExtensionPackage(this.Package); //Iterate through all the Components - for (int index = 0; index <= _componentInstallers.Count - 1; index++) + for (int index = 0; index <= this._componentInstallers.Count - 1; index++) { - ComponentInstallerBase compInstaller = _componentInstallers.Values[index]; - if ((_installedPackage == null) || (compInstaller.Version > Package.InstalledVersion) || (Package.InstallerInfo.RepairInstall)) + ComponentInstallerBase compInstaller = this._componentInstallers.Values[index]; + if ((this._installedPackage == null) || (compInstaller.Version > this.Package.InstalledVersion) || (this.Package.InstallerInfo.RepairInstall)) { - Log.AddInfo(Util.INSTALL_Start + " - " + compInstaller.Type); + this.Log.AddInfo(Util.INSTALL_Start + " - " + compInstaller.Type); compInstaller.Install(); if (compInstaller.Completed) { if (compInstaller.Skipped) { - Log.AddInfo(Util.COMPONENT_Skipped + " - " + compInstaller.Type); + this.Log.AddInfo(Util.COMPONENT_Skipped + " - " + compInstaller.Type); } else { - Log.AddInfo(Util.COMPONENT_Installed + " - " + compInstaller.Type); + this.Log.AddInfo(Util.COMPONENT_Installed + " - " + compInstaller.Type); } } else { - Log.AddFailure(Util.INSTALL_Failed + " - " + compInstaller.Type); + this.Log.AddFailure(Util.INSTALL_Failed + " - " + compInstaller.Type); isCompleted = false; break; } @@ -287,17 +287,17 @@ public override void Install() } catch (Exception ex) { - Log.AddFailure(Util.INSTALL_Aborted + " - " + Package.Name + ":" + ex.Message); + this.Log.AddFailure(Util.INSTALL_Aborted + " - " + this.Package.Name + ":" + ex.Message); } if (isCompleted) { //All components successfully installed so Commit any pending changes - Commit(); + this.Commit(); } else { //There has been a failure so Rollback - Rollback(); + this.Rollback(); } } @@ -309,34 +309,34 @@ public override void Install() public override void ReadManifest(XPathNavigator manifestNav) { //Get Name Property - Package.Name = Util.ReadAttribute(manifestNav, "name", Log, Util.EXCEPTION_NameMissing); + this.Package.Name = Util.ReadAttribute(manifestNav, "name", this.Log, Util.EXCEPTION_NameMissing); //Get Type - Package.PackageType = Util.ReadAttribute(manifestNav, "type", Log, Util.EXCEPTION_TypeMissing); + this.Package.PackageType = Util.ReadAttribute(manifestNav, "type", this.Log, Util.EXCEPTION_TypeMissing); //If Skin or Container then set PortalID - if (Package.PackageType.Equals("Skin", StringComparison.OrdinalIgnoreCase) || Package.PackageType.Equals("Container", StringComparison.OrdinalIgnoreCase)) + if (this.Package.PackageType.Equals("Skin", StringComparison.OrdinalIgnoreCase) || this.Package.PackageType.Equals("Container", StringComparison.OrdinalIgnoreCase)) { - Package.PortalID = Package.InstallerInfo.PortalID; + this.Package.PortalID = this.Package.InstallerInfo.PortalID; } - CheckSecurity(); - if (!IsValid) + this.CheckSecurity(); + if (!this.IsValid) { return; } //Get IsSystem - Package.IsSystemPackage = bool.Parse(Util.ReadAttribute(manifestNav, "isSystem", false, Log, "", bool.FalseString)); + this.Package.IsSystemPackage = bool.Parse(Util.ReadAttribute(manifestNav, "isSystem", false, this.Log, "", bool.FalseString)); //Get Version - string strVersion = Util.ReadAttribute(manifestNav, "version", Log, Util.EXCEPTION_VersionMissing); + string strVersion = Util.ReadAttribute(manifestNav, "version", this.Log, Util.EXCEPTION_VersionMissing); if (string.IsNullOrEmpty(strVersion)) { - IsValid = false; + this.IsValid = false; } - if (IsValid) + if (this.IsValid) { - Package.Version = new Version(strVersion); + this.Package.Version = new Version(strVersion); } else { @@ -344,71 +344,71 @@ public override void ReadManifest(XPathNavigator manifestNav) } //Attempt to get the Package from the Data Store (see if its installed) - var packageType = PackageController.Instance.GetExtensionPackageType(t => t.PackageType.Equals(Package.PackageType, StringComparison.OrdinalIgnoreCase)); + var packageType = PackageController.Instance.GetExtensionPackageType(t => t.PackageType.Equals(this.Package.PackageType, StringComparison.OrdinalIgnoreCase)); if (packageType.SupportsSideBySideInstallation) { - _installedPackage = PackageController.Instance.GetExtensionPackage(Package.PortalID, p => p.Name.Equals(Package.Name, StringComparison.OrdinalIgnoreCase) - && p.PackageType.Equals(Package.PackageType, StringComparison.OrdinalIgnoreCase) - && p.Version == Package.Version); + this._installedPackage = PackageController.Instance.GetExtensionPackage(this.Package.PortalID, p => p.Name.Equals(this.Package.Name, StringComparison.OrdinalIgnoreCase) + && p.PackageType.Equals(this.Package.PackageType, StringComparison.OrdinalIgnoreCase) + && p.Version == this.Package.Version); } else { - _installedPackage = PackageController.Instance.GetExtensionPackage(Package.PortalID, p => p.Name.Equals(Package.Name, StringComparison.OrdinalIgnoreCase) - && p.PackageType.Equals(Package.PackageType, StringComparison.OrdinalIgnoreCase)); + this._installedPackage = PackageController.Instance.GetExtensionPackage(this.Package.PortalID, p => p.Name.Equals(this.Package.Name, StringComparison.OrdinalIgnoreCase) + && p.PackageType.Equals(this.Package.PackageType, StringComparison.OrdinalIgnoreCase)); } - if (_installedPackage != null) + if (this._installedPackage != null) { - Package.InstalledVersion = _installedPackage.Version; - Package.InstallerInfo.PackageID = _installedPackage.PackageID; + this.Package.InstalledVersion = this._installedPackage.Version; + this.Package.InstallerInfo.PackageID = this._installedPackage.PackageID; - if (Package.InstalledVersion > Package.Version) + if (this.Package.InstalledVersion > this.Package.Version) { - Log.AddFailure(Util.INSTALL_Version + " - " + Package.InstalledVersion.ToString(3)); - IsValid = false; + this.Log.AddFailure(Util.INSTALL_Version + " - " + this.Package.InstalledVersion.ToString(3)); + this.IsValid = false; } - else if (Package.InstalledVersion == Package.Version) + else if (this.Package.InstalledVersion == this.Package.Version) { - Package.InstallerInfo.Installed = true; - Package.InstallerInfo.PortalID = _installedPackage.PortalID; + this.Package.InstallerInfo.Installed = true; + this.Package.InstallerInfo.PortalID = this._installedPackage.PortalID; } } - Log.AddInfo(Util.DNN_ReadingPackage + " - " + Package.PackageType + " - " + Package.Name); - Package.FriendlyName = Util.ReadElement(manifestNav, "friendlyName", Package.Name); - Package.Description = Util.ReadElement(manifestNav, "description"); + this.Log.AddInfo(Util.DNN_ReadingPackage + " - " + this.Package.PackageType + " - " + this.Package.Name); + this.Package.FriendlyName = Util.ReadElement(manifestNav, "friendlyName", this.Package.Name); + this.Package.Description = Util.ReadElement(manifestNav, "description"); XPathNavigator foldernameNav = null; - Package.FolderName = String.Empty; - switch (Package.PackageType) + this.Package.FolderName = String.Empty; + switch (this.Package.PackageType) { case "Module": //In Dynamics moduels, a component:type=File can have a basePath pointing to the App_Conde folder. This is not a correct FolderName //To ensure that FolderName is DesktopModules... var folderNameValue = PackageController.GetSpecificFolderName(manifestNav, "components/component/files|components/component/resourceFiles", "basePath", "DesktopModules"); - if (!String.IsNullOrEmpty(folderNameValue)) Package.FolderName = folderNameValue.Replace('\\', '/'); + if (!String.IsNullOrEmpty(folderNameValue)) this.Package.FolderName = folderNameValue.Replace('\\', '/'); break; case "Auth_System": foldernameNav = manifestNav.SelectSingleNode("components/component/files"); - if (foldernameNav != null) Package.FolderName = Util.ReadElement(foldernameNav, "basePath").Replace('\\', '/'); + if (foldernameNav != null) this.Package.FolderName = Util.ReadElement(foldernameNav, "basePath").Replace('\\', '/'); break; case "Container": foldernameNav = manifestNav.SelectSingleNode("components/component/containerFiles"); - if (foldernameNav != null) Package.FolderName = Globals.glbContainersPath + Util.ReadElement(foldernameNav, "containerName").Replace('\\', '/'); + if (foldernameNav != null) this.Package.FolderName = Globals.glbContainersPath + Util.ReadElement(foldernameNav, "containerName").Replace('\\', '/'); break; case "Skin": foldernameNav = manifestNav.SelectSingleNode("components/component/skinFiles"); - if (foldernameNav != null) Package.FolderName = Globals.glbSkinsPath + Util.ReadElement(foldernameNav, "skinName").Replace('\\', '/'); + if (foldernameNav != null) this.Package.FolderName = Globals.glbSkinsPath + Util.ReadElement(foldernameNav, "skinName").Replace('\\', '/'); break; default: //copied from "Module" without the extra OR condition folderNameValue = PackageController.GetSpecificFolderName(manifestNav, "components/component/resourceFiles", "basePath", "DesktopModules"); - if (!String.IsNullOrEmpty(folderNameValue)) Package.FolderName = folderNameValue.Replace('\\', '/'); + if (!String.IsNullOrEmpty(folderNameValue)) this.Package.FolderName = folderNameValue.Replace('\\', '/'); break; } - _eventMessage = ReadEventMessageNode(manifestNav); + this._eventMessage = this.ReadEventMessageNode(manifestNav); //Get Icon XPathNavigator iconFileNav = manifestNav.SelectSingleNode("iconFile"); @@ -418,16 +418,16 @@ public override void ReadManifest(XPathNavigator manifestNav) { if (iconFileNav.Value.StartsWith("~/")) { - Package.IconFile = iconFileNav.Value; + this.Package.IconFile = iconFileNav.Value; } else if (iconFileNav.Value.StartsWith("DesktopModules", StringComparison.InvariantCultureIgnoreCase)) { - Package.IconFile = string.Format("~/{0}", iconFileNav.Value); + this.Package.IconFile = string.Format("~/{0}", iconFileNav.Value); } else { - Package.IconFile = (String.IsNullOrEmpty(Package.FolderName) ? "" : Package.FolderName + "/") + iconFileNav.Value; - Package.IconFile = (!Package.IconFile.StartsWith("~/")) ? "~/" + Package.IconFile : Package.IconFile; + this.Package.IconFile = (String.IsNullOrEmpty(this.Package.FolderName) ? "" : this.Package.FolderName + "/") + iconFileNav.Value; + this.Package.IconFile = (!this.Package.IconFile.StartsWith("~/")) ? "~/" + this.Package.IconFile : this.Package.IconFile; } } } @@ -435,10 +435,10 @@ public override void ReadManifest(XPathNavigator manifestNav) XPathNavigator authorNav = manifestNav.SelectSingleNode("owner"); if (authorNav != null) { - Package.Owner = Util.ReadElement(authorNav, "name"); - Package.Organization = Util.ReadElement(authorNav, "organization"); - Package.Url = Util.ReadElement(authorNav, "url"); - Package.Email = Util.ReadElement(authorNav, "email"); + this.Package.Owner = Util.ReadElement(authorNav, "name"); + this.Package.Organization = Util.ReadElement(authorNav, "organization"); + this.Package.Url = Util.ReadElement(authorNav, "url"); + this.Package.Email = Util.ReadElement(authorNav, "email"); } //Get License @@ -449,17 +449,17 @@ public override void ReadManifest(XPathNavigator manifestNav) if (string.IsNullOrEmpty(licenseSrc)) { //Load from element - Package.License = licenseNav.Value; + this.Package.License = licenseNav.Value; } else { - Package.License = ReadTextFromFile(licenseSrc); + this.Package.License = this.ReadTextFromFile(licenseSrc); } } - if (string.IsNullOrEmpty(Package.License)) + if (string.IsNullOrEmpty(this.Package.License)) { //Legacy Packages have no license - Package.License = Util.PACKAGE_NoLicense; + this.Package.License = Util.PACKAGE_NoLicense; } //Get Release Notes @@ -470,21 +470,21 @@ public override void ReadManifest(XPathNavigator manifestNav) if (string.IsNullOrEmpty(relNotesSrc)) { //Load from element - Package.ReleaseNotes = relNotesNav.Value; + this.Package.ReleaseNotes = relNotesNav.Value; } else { - Package.ReleaseNotes = ReadTextFromFile(relNotesSrc); + this.Package.ReleaseNotes = this.ReadTextFromFile(relNotesSrc); } } - if (string.IsNullOrEmpty(Package.ReleaseNotes)) + if (string.IsNullOrEmpty(this.Package.ReleaseNotes)) { //Legacy Packages have no Release Notes - Package.ReleaseNotes = Util.PACKAGE_NoReleaseNotes; + this.Package.ReleaseNotes = Util.PACKAGE_NoReleaseNotes; } //Parse the Dependencies - var packageDependencies = Package.Dependencies; + var packageDependencies = this.Package.Dependencies; foreach (XPathNavigator dependencyNav in manifestNav.CreateNavigator().Select("dependencies/dependency")) { var dependency = DependencyFactory.GetDependency(dependencyNav); @@ -497,13 +497,13 @@ public override void ReadManifest(XPathNavigator manifestNav) if (!dependency.IsValid) { - Log.AddFailure(dependency.ErrorMessage); + this.Log.AddFailure(dependency.ErrorMessage); return; } } //Read Components - ReadComponents(manifestNav); + this.ReadComponents(manifestNav); } /// ----------------------------------------------------------------------------- @@ -513,27 +513,27 @@ public override void ReadManifest(XPathNavigator manifestNav) /// ----------------------------------------------------------------------------- public override void Rollback() { - for (int index = 0; index <= _componentInstallers.Count - 1; index++) + for (int index = 0; index <= this._componentInstallers.Count - 1; index++) { - ComponentInstallerBase compInstaller = _componentInstallers.Values[index]; - if (compInstaller.Version > Package.InstalledVersion && compInstaller.Completed) + ComponentInstallerBase compInstaller = this._componentInstallers.Values[index]; + if (compInstaller.Version > this.Package.InstalledVersion && compInstaller.Completed) { - Log.AddInfo(Util.COMPONENT_RollingBack + " - " + compInstaller.Type); + this.Log.AddInfo(Util.COMPONENT_RollingBack + " - " + compInstaller.Type); compInstaller.Rollback(); - Log.AddInfo(Util.COMPONENT_RolledBack + " - " + compInstaller.Type); + this.Log.AddInfo(Util.COMPONENT_RolledBack + " - " + compInstaller.Type); } } //If Previously Installed Package exists then we need to update the DataStore with this - if (_installedPackage == null) + if (this._installedPackage == null) { //No Previously Installed Package - Delete newly added Package - PackageController.Instance.DeleteExtensionPackage(Package); + PackageController.Instance.DeleteExtensionPackage(this.Package); } else { //Previously Installed Package - Rollback to Previously Installed - PackageController.Instance.SaveExtensionPackage(_installedPackage); + PackageController.Instance.SaveExtensionPackage(this._installedPackage); } } @@ -545,30 +545,30 @@ public override void Rollback() public override void UnInstall() { //Iterate through all the Components - for (int index = 0; index <= _componentInstallers.Count - 1; index++) + for (int index = 0; index <= this._componentInstallers.Count - 1; index++) { - ComponentInstallerBase compInstaller = _componentInstallers.Values[index]; + ComponentInstallerBase compInstaller = this._componentInstallers.Values[index]; var fileInstaller = compInstaller as FileInstaller; if (fileInstaller != null) { - fileInstaller.DeleteFiles = DeleteFiles; + fileInstaller.DeleteFiles = this.DeleteFiles; } - Log.ResetFlags(); - Log.AddInfo(Util.UNINSTALL_StartComp + " - " + compInstaller.Type); + this.Log.ResetFlags(); + this.Log.AddInfo(Util.UNINSTALL_StartComp + " - " + compInstaller.Type); compInstaller.UnInstall(); - Log.AddInfo(Util.COMPONENT_UnInstalled + " - " + compInstaller.Type); - if (Log.Valid) + this.Log.AddInfo(Util.COMPONENT_UnInstalled + " - " + compInstaller.Type); + if (this.Log.Valid) { - Log.AddInfo(Util.UNINSTALL_SuccessComp + " - " + compInstaller.Type); + this.Log.AddInfo(Util.UNINSTALL_SuccessComp + " - " + compInstaller.Type); } else { - Log.AddWarning(Util.UNINSTALL_WarningsComp + " - " + compInstaller.Type); + this.Log.AddWarning(Util.UNINSTALL_WarningsComp + " - " + compInstaller.Type); } } //Remove the Package information from the Data Store - PackageController.Instance.DeleteExtensionPackage(Package); + PackageController.Instance.DeleteExtensionPackage(this.Package); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/ProviderInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/ProviderInstaller.cs index 5a0c4442d08..f80eb7793ed 100644 --- a/DNN Platform/Library/Services/Installer/Installers/ProviderInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/ProviderInstaller.cs @@ -35,12 +35,12 @@ public override string AllowableFiles public override void Commit() { - Completed = true; + this.Completed = true; } public override void Install() { - Completed = true; + this.Completed = true; } public override void ReadManifest(XPathNavigator manifestNav) @@ -49,12 +49,12 @@ public override void ReadManifest(XPathNavigator manifestNav) public override void Rollback() { - Completed = true; + this.Completed = true; } public override void UnInstall() { - Completed = true; + this.Completed = true; } } } diff --git a/DNN Platform/Library/Services/Installer/Installers/ResourceFileInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/ResourceFileInstaller.cs index 75fcd1014c1..1048ca97e87 100644 --- a/DNN Platform/Library/Services/Installer/Installers/ResourceFileInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/ResourceFileInstaller.cs @@ -69,7 +69,7 @@ protected string Manifest { get { - return _Manifest; + return this._Manifest; } } @@ -125,15 +125,15 @@ protected override bool InstallFile(InstallFile insFile) bool retValue = true; try { - Log.AddInfo(Util.FILES_Expanding); + this.Log.AddInfo(Util.FILES_Expanding); //Create the folder for destination - _Manifest = insFile.Name + ".manifest"; - if (!Directory.Exists(PhysicalBasePath)) + this._Manifest = insFile.Name + ".manifest"; + if (!Directory.Exists(this.PhysicalBasePath)) { - Directory.CreateDirectory(PhysicalBasePath); + Directory.CreateDirectory(this.PhysicalBasePath); } using (var unzip = new ZipInputStream(new FileStream(insFile.TempFileName, FileMode.Open))) - using (var manifestStream = new FileStream(Path.Combine(PhysicalBasePath, Manifest), FileMode.Create, FileAccess.Write)) + using (var manifestStream = new FileStream(Path.Combine(this.PhysicalBasePath, this.Manifest), FileMode.Create, FileAccess.Write)) { var settings = new XmlWriterSettings(); settings.ConformanceLevel = ConformanceLevel.Fragment; @@ -169,12 +169,12 @@ protected override bool InstallFile(InstallFile insFile) //Write name writer.WriteElementString("name", fileName); - var physicalPath = Path.Combine(PhysicalBasePath, entry.Name); + var physicalPath = Path.Combine(this.PhysicalBasePath, entry.Name); if (File.Exists(physicalPath)) { - Util.BackupFile(new InstallFile(entry.Name, Package.InstallerInfo), - PhysicalBasePath, - Log); + Util.BackupFile(new InstallFile(entry.Name, this.Package.InstallerInfo), + this.PhysicalBasePath, + this.Log); } Util.WriteStream(unzip, physicalPath); @@ -182,7 +182,7 @@ protected override bool InstallFile(InstallFile insFile) //Close files Element writer.WriteEndElement(); - Log.AddInfo(string.Format(Util.FILE_Created, entry.Name)); + this.Log.AddInfo(string.Format(Util.FILE_Created, entry.Name)); } entry = unzip.GetNextEntry(); @@ -191,7 +191,7 @@ protected override bool InstallFile(InstallFile insFile) //Close files Element writer.WriteEndElement(); - Log.AddInfo(Util.FILES_CreatedResources); + this.Log.AddInfo(Util.FILES_CreatedResources); } } @@ -227,11 +227,11 @@ protected override InstallFile ReadManifestItem(XPathNavigator nav, bool checkFi { InstallFile insFile = base.ReadManifestItem(nav, checkFileExists); - _Manifest = Util.ReadElement(nav, "manifest"); + this._Manifest = Util.ReadElement(nav, "manifest"); - if (string.IsNullOrEmpty(_Manifest)) + if (string.IsNullOrEmpty(this._Manifest)) { - _Manifest = insFile.FullName + DEFAULT_MANIFESTEXT; + this._Manifest = insFile.FullName + DEFAULT_MANIFESTEXT; } //Call base method @@ -260,12 +260,12 @@ protected override void RollbackFile(InstallFile insFile) if (File.Exists(insFile.BackupPath + entry.Name)) { //Restore File - Util.RestoreFile(new InstallFile(unzip, entry, Package.InstallerInfo), PhysicalBasePath, Log); + Util.RestoreFile(new InstallFile(unzip, entry, this.Package.InstallerInfo), this.PhysicalBasePath, this.Log); } else { //Delete File - Util.DeleteFile(entry.Name, PhysicalBasePath, Log); + Util.DeleteFile(entry.Name, this.PhysicalBasePath, this.Log); } } entry = unzip.GetNextEntry(); @@ -275,8 +275,8 @@ protected override void RollbackFile(InstallFile insFile) protected override void UnInstallFile(InstallFile unInstallFile) { - _Manifest = unInstallFile.Name + ".manifest"; - var doc = new XPathDocument(Path.Combine(PhysicalBasePath, Manifest)); + this._Manifest = unInstallFile.Name + ".manifest"; + var doc = new XPathDocument(Path.Combine(this.PhysicalBasePath, this.Manifest)); foreach (XPathNavigator fileNavigator in doc.CreateNavigator().Select("dotnetnuke/files/file")) { @@ -285,19 +285,19 @@ protected override void UnInstallFile(InstallFile unInstallFile) string filePath = Path.Combine(path, fileName); try { - if (DeleteFiles) + if (this.DeleteFiles) { - Util.DeleteFile(filePath, PhysicalBasePath, Log); + Util.DeleteFile(filePath, this.PhysicalBasePath, this.Log); } } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } - if (DeleteFiles) + if (this.DeleteFiles) { - Util.DeleteFile(Manifest, PhysicalBasePath, Log); + Util.DeleteFile(this.Manifest, this.PhysicalBasePath, this.Log); } } diff --git a/DNN Platform/Library/Services/Installer/Installers/ScriptInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/ScriptInstaller.cs index 3b1a5221227..4e1afcad2fe 100644 --- a/DNN Platform/Library/Services/Installer/Installers/ScriptInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/ScriptInstaller.cs @@ -47,7 +47,7 @@ protected InstallFile InstallScript { get { - return _installScript; + return this._installScript; } } @@ -61,7 +61,7 @@ protected SortedList InstallScripts { get { - return _installScripts; + return this._installScripts; } } @@ -75,7 +75,7 @@ protected SortedList UnInstallScripts { get { - return _unInstallScripts; + return this._unInstallScripts; } } @@ -125,7 +125,7 @@ protected InstallFile UpgradeScript { get { - return _upgradeScript; + return this._upgradeScript; } } @@ -155,10 +155,10 @@ private bool ExecuteSql(InstallFile scriptFile) { bool bSuccess = true; - Log.AddInfo(string.Format(Util.SQL_BeginFile, scriptFile.Name)); + this.Log.AddInfo(string.Format(Util.SQL_BeginFile, scriptFile.Name)); //read script file for installation - string strScript = FileSystemUtils.ReadFile(PhysicalBasePath + scriptFile.FullName); + string strScript = FileSystemUtils.ReadFile(this.PhysicalBasePath + scriptFile.FullName); //This check needs to be included because the unicode Byte Order mark results in an extra character at the start of the file //The extra character - '?' - causes an error with the database. @@ -169,23 +169,23 @@ private bool ExecuteSql(InstallFile scriptFile) string strSQLExceptions = DataProvider.Instance().ExecuteScript(strScript); if (!String.IsNullOrEmpty(strSQLExceptions)) { - if (Package.InstallerInfo.IsLegacyMode) + if (this.Package.InstallerInfo.IsLegacyMode) { - Log.AddWarning(string.Format(Util.SQL_Exceptions, Environment.NewLine, strSQLExceptions)); + this.Log.AddWarning(string.Format(Util.SQL_Exceptions, Environment.NewLine, strSQLExceptions)); } else { - Log.AddFailure(string.Format(Util.SQL_Exceptions, Environment.NewLine, strSQLExceptions)); + this.Log.AddFailure(string.Format(Util.SQL_Exceptions, Environment.NewLine, strSQLExceptions)); bSuccess = false; } } - Log.AddInfo(string.Format(Util.SQL_EndFile, scriptFile.Name)); + this.Log.AddInfo(string.Format(Util.SQL_EndFile, scriptFile.Name)); return bSuccess; } private bool IsValidScript(string fileExtension) { - return ProviderConfiguration.DefaultProvider.Equals(fileExtension, StringComparison.InvariantCultureIgnoreCase) || fileExtension.Equals("sql", StringComparison.InvariantCultureIgnoreCase); + return this.ProviderConfiguration.DefaultProvider.Equals(fileExtension, StringComparison.InvariantCultureIgnoreCase) || fileExtension.Equals("sql", StringComparison.InvariantCultureIgnoreCase); } #endregion @@ -195,17 +195,17 @@ private bool IsValidScript(string fileExtension) private bool InstallScriptFile(InstallFile scriptFile) { //Call base InstallFile method to copy file - bool bSuccess = InstallFile(scriptFile); + bool bSuccess = this.InstallFile(scriptFile); //Process the file if it is an Install Script var extension = Path.GetExtension(scriptFile.Name.ToLowerInvariant()); if (extension != null) { string fileExtension = extension.Substring(1); - if (bSuccess && IsValidScript(fileExtension)) + if (bSuccess && this.IsValidScript(fileExtension)) { - Log.AddInfo(Util.SQL_Executing + scriptFile.Name); - bSuccess = ExecuteSql(scriptFile); + this.Log.AddInfo(Util.SQL_Executing + scriptFile.Name); + bSuccess = this.ExecuteSql(scriptFile); } } return bSuccess; @@ -232,26 +232,26 @@ protected override bool IsCorrectType(InstallFileType type) protected override void ProcessFile(InstallFile file, XPathNavigator nav) { string type = nav.GetAttribute("type", ""); - if (file != null && IsCorrectType(file.Type)) + if (file != null && this.IsCorrectType(file.Type)) { if (file.Name.StartsWith("install.", StringComparison.InvariantCultureIgnoreCase)) { //This is the initial script when installing - _installScript = file; + this._installScript = file; } else if (file.Name.StartsWith("upgrade.", StringComparison.InvariantCultureIgnoreCase)) { - _upgradeScript = file; + this._upgradeScript = file; } else if (type.Equals("install", StringComparison.InvariantCultureIgnoreCase)) { //These are the Install/Upgrade scripts - InstallScripts[file.Version] = file; + this.InstallScripts[file.Version] = file; } else { //These are the Uninstall scripts - UnInstallScripts[file.Version] = file; + this.UnInstallScripts[file.Version] = file; } } @@ -263,14 +263,14 @@ protected override void UnInstallFile(InstallFile scriptFile) { //Process the file if it is an UnInstall Script var extension = Path.GetExtension(scriptFile.Name.ToLowerInvariant()); - if (extension != null && (UnInstallScripts.ContainsValue(scriptFile) )) + if (extension != null && (this.UnInstallScripts.ContainsValue(scriptFile) )) { string fileExtension = extension.Substring(1); - if (scriptFile.Name.StartsWith("uninstall.", StringComparison.InvariantCultureIgnoreCase) && IsValidScript(fileExtension)) + if (scriptFile.Name.StartsWith("uninstall.", StringComparison.InvariantCultureIgnoreCase) && this.IsValidScript(fileExtension)) { //Install Script - Log.AddInfo(Util.SQL_Executing + scriptFile.Name); - ExecuteSql(scriptFile); + this.Log.AddInfo(Util.SQL_Executing + scriptFile.Name); + this.ExecuteSql(scriptFile); } } @@ -300,30 +300,30 @@ public override void Commit() /// ----------------------------------------------------------------------------- public override void Install() { - Log.AddInfo(Util.SQL_Begin); + this.Log.AddInfo(Util.SQL_Begin); try { bool bSuccess = true; - Version installedVersion = Package.InstalledVersion; + Version installedVersion = this.Package.InstalledVersion; //First process InstallScript if (installedVersion == new Version(0, 0, 0)) { - if (InstallScript != null) + if (this.InstallScript != null) { - bSuccess = InstallScriptFile(InstallScript); - installedVersion = InstallScript.Version; + bSuccess = this.InstallScriptFile(this.InstallScript); + installedVersion = this.InstallScript.Version; } } //Then process remain Install/Upgrade Scripts if (bSuccess) { - foreach (InstallFile file in InstallScripts.Values) + foreach (InstallFile file in this.InstallScripts.Values) { if (file.Version > installedVersion) { - bSuccess = InstallScriptFile(file); + bSuccess = this.InstallScriptFile(file); if (!bSuccess) { break; @@ -333,31 +333,31 @@ public override void Install() } //Next process UpgradeScript - this script always runs if present - if (UpgradeScript != null) + if (this.UpgradeScript != null) { - bSuccess = InstallScriptFile(UpgradeScript); - installedVersion = UpgradeScript.Version; + bSuccess = this.InstallScriptFile(this.UpgradeScript); + installedVersion = this.UpgradeScript.Version; } //Then process uninstallScripts - these need to be copied but not executed if (bSuccess) { - foreach (InstallFile file in UnInstallScripts.Values) + foreach (InstallFile file in this.UnInstallScripts.Values) { - bSuccess = InstallFile(file); + bSuccess = this.InstallFile(file); if (!bSuccess) { break; } } } - Completed = bSuccess; + this.Completed = bSuccess; } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } - Log.AddInfo(Util.SQL_End); + this.Log.AddInfo(Util.SQL_End); } /// ----------------------------------------------------------------------------- @@ -378,12 +378,12 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - Log.AddInfo(Util.SQL_BeginUnInstall); + this.Log.AddInfo(Util.SQL_BeginUnInstall); //Call the base method base.UnInstall(); - Log.AddInfo(Util.SQL_EndUnInstall); + this.Log.AddInfo(Util.SQL_EndUnInstall); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/SkinControlInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/SkinControlInstaller.cs index f447ebb0520..9c910ae974b 100644 --- a/DNN Platform/Library/Services/Installer/Installers/SkinControlInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/SkinControlInstaller.cs @@ -62,16 +62,16 @@ private void DeleteSkinControl() try { //Attempt to get the SkinControl - SkinControlInfo skinControl = SkinControlController.GetSkinControlByPackageID(Package.PackageID); + SkinControlInfo skinControl = SkinControlController.GetSkinControlByPackageID(this.Package.PackageID); if (skinControl != null) { SkinControlController.DeleteSkinControl(skinControl); } - Log.AddInfo(string.Format(Util.MODULE_UnRegistered, skinControl.ControlKey)); + this.Log.AddInfo(string.Format(Util.MODULE_UnRegistered, skinControl.ControlKey)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -99,23 +99,23 @@ public override void Install() try { //Attempt to get the SkinControl - InstalledSkinControl = SkinControlController.GetSkinControlByKey(SkinControl.ControlKey); + this.InstalledSkinControl = SkinControlController.GetSkinControlByKey(this.SkinControl.ControlKey); - if (InstalledSkinControl != null) + if (this.InstalledSkinControl != null) { - SkinControl.SkinControlID = InstalledSkinControl.SkinControlID; + this.SkinControl.SkinControlID = this.InstalledSkinControl.SkinControlID; } //Save SkinControl - SkinControl.PackageID = Package.PackageID; - SkinControl.SkinControlID = SkinControlController.SaveSkinControl(SkinControl); + this.SkinControl.PackageID = this.Package.PackageID; + this.SkinControl.SkinControlID = SkinControlController.SaveSkinControl(this.SkinControl); - Completed = true; - Log.AddInfo(string.Format(Util.MODULE_Registered, SkinControl.ControlKey)); + this.Completed = true; + this.Log.AddInfo(string.Format(Util.MODULE_Registered, this.SkinControl.ControlKey)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -127,11 +127,11 @@ public override void Install() public override void ReadManifest(XPathNavigator manifestNav) { //Load the SkinControl from the manifest - SkinControl = CBO.DeserializeObject(new StringReader(manifestNav.InnerXml)); + this.SkinControl = CBO.DeserializeObject(new StringReader(manifestNav.InnerXml)); - if (Log.Valid) + if (this.Log.Valid) { - Log.AddInfo(Util.MODULE_ReadSuccess); + this.Log.AddInfo(Util.MODULE_ReadSuccess); } } @@ -144,15 +144,15 @@ public override void ReadManifest(XPathNavigator manifestNav) public override void Rollback() { //If Temp SkinControl exists then we need to update the DataStore with this - if (InstalledSkinControl == null) + if (this.InstalledSkinControl == null) { //No Temp SkinControl - Delete newly added SkinControl - DeleteSkinControl(); + this.DeleteSkinControl(); } else { //Temp SkinControl - Rollback to Temp - SkinControlController.SaveSkinControl(InstalledSkinControl); + SkinControlController.SaveSkinControl(this.InstalledSkinControl); } } @@ -163,7 +163,7 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - DeleteSkinControl(); + this.DeleteSkinControl(); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/SkinInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/SkinInstaller.cs index e98d39c9d9d..867bf8cfddf 100644 --- a/DNN Platform/Library/Services/Installer/Installers/SkinInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/SkinInstaller.cs @@ -77,7 +77,7 @@ protected override string PhysicalBasePath { get { - string _PhysicalBasePath = RootPath + SkinRoot + "\\" + SkinPackage.SkinName; + string _PhysicalBasePath = this.RootPath + this.SkinRoot + "\\" + this.SkinPackage.SkinName; if (!_PhysicalBasePath.EndsWith("\\")) { _PhysicalBasePath += "\\"; @@ -97,7 +97,7 @@ protected string RootPath get { string _RootPath = Null.NullString; - if (Package.InstallerInfo.PortalID == Null.NullInteger && Package.PortalID == Null.NullInteger) + if (this.Package.InstallerInfo.PortalID == Null.NullInteger && this.Package.PortalID == Null.NullInteger) { _RootPath = Globals.HostMapPath; } @@ -119,7 +119,7 @@ protected ArrayList SkinFiles { get { - return _SkinFiles; + return this._SkinFiles; } } @@ -198,16 +198,16 @@ private void DeleteSkinPackage() try { //Attempt to get the Authentication Service - SkinPackageInfo skinPackage = SkinController.GetSkinByPackageID(Package.PackageID); + SkinPackageInfo skinPackage = SkinController.GetSkinByPackageID(this.Package.PackageID); if (skinPackage != null) { SkinController.DeleteSkinPackage(skinPackage); } - Log.AddInfo(string.Format(Util.SKIN_UnRegistered, skinPackage.SkinName)); + this.Log.AddInfo(string.Format(Util.SKIN_UnRegistered, skinPackage.SkinName)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -232,7 +232,7 @@ protected override void ProcessFile(InstallFile file, XPathNavigator nav) case "css": if (file.Path.IndexOf(Globals.glbAboutPage, StringComparison.InvariantCultureIgnoreCase) < 0) { - SkinFiles.Add(PhysicalBasePath + file.FullName); + this.SkinFiles.Add(this.PhysicalBasePath + file.FullName); } break; } @@ -249,11 +249,11 @@ protected override void ProcessFile(InstallFile file, XPathNavigator nav) /// ----------------------------------------------------------------------------- protected override void ReadCustomManifest(XPathNavigator nav) { - SkinPackage = new SkinPackageInfo(); - SkinPackage.PortalID = Package.PortalID; + this.SkinPackage = new SkinPackageInfo(); + this.SkinPackage.PortalID = this.Package.PortalID; //Get the Skin name - SkinPackage.SkinName = Util.ReadElement(nav, SkinNameNodeName); + this.SkinPackage.SkinName = Util.ReadElement(nav, this.SkinNameNodeName); //Call base class base.ReadCustomManifest(nav); @@ -275,7 +275,7 @@ protected override void UnInstallFile(InstallFile unInstallFile) //Try to remove "processed file" string fileName = unInstallFile.FullName; fileName = fileName.Replace(Path.GetExtension(fileName), ".ascx"); - Util.DeleteFile(fileName, PhysicalBasePath, Log); + Util.DeleteFile(fileName, this.PhysicalBasePath, this.Log); } } @@ -293,77 +293,77 @@ public override void Install() try { //Attempt to get the Skin Package - TempSkinPackage = SkinController.GetSkinPackage(SkinPackage.PortalID, SkinPackage.SkinName, SkinType); - if (TempSkinPackage == null) + this.TempSkinPackage = SkinController.GetSkinPackage(this.SkinPackage.PortalID, this.SkinPackage.SkinName, this.SkinType); + if (this.TempSkinPackage == null) { bAdd = true; - SkinPackage.PackageID = Package.PackageID; + this.SkinPackage.PackageID = this.Package.PackageID; } else { - SkinPackage.SkinPackageID = TempSkinPackage.SkinPackageID; - if (TempSkinPackage.PackageID != Package.PackageID) + this.SkinPackage.SkinPackageID = this.TempSkinPackage.SkinPackageID; + if (this.TempSkinPackage.PackageID != this.Package.PackageID) { - Completed = false; - Log.AddFailure(Util.SKIN_Installed); + this.Completed = false; + this.Log.AddFailure(Util.SKIN_Installed); return; } else { - SkinPackage.PackageID = TempSkinPackage.PackageID; + this.SkinPackage.PackageID = this.TempSkinPackage.PackageID; } } - SkinPackage.SkinType = SkinType; + this.SkinPackage.SkinType = this.SkinType; if (bAdd) { //Add new skin package - SkinPackage.SkinPackageID = SkinController.AddSkinPackage(SkinPackage); + this.SkinPackage.SkinPackageID = SkinController.AddSkinPackage(this.SkinPackage); } else { //Update skin package - SkinController.UpdateSkinPackage(SkinPackage); + SkinController.UpdateSkinPackage(this.SkinPackage); } - Log.AddInfo(string.Format(Util.SKIN_Registered, SkinPackage.SkinName)); + this.Log.AddInfo(string.Format(Util.SKIN_Registered, this.SkinPackage.SkinName)); //install (copy the files) by calling the base class base.Install(); //process the list of skin files - if (SkinFiles.Count > 0) + if (this.SkinFiles.Count > 0) { - Log.StartJob(Util.SKIN_BeginProcessing); + this.Log.StartJob(Util.SKIN_BeginProcessing); string strMessage = Null.NullString; - var NewSkin = new SkinFileProcessor(RootPath, SkinRoot, SkinPackage.SkinName); - foreach (string skinFile in SkinFiles) + var NewSkin = new SkinFileProcessor(this.RootPath, this.SkinRoot, this.SkinPackage.SkinName); + foreach (string skinFile in this.SkinFiles) { strMessage += NewSkin.ProcessFile(skinFile, SkinParser.Portable); skinFile.Replace(Globals.HostMapPath + "\\", "[G]"); switch (Path.GetExtension(skinFile)) { case ".htm": - SkinController.AddSkin(SkinPackage.SkinPackageID, skinFile.Replace("htm", "ascx")); + SkinController.AddSkin(this.SkinPackage.SkinPackageID, skinFile.Replace("htm", "ascx")); break; case ".html": - SkinController.AddSkin(SkinPackage.SkinPackageID, skinFile.Replace("html", "ascx")); + SkinController.AddSkin(this.SkinPackage.SkinPackageID, skinFile.Replace("html", "ascx")); break; case ".ascx": - SkinController.AddSkin(SkinPackage.SkinPackageID, skinFile); + SkinController.AddSkin(this.SkinPackage.SkinPackageID, skinFile); break; } } Array arrMessage = strMessage.Split(new[] {"
    "}, StringSplitOptions.None); foreach (string strRow in arrMessage) { - Log.AddInfo(HtmlUtils.StripTags(strRow, true)); + this.Log.AddInfo(HtmlUtils.StripTags(strRow, true)); } - Log.EndJob(Util.SKIN_EndProcessing); + this.Log.EndJob(Util.SKIN_EndProcessing); } - Completed = true; + this.Completed = true; } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -376,15 +376,15 @@ public override void Install() public override void Rollback() { //If Temp Skin exists then we need to update the DataStore with this - if (TempSkinPackage == null) + if (this.TempSkinPackage == null) { //No Temp Skin - Delete newly added Skin - DeleteSkinPackage(); + this.DeleteSkinPackage(); } else { //Temp Skin - Rollback to Temp - SkinController.UpdateSkinPackage(TempSkinPackage); + SkinController.UpdateSkinPackage(this.TempSkinPackage); } //Call base class to prcoess files @@ -398,7 +398,7 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - DeleteSkinPackage(); + this.DeleteSkinPackage(); //Call base class to prcoess files base.UnInstall(); diff --git a/DNN Platform/Library/Services/Installer/Installers/UrlProviderInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/UrlProviderInstaller.cs index afecac85ad2..c4a462bb5dc 100644 --- a/DNN Platform/Library/Services/Installer/Installers/UrlProviderInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/UrlProviderInstaller.cs @@ -40,17 +40,17 @@ private void DeleteProvider() { try { - ExtensionUrlProviderInfo tempUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger).Where(p => p.ProviderName == _extensionUrlProvider.ProviderName && p.ProviderType == _extensionUrlProvider.ProviderType).FirstOrDefault(); + ExtensionUrlProviderInfo tempUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger).Where(p => p.ProviderName == this._extensionUrlProvider.ProviderName && p.ProviderType == this._extensionUrlProvider.ProviderType).FirstOrDefault(); if (tempUrlProvider != null) { ExtensionUrlProviderController.DeleteProvider(tempUrlProvider); - Log.AddInfo(string.Format(Util.URLPROVIDER_UnRegistered, tempUrlProvider.ProviderName)); + this.Log.AddInfo(string.Format(Util.URLPROVIDER_UnRegistered, tempUrlProvider.ProviderName)); } } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -77,29 +77,29 @@ public override void Install() //Ensure DesktopModule Cache is cleared DataCache.RemoveCache(String.Format(DataCache.DesktopModuleCacheKey, Null.NullInteger)); - var desktopModule = DesktopModuleController.GetDesktopModuleByModuleName(_desktopModuleName, Null.NullInteger); + var desktopModule = DesktopModuleController.GetDesktopModuleByModuleName(this._desktopModuleName, Null.NullInteger); if (desktopModule != null) { - _extensionUrlProvider.DesktopModuleId = desktopModule.DesktopModuleID; + this._extensionUrlProvider.DesktopModuleId = desktopModule.DesktopModuleID; } //Attempt to get the Desktop Module - _installedExtensionUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger) - .SingleOrDefault(p => p.ProviderType == _extensionUrlProvider.ProviderType); + this._installedExtensionUrlProvider = ExtensionUrlProviderController.GetProviders(Null.NullInteger) + .SingleOrDefault(p => p.ProviderType == this._extensionUrlProvider.ProviderType); - if (_installedExtensionUrlProvider != null) + if (this._installedExtensionUrlProvider != null) { - _extensionUrlProvider.ExtensionUrlProviderId = _installedExtensionUrlProvider.ExtensionUrlProviderId; + this._extensionUrlProvider.ExtensionUrlProviderId = this._installedExtensionUrlProvider.ExtensionUrlProviderId; } - ExtensionUrlProviderController.SaveProvider(_extensionUrlProvider); + ExtensionUrlProviderController.SaveProvider(this._extensionUrlProvider); - Completed = true; - Log.AddInfo(string.Format(Util.URLPROVIDER_Registered, _extensionUrlProvider.ProviderName)); + this.Completed = true; + this.Log.AddInfo(string.Format(Util.URLPROVIDER_Registered, this._extensionUrlProvider.ProviderName)); } catch (Exception ex) { - Log.AddFailure(ex); + this.Log.AddFailure(ex); } } @@ -110,10 +110,10 @@ public override void Install() /// ----------------------------------------------------------------------------- public override void ReadManifest(XPathNavigator manifestNav) { - _extensionUrlProvider = new ExtensionUrlProviderInfo + this._extensionUrlProvider = new ExtensionUrlProviderInfo { - ProviderName = Util.ReadElement(manifestNav, "urlProvider/name", Log, Util.URLPROVIDER_NameMissing), - ProviderType = Util.ReadElement(manifestNav, "urlProvider/type", Log, Util.URLPROVIDER_TypeMissing), + ProviderName = Util.ReadElement(manifestNav, "urlProvider/name", this.Log, Util.URLPROVIDER_NameMissing), + ProviderType = Util.ReadElement(manifestNav, "urlProvider/type", this.Log, Util.URLPROVIDER_TypeMissing), SettingsControlSrc = Util.ReadElement(manifestNav, "urlProvider/settingsControlSrc"), IsActive = true, RedirectAllUrls = Convert.ToBoolean(Util.ReadElement(manifestNav, "urlProvider/redirectAllUrls", "false")), @@ -121,10 +121,10 @@ public override void ReadManifest(XPathNavigator manifestNav) RewriteAllUrls = Convert.ToBoolean(Util.ReadElement(manifestNav, "urlProvider/rewriteAllUrls", "false")) }; - _desktopModuleName = Util.ReadElement(manifestNav, "urlProvider/desktopModule"); - if (Log.Valid) + this._desktopModuleName = Util.ReadElement(manifestNav, "urlProvider/desktopModule"); + if (this.Log.Valid) { - Log.AddInfo(Util.URLPROVIDER_ReadSuccess); + this.Log.AddInfo(Util.URLPROVIDER_ReadSuccess); } } @@ -137,15 +137,15 @@ public override void ReadManifest(XPathNavigator manifestNav) public override void Rollback() { //If Temp Provider exists then we need to update the DataStore with this - if (_installedExtensionUrlProvider == null) + if (this._installedExtensionUrlProvider == null) { //No Temp Provider - Delete newly added module - DeleteProvider(); + this.DeleteProvider(); } else { //Temp Provider - Rollback to Temp - ExtensionUrlProviderController.SaveProvider(_installedExtensionUrlProvider); + ExtensionUrlProviderController.SaveProvider(this._installedExtensionUrlProvider); } } @@ -156,7 +156,7 @@ public override void Rollback() /// ----------------------------------------------------------------------------- public override void UnInstall() { - DeleteProvider(); + this.DeleteProvider(); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Installers/WidgetInstaller.cs b/DNN Platform/Library/Services/Installer/Installers/WidgetInstaller.cs index dcc3adaf999..b420dfa8fae 100644 --- a/DNN Platform/Library/Services/Installer/Installers/WidgetInstaller.cs +++ b/DNN Platform/Library/Services/Installer/Installers/WidgetInstaller.cs @@ -59,7 +59,7 @@ protected override string PhysicalBasePath { get { - string widgetPath = Path.Combine("Resources\\Widgets\\User", BasePath); + string widgetPath = Path.Combine("Resources\\Widgets\\User", this.BasePath); return Path.Combine(Globals.ApplicationMapPath, widgetPath); } } diff --git a/DNN Platform/Library/Services/Installer/Log/LogEntry.cs b/DNN Platform/Library/Services/Installer/Log/LogEntry.cs index 452184c131b..1017a111ed8 100644 --- a/DNN Platform/Library/Services/Installer/Log/LogEntry.cs +++ b/DNN Platform/Library/Services/Installer/Log/LogEntry.cs @@ -33,8 +33,8 @@ public class LogEntry /// ----------------------------------------------------------------------------- public LogEntry(LogType type, string description) { - Type = type; - _description = description; + this.Type = type; + this._description = description; } /// ----------------------------------------------------------------------------- @@ -55,18 +55,18 @@ public string Description { get { - if (_description == null) + if (this._description == null) { return "..."; } - return _description; + return this._description; } } public override string ToString() { - return string.Format("{0}: {1}", Type, Description); + return string.Format("{0}: {1}", this.Type, this.Description); } } } diff --git a/DNN Platform/Library/Services/Installer/Log/Logger.cs b/DNN Platform/Library/Services/Installer/Log/Logger.cs index 0978db96575..b8770b6e802 100644 --- a/DNN Platform/Library/Services/Installer/Log/Logger.cs +++ b/DNN Platform/Library/Services/Installer/Log/Logger.cs @@ -34,10 +34,10 @@ public class Logger public Logger() { - _logs = new List(); + this._logs = new List(); - _valid = true; - _hasWarnings = Null.NullBoolean; + this._valid = true; + this._hasWarnings = Null.NullBoolean; } /// ----------------------------------------------------------------------------- @@ -50,15 +50,15 @@ public string ErrorClass { get { - if (String.IsNullOrEmpty(_errorClass)) + if (String.IsNullOrEmpty(this._errorClass)) { - _errorClass = "NormalRed"; + this._errorClass = "NormalRed"; } - return _errorClass; + return this._errorClass; } set { - _errorClass = value; + this._errorClass = value; } } @@ -66,7 +66,7 @@ public bool HasWarnings { get { - return _hasWarnings; + return this._hasWarnings; } } @@ -80,15 +80,15 @@ public string HighlightClass { get { - if (String.IsNullOrEmpty(_highlightClass)) + if (String.IsNullOrEmpty(this._highlightClass)) { - _highlightClass = "NormalBold"; + this._highlightClass = "NormalBold"; } - return _highlightClass; + return this._highlightClass; } set { - _highlightClass = value; + this._highlightClass = value; } } @@ -102,7 +102,7 @@ public IList Logs { get { - return _logs; + return this._logs; } } @@ -116,15 +116,15 @@ public string NormalClass { get { - if (String.IsNullOrEmpty(_normalClass)) + if (String.IsNullOrEmpty(this._normalClass)) { - _normalClass = "Normal"; + this._normalClass = "Normal"; } - return _normalClass; + return this._normalClass; } set { - _normalClass = value; + this._normalClass = value; } } @@ -138,7 +138,7 @@ public bool Valid { get { - return _valid; + return this._valid; } } @@ -151,14 +151,14 @@ public bool Valid /// ----------------------------------------------------------------------------- public void AddFailure(string failure) { - _logs.Add(new LogEntry(LogType.Failure, failure)); + this._logs.Add(new LogEntry(LogType.Failure, failure)); DnnLogger.Error(failure); - _valid = false; + this._valid = false; } public void AddFailure(Exception ex) { - AddFailure((Util.EXCEPTION + ex)); + this.AddFailure((Util.EXCEPTION + ex)); Exceptions.Exceptions.LogException(ex); } @@ -170,7 +170,7 @@ public void AddFailure(Exception ex) /// ----------------------------------------------------------------------------- public void AddInfo(string info) { - _logs.Add(new LogEntry(LogType.Info, info)); + this._logs.Add(new LogEntry(LogType.Info, info)); DnnLogger.Info(info); } @@ -182,9 +182,9 @@ public void AddInfo(string info) /// ----------------------------------------------------------------------------- public void AddWarning(string warning) { - _logs.Add(new LogEntry(LogType.Warning, warning)); + this._logs.Add(new LogEntry(LogType.Warning, warning)); DnnLogger.Warn(warning); - _hasWarnings = true; + this._hasWarnings = true; } /// ----------------------------------------------------------------------------- @@ -195,7 +195,7 @@ public void AddWarning(string warning) /// ----------------------------------------------------------------------------- public void EndJob(string job) { - _logs.Add(new LogEntry(LogType.EndJob, job)); + this._logs.Add(new LogEntry(LogType.EndJob, job)); DnnLogger.Info(job); } @@ -207,7 +207,7 @@ public void EndJob(string job) public HtmlTable GetLogsTable() { var arrayTable = new HtmlTable(); - foreach (LogEntry entry in Logs) + foreach (LogEntry entry in this.Logs) { var tr = new HtmlTableRow(); var tdType = new HtmlTableCell(); @@ -220,17 +220,17 @@ public HtmlTable GetLogsTable() { case LogType.Failure: case LogType.Warning: - tdType.Attributes.Add("class", ErrorClass); - tdDescription.Attributes.Add("class", ErrorClass); + tdType.Attributes.Add("class", this.ErrorClass); + tdDescription.Attributes.Add("class", this.ErrorClass); break; case LogType.StartJob: case LogType.EndJob: - tdType.Attributes.Add("class", HighlightClass); - tdDescription.Attributes.Add("class", HighlightClass); + tdType.Attributes.Add("class", this.HighlightClass); + tdDescription.Attributes.Add("class", this.HighlightClass); break; case LogType.Info: - tdType.Attributes.Add("class", NormalClass); - tdDescription.Attributes.Add("class", NormalClass); + tdType.Attributes.Add("class", this.NormalClass); + tdDescription.Attributes.Add("class", this.NormalClass); break; } arrayTable.Rows.Add(tr); @@ -246,7 +246,7 @@ public HtmlTable GetLogsTable() public void ResetFlags() { - _valid = true; + this._valid = true; } /// ----------------------------------------------------------------------------- @@ -257,7 +257,7 @@ public void ResetFlags() /// ----------------------------------------------------------------------------- public void StartJob(string job) { - _logs.Add(new LogEntry(LogType.StartJob, job)); + this._logs.Add(new LogEntry(LogType.StartJob, job)); DnnLogger.Info(job); } } diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageController.cs b/DNN Platform/Library/Services/Installer/Packages/PackageController.cs index 46bdd1dd187..902e858337b 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageController.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageController.cs @@ -204,12 +204,12 @@ public void DeleteExtensionPackage(PackageInfo package) public PackageInfo GetExtensionPackage(int portalId, Func predicate) { - return GetExtensionPackage(portalId, predicate, false); + return this.GetExtensionPackage(portalId, predicate, false); } public PackageInfo GetExtensionPackage(int portalId, Func predicate, bool useCopy) { - var package = GetExtensionPackages(portalId).FirstOrDefault(predicate); + var package = this.GetExtensionPackages(portalId).FirstOrDefault(predicate); if (package != null && useCopy) { @@ -229,7 +229,7 @@ public IList GetExtensionPackages(int portalId) public IList GetExtensionPackages(int portalId, Func predicate) { - return GetExtensionPackages(portalId).Where(predicate).ToList(); + return this.GetExtensionPackages(portalId).Where(predicate).ToList(); } /// @@ -250,7 +250,7 @@ public void SaveExtensionPackage(PackageInfo package) public PackageType GetExtensionPackageType(Func predicate) { - return GetExtensionPackageTypes().SingleOrDefault(predicate); + return this.GetExtensionPackageTypes().SingleOrDefault(predicate); } public IList GetExtensionPackageTypes() diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageCreatedEventArgs.cs b/DNN Platform/Library/Services/Installer/Packages/PackageCreatedEventArgs.cs index b0662538c0c..519767d0a8f 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageCreatedEventArgs.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageCreatedEventArgs.cs @@ -33,7 +33,7 @@ public class PackageCreatedEventArgs : EventArgs ///----------------------------------------------------------------------------- public PackageCreatedEventArgs(PackageInfo package) { - _Package = package; + this._Package = package; } ///----------------------------------------------------------------------------- @@ -45,7 +45,7 @@ public PackageInfo Package { get { - return _Package; + return this._Package; } } } diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageEditorBase.cs b/DNN Platform/Library/Services/Installer/Packages/PackageEditorBase.cs index fa8a1bbcb22..f68aa077c07 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageEditorBase.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageEditorBase.cs @@ -24,7 +24,7 @@ public class PackageEditorBase : ModuleUserControlBase, IPackageEditor private PackageInfo _Package; private int _PackageID = Null.NullInteger; - protected string DisplayMode => (Request.QueryString["Display"] ?? "").ToLowerInvariant(); + protected string DisplayMode => (this.Request.QueryString["Display"] ?? "").ToLowerInvariant(); protected virtual string EditorID { @@ -38,7 +38,7 @@ protected bool IsSuperTab { get { - return ModuleContext.PortalSettings.ActiveTab.IsSuperTab; + return this.ModuleContext.PortalSettings.ActiveTab.IsSuperTab; } } @@ -46,11 +46,11 @@ protected PackageInfo Package { get { - if (_Package == null) + if (this._Package == null) { - _Package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, (p) => p.PackageID == PackageID); ; + this._Package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, (p) => p.PackageID == this.PackageID); ; } - return _Package; + return this._Package; } } @@ -66,11 +66,11 @@ public int PackageID { get { - return _PackageID; + return this._PackageID; } set { - _PackageID = value; + this._PackageID = value; } } @@ -84,11 +84,11 @@ public bool IsWizard { get { - return _IsWizard; + return this._IsWizard; } set { - _IsWizard = value; + this._IsWizard = value; } } @@ -114,7 +114,7 @@ public virtual void UpdatePackage() protected override void OnInit(EventArgs e) { - ID = EditorID; + this.ID = this.EditorID; base.OnInit(e); } diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageInfo.cs b/DNN Platform/Library/Services/Installer/Packages/PackageInfo.cs index 82493b1b4e3..d36d456d399 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageInfo.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageInfo.cs @@ -38,7 +38,7 @@ public class PackageInfo : BaseEntityInfo /// ----------------------------------------------------------------------------- public PackageInfo(InstallerInfo info) : this() { - AttachInstallerInfo(info); + this.AttachInstallerInfo(info); } /// @@ -47,11 +47,11 @@ public PackageInfo(InstallerInfo info) : this() /// ----------------------------------------------------------------------------- public PackageInfo() { - PackageID = Null.NullInteger; - PortalID = Null.NullInteger; - Version = new Version(0, 0, 0); - IsValid = true; - InstalledVersion = new Version(0, 0, 0); + this.PackageID = Null.NullInteger; + this.PortalID = Null.NullInteger; + this.Version = new Version(0, 0, 0); + this.IsValid = true; + this.InstalledVersion = new Version(0, 0, 0); } /// Gets the direct dependencies of this package. @@ -60,9 +60,9 @@ public IList Dependencies { get { - return _dependencies ?? (_dependencies = (PackageID == -1) + return this._dependencies ?? (this._dependencies = (this.PackageID == -1) ? new List() - : PackageController.Instance.GetPackageDependencies(p => p.PackageId == PackageID)); + : PackageController.Instance.GetPackageDependencies(p => p.PackageId == this.PackageID)); } } @@ -101,7 +101,7 @@ public Dictionary Files { get { - return InstallerInfo.Files; + return this.InstallerInfo.Files; } } @@ -156,7 +156,7 @@ public InstallMode InstallMode { get { - return InstallerInfo.InstallMode; + return this.InstallerInfo.InstallMode; } } @@ -196,7 +196,7 @@ public Logger Log { get { - return InstallerInfo.Log; + return this.InstallerInfo.Log; } } @@ -288,7 +288,7 @@ public Logger Log /// ----------------------------------------------------------------------------- public void AttachInstallerInfo(InstallerInfo installer) { - InstallerInfo = installer; + this.InstallerInfo = installer; } /// @@ -299,27 +299,27 @@ public PackageInfo Clone() { return new PackageInfo { - PackageID = PackageID, - PortalID = PortalID, - PackageType = PackageType, - InstallerInfo = InstallerInfo, - Name = Name, - FriendlyName = FriendlyName, - Manifest = Manifest, - Email = Email, - Description = Description, - FolderName = FolderName, - FileName = FileName, - IconFile = IconFile, - IsSystemPackage = IsSystemPackage, - IsValid = IsValid, - Organization = Organization, - Owner = Owner, - License = License, - ReleaseNotes = ReleaseNotes, - Url = Url, - Version = Version, - InstalledVersion = InstalledVersion + PackageID = this.PackageID, + PortalID = this.PortalID, + PackageType = this.PackageType, + InstallerInfo = this.InstallerInfo, + Name = this.Name, + FriendlyName = this.FriendlyName, + Manifest = this.Manifest, + Email = this.Email, + Description = this.Description, + FolderName = this.FolderName, + FileName = this.FileName, + IconFile = this.IconFile, + IsSystemPackage = this.IsSystemPackage, + IsValid = this.IsValid, + Organization = this.Organization, + Owner = this.Owner, + License = this.License, + ReleaseNotes = this.ReleaseNotes, + Url = this.Url, + Version = this.Version, + InstalledVersion = this.InstalledVersion }; } } diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageType.cs b/DNN Platform/Library/Services/Installer/Packages/PackageType.cs index d80358743d2..137ba16ddc7 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageType.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageType.cs @@ -22,7 +22,7 @@ public class PackageTypeMemberNameFixer { public PackageTypeMemberNameFixer() { - PackageType = string.Empty; + this.PackageType = string.Empty; } public string PackageType { get; set; } diff --git a/DNN Platform/Library/Services/Installer/Packages/PackageTypeEditControl.cs b/DNN Platform/Library/Services/Installer/Packages/PackageTypeEditControl.cs index eaf60203388..93fcb2bf01d 100644 --- a/DNN Platform/Library/Services/Installer/Packages/PackageTypeEditControl.cs +++ b/DNN Platform/Library/Services/Installer/Packages/PackageTypeEditControl.cs @@ -42,15 +42,15 @@ protected override void RenderEditMode(HtmlTextWriter writer) IList packageTypes = PackageController.Instance.GetExtensionPackageTypes(); //Render the Select Tag - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Select); //Add the Not Specified Option writer.AddAttribute(HtmlTextWriterAttribute.Value, Null.NullString); - if (StringValue == Null.NullString) + if (this.StringValue == Null.NullString) { writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); } @@ -65,7 +65,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Add the Value Attribute writer.AddAttribute(HtmlTextWriterAttribute.Value, type.PackageType); - if (type.PackageType == StringValue) + if (type.PackageType == this.StringValue) { //Add the Selected Attribute writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); diff --git a/DNN Platform/Library/Services/Installer/Writers/AuthenticationPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/AuthenticationPackageWriter.cs index f083b60d67b..5e53aa8e267 100644 --- a/DNN Platform/Library/Services/Installer/Writers/AuthenticationPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/AuthenticationPackageWriter.cs @@ -27,14 +27,14 @@ public class AuthenticationPackageWriter : PackageWriterBase public AuthenticationPackageWriter(PackageInfo package) : base(package) { - AuthSystem = AuthenticationController.GetAuthenticationServiceByPackageID(package.PackageID); - Initialize(); + this.AuthSystem = AuthenticationController.GetAuthenticationServiceByPackageID(package.PackageID); + this.Initialize(); } public AuthenticationPackageWriter(AuthenticationInfo authSystem, PackageInfo package) : base(package) { - AuthSystem = authSystem; - Initialize(); + this.AuthSystem = authSystem; + this.Initialize(); } #endregion @@ -55,9 +55,9 @@ public AuthenticationPackageWriter(AuthenticationInfo authSystem, PackageInfo pa private void Initialize() { - BasePath = Path.Combine("DesktopModules\\AuthenticationServices", AuthSystem.AuthenticationType); - AppCodePath = Path.Combine("App_Code\\AuthenticationServices", AuthSystem.AuthenticationType); - AssemblyPath = "bin"; + this.BasePath = Path.Combine("DesktopModules\\AuthenticationServices", this.AuthSystem.AuthenticationType); + this.AppCodePath = Path.Combine("App_Code\\AuthenticationServices", this.AuthSystem.AuthenticationType); + this.AssemblyPath = "bin"; } private void WriteAuthenticationComponent(XmlWriter writer) @@ -69,10 +69,10 @@ private void WriteAuthenticationComponent(XmlWriter writer) //Start authenticationService Element writer.WriteStartElement("authenticationService"); - writer.WriteElementString("type", AuthSystem.AuthenticationType); - writer.WriteElementString("settingsControlSrc", AuthSystem.SettingsControlSrc); - writer.WriteElementString("loginControlSrc", AuthSystem.LoginControlSrc); - writer.WriteElementString("logoffControlSrc", AuthSystem.LogoffControlSrc); + writer.WriteElementString("type", this.AuthSystem.AuthenticationType); + writer.WriteElementString("settingsControlSrc", this.AuthSystem.SettingsControlSrc); + writer.WriteElementString("loginControlSrc", this.AuthSystem.LoginControlSrc); + writer.WriteElementString("logoffControlSrc", this.AuthSystem.LogoffControlSrc); //End authenticationService Element writer.WriteEndElement(); @@ -86,7 +86,7 @@ private void WriteAuthenticationComponent(XmlWriter writer) protected override void WriteManifestComponent(XmlWriter writer) { //Write Authentication Component - WriteAuthenticationComponent(writer); + this.WriteAuthenticationComponent(writer); } } } diff --git a/DNN Platform/Library/Services/Installer/Writers/CleanupComponentWriter.cs b/DNN Platform/Library/Services/Installer/Writers/CleanupComponentWriter.cs index 610755de653..0624cdacc3e 100644 --- a/DNN Platform/Library/Services/Installer/Writers/CleanupComponentWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/CleanupComponentWriter.cs @@ -40,8 +40,8 @@ public class CleanupComponentWriter /// ----------------------------------------------------------------------------- public CleanupComponentWriter(string basePath, SortedList files) { - _Files = files; - _BasePath = basePath; + this._Files = files; + this._BasePath = basePath; } #endregion @@ -50,7 +50,7 @@ public CleanupComponentWriter(string basePath, SortedList f public virtual void WriteManifest(XmlWriter writer) { - foreach (KeyValuePair kvp in _Files) + foreach (KeyValuePair kvp in this._Files) { //Start component Element writer.WriteStartElement("component"); diff --git a/DNN Platform/Library/Services/Installer/Writers/ContainerPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/ContainerPackageWriter.cs index e96aa9bd4f5..d650040e690 100644 --- a/DNN Platform/Library/Services/Installer/Writers/ContainerPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/ContainerPackageWriter.cs @@ -24,17 +24,17 @@ public class ContainerPackageWriter : SkinPackageWriter { public ContainerPackageWriter(PackageInfo package) : base(package) { - BasePath = "Portals\\_default\\Containers\\" + SkinPackage.SkinName; + this.BasePath = "Portals\\_default\\Containers\\" + this.SkinPackage.SkinName; } public ContainerPackageWriter(SkinPackageInfo skinPackage, PackageInfo package) : base(skinPackage, package) { - BasePath = "Portals\\_default\\Containers\\" + skinPackage.SkinName; + this.BasePath = "Portals\\_default\\Containers\\" + skinPackage.SkinName; } protected override void WriteFilesToManifest(XmlWriter writer) { - var containerFileWriter = new ContainerComponentWriter(SkinPackage.SkinName, BasePath, Files, Package); + var containerFileWriter = new ContainerComponentWriter(this.SkinPackage.SkinName, this.BasePath, this.Files, this.Package); containerFileWriter.WriteManifest(writer); } } diff --git a/DNN Platform/Library/Services/Installer/Writers/FileComponentWriter.cs b/DNN Platform/Library/Services/Installer/Writers/FileComponentWriter.cs index e25ec74e45d..420b6a6d4ee 100644 --- a/DNN Platform/Library/Services/Installer/Writers/FileComponentWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/FileComponentWriter.cs @@ -46,9 +46,9 @@ public class FileComponentWriter /// ----------------------------------------------------------------------------- public FileComponentWriter(string basePath, Dictionary files, PackageInfo package) { - _Files = files; - _BasePath = basePath; - _Package = package; + this._Files = files; + this._BasePath = basePath; + this._Package = package; } #endregion @@ -107,7 +107,7 @@ protected virtual Logger Log { get { - return _Package.Log; + return this._Package.Log; } } @@ -121,7 +121,7 @@ protected virtual PackageInfo Package { get { - return _Package; + return this._Package; } } @@ -133,11 +133,11 @@ public int InstallOrder { get { - return _InstallOrder; + return this._InstallOrder; } set { - _InstallOrder = value; + this._InstallOrder = value; } } @@ -145,11 +145,11 @@ public int UnInstallOrder { get { - return _UnInstallOrder; + return this._UnInstallOrder; } set { - _UnInstallOrder = value; + this._UnInstallOrder = value; } } @@ -171,20 +171,20 @@ protected virtual void WriteCustomManifest(XmlWriter writer) protected virtual void WriteFileElement(XmlWriter writer, InstallFile file) { - Log.AddInfo(string.Format(Util.WRITER_AddFileToManifest, file.Name)); + this.Log.AddInfo(string.Format(Util.WRITER_AddFileToManifest, file.Name)); //Start file Element - writer.WriteStartElement(ItemNodeName); + writer.WriteStartElement(this.ItemNodeName); //Write path if (!string.IsNullOrEmpty(file.Path)) { string path = file.Path; - if (!string.IsNullOrEmpty(_BasePath)) + if (!string.IsNullOrEmpty(this._BasePath)) { - if (file.Path.ToLowerInvariant().Contains(_BasePath.ToLowerInvariant())) + if (file.Path.ToLowerInvariant().Contains(this._BasePath.ToLowerInvariant())) { - path = file.Path.ToLowerInvariant().Replace(_BasePath.ToLowerInvariant() + "\\", ""); + path = file.Path.ToLowerInvariant().Replace(this._BasePath.ToLowerInvariant() + "\\", ""); } } writer.WriteElementString("path", path); @@ -211,30 +211,30 @@ public virtual void WriteManifest(XmlWriter writer) { //Start component Element writer.WriteStartElement("component"); - writer.WriteAttributeString("type", ComponentType); - if (InstallOrder > Null.NullInteger) + writer.WriteAttributeString("type", this.ComponentType); + if (this.InstallOrder > Null.NullInteger) { - writer.WriteAttributeString("installOrder", InstallOrder.ToString()); + writer.WriteAttributeString("installOrder", this.InstallOrder.ToString()); } - if (UnInstallOrder > Null.NullInteger) + if (this.UnInstallOrder > Null.NullInteger) { - writer.WriteAttributeString("unInstallOrder", UnInstallOrder.ToString()); + writer.WriteAttributeString("unInstallOrder", this.UnInstallOrder.ToString()); } //Start files element - writer.WriteStartElement(CollectionNodeName); + writer.WriteStartElement(this.CollectionNodeName); //Write custom manifest items - WriteCustomManifest(writer); + this.WriteCustomManifest(writer); //Write basePath Element - if (!string.IsNullOrEmpty(_BasePath)) + if (!string.IsNullOrEmpty(this._BasePath)) { - writer.WriteElementString("basePath", _BasePath); + writer.WriteElementString("basePath", this._BasePath); } - foreach (InstallFile file in _Files.Values) + foreach (InstallFile file in this._Files.Values) { - WriteFileElement(writer, file); + this.WriteFileElement(writer, file); } //End files Element diff --git a/DNN Platform/Library/Services/Installer/Writers/LanguageComponentWriter.cs b/DNN Platform/Library/Services/Installer/Writers/LanguageComponentWriter.cs index d7a04cf99f1..61a522a4893 100644 --- a/DNN Platform/Library/Services/Installer/Writers/LanguageComponentWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/LanguageComponentWriter.cs @@ -46,8 +46,8 @@ public class LanguageComponentWriter : FileComponentWriter /// ----------------------------------------------------------------------------- public LanguageComponentWriter(Locale language, string basePath, Dictionary files, PackageInfo package) : base(basePath, files, package) { - _Language = language; - _PackageType = LanguagePackType.Core; + this._Language = language; + this._PackageType = LanguagePackType.Core; } /// ----------------------------------------------------------------------------- @@ -61,9 +61,9 @@ public LanguageComponentWriter(Locale language, string basePath, Dictionary files, PackageInfo package) : base(basePath, files, package) { - _Language = LocaleController.Instance.GetLocale(languagePack.LanguageID); - _PackageType = languagePack.PackageType; - _DependentPackageID = languagePack.DependentPackageID; + this._Language = LocaleController.Instance.GetLocale(languagePack.LanguageID); + this._PackageType = languagePack.PackageType; + this._DependentPackageID = languagePack.DependentPackageID; } #endregion @@ -95,7 +95,7 @@ protected override string ComponentType { get { - if (_PackageType == LanguagePackType.Core) + if (this._PackageType == LanguagePackType.Core) { return "CoreLanguage"; } @@ -129,15 +129,15 @@ protected override string ItemNodeName protected override void WriteCustomManifest(XmlWriter writer) { //Write language Elements - writer.WriteElementString("code", _Language.Code); - if (_PackageType == LanguagePackType.Core) + writer.WriteElementString("code", this._Language.Code); + if (this._PackageType == LanguagePackType.Core) { - writer.WriteElementString("displayName", _Language.Text); - writer.WriteElementString("fallback", _Language.Fallback); + writer.WriteElementString("displayName", this._Language.Text); + writer.WriteElementString("fallback", this._Language.Fallback); } else { - PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == _DependentPackageID); + PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == this._DependentPackageID); writer.WriteElementString("package", package.Name); } } diff --git a/DNN Platform/Library/Services/Installer/Writers/LanguagePackWriter.cs b/DNN Platform/Library/Services/Installer/Writers/LanguagePackWriter.cs index b0c55b4181b..b9e0f69017c 100644 --- a/DNN Platform/Library/Services/Installer/Writers/LanguagePackWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/LanguagePackWriter.cs @@ -42,61 +42,61 @@ public class LanguagePackWriter : PackageWriterBase public LanguagePackWriter(PackageInfo package) : base(package) { - _LanguagePack = LanguagePackController.GetLanguagePackByPackage(package.PackageID); - if (LanguagePack != null) + this._LanguagePack = LanguagePackController.GetLanguagePackByPackage(package.PackageID); + if (this.LanguagePack != null) { - _Language = LocaleController.Instance.GetLocale(_LanguagePack.LanguageID); - if (LanguagePack.PackageType == LanguagePackType.Core) + this._Language = LocaleController.Instance.GetLocale(this._LanguagePack.LanguageID); + if (this.LanguagePack.PackageType == LanguagePackType.Core) { - BasePath = Null.NullString; + this.BasePath = Null.NullString; } else { //Get the BasePath of the Dependent Package - PackageInfo dependendentPackage = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == LanguagePack.DependentPackageID); + PackageInfo dependendentPackage = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == this.LanguagePack.DependentPackageID); PackageWriterBase dependentPackageWriter = PackageWriterFactory.GetWriter(dependendentPackage); - BasePath = dependentPackageWriter.BasePath; + this.BasePath = dependentPackageWriter.BasePath; } } else { - BasePath = Null.NullString; + this.BasePath = Null.NullString; } } public LanguagePackWriter(XPathNavigator manifestNav, InstallerInfo installer) { - _Language = new Locale(); + this._Language = new Locale(); XPathNavigator cultureNav = manifestNav.SelectSingleNode("Culture"); - _Language.Text = Util.ReadAttribute(cultureNav, "DisplayName"); - _Language.Code = Util.ReadAttribute(cultureNav, "Code"); - _Language.Fallback = Localization.Localization.SystemLocale; + this._Language.Text = Util.ReadAttribute(cultureNav, "DisplayName"); + this._Language.Code = Util.ReadAttribute(cultureNav, "Code"); + this._Language.Fallback = Localization.Localization.SystemLocale; //Create a Package - Package = new PackageInfo(installer); - Package.Name = Language.Text; - Package.FriendlyName = Language.Text; - Package.Description = Null.NullString; - Package.Version = new Version(1, 0, 0); - Package.License = Util.PACKAGE_NoLicense; + this.Package = new PackageInfo(installer); + this.Package.Name = this.Language.Text; + this.Package.FriendlyName = this.Language.Text; + this.Package.Description = Null.NullString; + this.Package.Version = new Version(1, 0, 0); + this.Package.License = Util.PACKAGE_NoLicense; - ReadLegacyManifest(manifestNav); + this.ReadLegacyManifest(manifestNav); - if (_IsCore) + if (this._IsCore) { - Package.PackageType = "CoreLanguagePack"; + this.Package.PackageType = "CoreLanguagePack"; } else { - Package.PackageType = "ExtensionLanguagePack"; + this.Package.PackageType = "ExtensionLanguagePack"; } - BasePath = Null.NullString; + this.BasePath = Null.NullString; } public LanguagePackWriter(Locale language, PackageInfo package) : base(package) { - _Language = language; - BasePath = Null.NullString; + this._Language = language; + this.BasePath = Null.NullString; } #endregion @@ -121,11 +121,11 @@ public Locale Language { get { - return _Language; + return this._Language; } set { - _Language = value; + this._Language = value; } } @@ -139,11 +139,11 @@ public LanguagePackInfo LanguagePack { get { - return _LanguagePack; + return this._LanguagePack; } set { - _LanguagePack = value; + this._LanguagePack = value; } } @@ -160,18 +160,18 @@ private void ReadLegacyManifest(XPathNavigator manifestNav) resourcetype = Util.ReadAttribute(fileNav, "FileType"); moduleName = Util.ReadAttribute(fileNav, "ModuleName").ToLowerInvariant(); sourceFileName = Path.Combine(resourcetype, Path.Combine(moduleName, fileName)); - string extendedExtension = "." + Language.Code.ToLowerInvariant() + ".resx"; + string extendedExtension = "." + this.Language.Code.ToLowerInvariant() + ".resx"; switch (resourcetype) { case "GlobalResource": filePath = "App_GlobalResources"; - _IsCore = true; + this._IsCore = true; break; case "ControlResource": filePath = "Controls\\App_LocalResources"; break; case "AdminResource": - _IsCore = true; + this._IsCore = true; switch (moduleName) { case "authentication": @@ -452,13 +452,13 @@ private void ReadLegacyManifest(XPathNavigator manifestNav) //Two assumptions are made here //1. Core files appear in the package before extension files //2. Module packages only include one module - if (!_IsCore && _LanguagePack == null) + if (!this._IsCore && this._LanguagePack == null) { //Check if language is installed - Locale locale = LocaleController.Instance.GetLocale(_Language.Code); + Locale locale = LocaleController.Instance.GetLocale(this._Language.Code); if (locale == null) { - LegacyError = "CoreLanguageError"; + this.LegacyError = "CoreLanguageError"; } else { @@ -470,17 +470,17 @@ private void ReadLegacyManifest(XPathNavigator manifestNav) { //Found Module - Get Package var dependentPackage = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == kvp.Value.PackageID); - Package.Name += "_" + dependentPackage.Name; - Package.FriendlyName += " " + dependentPackage.FriendlyName; - _LanguagePack = new LanguagePackInfo(); - _LanguagePack.DependentPackageID = dependentPackage.PackageID; - _LanguagePack.LanguageID = locale.LanguageId; + this.Package.Name += "_" + dependentPackage.Name; + this.Package.FriendlyName += " " + dependentPackage.FriendlyName; + this._LanguagePack = new LanguagePackInfo(); + this._LanguagePack.DependentPackageID = dependentPackage.PackageID; + this._LanguagePack.LanguageID = locale.LanguageId; break; } } - if (_LanguagePack == null) + if (this._LanguagePack == null) { - LegacyError = "DependencyError"; + this.LegacyError = "DependencyError"; } } } @@ -494,7 +494,7 @@ private void ReadLegacyManifest(XPathNavigator manifestNav) } if (!string.IsNullOrEmpty(filePath)) { - AddFile(Path.Combine(filePath, fileName), sourceFileName); + this.AddFile(Path.Combine(filePath, fileName), sourceFileName); } } } @@ -506,12 +506,12 @@ private void ReadLegacyManifest(XPathNavigator manifestNav) protected override void GetFiles(bool includeSource, bool includeAppCode) { //Language file starts at the root - ParseFolder(Path.Combine(Globals.ApplicationMapPath, BasePath), Globals.ApplicationMapPath); + this.ParseFolder(Path.Combine(Globals.ApplicationMapPath, this.BasePath), Globals.ApplicationMapPath); } protected override void ParseFiles(DirectoryInfo folder, string rootPath) { - if (LanguagePack.PackageType == LanguagePackType.Core) + if (this.LanguagePack.PackageType == LanguagePackType.Core) { if (folder.FullName.ToLowerInvariant().Contains("desktopmodules") && !folder.FullName.ToLowerInvariant().Contains("admin") || folder.FullName.ToLowerInvariant().Contains("providers")) { @@ -533,9 +533,9 @@ protected override void ParseFiles(DirectoryInfo folder, string rootPath) { filePath = filePath.Substring(1); } - if (file.Name.ToLowerInvariant().Contains(Language.Code.ToLowerInvariant()) || (Language.Code.ToLowerInvariant() == "en-us" && !file.Name.Contains("-"))) + if (file.Name.ToLowerInvariant().Contains(this.Language.Code.ToLowerInvariant()) || (this.Language.Code.ToLowerInvariant() == "en-us" && !file.Name.Contains("-"))) { - AddFile(Path.Combine(filePath, file.Name)); + this.AddFile(Path.Combine(filePath, file.Name)); } } } @@ -544,13 +544,13 @@ protected override void ParseFiles(DirectoryInfo folder, string rootPath) protected override void WriteFilesToManifest(XmlWriter writer) { LanguageComponentWriter languageFileWriter; - if (LanguagePack == null) + if (this.LanguagePack == null) { - languageFileWriter = new LanguageComponentWriter(Language, BasePath, Files, Package); + languageFileWriter = new LanguageComponentWriter(this.Language, this.BasePath, this.Files, this.Package); } else { - languageFileWriter = new LanguageComponentWriter(LanguagePack, BasePath, Files, Package); + languageFileWriter = new LanguageComponentWriter(this.LanguagePack, this.BasePath, this.Files, this.Package); } languageFileWriter.WriteManifest(writer); } diff --git a/DNN Platform/Library/Services/Installer/Writers/LibraryPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/LibraryPackageWriter.cs index 1698b638095..ccda3acee4e 100644 --- a/DNN Platform/Library/Services/Installer/Writers/LibraryPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/LibraryPackageWriter.cs @@ -21,8 +21,8 @@ public class LibraryPackageWriter : PackageWriterBase { public LibraryPackageWriter(PackageInfo package) : base(package) { - BasePath = "DesktopModules\\Libraries"; - AssemblyPath = "bin"; + this.BasePath = "DesktopModules\\Libraries"; + this.AssemblyPath = "bin"; } protected override void GetFiles(bool includeSource, bool includeAppCode) diff --git a/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs index d2b1fbfe175..b4234718de8 100644 --- a/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/ModulePackageWriter.cs @@ -37,51 +37,51 @@ public class ModulePackageWriter : PackageWriterBase public ModulePackageWriter(XPathNavigator manifestNav, InstallerInfo installer) { - DesktopModule = new DesktopModuleInfo(); + this.DesktopModule = new DesktopModuleInfo(); //Create a Package - Package = new PackageInfo(installer); + this.Package = new PackageInfo(installer); - ReadLegacyManifest(manifestNav, true); + this.ReadLegacyManifest(manifestNav, true); - Package.Name = DesktopModule.ModuleName; - Package.FriendlyName = DesktopModule.FriendlyName; - Package.Description = DesktopModule.Description; - if (!string.IsNullOrEmpty(DesktopModule.Version)) + this.Package.Name = this.DesktopModule.ModuleName; + this.Package.FriendlyName = this.DesktopModule.FriendlyName; + this.Package.Description = this.DesktopModule.Description; + if (!string.IsNullOrEmpty(this.DesktopModule.Version)) { - Package.Version = new Version(DesktopModule.Version); + this.Package.Version = new Version(this.DesktopModule.Version); } - Package.PackageType = "Module"; + this.Package.PackageType = "Module"; - LegacyUtil.ParsePackageName(Package); + LegacyUtil.ParsePackageName(this.Package); - Initialize(DesktopModule.FolderName); + this.Initialize(this.DesktopModule.FolderName); } public ModulePackageWriter(DesktopModuleInfo desktopModule, XPathNavigator manifestNav, PackageInfo package) : base(package) { - DesktopModule = desktopModule; + this.DesktopModule = desktopModule; - Initialize(desktopModule.FolderName); + this.Initialize(desktopModule.FolderName); if (manifestNav != null) { - ReadLegacyManifest(manifestNav.SelectSingleNode("folders/folder"), false); + this.ReadLegacyManifest(manifestNav.SelectSingleNode("folders/folder"), false); } - string physicalFolderPath = Path.Combine(Globals.ApplicationMapPath, BasePath); - ProcessModuleFolders(physicalFolderPath, physicalFolderPath); + string physicalFolderPath = Path.Combine(Globals.ApplicationMapPath, this.BasePath); + this.ProcessModuleFolders(physicalFolderPath, physicalFolderPath); } public ModulePackageWriter(PackageInfo package) : base(package) { - DesktopModule = DesktopModuleController.GetDesktopModuleByPackageID(package.PackageID); - Initialize(DesktopModule.FolderName); + this.DesktopModule = DesktopModuleController.GetDesktopModuleByPackageID(package.PackageID); + this.Initialize(this.DesktopModule.FolderName); } public ModulePackageWriter(DesktopModuleInfo desktopModule, PackageInfo package) : base(package) { - DesktopModule = desktopModule; - Initialize(desktopModule.FolderName); + this.DesktopModule = desktopModule; + this.Initialize(desktopModule.FolderName); } #endregion @@ -93,13 +93,13 @@ protected override Dictionary Dependencies get { var dependencies = new Dictionary(); - if (!string.IsNullOrEmpty(DesktopModule.Dependencies)) + if (!string.IsNullOrEmpty(this.DesktopModule.Dependencies)) { - dependencies["type"] = DesktopModule.Dependencies; + dependencies["type"] = this.DesktopModule.Dependencies; } - if (!string.IsNullOrEmpty(DesktopModule.Permissions)) + if (!string.IsNullOrEmpty(this.DesktopModule.Permissions)) { - dependencies["permission"] = DesktopModule.Permissions; + dependencies["permission"] = this.DesktopModule.Permissions; } return dependencies; } @@ -124,9 +124,9 @@ protected override Dictionary Dependencies private void Initialize(string folder) { - BasePath = Path.Combine("DesktopModules", folder).Replace("/", "\\"); - AppCodePath = Path.Combine("App_Code", folder).Replace("/", "\\"); - AssemblyPath = "bin"; + this.BasePath = Path.Combine("DesktopModules", folder).Replace("/", "\\"); + this.AppCodePath = Path.Combine("App_Code", folder).Replace("/", "\\"); + this.AssemblyPath = "bin"; } private static void ProcessControls(XPathNavigator controlNav, string moduleFolder, ModuleDefinitionInfo definition) @@ -190,7 +190,7 @@ private void ProcessModuleFiles(string folder, string basePath) foreach (string fileName in Directory.GetFiles(folder)) { string name = fileName.Replace(basePath + "\\", ""); - AddFile(name, name); + this.AddFile(name, name); } } @@ -199,11 +199,11 @@ private void ProcessModuleFolders(string folder, string basePath) //Process Folders recursively foreach (string directoryName in Directory.GetDirectories(folder)) { - ProcessModuleFolders(directoryName, basePath); + this.ProcessModuleFolders(directoryName, basePath); } //process files - ProcessModuleFiles(folder, basePath); + this.ProcessModuleFiles(folder, basePath); } private void ProcessModules(XPathNavigator moduleNav, string moduleFolder) @@ -222,7 +222,7 @@ private void ProcessModules(XPathNavigator moduleNav, string moduleFolder) { ProcessControls(controlNav, moduleFolder, definition); } - DesktopModule.ModuleDefinitions[definition.FriendlyName] = definition; + this.DesktopModule.ModuleDefinitions[definition.FriendlyName] = definition; } private void ReadLegacyManifest(XPathNavigator folderNav, bool processModule) @@ -231,52 +231,52 @@ private void ReadLegacyManifest(XPathNavigator folderNav, bool processModule) { //Version 2 of legacy manifest string name = Util.ReadElement(folderNav, "name"); - DesktopModule.FolderName = name; - DesktopModule.ModuleName = name; - DesktopModule.FriendlyName = name; + this.DesktopModule.FolderName = name; + this.DesktopModule.ModuleName = name; + this.DesktopModule.FriendlyName = name; string folderName = Util.ReadElement(folderNav, "foldername"); if (!string.IsNullOrEmpty(folderName)) { - DesktopModule.FolderName = folderName; + this.DesktopModule.FolderName = folderName; } - if (string.IsNullOrEmpty(DesktopModule.FolderName)) + if (string.IsNullOrEmpty(this.DesktopModule.FolderName)) { - DesktopModule.FolderName = "MyModule"; + this.DesktopModule.FolderName = "MyModule"; } string friendlyname = Util.ReadElement(folderNav, "friendlyname"); if (!string.IsNullOrEmpty(friendlyname)) { - DesktopModule.FriendlyName = friendlyname; - DesktopModule.ModuleName = friendlyname; + this.DesktopModule.FriendlyName = friendlyname; + this.DesktopModule.ModuleName = friendlyname; } string iconFile = Util.ReadElement(folderNav, "iconfile"); if (!string.IsNullOrEmpty(iconFile)) { - Package.IconFile = iconFile; + this.Package.IconFile = iconFile; } string modulename = Util.ReadElement(folderNav, "modulename"); if (!string.IsNullOrEmpty(modulename)) { - DesktopModule.ModuleName = modulename; + this.DesktopModule.ModuleName = modulename; } string permissions = Util.ReadElement(folderNav, "permissions"); if (!string.IsNullOrEmpty(permissions)) { - DesktopModule.Permissions = permissions; + this.DesktopModule.Permissions = permissions; } string dependencies = Util.ReadElement(folderNav, "dependencies"); if (!string.IsNullOrEmpty(dependencies)) { - DesktopModule.Dependencies = dependencies; + this.DesktopModule.Dependencies = dependencies; } - DesktopModule.Version = Util.ReadElement(folderNav, "version", "01.00.00"); - DesktopModule.Description = Util.ReadElement(folderNav, "description"); - DesktopModule.BusinessControllerClass = Util.ReadElement(folderNav, "businesscontrollerclass"); + this.DesktopModule.Version = Util.ReadElement(folderNav, "version", "01.00.00"); + this.DesktopModule.Description = Util.ReadElement(folderNav, "description"); + this.DesktopModule.BusinessControllerClass = Util.ReadElement(folderNav, "businesscontrollerclass"); //Process legacy modules Node foreach (XPathNavigator moduleNav in folderNav.Select("modules/module")) { - ProcessModules(moduleNav, DesktopModule.FolderName); + this.ProcessModules(moduleNav, this.DesktopModule.FolderName); } } @@ -292,13 +292,13 @@ private void ReadLegacyManifest(XPathNavigator folderNav, bool processModule) if (filePath.Contains("[app_code]")) { //Special case for App_code - files can be in App_Code\ModuleName or root - sourceFileName = Path.Combine(filePath, fileName).Replace("[app_code]", "App_Code\\" + DesktopModule.FolderName); + sourceFileName = Path.Combine(filePath, fileName).Replace("[app_code]", "App_Code\\" + this.DesktopModule.FolderName); } else { sourceFileName = Path.Combine(filePath, fileName); } - string tempFolder = Package.InstallerInfo.TempInstallFolder; + string tempFolder = this.Package.InstallerInfo.TempInstallFolder; if (!File.Exists(Path.Combine(tempFolder, sourceFileName))) { sourceFileName = fileName; @@ -307,18 +307,18 @@ private void ReadLegacyManifest(XPathNavigator folderNav, bool processModule) //In Legacy Modules the assembly is always in "bin" - ignore the path element if (fileName.EndsWith(".dll", StringComparison.InvariantCultureIgnoreCase)) { - AddFile("bin/" + fileName, sourceFileName); + this.AddFile("bin/" + fileName, sourceFileName); } else { - AddFile(Path.Combine(filePath, fileName), sourceFileName); + this.AddFile(Path.Combine(filePath, fileName), sourceFileName); } } //Process resource file Node if (!string.IsNullOrEmpty(Util.ReadElement(folderNav, "resourcefile"))) { - AddResourceFile(new InstallFile(Util.ReadElement(folderNav, "resourcefile"), Package.InstallerInfo)); + this.AddResourceFile(new InstallFile(Util.ReadElement(folderNav, "resourcefile"), this.Package.InstallerInfo)); } } @@ -337,15 +337,15 @@ private void WriteEventMessage(XmlWriter writer) writer.WriteStartElement("attributes"); //Write businessControllerClass Attribute - writer.WriteElementString("businessControllerClass", DesktopModule.BusinessControllerClass); + writer.WriteElementString("businessControllerClass", this.DesktopModule.BusinessControllerClass); //Write businessControllerClass Attribute writer.WriteElementString("desktopModuleID", "[DESKTOPMODULEID]"); //Write upgradeVersionsList Attribute string upgradeVersions = Null.NullString; - Versions.Sort(); - foreach (string version in Versions) + this.Versions.Sort(); + foreach (string version in this.Versions) { upgradeVersions += version + ","; } @@ -369,16 +369,16 @@ private void WriteModuleComponent(XmlWriter writer) writer.WriteAttributeString("type", "Module"); //Write Module Manifest - if (AppCodeFiles.Count > 0) + if (this.AppCodeFiles.Count > 0) { - DesktopModule.CodeSubDirectory = DesktopModule.FolderName; + this.DesktopModule.CodeSubDirectory = this.DesktopModule.FolderName; } - CBO.SerializeObject(DesktopModule, writer); + CBO.SerializeObject(this.DesktopModule, writer); //Write EventMessage - if (!string.IsNullOrEmpty(DesktopModule.BusinessControllerClass)) + if (!string.IsNullOrEmpty(this.DesktopModule.BusinessControllerClass)) { - WriteEventMessage(writer); + this.WriteEventMessage(writer); } //End component Element @@ -392,7 +392,7 @@ private void WriteModuleComponent(XmlWriter writer) protected override void WriteManifestComponent(XmlWriter writer) { //Write Module Component - WriteModuleComponent(writer); + this.WriteModuleComponent(writer); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Writers/PackageWriterBase.cs b/DNN Platform/Library/Services/Installer/Writers/PackageWriterBase.cs index d23559ca22b..3f737d97774 100644 --- a/DNN Platform/Library/Services/Installer/Writers/PackageWriterBase.cs +++ b/DNN Platform/Library/Services/Installer/Writers/PackageWriterBase.cs @@ -56,8 +56,8 @@ protected PackageWriterBase() public PackageWriterBase(PackageInfo package) { - _Package = package; - _Package.AttachInstallerInfo(new InstallerInfo()); + this._Package = package; + this._Package.AttachInstallerInfo(new InstallerInfo()); } #endregion @@ -87,7 +87,7 @@ public Dictionary AppCodeFiles { get { - return _AppCodeFiles; + return this._AppCodeFiles; } } @@ -109,7 +109,7 @@ public Dictionary Assemblies { get { - return _Assemblies; + return this._Assemblies; } } @@ -131,11 +131,11 @@ public string BasePath { get { - return _BasePath; + return this._BasePath; } set { - _BasePath = value; + this._BasePath = value; } } @@ -149,7 +149,7 @@ public SortedList CleanUpFiles { get { - return _CleanUpFiles; + return this._CleanUpFiles; } } @@ -163,7 +163,7 @@ public Dictionary Files { get { - return _Files; + return this._Files; } } @@ -207,7 +207,7 @@ public Logger Log { get { - return Package.Log; + return this.Package.Log; } } @@ -221,11 +221,11 @@ public PackageInfo Package { get { - return _Package; + return this._Package; } set { - _Package = value; + this._Package = value; } } @@ -239,7 +239,7 @@ public Dictionary Resources { get { - return _Resources; + return this._Resources; } } @@ -253,7 +253,7 @@ public Dictionary Scripts { get { - return _Scripts; + return this._Scripts; } } @@ -267,7 +267,7 @@ public List Versions { get { - return _Versions; + return this._Versions; } } @@ -296,7 +296,7 @@ private void AddFilesToZip(ZipOutputStream stream, IDictionary 0) + if (this.Dependencies.Count > 0) { writer.WriteStartElement("dependencies"); - foreach (KeyValuePair kvp in Dependencies) + foreach (KeyValuePair kvp in this.Dependencies) { writer.WriteStartElement("dependency"); writer.WriteAttributeString("type", kvp.Key); @@ -422,12 +422,12 @@ private void WritePackageStartElement(XmlWriter writer) protected virtual void AddFile(string fileName) { - AddFile(new InstallFile(fileName, Package.InstallerInfo)); + this.AddFile(new InstallFile(fileName, this.Package.InstallerInfo)); } protected virtual void AddFile(string fileName, string sourceFileName) { - AddFile(new InstallFile(fileName, sourceFileName, Package.InstallerInfo)); + this.AddFile(new InstallFile(fileName, sourceFileName, this.Package.InstallerInfo)); } protected virtual void ConvertLegacyManifest(XPathNavigator legacyManifest, XmlWriter writer) @@ -436,7 +436,7 @@ protected virtual void ConvertLegacyManifest(XPathNavigator legacyManifest, XmlW protected virtual void GetFiles(bool includeSource, bool includeAppCode) { - string baseFolder = Path.Combine(Globals.ApplicationMapPath, BasePath); + string baseFolder = Path.Combine(Globals.ApplicationMapPath, this.BasePath); if (Directory.Exists(baseFolder)) { //Create the DirectoryInfo object @@ -448,23 +448,23 @@ protected virtual void GetFiles(bool includeSource, bool includeAppCode) if (files.Length == 0) //Assume Dynamic (App_Code based) Module { //Add the files in the DesktopModules Folder - ParseFolder(baseFolder, baseFolder); + this.ParseFolder(baseFolder, baseFolder); //Add the files in the AppCode Folder if (includeAppCode) { - string appCodeFolder = Path.Combine(Globals.ApplicationMapPath, AppCodePath); - ParseFolder(appCodeFolder, appCodeFolder); + string appCodeFolder = Path.Combine(Globals.ApplicationMapPath, this.AppCodePath); + this.ParseFolder(appCodeFolder, appCodeFolder); } } else //WAP Project File is present { - HasProjectFile = true; + this.HasProjectFile = true; //Parse the Project files (probably only one) foreach (FileInfo projFile in files) { - ParseProjectFile(projFile, includeSource); + this.ParseProjectFile(projFile, includeSource); } } } @@ -487,7 +487,7 @@ protected virtual void ParseFiles(DirectoryInfo folder, string rootPath) } if (!file.Extension.Equals(".dnn", StringComparison.InvariantCultureIgnoreCase) && (file.Attributes & FileAttributes.Hidden) == 0) { - AddFile(Path.Combine(filePath, file.Name)); + this.AddFile(Path.Combine(filePath, file.Name)); } } } @@ -504,12 +504,12 @@ protected virtual void ParseFolder(string folderName, string rootPath) { if ((subFolder.Attributes & FileAttributes.Hidden) == 0) { - ParseFolder(subFolder.FullName, rootPath); + this.ParseFolder(subFolder.FullName, rootPath); } } //Add the Files in the Folder - ParseFiles(folder, rootPath); + this.ParseFiles(folder, rootPath); } } @@ -528,8 +528,8 @@ protected void ParseProjectFile(FileInfo projFile, bool includeSource) fileName = assemblyNav.Value; XPathNavigator buildPathNav = rootNav.SelectSingleNode("proj:PropertyGroup/proj:OutputPath", manager); string buildPath = buildPathNav.Value.Replace("..\\", ""); - buildPath = buildPath.Replace(AssemblyPath + "\\", ""); - AddFile(Path.Combine(buildPath, fileName + ".dll")); + buildPath = buildPath.Replace(this.AssemblyPath + "\\", ""); + this.AddFile(Path.Combine(buildPath, fileName + ".dll")); //Check for referenced assemblies foreach (XPathNavigator itemNav in rootNav.Select("proj:ItemGroup/proj:Reference", manager)) @@ -543,7 +543,7 @@ protected void ParseProjectFile(FileInfo projFile, bool includeSource) !(fileName.StartsWith("system", StringComparison.InvariantCultureIgnoreCase) || fileName.StartsWith("microsoft", StringComparison.InvariantCultureIgnoreCase) || fileName.Equals("dotnetnuke", StringComparison.InvariantCultureIgnoreCase) || fileName.Equals("dotnetnuke.webutility", StringComparison.InvariantCultureIgnoreCase) || fileName.Equals("dotnetnuke.webcontrols", StringComparison.InvariantCultureIgnoreCase))) { - AddFile(fileName + ".dll"); + this.AddFile(fileName + ".dll"); } } @@ -551,14 +551,14 @@ protected void ParseProjectFile(FileInfo projFile, bool includeSource) foreach (XPathNavigator itemNav in rootNav.Select("proj:ItemGroup/proj:None", manager)) { fileName = Util.ReadAttribute(itemNav, "Include"); - AddFile(fileName); + this.AddFile(fileName); } //Add all the files that are classified as Content foreach (XPathNavigator itemNav in rootNav.Select("proj:ItemGroup/proj:Content", manager)) { fileName = Util.ReadAttribute(itemNav, "Include"); - AddFile(fileName); + this.AddFile(fileName); } //Add all the files that are classified as Compile @@ -567,14 +567,14 @@ protected void ParseProjectFile(FileInfo projFile, bool includeSource) foreach (XPathNavigator itemNav in rootNav.Select("proj:ItemGroup/proj:Compile", manager)) { fileName = Util.ReadAttribute(itemNav, "Include"); - AddFile(fileName); + this.AddFile(fileName); } } } protected virtual void WriteFilesToManifest(XmlWriter writer) { - var fileWriter = new FileComponentWriter(BasePath, Files, Package); + var fileWriter = new FileComponentWriter(this.BasePath, this.Files, this.Package); fileWriter.WriteManifest(writer); } @@ -591,50 +591,50 @@ public virtual void AddFile(InstallFile file) switch (file.Type) { case InstallFileType.AppCode: - _AppCodeFiles[file.FullName.ToLowerInvariant()] = file; + this._AppCodeFiles[file.FullName.ToLowerInvariant()] = file; break; case InstallFileType.Assembly: - _Assemblies[file.FullName.ToLowerInvariant()] = file; + this._Assemblies[file.FullName.ToLowerInvariant()] = file; break; case InstallFileType.CleanUp: - _CleanUpFiles[file.FullName.ToLowerInvariant()] = file; + this._CleanUpFiles[file.FullName.ToLowerInvariant()] = file; break; case InstallFileType.Script: - _Scripts[file.FullName.ToLowerInvariant()] = file; + this._Scripts[file.FullName.ToLowerInvariant()] = file; break; default: - _Files[file.FullName.ToLowerInvariant()] = file; + this._Files[file.FullName.ToLowerInvariant()] = file; break; } if ((file.Type == InstallFileType.CleanUp || file.Type == InstallFileType.Script) && FileVersionMatchRegex.IsMatch(file.Name)) { string version = Path.GetFileNameWithoutExtension(file.Name); - if (!_Versions.Contains(version)) + if (!this._Versions.Contains(version)) { - _Versions.Add(version); + this._Versions.Add(version); } } } public void AddResourceFile(InstallFile file) { - _Resources[file.FullName.ToLowerInvariant()] = file; + this._Resources[file.FullName.ToLowerInvariant()] = file; } public void CreatePackage(string archiveName, string manifestName, string manifest, bool createManifest) { if (createManifest) { - WriteManifest(manifestName, manifest); + this.WriteManifest(manifestName, manifest); } - AddFile(manifestName); - CreateZipFile(archiveName); + this.AddFile(manifestName); + this.CreateZipFile(archiveName); } public void GetFiles(bool includeSource) { //Call protected method that does the work - GetFiles(includeSource, true); + this.GetFiles(includeSource, true); } /// @@ -645,11 +645,11 @@ public void GetFiles(bool includeSource) /// This overload takes a package manifest and writes it to a file public void WriteManifest(string manifestName, string manifest) { - using (XmlWriter writer = XmlWriter.Create(Path.Combine(Globals.ApplicationMapPath, Path.Combine(BasePath, manifestName)), XmlUtils.GetXmlWriterSettings(ConformanceLevel.Fragment))) + using (XmlWriter writer = XmlWriter.Create(Path.Combine(Globals.ApplicationMapPath, Path.Combine(this.BasePath, manifestName)), XmlUtils.GetXmlWriterSettings(ConformanceLevel.Fragment))) { - Log.StartJob(Util.WRITER_CreatingManifest); - WriteManifest(writer, manifest); - Log.EndJob(Util.WRITER_CreatedManifest); + this.Log.StartJob(Util.WRITER_CreatingManifest); + this.WriteManifest(writer, manifest); + this.Log.EndJob(Util.WRITER_CreatedManifest); } } @@ -684,7 +684,7 @@ public string WriteManifest(bool packageFragment) var sb = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(sb, XmlUtils.GetXmlWriterSettings(ConformanceLevel.Fragment))) { - WriteManifest(writer, packageFragment); + this.WriteManifest(writer, packageFragment); //Close XmlWriter writer.Close(); //Return new manifest @@ -694,7 +694,7 @@ public string WriteManifest(bool packageFragment) public void WriteManifest(XmlWriter writer, bool packageFragment) { - Log.StartJob(Util.WRITER_CreatingManifest); + this.Log.StartJob(Util.WRITER_CreatingManifest); if (!packageFragment) { @@ -703,61 +703,61 @@ public void WriteManifest(XmlWriter writer, bool packageFragment) } //Start package Element - WritePackageStartElement(writer); + this.WritePackageStartElement(writer); //write Script Component - if (Scripts.Count > 0) + if (this.Scripts.Count > 0) { - var scriptWriter = new ScriptComponentWriter(BasePath, Scripts, Package); + var scriptWriter = new ScriptComponentWriter(this.BasePath, this.Scripts, this.Package); scriptWriter.WriteManifest(writer); } //write Clean Up Files Component - if (CleanUpFiles.Count > 0) + if (this.CleanUpFiles.Count > 0) { - var cleanupFileWriter = new CleanupComponentWriter(BasePath, CleanUpFiles); + var cleanupFileWriter = new CleanupComponentWriter(this.BasePath, this.CleanUpFiles); cleanupFileWriter.WriteManifest(writer); } //Write the Custom Component - WriteManifestComponent(writer); + this.WriteManifestComponent(writer); //Write Assemblies Component - if (Assemblies.Count > 0) + if (this.Assemblies.Count > 0) { - var assemblyWriter = new AssemblyComponentWriter(AssemblyPath, Assemblies, Package); + var assemblyWriter = new AssemblyComponentWriter(this.AssemblyPath, this.Assemblies, this.Package); assemblyWriter.WriteManifest(writer); } //Write AppCode Files Component - if (AppCodeFiles.Count > 0) + if (this.AppCodeFiles.Count > 0) { - var fileWriter = new FileComponentWriter(AppCodePath, AppCodeFiles, Package); + var fileWriter = new FileComponentWriter(this.AppCodePath, this.AppCodeFiles, this.Package); fileWriter.WriteManifest(writer); } //write Files Component - if (Files.Count > 0) + if (this.Files.Count > 0) { - WriteFilesToManifest(writer); + this.WriteFilesToManifest(writer); } //write ResourceFiles Component - if (Resources.Count > 0) + if (this.Resources.Count > 0) { - var fileWriter = new ResourceFileComponentWriter(BasePath, Resources, Package); + var fileWriter = new ResourceFileComponentWriter(this.BasePath, this.Resources, this.Package); fileWriter.WriteManifest(writer); } //Close Package - WritePackageEndElement(writer); + this.WritePackageEndElement(writer); if (!packageFragment) { //Close Dotnetnuke Element WriteManifestEndElement(writer); } - Log.EndJob(Util.WRITER_CreatedManifest); + this.Log.EndJob(Util.WRITER_CreatedManifest); } public static void WriteManifestEndElement(XmlWriter writer) diff --git a/DNN Platform/Library/Services/Installer/Writers/ProviderPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/ProviderPackageWriter.cs index 9ecc5b31631..a8269d63c10 100644 --- a/DNN Platform/Library/Services/Installer/Writers/ProviderPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/ProviderPackageWriter.cs @@ -34,7 +34,7 @@ public ProviderPackageWriter(PackageInfo package) : base(package) } if (!string.IsNullOrEmpty(providerPath)) { - BasePath = providerPath.Replace("~/", "").Replace("/", "\\"); + this.BasePath = providerPath.Replace("~/", "").Replace("/", "\\"); } } diff --git a/DNN Platform/Library/Services/Installer/Writers/ScriptComponentWriter.cs b/DNN Platform/Library/Services/Installer/Writers/ScriptComponentWriter.cs index 35eafe52a8f..926b2a4d496 100644 --- a/DNN Platform/Library/Services/Installer/Writers/ScriptComponentWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/ScriptComponentWriter.cs @@ -81,14 +81,14 @@ protected override string ItemNodeName protected override void WriteFileElement(XmlWriter writer, InstallFile file) { - Log.AddInfo(string.Format(Util.WRITER_AddFileToManifest, file.Name)); + this.Log.AddInfo(string.Format(Util.WRITER_AddFileToManifest, file.Name)); string type = "Install"; string version = Null.NullString; string fileName = Path.GetFileNameWithoutExtension(file.Name); if (fileName.Equals("uninstall", StringComparison.InvariantCultureIgnoreCase)) //UnInstall.SqlDataprovider { type = "UnInstall"; - version = Package.Version.ToString(3); + version = this.Package.Version.ToString(3); } else if (fileName.Equals("install", StringComparison.InvariantCultureIgnoreCase)) //Install.SqlDataprovider { @@ -107,7 +107,7 @@ protected override void WriteFileElement(XmlWriter writer, InstallFile file) } //Start file Element - writer.WriteStartElement(ItemNodeName); + writer.WriteStartElement(this.ItemNodeName); writer.WriteAttributeString("type", type); //Write path diff --git a/DNN Platform/Library/Services/Installer/Writers/SkinComponentWriter.cs b/DNN Platform/Library/Services/Installer/Writers/SkinComponentWriter.cs index d7ebf8d795c..076fd9af828 100644 --- a/DNN Platform/Library/Services/Installer/Writers/SkinComponentWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/SkinComponentWriter.cs @@ -41,7 +41,7 @@ public class SkinComponentWriter : FileComponentWriter /// ----------------------------------------------------------------------------- public SkinComponentWriter(string skinName, string basePath, Dictionary files, PackageInfo package) : base(basePath, files, package) { - _SkinName = skinName; + this._SkinName = skinName; } #endregion @@ -117,7 +117,7 @@ protected virtual string SkinNameNodeName /// ----------------------------------------------------------------------------- protected override void WriteCustomManifest(XmlWriter writer) { - writer.WriteElementString(SkinNameNodeName, _SkinName); + writer.WriteElementString(this.SkinNameNodeName, this._SkinName); } #endregion diff --git a/DNN Platform/Library/Services/Installer/Writers/SkinControlPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/SkinControlPackageWriter.cs index cf388b3d5af..99196a077e7 100644 --- a/DNN Platform/Library/Services/Installer/Writers/SkinControlPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/SkinControlPackageWriter.cs @@ -30,34 +30,34 @@ public class SkinControlPackageWriter : PackageWriterBase public SkinControlPackageWriter(PackageInfo package) : base(package) { - SkinControl = SkinControlController.GetSkinControlByPackageID(package.PackageID); - BasePath = Path.Combine("DesktopModules", package.Name.ToLowerInvariant()).Replace("/", "\\"); - AppCodePath = Path.Combine("App_Code", package.Name.ToLowerInvariant()).Replace("/", "\\"); + this.SkinControl = SkinControlController.GetSkinControlByPackageID(package.PackageID); + this.BasePath = Path.Combine("DesktopModules", package.Name.ToLowerInvariant()).Replace("/", "\\"); + this.AppCodePath = Path.Combine("App_Code", package.Name.ToLowerInvariant()).Replace("/", "\\"); } public SkinControlPackageWriter(SkinControlInfo skinControl, PackageInfo package) : base(package) { - SkinControl = skinControl; - BasePath = Path.Combine("DesktopModules", package.Name.ToLowerInvariant()).Replace("/", "\\"); - AppCodePath = Path.Combine("App_Code", package.Name.ToLowerInvariant()).Replace("/", "\\"); + this.SkinControl = skinControl; + this.BasePath = Path.Combine("DesktopModules", package.Name.ToLowerInvariant()).Replace("/", "\\"); + this.AppCodePath = Path.Combine("App_Code", package.Name.ToLowerInvariant()).Replace("/", "\\"); } public SkinControlPackageWriter(XPathNavigator manifestNav, InstallerInfo installer) { - SkinControl = new SkinControlInfo(); + this.SkinControl = new SkinControlInfo(); //Create a Package - Package = new PackageInfo(installer); + this.Package = new PackageInfo(installer); - ReadLegacyManifest(manifestNav, true); + this.ReadLegacyManifest(manifestNav, true); - Package.Description = Null.NullString; - Package.Version = new Version(1, 0, 0); - Package.PackageType = "SkinObject"; - Package.License = Util.PACKAGE_NoLicense; + this.Package.Description = Null.NullString; + this.Package.Version = new Version(1, 0, 0); + this.Package.PackageType = "SkinObject"; + this.Package.License = Util.PACKAGE_NoLicense; - BasePath = Path.Combine("DesktopModules", Package.Name.ToLowerInvariant()).Replace("/", "\\"); - AppCodePath = Path.Combine("App_Code", Package.Name.ToLowerInvariant()).Replace("/", "\\"); + this.BasePath = Path.Combine("DesktopModules", this.Package.Name.ToLowerInvariant()).Replace("/", "\\"); + this.AppCodePath = Path.Combine("App_Code", this.Package.Name.ToLowerInvariant()).Replace("/", "\\"); } #endregion @@ -80,18 +80,18 @@ private void ReadLegacyManifest(XPathNavigator legacyManifest, bool processModul if (processModule) { - Package.Name = Util.ReadElement(folderNav, "name"); - Package.FriendlyName = Package.Name; + this.Package.Name = Util.ReadElement(folderNav, "name"); + this.Package.FriendlyName = this.Package.Name; //Process legacy controls Node foreach (XPathNavigator controlNav in folderNav.Select("modules/module/controls/control")) { - SkinControl.ControlKey = Util.ReadElement(controlNav, "key"); - SkinControl.ControlSrc = Path.Combine(Path.Combine("DesktopModules", Package.Name.ToLowerInvariant()), Util.ReadElement(controlNav, "src")).Replace("\\", "/"); + this.SkinControl.ControlKey = Util.ReadElement(controlNav, "key"); + this.SkinControl.ControlSrc = Path.Combine(Path.Combine("DesktopModules", this.Package.Name.ToLowerInvariant()), Util.ReadElement(controlNav, "src")).Replace("\\", "/"); string supportsPartialRendering = Util.ReadElement(controlNav, "supportspartialrendering"); if (!string.IsNullOrEmpty(supportsPartialRendering)) { - SkinControl.SupportsPartialRendering = bool.Parse(supportsPartialRendering); + this.SkinControl.SupportsPartialRendering = bool.Parse(supportsPartialRendering); } } } @@ -102,13 +102,13 @@ private void ReadLegacyManifest(XPathNavigator legacyManifest, bool processModul string fileName = Util.ReadElement(fileNav, "name"); string filePath = Util.ReadElement(fileNav, "path"); - AddFile(Path.Combine(filePath, fileName), fileName); + this.AddFile(Path.Combine(filePath, fileName), fileName); } //Process resource file Node if (!string.IsNullOrEmpty(Util.ReadElement(folderNav, "resourcefile"))) { - AddFile(Util.ReadElement(folderNav, "resourcefile")); + this.AddFile(Util.ReadElement(folderNav, "resourcefile")); } } @@ -121,7 +121,7 @@ protected override void WriteManifestComponent(XmlWriter writer) writer.WriteAttributeString("type", "SkinObject"); //Write SkinControl Manifest - CBO.SerializeObject(SkinControl, writer); + CBO.SerializeObject(this.SkinControl, writer); //End component Element writer.WriteEndElement(); diff --git a/DNN Platform/Library/Services/Installer/Writers/SkinPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/SkinPackageWriter.cs index c95d91a1d8a..3573a1b6c56 100644 --- a/DNN Platform/Library/Services/Installer/Writers/SkinPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/SkinPackageWriter.cs @@ -35,27 +35,27 @@ public class SkinPackageWriter : PackageWriterBase public SkinPackageWriter(PackageInfo package) : base(package) { - _SkinPackage = SkinController.GetSkinByPackageID(package.PackageID); - SetBasePath(); + this._SkinPackage = SkinController.GetSkinByPackageID(package.PackageID); + this.SetBasePath(); } public SkinPackageWriter(SkinPackageInfo skinPackage, PackageInfo package) : base(package) { - _SkinPackage = skinPackage; - SetBasePath(); + this._SkinPackage = skinPackage; + this.SetBasePath(); } public SkinPackageWriter(SkinPackageInfo skinPackage, PackageInfo package, string basePath) : base(package) { - _SkinPackage = skinPackage; - BasePath = basePath; + this._SkinPackage = skinPackage; + this.BasePath = basePath; } public SkinPackageWriter(SkinPackageInfo skinPackage, PackageInfo package, string basePath, string subFolder) : base(package) { - _SkinPackage = skinPackage; - _SubFolder = subFolder; - BasePath = Path.Combine(basePath, subFolder); + this._SkinPackage = skinPackage; + this._SubFolder = subFolder; + this.BasePath = Path.Combine(basePath, subFolder); } #endregion @@ -73,7 +73,7 @@ protected SkinPackageInfo SkinPackage { get { - return _SkinPackage; + return this._SkinPackage; } } @@ -81,13 +81,13 @@ protected SkinPackageInfo SkinPackage public void SetBasePath() { - if (_SkinPackage.SkinType == "Skin") + if (this._SkinPackage.SkinType == "Skin") { - BasePath = Path.Combine("Portals\\_default\\Skins", SkinPackage.SkinName); + this.BasePath = Path.Combine("Portals\\_default\\Skins", this.SkinPackage.SkinName); } else { - BasePath = Path.Combine("Portals\\_default\\Containers", SkinPackage.SkinName); + this.BasePath = Path.Combine("Portals\\_default\\Containers", this.SkinPackage.SkinName); } } @@ -110,14 +110,14 @@ protected override void ParseFiles(DirectoryInfo folder, string rootPath) } if (!file.Extension.Equals(".dnn", StringComparison.InvariantCultureIgnoreCase)) { - if (string.IsNullOrEmpty(_SubFolder)) + if (string.IsNullOrEmpty(this._SubFolder)) { - AddFile(Path.Combine(filePath, file.Name)); + this.AddFile(Path.Combine(filePath, file.Name)); } else { filePath = Path.Combine(filePath, file.Name); - AddFile(filePath, Path.Combine(_SubFolder, filePath)); + this.AddFile(filePath, Path.Combine(this._SubFolder, filePath)); } } } @@ -125,14 +125,14 @@ protected override void ParseFiles(DirectoryInfo folder, string rootPath) protected override void WriteFilesToManifest(XmlWriter writer) { - var skinFileWriter = new SkinComponentWriter(SkinPackage.SkinName, BasePath, Files, Package); - if (SkinPackage.SkinType == "Skin") + var skinFileWriter = new SkinComponentWriter(this.SkinPackage.SkinName, this.BasePath, this.Files, this.Package); + if (this.SkinPackage.SkinType == "Skin") { - skinFileWriter = new SkinComponentWriter(SkinPackage.SkinName, BasePath, Files, Package); + skinFileWriter = new SkinComponentWriter(this.SkinPackage.SkinName, this.BasePath, this.Files, this.Package); } else { - skinFileWriter = new ContainerComponentWriter(SkinPackage.SkinName, BasePath, Files, Package); + skinFileWriter = new ContainerComponentWriter(this.SkinPackage.SkinName, this.BasePath, this.Files, this.Package); } skinFileWriter.WriteManifest(writer); } diff --git a/DNN Platform/Library/Services/Installer/Writers/WidgetPackageWriter.cs b/DNN Platform/Library/Services/Installer/Writers/WidgetPackageWriter.cs index 196a5f54b70..4fbfc3f2d51 100644 --- a/DNN Platform/Library/Services/Installer/Writers/WidgetPackageWriter.cs +++ b/DNN Platform/Library/Services/Installer/Writers/WidgetPackageWriter.cs @@ -32,7 +32,7 @@ public WidgetPackageWriter(PackageInfo package) : base(package) company = company.Substring(0, company.IndexOf(".")); } - BasePath = Path.Combine("Resources\\Widgets\\User", company); + this.BasePath = Path.Combine("Resources\\Widgets\\User", company); } #endregion @@ -57,8 +57,8 @@ protected override void GetFiles(bool includeSource, bool includeAppCode) protected override void WriteFilesToManifest(XmlWriter writer) { - string company = Package.Name.Substring(0, Package.Name.IndexOf(".")); - var widgetFileWriter = new WidgetComponentWriter(company, Files, Package); + string company = this.Package.Name.Substring(0, this.Package.Name.IndexOf(".")); + var widgetFileWriter = new WidgetComponentWriter(company, this.Files, this.Package); widgetFileWriter.WriteManifest(writer); } } diff --git a/DNN Platform/Library/Services/Installer/XmlMerge.cs b/DNN Platform/Library/Services/Installer/XmlMerge.cs index 5d260ef8d75..9734850d887 100644 --- a/DNN Platform/Library/Services/Installer/XmlMerge.cs +++ b/DNN Platform/Library/Services/Installer/XmlMerge.cs @@ -45,10 +45,10 @@ public class XmlMerge /// ----------------------------------------------------------------------------- public XmlMerge(string sourceFileName, string version, string sender) { - Version = version; - Sender = sender; - SourceConfig = new XmlDocument { XmlResolver = null }; - SourceConfig.Load(sourceFileName); + this.Version = version; + this.Sender = sender; + this.SourceConfig = new XmlDocument { XmlResolver = null }; + this.SourceConfig.Load(sourceFileName); } /// ----------------------------------------------------------------------------- @@ -61,10 +61,10 @@ public XmlMerge(string sourceFileName, string version, string sender) /// ----------------------------------------------------------------------------- public XmlMerge(Stream sourceStream, string version, string sender) { - Version = version; - Sender = sender; - SourceConfig = new XmlDocument { XmlResolver = null }; - SourceConfig.Load(sourceStream); + this.Version = version; + this.Sender = sender; + this.SourceConfig = new XmlDocument { XmlResolver = null }; + this.SourceConfig.Load(sourceStream); } /// ----------------------------------------------------------------------------- @@ -77,10 +77,10 @@ public XmlMerge(Stream sourceStream, string version, string sender) /// ----------------------------------------------------------------------------- public XmlMerge(TextReader sourceReader, string version, string sender) { - Version = version; - Sender = sender; - SourceConfig = new XmlDocument { XmlResolver = null }; - SourceConfig.Load(sourceReader); + this.Version = version; + this.Sender = sender; + this.SourceConfig = new XmlDocument { XmlResolver = null }; + this.SourceConfig.Load(sourceReader); } /// ----------------------------------------------------------------------------- @@ -93,9 +93,9 @@ public XmlMerge(TextReader sourceReader, string version, string sender) /// ----------------------------------------------------------------------------- public XmlMerge(XmlDocument sourceDoc, string version, string sender) { - Version = version; - Sender = sender; - SourceConfig = sourceDoc; + this.Version = version; + this.Sender = sender; + this.SourceConfig = sourceDoc; } #endregion @@ -154,12 +154,12 @@ public IDictionary PendingDocuments { get { - if (_pendingDocuments == null) + if (this._pendingDocuments == null) { - _pendingDocuments = new Dictionary(); + this._pendingDocuments = new Dictionary(); } - return _pendingDocuments; + return this._pendingDocuments; } } @@ -174,7 +174,7 @@ private bool AddNode(XmlNode rootNode, XmlNode actionNode) { if (child.NodeType == XmlNodeType.Element || child.NodeType == XmlNodeType.Comment) { - rootNode.AppendChild(TargetConfig.ImportNode(child, true)); + rootNode.AppendChild(this.TargetConfig.ImportNode(child, true)); DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "AddNode:" + child.InnerXml.ToString()); changedNode = true; } @@ -190,7 +190,7 @@ private bool PrependNode(XmlNode rootNode, XmlNode actionNode) { if (child.NodeType == XmlNodeType.Element || child.NodeType == XmlNodeType.Comment) { - rootNode.PrependChild(TargetConfig.ImportNode(child, true)); + rootNode.PrependChild(this.TargetConfig.ImportNode(child, true)); DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "PrependNode:" + child.InnerXml.ToString()); changedNode = true; } @@ -213,11 +213,11 @@ private bool InsertNode(XmlNode childRootNode, XmlNode actionNode, NodeInsertTyp switch (mode) { case NodeInsertType.Before: - rootNode.InsertBefore(TargetConfig.ImportNode(child, true), childRootNode); + rootNode.InsertBefore(this.TargetConfig.ImportNode(child, true), childRootNode); changedNode = true; break; case NodeInsertType.After: - rootNode.InsertAfter(TargetConfig.ImportNode(child, true), childRootNode); + rootNode.InsertAfter(this.TargetConfig.ImportNode(child, true), childRootNode); changedNode = true; break; } @@ -231,7 +231,7 @@ private bool ProcessNode(XmlNode node, XmlNode targetRoot) { Debug.Assert(node.Attributes != null, "node.Attributes != null"); - XmlNode rootNode = FindMatchingNode(targetRoot, node, "path"); + XmlNode rootNode = this.FindMatchingNode(targetRoot, node, "path"); string nodeAction = node.Attributes["action"].Value.ToLowerInvariant(); @@ -243,21 +243,21 @@ private bool ProcessNode(XmlNode node, XmlNode targetRoot) switch (nodeAction) { case "add": - return AddNode(rootNode, node); + return this.AddNode(rootNode, node); case "prepend": - return PrependNode(rootNode, node); + return this.PrependNode(rootNode, node); case "insertbefore": - return InsertNode(rootNode, node, NodeInsertType.Before); + return this.InsertNode(rootNode, node, NodeInsertType.Before); case "insertafter": - return InsertNode(rootNode, node, NodeInsertType.After); + return this.InsertNode(rootNode, node, NodeInsertType.After); case "remove": - return RemoveNode(rootNode); + return this.RemoveNode(rootNode); case "removeattribute": - return RemoveAttribute(rootNode, node); + return this.RemoveAttribute(rootNode, node); case "update": - return UpdateNode(rootNode, node); + return this.UpdateNode(rootNode, node); case "updateattribute": - return UpdateAttribute(rootNode, node); + return this.UpdateAttribute(rootNode, node); default: return false; } @@ -265,13 +265,13 @@ private bool ProcessNode(XmlNode node, XmlNode targetRoot) private XmlNode FindNode(XmlNode root, string rootNodePath, XmlNamespaceManager nsmgr) { - rootNodePath = AdjustRootNodePathRelativeToLocationElements(root, rootNodePath); + rootNodePath = this.AdjustRootNodePathRelativeToLocationElements(root, rootNodePath); return root.SelectSingleNode(rootNodePath, nsmgr); } private XmlNode FindNode(XmlNode root, string rootNodePath) { - rootNodePath = AdjustRootNodePathRelativeToLocationElements(root, rootNodePath); + rootNodePath = this.AdjustRootNodePathRelativeToLocationElements(root, rootNodePath); return root.SelectSingleNode(rootNodePath); } @@ -298,26 +298,26 @@ private bool ProcessNodes(XmlNodeList nodes, bool saveConfig) var changedNodes = false; //The nodes definition is not correct so skip changes - if (TargetConfig != null) + if (this.TargetConfig != null) { //in web.config it is possible to add nodes that contain nodes that would //otherwise be in the root node, therefore some files can have multiple roots //making it tricky to decide where to apply the xml merge operations - var targetRoots = GetTargetRoots().ToList(); + var targetRoots = this.GetTargetRoots().ToList(); if(targetRoots.Count == 1) { var root = targetRoots[0]; foreach (XmlNode node in nodes) { - changedNodes = ProcessNode(node, root) || changedNodes; + changedNodes = this.ProcessNode(node, root) || changedNodes; } } else { foreach (XmlNode node in nodes) { - var hits = FindMatchingNodes(node, targetRoots, "path").ToList(); + var hits = this.FindMatchingNodes(node, targetRoots, "path").ToList(); if(hits.Count == 0) { @@ -326,24 +326,24 @@ private bool ProcessNodes(XmlNodeList nodes, bool saveConfig) if(hits.Count == 1) { - changedNodes = ProcessNode(node, hits[0]) || changedNodes; + changedNodes = this.ProcessNode(node, hits[0]) || changedNodes; } else if(hits.Count < targetRoots.Count) { - changedNodes = ProcessNode(node, hits[0]) || changedNodes; + changedNodes = this.ProcessNode(node, hits[0]) || changedNodes; } else { //hit on all roots - XmlNode hit = FindMatchingNodes(node, hits, "targetpath").FirstOrDefault(); + XmlNode hit = this.FindMatchingNodes(node, hits, "targetpath").FirstOrDefault(); if (hit != null) { - changedNodes = ProcessNode(node, hit) || changedNodes; + changedNodes = this.ProcessNode(node, hit) || changedNodes; } else { //all paths match at root level but no targetpaths match below that so default to the initial root - changedNodes = ProcessNode(node, hits[0]) || changedNodes; + changedNodes = this.ProcessNode(node, hits[0]) || changedNodes; } } } @@ -351,7 +351,7 @@ private bool ProcessNodes(XmlNodeList nodes, bool saveConfig) if (saveConfig && changedNodes) { - Config.Save(TargetConfig, TargetFileName); + Config.Save(this.TargetConfig, this.TargetFileName); } } @@ -362,7 +362,7 @@ private IEnumerable FindMatchingNodes(XmlNode mergeNode, IEnumerable GetTargetRoots() { - yield return TargetConfig.DocumentElement; + yield return this.TargetConfig.DocumentElement; - var locations = TargetConfig.SelectNodes("/configuration/location"); + var locations = this.TargetConfig.SelectNodes("/configuration/location"); if (locations != null) { foreach (XmlNode node in locations) @@ -468,7 +468,7 @@ private bool UpdateAttribute(XmlNode rootNode, XmlNode actionNode) DnnInstallLogger.InstallLogInfo(Localization.Localization.GetString("LogStart", Localization.Localization.GlobalResourceFile) + "UpdateAttribute:attributeName=" + attributeName.ToString()); if (rootNode.Attributes[attributeName] == null) { - rootNode.Attributes.Append(TargetConfig.CreateAttribute(attributeName)); + rootNode.Attributes.Append(this.TargetConfig.CreateAttribute(attributeName)); changedNode = true; } @@ -512,12 +512,12 @@ private bool UpdateNode(XmlNode rootNode, XmlNode actionNode) } else { - targetNode = FindMatchingNode(rootNode, actionNode, "targetpath"); + targetNode = this.FindMatchingNode(rootNode, actionNode, "targetpath"); } if (targetNode == null) { //Since there is no collision we can just add the node - rootNode.AppendChild(TargetConfig.ImportNode(child, true)); + rootNode.AppendChild(this.TargetConfig.ImportNode(child, true)); changedNode = true; continue; } @@ -528,20 +528,20 @@ private bool UpdateNode(XmlNode rootNode, XmlNode actionNode) { case "overwrite": var oldContent = rootNode.InnerXml; - rootNode.ReplaceChild(TargetConfig.ImportNode(child, true), targetNode); + rootNode.ReplaceChild(this.TargetConfig.ImportNode(child, true), targetNode); var newContent = rootNode.InnerXml; changedNode = !string.Equals(oldContent, newContent, StringComparison.Ordinal); break; case "save": string commentHeaderText = string.Format(Localization.Localization.GetString("XMLMERGE_Upgrade", Localization.Localization.SharedResourceFile), Environment.NewLine, - Sender, - Version, + this.Sender, + this.Version, DateTime.Now); - XmlComment commentHeader = TargetConfig.CreateComment(commentHeaderText); + XmlComment commentHeader = this.TargetConfig.CreateComment(commentHeaderText); - var targetNodeContent = GetNodeContentWithoutComment(targetNode); - XmlComment commentNode = TargetConfig.CreateComment(targetNodeContent); + var targetNodeContent = this.GetNodeContentWithoutComment(targetNode); + XmlComment commentNode = this.TargetConfig.CreateComment(targetNodeContent); var newChild = this.TargetConfig.ImportNode(child, true); rootNode.ReplaceChild(newChild, targetNode); rootNode.InsertBefore(commentHeader, newChild); @@ -560,7 +560,7 @@ private bool UpdateNode(XmlNode rootNode, XmlNode actionNode) private string GetNodeContentWithoutComment(XmlNode node) { var cloneNode = node.Clone(); - RemoveCommentNodes(cloneNode); + this.RemoveCommentNodes(cloneNode); return cloneNode.OuterXml; } @@ -576,7 +576,7 @@ private void RemoveCommentNodes(XmlNode node) } else if (childNode.HasChildNodes) { - RemoveCommentNodes(childNode); + this.RemoveCommentNodes(childNode); } } @@ -601,13 +601,13 @@ private void RemoveCommentNodes(XmlNode node) public void UpdateConfig(XmlDocument target) { var changedAnyNodes = false; - TargetConfig = target; - if (TargetConfig != null) + this.TargetConfig = target; + if (this.TargetConfig != null) { - changedAnyNodes = ProcessNodes(SourceConfig.SelectNodes("/configuration/nodes/node"), false); + changedAnyNodes = this.ProcessNodes(this.SourceConfig.SelectNodes("/configuration/nodes/node"), false); } - ConfigUpdateChangedNodes = changedAnyNodes; + this.ConfigUpdateChangedNodes = changedAnyNodes; } /// ----------------------------------------------------------------------------- @@ -621,14 +621,14 @@ public void UpdateConfig(XmlDocument target) public void UpdateConfig(XmlDocument target, string fileName) { var changedAnyNodes = false; - TargetFileName = fileName; - TargetConfig = target; - if (TargetConfig != null) + this.TargetFileName = fileName; + this.TargetConfig = target; + if (this.TargetConfig != null) { - changedAnyNodes = ProcessNodes(SourceConfig.SelectNodes("/configuration/nodes/node"), true); + changedAnyNodes = this.ProcessNodes(this.SourceConfig.SelectNodes("/configuration/nodes/node"), true); } - ConfigUpdateChangedNodes = changedAnyNodes; + this.ConfigUpdateChangedNodes = changedAnyNodes; } /// ----------------------------------------------------------------------------- @@ -640,13 +640,13 @@ public void UpdateConfig(XmlDocument target, string fileName) public void UpdateConfigs() { - UpdateConfigs(true); + this.UpdateConfigs(true); } public void UpdateConfigs(bool autoSave) { var changedAnyNodes = false; - var nodes = SourceConfig.SelectNodes("/configuration/nodes"); + var nodes = this.SourceConfig.SelectNodes("/configuration/nodes"); if (nodes != null) { foreach (XmlNode configNode in nodes) @@ -654,7 +654,7 @@ public void UpdateConfigs(bool autoSave) Debug.Assert(configNode.Attributes != null, "configNode.Attributes != null"); //Attempt to load TargetFile property from configFile Atribute - TargetFileName = configNode.Attributes["configfile"].Value; + this.TargetFileName = configNode.Attributes["configfile"].Value; string targetProductName = ""; if (configNode.Attributes["productName"] != null) { @@ -662,13 +662,13 @@ public void UpdateConfigs(bool autoSave) } bool isAppliedToProduct; - if (!File.Exists(Globals.ApplicationMapPath + "\\" + TargetFileName)) + if (!File.Exists(Globals.ApplicationMapPath + "\\" + this.TargetFileName)) { - DnnInstallLogger.InstallLogInfo($"Target File {TargetFileName} doesn't exist, ignore the merge process"); + DnnInstallLogger.InstallLogInfo($"Target File {this.TargetFileName} doesn't exist, ignore the merge process"); return; } - TargetConfig = Config.Load(TargetFileName); + this.TargetConfig = Config.Load(this.TargetFileName); if (String.IsNullOrEmpty(targetProductName) || targetProductName == "All") { isAppliedToProduct = true; @@ -678,26 +678,26 @@ public void UpdateConfigs(bool autoSave) isAppliedToProduct = DotNetNukeContext.Current.Application.ApplyToProduct(targetProductName); } //The nodes definition is not correct so skip changes - if (TargetConfig != null && isAppliedToProduct) + if (this.TargetConfig != null && isAppliedToProduct) { - var changedNodes = ProcessNodes(configNode.SelectNodes("node"), autoSave); + var changedNodes = this.ProcessNodes(configNode.SelectNodes("node"), autoSave); changedAnyNodes = changedAnyNodes || changedNodes; if (!autoSave && changedNodes) { - PendingDocuments.Add(TargetFileName, TargetConfig); + this.PendingDocuments.Add(this.TargetFileName, this.TargetConfig); } } } } - ConfigUpdateChangedNodes = changedAnyNodes; + this.ConfigUpdateChangedNodes = changedAnyNodes; } public void SavePendingConfigs() { - foreach (var key in PendingDocuments.Keys) + foreach (var key in this.PendingDocuments.Keys) { - Config.Save(PendingDocuments[key], key); + Config.Save(this.PendingDocuments[key], key); } } diff --git a/DNN Platform/Library/Services/Journal/CommentInfo.cs b/DNN Platform/Library/Services/Journal/CommentInfo.cs index 5d2773df890..8f180ecdb75 100644 --- a/DNN Platform/Library/Services/Journal/CommentInfo.cs +++ b/DNN Platform/Library/Services/Journal/CommentInfo.cs @@ -26,25 +26,25 @@ public class CommentInfo : IHydratable, IPropertyAccess { public int KeyID { get { - return CommentId; + return this.CommentId; } set { - CommentId = value; + this.CommentId = value; } } public void Fill(System.Data.IDataReader dr) { - CommentId = Null.SetNullInteger(dr["CommentId"]); - JournalId = Null.SetNullInteger(dr["JournalId"]); - Comment = Null.SetNullString(dr["Comment"]); - DateCreated = Null.SetNullDateTime(dr["DateCreated"]); - DateUpdated = Null.SetNullDateTime(dr["DateUpdated"]); + this.CommentId = Null.SetNullInteger(dr["CommentId"]); + this.JournalId = Null.SetNullInteger(dr["JournalId"]); + this.Comment = Null.SetNullString(dr["Comment"]); + this.DateCreated = Null.SetNullDateTime(dr["DateCreated"]); + this.DateUpdated = Null.SetNullDateTime(dr["DateUpdated"]); if (!String.IsNullOrEmpty(Null.SetNullString(dr["CommentXML"]))) { - CommentXML = new XmlDocument { XmlResolver = null }; - CommentXML.LoadXml(dr["CommentXML"].ToString()); + this.CommentXML = new XmlDocument { XmlResolver = null }; + this.CommentXML.LoadXml(dr["CommentXML"].ToString()); } - UserId = Null.SetNullInteger(dr["UserId"]); - DisplayName = Null.SetNullString(dr["DisplayName"]); + this.UserId = Null.SetNullInteger(dr["UserId"]); + this.DisplayName = Null.SetNullString(dr["DisplayName"]); } diff --git a/DNN Platform/Library/Services/Journal/Data/JournalDataServiceImpl.cs b/DNN Platform/Library/Services/Journal/Data/JournalDataServiceImpl.cs index 9d29d7e9a21..dcdba638a11 100644 --- a/DNN Platform/Library/Services/Journal/Data/JournalDataServiceImpl.cs +++ b/DNN Platform/Library/Services/Journal/Data/JournalDataServiceImpl.cs @@ -22,101 +22,101 @@ internal class JournalDataServiceImpl : IJournalDataService public IDataReader Journal_ListForSummary(int portalId, int moduleId, int currentUserId, int rowIndex, int maxRows) { - return _provider.ExecuteReader("Journal_ListForSummary", portalId, moduleId, currentUserId, rowIndex, + return this._provider.ExecuteReader("Journal_ListForSummary", portalId, moduleId, currentUserId, rowIndex, maxRows); } public IDataReader Journal_ListForProfile(int portalId, int moduleId, int currentUserId, int profileId, int rowIndex, int maxRows) { - return _provider.ExecuteReader("Journal_ListForProfile", portalId, moduleId, currentUserId, profileId, + return this._provider.ExecuteReader("Journal_ListForProfile", portalId, moduleId, currentUserId, profileId, rowIndex, maxRows); } public IDataReader Journal_ListForGroup(int portalId, int moduleId, int currentUserId, int groupId, int rowIndex, int maxRows) { - return _provider.ExecuteReader("Journal_ListForGroup", portalId, moduleId, currentUserId, groupId, rowIndex, + return this._provider.ExecuteReader("Journal_ListForGroup", portalId, moduleId, currentUserId, groupId, rowIndex, maxRows); } public void Journal_Delete(int journalId) { - _provider.ExecuteNonQuery("Journal_Delete", journalId); + this._provider.ExecuteNonQuery("Journal_Delete", journalId); } public void Journal_DeleteByKey(int portalId, string objectKey) { - _provider.ExecuteNonQuery("Journal_DeleteByKey", portalId, objectKey); + this._provider.ExecuteNonQuery("Journal_DeleteByKey", portalId, objectKey); } public void Journal_DeleteByGroupId(int portalId, int groupId) { - _provider.ExecuteNonQuery("Journal_DeleteByGroupId", portalId, groupId); + this._provider.ExecuteNonQuery("Journal_DeleteByGroupId", portalId, groupId); } public void Journal_SoftDelete(int journalId) { - _provider.ExecuteNonQuery("Journal_Delete", journalId, true); + this._provider.ExecuteNonQuery("Journal_Delete", journalId, true); } public void Journal_SoftDeleteByKey(int portalId, string objectKey) { - _provider.ExecuteNonQuery("Journal_DeleteByKey", portalId, objectKey, true); + this._provider.ExecuteNonQuery("Journal_DeleteByKey", portalId, objectKey, true); } public void Journal_SoftDeleteByGroupId(int portalId, int groupId) { - _provider.ExecuteNonQuery("Journal_DeleteByGroupId", portalId, groupId, true); + this._provider.ExecuteNonQuery("Journal_DeleteByGroupId", portalId, groupId, true); } public void Journal_Like(int journalId, int userId, string displayName) { - _provider.ExecuteNonQuery("Journal_Like", journalId, userId, displayName); + this._provider.ExecuteNonQuery("Journal_Like", journalId, userId, displayName); } public IDataReader Journal_LikeList(int portalId, int journalId) { - return _provider.ExecuteReader("Journal_LikeList", portalId, journalId); + return this._provider.ExecuteReader("Journal_LikeList", portalId, journalId); } public void Journal_UpdateContentItemId(int journalId, int contentItemId) { - _provider.ExecuteNonQuery("Journal_UpdateContentItemId", journalId, contentItemId); + this._provider.ExecuteNonQuery("Journal_UpdateContentItemId", journalId, contentItemId); } public IDataReader Journal_Get(int portalId, int currentUserId, int journalId) { - return Journal_Get(portalId, currentUserId, journalId, false, false, false); + return this.Journal_Get(portalId, currentUserId, journalId, false, false, false); } public IDataReader Journal_Get(int portalId, int currentUserId, int journalId, bool includeAllItems, bool isDeleted, bool securityCheck) { - return _provider.ExecuteReader("Journal_Get", portalId, currentUserId, journalId, includeAllItems, isDeleted, securityCheck); + return this._provider.ExecuteReader("Journal_Get", portalId, currentUserId, journalId, includeAllItems, isDeleted, securityCheck); } public IDataReader Journal_GetByKey(int portalId, string objectKey) { - return Journal_GetByKey(portalId, objectKey, false, false); + return this.Journal_GetByKey(portalId, objectKey, false, false); } public IDataReader Journal_GetByKey(int portalId, string objectKey, bool includeAllItems, bool isDeleted) { - return _provider.ExecuteReader("Journal_GetByKey", portalId, objectKey, includeAllItems, isDeleted); + return this._provider.ExecuteReader("Journal_GetByKey", portalId, objectKey, includeAllItems, isDeleted); } public int Journal_Save(int portalId, int currentUserId, int profileId, int groupId, int journalId, int journalTypeId, string title, string summary, string body, string itemData, string xml, string objectKey, Guid accessKey, string securitySet) { - journalId = _provider.ExecuteScalar("Journal_Save", portalId, journalId, journalTypeId, currentUserId, profileId, + journalId = this._provider.ExecuteScalar("Journal_Save", portalId, journalId, journalTypeId, currentUserId, profileId, groupId, title, summary, itemData, xml, objectKey, accessKey, securitySet, false, false); return journalId; } public int Journal_Save(int portalId, int currentUserId, int profileId, int groupId, int journalId, int journalTypeId, string title, string summary, string body, string itemData, string xml, string objectKey, Guid accessKey, string securitySet, bool commentsDisabled, bool commentsHidden) { - journalId = _provider.ExecuteScalar("Journal_Save", portalId, journalId, journalTypeId, currentUserId, profileId, + journalId = this._provider.ExecuteScalar("Journal_Save", portalId, journalId, journalTypeId, currentUserId, profileId, groupId, title, summary, itemData, xml, objectKey, accessKey, securitySet, commentsDisabled, commentsHidden); return journalId; } public int Journal_Update(int portalId, int currentUserId, int profileId, int groupId, int journalId, int journalTypeId, string title, string summary, string body, string itemData, string xml, string objectKey, Guid accessKey, string securitySet) { - journalId = _provider.ExecuteScalar("Journal_Update", portalId, journalId, journalTypeId, currentUserId, profileId, + journalId = this._provider.ExecuteScalar("Journal_Update", portalId, journalId, journalTypeId, currentUserId, profileId, groupId, title, summary, itemData, xml, objectKey, accessKey, securitySet, false, false); return journalId; @@ -124,75 +124,75 @@ public int Journal_Update(int portalId, int currentUserId, int profileId, int gr public int Journal_Update(int portalId, int currentUserId, int profileId, int groupId, int journalId, int journalTypeId, string title, string summary, string body, string itemData, string xml, string objectKey, Guid accessKey, string securitySet, bool commentsDisabled, bool commentsHidden) { - journalId = _provider.ExecuteScalar("Journal_Update", portalId, journalId, journalTypeId, currentUserId, profileId, + journalId = this._provider.ExecuteScalar("Journal_Update", portalId, journalId, journalTypeId, currentUserId, profileId, groupId, title, summary, itemData, xml, objectKey, accessKey, securitySet, commentsDisabled, commentsHidden); return journalId; } public void Journal_Comment_Delete(int journalId, int commentId) { - _provider.ExecuteNonQuery("Journal_Comment_Delete", journalId, commentId); + this._provider.ExecuteNonQuery("Journal_Comment_Delete", journalId, commentId); } public int Journal_Comment_Save(int journalId, int commentId, int userId, string comment, string xml, DateTime dateUpdated) { - commentId = _provider.ExecuteScalar("Journal_Comment_Save", journalId, commentId, userId, comment, xml, DataProvider.Instance().GetNull(dateUpdated)); + commentId = this._provider.ExecuteScalar("Journal_Comment_Save", journalId, commentId, userId, comment, xml, DataProvider.Instance().GetNull(dateUpdated)); return commentId; } public IDataReader Journal_Comment_List(int journalId) { - return _provider.ExecuteReader("Journal_Comment_List", journalId); + return this._provider.ExecuteReader("Journal_Comment_List", journalId); } public IDataReader Journal_Comment_Get(int commentId) { - return _provider.ExecuteReader("Journal_Comment_Get", commentId); + return this._provider.ExecuteReader("Journal_Comment_Get", commentId); } public IDataReader Journal_Comment_ListByJournalIds(string journalIds) { - return _provider.ExecuteReader("Journal_Comment_ListByJournalIds", journalIds); + return this._provider.ExecuteReader("Journal_Comment_ListByJournalIds", journalIds); } public void Journal_Comment_Like(int journalId, int commentId, int userId, string displayName) { - _provider.ExecuteNonQuery("Journal_Comment_Like", journalId, commentId, userId, displayName); + this._provider.ExecuteNonQuery("Journal_Comment_Like", journalId, commentId, userId, displayName); } public IDataReader Journal_Comment_LikeList(int portalId, int journalId, int commentId) { - return _provider.ExecuteReader("Journal_Comment_LikeList", portalId, journalId, commentId); + return this._provider.ExecuteReader("Journal_Comment_LikeList", portalId, journalId, commentId); } public void Journal_Comments_ToggleDisable(int portalId, int journalId, bool disable) { - _provider.ExecuteNonQuery("Journal_Comments_ToggleDisable", portalId, journalId, disable); + this._provider.ExecuteNonQuery("Journal_Comments_ToggleDisable", portalId, journalId, disable); } public void Journal_Comments_ToggleHidden(int portalId, int journalId, bool hidden) { - _provider.ExecuteNonQuery("Journal_Comments_ToggleHidden", portalId, journalId, hidden); + this._provider.ExecuteNonQuery("Journal_Comments_ToggleHidden", portalId, journalId, hidden); } public IDataReader Journal_Types_List(int portalId) { - return _provider.ExecuteReader("Journal_Types_List", portalId); + return this._provider.ExecuteReader("Journal_Types_List", portalId); } public IDataReader Journal_Types_GetById(int journalTypeId) { - return _provider.ExecuteReader("Journal_Types_GetById", journalTypeId); + return this._provider.ExecuteReader("Journal_Types_GetById", journalTypeId); } public IDataReader Journal_Types_Get(string journalType) { - return _provider.ExecuteReader("Journal_Types_Get", journalType); + return this._provider.ExecuteReader("Journal_Types_Get", journalType); } public void Journal_Types_Delete(int journalTypeId, int portalId) { - _provider.ExecuteNonQuery("Journal_Types_Delete", journalTypeId, portalId); + this._provider.ExecuteNonQuery("Journal_Types_Delete", journalTypeId, portalId); } public int Journal_Types_Save(int journalTypeId, string journalType, string icon, int portalId, bool isEnabled, bool appliesToProfile, bool appliesToGroup, bool appliesToStream, string options, bool supportsNotify) { - journalTypeId = _provider.ExecuteScalar("Journal_Types_Save", journalTypeId, journalType, icon, + journalTypeId = this._provider.ExecuteScalar("Journal_Types_Save", journalTypeId, journalType, icon, portalId, isEnabled, appliesToProfile, appliesToGroup, appliesToStream, options, supportsNotify); return journalTypeId; @@ -200,22 +200,22 @@ public int Journal_Types_Save(int journalTypeId, string journalType, string icon public IDataReader Journal_GetStatsForGroup(int portalId, int groupId) { - return _provider.ExecuteReader("Journal_GetStatsForGroup", portalId, groupId); + return this._provider.ExecuteReader("Journal_GetStatsForGroup", portalId, groupId); } public IDataReader Journal_TypeFilters_List(int portalId, int moduleId) { - return _provider.ExecuteReader("Journal_TypeFilters_List", portalId, moduleId); + return this._provider.ExecuteReader("Journal_TypeFilters_List", portalId, moduleId); } public void Journal_TypeFilters_Delete(int portalId, int moduleId) { - _provider.ExecuteNonQuery("Journal_TypeFilters_Delete", portalId, moduleId); + this._provider.ExecuteNonQuery("Journal_TypeFilters_Delete", portalId, moduleId); } public void Journal_TypeFilters_Save(int portalId, int moduleId, int journalTypeId) { - _provider.ExecuteNonQuery("Journal_TypeFilters_Save", portalId, moduleId, journalTypeId); + this._provider.ExecuteNonQuery("Journal_TypeFilters_Save", portalId, moduleId, journalTypeId); } #endregion diff --git a/DNN Platform/Library/Services/Journal/Internal/InternalJournalControllerImpl.cs b/DNN Platform/Library/Services/Journal/Internal/InternalJournalControllerImpl.cs index 06c2e961ad3..c64b1742ff0 100644 --- a/DNN Platform/Library/Services/Journal/Internal/InternalJournalControllerImpl.cs +++ b/DNN Platform/Library/Services/Journal/Internal/InternalJournalControllerImpl.cs @@ -23,7 +23,7 @@ public class InternalJournalControllerImpl : IInternalJournalController public InternalJournalControllerImpl() { - _dataService = JournalDataService.Instance; + this._dataService = JournalDataService.Instance; } #endregion @@ -32,7 +32,7 @@ public IList GetJournalItemsByProfile(int portalId, int moduleId, i int rowIndex, int maxRows) { return - CBO.FillCollection(_dataService.Journal_ListForProfile(portalId, moduleId, currentUserId, + CBO.FillCollection(this._dataService.Journal_ListForProfile(portalId, moduleId, currentUserId, profileId, rowIndex, maxRows)); } @@ -40,7 +40,7 @@ public IList GetJournalItemsByGroup(int portalId, int moduleId, int int rowIndex, int maxRows) { return - CBO.FillCollection(_dataService.Journal_ListForGroup(portalId, moduleId, currentUserId, + CBO.FillCollection(this._dataService.Journal_ListForGroup(portalId, moduleId, currentUserId, groupId, rowIndex, maxRows)); } @@ -48,18 +48,18 @@ public IList GetJournalItems(int portalId, int moduleId, int curren int maxRows) { return - CBO.FillCollection(_dataService.Journal_ListForSummary(portalId, moduleId, currentUserId, + CBO.FillCollection(this._dataService.Journal_ListForSummary(portalId, moduleId, currentUserId, rowIndex, maxRows)); } public void DeleteFilters(int portalId, int moduleId) { - _dataService.Journal_TypeFilters_Delete(portalId, moduleId); + this._dataService.Journal_TypeFilters_Delete(portalId, moduleId); } public void SaveFilters(int portalId, int moduleId, int journalTypeId) { - _dataService.Journal_TypeFilters_Save(portalId, moduleId, journalTypeId); + this._dataService.Journal_TypeFilters_Save(portalId, moduleId, journalTypeId); } } } diff --git a/DNN Platform/Library/Services/Journal/ItemData.cs b/DNN Platform/Library/Services/Journal/ItemData.cs index ecbc10e15d0..d2013dae0aa 100644 --- a/DNN Platform/Library/Services/Journal/ItemData.cs +++ b/DNN Platform/Library/Services/Journal/ItemData.cs @@ -32,13 +32,13 @@ public string GetProperty(string propertyName, string format, System.Globalizati propertyName = propertyName.ToLowerInvariant(); switch (propertyName) { case "url": - return PropertyAccess.FormatString(Url, format); + return PropertyAccess.FormatString(this.Url, format); case "title": - return PropertyAccess.FormatString(Title, format); + return PropertyAccess.FormatString(this.Title, format); case "description": - return PropertyAccess.FormatString(Description, format); + return PropertyAccess.FormatString(this.Description, format); case "imageurl": - return PropertyAccess.FormatString(ImageUrl, format); + return PropertyAccess.FormatString(this.ImageUrl, format); } diff --git a/DNN Platform/Library/Services/Journal/JournalControllerImpl.cs b/DNN Platform/Library/Services/Journal/JournalControllerImpl.cs index 44dd51a2098..0ed3526955f 100644 --- a/DNN Platform/Library/Services/Journal/JournalControllerImpl.cs +++ b/DNN Platform/Library/Services/Journal/JournalControllerImpl.cs @@ -36,7 +36,7 @@ internal class JournalControllerImpl : IJournalController public JournalControllerImpl() { - _dataService = JournalDataService.Instance; + this._dataService = JournalDataService.Instance; } #endregion @@ -76,7 +76,7 @@ private void UpdateGroupStats(int portalId, int groupId) } } - using (IDataReader dr = _dataService.Journal_GetStatsForGroup(portalId, groupId)) + using (IDataReader dr = this._dataService.Journal_GetStatsForGroup(portalId, groupId)) { while (dr.Read()) { @@ -97,7 +97,7 @@ private void UpdateGroupStats(int portalId, int groupId) private void DeleteJournalItem(int portalId, int currentUserId, int journalId, bool softDelete) { - var ji = GetJournalItem(portalId, currentUserId, journalId, !softDelete); + var ji = this.GetJournalItem(portalId, currentUserId, journalId, !softDelete); if (ji == null) { return; @@ -107,16 +107,16 @@ private void DeleteJournalItem(int portalId, int currentUserId, int journalId, b if (softDelete) { - _dataService.Journal_SoftDelete(journalId); + this._dataService.Journal_SoftDelete(journalId); } else { - _dataService.Journal_Delete(journalId); + this._dataService.Journal_Delete(journalId); } if (groupId > 0) { - UpdateGroupStats(portalId, groupId); + this.UpdateGroupStats(portalId, groupId); } // queue remove journal from search index @@ -140,8 +140,8 @@ private Stream GetJournalImageContent(Stream fileContent) Image image = new Bitmap(fileContent); int thumbnailWidth = 400; int thumbnailHeight = 400; - GetThumbnailSize(image.Width, image.Height, ref thumbnailWidth, ref thumbnailHeight); - var thumbnail = image.GetThumbnailImage(thumbnailWidth, thumbnailHeight, ThumbnailCallback, IntPtr.Zero); + this.GetThumbnailSize(image.Width, image.Height, ref thumbnailWidth, ref thumbnailHeight); + var thumbnail = image.GetThumbnailImage(thumbnailWidth, thumbnailHeight, this.ThumbnailCallback, IntPtr.Zero); var result = new MemoryStream(); thumbnail.Save(result, image.RawFormat); return result; @@ -152,12 +152,12 @@ private void GetThumbnailSize(int imageWidth, int imageHeight, ref int thumbnail if (imageWidth >= imageHeight) { thumbnailWidth = Math.Min(imageWidth, thumbnailWidth); - thumbnailHeight = GetMinorSize(imageHeight, imageWidth, thumbnailWidth); + thumbnailHeight = this.GetMinorSize(imageHeight, imageWidth, thumbnailWidth); } else { thumbnailHeight = Math.Min(imageHeight, thumbnailHeight); - thumbnailWidth = GetMinorSize(imageWidth, imageHeight, thumbnailHeight); + thumbnailWidth = this.GetMinorSize(imageWidth, imageHeight, thumbnailHeight); } } @@ -185,9 +185,9 @@ private bool ThumbnailCallback() private bool IsResizePhotosEnabled(ModuleInfo module) { - return GetBooleanSetting(AllowResizePhotosSetting, false, module) && - GetBooleanSetting(AllowPhotosSetting, true, module) && - GetBooleanSetting(EditorEnabledSetting, true, module); + return this.GetBooleanSetting(AllowResizePhotosSetting, false, module) && + this.GetBooleanSetting(AllowPhotosSetting, true, module) && + this.GetBooleanSetting(EditorEnabledSetting, true, module); } private bool GetBooleanSetting(string settingName, bool defaultValue, ModuleInfo module) { @@ -315,8 +315,8 @@ public void SaveJournalItem(JournalItem journalItem, int tabId, int moduleId) var xDoc = new XmlDocument { XmlResolver = null }; XmlElement xnode = xDoc.CreateElement("items"); XmlElement xnode2 = xDoc.CreateElement("item"); - xnode2.AppendChild(CreateElement(xDoc, "id", "-1")); - xnode2.AppendChild(CreateCDataElement(xDoc, "body", journalItem.Body)); + xnode2.AppendChild(this.CreateElement(xDoc, "id", "-1")); + xnode2.AppendChild(this.CreateCDataElement(xDoc, "body", journalItem.Body)); xnode.AppendChild(xnode2); xDoc.AppendChild(xnode); XmlDeclaration xDec = xDoc.CreateXmlDeclaration("1.0", null, null); @@ -352,9 +352,9 @@ public void SaveJournalItem(JournalItem journalItem, int tabId, int moduleId) journalData = null; } - PrepareSecuritySet(journalItem, currentUser); + this.PrepareSecuritySet(journalItem, currentUser); - journalItem.JournalId = _dataService.Journal_Save(journalItem.PortalId, + journalItem.JournalId = this._dataService.Journal_Save(journalItem.PortalId, journalItem.UserId, journalItem.ProfileId, journalItem.SocialGroupId, @@ -371,7 +371,7 @@ public void SaveJournalItem(JournalItem journalItem, int tabId, int moduleId) journalItem.CommentsDisabled, journalItem.CommentsHidden); - var updatedJournalItem = GetJournalItem(journalItem.PortalId, journalItem.UserId, journalItem.JournalId); + var updatedJournalItem = this.GetJournalItem(journalItem.PortalId, journalItem.UserId, journalItem.JournalId); journalItem.DateCreated = updatedJournalItem.DateCreated; journalItem.DateUpdated = updatedJournalItem.DateUpdated; var cnt = new Content(); @@ -379,19 +379,19 @@ public void SaveJournalItem(JournalItem journalItem, int tabId, int moduleId) if (journalItem.ContentItemId > 0) { cnt.UpdateContentItem(journalItem, tabId, moduleId); - _dataService.Journal_UpdateContentItemId(journalItem.JournalId, journalItem.ContentItemId); + this._dataService.Journal_UpdateContentItemId(journalItem.JournalId, journalItem.ContentItemId); } else { ContentItem ci = cnt.CreateContentItem(journalItem, tabId, moduleId); - _dataService.Journal_UpdateContentItemId(journalItem.JournalId, ci.ContentItemId); + this._dataService.Journal_UpdateContentItemId(journalItem.JournalId, ci.ContentItemId); journalItem.ContentItemId = ci.ContentItemId; } if (journalItem.SocialGroupId > 0) { try { - UpdateGroupStats(journalItem.PortalId, journalItem.SocialGroupId); + this.UpdateGroupStats(journalItem.PortalId, journalItem.SocialGroupId); } catch (Exception exc) { @@ -430,8 +430,8 @@ public void UpdateJournalItem(JournalItem journalItem, int tabId, int moduleId) var xDoc = new XmlDocument { XmlResolver = null }; XmlElement xnode = xDoc.CreateElement("items"); XmlElement xnode2 = xDoc.CreateElement("item"); - xnode2.AppendChild(CreateElement(xDoc, "id", "-1")); - xnode2.AppendChild(CreateCDataElement(xDoc, "body", journalItem.Body)); + xnode2.AppendChild(this.CreateElement(xDoc, "id", "-1")); + xnode2.AppendChild(this.CreateCDataElement(xDoc, "body", journalItem.Body)); xnode.AppendChild(xnode2); xDoc.AppendChild(xnode); XmlDeclaration xDec = xDoc.CreateXmlDeclaration("1.0", null, null); @@ -468,9 +468,9 @@ public void UpdateJournalItem(JournalItem journalItem, int tabId, int moduleId) journalData = null; } - PrepareSecuritySet(journalItem, currentUser); + this.PrepareSecuritySet(journalItem, currentUser); - journalItem.JournalId = _dataService.Journal_Update(journalItem.PortalId, + journalItem.JournalId = this._dataService.Journal_Update(journalItem.PortalId, journalItem.UserId, journalItem.ProfileId, journalItem.SocialGroupId, @@ -487,7 +487,7 @@ public void UpdateJournalItem(JournalItem journalItem, int tabId, int moduleId) journalItem.CommentsDisabled, journalItem.CommentsHidden); - var updatedJournalItem = GetJournalItem(journalItem.PortalId, journalItem.UserId, journalItem.JournalId); + var updatedJournalItem = this.GetJournalItem(journalItem.PortalId, journalItem.UserId, journalItem.JournalId); journalItem.DateCreated = updatedJournalItem.DateCreated; journalItem.DateUpdated = updatedJournalItem.DateUpdated; @@ -495,19 +495,19 @@ public void UpdateJournalItem(JournalItem journalItem, int tabId, int moduleId) if (journalItem.ContentItemId > 0) { cnt.UpdateContentItem(journalItem, tabId, moduleId); - _dataService.Journal_UpdateContentItemId(journalItem.JournalId, journalItem.ContentItemId); + this._dataService.Journal_UpdateContentItemId(journalItem.JournalId, journalItem.ContentItemId); } else { ContentItem ci = cnt.CreateContentItem(journalItem, tabId, moduleId); - _dataService.Journal_UpdateContentItemId(journalItem.JournalId, ci.ContentItemId); + this._dataService.Journal_UpdateContentItemId(journalItem.JournalId, ci.ContentItemId); journalItem.ContentItemId = ci.ContentItemId; } if (journalItem.SocialGroupId > 0) { try { - UpdateGroupStats(journalItem.PortalId, journalItem.SocialGroupId); + this.UpdateGroupStats(journalItem.PortalId, journalItem.SocialGroupId); } catch (Exception exc) { @@ -518,32 +518,32 @@ public void UpdateJournalItem(JournalItem journalItem, int tabId, int moduleId) public JournalItem GetJournalItem(int portalId, int currentUserId, int journalId) { - return GetJournalItem(portalId, currentUserId, journalId, false, false); + return this.GetJournalItem(portalId, currentUserId, journalId, false, false); } public JournalItem GetJournalItem(int portalId, int currentUserId, int journalId, bool includeAllItems) { - return GetJournalItem(portalId, currentUserId, journalId, includeAllItems, false); + return this.GetJournalItem(portalId, currentUserId, journalId, includeAllItems, false); } public JournalItem GetJournalItem(int portalId, int currentUserId, int journalId, bool includeAllItems, bool isDeleted) { - return GetJournalItem(portalId, currentUserId, journalId, includeAllItems, isDeleted, false); + return this.GetJournalItem(portalId, currentUserId, journalId, includeAllItems, isDeleted, false); } public JournalItem GetJournalItem(int portalId, int currentUserId, int journalId, bool includeAllItems, bool isDeleted, bool securityCheck) { - return CBO.FillObject(_dataService.Journal_Get(portalId, currentUserId, journalId, includeAllItems, isDeleted, securityCheck)); + return CBO.FillObject(this._dataService.Journal_Get(portalId, currentUserId, journalId, includeAllItems, isDeleted, securityCheck)); } public JournalItem GetJournalItemByKey(int portalId, string objectKey) { - return GetJournalItemByKey(portalId, objectKey, false, false); + return this.GetJournalItemByKey(portalId, objectKey, false, false); } public JournalItem GetJournalItemByKey(int portalId, string objectKey, bool includeAllItems) { - return GetJournalItemByKey(portalId, objectKey, includeAllItems, false); + return this.GetJournalItemByKey(portalId, objectKey, includeAllItems, false); } public JournalItem GetJournalItemByKey(int portalId, string objectKey, bool includeAllItems, bool isDeleted) @@ -552,16 +552,16 @@ public JournalItem GetJournalItemByKey(int portalId, string objectKey, bool incl { return null; } - return CBO.FillObject(_dataService.Journal_GetByKey(portalId, objectKey, includeAllItems, isDeleted)); + return CBO.FillObject(this._dataService.Journal_GetByKey(portalId, objectKey, includeAllItems, isDeleted)); } public IFileInfo SaveJourmalFile(ModuleInfo module, UserInfo userInfo, string fileName, Stream fileContent) { var userFolder = FolderManager.Instance.GetUserFolder(userInfo); - if (IsImageFile(fileName) && IsResizePhotosEnabled(module)) + if (this.IsImageFile(fileName) && this.IsResizePhotosEnabled(module)) { - using (var stream = GetJournalImageContent(fileContent)) + using (var stream = this.GetJournalImageContent(fileContent)) { return FileManager.Instance.AddFile(userFolder, fileName, stream, true); } @@ -575,7 +575,7 @@ public void SaveJournalItem(JournalItem journalItem, ModuleInfo module) var tabId = module == null ? Null.NullInteger : module.TabID; var tabModuleId = module == null ? Null.NullInteger : module.TabModuleID; - SaveJournalItem(journalItem, tabId, tabModuleId); + this.SaveJournalItem(journalItem, tabId, tabModuleId); } public void UpdateJournalItem(JournalItem journalItem, ModuleInfo module) @@ -583,27 +583,27 @@ public void UpdateJournalItem(JournalItem journalItem, ModuleInfo module) var tabId = module == null ? Null.NullInteger : module.TabID; var tabModuleId = module == null ? Null.NullInteger : module.TabModuleID; - UpdateJournalItem(journalItem, tabId, tabModuleId); + this.UpdateJournalItem(journalItem, tabId, tabModuleId); } public void DisableComments(int portalId, int journalId) { - _dataService.Journal_Comments_ToggleDisable(portalId, journalId, true); + this._dataService.Journal_Comments_ToggleDisable(portalId, journalId, true); } public void EnableComments(int portalId, int journalId) { - _dataService.Journal_Comments_ToggleDisable(portalId, journalId, false); + this._dataService.Journal_Comments_ToggleDisable(portalId, journalId, false); } public void HideComments(int portalId, int journalId) { - _dataService.Journal_Comments_ToggleHidden(portalId, journalId, true); + this._dataService.Journal_Comments_ToggleHidden(portalId, journalId, true); } public void ShowComments(int portalId, int journalId) { - _dataService.Journal_Comments_ToggleHidden(portalId, journalId, false); + this._dataService.Journal_Comments_ToggleHidden(portalId, journalId, false); } // Delete Journal Items @@ -615,7 +615,7 @@ public void ShowComments(int portalId, int journalId) /// public void DeleteJournalItem(int portalId, int currentUserId, int journalId) { - DeleteJournalItem(portalId, currentUserId, journalId, false); + this.DeleteJournalItem(portalId, currentUserId, journalId, false); } /// @@ -625,7 +625,7 @@ public void DeleteJournalItem(int portalId, int currentUserId, int journalId) /// public void DeleteJournalItemByKey(int portalId, string objectKey) { - _dataService.Journal_DeleteByKey(portalId, objectKey); + this._dataService.Journal_DeleteByKey(portalId, objectKey); } /// @@ -635,7 +635,7 @@ public void DeleteJournalItemByKey(int portalId, string objectKey) /// public void DeleteJournalItemByGroupId(int portalId, int groupId) { - _dataService.Journal_DeleteByGroupId(portalId, groupId); + this._dataService.Journal_DeleteByGroupId(portalId, groupId); } /// @@ -646,7 +646,7 @@ public void DeleteJournalItemByGroupId(int portalId, int groupId) /// public void SoftDeleteJournalItem(int portalId, int currentUserId, int journalId) { - DeleteJournalItem(portalId, currentUserId, journalId, true); + this.DeleteJournalItem(portalId, currentUserId, journalId, true); } /// @@ -656,7 +656,7 @@ public void SoftDeleteJournalItem(int portalId, int currentUserId, int journalId /// public void SoftDeleteJournalItemByKey(int portalId, string objectKey) { - _dataService.Journal_SoftDeleteByKey(portalId, objectKey); + this._dataService.Journal_SoftDeleteByKey(portalId, objectKey); } /// @@ -666,19 +666,19 @@ public void SoftDeleteJournalItemByKey(int portalId, string objectKey) /// public void SoftDeleteJournalItemByGroupId(int portalId, int groupId) { - _dataService.Journal_SoftDeleteByGroupId(portalId, groupId); + this._dataService.Journal_SoftDeleteByGroupId(portalId, groupId); } // Journal Comments public IList GetCommentsByJournalIds(List journalIdList) { var journalIds = journalIdList.Aggregate("", (current, journalId) => current + journalId + ";"); - return CBO.FillCollection(_dataService.Journal_Comment_ListByJournalIds(journalIds)); + return CBO.FillCollection(this._dataService.Journal_Comment_ListByJournalIds(journalIds)); } public void LikeJournalItem(int journalId, int userId, string displayName) { - _dataService.Journal_Like(journalId, userId, displayName); + this._dataService.Journal_Like(journalId, userId, displayName); } public void SaveComment(CommentInfo comment) @@ -698,27 +698,27 @@ public void SaveComment(CommentInfo comment) xml = comment.CommentXML.OuterXml; } - comment.CommentId = _dataService.Journal_Comment_Save(comment.JournalId, comment.CommentId, comment.UserId, comment.Comment, xml, Null.NullDate); + comment.CommentId = this._dataService.Journal_Comment_Save(comment.JournalId, comment.CommentId, comment.UserId, comment.Comment, xml, Null.NullDate); - var newComment = GetComment(comment.CommentId); + var newComment = this.GetComment(comment.CommentId); comment.DateCreated = newComment.DateCreated; comment.DateUpdated = newComment.DateUpdated; } public CommentInfo GetComment(int commentId) { - return CBO.FillObject(_dataService.Journal_Comment_Get(commentId)); + return CBO.FillObject(this._dataService.Journal_Comment_Get(commentId)); } public void DeleteComment(int journalId, int commentId) { - _dataService.Journal_Comment_Delete(journalId, commentId); + this._dataService.Journal_Comment_Delete(journalId, commentId); //UNDONE: update the parent journal item and content item so this comment gets removed from search index } public void LikeComment(int journalId, int commentId, int userId, string displayName) { - _dataService.Journal_Comment_Like(journalId, commentId, userId, displayName); + this._dataService.Journal_Comment_Like(journalId, commentId, userId, displayName); } #endregion @@ -727,12 +727,12 @@ public void LikeComment(int journalId, int commentId, int userId, string display public JournalTypeInfo GetJournalType(string journalType) { - return CBO.FillObject(_dataService.Journal_Types_Get(journalType)); + return CBO.FillObject(this._dataService.Journal_Types_Get(journalType)); } public JournalTypeInfo GetJournalTypeById(int journalTypeId) { - return CBO.FillObject(_dataService.Journal_Types_GetById(journalTypeId)); + return CBO.FillObject(this._dataService.Journal_Types_GetById(journalTypeId)); } public IEnumerable GetJournalTypes(int portalId) @@ -742,7 +742,7 @@ public IEnumerable GetJournalTypes(int portalId) DataCache.JournalTypesTimeOut, DataCache.JournalTypesCachePriority, portalId), - c => CBO.FillCollection(_dataService.Journal_Types_List(portalId))); + c => CBO.FillCollection(this._dataService.Journal_Types_List(portalId))); } #endregion @@ -752,13 +752,13 @@ public IEnumerable GetJournalTypes(int portalId) [Obsolete("Deprecated in DNN 7.2.2. Use SaveJournalItem(JournalItem, ModuleInfo). Scheduled removal in v10.0.0.")] public void SaveJournalItem(JournalItem journalItem, int tabId) { - SaveJournalItem(journalItem, tabId, Null.NullInteger); + this.SaveJournalItem(journalItem, tabId, Null.NullInteger); } [Obsolete("Deprecated in DNN 7.2.2. Use UpdateJournalItem(JournalItem, ModuleInfo). Scheduled removal in v10.0.0.")] public void UpdateJournalItem(JournalItem journalItem, int tabId) { - UpdateJournalItem(journalItem, tabId, Null.NullInteger); + this.UpdateJournalItem(journalItem, tabId, Null.NullInteger); } #endregion diff --git a/DNN Platform/Library/Services/Journal/JournalEntity.cs b/DNN Platform/Library/Services/Journal/JournalEntity.cs index 2081451a809..fbc1f19dabf 100644 --- a/DNN Platform/Library/Services/Journal/JournalEntity.cs +++ b/DNN Platform/Library/Services/Journal/JournalEntity.cs @@ -25,10 +25,10 @@ public JournalEntity(string entityXML) { XmlNode xNode = null; xNode = xRoot.SelectSingleNode("//entity"); if ((xNode != null)) { - Id = int.Parse(xNode["id"].InnerText); - Name = xNode["name"].InnerText.ToString(); + this.Id = int.Parse(xNode["id"].InnerText); + this.Name = xNode["name"].InnerText.ToString(); if ((xNode["vanity"] != null)) { - Vanity= xNode["vanity"].InnerText.ToString(); + this.Vanity= xNode["vanity"].InnerText.ToString(); } } @@ -50,13 +50,13 @@ public string GetProperty(string propertyName, string format, System.Globalizati propertyName = propertyName.ToLowerInvariant(); switch (propertyName) { case "id": - return PropertyAccess.FormatString(Id.ToString(), format); + return PropertyAccess.FormatString(this.Id.ToString(), format); case "name": - return PropertyAccess.FormatString(Name.ToString(), format); + return PropertyAccess.FormatString(this.Name.ToString(), format); case "vanity": - return PropertyAccess.FormatString(Vanity.ToString(), format); + return PropertyAccess.FormatString(this.Vanity.ToString(), format); case "avatar": - return PropertyAccess.FormatString(Avatar.ToString(), format); + return PropertyAccess.FormatString(this.Avatar.ToString(), format); } diff --git a/DNN Platform/Library/Services/Journal/JournalItem.cs b/DNN Platform/Library/Services/Journal/JournalItem.cs index e68461940e3..0cde1acd885 100644 --- a/DNN Platform/Library/Services/Journal/JournalItem.cs +++ b/DNN Platform/Library/Services/Journal/JournalItem.cs @@ -61,49 +61,49 @@ public class JournalItem : IHydratable, IPropertyAccess { [XmlIgnore] public virtual int KeyID { get { - return JournalId; + return this.JournalId; } set { - JournalId = value; + this.JournalId = value; } } public void Fill(IDataReader dr) { - JournalId = Null.SetNullInteger(dr["JournalId"]); - JournalTypeId = Null.SetNullInteger(dr["JournalTypeId"]); - PortalId = Null.SetNullInteger(dr["PortalId"]); - UserId = Null.SetNullInteger(dr["UserId"]); - ProfileId = Null.SetNullInteger(dr["ProfileId"]); - SocialGroupId = Null.SetNullInteger(dr["GroupId"]); + this.JournalId = Null.SetNullInteger(dr["JournalId"]); + this.JournalTypeId = Null.SetNullInteger(dr["JournalTypeId"]); + this.PortalId = Null.SetNullInteger(dr["PortalId"]); + this.UserId = Null.SetNullInteger(dr["UserId"]); + this.ProfileId = Null.SetNullInteger(dr["ProfileId"]); + this.SocialGroupId = Null.SetNullInteger(dr["GroupId"]); if (!String.IsNullOrEmpty(Null.SetNullString(dr["JournalXML"]))) { - JournalXML = new XmlDocument { XmlResolver = null }; - JournalXML.LoadXml(dr["JournalXML"].ToString()); - XmlNode xRoot = JournalXML.DocumentElement; + this.JournalXML = new XmlDocument { XmlResolver = null }; + this.JournalXML.LoadXml(dr["JournalXML"].ToString()); + XmlNode xRoot = this.JournalXML.DocumentElement; XmlNode xNode = xRoot.SelectSingleNode("//items/item/body"); if (xNode != null) { - Body = xNode.InnerText; + this.Body = xNode.InnerText; } } - DateCreated = Null.SetNullDateTime(dr["DateCreated"]); - DateUpdated = Null.SetNullDateTime(dr["DateUpdated"]); - ObjectKey = Null.SetNullString(dr["ObjectKey"]); - AccessKey = Null.SetNullGuid(dr["AccessKey"]); - Title = Null.SetNullString(dr["Title"]); - Summary = Null.SetNullString(dr["Summary"]); + this.DateCreated = Null.SetNullDateTime(dr["DateCreated"]); + this.DateUpdated = Null.SetNullDateTime(dr["DateUpdated"]); + this.ObjectKey = Null.SetNullString(dr["ObjectKey"]); + this.AccessKey = Null.SetNullGuid(dr["AccessKey"]); + this.Title = Null.SetNullString(dr["Title"]); + this.Summary = Null.SetNullString(dr["Summary"]); string itemd = Null.SetNullString(dr["ItemData"]); - ItemData = new ItemData(); + this.ItemData = new ItemData(); if (!string.IsNullOrEmpty(itemd)) { - ItemData = itemd.FromJson(); + this.ItemData = itemd.FromJson(); } - ContentItemId = Null.SetNullInteger(dr["ContentItemId"]); - JournalAuthor = new JournalEntity(dr["JournalAuthor"].ToString()); - JournalOwner = new JournalEntity(dr["JournalOwner"].ToString()); - JournalType = Null.SetNullString(dr["JournalType"]); + this.ContentItemId = Null.SetNullInteger(dr["ContentItemId"]); + this.JournalAuthor = new JournalEntity(dr["JournalAuthor"].ToString()); + this.JournalOwner = new JournalEntity(dr["JournalOwner"].ToString()); + this.JournalType = Null.SetNullString(dr["JournalType"]); - IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]); - CommentsDisabled = Null.SetNullBoolean(dr["CommentsDisabled"]); - CommentsHidden = Null.SetNullBoolean(dr["CommentsHidden"]); - SimilarCount = Null.SetNullInteger(dr["SimilarCount"]); + this.IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]); + this.CommentsDisabled = Null.SetNullBoolean(dr["CommentsDisabled"]); + this.CommentsHidden = Null.SetNullBoolean(dr["CommentsHidden"]); + this.SimilarCount = Null.SetNullInteger(dr["SimilarCount"]); } public CacheLevel Cacheability { get { @@ -121,25 +121,25 @@ public string GetProperty(string propertyName, string format, System.Globalizati propertyName = propertyName.ToLowerInvariant(); switch (propertyName) { case "journalid": - return PropertyAccess.FormatString(JournalId.ToString(), format); + return PropertyAccess.FormatString(this.JournalId.ToString(), format); case "journaltypeid": - return PropertyAccess.FormatString(JournalTypeId.ToString(), format); + return PropertyAccess.FormatString(this.JournalTypeId.ToString(), format); case "profileid": - return PropertyAccess.FormatString(ProfileId.ToString(), format); + return PropertyAccess.FormatString(this.ProfileId.ToString(), format); case "socialgroupid": - return PropertyAccess.FormatString(SocialGroupId.ToString(), format); + return PropertyAccess.FormatString(this.SocialGroupId.ToString(), format); case "datecreated": - return PropertyAccess.FormatString(DateCreated.ToString(), format); + return PropertyAccess.FormatString(this.DateCreated.ToString(), format); case "title": - return PropertyAccess.FormatString(Title, format); + return PropertyAccess.FormatString(this.Title, format); case "summary": - return PropertyAccess.FormatString(Summary, format); + return PropertyAccess.FormatString(this.Summary, format); case "body": - return PropertyAccess.FormatString(Body, format); + return PropertyAccess.FormatString(this.Body, format); case "timeframe": - return PropertyAccess.FormatString(TimeFrame, format); + return PropertyAccess.FormatString(this.TimeFrame, format); case "isdeleted": - return IsDeleted.ToString(); + return this.IsDeleted.ToString(); } propertyNotFound = true; diff --git a/DNN Platform/Library/Services/Journal/JournalTypeInfo.cs b/DNN Platform/Library/Services/Journal/JournalTypeInfo.cs index 64962d16164..cf966c64fc8 100644 --- a/DNN Platform/Library/Services/Journal/JournalTypeInfo.cs +++ b/DNN Platform/Library/Services/Journal/JournalTypeInfo.cs @@ -25,25 +25,25 @@ public class JournalTypeInfo : IHydratable { public bool EnableComments { get; set; } public int KeyID { get { - return JournalTypeId; + return this.JournalTypeId; } set { - JournalTypeId = value; + this.JournalTypeId = value; } } public void Fill(System.Data.IDataReader dr) { - JournalTypeId = Null.SetNullInteger(dr["JournalTypeId"]); - PortalId = Null.SetNullInteger(dr["PortalId"]); - JournalType = Null.SetNullString(dr["JournalType"]); - icon = Null.SetNullString(dr["icon"]); - AppliesToProfile = Null.SetNullBoolean(dr["AppliesToProfile"]); - AppliesToGroup = Null.SetNullBoolean(dr["AppliesToGroup"]); - AppliesToStream = Null.SetNullBoolean(dr["AppliesToStream"]); - SupportsNotify = Null.SetNullBoolean(dr["SupportsNotify"]); - Options = Null.SetNullString(dr["Options"]); - IsEnabled = Null.SetNullBoolean(dr["IsEnabled"]); - EnableComments = Null.SetNullBoolean(dr["EnableComments"]); + this.JournalTypeId = Null.SetNullInteger(dr["JournalTypeId"]); + this.PortalId = Null.SetNullInteger(dr["PortalId"]); + this.JournalType = Null.SetNullString(dr["JournalType"]); + this.icon = Null.SetNullString(dr["icon"]); + this.AppliesToProfile = Null.SetNullBoolean(dr["AppliesToProfile"]); + this.AppliesToGroup = Null.SetNullBoolean(dr["AppliesToGroup"]); + this.AppliesToStream = Null.SetNullBoolean(dr["AppliesToStream"]); + this.SupportsNotify = Null.SetNullBoolean(dr["SupportsNotify"]); + this.Options = Null.SetNullString(dr["Options"]); + this.IsEnabled = Null.SetNullBoolean(dr["IsEnabled"]); + this.EnableComments = Null.SetNullBoolean(dr["EnableComments"]); } } } diff --git a/DNN Platform/Library/Services/Localization/CultureInfoComparer.cs b/DNN Platform/Library/Services/Localization/CultureInfoComparer.cs index 8fa9ca00453..f6b1e63cc31 100644 --- a/DNN Platform/Library/Services/Localization/CultureInfoComparer.cs +++ b/DNN Platform/Library/Services/Localization/CultureInfoComparer.cs @@ -17,14 +17,14 @@ public class CultureInfoComparer : IComparer public CultureInfoComparer(string compareBy) { - _compare = compareBy; + this._compare = compareBy; } #region IComparer Members public int Compare(object x, object y) { - switch (_compare.ToUpperInvariant()) + switch (this._compare.ToUpperInvariant()) { case "ENGLISH": return ((CultureInfo) x).EnglishName.CompareTo(((CultureInfo) y).EnglishName); diff --git a/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs b/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs index 5cbe83060d5..d59e1d6cd45 100644 --- a/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs +++ b/DNN Platform/Library/Services/Localization/Internal/LocalizationImpl.cs @@ -62,7 +62,7 @@ public string BestCultureCodeBasedOnBrowserLanguages(IEnumerable culture public string BestCultureCodeBasedOnBrowserLanguages(IEnumerable cultureCodes) { - return BestCultureCodeBasedOnBrowserLanguages(cultureCodes, Localization.SystemLocale); + return this.BestCultureCodeBasedOnBrowserLanguages(cultureCodes, Localization.SystemLocale); } public CultureInfo GetPageLocale(PortalSettings portalSettings) diff --git a/DNN Platform/Library/Services/Localization/LanguagePackInfo.cs b/DNN Platform/Library/Services/Localization/LanguagePackInfo.cs index a9e9a77c45c..a888b3f14a8 100644 --- a/DNN Platform/Library/Services/Localization/LanguagePackInfo.cs +++ b/DNN Platform/Library/Services/Localization/LanguagePackInfo.cs @@ -33,11 +33,11 @@ public int LanguagePackID { get { - return _LanguagePackID; + return this._LanguagePackID; } set { - _LanguagePackID = value; + this._LanguagePackID = value; } } @@ -45,11 +45,11 @@ public int LanguageID { get { - return _LanguageID; + return this._LanguageID; } set { - _LanguageID = value; + this._LanguageID = value; } } @@ -57,11 +57,11 @@ public int PackageID { get { - return _PackageID; + return this._PackageID; } set { - _PackageID = value; + this._PackageID = value; } } @@ -69,11 +69,11 @@ public int DependentPackageID { get { - return _DependentPackageID; + return this._DependentPackageID; } set { - _DependentPackageID = value; + this._DependentPackageID = value; } } @@ -81,7 +81,7 @@ public LanguagePackType PackageType { get { - if (DependentPackageID == -2) + if (this.DependentPackageID == -2) { return LanguagePackType.Core; } @@ -98,10 +98,10 @@ public LanguagePackType PackageType public void Fill(IDataReader dr) { - LanguagePackID = Null.SetNullInteger(dr["LanguagePackID"]); - LanguageID = Null.SetNullInteger(dr["LanguageID"]); - PackageID = Null.SetNullInteger(dr["PackageID"]); - DependentPackageID = Null.SetNullInteger(dr["DependentPackageID"]); + this.LanguagePackID = Null.SetNullInteger(dr["LanguagePackID"]); + this.LanguageID = Null.SetNullInteger(dr["LanguageID"]); + this.PackageID = Null.SetNullInteger(dr["PackageID"]); + this.DependentPackageID = Null.SetNullInteger(dr["DependentPackageID"]); //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); } @@ -110,11 +110,11 @@ public int KeyID { get { - return LanguagePackID; + return this.LanguagePackID; } set { - LanguagePackID = value; + this.LanguagePackID = value; } } diff --git a/DNN Platform/Library/Services/Localization/Locale.cs b/DNN Platform/Library/Services/Localization/Locale.cs index de2d60acb1f..d0528728cde 100644 --- a/DNN Platform/Library/Services/Localization/Locale.cs +++ b/DNN Platform/Library/Services/Localization/Locale.cs @@ -24,9 +24,9 @@ public class Locale : BaseEntityInfo, IHydratable { public Locale() { - PortalId = Null.NullInteger; - LanguageId = Null.NullInteger; - IsPublished = Null.NullBoolean; + this.PortalId = Null.NullInteger; + this.LanguageId = Null.NullInteger; + this.IsPublished = Null.NullBoolean; } #region Public Properties @@ -37,7 +37,7 @@ public CultureInfo Culture { get { - return CultureInfo.GetCultureInfo(Code); + return CultureInfo.GetCultureInfo(this.Code); } } @@ -46,9 +46,9 @@ public string EnglishName get { string _Name = Null.NullString; - if (Culture != null) + if (this.Culture != null) { - _Name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Culture.EnglishName); + _Name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.Culture.EnglishName); } return _Name; } @@ -61,9 +61,9 @@ public Locale FallBackLocale get { Locale _FallbackLocale = null; - if (!string.IsNullOrEmpty(Fallback)) + if (!string.IsNullOrEmpty(this.Fallback)) { - _FallbackLocale = LocaleController.Instance.GetLocale(PortalId, Fallback); + _FallbackLocale = LocaleController.Instance.GetLocale(this.PortalId, this.Fallback); } return _FallbackLocale; } @@ -78,9 +78,9 @@ public string NativeName get { string _Name = Null.NullString; - if (Culture != null) + if (this.Culture != null) { - _Name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Culture.NativeName); + _Name = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(this.Culture.NativeName); } return _Name; } @@ -96,10 +96,10 @@ public string NativeName public void Fill(IDataReader dr) { - LanguageId = Null.SetNullInteger(dr["LanguageID"]); - Code = Null.SetNullString(dr["CultureCode"]); - Text = Null.SetNullString(dr["CultureName"]); - Fallback = Null.SetNullString(dr["FallbackCulture"]); + this.LanguageId = Null.SetNullInteger(dr["LanguageID"]); + this.Code = Null.SetNullString(dr["CultureCode"]); + this.Text = Null.SetNullString(dr["CultureName"]); + this.Fallback = Null.SetNullString(dr["FallbackCulture"]); //These fields may not be populated (for Host level locales) DataTable schemaTable = dr.GetSchemaTable(); @@ -107,8 +107,8 @@ public void Fill(IDataReader dr) if(hasColumns) { - IsPublished = Null.SetNullBoolean(dr["IsPublished"]); - PortalId = Null.SetNullInteger(dr["PortalID"]); + this.IsPublished = Null.SetNullBoolean(dr["IsPublished"]); + this.PortalId = Null.SetNullInteger(dr["PortalID"]); } //Call the base classes fill method to populate base class proeprties @@ -119,11 +119,11 @@ public int KeyID { get { - return LanguageId; + return this.LanguageId; } set { - LanguageId = value; + this.LanguageId = value; } } diff --git a/DNN Platform/Library/Services/Localization/LocaleCollection.cs b/DNN Platform/Library/Services/Localization/LocaleCollection.cs index 41d63cb6907..18fa707044a 100644 --- a/DNN Platform/Library/Services/Localization/LocaleCollection.cs +++ b/DNN Platform/Library/Services/Localization/LocaleCollection.cs @@ -23,9 +23,9 @@ public DictionaryEntry this[int index] { get { - _de.Key = BaseGetKey(index); - _de.Value = BaseGet(index); - return _de; + this._de.Key = this.BaseGetKey(index); + this._de.Value = this.BaseGet(index); + return this._de; } } @@ -34,11 +34,11 @@ public Locale this[string key] { get { - return (Locale) BaseGet(key); + return (Locale) this.BaseGet(key); } set { - BaseSet(key, value); + this.BaseSet(key, value); } } @@ -47,7 +47,7 @@ public string[] AllKeys { get { - return BaseGetAllKeys(); + return this.BaseGetAllKeys(); } } @@ -56,7 +56,7 @@ public Array AllValues { get { - return BaseGetAllValues(); + return this.BaseGetAllValues(); } } @@ -65,20 +65,20 @@ public Boolean HasKeys { get { - return BaseHasKeys(); + return this.BaseHasKeys(); } } //Adds an entry to the collection. public void Add(String key, Object value) { - BaseAdd(key, value); + this.BaseAdd(key, value); } //Removes an entry with the specified key from the collection. public void Remove(String key) { - BaseRemove(key); + this.BaseRemove(key); } } } diff --git a/DNN Platform/Library/Services/Localization/LocaleController.cs b/DNN Platform/Library/Services/Localization/LocaleController.cs index 69820d720b5..d9ebb9b001a 100644 --- a/DNN Platform/Library/Services/Localization/LocaleController.cs +++ b/DNN Platform/Library/Services/Localization/LocaleController.cs @@ -85,11 +85,11 @@ public Locale GetCurrentLocale(int PortalId) if (HttpContext.Current != null && !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["language"])) { - locale = GetLocale(HttpContext.Current.Request.QueryString["language"]); + locale = this.GetLocale(HttpContext.Current.Request.QueryString["language"]); } return locale ?? ((PortalId == Null.NullInteger) - ? GetLocale(Localization.SystemLocale) - : GetDefaultLocale(PortalId)); + ? this.GetLocale(Localization.SystemLocale) + : this.GetDefaultLocale(PortalId)); } /// @@ -103,13 +103,13 @@ public Locale GetDefaultLocale(int portalId) Locale locale = null; if (portal != null) { - Dictionary locales = GetLocales(portal.PortalID); + Dictionary locales = this.GetLocales(portal.PortalID); if (locales != null && locales.ContainsKey(portal.DefaultLanguage)) { locale = locales[portal.DefaultLanguage]; } } - return locale ?? (GetLocale(Localization.SystemLocale)); + return locale ?? (this.GetLocale(Localization.SystemLocale)); } /// @@ -119,7 +119,7 @@ public Locale GetDefaultLocale(int portalId) /// public Locale GetLocale(string code) { - return GetLocale(Null.NullInteger, code); + return this.GetLocale(Null.NullInteger, code); } /// @@ -130,7 +130,7 @@ public Locale GetLocale(string code) /// public Locale GetLocale(int portalID, string code) { - Dictionary dicLocales = GetLocales(portalID); + Dictionary dicLocales = this.GetLocales(portalID); Locale locale = null; if (dicLocales != null) @@ -161,7 +161,7 @@ public Locale GetLocaleOrCurrent(int portalID, string code) /// public Locale GetLocale(int languageID) { - Dictionary dicLocales = GetLocales(Null.NullInteger); + Dictionary dicLocales = this.GetLocales(Null.NullInteger); return (from kvp in dicLocales where kvp.Value.LanguageId == languageID select kvp.Value).FirstOrDefault(); } @@ -198,7 +198,7 @@ public Dictionary GetLocales(int portalID) /// public Dictionary GetPublishedLocales(int portalID) { - return GetLocales(portalID).Where(kvp => kvp.Value.IsPublished).ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + return this.GetLocales(portalID).Where(kvp => kvp.Value.IsPublished).ToDictionary(kvp => kvp.Key, kvp => kvp.Value); } /// @@ -214,7 +214,7 @@ public bool IsEnabled(ref string localeCode, int portalId) try { bool enabled = false; - Dictionary dicLocales = GetLocales(portalId); + Dictionary dicLocales = this.GetLocales(portalId); //if ((!dicLocales.ContainsKey(localeCode))) string locale = localeCode; diff --git a/DNN Platform/Library/Services/Localization/Localization.cs b/DNN Platform/Library/Services/Localization/Localization.cs index 0e4b195c248..ca2c9b7dd2f 100644 --- a/DNN Platform/Library/Services/Localization/Localization.cs +++ b/DNN Platform/Library/Services/Localization/Localization.cs @@ -764,7 +764,7 @@ public static string GetExceptionMessage(string key, string defaultValue, params public string GetFixedCurrency(decimal expression, string culture, int numDigitsAfterDecimal) { - string oldCurrentCulture = CurrentUICulture; + string oldCurrentCulture = this.CurrentUICulture; var newCulture = new CultureInfo(culture); Thread.CurrentThread.CurrentUICulture = newCulture; string currencyStr = expression.ToString(newCulture.NumberFormat.CurrencySymbol); @@ -775,7 +775,7 @@ public string GetFixedCurrency(decimal expression, string culture, int numDigits public string GetFixedDate(DateTime expression, string culture) { - string oldCurrentCulture = CurrentUICulture; + string oldCurrentCulture = this.CurrentUICulture; var newCulture = new CultureInfo(culture); Thread.CurrentThread.CurrentUICulture = newCulture; string dateStr = expression.ToString(newCulture.DateTimeFormat.FullDateTimePattern); diff --git a/DNN Platform/Library/Services/Localization/LocalizationExpressionBuilder.cs b/DNN Platform/Library/Services/Localization/LocalizationExpressionBuilder.cs index d261b8f46e9..59cdc5601a1 100644 --- a/DNN Platform/Library/Services/Localization/LocalizationExpressionBuilder.cs +++ b/DNN Platform/Library/Services/Localization/LocalizationExpressionBuilder.cs @@ -38,7 +38,7 @@ public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, objec new CodePrimitiveExpression(context.VirtualPath) }; - return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(GetType()), "GetLocalizedResource", inputParams); + return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(this.GetType()), "GetLocalizedResource", inputParams); } public static object GetLocalizedResource(string key, Type targetType, string propertyName, string virtualPath) diff --git a/DNN Platform/Library/Services/Localization/LocalizationProvider.cs b/DNN Platform/Library/Services/Localization/LocalizationProvider.cs index 56481d19632..ddf51f916a0 100644 --- a/DNN Platform/Library/Services/Localization/LocalizationProvider.cs +++ b/DNN Platform/Library/Services/Localization/LocalizationProvider.cs @@ -2,598 +2,587 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using System.Web.Hosting; -using System.Xml; -using System.Xml.XPath; - -using DotNetNuke.Collections.Internal; -using DotNetNuke.Common; -using DotNetNuke.Common.Utilities; -using DotNetNuke.ComponentModel; -using DotNetNuke.Entities.Portals; -using DotNetNuke.Instrumentation; -using DotNetNuke.Services.Cache; - -namespace DotNetNuke.Services.Localization -{ - public class LocalizationProvider : ComponentBase, ILocalizationProvider - { - private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(LocalizationProvider)); - #region Nested type: CustomizedLocale - - public enum CustomizedLocale - { - None = 0, - Portal = 1, - Host = 2 - } - - #endregion - - #region Implementation of ILocalizationProvider - - public string GetString(string key, string resourceFileRoot) - { - return GetString(key, resourceFileRoot, null, PortalController.Instance.GetCurrentPortalSettings(), false); - } - - public string GetString(string key, string resourceFileRoot, string language) - { - return GetString(key, resourceFileRoot, language, PortalController.Instance.GetCurrentPortalSettings(), false); - } - - public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings) - { - return GetString(key, resourceFileRoot, language, portalSettings, false); - } - - public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys) - { - //make the default translation property ".Text" - if (key.IndexOf(".", StringComparison.Ordinal) < 1) - { - key += ".Text"; - } - string resourceValue = Null.NullString; - bool keyFound = TryGetStringInternal(key, language, resourceFileRoot, portalSettings, ref resourceValue); - - //If the key can't be found then it doesn't exist in the Localization Resources - if (Localization.ShowMissingKeys && !disableShowMissingKeys) - { - if (keyFound) - { - resourceValue = "[L]" + resourceValue; - } - else - { - resourceValue = "RESX:" + key; - } - } - - if (!keyFound) - { - Logger.WarnFormat("Missing localization key. key:{0} resFileRoot:{1} threadCulture:{2} userlan:{3}", key, resourceFileRoot, Thread.CurrentThread.CurrentUICulture, language); - } - - return string.IsNullOrEmpty(resourceValue) ? string.Empty : RemoveHttpUrlsIfSiteisSSLEnabled(portalSettings, resourceValue); - } - - private string RemoveHttpUrlsIfSiteisSSLEnabled(PortalSettings portalSettings, string resourceValue) - { - - if (portalSettings != null && (portalSettings.SSLEnabled || portalSettings.SSLEnforced)) - { - resourceValue = resourceValue.Replace(@"http:", @"https:"); - } - - return resourceValue; - } - - /// - /// Saves a string to a resource file. - /// - /// The key to save (e.g. "MyWidget.Text"). - /// The text value for the key. - /// Relative path for the resource file root (e.g. "DesktopModules/Admin/Lists/App_LocalResources/ListEditor.ascx.resx"). - /// The locale code in lang-region format (e.g. "fr-FR"). - /// The current portal settings. - /// Specifies whether to save as portal, host or system resource file. - /// if set to true a new file will be created if it is not found. - /// if set to true a new key will be created if not found. - /// If the value could be saved then true will be returned, otherwise false. - /// Any file io error or similar will lead to exceptions - public bool SaveString(string key, string value, string resourceFileRoot, string language, PortalSettings portalSettings, CustomizedLocale resourceType, bool createFile, bool createKey) - { - try - { - if (key.IndexOf(".", StringComparison.Ordinal) < 1) - { - key += ".Text"; - } - string resourceFileName = GetResourceFileName(resourceFileRoot, language); - resourceFileName = resourceFileName.Replace("." + language.ToLowerInvariant() + ".", "." + language + "."); - switch (resourceType) - { - case CustomizedLocale.Host: - resourceFileName = resourceFileName.Replace(".resx", ".Host.resx"); - break; - case CustomizedLocale.Portal: - resourceFileName = resourceFileName.Replace(".resx", ".Portal-" + portalSettings.PortalId + ".resx"); - break; - } - resourceFileName = resourceFileName.TrimStart('~', '/', '\\'); - string filePath = HostingEnvironment.MapPath("~/" + resourceFileName); - XmlDocument doc = null; - if (File.Exists(filePath)) - { - doc = new XmlDocument { XmlResolver = null }; - doc.Load(filePath); - } - else - { - if (createFile) - { - doc = new XmlDocument { XmlResolver = null }; - doc.AppendChild(doc.CreateXmlDeclaration("1.0", "utf-8", "yes")); - XmlNode root = doc.CreateElement("root"); - doc.AppendChild(root); - AddResourceFileNode(ref root, "resheader", "resmimetype", "text/microsoft-resx"); - AddResourceFileNode(ref root, "resheader", "version", "2.0"); - AddResourceFileNode(ref root, "resheader", "reader", "System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); - AddResourceFileNode(ref root, "resheader", "writer", "System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); - } - } - if (doc == null) { return false; } - XmlNode reskeyNode = doc.SelectSingleNode("root/data[@name=\"" + key + "\"]"); - if (reskeyNode != null) - { - reskeyNode.SelectSingleNode("value").InnerText = value; - } - else - { - if (createKey) - { - XmlNode root = doc.SelectSingleNode("root"); - AddResourceFileNode(ref root, "data", key, value); - } - else - { - return false; - } - } - doc.Save(filePath); - DataCache.RemoveCache("/" + resourceFileName.ToLowerInvariant()); - return true; - } - catch (Exception ex) - { - throw new Exception(string.Format("Error while trying to create resource in {0}", resourceFileRoot), ex); - } - } - - public Dictionary GetCompiledResourceFile(PortalSettings portalSettings, string resourceFile, string locale) - { - return - CBO.GetCachedObject>(new CacheItemArgs("Compiled-" + resourceFile + "-" + locale + "-" + portalSettings.PortalId, - DataCache.ResourceFilesCacheTimeOut, DataCache.ResourceFilesCachePriority, resourceFile, locale, - portalSettings), GetCompiledResourceFileCallBack, true); - } - - #endregion - - private static object GetCompiledResourceFileCallBack(CacheItemArgs cacheItemArgs) - { - string resourceFile = (string)cacheItemArgs.Params[0]; - string locale = (string)cacheItemArgs.Params[1]; - PortalSettings portalSettings = (PortalSettings)cacheItemArgs.Params[2]; - string systemLanguage = Localization.SystemLocale; - string defaultLanguage = portalSettings.DefaultLanguage; - string fallbackLanguage = Localization.SystemLocale; - Locale targetLocale = LocaleController.Instance.GetLocale(locale); - if (!String.IsNullOrEmpty(targetLocale.Fallback)) - { - fallbackLanguage = targetLocale.Fallback; - } - - // get system default and merge the specific ones one by one - var res = GetResourceFile(resourceFile); - if (res == null) - { - return new Dictionary(); - } - - //clone the dictionart so that when merge values into dictionart, it won't - //affect the cache data. - res = res.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - res = MergeResourceFile(res, GetResourceFileName(resourceFile, systemLanguage, portalSettings.PortalId)); - if (defaultLanguage != systemLanguage) - { - res = MergeResourceFile(res, GetResourceFileName(resourceFile, defaultLanguage)); - res = MergeResourceFile(res, GetResourceFileName(resourceFile, defaultLanguage, portalSettings.PortalId)); - } - if (fallbackLanguage != defaultLanguage) - { - res = MergeResourceFile(res, GetResourceFileName(resourceFile, fallbackLanguage)); - res = MergeResourceFile(res, GetResourceFileName(resourceFile, fallbackLanguage, portalSettings.PortalId)); - } - if (locale != fallbackLanguage) - { - res = MergeResourceFile(res, GetResourceFileName(resourceFile, locale)); - res = MergeResourceFile(res, GetResourceFileName(resourceFile, locale, portalSettings.PortalId)); - } - return res; - } - - private static Dictionary MergeResourceFile(Dictionary current, string resourceFile) - { - var resFile = GetResourceFile(resourceFile); - if (resFile == null) - { - return current; - } - foreach (string key in current.Keys.ToList()) - { - if (resFile.ContainsKey(key)) - { - current[key] = resFile[key]; - } - } - return current; - } - - /// - /// Adds one of either a "resheader" or "data" element to resxRoot (which should be the root element of the resx file). - /// This function is used to construct new resource files and to add resource keys to an existing file. - /// - /// The RESX root. - /// Name of the element ("resheader" or "data"). - /// Name of the node (in case of "data" specify the localization key here, e.g. "MyWidget.Text"). - /// The node value (text value to use). - private static void AddResourceFileNode(ref XmlNode resxRoot, string elementName, string nodeName, string nodeValue) - { - XmlNode newNode = resxRoot.AddElement(elementName, "").AddAttribute("name", nodeName); - if (elementName == "data") - { - newNode = newNode.AddAttribute("xml:space", "preserve"); - } - newNode.AddElement("value", nodeValue); - } - - private static object GetResourceFileCallBack(CacheItemArgs cacheItemArgs) - { - string cacheKey = cacheItemArgs.CacheKey; - Dictionary resources = null; - - string filePath = null; - try - { - //Get resource file lookup to determine if the resource file even exists - SharedDictionary resourceFileExistsLookup = GetResourceFileLookupDictionary(); - - if (ResourceFileMayExist(resourceFileExistsLookup, cacheKey)) - { - //check if an absolute reference for the resource file was used - if (cacheKey.Contains(":\\") && Path.IsPathRooted(cacheKey)) - { - //if an absolute reference, check that the file exists - if (File.Exists(cacheKey)) - { - filePath = cacheKey; - } - } - - //no filepath found from an absolute reference, try and map the path to get the file path - if (filePath == null) - { - filePath = HostingEnvironment.MapPath(Globals.ApplicationPath + cacheKey); - } - - //The file is not in the lookup, or we know it exists as we have found it before - if (File.Exists(filePath)) - { - if (filePath != null) - { - var doc = new XPathDocument(filePath); - resources = new Dictionary(); - foreach (XPathNavigator nav in doc.CreateNavigator().Select("root/data")) - { - if (nav.NodeType != XPathNodeType.Comment) - { - var selectSingleNode = nav.SelectSingleNode("value"); - if (selectSingleNode != null) - { - resources[nav.GetAttribute("name", String.Empty)] = selectSingleNode.Value; - } - } - } - } - cacheItemArgs.CacheDependency = new DNNCacheDependency(filePath); - - //File exists so add it to lookup with value true, so we are safe to try again - using (resourceFileExistsLookup.GetWriteLock()) - { - resourceFileExistsLookup[cacheKey] = true; - } - } - else - { - //File does not exist so add it to lookup with value false, so we don't try again - using (resourceFileExistsLookup.GetWriteLock()) - { - resourceFileExistsLookup[cacheKey] = false; - } - } - } - } - catch (Exception ex) - { - throw new Exception(string.Format("The following resource file caused an error while reading: {0}", filePath), ex); - } - return resources; - } - - private static SharedDictionary GetResourceFileLookupDictionary() - { - return - CBO.GetCachedObject>( - new CacheItemArgs(DataCache.ResourceFileLookupDictionaryCacheKey, DataCache.ResourceFileLookupDictionaryTimeOut, DataCache.ResourceFileLookupDictionaryCachePriority), - c => new SharedDictionary(), - true); - } - - private static Dictionary GetResourceFile(string resourceFile) - { - return CBO.GetCachedObject>(new CacheItemArgs(resourceFile, DataCache.ResourceFilesCacheTimeOut, DataCache.ResourceFilesCachePriority), - GetResourceFileCallBack, - true); - } - - private static string GetResourceFileName(string resourceFileRoot, string language, int portalId) - { - string resourceFile = GetResourceFileName(resourceFileRoot, language); - if (portalId != -1) - { - resourceFile = resourceFile.Replace(".resx", ".Portal-" + portalId + ".resx"); - } - return resourceFile; - } - - private static string GetResourceFileName(string resourceFileRoot, string language) - { - string resourceFile; - language = language.ToLowerInvariant(); - if (resourceFileRoot != null) - { - if (language == Localization.SystemLocale.ToLowerInvariant() || String.IsNullOrEmpty(language)) - { - switch (resourceFileRoot.Substring(resourceFileRoot.Length - 5, 5).ToLowerInvariant()) - { - case ".resx": - resourceFile = resourceFileRoot; - break; - case ".ascx": - resourceFile = resourceFileRoot + ".resx"; - break; - case ".aspx": - resourceFile = resourceFileRoot + ".resx"; - break; - default: - resourceFile = resourceFileRoot + ".ascx.resx"; //a portal module - break; - } - } - else - { - switch (resourceFileRoot.Substring(resourceFileRoot.Length - 5, 5).ToLowerInvariant()) - { - case ".resx": - resourceFile = resourceFileRoot.Replace(".resx", "." + language + ".resx"); - break; - case ".ascx": - resourceFile = resourceFileRoot.Replace(".ascx", ".ascx." + language + ".resx"); - break; - case ".aspx": - resourceFile = resourceFileRoot.Replace(".aspx", ".aspx." + language + ".resx"); - break; - default: - resourceFile = resourceFileRoot + ".ascx." + language + ".resx"; - break; - } - } - } - else - { - if (language == Localization.SystemLocale.ToLowerInvariant() || String.IsNullOrEmpty(language)) - { - resourceFile = Localization.SharedResourceFile; - } - else - { - resourceFile = Localization.SharedResourceFile.Replace(".resx", "." + language + ".resx"); - } - } - return resourceFile; - } - - private static bool ResourceFileMayExist(SharedDictionary resourceFileExistsLookup, string cacheKey) - { - bool mayExist; - using (resourceFileExistsLookup.GetReadLock()) - { - mayExist = !resourceFileExistsLookup.ContainsKey(cacheKey) || resourceFileExistsLookup[cacheKey]; - } - return mayExist; - } - - private static bool TryGetFromResourceFile(string key, string resourceFile, string userLanguage, string fallbackLanguage, string defaultLanguage, int portalID, ref string resourceValue) - { - //Try the user's language first - bool bFound = TryGetFromResourceFile(key, GetResourceFileName(resourceFile, userLanguage), portalID, ref resourceValue); - - if (!bFound && fallbackLanguage != userLanguage) - { - //Try fallback language next - bFound = TryGetFromResourceFile(key, GetResourceFileName(resourceFile, fallbackLanguage), portalID, ref resourceValue); - } - if (!bFound && !(defaultLanguage == userLanguage || defaultLanguage == fallbackLanguage)) - { - //Try default Language last - bFound = TryGetFromResourceFile(key, GetResourceFileName(resourceFile, defaultLanguage), portalID, ref resourceValue); - } - return bFound; - } - - private static bool TryGetFromResourceFile(string key, string resourceFile, int portalID, ref string resourceValue) - { - //Try Portal Resource File - bool bFound = TryGetFromResourceFile(key, resourceFile, portalID, CustomizedLocale.Portal, ref resourceValue); - if (!bFound) - { - //Try Host Resource File - bFound = TryGetFromResourceFile(key, resourceFile, portalID, CustomizedLocale.Host, ref resourceValue); - } - if (!bFound) - { - //Try Portal Resource File - bFound = TryGetFromResourceFile(key, resourceFile, portalID, CustomizedLocale.None, ref resourceValue); - } - return bFound; - } - - private static bool TryGetStringInternal(string key, string userLanguage, string resourceFile, PortalSettings portalSettings, ref string resourceValue) - { - string defaultLanguage = Null.NullString; - string fallbackLanguage = Localization.SystemLocale; - int portalId = Null.NullInteger; - - //Get the default language - if (portalSettings != null) - { - defaultLanguage = portalSettings.DefaultLanguage; - portalId = portalSettings.PortalId; - } - - //Set the userLanguage if not passed in - if (String.IsNullOrEmpty(userLanguage)) - { - userLanguage = Thread.CurrentThread.CurrentUICulture.ToString(); - } - - //Default the userLanguage to the defaultLanguage if not set - if (String.IsNullOrEmpty(userLanguage)) - { - userLanguage = defaultLanguage; - } - Locale userLocale = null; - try - { - if (Globals.Status != Globals.UpgradeStatus.Install) - { - //Get Fallback language, but not when we are installing (because we may not have a database yet) - userLocale = LocaleController.Instance.GetLocale(userLanguage); - } - } - catch (Exception ex) - { - Logger.Error(ex); - } - - if (userLocale != null && !String.IsNullOrEmpty(userLocale.Fallback)) - { - fallbackLanguage = userLocale.Fallback; - } - if (String.IsNullOrEmpty(resourceFile)) - { - resourceFile = Localization.SharedResourceFile; - } - - //Try the resource file for the key - bool bFound = TryGetFromResourceFile(key, resourceFile, userLanguage, fallbackLanguage, defaultLanguage, portalId, ref resourceValue); - if (!bFound) - { - if (Localization.SharedResourceFile.ToLowerInvariant() != resourceFile.ToLowerInvariant()) - { - //try to use a module specific shared resource file - string localSharedFile = resourceFile.Substring(0, resourceFile.LastIndexOf("/", StringComparison.Ordinal) + 1) + Localization.LocalSharedResourceFile; - - if (localSharedFile.ToLowerInvariant() != resourceFile.ToLowerInvariant()) - { - bFound = TryGetFromResourceFile(key, localSharedFile, userLanguage, fallbackLanguage, defaultLanguage, portalId, ref resourceValue); - } - } - } - if (!bFound) - { - if (Localization.SharedResourceFile.ToLowerInvariant() != resourceFile.ToLowerInvariant()) - { - bFound = TryGetFromResourceFile(key, Localization.SharedResourceFile, userLanguage, fallbackLanguage, defaultLanguage, portalId, ref resourceValue); - } - } - return bFound; - } - - private static bool TryGetFromResourceFile(string key, string resourceFile, int portalID, CustomizedLocale resourceType, ref string resourceValue) - { - bool bFound = Null.NullBoolean; - string resourceFileName = resourceFile; - switch (resourceType) - { - case CustomizedLocale.Host: - resourceFileName = resourceFile.Replace(".resx", ".Host.resx"); - break; - case CustomizedLocale.Portal: - resourceFileName = resourceFile.Replace(".resx", ".Portal-" + portalID + ".resx"); - break; - } - - if (resourceFileName.StartsWith("desktopmodules", StringComparison.InvariantCultureIgnoreCase) - || resourceFileName.StartsWith("admin", StringComparison.InvariantCultureIgnoreCase) - || resourceFileName.StartsWith("controls", StringComparison.InvariantCultureIgnoreCase)) - { - resourceFileName = "~/" + resourceFileName; - } - - //Local resource files are either named ~/... or /... - //The following logic creates a cachekey of /.... - string cacheKey = resourceFileName.Replace("~/", "/").ToLowerInvariant(); - if (!String.IsNullOrEmpty(Globals.ApplicationPath)) - { - if (Globals.ApplicationPath != "/portals") - { - if (cacheKey.StartsWith(Globals.ApplicationPath)) - { - cacheKey = cacheKey.Substring(Globals.ApplicationPath.Length); - } - } - else - { - cacheKey = "~" + cacheKey; - if (cacheKey.StartsWith("~" + Globals.ApplicationPath)) - { - cacheKey = cacheKey.Substring(Globals.ApplicationPath.Length + 1); - } - } - } - - //Get resource file lookup to determine if the resource file even exists - SharedDictionary resourceFileExistsLookup = GetResourceFileLookupDictionary(); - - if (ResourceFileMayExist(resourceFileExistsLookup, cacheKey)) - { - //File is not in lookup or its value is true so we know it exists - Dictionary dicResources = GetResourceFile(cacheKey); - if (dicResources != null) - { - bFound = dicResources.TryGetValue(key, out resourceValue); - } - } - - return bFound; - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading; +using System.Web.Hosting; +using System.Xml; +using System.Xml.XPath; + +using DotNetNuke.Collections.Internal; +using DotNetNuke.Common; +using DotNetNuke.Common.Utilities; +using DotNetNuke.ComponentModel; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Instrumentation; +using DotNetNuke.Services.Cache; + +namespace DotNetNuke.Services.Localization +{ + public class LocalizationProvider : ComponentBase, ILocalizationProvider + { + private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(LocalizationProvider)); + #region Nested type: CustomizedLocale + + public enum CustomizedLocale + { + None = 0, + Portal = 1, + Host = 2 + } + + #endregion + + #region Implementation of ILocalizationProvider + + public string GetString(string key, string resourceFileRoot) + { + return this.GetString(key, resourceFileRoot, null, PortalController.Instance.GetCurrentPortalSettings(), false); + } + + public string GetString(string key, string resourceFileRoot, string language) + { + return this.GetString(key, resourceFileRoot, language, PortalController.Instance.GetCurrentPortalSettings(), false); + } + + public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings) + { + return this.GetString(key, resourceFileRoot, language, portalSettings, false); + } + + public string GetString(string key, string resourceFileRoot, string language, PortalSettings portalSettings, bool disableShowMissingKeys) + { + //make the default translation property ".Text" + if (key.IndexOf(".", StringComparison.Ordinal) < 1) + { + key += ".Text"; + } + string resourceValue = Null.NullString; + bool keyFound = TryGetStringInternal(key, language, resourceFileRoot, portalSettings, ref resourceValue); + + //If the key can't be found then it doesn't exist in the Localization Resources + if (Localization.ShowMissingKeys && !disableShowMissingKeys) + { + if (keyFound) + { + resourceValue = "[L]" + resourceValue; + } + else + { + resourceValue = "RESX:" + key; + } + } + + if (!keyFound) + { + Logger.WarnFormat("Missing localization key. key:{0} resFileRoot:{1} threadCulture:{2} userlan:{3}", key, resourceFileRoot, Thread.CurrentThread.CurrentUICulture, language); + } + + return string.IsNullOrEmpty(resourceValue) ? string.Empty : resourceValue; + } + + /// + /// Saves a string to a resource file. + /// + /// The key to save (e.g. "MyWidget.Text"). + /// The text value for the key. + /// Relative path for the resource file root (e.g. "DesktopModules/Admin/Lists/App_LocalResources/ListEditor.ascx.resx"). + /// The locale code in lang-region format (e.g. "fr-FR"). + /// The current portal settings. + /// Specifies whether to save as portal, host or system resource file. + /// if set to true a new file will be created if it is not found. + /// if set to true a new key will be created if not found. + /// If the value could be saved then true will be returned, otherwise false. + /// Any file io error or similar will lead to exceptions + public bool SaveString(string key, string value, string resourceFileRoot, string language, PortalSettings portalSettings, CustomizedLocale resourceType, bool createFile, bool createKey) + { + try + { + if (key.IndexOf(".", StringComparison.Ordinal) < 1) + { + key += ".Text"; + } + string resourceFileName = GetResourceFileName(resourceFileRoot, language); + resourceFileName = resourceFileName.Replace("." + language.ToLowerInvariant() + ".", "." + language + "."); + switch (resourceType) + { + case CustomizedLocale.Host: + resourceFileName = resourceFileName.Replace(".resx", ".Host.resx"); + break; + case CustomizedLocale.Portal: + resourceFileName = resourceFileName.Replace(".resx", ".Portal-" + portalSettings.PortalId + ".resx"); + break; + } + resourceFileName = resourceFileName.TrimStart('~', '/', '\\'); + string filePath = HostingEnvironment.MapPath("~/" + resourceFileName); + XmlDocument doc = null; + if (File.Exists(filePath)) + { + doc = new XmlDocument { XmlResolver = null }; + doc.Load(filePath); + } + else + { + if (createFile) + { + doc = new XmlDocument { XmlResolver = null }; + doc.AppendChild(doc.CreateXmlDeclaration("1.0", "utf-8", "yes")); + XmlNode root = doc.CreateElement("root"); + doc.AppendChild(root); + AddResourceFileNode(ref root, "resheader", "resmimetype", "text/microsoft-resx"); + AddResourceFileNode(ref root, "resheader", "version", "2.0"); + AddResourceFileNode(ref root, "resheader", "reader", "System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + AddResourceFileNode(ref root, "resheader", "writer", "System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); + } + } + if (doc == null) { return false; } + XmlNode reskeyNode = doc.SelectSingleNode("root/data[@name=\"" + key + "\"]"); + if (reskeyNode != null) + { + reskeyNode.SelectSingleNode("value").InnerText = value; + } + else + { + if (createKey) + { + XmlNode root = doc.SelectSingleNode("root"); + AddResourceFileNode(ref root, "data", key, value); + } + else + { + return false; + } + } + doc.Save(filePath); + DataCache.RemoveCache("/" + resourceFileName.ToLowerInvariant()); + return true; + } + catch (Exception ex) + { + throw new Exception(string.Format("Error while trying to create resource in {0}", resourceFileRoot), ex); + } + } + + public Dictionary GetCompiledResourceFile(PortalSettings portalSettings, string resourceFile, string locale) + { + return + CBO.GetCachedObject>(new CacheItemArgs("Compiled-" + resourceFile + "-" + locale + "-" + portalSettings.PortalId, + DataCache.ResourceFilesCacheTimeOut, DataCache.ResourceFilesCachePriority, resourceFile, locale, + portalSettings), GetCompiledResourceFileCallBack, true); + } + + #endregion + + private static object GetCompiledResourceFileCallBack(CacheItemArgs cacheItemArgs) + { + string resourceFile = (string)cacheItemArgs.Params[0]; + string locale = (string)cacheItemArgs.Params[1]; + PortalSettings portalSettings = (PortalSettings)cacheItemArgs.Params[2]; + string systemLanguage = Localization.SystemLocale; + string defaultLanguage = portalSettings.DefaultLanguage; + string fallbackLanguage = Localization.SystemLocale; + Locale targetLocale = LocaleController.Instance.GetLocale(locale); + if (!String.IsNullOrEmpty(targetLocale.Fallback)) + { + fallbackLanguage = targetLocale.Fallback; + } + + // get system default and merge the specific ones one by one + var res = GetResourceFile(resourceFile); + if (res == null) + { + return new Dictionary(); + } + + //clone the dictionart so that when merge values into dictionart, it won't + //affect the cache data. + res = res.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + res = MergeResourceFile(res, GetResourceFileName(resourceFile, systemLanguage, portalSettings.PortalId)); + if (defaultLanguage != systemLanguage) + { + res = MergeResourceFile(res, GetResourceFileName(resourceFile, defaultLanguage)); + res = MergeResourceFile(res, GetResourceFileName(resourceFile, defaultLanguage, portalSettings.PortalId)); + } + if (fallbackLanguage != defaultLanguage) + { + res = MergeResourceFile(res, GetResourceFileName(resourceFile, fallbackLanguage)); + res = MergeResourceFile(res, GetResourceFileName(resourceFile, fallbackLanguage, portalSettings.PortalId)); + } + if (locale != fallbackLanguage) + { + res = MergeResourceFile(res, GetResourceFileName(resourceFile, locale)); + res = MergeResourceFile(res, GetResourceFileName(resourceFile, locale, portalSettings.PortalId)); + } + return res; + } + + private static Dictionary MergeResourceFile(Dictionary current, string resourceFile) + { + var resFile = GetResourceFile(resourceFile); + if (resFile == null) + { + return current; + } + foreach (string key in current.Keys.ToList()) + { + if (resFile.ContainsKey(key)) + { + current[key] = resFile[key]; + } + } + return current; + } + + /// + /// Adds one of either a "resheader" or "data" element to resxRoot (which should be the root element of the resx file). + /// This function is used to construct new resource files and to add resource keys to an existing file. + /// + /// The RESX root. + /// Name of the element ("resheader" or "data"). + /// Name of the node (in case of "data" specify the localization key here, e.g. "MyWidget.Text"). + /// The node value (text value to use). + private static void AddResourceFileNode(ref XmlNode resxRoot, string elementName, string nodeName, string nodeValue) + { + XmlNode newNode = resxRoot.AddElement(elementName, "").AddAttribute("name", nodeName); + if (elementName == "data") + { + newNode = newNode.AddAttribute("xml:space", "preserve"); + } + newNode.AddElement("value", nodeValue); + } + + private static object GetResourceFileCallBack(CacheItemArgs cacheItemArgs) + { + string cacheKey = cacheItemArgs.CacheKey; + Dictionary resources = null; + + string filePath = null; + try + { + //Get resource file lookup to determine if the resource file even exists + SharedDictionary resourceFileExistsLookup = GetResourceFileLookupDictionary(); + + if (ResourceFileMayExist(resourceFileExistsLookup, cacheKey)) + { + //check if an absolute reference for the resource file was used + if (cacheKey.Contains(":\\") && Path.IsPathRooted(cacheKey)) + { + //if an absolute reference, check that the file exists + if (File.Exists(cacheKey)) + { + filePath = cacheKey; + } + } + + //no filepath found from an absolute reference, try and map the path to get the file path + if (filePath == null) + { + filePath = HostingEnvironment.MapPath(Globals.ApplicationPath + cacheKey); + } + + //The file is not in the lookup, or we know it exists as we have found it before + if (File.Exists(filePath)) + { + if (filePath != null) + { + var doc = new XPathDocument(filePath); + resources = new Dictionary(); + foreach (XPathNavigator nav in doc.CreateNavigator().Select("root/data")) + { + if (nav.NodeType != XPathNodeType.Comment) + { + var selectSingleNode = nav.SelectSingleNode("value"); + if (selectSingleNode != null) + { + resources[nav.GetAttribute("name", String.Empty)] = selectSingleNode.Value; + } + } + } + } + cacheItemArgs.CacheDependency = new DNNCacheDependency(filePath); + + //File exists so add it to lookup with value true, so we are safe to try again + using (resourceFileExistsLookup.GetWriteLock()) + { + resourceFileExistsLookup[cacheKey] = true; + } + } + else + { + //File does not exist so add it to lookup with value false, so we don't try again + using (resourceFileExistsLookup.GetWriteLock()) + { + resourceFileExistsLookup[cacheKey] = false; + } + } + } + } + catch (Exception ex) + { + throw new Exception(string.Format("The following resource file caused an error while reading: {0}", filePath), ex); + } + return resources; + } + + private static SharedDictionary GetResourceFileLookupDictionary() + { + return + CBO.GetCachedObject>( + new CacheItemArgs(DataCache.ResourceFileLookupDictionaryCacheKey, DataCache.ResourceFileLookupDictionaryTimeOut, DataCache.ResourceFileLookupDictionaryCachePriority), + c => new SharedDictionary(), + true); + } + + private static Dictionary GetResourceFile(string resourceFile) + { + return CBO.GetCachedObject>(new CacheItemArgs(resourceFile, DataCache.ResourceFilesCacheTimeOut, DataCache.ResourceFilesCachePriority), + GetResourceFileCallBack, + true); + } + + private static string GetResourceFileName(string resourceFileRoot, string language, int portalId) + { + string resourceFile = GetResourceFileName(resourceFileRoot, language); + if (portalId != -1) + { + resourceFile = resourceFile.Replace(".resx", ".Portal-" + portalId + ".resx"); + } + return resourceFile; + } + + private static string GetResourceFileName(string resourceFileRoot, string language) + { + string resourceFile; + language = language.ToLowerInvariant(); + if (resourceFileRoot != null) + { + if (language == Localization.SystemLocale.ToLowerInvariant() || String.IsNullOrEmpty(language)) + { + switch (resourceFileRoot.Substring(resourceFileRoot.Length - 5, 5).ToLowerInvariant()) + { + case ".resx": + resourceFile = resourceFileRoot; + break; + case ".ascx": + resourceFile = resourceFileRoot + ".resx"; + break; + case ".aspx": + resourceFile = resourceFileRoot + ".resx"; + break; + default: + resourceFile = resourceFileRoot + ".ascx.resx"; //a portal module + break; + } + } + else + { + switch (resourceFileRoot.Substring(resourceFileRoot.Length - 5, 5).ToLowerInvariant()) + { + case ".resx": + resourceFile = resourceFileRoot.Replace(".resx", "." + language + ".resx"); + break; + case ".ascx": + resourceFile = resourceFileRoot.Replace(".ascx", ".ascx." + language + ".resx"); + break; + case ".aspx": + resourceFile = resourceFileRoot.Replace(".aspx", ".aspx." + language + ".resx"); + break; + default: + resourceFile = resourceFileRoot + ".ascx." + language + ".resx"; + break; + } + } + } + else + { + if (language == Localization.SystemLocale.ToLowerInvariant() || String.IsNullOrEmpty(language)) + { + resourceFile = Localization.SharedResourceFile; + } + else + { + resourceFile = Localization.SharedResourceFile.Replace(".resx", "." + language + ".resx"); + } + } + return resourceFile; + } + + private static bool ResourceFileMayExist(SharedDictionary resourceFileExistsLookup, string cacheKey) + { + bool mayExist; + using (resourceFileExistsLookup.GetReadLock()) + { + mayExist = !resourceFileExistsLookup.ContainsKey(cacheKey) || resourceFileExistsLookup[cacheKey]; + } + return mayExist; + } + + private static bool TryGetFromResourceFile(string key, string resourceFile, string userLanguage, string fallbackLanguage, string defaultLanguage, int portalID, ref string resourceValue) + { + //Try the user's language first + bool bFound = TryGetFromResourceFile(key, GetResourceFileName(resourceFile, userLanguage), portalID, ref resourceValue); + + if (!bFound && fallbackLanguage != userLanguage) + { + //Try fallback language next + bFound = TryGetFromResourceFile(key, GetResourceFileName(resourceFile, fallbackLanguage), portalID, ref resourceValue); + } + if (!bFound && !(defaultLanguage == userLanguage || defaultLanguage == fallbackLanguage)) + { + //Try default Language last + bFound = TryGetFromResourceFile(key, GetResourceFileName(resourceFile, defaultLanguage), portalID, ref resourceValue); + } + return bFound; + } + + private static bool TryGetFromResourceFile(string key, string resourceFile, int portalID, ref string resourceValue) + { + //Try Portal Resource File + bool bFound = TryGetFromResourceFile(key, resourceFile, portalID, CustomizedLocale.Portal, ref resourceValue); + if (!bFound) + { + //Try Host Resource File + bFound = TryGetFromResourceFile(key, resourceFile, portalID, CustomizedLocale.Host, ref resourceValue); + } + if (!bFound) + { + //Try Portal Resource File + bFound = TryGetFromResourceFile(key, resourceFile, portalID, CustomizedLocale.None, ref resourceValue); + } + return bFound; + } + + private static bool TryGetStringInternal(string key, string userLanguage, string resourceFile, PortalSettings portalSettings, ref string resourceValue) + { + string defaultLanguage = Null.NullString; + string fallbackLanguage = Localization.SystemLocale; + int portalId = Null.NullInteger; + + //Get the default language + if (portalSettings != null) + { + defaultLanguage = portalSettings.DefaultLanguage; + portalId = portalSettings.PortalId; + } + + //Set the userLanguage if not passed in + if (String.IsNullOrEmpty(userLanguage)) + { + userLanguage = Thread.CurrentThread.CurrentUICulture.ToString(); + } + + //Default the userLanguage to the defaultLanguage if not set + if (String.IsNullOrEmpty(userLanguage)) + { + userLanguage = defaultLanguage; + } + Locale userLocale = null; + try + { + if (Globals.Status != Globals.UpgradeStatus.Install) + { + //Get Fallback language, but not when we are installing (because we may not have a database yet) + userLocale = LocaleController.Instance.GetLocale(userLanguage); + } + } + catch (Exception ex) + { + Logger.Error(ex); + } + + if (userLocale != null && !String.IsNullOrEmpty(userLocale.Fallback)) + { + fallbackLanguage = userLocale.Fallback; + } + if (String.IsNullOrEmpty(resourceFile)) + { + resourceFile = Localization.SharedResourceFile; + } + + //Try the resource file for the key + bool bFound = TryGetFromResourceFile(key, resourceFile, userLanguage, fallbackLanguage, defaultLanguage, portalId, ref resourceValue); + if (!bFound) + { + if (Localization.SharedResourceFile.ToLowerInvariant() != resourceFile.ToLowerInvariant()) + { + //try to use a module specific shared resource file + string localSharedFile = resourceFile.Substring(0, resourceFile.LastIndexOf("/", StringComparison.Ordinal) + 1) + Localization.LocalSharedResourceFile; + + if (localSharedFile.ToLowerInvariant() != resourceFile.ToLowerInvariant()) + { + bFound = TryGetFromResourceFile(key, localSharedFile, userLanguage, fallbackLanguage, defaultLanguage, portalId, ref resourceValue); + } + } + } + if (!bFound) + { + if (Localization.SharedResourceFile.ToLowerInvariant() != resourceFile.ToLowerInvariant()) + { + bFound = TryGetFromResourceFile(key, Localization.SharedResourceFile, userLanguage, fallbackLanguage, defaultLanguage, portalId, ref resourceValue); + } + } + return bFound; + } + + private static bool TryGetFromResourceFile(string key, string resourceFile, int portalID, CustomizedLocale resourceType, ref string resourceValue) + { + bool bFound = Null.NullBoolean; + string resourceFileName = resourceFile; + switch (resourceType) + { + case CustomizedLocale.Host: + resourceFileName = resourceFile.Replace(".resx", ".Host.resx"); + break; + case CustomizedLocale.Portal: + resourceFileName = resourceFile.Replace(".resx", ".Portal-" + portalID + ".resx"); + break; + } + + if (resourceFileName.StartsWith("desktopmodules", StringComparison.InvariantCultureIgnoreCase) + || resourceFileName.StartsWith("admin", StringComparison.InvariantCultureIgnoreCase) + || resourceFileName.StartsWith("controls", StringComparison.InvariantCultureIgnoreCase)) + { + resourceFileName = "~/" + resourceFileName; + } + + //Local resource files are either named ~/... or /... + //The following logic creates a cachekey of /.... + string cacheKey = resourceFileName.Replace("~/", "/").ToLowerInvariant(); + if (!String.IsNullOrEmpty(Globals.ApplicationPath)) + { + if (Globals.ApplicationPath != "/portals") + { + if (cacheKey.StartsWith(Globals.ApplicationPath)) + { + cacheKey = cacheKey.Substring(Globals.ApplicationPath.Length); + } + } + else + { + cacheKey = "~" + cacheKey; + if (cacheKey.StartsWith("~" + Globals.ApplicationPath)) + { + cacheKey = cacheKey.Substring(Globals.ApplicationPath.Length + 1); + } + } + } + + //Get resource file lookup to determine if the resource file even exists + SharedDictionary resourceFileExistsLookup = GetResourceFileLookupDictionary(); + + if (ResourceFileMayExist(resourceFileExistsLookup, cacheKey)) + { + //File is not in lookup or its value is true so we know it exists + Dictionary dicResources = GetResourceFile(cacheKey); + if (dicResources != null) + { + bFound = dicResources.TryGetValue(key, out resourceValue); + } + } + + return bFound; + } + } +} diff --git a/DNN Platform/Library/Services/Log/EventLog/DBLoggingProvider.cs b/DNN Platform/Library/Services/Log/EventLog/DBLoggingProvider.cs index b9b2dd4a845..58f54cec58d 100644 --- a/DNN Platform/Library/Services/Log/EventLog/DBLoggingProvider.cs +++ b/DNN Platform/Library/Services/Log/EventLog/DBLoggingProvider.cs @@ -61,7 +61,7 @@ private static Hashtable FillLogTypeConfigInfoByKey(ArrayList arr) private LogTypeConfigInfo GetLogTypeConfigInfoByKey(string logTypeKey, string logTypePortalID) { - var configInfoByKey = (Hashtable)DataCache.GetCache(LogTypeInfoByKeyCacheKey) ?? FillLogTypeConfigInfoByKey(GetLogTypeConfigInfo()); + var configInfoByKey = (Hashtable)DataCache.GetCache(LogTypeInfoByKeyCacheKey) ?? FillLogTypeConfigInfoByKey(this.GetLogTypeConfigInfo()); var logTypeConfigInfo = (LogTypeConfigInfo) configInfoByKey[logTypeKey + "|" + logTypePortalID]; if (logTypeConfigInfo == null) { @@ -239,7 +239,7 @@ public override void AddLog(LogInfo logInfo) string configPortalID = logInfo.LogPortalID != Null.NullInteger ? logInfo.LogPortalID.ToString() : "*"; - var logTypeConfigInfo = GetLogTypeConfigInfoByKey(logInfo.LogTypeKey, configPortalID); + var logTypeConfigInfo = this.GetLogTypeConfigInfoByKey(logInfo.LogTypeKey, configPortalID); if (logTypeConfigInfo == null || logTypeConfigInfo.LoggingIsActive == false) { return; @@ -406,7 +406,7 @@ public override bool LoggingIsEnabled(string logType, int portalID) { configPortalID = "*"; } - LogTypeConfigInfo configInfo = GetLogTypeConfigInfoByKey(logType, configPortalID); + LogTypeConfigInfo configInfo = this.GetLogTypeConfigInfoByKey(logType, configPortalID); if (configInfo == null) { return false; diff --git a/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs b/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs index d19ca7715ed..f1642c85a4d 100644 --- a/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/EventLogController.cs @@ -196,12 +196,12 @@ protected override Func GetFactory() public void AddLog(string propertyName, string propertyValue, EventLogType logType) { - AddLog(propertyName, propertyValue, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, logType); + this.AddLog(propertyName, propertyValue, PortalController.Instance.GetCurrentPortalSettings(), UserController.Instance.GetCurrentUserInfo().UserID, logType); } public void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, EventLogType logType) { - AddLog(propertyName, propertyValue, portalSettings, userID, logType.ToString()); + this.AddLog(propertyName, propertyValue, portalSettings, userID, logType.ToString()); } public void AddLog(string propertyName, string propertyValue, PortalSettings portalSettings, int userID, string logType) @@ -209,7 +209,7 @@ public void AddLog(string propertyName, string propertyValue, PortalSettings por var properties = new LogProperties(); var logDetailInfo = new LogDetailInfo {PropertyName = propertyName, PropertyValue = propertyValue}; properties.Add(logDetailInfo); - AddLog(properties, portalSettings, userID, logType, false); + this.AddLog(properties, portalSettings, userID, logType, false); } public void AddLog(LogProperties properties, PortalSettings portalSettings, int userID, string logTypeKey, bool bypassBuffering) @@ -232,12 +232,12 @@ public void AddLog(LogProperties properties, PortalSettings portalSettings, int public void AddLog(PortalSettings portalSettings, int userID, EventLogType logType) { - AddLog(new LogProperties(), portalSettings, userID, logType.ToString(), false); + this.AddLog(new LogProperties(), portalSettings, userID, logType.ToString(), false); } public void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, EventLogType logType) { - AddLog(businessObject, portalSettings, userID, userName, logType.ToString()); + this.AddLog(businessObject, portalSettings, userID, userName, logType.ToString()); } public void AddLog(object businessObject, PortalSettings portalSettings, int userID, string userName, string logType) diff --git a/DNN Platform/Library/Services/Log/EventLog/ExceptionLogController.cs b/DNN Platform/Library/Services/Log/EventLog/ExceptionLogController.cs index 24026de516f..f6ae4416993 100644 --- a/DNN Platform/Library/Services/Log/EventLog/ExceptionLogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/ExceptionLogController.cs @@ -35,7 +35,7 @@ public enum ExceptionLogType public void AddLog(Exception objException) { - AddLog(objException, ExceptionLogType.GENERAL_EXCEPTION); + this.AddLog(objException, ExceptionLogType.GENERAL_EXCEPTION); } public void AddLog(BasePortalException objBasePortalException) @@ -53,34 +53,34 @@ public void AddLog(BasePortalException objBasePortalException) log.Exception.UserAgent = objBasePortalException.UserAgent; if (objBasePortalException.GetType().Name == "ModuleLoadException") { - AddLog(objBasePortalException, log, ExceptionLogType.MODULE_LOAD_EXCEPTION); + this.AddLog(objBasePortalException, log, ExceptionLogType.MODULE_LOAD_EXCEPTION); } else if (objBasePortalException.GetType().Name == "PageLoadException") { - AddLog(objBasePortalException, log, ExceptionLogType.PAGE_LOAD_EXCEPTION); + this.AddLog(objBasePortalException, log, ExceptionLogType.PAGE_LOAD_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SchedulerException") { - AddLog(objBasePortalException, log, ExceptionLogType.SCHEDULER_EXCEPTION); + this.AddLog(objBasePortalException, log, ExceptionLogType.SCHEDULER_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SecurityException") { - AddLog(objBasePortalException, log, ExceptionLogType.SECURITY_EXCEPTION); + this.AddLog(objBasePortalException, log, ExceptionLogType.SECURITY_EXCEPTION); } else if (objBasePortalException.GetType().Name == "SearchException") { - AddLog(objBasePortalException, log, ExceptionLogType.SEARCH_INDEXER_EXCEPTION); + this.AddLog(objBasePortalException, log, ExceptionLogType.SEARCH_INDEXER_EXCEPTION); } else { - AddLog(objBasePortalException, log, ExceptionLogType.GENERAL_EXCEPTION); + this.AddLog(objBasePortalException, log, ExceptionLogType.GENERAL_EXCEPTION); } } public void AddLog(Exception objException, ExceptionLogType logType) { var log = new LogInfo { Exception = new ExceptionInfo(objException) }; - AddLog(objException, log, logType); + this.AddLog(objException, log, logType); } public void AddLog(Exception objException, LogInfo log, ExceptionLogType logType) diff --git a/DNN Platform/Library/Services/Log/EventLog/LogController.cs b/DNN Platform/Library/Services/Log/EventLog/LogController.cs index ad1e475027f..b8be4c77e28 100644 --- a/DNN Platform/Library/Services/Log/EventLog/LogController.cs +++ b/DNN Platform/Library/Services/Log/EventLog/LogController.cs @@ -191,7 +191,7 @@ public void AddLog(LogInfo logInfo) } //Check if Log Type exists - if (!GetLogTypeInfoDictionary().ContainsKey(logInfo.LogTypeKey)) + if (!this.GetLogTypeInfoDictionary().ContainsKey(logInfo.LogTypeKey)) { //Add new Log Type var logType = new LogTypeInfo() @@ -202,7 +202,7 @@ public void AddLog(LogInfo logInfo) LogTypeCSSClass = "GeneralAdminOperation", LogTypeDescription = string.Empty }; - AddLogType(logType); + this.AddLogType(logType); var logTypeConfigInfo = new LogTypeConfigInfo() { @@ -217,7 +217,7 @@ public void AddLog(LogInfo logInfo) MailFromAddress = String.Empty, MailToAddress = String.Empty }; - AddLogTypeConfigInfo(logTypeConfigInfo); + this.AddLogTypeConfigInfo(logTypeConfigInfo); } if (LoggingProvider.Instance() != null) @@ -273,7 +273,7 @@ public void AddLogType(string configFile, string fallbackConfigFile) LogTypeCSSClass = typeInfo.Attributes["LogTypeCSSClass"].Value, LogTypeOwner = typeInfo.Attributes["LogTypeOwner"].Value }; - AddLogType(objLogTypeInfo); + this.AddLogType(objLogTypeInfo); } } } @@ -300,7 +300,7 @@ public void AddLogType(string configFile, string fallbackConfigFile) (LogTypeConfigInfo.NotificationThresholdTimeTypes) Enum.Parse(typeof(LogTypeConfigInfo.NotificationThresholdTimeTypes), typeConfigInfo.Attributes["NotificationThresholdTimeType"].Value) }; - AddLogTypeConfigInfo(logTypeConfigInfo); + this.AddLogTypeConfigInfo(logTypeConfigInfo); } } } diff --git a/DNN Platform/Library/Services/Log/EventLog/LogDetailInfo.cs b/DNN Platform/Library/Services/Log/EventLog/LogDetailInfo.cs index f1a07d43e16..e9c82cff77e 100644 --- a/DNN Platform/Library/Services/Log/EventLog/LogDetailInfo.cs +++ b/DNN Platform/Library/Services/Log/EventLog/LogDetailInfo.cs @@ -24,19 +24,19 @@ public LogDetailInfo() : this("", "") public LogDetailInfo(string name, string value) { - _PropertyName = name; - _PropertyValue = value; + this._PropertyName = name; + this._PropertyValue = value; } public string PropertyName { get { - return _PropertyName; + return this._PropertyName; } set { - _PropertyName = value; + this._PropertyName = value; } } @@ -44,23 +44,23 @@ public string PropertyValue { get { - return _PropertyValue; + return this._PropertyValue; } set { - _PropertyValue = value; + this._PropertyValue = value; } } public void ReadXml(XmlReader reader) { reader.ReadStartElement("PropertyName"); - PropertyName = reader.ReadString(); + this.PropertyName = reader.ReadString(); reader.ReadEndElement(); if (!reader.IsEmptyElement) { reader.ReadStartElement("PropertyValue"); - PropertyValue = reader.ReadString(); + this.PropertyValue = reader.ReadString(); reader.ReadEndElement(); } else @@ -73,9 +73,9 @@ public override string ToString() { var sb = new StringBuilder(); sb.Append("

    "); - sb.Append(PropertyName); + sb.Append(this.PropertyName); sb.Append(": "); - sb.Append(PropertyValue); + sb.Append(this.PropertyValue); sb.Append("

    "); return sb.ToString(); } @@ -83,8 +83,8 @@ public override string ToString() public void WriteXml(XmlWriter writer) { writer.WriteStartElement("LogProperty"); - writer.WriteElementString("PropertyName", PropertyName); - writer.WriteElementString("PropertyValue", PropertyValue); + writer.WriteElementString("PropertyName", this.PropertyName); + writer.WriteElementString("PropertyValue", this.PropertyValue); writer.WriteEndElement(); } } diff --git a/DNN Platform/Library/Services/Log/EventLog/LogInfo.cs b/DNN Platform/Library/Services/Log/EventLog/LogInfo.cs index ee083bf8371..25df028cf23 100644 --- a/DNN Platform/Library/Services/Log/EventLog/LogInfo.cs +++ b/DNN Platform/Library/Services/Log/EventLog/LogInfo.cs @@ -21,20 +21,20 @@ public class LogInfo public LogInfo() { - LogGUID = Guid.NewGuid().ToString(); - BypassBuffering = false; - LogProperties = new LogProperties(); - LogPortalID = -1; - LogPortalName = ""; - LogUserID = -1; - LogEventID = -1; - LogUserName = ""; - Exception = new ExceptionInfo(); + this.LogGUID = Guid.NewGuid().ToString(); + this.BypassBuffering = false; + this.LogProperties = new LogProperties(); + this.LogPortalID = -1; + this.LogPortalName = ""; + this.LogUserID = -1; + this.LogEventID = -1; + this.LogUserName = ""; + this.Exception = new ExceptionInfo(); } public LogInfo(string content) : this() { - Deserialize(content); + this.Deserialize(content); } #endregion @@ -94,7 +94,7 @@ public void AddProperty(string PropertyName, string PropertyValue) var objLogDetailInfo = new LogDetailInfo(); objLogDetailInfo.PropertyName = PropertyName; objLogDetailInfo.PropertyValue = PropertyValue; - LogProperties.Add(objLogDetailInfo); + this.LogProperties.Add(objLogDetailInfo); } catch (Exception exc) { @@ -108,7 +108,7 @@ public void Deserialize(string content) { if (reader.Read()) { - ReadXml(reader); + this.ReadXml(reader); } reader.Close(); } @@ -123,43 +123,43 @@ public void ReadXml(XmlReader reader) switch (reader.Name) { case "LogGUID": - LogGUID = reader.ReadContentAsString(); + this.LogGUID = reader.ReadContentAsString(); break; case "LogFileID": - LogFileID = reader.ReadContentAsString(); + this.LogFileID = reader.ReadContentAsString(); break; case "LogTypeKey": - LogTypeKey = reader.ReadContentAsString(); + this.LogTypeKey = reader.ReadContentAsString(); break; case "LogUserID": - LogUserID = reader.ReadContentAsInt(); + this.LogUserID = reader.ReadContentAsInt(); break; case "LogEventID": - LogEventID = reader.ReadContentAsInt(); + this.LogEventID = reader.ReadContentAsInt(); break; case "LogUserName": - LogUserName = reader.ReadContentAsString(); + this.LogUserName = reader.ReadContentAsString(); break; case "LogPortalID": - LogPortalID = reader.ReadContentAsInt(); + this.LogPortalID = reader.ReadContentAsInt(); break; case "LogPortalName": - LogPortalName = reader.ReadContentAsString(); + this.LogPortalName = reader.ReadContentAsString(); break; case "LogCreateDate": - LogCreateDate = DateTime.Parse(reader.ReadContentAsString()); + this.LogCreateDate = DateTime.Parse(reader.ReadContentAsString()); break; case "LogCreateDateNum": - LogCreateDateNum = reader.ReadContentAsLong(); + this.LogCreateDateNum = reader.ReadContentAsLong(); break; case "BypassBuffering": - BypassBuffering = bool.Parse(reader.ReadContentAsString()); + this.BypassBuffering = bool.Parse(reader.ReadContentAsString()); break; case "LogServerName": - LogServerName = reader.ReadContentAsString(); + this.LogServerName = reader.ReadContentAsString(); break; case "LogConfigID": - LogConfigID = reader.ReadContentAsString(); + this.LogConfigID = reader.ReadContentAsString(); break; } } @@ -172,13 +172,13 @@ public void ReadXml(XmlReader reader) reader.ReadStartElement("LogProperties"); if (reader.ReadState != ReadState.EndOfFile && reader.NodeType != XmlNodeType.None && !String.IsNullOrEmpty(reader.LocalName)) { - LogProperties.ReadXml(reader); + this.LogProperties.ReadXml(reader); } } //Check for Exception child node if (reader.NodeType == XmlNodeType.Element && reader.LocalName == "Exception") { - Exception.ReadXml(reader); + this.Exception.ReadXml(reader); } } @@ -210,7 +210,7 @@ public string Serialize() var sb = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(sb, settings)) { - WriteXml(writer); + this.WriteXml(writer); writer.Close(); return sb.ToString(); } @@ -219,19 +219,19 @@ public string Serialize() public override string ToString() { var str = new StringBuilder(); - str.Append("

    LogGUID:" + LogGUID + "

    "); - str.Append("

    LogType:" + LogTypeKey + "

    "); - str.Append("

    UserID:" + LogUserID + "

    "); - str.Append("

    EventID:" + LogEventID + "

    "); - str.Append("

    Username:" + LogUserName + "

    "); - str.Append("

    PortalID:" + LogPortalID + "

    "); - str.Append("

    PortalName:" + LogPortalName + "

    "); - str.Append("

    CreateDate:" + LogCreateDate + "

    "); - str.Append("

    ServerName:" + LogServerName + "

    "); - str.Append(LogProperties.ToString()); - if (!string.IsNullOrEmpty(Exception.ExceptionHash)) + str.Append("

    LogGUID:" + this.LogGUID + "

    "); + str.Append("

    LogType:" + this.LogTypeKey + "

    "); + str.Append("

    UserID:" + this.LogUserID + "

    "); + str.Append("

    EventID:" + this.LogEventID + "

    "); + str.Append("

    Username:" + this.LogUserName + "

    "); + str.Append("

    PortalID:" + this.LogPortalID + "

    "); + str.Append("

    PortalName:" + this.LogPortalName + "

    "); + str.Append("

    CreateDate:" + this.LogCreateDate + "

    "); + str.Append("

    ServerName:" + this.LogServerName + "

    "); + str.Append(this.LogProperties.ToString()); + if (!string.IsNullOrEmpty(this.Exception.ExceptionHash)) { - str.Append(Exception.ToString()); + str.Append(this.Exception.ToString()); } return str.ToString(); } @@ -239,23 +239,23 @@ public override string ToString() public void WriteXml(XmlWriter writer) { writer.WriteStartElement("log"); - writer.WriteAttributeString("LogGUID", LogGUID); - writer.WriteAttributeString("LogFileID", LogFileID); - writer.WriteAttributeString("LogTypeKey", LogTypeKey); - writer.WriteAttributeString("LogUserID", LogUserID.ToString()); - writer.WriteAttributeString("LogEventID", LogEventID.ToString()); - writer.WriteAttributeString("LogUserName", LogUserName); - writer.WriteAttributeString("LogPortalID", LogPortalID.ToString()); - writer.WriteAttributeString("LogPortalName", LogPortalName); - writer.WriteAttributeString("LogCreateDate", LogCreateDate.ToString()); - writer.WriteAttributeString("LogCreateDateNum", LogCreateDateNum.ToString()); - writer.WriteAttributeString("BypassBuffering", BypassBuffering.ToString()); - writer.WriteAttributeString("LogServerName", LogServerName); - writer.WriteAttributeString("LogConfigID", LogConfigID); - LogProperties.WriteXml(writer); - if (!string.IsNullOrEmpty(Exception.ExceptionHash)) + writer.WriteAttributeString("LogGUID", this.LogGUID); + writer.WriteAttributeString("LogFileID", this.LogFileID); + writer.WriteAttributeString("LogTypeKey", this.LogTypeKey); + writer.WriteAttributeString("LogUserID", this.LogUserID.ToString()); + writer.WriteAttributeString("LogEventID", this.LogEventID.ToString()); + writer.WriteAttributeString("LogUserName", this.LogUserName); + writer.WriteAttributeString("LogPortalID", this.LogPortalID.ToString()); + writer.WriteAttributeString("LogPortalName", this.LogPortalName); + writer.WriteAttributeString("LogCreateDate", this.LogCreateDate.ToString()); + writer.WriteAttributeString("LogCreateDateNum", this.LogCreateDateNum.ToString()); + writer.WriteAttributeString("BypassBuffering", this.BypassBuffering.ToString()); + writer.WriteAttributeString("LogServerName", this.LogServerName); + writer.WriteAttributeString("LogConfigID", this.LogConfigID); + this.LogProperties.WriteXml(writer); + if (!string.IsNullOrEmpty(this.Exception.ExceptionHash)) { - Exception.WriteXml(writer); + this.Exception.WriteXml(writer); } writer.WriteEndElement(); } diff --git a/DNN Platform/Library/Services/Log/EventLog/LogProperties.cs b/DNN Platform/Library/Services/Log/EventLog/LogProperties.cs index e768ecf0c29..10e1b9f2453 100644 --- a/DNN Platform/Library/Services/Log/EventLog/LogProperties.cs +++ b/DNN Platform/Library/Services/Log/EventLog/LogProperties.cs @@ -24,7 +24,7 @@ public string Summary { get { - string summary = HtmlUtils.Clean(ToString(), true); + string summary = HtmlUtils.Clean(this.ToString(), true); if (summary.Length > 75) { summary = summary.Substring(0, 75); @@ -44,7 +44,7 @@ public void Deserialize(string content) reader.ReadStartElement("LogProperties"); if (reader.ReadState != ReadState.EndOfFile && reader.NodeType != XmlNodeType.None && !String.IsNullOrEmpty(reader.LocalName)) { - ReadXml(reader); + this.ReadXml(reader); } reader.Close(); } @@ -63,7 +63,7 @@ public void ReadXml(XmlReader reader) logDetail.ReadXml(reader); //Add to the collection - Add(logDetail); + this.Add(logDetail); } while (reader.ReadToNextSibling("LogProperty")); } @@ -76,7 +76,7 @@ public string Serialize() var sb = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(sb, settings)) { - WriteXml(writer); + this.WriteXml(writer); writer.Close(); return sb.ToString(); } diff --git a/DNN Platform/Library/Services/Log/EventLog/LogTypeConfigInfo.cs b/DNN Platform/Library/Services/Log/EventLog/LogTypeConfigInfo.cs index 47ad767414d..2e4c0391d60 100644 --- a/DNN Platform/Library/Services/Log/EventLog/LogTypeConfigInfo.cs +++ b/DNN Platform/Library/Services/Log/EventLog/LogTypeConfigInfo.cs @@ -35,16 +35,16 @@ public DateTime StartDateTime { get { - switch (NotificationThresholdTimeType) + switch (this.NotificationThresholdTimeType) { case NotificationThresholdTimeTypes.Seconds: - return DateTime.Now.AddSeconds(NotificationThresholdTime*-1); + return DateTime.Now.AddSeconds(this.NotificationThresholdTime*-1); case NotificationThresholdTimeTypes.Minutes: - return DateTime.Now.AddMinutes(NotificationThresholdTime*-1); + return DateTime.Now.AddMinutes(this.NotificationThresholdTime*-1); case NotificationThresholdTimeTypes.Hours: - return DateTime.Now.AddHours(NotificationThresholdTime*-1); + return DateTime.Now.AddHours(this.NotificationThresholdTime*-1); case NotificationThresholdTimeTypes.Days: - return DateTime.Now.AddDays(NotificationThresholdTime*-1); + return DateTime.Now.AddDays(this.NotificationThresholdTime*-1); default: return Null.NullDate; } @@ -58,10 +58,10 @@ public string MailFromAddress get { var portalSettings = Globals.GetPortalSettings(); return - string.IsNullOrWhiteSpace(_mailFromAddress) + string.IsNullOrWhiteSpace(this._mailFromAddress) ? (portalSettings == null ? string.Empty : portalSettings.Email) - : _mailFromAddress; } - set { _mailFromAddress = value; } + : this._mailFromAddress; } + set { this._mailFromAddress = value; } } diff --git a/DNN Platform/Library/Services/Log/EventLog/PurgeLogBuffer.cs b/DNN Platform/Library/Services/Log/EventLog/PurgeLogBuffer.cs index a0bb4321905..d0c7d2e9d31 100644 --- a/DNN Platform/Library/Services/Log/EventLog/PurgeLogBuffer.cs +++ b/DNN Platform/Library/Services/Log/EventLog/PurgeLogBuffer.cs @@ -16,7 +16,7 @@ public class PurgeLogBuffer : SchedulerClient { public PurgeLogBuffer(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } public override void DoWork() @@ -24,16 +24,16 @@ public override void DoWork() try { //notification that the event is progressing - Progressing(); //OPTIONAL + this.Progressing(); //OPTIONAL LoggingProvider.Instance().PurgeLogBuffer(); - ScheduleHistoryItem.Succeeded = true; //REQUIRED - ScheduleHistoryItem.AddLogNote("Purged log entries successfully"); //OPTIONAL + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("Purged log entries successfully"); //OPTIONAL } catch (Exception exc) //REQUIRED { - ScheduleHistoryItem.Succeeded = false; //REQUIRED - ScheduleHistoryItem.AddLogNote("EXCEPTION: " + exc); //OPTIONAL - Errored(ref exc); //REQUIRED + this.ScheduleHistoryItem.Succeeded = false; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("EXCEPTION: " + exc); //OPTIONAL + this.Errored(ref exc); //REQUIRED //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL } diff --git a/DNN Platform/Library/Services/Log/EventLog/SendLogNotifications.cs b/DNN Platform/Library/Services/Log/EventLog/SendLogNotifications.cs index e7350106c34..21a5ec10043 100644 --- a/DNN Platform/Library/Services/Log/EventLog/SendLogNotifications.cs +++ b/DNN Platform/Library/Services/Log/EventLog/SendLogNotifications.cs @@ -16,7 +16,7 @@ public class SendLogNotifications : SchedulerClient { public SendLogNotifications(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } public override void DoWork() @@ -24,16 +24,16 @@ public override void DoWork() try { //notification that the event is progressing - Progressing(); //OPTIONAL + this.Progressing(); //OPTIONAL LoggingProvider.Instance().SendLogNotifications(); - ScheduleHistoryItem.Succeeded = true; //REQUIRED - ScheduleHistoryItem.AddLogNote("Sent log notifications successfully"); //OPTIONAL + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("Sent log notifications successfully"); //OPTIONAL } catch (Exception exc) //REQUIRED { - ScheduleHistoryItem.Succeeded = false; //REQUIRED - ScheduleHistoryItem.AddLogNote("EXCEPTION: " + exc); //OPTIONAL - Errored(ref exc); //REQUIRED + this.ScheduleHistoryItem.Succeeded = false; //REQUIRED + this.ScheduleHistoryItem.AddLogNote("EXCEPTION: " + exc); //OPTIONAL + this.Errored(ref exc); //REQUIRED //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL } diff --git a/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs b/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs index 3a36e0d8eae..433bc21b7d8 100644 --- a/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs +++ b/DNN Platform/Library/Services/Mail/SendTokenizedBulkEmail.cs @@ -89,27 +89,27 @@ public enum AddressMethods public SendTokenizedBulkEmail() { - ReportRecipients = true; - AddressMethod = AddressMethods.Send_TO; - BodyFormat = MailFormat.Text; - Subject = ""; - Priority = MailPriority.Normal; - Initialize(); + this.ReportRecipients = true; + this.AddressMethod = AddressMethods.Send_TO; + this.BodyFormat = MailFormat.Text; + this.Subject = ""; + this.Priority = MailPriority.Normal; + this.Initialize(); } public SendTokenizedBulkEmail(List addressedRoles, List addressedUsers, bool removeDuplicates, string subject, string body) { - ReportRecipients = true; - AddressMethod = AddressMethods.Send_TO; - BodyFormat = MailFormat.Text; - Priority = MailPriority.Normal; - _addressedRoles = addressedRoles; - _addressedUsers = addressedUsers; - RemoveDuplicates = removeDuplicates; - Subject = subject; - Body = body; - SuppressTokenReplace = SuppressTokenReplace; - Initialize(); + this.ReportRecipients = true; + this.AddressMethod = AddressMethods.Send_TO; + this.BodyFormat = MailFormat.Text; + this.Priority = MailPriority.Normal; + this._addressedRoles = addressedRoles; + this._addressedUsers = addressedUsers; + this.RemoveDuplicates = removeDuplicates; + this.Subject = subject; + this.Body = body; + this.SuppressTokenReplace = this.SuppressTokenReplace; + this.Initialize(); } #endregion @@ -135,12 +135,12 @@ public string Body { get { - return _body; + return this._body; } set { - _body = value; - BodyFormat = HtmlUtils.IsHtml(_body) ? MailFormat.Html : MailFormat.Text; + this._body = value; + this.BodyFormat = HtmlUtils.IsHtml(this._body) ? MailFormat.Html : MailFormat.Text; } } @@ -161,19 +161,19 @@ public UserInfo SendingUser { get { - return _sendingUser; + return this._sendingUser; } set { - _sendingUser = value; - if (_sendingUser.Profile.PreferredLocale != null) + this._sendingUser = value; + if (this._sendingUser.Profile.PreferredLocale != null) { - _strSenderLanguage = _sendingUser.Profile.PreferredLocale; + this._strSenderLanguage = this._sendingUser.Profile.PreferredLocale; } else { PortalSettings portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - _strSenderLanguage = portalSettings.DefaultLanguage; + this._strSenderLanguage = portalSettings.DefaultLanguage; } } } @@ -184,11 +184,11 @@ public UserInfo ReplyTo { get { - return _replyToUser ?? SendingUser; + return this._replyToUser ?? this.SendingUser; } set { - _replyToUser = value; + this._replyToUser = value; } } @@ -208,11 +208,11 @@ public string RelayEmailAddress { get { - return AddressMethod == AddressMethods.Send_Relay ? _relayEmail : string.Empty; + return this.AddressMethod == AddressMethods.Send_Relay ? this._relayEmail : string.Empty; } set { - _relayEmail = value; + this._relayEmail = value; } } @@ -225,15 +225,15 @@ public string RelayEmailAddress /// internal method to initialize used objects, depending on parameters of construct method private void Initialize() { - _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - PortalAlias = _portalSettings.PortalAlias.HTTPAlias; - SendingUser = (UserInfo) HttpContext.Current.Items["UserInfo"]; - _tokenReplace = new TokenReplace(); - _confirmBodyHTML = Localization.Localization.GetString("EMAIL_BulkMailConf_Html_Body", Localization.Localization.GlobalResourceFile, _strSenderLanguage); - _confirmBodyText = Localization.Localization.GetString("EMAIL_BulkMailConf_Text_Body", Localization.Localization.GlobalResourceFile, _strSenderLanguage); - _confirmSubject = Localization.Localization.GetString("EMAIL_BulkMailConf_Subject", Localization.Localization.GlobalResourceFile, _strSenderLanguage); - _noError = Localization.Localization.GetString("NoErrorsSending", Localization.Localization.GlobalResourceFile, _strSenderLanguage); - _smtpEnableSSL = Host.EnableSMTPSSL; + this._portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + this.PortalAlias = this._portalSettings.PortalAlias.HTTPAlias; + this.SendingUser = (UserInfo) HttpContext.Current.Items["UserInfo"]; + this._tokenReplace = new TokenReplace(); + this._confirmBodyHTML = Localization.Localization.GetString("EMAIL_BulkMailConf_Html_Body", Localization.Localization.GlobalResourceFile, this._strSenderLanguage); + this._confirmBodyText = Localization.Localization.GetString("EMAIL_BulkMailConf_Text_Body", Localization.Localization.GlobalResourceFile, this._strSenderLanguage); + this._confirmSubject = Localization.Localization.GetString("EMAIL_BulkMailConf_Subject", Localization.Localization.GlobalResourceFile, this._strSenderLanguage); + this._noError = Localization.Localization.GetString("NoErrorsSending", Localization.Localization.GlobalResourceFile, this._strSenderLanguage); + this._smtpEnableSSL = Host.EnableSMTPSSL; } /// Send bulkmail confirmation to admin @@ -265,19 +265,19 @@ private void SendConfirmationMail(int numRecipients, int numMessages, int numErr numMessages >= 0 ? numMessages.ToString(CultureInfo.InvariantCulture) : "***", DateTime.Now.ToString(CultureInfo.InvariantCulture), numErrors > 0 ? numErrors.ToString(CultureInfo.InvariantCulture) : "", - mailErrors != string.Empty ? mailErrors : _noError, - ReportRecipients ? recipientList : "" + mailErrors != string.Empty ? mailErrors : this._noError, + this.ReportRecipients ? recipientList : "" }; - _tokenReplace.User = _sendingUser; - string body = _tokenReplace.ReplaceEnvironmentTokens(BodyFormat == MailFormat.Html ? _confirmBodyHTML : _confirmBodyText, parameters, "Custom"); - string strSubject = string.Format(_confirmSubject, subject); - if (!SuppressTokenReplace) + this._tokenReplace.User = this._sendingUser; + string body = this._tokenReplace.ReplaceEnvironmentTokens(this.BodyFormat == MailFormat.Html ? this._confirmBodyHTML : this._confirmBodyText, parameters, "Custom"); + string strSubject = string.Format(this._confirmSubject, subject); + if (!this.SuppressTokenReplace) { - strSubject = _tokenReplace.ReplaceEnvironmentTokens(strSubject); + strSubject = this._tokenReplace.ReplaceEnvironmentTokens(strSubject); } - var message = new Message {FromUserID = _sendingUser.UserID, ToUserID = _sendingUser.UserID, Subject = strSubject, Body = body, Status = MessageStatusType.Unread}; + var message = new Message {FromUserID = this._sendingUser.UserID, ToUserID = this._sendingUser.UserID, Subject = strSubject, Body = body, Status = MessageStatusType.Unread}; - Mail.SendEmail(_sendingUser.Email, _sendingUser.Email, message.Subject, message.Body); + Mail.SendEmail(this._sendingUser.Email, this._sendingUser.Email, message.Subject, message.Body); } /// check, if the user's language matches the current language filter @@ -286,17 +286,17 @@ private void SendConfirmationMail(int numRecipients, int numMessages, int numErr /// if filter not set, true is returned private bool MatchLanguageFilter(string userLanguage) { - if (LanguageFilter == null || LanguageFilter.Length == 0) + if (this.LanguageFilter == null || this.LanguageFilter.Length == 0) { return true; } if(string.IsNullOrEmpty(userLanguage)) { - userLanguage = _portalSettings.DefaultLanguage; + userLanguage = this._portalSettings.DefaultLanguage; } - return LanguageFilter.Any(s => userLanguage.StartsWith(s, StringComparison.InvariantCultureIgnoreCase)); + return this.LanguageFilter.Any(s => userLanguage.StartsWith(s, StringComparison.InvariantCultureIgnoreCase)); } /// add a user to the userlist, if it is not already in there @@ -306,10 +306,10 @@ private bool MatchLanguageFilter(string userLanguage) /// for use by Recipients method only private void ConditionallyAddUser(UserInfo user, ref List keyList, ref List userList) { - if (((user.UserID <= 0 || user.Membership.Approved) && user.Email != string.Empty) && MatchLanguageFilter(user.Profile.PreferredLocale)) + if (((user.UserID <= 0 || user.Membership.Approved) && user.Email != string.Empty) && this.MatchLanguageFilter(user.Profile.PreferredLocale)) { string key; - if (RemoveDuplicates || user.UserID == Null.NullInteger) + if (this.RemoveDuplicates || user.UserID == Null.NullInteger) { key = user.Email; } @@ -328,7 +328,7 @@ private void ConditionallyAddUser(UserInfo user, ref List keyList, ref L private List LoadAttachments() { var attachments = new List(); - foreach (var attachment in _attachments) + foreach (var attachment in this._attachments) { Attachment newAttachment; MemoryStream memoryStream = null; @@ -374,13 +374,13 @@ private List LoadAttachments() /// if not called, values will be taken from host settings public bool SetSMTPServer(string smtpServer, string smtpAuthentication, string smtpUsername, string smtpPassword, bool smtpEnableSSL) { - EnsureNotDisposed(); + this.EnsureNotDisposed(); - _smtpServer = smtpServer; - _smtpAuthenticationMethod = smtpAuthentication; - _smtpUsername = smtpUsername; - _smtpPassword = smtpPassword; - _smtpEnableSSL = smtpEnableSSL; + this._smtpServer = smtpServer; + this._smtpAuthenticationMethod = smtpAuthentication; + this._smtpUsername = smtpUsername; + this._smtpPassword = smtpPassword; + this._smtpEnableSSL = smtpEnableSSL; return true; } @@ -389,14 +389,14 @@ public bool SetSMTPServer(string smtpServer, string smtpAuthentication, string s /// only local stored files can be added with a path public void AddAttachment(string localPath) { - EnsureNotDisposed(); - _attachments.Add(new Attachment(localPath)); + this.EnsureNotDisposed(); + this._attachments.Add(new Attachment(localPath)); } public void AddAttachment(Stream contentStream, ContentType contentType) { - EnsureNotDisposed(); - _attachments.Add(new Attachment(contentStream, contentType)); + this.EnsureNotDisposed(); + this._attachments.Add(new Attachment(contentStream, contentType)); } /// Add a single recipient @@ -404,8 +404,8 @@ public void AddAttachment(Stream contentStream, ContentType contentType) /// emaiol will be used for addressing, other properties might be used for TokenReplace public void AddAddressedUser(UserInfo recipient) { - EnsureNotDisposed(); - _addressedUsers.Add(recipient); + this.EnsureNotDisposed(); + this._addressedUsers.Add(recipient); } /// Add all members of a role to recipient list @@ -413,8 +413,8 @@ public void AddAddressedUser(UserInfo recipient) /// emaiol will be used for addressing, other properties might be used for TokenReplace public void AddAddressedRole(string roleName) { - EnsureNotDisposed(); - _addressedRoles.Add(roleName); + this.EnsureNotDisposed(); + this._addressedRoles.Add(roleName); } /// All bulk mail recipients, derived from role names and individual adressees @@ -422,32 +422,32 @@ public void AddAddressedRole(string roleName) /// user.Email used for sending, other properties might be used for TokenReplace public List Recipients() { - EnsureNotDisposed(); + this.EnsureNotDisposed(); var userList = new List(); var keyList = new List(); - foreach (string roleName in _addressedRoles) + foreach (string roleName in this._addressedRoles) { string role = roleName; - var roleInfo = RoleController.Instance.GetRole(_portalSettings.PortalId, r => r.RoleName == role); + var roleInfo = RoleController.Instance.GetRole(this._portalSettings.PortalId, r => r.RoleName == role); - foreach (UserInfo objUser in RoleController.Instance.GetUsersByRole(_portalSettings.PortalId, roleName)) + foreach (UserInfo objUser in RoleController.Instance.GetUsersByRole(this._portalSettings.PortalId, roleName)) { UserInfo user = objUser; ProfileController.GetUserProfile(ref user); - var userRole = RoleController.Instance.GetUserRole(_portalSettings.PortalId, objUser.UserID, roleInfo.RoleID); + var userRole = RoleController.Instance.GetUserRole(this._portalSettings.PortalId, objUser.UserID, roleInfo.RoleID); //only add if user role has not expired and effectivedate has been passed if ((userRole.EffectiveDate <= DateTime.Now || Null.IsNull(userRole.EffectiveDate)) && (userRole.ExpiryDate >= DateTime.Now || Null.IsNull(userRole.ExpiryDate))) { - ConditionallyAddUser(objUser, ref keyList, ref userList); + this.ConditionallyAddUser(objUser, ref keyList, ref userList); } } } - foreach (UserInfo objUser in _addressedUsers) + foreach (UserInfo objUser in this._addressedUsers) { - ConditionallyAddUser(objUser, ref keyList, ref userList); + this.ConditionallyAddUser(objUser, ref keyList, ref userList); } return userList; @@ -458,7 +458,7 @@ public List Recipients() /// Detailed status report is sent by email to sending user public int SendMails() { - EnsureNotDisposed(); + this.EnsureNotDisposed(); int recipients = 0; int messagesSent = 0; @@ -467,74 +467,74 @@ public int SendMails() try { //send to recipients - string body = _body; - if (BodyFormat == MailFormat.Html) //Add Base Href for any images inserted in to the email. + string body = this._body; + if (this.BodyFormat == MailFormat.Html) //Add Base Href for any images inserted in to the email. { - var host = PortalAlias.Contains("/") ? PortalAlias.Substring(0, PortalAlias.IndexOf('/')) : PortalAlias; - body = "" + Subject + "" + body + ""; + var host = this.PortalAlias.Contains("/") ? this.PortalAlias.Substring(0, this.PortalAlias.IndexOf('/')) : this.PortalAlias; + body = "" + this.Subject + "" + body + ""; } - string subject = Subject; + string subject = this.Subject; string startedAt = DateTime.Now.ToString(CultureInfo.InvariantCulture); - bool replaceTokens = !SuppressTokenReplace && (_tokenReplace.ContainsTokens(Subject) || _tokenReplace.ContainsTokens(_body)); + bool replaceTokens = !this.SuppressTokenReplace && (this._tokenReplace.ContainsTokens(this.Subject) || this._tokenReplace.ContainsTokens(this._body)); bool individualSubj = false; bool individualBody = false; var mailErrors = new StringBuilder(); var mailRecipients = new StringBuilder(); - switch (AddressMethod) + switch (this.AddressMethod) { case AddressMethods.Send_TO: case AddressMethods.Send_Relay: //optimization: if (replaceTokens) { - individualBody = (_tokenReplace.Cacheability(_body) == CacheLevel.notCacheable); - individualSubj = (_tokenReplace.Cacheability(Subject) == CacheLevel.notCacheable); + individualBody = (this._tokenReplace.Cacheability(this._body) == CacheLevel.notCacheable); + individualSubj = (this._tokenReplace.Cacheability(this.Subject) == CacheLevel.notCacheable); if (!individualBody) { - body = _tokenReplace.ReplaceEnvironmentTokens(body); + body = this._tokenReplace.ReplaceEnvironmentTokens(body); } if (!individualSubj) { - subject = _tokenReplace.ReplaceEnvironmentTokens(subject); + subject = this._tokenReplace.ReplaceEnvironmentTokens(subject); } } - foreach (UserInfo user in Recipients()) + foreach (UserInfo user in this.Recipients()) { recipients += 1; if (individualBody || individualSubj) { - _tokenReplace.User = user; - _tokenReplace.AccessingUser = user; + this._tokenReplace.User = user; + this._tokenReplace.AccessingUser = user; if (individualBody) { - body = _tokenReplace.ReplaceEnvironmentTokens(_body); + body = this._tokenReplace.ReplaceEnvironmentTokens(this._body); } if (individualSubj) { - subject = _tokenReplace.ReplaceEnvironmentTokens(Subject); + subject = this._tokenReplace.ReplaceEnvironmentTokens(this.Subject); } } - string recipient = AddressMethod == AddressMethods.Send_TO ? user.Email : RelayEmailAddress; + string recipient = this.AddressMethod == AddressMethods.Send_TO ? user.Email : this.RelayEmailAddress; - string mailError = Mail.SendMail(_sendingUser.Email, + string mailError = Mail.SendMail(this._sendingUser.Email, recipient, "", "", - ReplyTo.Email, - Priority, + this.ReplyTo.Email, + this.Priority, subject, - BodyFormat, + this.BodyFormat, Encoding.UTF8, body, - LoadAttachments(), - _smtpServer, - _smtpAuthenticationMethod, - _smtpUsername, - _smtpPassword, - _smtpEnableSSL); + this.LoadAttachments(), + this._smtpServer, + this._smtpAuthenticationMethod, + this._smtpUsername, + this._smtpPassword, + this._smtpEnableSSL); if (!string.IsNullOrEmpty(mailError)) { mailErrors.Append(mailError); @@ -544,7 +544,7 @@ public int SendMails() else { mailRecipients.Append(user.Email); - mailRecipients.Append(BodyFormat == MailFormat.Html ? "
    " : Environment.NewLine); + mailRecipients.Append(this.BodyFormat == MailFormat.Html ? "
    " : Environment.NewLine); messagesSent += 1; } } @@ -553,12 +553,12 @@ public int SendMails() case AddressMethods.Send_BCC: var distributionList = new StringBuilder(); messagesSent = Null.NullInteger; - foreach (UserInfo user in Recipients()) + foreach (UserInfo user in this.Recipients()) { recipients += 1; distributionList.Append(user.Email + "; "); mailRecipients.Append(user.Email); - mailRecipients.Append(BodyFormat == MailFormat.Html ? "
    " : Environment.NewLine); + mailRecipients.Append(this.BodyFormat == MailFormat.Html ? "
    " : Environment.NewLine); } if (distributionList.Length > 2) @@ -567,30 +567,30 @@ public int SendMails() { //no access to User properties possible! var tr = new TokenReplace(Scope.Configuration); - body = tr.ReplaceEnvironmentTokens(_body); - subject = tr.ReplaceEnvironmentTokens(Subject); + body = tr.ReplaceEnvironmentTokens(this._body); + subject = tr.ReplaceEnvironmentTokens(this.Subject); } else { - body = _body; - subject = Subject; + body = this._body; + subject = this.Subject; } - string mailError = Mail.SendMail(_sendingUser.Email, - _sendingUser.Email, + string mailError = Mail.SendMail(this._sendingUser.Email, + this._sendingUser.Email, "", distributionList.ToString(0, distributionList.Length - 2), - ReplyTo.Email, - Priority, + this.ReplyTo.Email, + this.Priority, subject, - BodyFormat, + this.BodyFormat, Encoding.UTF8, body, - LoadAttachments(), - _smtpServer, - _smtpAuthenticationMethod, - _smtpUsername, - _smtpPassword, - _smtpEnableSSL); + this.LoadAttachments(), + this._smtpServer, + this._smtpAuthenticationMethod, + this._smtpUsername, + this._smtpPassword, + this._smtpEnableSSL); if (mailError == string.Empty) { messagesSent = 1; @@ -607,7 +607,7 @@ public int SendMails() { mailRecipients = new StringBuilder(); } - SendConfirmationMail(recipients, messagesSent, errors, subject, startedAt, mailErrors.ToString(), mailRecipients.ToString()); + this.SendConfirmationMail(recipients, messagesSent, errors, subject, startedAt, mailErrors.ToString(), mailRecipients.ToString()); } catch (Exception exc) //send mail failure { @@ -617,7 +617,7 @@ public int SendMails() } finally { - foreach (var attachment in _attachments) + foreach (var attachment in this._attachments) { attachment.Dispose(); } @@ -628,15 +628,15 @@ public int SendMails() /// Wrapper for Function SendMails public void Send() { - EnsureNotDisposed(); - SendMails(); + this.EnsureNotDisposed(); + this.SendMails(); } #endregion private void EnsureNotDisposed() { - if (_isDisposed) + if (this._isDisposed) { throw new ObjectDisposedException("SharedDictionary"); } @@ -644,21 +644,21 @@ private void EnsureNotDisposed() public void Dispose() { - Dispose(true); + this.Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { - if (!_isDisposed) + if (!this._isDisposed) { if (disposing) { //get rid of managed resources - foreach (Attachment attachment in _attachments) + foreach (Attachment attachment in this._attachments) { attachment.Dispose(); - _isDisposed = true; + this._isDisposed = true; } } // get rid of unmanaged resources @@ -667,7 +667,7 @@ protected virtual void Dispose(bool disposing) ~SendTokenizedBulkEmail() { - Dispose(false); + this.Dispose(false); } } } diff --git a/DNN Platform/Library/Services/Messaging/Data/Message.cs b/DNN Platform/Library/Services/Messaging/Data/Message.cs index 8ef1408401a..b02f2653493 100644 --- a/DNN Platform/Library/Services/Messaging/Data/Message.cs +++ b/DNN Platform/Library/Services/Messaging/Data/Message.cs @@ -46,9 +46,9 @@ public class Message : IHydratable public Message() { - Conversation = Guid.Empty; - Status = MessageStatusType.Draft; - MessageDate = DateTime.Now; + this.Conversation = Guid.Empty; + this.Status = MessageStatusType.Draft; + this.MessageDate = DateTime.Now; } #endregion @@ -62,11 +62,11 @@ public string FromUserName { get { - return _FromUserName; + return this._FromUserName; } private set { - _FromUserName = value; + this._FromUserName = value; } } @@ -75,11 +75,11 @@ public int FromUserID { get { - return _FromUserID; + return this._FromUserID; } set { - _FromUserID = value; + this._FromUserID = value; } } @@ -88,11 +88,11 @@ public int ToRoleID { get { - return _ToRoleId; + return this._ToRoleId; } set { - _ToRoleId = value; + this._ToRoleId = value; } } @@ -101,11 +101,11 @@ public bool AllowReply { get { - return _allowReply; + return this._allowReply; } set { - _allowReply = value; + this._allowReply = value; } } @@ -114,11 +114,11 @@ public bool SkipInbox { get { - return _skipInbox; + return this._skipInbox; } set { - _skipInbox = value; + this._skipInbox = value; } } @@ -126,11 +126,11 @@ public bool EmailSent { get { - return _EmailSent; + return this._EmailSent; } set { - _EmailSent = value; + this._EmailSent = value; } } @@ -139,11 +139,11 @@ public string Body { get { - return _Body; + return this._Body; } set { - _Body = value; + this._Body = value; } } @@ -151,11 +151,11 @@ public DateTime MessageDate { get { - return _MessageDate; + return this._MessageDate; } set { - _MessageDate = value; + this._MessageDate = value; } } @@ -163,11 +163,11 @@ public Guid Conversation { get { - return _Conversation; + return this._Conversation; } set { - _Conversation = value; + this._Conversation = value; } } @@ -175,11 +175,11 @@ public int MessageID { get { - return _MessageID; + return this._MessageID; } private set { - _MessageID = value; + this._MessageID = value; } } @@ -188,11 +188,11 @@ public int PortalID { get { - return _PortalID; + return this._PortalID; } set { - _PortalID = value; + this._PortalID = value; } } @@ -200,11 +200,11 @@ public int ReplyTo { get { - return _ReplyTo; + return this._ReplyTo; } private set { - _ReplyTo = value; + this._ReplyTo = value; } } @@ -212,11 +212,11 @@ public MessageStatusType Status { get { - return _Status; + return this._Status; } set { - _Status = value; + this._Status = value; } } @@ -225,13 +225,13 @@ public string Subject get { var ps = PortalSecurity.Instance; - return ps.InputFilter(_Subject, PortalSecurity.FilterFlag.NoMarkup); + return ps.InputFilter(this._Subject, PortalSecurity.FilterFlag.NoMarkup); } set { var ps = PortalSecurity.Instance; ps.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); - _Subject = ps.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); + this._Subject = ps.InputFilter(value, PortalSecurity.FilterFlag.NoMarkup); } } @@ -240,11 +240,11 @@ public int ToUserID { get { - return _ToUserID; + return this._ToUserID; } set { - _ToUserID = value; + this._ToUserID = value; } } @@ -252,11 +252,11 @@ public string ToUserName { get { - return _ToUserName; + return this._ToUserName; } private set { - _ToUserName = value; + this._ToUserName = value; } } @@ -265,11 +265,11 @@ public DateTime EmailSentDate { get { - return _EmailSentDate; + return this._EmailSentDate; } private set { - _EmailSentDate = value; + this._EmailSentDate = value; } } @@ -278,11 +278,11 @@ public Guid EmailSchedulerInstance { get { - return _EmailSchedulerInstance; + return this._EmailSchedulerInstance; } private set { - _EmailSchedulerInstance = value; + this._EmailSchedulerInstance = value; } } @@ -293,16 +293,16 @@ private set public Message GetReplyMessage() { var message = new Message(); - message.AllowReply = AllowReply; - message.Body = string.Format("


    On {0} {1} wrote ", MessageDate, FromUserName) + Body; - message.Conversation = Conversation; - message.FromUserID = ToUserID; - message.ToUserID = FromUserID; - message.ToUserName = FromUserName; - message.PortalID = PortalID; - message.ReplyTo = MessageID; - message.SkipInbox = SkipInbox; - message.Subject = "RE:" + Subject; + message.AllowReply = this.AllowReply; + message.Body = string.Format("


    On {0} {1} wrote ", this.MessageDate, this.FromUserName) + this.Body; + message.Conversation = this.Conversation; + message.FromUserID = this.ToUserID; + message.ToUserID = this.FromUserID; + message.ToUserName = this.FromUserName; + message.PortalID = this.PortalID; + message.ReplyTo = this.MessageID; + message.SkipInbox = this.SkipInbox; + message.Subject = "RE:" + this.Subject; return message; } @@ -313,26 +313,26 @@ public Message GetReplyMessage() public void Fill(IDataReader dr) { - MessageID = Null.SetNullInteger(dr["MessageID"]); - PortalID = Null.SetNullInteger(dr["PortalID"]); - FromUserID = Null.SetNullInteger(dr["FromUserID"]); - FromUserName = Null.SetNullString(dr["FromUserName"]); - ToUserID = Null.SetNullInteger(dr["ToUserID"]); + this.MessageID = Null.SetNullInteger(dr["MessageID"]); + this.PortalID = Null.SetNullInteger(dr["PortalID"]); + this.FromUserID = Null.SetNullInteger(dr["FromUserID"]); + this.FromUserName = Null.SetNullString(dr["FromUserName"]); + this.ToUserID = Null.SetNullInteger(dr["ToUserID"]); //'_ToUserName = Null.SetNullString(dr.Item("ToUserName")) - ReplyTo = Null.SetNullInteger(dr["ReplyTo"]); - Status = (MessageStatusType) Enum.Parse(typeof (MessageStatusType), Null.SetNullString(dr["Status"])); - Body = Null.SetNullString(dr["Body"]); - Subject = Null.SetNullString(dr["Subject"]); - MessageDate = Null.SetNullDateTime(dr["Date"]); - ToRoleID = Null.SetNullInteger(dr["ToRoleID"]); - AllowReply = Null.SetNullBoolean(dr["AllowReply"]); - SkipInbox = Null.SetNullBoolean(dr["SkipPortal"]); - EmailSent = Null.SetNullBoolean(dr["EmailSent"]); - ToUserName = Null.SetNullString(dr["ToUserName"]); + this.ReplyTo = Null.SetNullInteger(dr["ReplyTo"]); + this.Status = (MessageStatusType) Enum.Parse(typeof (MessageStatusType), Null.SetNullString(dr["Status"])); + this.Body = Null.SetNullString(dr["Body"]); + this.Subject = Null.SetNullString(dr["Subject"]); + this.MessageDate = Null.SetNullDateTime(dr["Date"]); + this.ToRoleID = Null.SetNullInteger(dr["ToRoleID"]); + this.AllowReply = Null.SetNullBoolean(dr["AllowReply"]); + this.SkipInbox = Null.SetNullBoolean(dr["SkipPortal"]); + this.EmailSent = Null.SetNullBoolean(dr["EmailSent"]); + this.ToUserName = Null.SetNullString(dr["ToUserName"]); string g = Null.SetNullString(dr["Conversation"]); - EmailSentDate = Null.SetNullDateTime(dr["EmailSentDate"]); - EmailSchedulerInstance = Null.SetNullGuid(dr["EmailSchedulerInstance"]); - Conversation = Null.SetNullGuid(dr["Conversation"]); + this.EmailSentDate = Null.SetNullDateTime(dr["EmailSentDate"]); + this.EmailSchedulerInstance = Null.SetNullGuid(dr["EmailSchedulerInstance"]); + this.Conversation = Null.SetNullGuid(dr["Conversation"]); //'Conversation = New Guid(g) @@ -342,11 +342,11 @@ public int KeyID { get { - return MessageID; + return this.MessageID; } set { - MessageID = value; + this.MessageID = value; } } diff --git a/DNN Platform/Library/Services/Messaging/Data/MessagingDataService.cs b/DNN Platform/Library/Services/Messaging/Data/MessagingDataService.cs index 73ba790cdba..8e296e5a0c1 100644 --- a/DNN Platform/Library/Services/Messaging/Data/MessagingDataService.cs +++ b/DNN Platform/Library/Services/Messaging/Data/MessagingDataService.cs @@ -21,22 +21,22 @@ public class MessagingDataService : IMessagingDataService public IDataReader GetMessageByID(int messageId) { - return provider.ExecuteReader("Messaging_GetMessage", messageId); + return this.provider.ExecuteReader("Messaging_GetMessage", messageId); } public IDataReader GetUserInbox(int PortalID, int UserID, int PageNumber, int PageSize) { - return provider.ExecuteReader("Messaging_GetInbox", PortalID, UserID, PageNumber, PageSize); + return this.provider.ExecuteReader("Messaging_GetInbox", PortalID, UserID, PageNumber, PageSize); } public int GetInboxCount(int PortalID, int UserID) { - return provider.ExecuteScalar("Messaging_GetInboxCount", PortalID, UserID); + return this.provider.ExecuteScalar("Messaging_GetInboxCount", PortalID, UserID); } public long SaveMessage(Message objMessaging) { - return provider.ExecuteScalar("Messaging_Save_Message", + return this.provider.ExecuteScalar("Messaging_Save_Message", objMessaging.PortalID, objMessaging.FromUserID, objMessaging.ToUserID, @@ -53,22 +53,22 @@ public long SaveMessage(Message objMessaging) public int GetNewMessageCount(int PortalID, int UserID) { - return provider.ExecuteScalar("Messaging_GetNewMessageCount", PortalID, UserID); + return this.provider.ExecuteScalar("Messaging_GetNewMessageCount", PortalID, UserID); } public IDataReader GetNextMessageForDispatch(Guid SchedulerInstance) { - return provider.ExecuteReader("Messaging_GetNextMessageForDispatch", SchedulerInstance); + return this.provider.ExecuteReader("Messaging_GetNextMessageForDispatch", SchedulerInstance); } public void MarkMessageAsDispatched(int MessageID) { - provider.ExecuteNonQuery("Messaging_MarkMessageAsDispatched", MessageID); + this.provider.ExecuteNonQuery("Messaging_MarkMessageAsDispatched", MessageID); } public void UpdateMessage(Message message) { - provider.ExecuteNonQuery("Messaging_UpdateMessage", + this.provider.ExecuteNonQuery("Messaging_UpdateMessage", message.MessageID, message.ToUserID, message.ToRoleID, diff --git a/DNN Platform/Library/Services/Mobile/MatchRule.cs b/DNN Platform/Library/Services/Mobile/MatchRule.cs index d08a5085d6e..9484ff67f99 100644 --- a/DNN Platform/Library/Services/Mobile/MatchRule.cs +++ b/DNN Platform/Library/Services/Mobile/MatchRule.cs @@ -29,11 +29,11 @@ public int Id { get { - return _id; + return this._id; } set { - _id = value; + this._id = value; } } diff --git a/DNN Platform/Library/Services/Mobile/PreviewProfile.cs b/DNN Platform/Library/Services/Mobile/PreviewProfile.cs index ca4c89cce0d..967941b8592 100644 --- a/DNN Platform/Library/Services/Mobile/PreviewProfile.cs +++ b/DNN Platform/Library/Services/Mobile/PreviewProfile.cs @@ -28,11 +28,11 @@ public int Id { get { - return _id; + return this._id; } set { - _id = value; + this._id = value; } } diff --git a/DNN Platform/Library/Services/Mobile/PreviewProfileController.cs b/DNN Platform/Library/Services/Mobile/PreviewProfileController.cs index 0596d10bda0..0b2493f91f5 100644 --- a/DNN Platform/Library/Services/Mobile/PreviewProfileController.cs +++ b/DNN Platform/Library/Services/Mobile/PreviewProfileController.cs @@ -39,7 +39,7 @@ public void Save(IPreviewProfile profile) if (profile.Id == Null.NullInteger || profile.SortOrder == 0) { - profile.SortOrder = GetProfilesByPortal(profile.PortalId, false).Count + 1; + profile.SortOrder = this.GetProfilesByPortal(profile.PortalId, false).Count + 1; } int id = DataProvider.Instance().SavePreviewProfile(profile.Id, @@ -54,9 +54,9 @@ public void Save(IPreviewProfile profile) profile.Id = id; var logContent = string.Format("{0} Mobile Preview Profile '{1}'", profile.Id == Null.NullInteger ? "Add" : "Update", profile.Name); - AddLog(logContent); + this.AddLog(logContent); - ClearCache(profile.PortalId); + this.ClearCache(profile.PortalId); } /// @@ -66,21 +66,21 @@ public void Save(IPreviewProfile profile) /// the profile's id. public void Delete(int portalId, int id) { - var delProfile = GetProfileById(portalId, id); + var delProfile = this.GetProfileById(portalId, id); if (delProfile != null) { //update the list order - GetProfilesByPortal(portalId).Where(p => p.SortOrder > delProfile.SortOrder).ToList().ForEach(p => + this.GetProfilesByPortal(portalId).Where(p => p.SortOrder > delProfile.SortOrder).ToList().ForEach(p => { p.SortOrder--; - Save(p); + this.Save(p); }); DataProvider.Instance().DeletePreviewProfile(id); var logContent = string.Format("Delete Mobile Preview Profile '{0}'", id); - AddLog(logContent); + this.AddLog(logContent); - ClearCache(portalId); + this.ClearCache(portalId); } } @@ -91,7 +91,7 @@ public void Delete(int portalId, int id) /// List of preview profile. public IList GetProfilesByPortal(int portalId) { - return GetProfilesByPortal(portalId, true); + return this.GetProfilesByPortal(portalId, true); } /// @@ -102,7 +102,7 @@ public IList GetProfilesByPortal(int portalId) /// profile object. public IPreviewProfile GetProfileById(int portalId, int id) { - return GetProfilesByPortal(portalId).Where(r => r.Id == id).FirstOrDefault(); + return this.GetProfilesByPortal(portalId).Where(r => r.Id == id).FirstOrDefault(); } #endregion @@ -113,7 +113,7 @@ private IList GetProfilesByPortal(int portalId, bool addDefault { string cacheKey = string.Format(DataCache.PreviewProfilesCacheKey, portalId); var cacheArg = new CacheItemArgs(cacheKey, DataCache.PreviewProfilesCacheTimeOut, DataCache.PreviewProfilesCachePriority, portalId, addDefault); - return CBO.GetCachedObject>(cacheArg, GetProfilesByPortalIdCallBack); + return CBO.GetCachedObject>(cacheArg, this.GetProfilesByPortalIdCallBack); } private IList GetProfilesByPortalIdCallBack(CacheItemArgs cacheItemArgs) @@ -124,7 +124,7 @@ private IList GetProfilesByPortalIdCallBack(CacheItemArgs cache var profiles = CBO.FillCollection(DataProvider.Instance().GetPreviewProfiles(portalId)); if (profiles.Count == 0 && addDefault) { - profiles = CreateDefaultDevices(portalId); + profiles = this.CreateDefaultDevices(portalId); } return profiles.Cast().ToList(); @@ -167,7 +167,7 @@ private List CreateDefaultDevices(int portalId) { p.PortalId = portalId; - Save(p); + this.Save(p); }); } } diff --git a/DNN Platform/Library/Services/Mobile/Redirection.cs b/DNN Platform/Library/Services/Mobile/Redirection.cs index b5390f75057..23f0debf86b 100644 --- a/DNN Platform/Library/Services/Mobile/Redirection.cs +++ b/DNN Platform/Library/Services/Mobile/Redirection.cs @@ -30,12 +30,12 @@ public int Id { get { - return _id; + return this._id; } set { - _id = value; - _matchRules = null; + this._id = value; + this._matchRules = null; } } @@ -82,24 +82,24 @@ public IList MatchRules { get { - if (_matchRules == null) + if (this._matchRules == null) { - if (_id == Null.NullInteger) + if (this._id == Null.NullInteger) { - _matchRules = new List(); + this._matchRules = new List(); } else { //get from database - _matchRules = CBO.FillCollection(DataProvider.Instance().GetRedirectionRules(this.Id)).Cast().ToList(); + this._matchRules = CBO.FillCollection(DataProvider.Instance().GetRedirectionRules(this.Id)).Cast().ToList(); } } - return _matchRules; + return this._matchRules; } set { - _matchRules = value; + this._matchRules = value; } } diff --git a/DNN Platform/Library/Services/Mobile/RedirectionController.cs b/DNN Platform/Library/Services/Mobile/RedirectionController.cs index 99dea3a0751..28e2da9d627 100644 --- a/DNN Platform/Library/Services/Mobile/RedirectionController.cs +++ b/DNN Platform/Library/Services/Mobile/RedirectionController.cs @@ -125,7 +125,7 @@ public string GetRedirectUrl(string userAgent) var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (portalSettings != null && portalSettings.ActiveTab != null) { - string redirectUrl = GetRedirectUrl(userAgent, portalSettings.PortalId, portalSettings.ActiveTab.TabID); + string redirectUrl = this.GetRedirectUrl(userAgent, portalSettings.PortalId, portalSettings.ActiveTab.TabID); if (!string.IsNullOrEmpty(redirectUrl) && string.Compare(redirectUrl, portalSettings.ActiveTab.FullUrl, true, CultureInfo.InvariantCulture) != 0) { return redirectUrl; @@ -148,7 +148,7 @@ public string GetRedirectUrl(string userAgent, int portalId, int currentTabId) string redirectUrl = string.Empty; - IList redirections = GetRedirectionsByPortal(portalId); + IList redirections = this.GetRedirectionsByPortal(portalId); //check for redirect only when redirect rules are defined if (redirections == null || redirections.Count == 0) { @@ -157,7 +157,7 @@ public string GetRedirectUrl(string userAgent, int portalId, int currentTabId) //try to get content from cache var cacheKey = string.Format(RedirectionUrlCacheKey, userAgent, portalId, currentTabId); - redirectUrl = GetUrlFromCache(cacheKey); + redirectUrl = this.GetUrlFromCache(cacheKey); if (!string.IsNullOrEmpty(redirectUrl)) { return redirectUrl; @@ -205,13 +205,13 @@ public string GetRedirectUrl(string userAgent, int portalId, int currentTabId) clientCapability = ClientCapabilityProvider.Instance().GetClientCapability(userAgent); } //check if client capability matches with this rule - if (DoesCapabilityMatchWithRule(clientCapability, redirection)) + if (this.DoesCapabilityMatchWithRule(clientCapability, redirection)) { //find the redirect url - redirectUrl = GetRedirectUrlFromRule(redirection, portalId, currentTabId); + redirectUrl = this.GetRedirectUrlFromRule(redirection, portalId, currentTabId); //update cache content - SetUrlInCache(cacheKey, redirectUrl); + this.SetUrlInCache(cacheKey, redirectUrl); break; } } @@ -230,7 +230,7 @@ public string GetFullSiteUrl() var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (portalSettings != null && portalSettings.ActiveTab != null) { - string fullSiteUrl = GetFullSiteUrl(portalSettings.PortalId, portalSettings.ActiveTab.TabID); + string fullSiteUrl = this.GetFullSiteUrl(portalSettings.PortalId, portalSettings.ActiveTab.TabID); if (!string.IsNullOrEmpty(fullSiteUrl) && string.Compare(fullSiteUrl, portalSettings.ActiveTab.FullUrl, true, CultureInfo.InvariantCulture) != 0) { return fullSiteUrl; @@ -250,7 +250,7 @@ public string GetFullSiteUrl(int portalId, int currentTabId) { string fullSiteUrl = string.Empty; - IList redirections = GetAllRedirections(); + IList redirections = this.GetAllRedirections(); //check for redirect only when redirect rules are defined if (redirections == null || redirections.Count == 0) { @@ -259,7 +259,7 @@ public string GetFullSiteUrl(int portalId, int currentTabId) //try to get content from cache var cacheKey = string.Format(FullSiteUrlCacheKey, portalId, currentTabId); - fullSiteUrl = GetUrlFromCache(cacheKey); + fullSiteUrl = this.GetUrlFromCache(cacheKey); if (!string.IsNullOrEmpty(fullSiteUrl)) { return fullSiteUrl; @@ -302,7 +302,7 @@ public string GetFullSiteUrl(int portalId, int currentTabId) var portalSettings = new PortalSettings(redirection.PortalId); if (portalSettings.HomeTabId != Null.NullInteger && portalSettings.HomeTabId != currentTabId) //ensure it's not redirecting to itself { - fullSiteUrl = GetPortalHomePageUrl(portalSettings); + fullSiteUrl = this.GetPortalHomePageUrl(portalSettings); } } break; @@ -315,7 +315,7 @@ public string GetFullSiteUrl(int portalId, int currentTabId) fullSiteUrl += string.Format("{0}{1}=1", fullSiteUrl.Contains("?") ? "&" : "?", DisableMobileRedirectQueryStringName); //update cache content - SetUrlInCache(cacheKey, fullSiteUrl); + this.SetUrlInCache(cacheKey, fullSiteUrl); return fullSiteUrl; } @@ -329,7 +329,7 @@ public string GetMobileSiteUrl() var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (portalSettings != null && portalSettings.ActiveTab != null) { - string fullSiteUrl = GetMobileSiteUrl(portalSettings.PortalId, portalSettings.ActiveTab.TabID); + string fullSiteUrl = this.GetMobileSiteUrl(portalSettings.PortalId, portalSettings.ActiveTab.TabID); if (!string.IsNullOrEmpty(fullSiteUrl) && string.Compare(fullSiteUrl, portalSettings.ActiveTab.FullUrl, true, CultureInfo.InvariantCulture) != 0) { return fullSiteUrl; @@ -348,7 +348,7 @@ public string GetMobileSiteUrl() public string GetMobileSiteUrl(int portalId, int currentTabId) { string mobileSiteUrl = string.Empty; - IList redirections = GetRedirectionsByPortal(portalId); + IList redirections = this.GetRedirectionsByPortal(portalId); //check for redirect only when redirect rules are defined if (redirections == null || redirections.Count == 0) { @@ -357,7 +357,7 @@ public string GetMobileSiteUrl(int portalId, int currentTabId) //try to get content from cache var cacheKey = string.Format(MobileSiteUrlCacheKey, portalId, currentTabId); - mobileSiteUrl = GetUrlFromCache(cacheKey); + mobileSiteUrl = this.GetUrlFromCache(cacheKey); if (!string.IsNullOrEmpty(mobileSiteUrl)) { return mobileSiteUrl; @@ -370,7 +370,7 @@ public string GetMobileSiteUrl(int portalId, int currentTabId) { if (redirection.SourceTabId != Null.NullInteger && currentTabId == redirection.SourceTabId) { - mobileSiteUrl = GetRedirectUrlFromRule(redirection, portalId, currentTabId); + mobileSiteUrl = this.GetRedirectUrlFromRule(redirection, portalId, currentTabId); break; } } @@ -382,7 +382,7 @@ public string GetMobileSiteUrl(int portalId, int currentTabId) var firstRedirection = redirections.FirstOrDefault(r => r.Enabled); if (firstRedirection != null) { - mobileSiteUrl = GetRedirectUrlFromRule(firstRedirection, portalId, currentTabId); + mobileSiteUrl = this.GetRedirectUrlFromRule(firstRedirection, portalId, currentTabId); } } @@ -391,7 +391,7 @@ public string GetMobileSiteUrl(int portalId, int currentTabId) mobileSiteUrl += string.Format("{0}{1}=0", mobileSiteUrl.Contains("?") ? "&" : "?", DisableMobileRedirectQueryStringName); //update cache content - SetUrlInCache(cacheKey, mobileSiteUrl); + this.SetUrlInCache(cacheKey, mobileSiteUrl); return mobileSiteUrl; } @@ -405,7 +405,7 @@ public void Save(IRedirection redirection) { if(redirection.Id == Null.NullInteger || redirection.SortOrder == 0) { - redirection.SortOrder = GetRedirectionsByPortal(redirection.PortalId).Count + 1; + redirection.SortOrder = this.GetRedirectionsByPortal(redirection.PortalId).Count + 1; } int id = DataProvider.Instance().SaveRedirection(redirection.Id, @@ -426,9 +426,9 @@ public void Save(IRedirection redirection) } var logContent = string.Format("'{0}' {1}", redirection.Name, redirection.Id == Null.NullInteger ? "Added" : "Updated"); - AddLog(logContent); + this.AddLog(logContent); - ClearCache(redirection.PortalId); + this.ClearCache(redirection.PortalId); } /// @@ -438,23 +438,23 @@ public void Save(IRedirection redirection) public void PurgeInvalidRedirections(int portalId) { var allTabs = TabController.Instance.GetTabsByPortal(portalId); - var redirects = GetRedirectionsByPortal(portalId); + var redirects = this.GetRedirectionsByPortal(portalId); //remove rules for deleted source tabs foreach (var r in redirects.Where(r => r.SourceTabId != Null.NullInteger && allTabs.Where(t => t.Key == r.SourceTabId).Count() < 1)) { - Delete(portalId, r.Id); + this.Delete(portalId, r.Id); } //remove rules for deleted target tabs - redirects = GetRedirectionsByPortal(portalId); //fresh get of rules in case some were deleted above + redirects = this.GetRedirectionsByPortal(portalId); //fresh get of rules in case some were deleted above foreach (var r in redirects.Where(r => r.TargetType == TargetType.Tab && allTabs.Where(t => t.Key == int.Parse(r.TargetValue.ToString())).Count() < 1)) { - Delete(portalId, r.Id); + this.Delete(portalId, r.Id); } //remove rules for deleted target portals - redirects = GetRedirectionsByPortal(portalId); //fresh get of rules in case some were deleted above + redirects = this.GetRedirectionsByPortal(portalId); //fresh get of rules in case some were deleted above var allPortals = PortalController.Instance.GetPortals(); foreach (var r in redirects.Where(r => r.TargetType == TargetType.Portal)) { @@ -468,7 +468,7 @@ public void PurgeInvalidRedirections(int portalId) } } if (!found) - Delete(portalId, r.Id); + this.Delete(portalId, r.Id); } } @@ -479,21 +479,21 @@ public void PurgeInvalidRedirections(int portalId) /// the redirection's id. public void Delete(int portalId, int id) { - var delRedirection = GetRedirectionById(portalId, id); + var delRedirection = this.GetRedirectionById(portalId, id); if (delRedirection != null) { //update the list order - GetRedirectionsByPortal(portalId).Where(p => p.SortOrder > delRedirection.SortOrder).ToList().ForEach(p => + this.GetRedirectionsByPortal(portalId).Where(p => p.SortOrder > delRedirection.SortOrder).ToList().ForEach(p => { p.SortOrder--; - Save(p); + this.Save(p); }); DataProvider.Instance().DeleteRedirection(id); var logContent = string.Format("Id '{0}' Deleted", id); - AddLog(logContent); + this.AddLog(logContent); - ClearCache(portalId); + this.ClearCache(portalId); } } @@ -508,9 +508,9 @@ public void DeleteRule(int portalId, int redirectionId, int ruleId) DataProvider.Instance().DeleteRedirectionRule(ruleId); var logContent = string.Format("Id '{0}' Removed from Redirection Id '{1}'", ruleId, redirectionId); - AddLog(logContent); + this.AddLog(logContent); - ClearCache(portalId); + this.ClearCache(portalId); } /// @@ -519,8 +519,8 @@ public void DeleteRule(int portalId, int redirectionId, int ruleId) /// List of redirection. public IList GetAllRedirections() { - var cacheArg = new CacheItemArgs(AllRedirectionsCacheKey, DataCache.RedirectionsCacheTimeOut, DataCache.RedirectionsCachePriority, ""); - return CBO.GetCachedObject>(cacheArg, GetAllRedirectionsCallBack); + var cacheArg = new CacheItemArgs(this.AllRedirectionsCacheKey, DataCache.RedirectionsCacheTimeOut, DataCache.RedirectionsCachePriority, ""); + return CBO.GetCachedObject>(cacheArg, this.GetAllRedirectionsCallBack); } /// @@ -532,7 +532,7 @@ public IList GetRedirectionsByPortal(int portalId) { string cacheKey = string.Format(DataCache.RedirectionsCacheKey, portalId); var cacheArg = new CacheItemArgs(cacheKey, DataCache.RedirectionsCacheTimeOut, DataCache.RedirectionsCachePriority, portalId); - return CBO.GetCachedObject>(cacheArg, GetRedirectionsByPortalCallBack); + return CBO.GetCachedObject>(cacheArg, this.GetRedirectionsByPortalCallBack); } /// @@ -543,7 +543,7 @@ public IList GetRedirectionsByPortal(int portalId) /// redirection object. public IRedirection GetRedirectionById(int portalId, int id) { - return GetRedirectionsByPortal(portalId).Where(r => r.Id == id).FirstOrDefault(); + return this.GetRedirectionsByPortal(portalId).Where(r => r.Id == id).FirstOrDefault(); } /// @@ -584,7 +584,7 @@ public string GetRedirectUrlFromRule(IRedirection redirection, int portalId, int var portalSettings = new PortalSettings(targetPortalId); if (portalSettings.HomeTabId != Null.NullInteger && portalSettings.HomeTabId != currentTabId) //ensure it's not redirecting to itself { - redirectUrl = GetPortalHomePageUrl(portalSettings); + redirectUrl = this.GetPortalHomePageUrl(portalSettings); } } } @@ -616,7 +616,7 @@ private IList GetRedirectionsByPortalCallBack(CacheItemArgs cacheI private void ClearCache(int portalId) { DataCache.RemoveCache(string.Format(DataCache.RedirectionsCacheKey, portalId)); - DataCache.RemoveCache(AllRedirectionsCacheKey); + DataCache.RemoveCache(this.AllRedirectionsCacheKey); DataCache.RemoveCache(UrlsCacheKey); } diff --git a/DNN Platform/Library/Services/ModuleCache/FileProvider.cs b/DNN Platform/Library/Services/ModuleCache/FileProvider.cs index 673893f9750..13e575ef4c8 100644 --- a/DNN Platform/Library/Services/ModuleCache/FileProvider.cs +++ b/DNN Platform/Library/Services/ModuleCache/FileProvider.cs @@ -39,7 +39,7 @@ private string GenerateCacheKeyHash(int tabModuleId, string cacheKey) using (var sha256 = new SHA256CryptoServiceProvider()) { hash = sha256.ComputeHash(hash); - return tabModuleId + "_" + ByteArrayToString(hash); + return tabModuleId + "_" + this.ByteArrayToString(hash); } } @@ -178,7 +178,7 @@ public override string GenerateCacheKey(int tabModuleId, SortedDictionary -1 && DataProvider.Instance().GetOutputCacheItemCount(itemId) >= maxVaryByCount) { - HasErrored = true; + this.HasErrored = true; return; } - CaptureStream = new MemoryStream(); + this.CaptureStream = new MemoryStream(); } protected override void AddItemToCache(int itemId, string output) { - DataProvider.Instance().AddOutputCacheItem(itemId, CacheKey, output, DateTime.UtcNow.Add(CacheDuration)); + DataProvider.Instance().AddOutputCacheItem(itemId, this.CacheKey, output, DateTime.UtcNow.Add(this.CacheDuration)); } protected override void RemoveItemFromCache(int itemId) diff --git a/DNN Platform/Library/Services/OutputCache/Providers/FileProvider.cs b/DNN Platform/Library/Services/OutputCache/Providers/FileProvider.cs index 424c56c7ebf..1bfbbcda6f7 100644 --- a/DNN Platform/Library/Services/OutputCache/Providers/FileProvider.cs +++ b/DNN Platform/Library/Services/OutputCache/Providers/FileProvider.cs @@ -180,7 +180,7 @@ public override void PurgeCache(int portalId) string cacheFolder = GetCacheFolder(portalId); if (!(string.IsNullOrEmpty(cacheFolder))) { - PurgeCache(cacheFolder); + this.PurgeCache(cacheFolder); } } @@ -194,7 +194,7 @@ public override void PurgeExpiredItems(int portalId) { foreach (string file in Directory.GetFiles(cacheFolder, "*" + AttribFileExtension)) { - if (IsFileExpired(file)) + if (this.IsFileExpired(file)) { string fileToDelete = file.Replace(AttribFileExtension, DataFileExtension); if (!(FileSystemUtils.DeleteFileWithWait(fileToDelete, 100, 200))) diff --git a/DNN Platform/Library/Services/OutputCache/Providers/FileResponseFilter.cs b/DNN Platform/Library/Services/OutputCache/Providers/FileResponseFilter.cs index 77303df946b..2274b1de0dc 100644 --- a/DNN Platform/Library/Services/OutputCache/Providers/FileResponseFilter.cs +++ b/DNN Platform/Library/Services/OutputCache/Providers/FileResponseFilter.cs @@ -20,35 +20,35 @@ internal FileResponseFilter(int itemId, int maxVaryByCount, Stream filterChain, { if (maxVaryByCount > -1 && Services.OutputCache.Providers.FileProvider.GetCachedItemCount(itemId) >= maxVaryByCount) { - HasErrored = true; + this.HasErrored = true; return; } - CachedOutputTempFileName = Services.OutputCache.Providers.FileProvider.GetTempFileName(itemId, cacheKey); - CachedOutputFileName = Services.OutputCache.Providers.FileProvider.GetCachedOutputFileName(itemId, cacheKey); - CachedOutputAttribFileName = Services.OutputCache.Providers.FileProvider.GetAttribFileName(itemId, cacheKey); - if (File.Exists(CachedOutputTempFileName)) + this.CachedOutputTempFileName = Services.OutputCache.Providers.FileProvider.GetTempFileName(itemId, cacheKey); + this.CachedOutputFileName = Services.OutputCache.Providers.FileProvider.GetCachedOutputFileName(itemId, cacheKey); + this.CachedOutputAttribFileName = Services.OutputCache.Providers.FileProvider.GetAttribFileName(itemId, cacheKey); + if (File.Exists(this.CachedOutputTempFileName)) { - bool fileDeleted = FileSystemUtils.DeleteFileWithWait(CachedOutputTempFileName, 100, 200); + bool fileDeleted = FileSystemUtils.DeleteFileWithWait(this.CachedOutputTempFileName, 100, 200); if (fileDeleted == false) { - HasErrored = true; + this.HasErrored = true; } } - if (HasErrored == false) + if (this.HasErrored == false) { try { - CaptureStream = new FileStream(CachedOutputTempFileName, FileMode.CreateNew, FileAccess.Write); + this.CaptureStream = new FileStream(this.CachedOutputTempFileName, FileMode.CreateNew, FileAccess.Write); } catch (Exception) { - HasErrored = true; + this.HasErrored = true; throw; } - _cacheExpiration = DateTime.UtcNow.Add(cacheDuration); - HasErrored = false; + this._cacheExpiration = DateTime.UtcNow.Add(cacheDuration); + this.HasErrored = false; } } @@ -62,40 +62,40 @@ public DateTime CacheExpiration { get { - return _cacheExpiration; + return this._cacheExpiration; } set { - _cacheExpiration = value; + this._cacheExpiration = value; } } public override byte[] StopFiltering(int itemId, bool deleteData) { - if (HasErrored) + if (this.HasErrored) { return null; } - if ((CaptureStream) != null) + if ((this.CaptureStream) != null) { - CaptureStream.Close(); + this.CaptureStream.Close(); - if (File.Exists(CachedOutputFileName)) + if (File.Exists(this.CachedOutputFileName)) { - FileSystemUtils.DeleteFileWithWait(CachedOutputFileName, 100, 200); + FileSystemUtils.DeleteFileWithWait(this.CachedOutputFileName, 100, 200); } - File.Move(CachedOutputTempFileName, CachedOutputFileName); + File.Move(this.CachedOutputTempFileName, this.CachedOutputFileName); - StreamWriter oWrite = File.CreateText(CachedOutputAttribFileName); - oWrite.WriteLine(_cacheExpiration.ToString()); + StreamWriter oWrite = File.CreateText(this.CachedOutputAttribFileName); + oWrite.WriteLine(this._cacheExpiration.ToString()); oWrite.Close(); } if (deleteData) { - FileSystemUtils.DeleteFileWithWait(CachedOutputFileName, 100, 200); - FileSystemUtils.DeleteFileWithWait(CachedOutputAttribFileName, 100, 200); + FileSystemUtils.DeleteFileWithWait(this.CachedOutputFileName, 100, 200); + FileSystemUtils.DeleteFileWithWait(this.CachedOutputAttribFileName, 100, 200); } return null; diff --git a/DNN Platform/Library/Services/OutputCache/Providers/MemoryProvider.cs b/DNN Platform/Library/Services/OutputCache/Providers/MemoryProvider.cs index 6196347dca9..eb81bae8dcf 100644 --- a/DNN Platform/Library/Services/OutputCache/Providers/MemoryProvider.cs +++ b/DNN Platform/Library/Services/OutputCache/Providers/MemoryProvider.cs @@ -95,7 +95,7 @@ internal static List GetCacheKeys(int tabId) public override string GenerateCacheKey(int tabId, System.Collections.Specialized.StringCollection includeVaryByKeys, System.Collections.Specialized.StringCollection excludeVaryByKeys, SortedDictionary varyBy) { - return GetCacheKey(base.GenerateCacheKey(tabId, includeVaryByKeys, excludeVaryByKeys, varyBy)); + return this.GetCacheKey(base.GenerateCacheKey(tabId, includeVaryByKeys, excludeVaryByKeys, varyBy)); } public override int GetItemCount(int tabId) diff --git a/DNN Platform/Library/Services/OutputCache/Providers/MemoryResponseFilter.cs b/DNN Platform/Library/Services/OutputCache/Providers/MemoryResponseFilter.cs index a792778fba0..ad77845b563 100644 --- a/DNN Platform/Library/Services/OutputCache/Providers/MemoryResponseFilter.cs +++ b/DNN Platform/Library/Services/OutputCache/Providers/MemoryResponseFilter.cs @@ -21,10 +21,10 @@ internal MemoryResponseFilter(int itemId, int maxVaryByCount, Stream filterChain { if (maxVaryByCount > -1 && Services.OutputCache.Providers.MemoryProvider.GetCacheKeys(itemId).Count >= maxVaryByCount) { - HasErrored = true; + this.HasErrored = true; return; } - CaptureStream = new MemoryStream(); + this.CaptureStream = new MemoryStream(); } protected static System.Web.Caching.Cache Cache @@ -42,12 +42,12 @@ protected static System.Web.Caching.Cache Cache protected override void AddItemToCache(int itemId, string output) { - Cache.Insert(CacheKey, output, null, DateTime.UtcNow.Add(CacheDuration), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null); + Cache.Insert(this.CacheKey, output, null, DateTime.UtcNow.Add(this.CacheDuration), System.Web.Caching.Cache.NoSlidingExpiration, CacheItemPriority.Default, null); } protected override void RemoveItemFromCache(int itemId) { - Cache.Remove(CacheKey); + Cache.Remove(this.CacheKey); } } } diff --git a/DNN Platform/Library/Services/OutputCache/PurgeOutputCache.cs b/DNN Platform/Library/Services/OutputCache/PurgeOutputCache.cs index d57d248fbe7..74a9de46956 100644 --- a/DNN Platform/Library/Services/OutputCache/PurgeOutputCache.cs +++ b/DNN Platform/Library/Services/OutputCache/PurgeOutputCache.cs @@ -22,7 +22,7 @@ public class PurgeOutputCache : SchedulerClient public PurgeOutputCache(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; //REQUIRED + this.ScheduleHistoryItem = objScheduleHistoryItem; //REQUIRED } public override void DoWork() @@ -37,7 +37,7 @@ public override void DoWork() foreach (PortalInfo portal in portals) { kvp.Value.PurgeExpiredItems(portal.PortalID); - ScheduleHistoryItem.AddLogNote(string.Format("Purged output cache for {0}. ", kvp.Key)); + this.ScheduleHistoryItem.AddLogNote(string.Format("Purged output cache for {0}. ", kvp.Key)); } } catch (NotSupportedException exc) @@ -46,16 +46,16 @@ public override void DoWork() Logger.Debug(exc); } } - ScheduleHistoryItem.Succeeded = true; //REQUIRED + this.ScheduleHistoryItem.Succeeded = true; //REQUIRED } catch (Exception exc) //REQUIRED { - ScheduleHistoryItem.Succeeded = false; //REQUIRED + this.ScheduleHistoryItem.Succeeded = false; //REQUIRED - ScheduleHistoryItem.AddLogNote(string.Format("Purging output cache task failed: {0}.", exc.ToString())); //OPTIONAL + this.ScheduleHistoryItem.AddLogNote(string.Format("Purging output cache task failed: {0}.", exc.ToString())); //OPTIONAL //notification that we have errored - Errored(ref exc); + this.Errored(ref exc); //log the exception Exceptions.Exceptions.LogException(exc); //OPTIONAL diff --git a/DNN Platform/Library/Services/Personalization/PersonalizationController.cs b/DNN Platform/Library/Services/Personalization/PersonalizationController.cs index db916e20135..1f5d485e57b 100644 --- a/DNN Platform/Library/Services/Personalization/PersonalizationController.cs +++ b/DNN Platform/Library/Services/Personalization/PersonalizationController.cs @@ -24,14 +24,14 @@ public class PersonalizationController //default implementation relies on HTTPContext public void LoadProfile(HttpContext httpContext, int userId, int portalId) { - LoadProfile(new HttpContextWrapper(httpContext), userId, portalId); + this.LoadProfile(new HttpContextWrapper(httpContext), userId, portalId); } public void LoadProfile(HttpContextBase httpContext, int userId, int portalId) { if (HttpContext.Current.Items["Personalization"] == null) { - httpContext.Items.Add("Personalization", LoadProfile(userId, portalId)); + httpContext.Items.Add("Personalization", this.LoadProfile(userId, portalId)); } } @@ -102,14 +102,14 @@ private static object GetCachedUserPersonalizationCallback(CacheItemArgs cacheIt public void SaveProfile(PersonalizationInfo personalization) { - SaveProfile(personalization, personalization.UserId, personalization.PortalId); + this.SaveProfile(personalization, personalization.UserId, personalization.PortalId); } //default implementation relies on HTTPContext public void SaveProfile(HttpContext httpContext, int userId, int portalId) { var objPersonalization = (PersonalizationInfo) httpContext.Items["Personalization"]; - SaveProfile(objPersonalization, userId, portalId); + this.SaveProfile(objPersonalization, userId, portalId); } //override allows for manipulation of PersonalizationInfo outside of HTTPContext diff --git a/DNN Platform/Library/Services/Registration/RegistrationProfileController.cs b/DNN Platform/Library/Services/Registration/RegistrationProfileController.cs index b63c7e32614..1fee0a69855 100644 --- a/DNN Platform/Library/Services/Registration/RegistrationProfileController.cs +++ b/DNN Platform/Library/Services/Registration/RegistrationProfileController.cs @@ -24,16 +24,16 @@ public IEnumerable Search(int portalId, string searchTerm) .Cast() .Where(definition => definition.DataType != imageType.EntryID)) { - AddProperty(results, definition.PropertyName, searchTerm); + this.AddProperty(results, definition.PropertyName, searchTerm); } - AddProperty(results, "Email", searchTerm); - AddProperty(results, "DisplayName", searchTerm); - AddProperty(results, "Username", searchTerm); - AddProperty(results, "Password", searchTerm); - AddProperty(results, "PasswordConfirm", searchTerm); - AddProperty(results, "PasswordQuestion", searchTerm); - AddProperty(results, "PasswordAnswer", searchTerm); + this.AddProperty(results, "Email", searchTerm); + this.AddProperty(results, "DisplayName", searchTerm); + this.AddProperty(results, "Username", searchTerm); + this.AddProperty(results, "Password", searchTerm); + this.AddProperty(results, "PasswordConfirm", searchTerm); + this.AddProperty(results, "PasswordQuestion", searchTerm); + this.AddProperty(results, "PasswordAnswer", searchTerm); return results; } diff --git a/DNN Platform/Library/Services/Scheduling/DNNScheduler.cs b/DNN Platform/Library/Services/Scheduling/DNNScheduler.cs index bf406a9990a..3e2e5b5d900 100644 --- a/DNN Platform/Library/Services/Scheduling/DNNScheduler.cs +++ b/DNN Platform/Library/Services/Scheduling/DNNScheduler.cs @@ -57,7 +57,7 @@ public override int AddSchedule(ScheduleItem scheduleItem) scheduleItem.FriendlyName, scheduleItem.ScheduleStartDate); //Add schedule to queue - RunScheduleItemNow(scheduleItem); + this.RunScheduleItemNow(scheduleItem); //Return Id return scheduleItem.ScheduleID; @@ -166,8 +166,8 @@ public override void PurgeScheduleHistory() public override void ReStart(string sourceOfRestart) { - Halt(sourceOfRestart); - StartAndWaitForResponse(); + this.Halt(sourceOfRestart); + this.StartAndWaitForResponse(); } public override void RunEventSchedule(EventName eventName) @@ -199,7 +199,7 @@ public override void RunScheduleItemNow(ScheduleItem scheduleItem, bool runNow) public override void RunScheduleItemNow(ScheduleItem scheduleItem) { - RunScheduleItemNow(scheduleItem, false); + this.RunScheduleItemNow(scheduleItem, false); } public override void Start() @@ -217,14 +217,14 @@ public override void StartAndWaitForResponse() { if (Enabled) { - var newThread = new Thread(Start) {IsBackground = true}; + var newThread = new Thread(this.Start) {IsBackground = true}; newThread.Start(); //wait for up to 30 seconds for thread //to start up for (int i = 0; i <= 30; i++) { - if (GetScheduleStatus() != ScheduleStatus.STOPPED) + if (this.GetScheduleStatus() != ScheduleStatus.STOPPED) { return; } @@ -245,7 +245,7 @@ public override void UpdateSchedule(ScheduleItem scheduleItem) //save item SchedulingController.UpdateSchedule(scheduleItem); //Update items that are already scheduled - var futureHistory = GetScheduleHistory(scheduleItem.ScheduleID).Cast().Where(h => h.NextStart > DateTime.Now); + var futureHistory = this.GetScheduleHistory(scheduleItem.ScheduleID).Cast().Where(h => h.NextStart > DateTime.Now); var scheduleItemStart = scheduleItem.ScheduleStartDate > DateTime.Now ? scheduleItem.ScheduleStartDate @@ -258,14 +258,14 @@ public override void UpdateSchedule(ScheduleItem scheduleItem) //Add schedule to queue - RunScheduleItemNow(scheduleItem); + this.RunScheduleItemNow(scheduleItem); } //DNN-5001 Possibility to stop already running tasks public override void RemoveFromScheduleInProgress(ScheduleItem scheduleItem) { //get ScheduleHistoryItem of the running task - var runningscheduleHistoryItem = GetScheduleHistory(scheduleItem.ScheduleID).Cast().ElementAtOrDefault(0); + var runningscheduleHistoryItem = this.GetScheduleHistory(scheduleItem.ScheduleID).Cast().ElementAtOrDefault(0); Scheduler.CoreScheduler.StopScheduleInProgress(scheduleItem, runningscheduleHistoryItem); } diff --git a/DNN Platform/Library/Services/Scheduling/ProcessGroup.cs b/DNN Platform/Library/Services/Scheduling/ProcessGroup.cs index 041eed27833..fdec51b1d1d 100644 --- a/DNN Platform/Library/Services/Scheduling/ProcessGroup.cs +++ b/DNN Platform/Library/Services/Scheduling/ProcessGroup.cs @@ -69,7 +69,7 @@ public void Run(ScheduleHistoryItem objScheduleHistoryItem) //This is called from RunPooledThread() ticksElapsed = Environment.TickCount - ticksElapsed; serviceScope = Globals.DependencyProvider.CreateScope(); - Process = GetSchedulerClient(serviceScope.ServiceProvider, objScheduleHistoryItem.TypeFullName, objScheduleHistoryItem); + Process = this.GetSchedulerClient(serviceScope.ServiceProvider, objScheduleHistoryItem.TypeFullName, objScheduleHistoryItem); Process.ScheduleHistoryItem = objScheduleHistoryItem; //Set up the handlers for the CoreScheduler @@ -119,9 +119,9 @@ public void Run(ScheduleHistoryItem objScheduleHistoryItem) if (processesCompleted == numberOfProcesses) { ticksElapsed = Environment.TickCount - ticksElapsed; - if (Completed != null) + if (this.Completed != null) { - Completed(); + this.Completed(); } } } @@ -172,7 +172,7 @@ private SchedulerClient GetSchedulerClient(IServiceProvider services, string str //so the two subroutines cannot be combined, so instead just call Run from here. private void RunPooledThread(object objScheduleHistoryItem) { - Run((ScheduleHistoryItem) objScheduleHistoryItem); + this.Run((ScheduleHistoryItem) objScheduleHistoryItem); } //Add a queue request to Threadpool with a @@ -185,7 +185,7 @@ public void AddQueueUserWorkItem(ScheduleItem s) try { //Create a callback to subroutine RunPooledThread - WaitCallback callback = RunPooledThread; + WaitCallback callback = this.RunPooledThread; //And put in a request to ThreadPool to run the process. ThreadPool.QueueUserWorkItem(callback, obj); } diff --git a/DNN Platform/Library/Services/Scheduling/PurgeScheduleHistory.cs b/DNN Platform/Library/Services/Scheduling/PurgeScheduleHistory.cs index 21e42666e67..2bf764cf023 100644 --- a/DNN Platform/Library/Services/Scheduling/PurgeScheduleHistory.cs +++ b/DNN Platform/Library/Services/Scheduling/PurgeScheduleHistory.cs @@ -14,7 +14,7 @@ public class PurgeScheduleHistory : SchedulerClient { public PurgeScheduleHistory(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } public override void DoWork() @@ -22,22 +22,22 @@ public override void DoWork() try { //notification that the event is progressing - Progressing(); + this.Progressing(); SchedulingProvider.Instance().PurgeScheduleHistory(); //update the result to success since no exception was thrown - ScheduleHistoryItem.Succeeded = true; - ScheduleHistoryItem.AddLogNote("Schedule history purged."); + this.ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.AddLogNote("Schedule history purged."); } catch (Exception exc) { - ScheduleHistoryItem.Succeeded = false; - ScheduleHistoryItem.AddLogNote("Schedule history purge failed." + exc); - ScheduleHistoryItem.Succeeded = false; + this.ScheduleHistoryItem.Succeeded = false; + this.ScheduleHistoryItem.AddLogNote("Schedule history purge failed." + exc); + this.ScheduleHistoryItem.Succeeded = false; //notification that we have errored - Errored(ref exc); + this.Errored(ref exc); //log the exception Exceptions.Exceptions.LogException(exc); diff --git a/DNN Platform/Library/Services/Scheduling/ScheduleHistoryItem.cs b/DNN Platform/Library/Services/Scheduling/ScheduleHistoryItem.cs index 0d135d900bb..ac820cbb682 100644 --- a/DNN Platform/Library/Services/Scheduling/ScheduleHistoryItem.cs +++ b/DNN Platform/Library/Services/Scheduling/ScheduleHistoryItem.cs @@ -28,40 +28,40 @@ public class ScheduleHistoryItem : ScheduleItem public ScheduleHistoryItem() { - _ScheduleHistoryID = Null.NullInteger; - _StartDate = Null.NullDate; - EndDate = Null.NullDate; - _Succeeded = Null.NullBoolean; - _LogNotes = new StringBuilder(); - _Server = Null.NullString; + this._ScheduleHistoryID = Null.NullInteger; + this._StartDate = Null.NullDate; + this.EndDate = Null.NullDate; + this._Succeeded = Null.NullBoolean; + this._LogNotes = new StringBuilder(); + this._Server = Null.NullString; } public ScheduleHistoryItem(ScheduleItem objScheduleItem) { - AttachToEvent = objScheduleItem.AttachToEvent; - CatchUpEnabled = objScheduleItem.CatchUpEnabled; - Enabled = objScheduleItem.Enabled; - NextStart = objScheduleItem.NextStart; - ObjectDependencies = objScheduleItem.ObjectDependencies; - ProcessGroup = objScheduleItem.ProcessGroup; - RetainHistoryNum = objScheduleItem.RetainHistoryNum; - RetryTimeLapse = objScheduleItem.RetryTimeLapse; - RetryTimeLapseMeasurement = objScheduleItem.RetryTimeLapseMeasurement; - ScheduleID = objScheduleItem.ScheduleID; - ScheduleSource = objScheduleItem.ScheduleSource; - ThreadID = objScheduleItem.ThreadID; - TimeLapse = objScheduleItem.TimeLapse; - TimeLapseMeasurement = objScheduleItem.TimeLapseMeasurement; - TypeFullName = objScheduleItem.TypeFullName; - Servers = objScheduleItem.Servers; - FriendlyName = objScheduleItem.FriendlyName; - _ScheduleHistoryID = Null.NullInteger; - _StartDate = Null.NullDate; - EndDate = Null.NullDate; - _Succeeded = Null.NullBoolean; - _LogNotes = new StringBuilder(); - _Server = Null.NullString; - ScheduleStartDate = objScheduleItem.ScheduleStartDate != Null.NullDate + this.AttachToEvent = objScheduleItem.AttachToEvent; + this.CatchUpEnabled = objScheduleItem.CatchUpEnabled; + this.Enabled = objScheduleItem.Enabled; + this.NextStart = objScheduleItem.NextStart; + this.ObjectDependencies = objScheduleItem.ObjectDependencies; + this.ProcessGroup = objScheduleItem.ProcessGroup; + this.RetainHistoryNum = objScheduleItem.RetainHistoryNum; + this.RetryTimeLapse = objScheduleItem.RetryTimeLapse; + this.RetryTimeLapseMeasurement = objScheduleItem.RetryTimeLapseMeasurement; + this.ScheduleID = objScheduleItem.ScheduleID; + this.ScheduleSource = objScheduleItem.ScheduleSource; + this.ThreadID = objScheduleItem.ThreadID; + this.TimeLapse = objScheduleItem.TimeLapse; + this.TimeLapseMeasurement = objScheduleItem.TimeLapseMeasurement; + this.TypeFullName = objScheduleItem.TypeFullName; + this.Servers = objScheduleItem.Servers; + this.FriendlyName = objScheduleItem.FriendlyName; + this._ScheduleHistoryID = Null.NullInteger; + this._StartDate = Null.NullDate; + this.EndDate = Null.NullDate; + this._Succeeded = Null.NullBoolean; + this._LogNotes = new StringBuilder(); + this._Server = Null.NullString; + this.ScheduleStartDate = objScheduleItem.ScheduleStartDate != Null.NullDate ? objScheduleItem.ScheduleStartDate : Null.NullDate; } @@ -74,13 +74,13 @@ public double ElapsedTime { try { - if (EndDate == Null.NullDate && _StartDate != Null.NullDate) + if (this.EndDate == Null.NullDate && this._StartDate != Null.NullDate) { - return DateTime.Now.Subtract(_StartDate).TotalSeconds; + return DateTime.Now.Subtract(this._StartDate).TotalSeconds; } - else if (_StartDate != Null.NullDate) + else if (this._StartDate != Null.NullDate) { - return EndDate.Subtract(_StartDate).TotalSeconds; + return this.EndDate.Subtract(this._StartDate).TotalSeconds; } else { @@ -100,11 +100,11 @@ public string LogNotes { get { - return _LogNotes.ToString(); + return this._LogNotes.ToString(); } set { - _LogNotes = new StringBuilder(value); + this._LogNotes = new StringBuilder(value); } } @@ -112,7 +112,7 @@ public bool Overdue { get { - if (NextStart < DateTime.Now && EndDate == Null.NullDate) + if (this.NextStart < DateTime.Now && this.EndDate == Null.NullDate) { return true; } @@ -129,9 +129,9 @@ public double OverdueBy { try { - if (NextStart <= DateTime.Now && EndDate == Null.NullDate) + if (this.NextStart <= DateTime.Now && this.EndDate == Null.NullDate) { - return Math.Round(DateTime.Now.Subtract(NextStart).TotalSeconds); + return Math.Round(DateTime.Now.Subtract(this.NextStart).TotalSeconds); } else { @@ -151,9 +151,9 @@ public double RemainingTime { try { - if (NextStart > DateTime.Now && EndDate == Null.NullDate) + if (this.NextStart > DateTime.Now && this.EndDate == Null.NullDate) { - return Math.Round(NextStart.Subtract(DateTime.Now).TotalSeconds); + return Math.Round(this.NextStart.Subtract(DateTime.Now).TotalSeconds); } else { @@ -171,11 +171,11 @@ public int ScheduleHistoryID { get { - return _ScheduleHistoryID; + return this._ScheduleHistoryID; } set { - _ScheduleHistoryID = value; + this._ScheduleHistoryID = value; } } @@ -183,11 +183,11 @@ public string Server { get { - return _Server; + return this._Server; } set { - _Server = value; + this._Server = value; } } @@ -195,11 +195,11 @@ public DateTime StartDate { get { - return _StartDate; + return this._StartDate; } set { - _StartDate = value; + this._StartDate = value; } } @@ -207,32 +207,32 @@ public bool Succeeded { get { - return _Succeeded; + return this._Succeeded; } set { - _Succeeded = value; + this._Succeeded = value; if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"ScheduleHistoryItem.Succeeded Info (ScheduledTask {(value == false ? "Start" : "End")}): {FriendlyName}"); + _tracelLogger.Debug($"ScheduleHistoryItem.Succeeded Info (ScheduledTask {(value == false ? "Start" : "End")}): {this.FriendlyName}"); } } public virtual void AddLogNote(string notes) { - _LogNotes.Append(notes); + this._LogNotes.Append(notes); if (_tracelLogger.IsTraceEnabled) _tracelLogger.Trace(notes.Replace(@"
    ", Environment.NewLine)); } public override void Fill(IDataReader dr) { - ScheduleHistoryID = Null.SetNullInteger(dr["ScheduleHistoryID"]); - StartDate = Null.SetNullDateTime(dr["StartDate"]); - EndDate = Null.SetNullDateTime(dr["EndDate"]); - Succeeded = Null.SetNullBoolean(dr["Succeeded"]); - LogNotes = Null.SetNullString(dr["LogNotes"]); - Server = Null.SetNullString(dr["Server"]); - FillInternal(dr); + this.ScheduleHistoryID = Null.SetNullInteger(dr["ScheduleHistoryID"]); + this.StartDate = Null.SetNullDateTime(dr["StartDate"]); + this.EndDate = Null.SetNullDateTime(dr["EndDate"]); + this.Succeeded = Null.SetNullBoolean(dr["Succeeded"]); + this.LogNotes = Null.SetNullString(dr["LogNotes"]); + this.Server = Null.SetNullString(dr["Server"]); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Services/Scheduling/ScheduleItem.cs b/DNN Platform/Library/Services/Scheduling/ScheduleItem.cs index 0517c531ea4..365cb7fcd95 100644 --- a/DNN Platform/Library/Services/Scheduling/ScheduleItem.cs +++ b/DNN Platform/Library/Services/Scheduling/ScheduleItem.cs @@ -31,21 +31,21 @@ public class ScheduleItem : BaseEntityInfo, IHydratable public ScheduleItem() { - ScheduleID = Null.NullInteger; - TypeFullName = Null.NullString; - TimeLapse = Null.NullInteger; - TimeLapseMeasurement = Null.NullString; - RetryTimeLapse = Null.NullInteger; - RetryTimeLapseMeasurement = Null.NullString; - ObjectDependencies = Null.NullString; - RetainHistoryNum = Null.NullInteger; - CatchUpEnabled = Null.NullBoolean; - Enabled = Null.NullBoolean; - AttachToEvent = Null.NullString; - ThreadID = Null.NullInteger; - ProcessGroup = Null.NullInteger; - Servers = Null.NullString; - ScheduleStartDate = Null.NullDate; + this.ScheduleID = Null.NullInteger; + this.TypeFullName = Null.NullString; + this.TimeLapse = Null.NullInteger; + this.TimeLapseMeasurement = Null.NullString; + this.RetryTimeLapse = Null.NullInteger; + this.RetryTimeLapseMeasurement = Null.NullString; + this.ObjectDependencies = Null.NullString; + this.RetainHistoryNum = Null.NullInteger; + this.CatchUpEnabled = Null.NullBoolean; + this.Enabled = Null.NullBoolean; + this.AttachToEvent = Null.NullString; + this.ThreadID = Null.NullInteger; + this.ProcessGroup = Null.NullInteger; + this.Servers = Null.NullString; + this.ScheduleStartDate = Null.NullDate; } #endregion @@ -66,15 +66,15 @@ public virtual DateTime NextStart { get { - if (!_NextStart.HasValue) + if (!this._NextStart.HasValue) { - _NextStart = MinNextTime; + this._NextStart = MinNextTime; } - return _NextStart.Value > MinNextTime ? _NextStart.Value : MinNextTime; + return this._NextStart.Value > MinNextTime ? this._NextStart.Value : MinNextTime; } set { - _NextStart = value; + this._NextStart = value; } } @@ -110,17 +110,17 @@ public int KeyID { get { - return ScheduleID; + return this.ScheduleID; } set { - ScheduleID = value; + this.ScheduleID = value; } } public virtual void Fill(IDataReader dr) { - FillInternal(dr); + this.FillInternal(dr); } #endregion @@ -134,13 +134,13 @@ public bool HasObjectDependencies(string strObjectDependencies) int i; for (i = 0; i <= a.Length - 1; i++) { - if (ObjectDependencies.IndexOf(a[i].Trim(), StringComparison.InvariantCultureIgnoreCase) > -1) + if (this.ObjectDependencies.IndexOf(a[i].Trim(), StringComparison.InvariantCultureIgnoreCase) > -1) { return true; } } } - else if (ObjectDependencies.IndexOf(strObjectDependencies, StringComparison.InvariantCultureIgnoreCase) > -1) + else if (this.ObjectDependencies.IndexOf(strObjectDependencies, StringComparison.InvariantCultureIgnoreCase) > -1) { return true; } @@ -151,18 +151,18 @@ public bool HasObjectDependencies(string strObjectDependencies) public void AddSetting(string Key, string Value) { - _ScheduleItemSettings.Add(Key, Value); + this._ScheduleItemSettings.Add(Key, Value); } public virtual string GetSetting(string Key) { - if (_ScheduleItemSettings == null) + if (this._ScheduleItemSettings == null) { - GetSettings(); + this.GetSettings(); } - if (_ScheduleItemSettings != null && _ScheduleItemSettings.ContainsKey(Key)) + if (this._ScheduleItemSettings != null && this._ScheduleItemSettings.ContainsKey(Key)) { - return Convert.ToString(_ScheduleItemSettings[Key]); + return Convert.ToString(this._ScheduleItemSettings[Key]); } else { @@ -172,36 +172,36 @@ public virtual string GetSetting(string Key) public virtual Hashtable GetSettings() { - _ScheduleItemSettings = SchedulingProvider.Instance().GetScheduleItemSettings(ScheduleID); - return _ScheduleItemSettings; + this._ScheduleItemSettings = SchedulingProvider.Instance().GetScheduleItemSettings(this.ScheduleID); + return this._ScheduleItemSettings; } protected override void FillInternal(IDataReader dr) { - ScheduleID = Null.SetNullInteger(dr["ScheduleID"]); - FriendlyName = Null.SetNullString(dr["FriendlyName"]); - TypeFullName = Null.SetNullString(dr["TypeFullName"]); - TimeLapse = Null.SetNullInteger(dr["TimeLapse"]); - TimeLapseMeasurement = Null.SetNullString(dr["TimeLapseMeasurement"]); - RetryTimeLapse = Null.SetNullInteger(dr["RetryTimeLapse"]); - RetryTimeLapseMeasurement = Null.SetNullString(dr["RetryTimeLapseMeasurement"]); - ObjectDependencies = Null.SetNullString(dr["ObjectDependencies"]); - AttachToEvent = Null.SetNullString(dr["AttachToEvent"]); - RetainHistoryNum = Null.SetNullInteger(dr["RetainHistoryNum"]); - CatchUpEnabled = Null.SetNullBoolean(dr["CatchUpEnabled"]); - Enabled = Null.SetNullBoolean(dr["Enabled"]); - Servers = Null.SetNullString(dr["Servers"]); + this.ScheduleID = Null.SetNullInteger(dr["ScheduleID"]); + this.FriendlyName = Null.SetNullString(dr["FriendlyName"]); + this.TypeFullName = Null.SetNullString(dr["TypeFullName"]); + this.TimeLapse = Null.SetNullInteger(dr["TimeLapse"]); + this.TimeLapseMeasurement = Null.SetNullString(dr["TimeLapseMeasurement"]); + this.RetryTimeLapse = Null.SetNullInteger(dr["RetryTimeLapse"]); + this.RetryTimeLapseMeasurement = Null.SetNullString(dr["RetryTimeLapseMeasurement"]); + this.ObjectDependencies = Null.SetNullString(dr["ObjectDependencies"]); + this.AttachToEvent = Null.SetNullString(dr["AttachToEvent"]); + this.RetainHistoryNum = Null.SetNullInteger(dr["RetainHistoryNum"]); + this.CatchUpEnabled = Null.SetNullBoolean(dr["CatchUpEnabled"]); + this.Enabled = Null.SetNullBoolean(dr["Enabled"]); + this.Servers = Null.SetNullString(dr["Servers"]); var schema = dr.GetSchemaTable(); if (schema != null) { if (schema.Select("ColumnName = 'NextStart'").Length > 0) { - NextStart = Null.SetNullDateTime(dr["NextStart"]); + this.NextStart = Null.SetNullDateTime(dr["NextStart"]); } if (schema.Select("ColumnName = 'ScheduleStartDate'").Length > 0) { - ScheduleStartDate = Null.SetNullDateTime(dr["ScheduleStartDate"]); + this.ScheduleStartDate = Null.SetNullDateTime(dr["ScheduleStartDate"]); } } //Fill BaseEntityInfo diff --git a/DNN Platform/Library/Services/Scheduling/SchedulerClient.cs b/DNN Platform/Library/Services/Scheduling/SchedulerClient.cs index c1dc95f3403..d4f2f68de00 100644 --- a/DNN Platform/Library/Services/Scheduling/SchedulerClient.cs +++ b/DNN Platform/Library/Services/Scheduling/SchedulerClient.cs @@ -21,10 +21,10 @@ public abstract class SchedulerClient { public SchedulerClient() { - SchedulerEventGUID = Null.NullString; - aProcessMethod = Null.NullString; - Status = Null.NullString; - ScheduleHistoryItem = new ScheduleHistoryItem(); + this.SchedulerEventGUID = Null.NullString; + this.aProcessMethod = Null.NullString; + this.Status = Null.NullString; + this.ScheduleHistoryItem = new ScheduleHistoryItem(); } public ScheduleHistoryItem ScheduleHistoryItem { get; set; } @@ -50,33 +50,33 @@ public int ThreadID public void Started() { - if (ProcessStarted != null) + if (this.ProcessStarted != null) { - ProcessStarted(this); + this.ProcessStarted(this); } } public void Progressing() { - if (ProcessProgressing != null) + if (this.ProcessProgressing != null) { - ProcessProgressing(this); + this.ProcessProgressing(this); } } public void Completed() { - if (ProcessCompleted != null) + if (this.ProcessCompleted != null) { - ProcessCompleted(this); + this.ProcessCompleted(this); } } public void Errored(ref Exception objException) { - if (ProcessErrored != null) + if (this.ProcessErrored != null) { - ProcessErrored(this, objException); + this.ProcessErrored(this, objException); } } diff --git a/DNN Platform/Library/Services/Scheduling/SchedulingProvider.cs b/DNN Platform/Library/Services/Scheduling/SchedulingProvider.cs index 97723557a81..24da60d7d9c 100644 --- a/DNN Platform/Library/Services/Scheduling/SchedulingProvider.cs +++ b/DNN Platform/Library/Services/Scheduling/SchedulingProvider.cs @@ -70,10 +70,10 @@ public abstract class SchedulingProvider protected SchedulingProvider() { - var settings = Settings; + var settings = this.Settings; if (settings != null) { - ProviderPath = settings["providerPath"]; + this.ProviderPath = settings["providerPath"]; string str; bool dbg; diff --git a/DNN Platform/Library/Services/Search/Controllers/ModuleResultController.cs b/DNN Platform/Library/Services/Search/Controllers/ModuleResultController.cs index 6542b36272b..488b4b47181 100644 --- a/DNN Platform/Library/Services/Search/Controllers/ModuleResultController.cs +++ b/DNN Platform/Library/Services/Search/Controllers/ModuleResultController.cs @@ -55,10 +55,10 @@ public override bool HasViewPermission(SearchResult searchResult) foreach (ModuleInfo module in tabModules) { var tab = TabController.Instance.GetTab(module.TabID, searchResult.PortalId, false); - if (ModuleIsAvailable(tab, module) && !tab.IsDeleted && !tab.DisableLink && TabPermissionController.CanViewPage(tab)) + if (this.ModuleIsAvailable(tab, module) && !tab.IsDeleted && !tab.DisableLink && TabPermissionController.CanViewPage(tab)) { //Check If authorised to View Module - if (ModulePermissionController.CanViewModule(module) && HasModuleSearchPermission(module, searchResult)) + if (ModulePermissionController.CanViewModule(module) && this.HasModuleSearchPermission(module, searchResult)) { //Verify against search document permissions if (string.IsNullOrEmpty(searchResult.Permissions) || PortalSecurity.IsInRoles(searchResult.Permissions)) @@ -66,7 +66,7 @@ public override bool HasViewPermission(SearchResult searchResult) viewable = true; if (string.IsNullOrEmpty(searchResult.Url)) { - searchResult.Url = GetModuleSearchUrl(module, searchResult); + searchResult.Url = this.GetModuleSearchUrl(module, searchResult); if (string.IsNullOrEmpty(searchResult.Url)) { searchResult.Url = TestableGlobals.Instance.NavigateURL(module.TabID, string.Empty, @@ -104,7 +104,7 @@ public override string GetDocUrl(SearchResult searchResult) { try { - url = GetModuleSearchUrl(module, searchResult); + url = this.GetModuleSearchUrl(module, searchResult); if (string.IsNullOrEmpty(url)) { @@ -144,7 +144,7 @@ private bool HasModuleSearchPermission(ModuleInfo module, SearchResult searchRes { var canView = true; - var moduleSearchController = GetModuleSearchController(module); + var moduleSearchController = this.GetModuleSearchController(module); if (moduleSearchController != null) { canView = moduleSearchController.HasViewPermission(searchResult); @@ -156,7 +156,7 @@ private bool HasModuleSearchPermission(ModuleInfo module, SearchResult searchRes private string GetModuleSearchUrl(ModuleInfo module, SearchResult searchResult) { var url = string.Empty; - var moduleSearchController = GetModuleSearchController(module); + var moduleSearchController = this.GetModuleSearchController(module); if (moduleSearchController != null) { url = moduleSearchController.GetDocUrl(searchResult); @@ -189,7 +189,7 @@ private IModuleSearchResultController GetModuleSearchController(ModuleInfo modul private bool ModuleIsAvailable(TabInfo tab, ModuleInfo module) { - return GetModules(tab).Any(m => m.ModuleID == module.ModuleID && !m.IsDeleted); + return this.GetModules(tab).Any(m => m.ModuleID == module.ModuleID && !m.IsDeleted); } private IEnumerable GetModules(TabInfo tab) diff --git a/DNN Platform/Library/Services/Search/Controllers/SearchControllerImpl.cs b/DNN Platform/Library/Services/Search/Controllers/SearchControllerImpl.cs index 88993cc4d23..801435bb298 100644 --- a/DNN Platform/Library/Services/Search/Controllers/SearchControllerImpl.cs +++ b/DNN Platform/Library/Services/Search/Controllers/SearchControllerImpl.cs @@ -47,14 +47,14 @@ internal class SearchControllerImpl : ISearchController public SearchResults SiteSearch(SearchQuery searchQuery) { - var results = GetResults(searchQuery); + var results = this.GetResults(searchQuery); return new SearchResults{TotalHits = results.Item1, Results = results.Item2}; } public SearchResults ModuleSearch(SearchQuery searchQuery) { - searchQuery.SearchTypeIds = new List { _moduleSearchTypeId }; - var results = GetResults(searchQuery); + searchQuery.SearchTypeIds = new List { this._moduleSearchTypeId }; + var results = this.GetResults(searchQuery); return new SearchResults { TotalHits = results.Item1, Results = results.Item2 }; } @@ -67,7 +67,7 @@ private Tuple> GetResults(SearchQuery searchQuery) Requires.NotNull("Query", searchQuery); Requires.PropertyNotEqualTo("searchQuery", "SearchTypeIds", searchQuery.SearchTypeIds.Count(), 0); - if((searchQuery.ModuleId > 0) && (searchQuery.SearchTypeIds.Count() > 1 || !searchQuery.SearchTypeIds.Contains(_moduleSearchTypeId))) + if((searchQuery.ModuleId > 0) && (searchQuery.SearchTypeIds.Count() > 1 || !searchQuery.SearchTypeIds.Contains(this._moduleSearchTypeId))) throw new ArgumentException(Localization.Localization.GetExceptionMessage("ModuleIdMustHaveSearchTypeIdForModule", "ModuleId based search must have SearchTypeId for a module only")); if(searchQuery.SortField == SortFields.CustomStringField || searchQuery.SortField == SortFields.CustomNumericField @@ -112,7 +112,7 @@ private Tuple> GetResults(SearchQuery searchQuery) } if (searchQuery.PortalIds.Any()) query.Add(portalIdQuery, Occur.MUST); - ApplySearchTypeIdFilter(query, searchQuery); + this.ApplySearchTypeIdFilter(query, searchQuery); if (searchQuery.BeginModifiedTimeUtc > DateTime.MinValue && searchQuery.EndModifiedTimeUtc >= searchQuery.BeginModifiedTimeUtc) { @@ -156,14 +156,14 @@ private Tuple> GetResults(SearchQuery searchQuery) var luceneQuery = new LuceneQuery { Query = query, - Sort = GetSort(searchQuery), + Sort = this.GetSort(searchQuery), PageIndex = searchQuery.PageIndex, PageSize = searchQuery.PageSize, TitleSnippetLength = searchQuery.TitleSnippetLength, BodySnippetLength = searchQuery.BodySnippetLength }; - return GetSecurityTrimmedResults(searchQuery, luceneQuery); + return this.GetSecurityTrimmedResults(searchQuery, luceneQuery); } private Sort GetSort(SearchQuery query) @@ -208,7 +208,7 @@ private Sort GetSort(SearchQuery query) private void ApplySearchTypeIdFilter(BooleanQuery query, SearchQuery searchQuery) { //Special handling for Module Search - if (searchQuery.SearchTypeIds.Count() == 1 && searchQuery.SearchTypeIds.Contains(_moduleSearchTypeId)) + if (searchQuery.SearchTypeIds.Count() == 1 && searchQuery.SearchTypeIds.Contains(this._moduleSearchTypeId)) { //When moduleid is specified, we ignore other searchtypeid or moduledefinitionid. Major security check if (searchQuery.ModuleId > 0) @@ -227,14 +227,14 @@ private void ApplySearchTypeIdFilter(BooleanQuery query, SearchQuery searchQuery query.Add(modDefQuery, Occur.MUST); //Note the MUST } - query.Add(NumericRangeQuery.NewIntRange(Constants.SearchTypeTag, _moduleSearchTypeId, _moduleSearchTypeId, true, true), Occur.MUST); + query.Add(NumericRangeQuery.NewIntRange(Constants.SearchTypeTag, this._moduleSearchTypeId, this._moduleSearchTypeId, true, true), Occur.MUST); } else { var searchTypeIdQuery = new BooleanQuery(); foreach (var searchTypeId in searchQuery.SearchTypeIds) { - if (searchTypeId == _moduleSearchTypeId) + if (searchTypeId == this._moduleSearchTypeId) { foreach (var moduleDefId in searchQuery.ModuleDefIds.OrderBy(id => id)) { @@ -383,7 +383,7 @@ private static string GetSnippet(SearchResult searchResult, LuceneResult luceneR private Dictionary GetSearchResultControllers() { var cachArg = new CacheItemArgs(SeacrchContollersCacheKey, 120, CacheItemPriority.Default); - return CBO.GetCachedObject>(cachArg, GetSearchResultsControllersCallBack); + return CBO.GetCachedObject>(cachArg, this.GetSearchResultsControllersCallBack); } private Dictionary GetSearchResultsControllersCallBack(CacheItemArgs cacheItem) @@ -423,9 +423,9 @@ private Tuple> GetSecurityTrimmedResults(SearchQuery se { LuceneQuery = luceneQuery, SearchQuery = searchQuery, - SecurityCheckerDelegate = HasPermissionToViewDoc + SecurityCheckerDelegate = this.HasPermissionToViewDoc }); - results = luceneResults.Results.Select(GetSearchResultFromLuceneResult).ToList(); + results = luceneResults.Results.Select(this.GetSearchResultFromLuceneResult).ToList(); totalHits = luceneResults.TotalHits; //**************************************************************************** @@ -435,7 +435,7 @@ private Tuple> GetSecurityTrimmedResults(SearchQuery se { if (string.IsNullOrEmpty(result.Url)) { - var resultController = GetSearchResultControllers().Single(sc => sc.Key == result.SearchTypeId).Value; + var resultController = this.GetSearchResultControllers().Single(sc => sc.Key == result.SearchTypeId).Value; result.Url = resultController.GetDocUrl(result); } } @@ -448,7 +448,7 @@ private bool HasPermissionToViewDoc(Document document, SearchQuery searchQuery) { // others LuceneResult fields are not impotrant at this moment var result = GetPartialSearchResult(document, searchQuery); - var resultController = GetSearchResultControllers().SingleOrDefault(sc => sc.Key == result.SearchTypeId).Value; + var resultController = this.GetSearchResultControllers().SingleOrDefault(sc => sc.Key == result.SearchTypeId).Value; return resultController != null && resultController.HasViewPermission(result); } diff --git a/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs b/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs index 6e86a69826a..f1ffe1dbefc 100644 --- a/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs +++ b/DNN Platform/Library/Services/Search/Controllers/UserResultController.cs @@ -49,7 +49,7 @@ public override bool HasViewPermission(SearchResult searchResult) return false; } - var userInSearchResult = UserController.GetUserById(PortalSettings.PortalId, userId); + var userInSearchResult = UserController.GetUserById(this.PortalSettings.PortalId, userId); if (userInSearchResult == null || userInSearchResult.IsDeleted) { return false; @@ -68,7 +68,7 @@ public override bool HasViewPermission(SearchResult searchResult) var extendedVisibility = searchResult.UniqueKey.IndexOf("_") != searchResult.UniqueKey.LastIndexOf("_") ? searchResult.UniqueKey.Split('_')[2] : string.Empty; - return HasSocialReplationship(userInSearchResult, UserController.Instance.GetCurrentUserInfo(), extendedVisibility); + return this.HasSocialReplationship(userInSearchResult, UserController.Instance.GetCurrentUserInfo(), extendedVisibility); } if (searchResult.UniqueKey.Contains("membersonly")) @@ -100,7 +100,7 @@ public override bool HasViewPermission(SearchResult searchResult) public override string GetDocUrl(SearchResult searchResult) { - var url = TestableGlobals.Instance.NavigateURL(PortalSettings.UserTabId, string.Empty, "userid=" + GetUserId(searchResult)); + var url = TestableGlobals.Instance.NavigateURL(this.PortalSettings.UserTabId, string.Empty, "userid=" + GetUserId(searchResult)); return url; } @@ -117,7 +117,7 @@ private bool HasSocialReplationship(UserInfo targetUser, UserInfo accessingUser, return false; } - var profileVisibility = new ProfileVisibility(PortalSettings.PortalId, extendedVisibility); + var profileVisibility = new ProfileVisibility(this.PortalSettings.PortalId, extendedVisibility); var isVisible = accessingUser.UserID == targetUser.UserID; if (!isVisible) diff --git a/DNN Platform/Library/Services/Search/Entities/SearchDocument.cs b/DNN Platform/Library/Services/Search/Entities/SearchDocument.cs index 60118820caa..a0acc66a15d 100644 --- a/DNN Platform/Library/Services/Search/Entities/SearchDocument.cs +++ b/DNN Platform/Library/Services/Search/Entities/SearchDocument.cs @@ -79,8 +79,8 @@ public class SearchDocument : SearchDocumentToDelete public SearchDocument() { - Tags = new string[0]; - IsActive = true; + this.Tags = new string[0]; + this.IsActive = true; } #endregion @@ -89,15 +89,15 @@ public override string ToString() { return string.Join(", ", new[] { - "Portal ID: " + PortalId, - "Tab ID: " + TabId, - "Module ID: " + ModuleId, - "Mod. Def.ID: " + ModuleDefId, - "Url: " + Url, - "Unique Key: " + UniqueKey, - "Last Modified: " + ModifiedTimeUtc.ToString("O"), - "Culture: " + CultureCode, - "Search Type: " + SearchTypeId + "Portal ID: " + this.PortalId, + "Tab ID: " + this.TabId, + "Module ID: " + this.ModuleId, + "Mod. Def.ID: " + this.ModuleDefId, + "Url: " + this.Url, + "Unique Key: " + this.UniqueKey, + "Last Modified: " + this.ModifiedTimeUtc.ToString("O"), + "Culture: " + this.CultureCode, + "Search Type: " + this.SearchTypeId }); } } diff --git a/DNN Platform/Library/Services/Search/Entities/SearchDocumentToDelete.cs b/DNN Platform/Library/Services/Search/Entities/SearchDocumentToDelete.cs index 7859907e5af..e8054a7ea22 100644 --- a/DNN Platform/Library/Services/Search/Entities/SearchDocumentToDelete.cs +++ b/DNN Platform/Library/Services/Search/Entities/SearchDocumentToDelete.cs @@ -101,16 +101,16 @@ public class SearchDocumentToDelete public SearchDocumentToDelete() { - Keywords = new Dictionary(); - NumericKeys = new Dictionary(); - CultureCode = string.Empty; - SearchTypeId = - PortalId = - RoleId = -1; - ModuleDefId = - ModuleId = - TabId = - AuthorUserId = 0; + this.Keywords = new Dictionary(); + this.NumericKeys = new Dictionary(); + this.CultureCode = string.Empty; + this.SearchTypeId = + this.PortalId = + this.RoleId = -1; + this.ModuleDefId = + this.ModuleId = + this.TabId = + this.AuthorUserId = 0; } /// diff --git a/DNN Platform/Library/Services/Search/Entities/SearchQuery.cs b/DNN Platform/Library/Services/Search/Entities/SearchQuery.cs index 0a62b87c8e6..6a903694b12 100644 --- a/DNN Platform/Library/Services/Search/Entities/SearchQuery.cs +++ b/DNN Platform/Library/Services/Search/Entities/SearchQuery.cs @@ -165,17 +165,17 @@ public class SearchQuery public SearchQuery() { - Tags = new string[0]; - PortalIds = new int[0]; - SearchTypeIds = new int[0]; - ModuleDefIds = new int[0]; - TitleSnippetLength = 60; - BodySnippetLength = 100; - PageSize = 10; - PageIndex = 1; - SearchContext = new Dictionary(); - CustomKeywords = new Dictionary(); - NumericKeys = new Dictionary(); + this.Tags = new string[0]; + this.PortalIds = new int[0]; + this.SearchTypeIds = new int[0]; + this.ModuleDefIds = new int[0]; + this.TitleSnippetLength = 60; + this.BodySnippetLength = 100; + this.PageSize = 10; + this.PageIndex = 1; + this.SearchContext = new Dictionary(); + this.CustomKeywords = new Dictionary(); + this.NumericKeys = new Dictionary(); } #endregion diff --git a/DNN Platform/Library/Services/Search/Entities/SearchResult.cs b/DNN Platform/Library/Services/Search/Entities/SearchResult.cs index ac73218dfc7..3aeef730f83 100644 --- a/DNN Platform/Library/Services/Search/Entities/SearchResult.cs +++ b/DNN Platform/Library/Services/Search/Entities/SearchResult.cs @@ -25,7 +25,7 @@ public class SearchResult : SearchDocument /// /// Time when Content was last modified (in friendly format) /// - public string DisplayModifiedTime { get { return DateUtils.CalculateDateForDisplay(ModifiedTimeUtc); } } + public string DisplayModifiedTime { get { return DateUtils.CalculateDateForDisplay(this.ModifiedTimeUtc); } } /// /// Highlighted snippet from document @@ -61,10 +61,10 @@ public class SearchResult : SearchDocument /// public SearchResult() { - Tags = new string[0]; - NumericKeys = new Dictionary(); - Keywords = new Dictionary(); - SearchContext = new Dictionary(); + this.Tags = new string[0]; + this.NumericKeys = new Dictionary(); + this.Keywords = new Dictionary(); + this.SearchContext = new Dictionary(); } } } diff --git a/DNN Platform/Library/Services/Search/Entities/SearchResults.cs b/DNN Platform/Library/Services/Search/Entities/SearchResults.cs index 508e7410ac5..9bc85da1b42 100644 --- a/DNN Platform/Library/Services/Search/Entities/SearchResults.cs +++ b/DNN Platform/Library/Services/Search/Entities/SearchResults.cs @@ -32,7 +32,7 @@ public class SearchResults public SearchResults() { - Results = new List(); + this.Results = new List(); } } } diff --git a/DNN Platform/Library/Services/Search/IndexingProvider.cs b/DNN Platform/Library/Services/Search/IndexingProvider.cs index a0f1a1575e4..92b8ddda8ed 100644 --- a/DNN Platform/Library/Services/Search/IndexingProvider.cs +++ b/DNN Platform/Library/Services/Search/IndexingProvider.cs @@ -51,7 +51,7 @@ public virtual IEnumerable GetSearchDocuments(int portalId, Date protected DateTime GetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, DateTime localTime) { var lastTime = SearchHelper.Instance.GetIndexerCheckpointUtcTime( - scheduleId, ScheduleItemSettingKey(portalId, TimePostfix)).ToLocalTime(); + scheduleId, this.ScheduleItemSettingKey(portalId, TimePostfix)).ToLocalTime(); return lastTime < localTime ? lastTime : localTime; } @@ -62,7 +62,7 @@ protected DateTime GetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, D protected void SetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, DateTime localTime) { SearchHelper.Instance.SetIndexerCheckpointUtcTime( - scheduleId, ScheduleItemSettingKey(portalId, TimePostfix), localTime.ToUniversalTime()); + scheduleId, this.ScheduleItemSettingKey(portalId, TimePostfix), localTime.ToUniversalTime()); } /// Retrieves free format data to help the indexer to perform its job @@ -71,7 +71,7 @@ protected void SetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, DateT /// The checkpoint data protected string GetLastCheckpointData(int portalId, int scheduleId) { - return SearchHelper.Instance.GetIndexerCheckpointData(scheduleId, ScheduleItemSettingKey(portalId, DataPostfix)); + return SearchHelper.Instance.GetIndexerCheckpointData(scheduleId, this.ScheduleItemSettingKey(portalId, DataPostfix)); } /// Stores free format data to help the indexer to perform its job @@ -80,7 +80,7 @@ protected string GetLastCheckpointData(int portalId, int scheduleId) /// The data to store. protected void SetLastCheckpointData(int portalId, int scheduleId, string data) { - SearchHelper.Instance.SetIndexerCheckpointData(scheduleId, ScheduleItemSettingKey(portalId, DataPostfix), data); + SearchHelper.Instance.SetIndexerCheckpointData(scheduleId, this.ScheduleItemSettingKey(portalId, DataPostfix), data); } /// @@ -107,7 +107,7 @@ protected void SetLastCheckpointData(int portalId, int scheduleId, string data) private string ScheduleItemSettingKey(int portalId, string propertyId) { Requires.NotNullOrEmpty("propertyId", propertyId); - var t = GetType(); + var t = this.GetType(); return string.Join("_", "Search", t.Name, t.FullName.GetHashCode().ToString("x8"), portalId.ToString(), propertyId); } } diff --git a/DNN Platform/Library/Services/Search/IndexingProviderBase.cs b/DNN Platform/Library/Services/Search/IndexingProviderBase.cs index a985081e8e3..21a30ff3de3 100644 --- a/DNN Platform/Library/Services/Search/IndexingProviderBase.cs +++ b/DNN Platform/Library/Services/Search/IndexingProviderBase.cs @@ -38,7 +38,7 @@ public abstract int IndexSearchDocuments(int portalId, protected DateTime GetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, DateTime localTime) { var lastTime = SearchHelper.Instance.GetIndexerCheckpointUtcTime( - scheduleId, ScheduleItemSettingKey(portalId, TimePostfix)).ToLocalTime(); + scheduleId, this.ScheduleItemSettingKey(portalId, TimePostfix)).ToLocalTime(); return lastTime < localTime ? lastTime : localTime; } @@ -49,7 +49,7 @@ protected DateTime GetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, D protected void SetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, DateTime localTime) { SearchHelper.Instance.SetIndexerCheckpointUtcTime( - scheduleId, ScheduleItemSettingKey(portalId, TimePostfix), localTime.ToUniversalTime()); + scheduleId, this.ScheduleItemSettingKey(portalId, TimePostfix), localTime.ToUniversalTime()); } /// Retrieves free format data to help the indexer to perform its job @@ -58,7 +58,7 @@ protected void SetLocalTimeOfLastIndexedItem(int portalId, int scheduleId, DateT /// The checkpoint data protected string GetLastCheckpointData(int portalId, int scheduleId) { - return SearchHelper.Instance.GetIndexerCheckpointData(scheduleId, ScheduleItemSettingKey(portalId, DataPostfix)); + return SearchHelper.Instance.GetIndexerCheckpointData(scheduleId, this.ScheduleItemSettingKey(portalId, DataPostfix)); } /// Stores free format data to help the indexer to perform its job @@ -67,7 +67,7 @@ protected string GetLastCheckpointData(int portalId, int scheduleId) /// The data to store. protected void SetLastCheckpointData(int portalId, int scheduleId, string data) { - SearchHelper.Instance.SetIndexerCheckpointData(scheduleId, ScheduleItemSettingKey(portalId, DataPostfix), data); + SearchHelper.Instance.SetIndexerCheckpointData(scheduleId, this.ScheduleItemSettingKey(portalId, DataPostfix), data); } [Obsolete("Deprecated in DNN 7.4.2 Use 'IndexSearchDocuments' instead for lower memory footprint during search.. Scheduled removal in v10.0.0.")] @@ -79,7 +79,7 @@ public virtual IEnumerable GetSearchDocuments(int portalId, Date [Obsolete("Legacy Search (ISearchable) -- Deprecated in DNN 7.1. Use 'IndexSearchDocuments' instead.. Scheduled removal in v10.0.0.")] public virtual SearchItemInfoCollection GetSearchIndexItems(int portalId) { - return null; + return new SearchItemInfoCollection(); } /// @@ -106,7 +106,7 @@ public virtual SearchItemInfoCollection GetSearchIndexItems(int portalId) private string ScheduleItemSettingKey(int portalId, string propertyId) { Requires.NotNullOrEmpty("propertyId", propertyId); - var t = GetType(); + var t = this.GetType(); return string.Join("_", "Search", t.Name, t.FullName.GetHashCode().ToString("x8"), portalId.ToString(), propertyId); } } diff --git a/DNN Platform/Library/Services/Search/Internals/InternalSearchControllerImpl.cs b/DNN Platform/Library/Services/Search/Internals/InternalSearchControllerImpl.cs index 86179f544e4..8f4f1639a30 100644 --- a/DNN Platform/Library/Services/Search/Internals/InternalSearchControllerImpl.cs +++ b/DNN Platform/Library/Services/Search/Internals/InternalSearchControllerImpl.cs @@ -64,11 +64,11 @@ internal class InternalSearchControllerImpl : IInternalSearchController public InternalSearchControllerImpl() { var hostController = HostController.Instance; - _titleBoost = hostController.GetInteger(Constants.SearchTitleBoostSetting, Constants.DefaultSearchTitleBoost); - _tagBoost = hostController.GetInteger(Constants.SearchTagBoostSetting, Constants.DefaultSearchTagBoost); - _contentBoost = hostController.GetInteger(Constants.SearchContentBoostSetting, Constants.DefaultSearchKeywordBoost); - _descriptionBoost = hostController.GetInteger(Constants.SearchDescriptionBoostSetting, Constants.DefaultSearchDescriptionBoost); - _authorBoost = hostController.GetInteger(Constants.SearchAuthorBoostSetting, Constants.DefaultSearchAuthorBoost); + this._titleBoost = hostController.GetInteger(Constants.SearchTitleBoostSetting, Constants.DefaultSearchTitleBoost); + this._tagBoost = hostController.GetInteger(Constants.SearchTagBoostSetting, Constants.DefaultSearchTagBoost); + this._contentBoost = hostController.GetInteger(Constants.SearchContentBoostSetting, Constants.DefaultSearchKeywordBoost); + this._descriptionBoost = hostController.GetInteger(Constants.SearchDescriptionBoostSetting, Constants.DefaultSearchDescriptionBoost); + this._authorBoost = hostController.GetInteger(Constants.SearchAuthorBoostSetting, Constants.DefaultSearchAuthorBoost); } #endregion @@ -146,7 +146,7 @@ public IEnumerable GetSearchContentSourceList(int portalId) 120, CacheItemPriority.Default); var list = CBO.GetCachedObject>( - searchableModuleDefsCacheArgs, SearchContentSourceCallback); + searchableModuleDefsCacheArgs, this.SearchContentSourceCallback); return list; } @@ -156,7 +156,7 @@ private object SearchDocumentTypeDisplayNameCallBack(CacheItemArgs cacheItem) var data = new Dictionary(); foreach (PortalInfo portal in PortalController.Instance.GetPortals()) { - var searchContentSources = GetSearchContentSourceList(portal.PortalID); + var searchContentSources = this.GetSearchContentSourceList(portal.PortalID); foreach (var searchContentSource in searchContentSources) { var key = string.Format("{0}-{1}", searchContentSource.SearchTypeId, searchContentSource.ModuleDefinitionId); @@ -173,7 +173,7 @@ public string GetSearchDocumentTypeDisplayName(SearchResult searchResult) //ModuleDefId will be zero for non-module var key = string.Format("{0}-{1}", searchResult.SearchTypeId, searchResult.ModuleDefId); var keys = CBO.Instance.GetCachedObject>( - new CacheItemArgs(key, 120, CacheItemPriority.Default), SearchDocumentTypeDisplayNameCallBack, false); + new CacheItemArgs(key, 120, CacheItemPriority.Default), this.SearchDocumentTypeDisplayNameCallBack, false); return keys.ContainsKey(key) ? keys[key] : string.Empty; } @@ -182,7 +182,7 @@ public string GetSearchDocumentTypeDisplayName(SearchResult searchResult) public void AddSearchDocument(SearchDocument searchDocument) { - AddSearchDocumentInternal(searchDocument, false); + this.AddSearchDocumentInternal(searchDocument, false); } private void AddSearchDocumentInternal(SearchDocument searchDocument, bool autoCommit) @@ -193,7 +193,7 @@ private void AddSearchDocumentInternal(SearchDocument searchDocument, bool autoC Requires.PropertyNotEqualTo("searchDocument", "SearchTypeId", searchDocument.SearchTypeId, 0); Requires.PropertyNotEqualTo("searchDocument", "ModifiedTimeUtc", searchDocument.ModifiedTimeUtc.ToString(CultureInfo.InvariantCulture), DateTime.MinValue.ToString(CultureInfo.InvariantCulture)); - if (searchDocument.SearchTypeId == _moduleSearchTypeId) + if (searchDocument.SearchTypeId == this._moduleSearchTypeId) { if(searchDocument.ModuleDefId <= 0) throw new ArgumentException( Localization.Localization.GetExceptionMessage("ModuleDefIdMustBeGreaterThanZero","ModuleDefId must be greater than zero when SearchTypeId is for a module")); @@ -226,11 +226,11 @@ private void AddSearchDocumentInternal(SearchDocument searchDocument, bool autoC //Index.NOT_ANALYZED | Do index the field, but don’t analyze the String value.Instead, treat the Field’s entire value as a single token and make that token searchable. // Generic and Additional SearchDocument Params - AddSearchDocumentParamters(doc, searchDocument, sb); + this.AddSearchDocumentParamters(doc, searchDocument, sb); //Remove the existing document from Lucene - DeleteSearchDocumentInternal(searchDocument, false); + this.DeleteSearchDocumentInternal(searchDocument, false); //Add only when Document is active. The previous call would have otherwise deleted the document if it existed earlier if (searchDocument.IsActive) @@ -248,7 +248,7 @@ private void AddSearchDocumentInternal(SearchDocument searchDocument, bool autoC if (autoCommit) { - Commit(); + this.Commit(); } } @@ -265,7 +265,7 @@ public void AddSearchDocuments(IEnumerable searchDocuments) { try { - AddSearchDocumentInternal(searchDoc, (++idx%commitBatchSize) == 0); + this.AddSearchDocumentInternal(searchDoc, (++idx%commitBatchSize) == 0); //added = true; } catch (Exception ex) @@ -285,7 +285,7 @@ public void AddSearchDocuments(IEnumerable searchDocuments) public void DeleteSearchDocument(SearchDocument searchDocument) { - DeleteSearchDocumentInternal(searchDocument, false); + this.DeleteSearchDocumentInternal(searchDocument, false); } private void DeleteSearchDocumentInternal(SearchDocument searchDocument, bool autoCommit) @@ -326,7 +326,7 @@ private void DeleteSearchDocumentInternal(SearchDocument searchDocument, bool au if (autoCommit) { - Commit(); + this.Commit(); } } @@ -339,7 +339,7 @@ public void DeleteSearchDocumentsByModule(int portalId, int moduleId, int module { Requires.NotNegative("PortalId", portalId); - DeleteSearchDocument(new SearchDocument + this.DeleteSearchDocument(new SearchDocument { PortalId = portalId, ModuleId = moduleId, @@ -352,7 +352,7 @@ public void DeleteAllDocuments(int portalId, int searchTypeId) { Requires.NotNegative("SearchTypeId", searchTypeId); - DeleteSearchDocument(new SearchDocument + this.DeleteSearchDocument(new SearchDocument { PortalId = portalId, SearchTypeId = searchTypeId @@ -392,14 +392,14 @@ private void AddSearchDocumentParamters(Document doc, SearchDocument searchDocum if (!string.IsNullOrEmpty(searchDocument.Title)) { var field = new Field(Constants.TitleTag, StripTagsRetainAttributes(searchDocument.Title, HtmlAttributesToRetain, false, true), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); - if (_titleBoost >0 && _titleBoost != Constants.StandardLuceneBoost) field.Boost = _titleBoost / 10f; + if (this._titleBoost >0 && this._titleBoost != Constants.StandardLuceneBoost) field.Boost = this._titleBoost / 10f; doc.Add(field); } if (!string.IsNullOrEmpty(searchDocument.Description)) { var field = new Field(Constants.DescriptionTag, StripTagsRetainAttributes(searchDocument.Description, HtmlAttributesToRetain, false, true), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); - if (_descriptionBoost > 0 && _descriptionBoost != Constants.StandardLuceneBoost) field.Boost = _descriptionBoost / 10f; + if (this._descriptionBoost > 0 && this._descriptionBoost != Constants.StandardLuceneBoost) field.Boost = this._descriptionBoost / 10f; doc.Add(field); } @@ -426,27 +426,27 @@ private void AddSearchDocumentParamters(Document doc, SearchDocument searchDocum switch (key) { case Constants.TitleTag: - if (_titleBoost > 0 && _titleBoost != Constants.StandardLuceneBoost) + if (this._titleBoost > 0 && this._titleBoost != Constants.StandardLuceneBoost) { - field.Boost = _titleBoost / 10f; + field.Boost = this._titleBoost / 10f; } break; case Constants.SubjectTag: - if (_contentBoost > 0 && _contentBoost != Constants.StandardLuceneBoost) + if (this._contentBoost > 0 && this._contentBoost != Constants.StandardLuceneBoost) { - field.Boost = _contentBoost / 10f; + field.Boost = this._contentBoost / 10f; } break; case Constants.CommentsTag: - if (_descriptionBoost > 0 && _descriptionBoost != Constants.StandardLuceneBoost) + if (this._descriptionBoost > 0 && this._descriptionBoost != Constants.StandardLuceneBoost) { - field.Boost = _descriptionBoost / 10f; + field.Boost = this._descriptionBoost / 10f; } break; case Constants.AuthorNameTag: - if (_authorBoost > 0 && _authorBoost != Constants.StandardLuceneBoost) + if (this._authorBoost > 0 && this._authorBoost != Constants.StandardLuceneBoost) { - field.Boost = _authorBoost / 10f; + field.Boost = this._authorBoost / 10f; } break; } @@ -466,9 +466,9 @@ private void AddSearchDocumentParamters(Document doc, SearchDocument searchDocum var field = new Field(Constants.Tag, SearchHelper.Instance.StripTagsNoAttributes(tag.ToLowerInvariant(), true), Field.Store.YES, Field.Index.NOT_ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); if (!tagBoostApplied) { - if (_tagBoost > 0 && _tagBoost != Constants.StandardLuceneBoost) + if (this._tagBoost > 0 && this._tagBoost != Constants.StandardLuceneBoost) { - field.Boost = _tagBoost / 10f; + field.Boost = this._tagBoost / 10f; tagBoostApplied = true; } } @@ -487,7 +487,7 @@ private void AddSearchDocumentParamters(Document doc, SearchDocument searchDocum if (user != null && !string.IsNullOrEmpty(user.DisplayName)) { var field = new Field(Constants.AuthorNameTag, user.DisplayName, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); - if (_authorBoost > 0 && _authorBoost != Constants.StandardLuceneBoost) field.Boost = _authorBoost / 10f; + if (this._authorBoost > 0 && this._authorBoost != Constants.StandardLuceneBoost) field.Boost = this._authorBoost / 10f; doc.Add(field); } } @@ -503,7 +503,7 @@ private void AddSearchDocumentParamters(Document doc, SearchDocument searchDocum { var field = new Field(Constants.ContentTag, SearchHelper.Instance.StripTagsNoAttributes(sb.ToString(), true), Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); doc.Add(field); - if (_contentBoost > 0 && _contentBoost != Constants.StandardLuceneBoost) field.Boost = _contentBoost/10f; + if (this._contentBoost > 0 && this._contentBoost != Constants.StandardLuceneBoost) field.Boost = this._contentBoost/10f; } } diff --git a/DNN Platform/Library/Services/Search/Internals/LuceneControllerImpl.cs b/DNN Platform/Library/Services/Search/Internals/LuceneControllerImpl.cs index 045c3736d22..bafe70fcf48 100644 --- a/DNN Platform/Library/Services/Search/Internals/LuceneControllerImpl.cs +++ b/DNN Platform/Library/Services/Search/Internals/LuceneControllerImpl.cs @@ -76,14 +76,14 @@ public LuceneControllerImpl() var folder = hostController.GetString(Constants.SearchIndexFolderKey, DefaultSearchFolder); if (string.IsNullOrEmpty(folder)) folder = DefaultSearchFolder; - IndexFolder = Path.Combine(Globals.ApplicationMapPath, folder); - _readerTimeSpan = hostController.GetDouble(Constants.SearchReaderRefreshTimeKey, DefaultRereadTimeSpan); - _searchRetryTimes = hostController.GetInteger(Constants.SearchRetryTimesKey, DefaultSearchRetryTimes); + this.IndexFolder = Path.Combine(Globals.ApplicationMapPath, folder); + this._readerTimeSpan = hostController.GetDouble(Constants.SearchReaderRefreshTimeKey, DefaultRereadTimeSpan); + this._searchRetryTimes = hostController.GetInteger(Constants.SearchRetryTimesKey, DefaultSearchRetryTimes); } private void CheckDisposed() { - if (Thread.VolatileRead(ref _isDisposed) == DISPOSED) + if (Thread.VolatileRead(ref this._isDisposed) == DISPOSED) throw new ObjectDisposedException(Localization.Localization.GetExceptionMessage("LuceneControlerIsDisposed","LuceneController is disposed and cannot be used anymore")); } #endregion @@ -92,13 +92,13 @@ private IndexWriter Writer { get { - if (_writer == null) + if (this._writer == null) { - lock (_writerLock) + lock (this._writerLock) { - if (_writer == null) + if (this._writer == null) { - var lockFile = Path.Combine(IndexFolder, WriteLockFile); + var lockFile = Path.Combine(this.IndexFolder, WriteLockFile); if (File.Exists(lockFile)) { try @@ -117,62 +117,62 @@ private IndexWriter Writer } } - CheckDisposed(); - var writer = new IndexWriter(FSDirectory.Open(IndexFolder), - GetCustomAnalyzer() ?? new SynonymAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED); - _idxReader = writer.GetReader(); + this.CheckDisposed(); + var writer = new IndexWriter(FSDirectory.Open(this.IndexFolder), + this.GetCustomAnalyzer() ?? new SynonymAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED); + this._idxReader = writer.GetReader(); Thread.MemoryBarrier(); - _writer = writer; + this._writer = writer; } } } - return _writer; + return this._writer; } } // made internal to be used in unit tests only; otherwise could be made private internal IndexSearcher GetSearcher() { - if (_reader == null || MustRereadIndex) + if (this._reader == null || this.MustRereadIndex) { - CheckValidIndexFolder(); - UpdateLastAccessTimes(); - InstantiateReader(); + this.CheckValidIndexFolder(); + this.UpdateLastAccessTimes(); + this.InstantiateReader(); } - return _reader.GetSearcher(); + return this._reader.GetSearcher(); } private void InstantiateReader() { IndexSearcher searcher; - if (_idxReader != null) + if (this._idxReader != null) { //use the Reopen() method for better near-realtime when the _writer ins't null - var newReader = _idxReader.Reopen(); - if (_idxReader != newReader) + var newReader = this._idxReader.Reopen(); + if (this._idxReader != newReader) { //_idxReader.Dispose(); -- will get disposed upon disposing the searcher - Interlocked.Exchange(ref _idxReader, newReader); + Interlocked.Exchange(ref this._idxReader, newReader); } - searcher = new IndexSearcher(_idxReader); + searcher = new IndexSearcher(this._idxReader); } else { // Note: disposing the IndexSearcher instance obtained from the next // statement will not close the underlying reader on dispose. - searcher = new IndexSearcher(FSDirectory.Open(IndexFolder)); + searcher = new IndexSearcher(FSDirectory.Open(this.IndexFolder)); } var reader = new CachedReader(searcher); - var cutoffTime = DateTime.Now - TimeSpan.FromSeconds(_readerTimeSpan*10); - lock (((ICollection) _oldReaders).SyncRoot) + var cutoffTime = DateTime.Now - TimeSpan.FromSeconds(this._readerTimeSpan*10); + lock (((ICollection) this._oldReaders).SyncRoot) { - CheckDisposed(); - _oldReaders.RemoveAll(r => r.LastUsed <= cutoffTime); - _oldReaders.Add(reader); - Interlocked.Exchange(ref _reader, reader); + this.CheckDisposed(); + this._oldReaders.RemoveAll(r => r.LastUsed <= cutoffTime); + this._oldReaders.Add(reader); + Interlocked.Exchange(ref this._reader, reader); } } @@ -183,18 +183,18 @@ private bool MustRereadIndex { get { - return (DateTime.UtcNow - _lastReadTimeUtc).TotalSeconds >= _readerTimeSpan && - System.IO.Directory.Exists(IndexFolder) && - System.IO.Directory.GetLastWriteTimeUtc(IndexFolder) != _lastDirModifyTimeUtc; + return (DateTime.UtcNow - this._lastReadTimeUtc).TotalSeconds >= this._readerTimeSpan && + System.IO.Directory.Exists(this.IndexFolder) && + System.IO.Directory.GetLastWriteTimeUtc(this.IndexFolder) != this._lastDirModifyTimeUtc; } } private void UpdateLastAccessTimes() { - _lastReadTimeUtc = DateTime.UtcNow; - if (System.IO.Directory.Exists(IndexFolder)) + this._lastReadTimeUtc = DateTime.UtcNow; + if (System.IO.Directory.Exists(this.IndexFolder)) { - _lastDirModifyTimeUtc = System.IO.Directory.GetLastWriteTimeUtc(IndexFolder); + this._lastDirModifyTimeUtc = System.IO.Directory.GetLastWriteTimeUtc(this.IndexFolder); } } @@ -202,15 +202,15 @@ private void RescheduleAccessTimes() { // forces re-opening the reader within 30 seconds from now (used mainly by commit) var now = DateTime.UtcNow; - if (_readerTimeSpan > DefaultRereadTimeSpan && (now - _lastReadTimeUtc).TotalSeconds > DefaultRereadTimeSpan) + if (this._readerTimeSpan > DefaultRereadTimeSpan && (now - this._lastReadTimeUtc).TotalSeconds > DefaultRereadTimeSpan) { - _lastReadTimeUtc = now - TimeSpan.FromSeconds(_readerTimeSpan - DefaultRereadTimeSpan); + this._lastReadTimeUtc = now - TimeSpan.FromSeconds(this._readerTimeSpan - DefaultRereadTimeSpan); } } private void CheckValidIndexFolder() { - if (!ValidateIndexFolder()) + if (!this.ValidateIndexFolder()) { throw new SearchIndexEmptyException(Localization.Localization.GetExceptionMessage("SearchIndexingDirectoryNoValid","Search indexing directory is either empty or does not exist")); } @@ -218,22 +218,22 @@ private void CheckValidIndexFolder() private bool ValidateIndexFolder() { - return System.IO.Directory.Exists(IndexFolder) && - System.IO.Directory.GetFiles(IndexFolder, "*.*").Length > 0; + return System.IO.Directory.Exists(this.IndexFolder) && + System.IO.Directory.GetFiles(this.IndexFolder, "*.*").Length > 0; } private FastVectorHighlighter FastHighlighter { get { - if (_fastHighlighter == null) + if (this._fastHighlighter == null) { FragListBuilder fragListBuilder = new SimpleFragListBuilder(); FragmentsBuilder fragmentBuilder = new ScoreOrderFragmentsBuilder( new[] { HighlightPreTag }, new[] { HighlightPostTag }); - _fastHighlighter = new FastVectorHighlighter(true, true, fragListBuilder, fragmentBuilder); + this._fastHighlighter = new FastVectorHighlighter(true, true, fragListBuilder, fragmentBuilder); } - return _fastHighlighter; + return this._fastHighlighter; } } @@ -249,22 +249,22 @@ public LuceneResults Search(LuceneSearchContext searchContext) var luceneResults = new LuceneResults(); //validate whether index folder is exist and contains index files, otherwise return null. - if (!ValidateIndexFolder()) + if (!this.ValidateIndexFolder()) { return luceneResults; } - var highlighter = FastHighlighter; + var highlighter = this.FastHighlighter; var fieldQuery = highlighter.GetFieldQuery(searchContext.LuceneQuery.Query); var maxResults = searchContext.LuceneQuery.PageIndex * searchContext.LuceneQuery.PageSize; var minResults = maxResults - searchContext.LuceneQuery.PageSize + 1; - for (var i = 0; i < _searchRetryTimes; i++) + for (var i = 0; i < this._searchRetryTimes; i++) { try { - var searcher = GetSearcher(); + var searcher = this.GetSearcher(); var searchSecurityTrimmer = new SearchSecurityTrimmer(new SearchSecurityTrimmerContext { Searcher = searcher, @@ -290,22 +290,22 @@ public LuceneResults Search(LuceneSearchContext searchContext) { Document = searcher.Doc(match.Doc), Score = match.Score, - DisplayScore = GetDisplayScoreFromMatch(match.ToString()), - TitleSnippet = GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.TitleTag, searchContext.LuceneQuery.TitleSnippetLength), - BodySnippet = GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.BodyTag, searchContext.LuceneQuery.BodySnippetLength), - DescriptionSnippet = GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.DescriptionTag, searchContext.LuceneQuery.TitleSnippetLength), - TagSnippet = GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.Tag, searchContext.LuceneQuery.TitleSnippetLength), - AuthorSnippet = GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.AuthorNameTag, searchContext.LuceneQuery.TitleSnippetLength), - ContentSnippet = GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.ContentTag, searchContext.LuceneQuery.TitleSnippetLength) + DisplayScore = this.GetDisplayScoreFromMatch(match.ToString()), + TitleSnippet = this.GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.TitleTag, searchContext.LuceneQuery.TitleSnippetLength), + BodySnippet = this.GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.BodyTag, searchContext.LuceneQuery.BodySnippetLength), + DescriptionSnippet = this.GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.DescriptionTag, searchContext.LuceneQuery.TitleSnippetLength), + TagSnippet = this.GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.Tag, searchContext.LuceneQuery.TitleSnippetLength), + AuthorSnippet = this.GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.AuthorNameTag, searchContext.LuceneQuery.TitleSnippetLength), + ContentSnippet = this.GetHighlightedText(highlighter, fieldQuery, searcher, match, Constants.ContentTag, searchContext.LuceneQuery.TitleSnippetLength) }).ToList(); break; } catch (Exception ex) when (ex is IOException || ex is AlreadyClosedException) { - DisposeReaders(); - DisposeWriter(false); + this.DisposeReaders(); + this.DisposeWriter(false); - if (i == _searchRetryTimes - 1) + if (i == this._searchRetryTimes - 1) { throw; } @@ -367,15 +367,15 @@ public void Add(Document doc) { try { - Writer.AddDocument(doc); + this.Writer.AddDocument(doc); } catch (OutOfMemoryException) { - lock (_writerLock) + lock (this._writerLock) { // as suggested by Lucene's doc - DisposeWriter(); - Writer.AddDocument(doc); + this.DisposeWriter(); + this.Writer.AddDocument(doc); } } } @@ -384,20 +384,20 @@ public void Add(Document doc) public void Delete(Query query) { Requires.NotNull("luceneQuery", query); - Writer.DeleteDocuments(query); + this.Writer.DeleteDocuments(query); } public void Commit() { - if (_writer != null) + if (this._writer != null) { - lock (_writerLock) + lock (this._writerLock) { - if (_writer != null) + if (this._writer != null) { - CheckDisposed(); - _writer.Commit(); - RescheduleAccessTimes(); + this.CheckDisposed(); + this._writer.Commit(); + this.RescheduleAccessTimes(); } } } @@ -405,7 +405,7 @@ public void Commit() public bool OptimizeSearchIndex(bool doWait) { - var writer = _writer; + var writer = this._writer; if (writer != null && writer.HasDeletions()) { if (doWait) @@ -413,13 +413,13 @@ public bool OptimizeSearchIndex(bool doWait) Logger.Debug("Compacting Search Index - started"); } - CheckDisposed(); + this.CheckDisposed(); //optimize down to "> 1 segments" for better performance than down to 1 - _writer.Optimize(4, doWait); + this._writer.Optimize(4, doWait); if (doWait) { - Commit(); + this.Commit(); Logger.Debug("Compacting Search Index - finished"); } @@ -431,32 +431,32 @@ public bool OptimizeSearchIndex(bool doWait) public bool HasDeletions() { - CheckDisposed(); - var searcher = GetSearcher(); + this.CheckDisposed(); + var searcher = this.GetSearcher(); return searcher.IndexReader.HasDeletions; } public int MaxDocsCount() { - CheckDisposed(); - var searcher = GetSearcher(); + this.CheckDisposed(); + var searcher = this.GetSearcher(); return searcher.IndexReader.MaxDoc; } public int SearchbleDocsCount() { - CheckDisposed(); - var searcher = GetSearcher(); + this.CheckDisposed(); + var searcher = this.GetSearcher(); return searcher.IndexReader.NumDocs(); } // works on the computer (in a web-farm) that runs under the scheduler public SearchStatistics GetSearchStatistics() { - CheckDisposed(); - var searcher = GetSearcher(); + this.CheckDisposed(); + var searcher = this.GetSearcher(); - var files = System.IO.Directory.GetFiles(IndexFolder, "*.*"); + var files = System.IO.Directory.GetFiles(this.IndexFolder, "*.*"); var size = files.Select(name => new FileInfo(name)).Select(fInfo => fInfo.Length).Sum(); return new SearchStatistics @@ -464,19 +464,19 @@ public SearchStatistics GetSearchStatistics() //Hack: seems that NumDocs/MaxDoc are buggy and return incorrect/swapped values TotalActiveDocuments = searcher.IndexReader.NumDocs(), TotalDeletedDocuments = searcher.IndexReader.NumDeletedDocs, - IndexLocation = IndexFolder, - LastModifiedOn = System.IO.Directory.GetLastWriteTimeUtc(IndexFolder), + IndexLocation = this.IndexFolder, + LastModifiedOn = System.IO.Directory.GetLastWriteTimeUtc(this.IndexFolder), IndexDbSize = size }; } public void Dispose() { - var status = Interlocked.CompareExchange(ref _isDisposed, DISPOSED, UNDISPOSED); + var status = Interlocked.CompareExchange(ref this._isDisposed, DISPOSED, UNDISPOSED); if (status == UNDISPOSED) { - DisposeWriter(); - DisposeReaders(); + this.DisposeWriter(); + this.DisposeReaders(); } } @@ -515,22 +515,22 @@ public Analyzer GetCustomAnalyzer() private void DisposeWriter(bool commit = true) { - if (_writer != null) + if (this._writer != null) { - lock (_writerLock) + lock (this._writerLock) { - if (_writer != null) + if (this._writer != null) { - _idxReader.Dispose(); - _idxReader = null; + this._idxReader.Dispose(); + this._idxReader = null; if (commit) { - _writer.Commit(); + this._writer.Commit(); } - _writer.Dispose(); - _writer = null; + this._writer.Dispose(); + this._writer = null; } } } @@ -538,14 +538,14 @@ private void DisposeWriter(bool commit = true) private void DisposeReaders() { - lock (((ICollection)_oldReaders).SyncRoot) + lock (((ICollection)this._oldReaders).SyncRoot) { - foreach (var rdr in _oldReaders) + foreach (var rdr in this._oldReaders) { rdr.Dispose(); } - _oldReaders.Clear(); - _reader = null; + this._oldReaders.Clear(); + this._reader = null; } } @@ -556,25 +556,25 @@ class CachedReader : IDisposable public CachedReader(IndexSearcher searcher) { - _searcher = searcher; - UpdateLastUsed(); + this._searcher = searcher; + this.UpdateLastUsed(); } public IndexSearcher GetSearcher() { - UpdateLastUsed(); - return _searcher; + this.UpdateLastUsed(); + return this._searcher; } private void UpdateLastUsed() { - LastUsed = DateTime.Now; + this.LastUsed = DateTime.Now; } public void Dispose() { - _searcher.Dispose(); - _searcher.IndexReader.Dispose(); + this._searcher.Dispose(); + this._searcher.IndexReader.Dispose(); } } } diff --git a/DNN Platform/Library/Services/Search/Internals/LuceneQuery.cs b/DNN Platform/Library/Services/Search/Internals/LuceneQuery.cs index a32271514e4..03960f4f126 100644 --- a/DNN Platform/Library/Services/Search/Internals/LuceneQuery.cs +++ b/DNN Platform/Library/Services/Search/Internals/LuceneQuery.cs @@ -54,11 +54,11 @@ internal class LuceneQuery public LuceneQuery() { - PageIndex = 1; - TitleSnippetLength = 60; - BodySnippetLength = 100; - PageSize = 10; - Sort = Sort.RELEVANCE; + this.PageIndex = 1; + this.TitleSnippetLength = 60; + this.BodySnippetLength = 100; + this.PageSize = 10; + this.Sort = Sort.RELEVANCE; } #endregion diff --git a/DNN Platform/Library/Services/Search/Internals/LuceneResults.cs b/DNN Platform/Library/Services/Search/Internals/LuceneResults.cs index ddedbfda87a..31c1b00d775 100644 --- a/DNN Platform/Library/Services/Search/Internals/LuceneResults.cs +++ b/DNN Platform/Library/Services/Search/Internals/LuceneResults.cs @@ -13,7 +13,7 @@ internal class LuceneResults public LuceneResults() { - Results = new List(); + this.Results = new List(); } } } diff --git a/DNN Platform/Library/Services/Search/Internals/SearchHelperImpl.cs b/DNN Platform/Library/Services/Search/Internals/SearchHelperImpl.cs index d80640528aa..7f52347e6fa 100644 --- a/DNN Platform/Library/Services/Search/Internals/SearchHelperImpl.cs +++ b/DNN Platform/Library/Services/Search/Internals/SearchHelperImpl.cs @@ -55,7 +55,7 @@ public IEnumerable GetSearchTypes() public SearchType GetSearchTypeByName(string searchTypeName) { - return GetSearchTypes().Single(t => t.SearchTypeName == searchTypeName); + return this.GetSearchTypes().Single(t => t.SearchTypeName == searchTypeName); } #endregion @@ -66,16 +66,16 @@ private IDictionary> GetSynonymTerms(int portalId, string { var cacheKey = string.Format("{0}_{1}_{2}", SynonymTermsCacheKey, portalId, cultureCode); var cachArg = new CacheItemArgs(cacheKey, 120, CacheItemPriority.Default); - return CBO.GetCachedObject>>(cachArg, SynonymTermsCallBack); + return CBO.GetCachedObject>>(cachArg, this.SynonymTermsCallBack); } public IEnumerable GetSynonyms(int portalId, string cultureCode, string term) { - var terms = GetSynonymTerms(portalId, cultureCode); + var terms = this.GetSynonymTerms(portalId, cultureCode); IList synonyms; if (terms == null || !terms.TryGetValue((term ?? string.Empty).ToLowerInvariant(), out synonyms)) { - synonyms = _emptySynonums; + synonyms = this._emptySynonums; } return synonyms; } @@ -84,7 +84,7 @@ public IEnumerable GetSynonymsGroups(int portalId, string culture { var cacheKey = string.Format(CacheKeyFormat, SynonymGroupsCacheKey, portalId, cultureCode); var cachArg = new CacheItemArgs(cacheKey, 120, CacheItemPriority.Default); - return CBO.GetCachedObject>(cachArg, GetSynonymsGroupsCallBack); + return CBO.GetCachedObject>(cachArg, this.GetSynonymsGroupsCallBack); } public int AddSynonymsGroup(string synonymsTags, int portalId, string cultureCode, out string duplicateWord) @@ -94,7 +94,7 @@ public int AddSynonymsGroup(string synonymsTags, int portalId, string cultureCod if (portalId < 0) return 0; var userId = PortalSettings.Current.UserId; - var list = GetSynonymsGroups(portalId, cultureCode); + var list = this.GetSynonymsGroups(portalId, cultureCode); var tags = synonymsTags.ToLowerInvariant().Split(','); if (!tags.Any()) return 0; @@ -123,7 +123,7 @@ public int UpdateSynonymsGroup(int synonymsGroupId, string synonymsTags, int por if (string.IsNullOrEmpty(synonymsTags)) return 0; var userId = PortalSettings.Current.UserId; - var list = GetSynonymsGroups(portalId, cultureCode); + var list = this.GetSynonymsGroups(portalId, cultureCode); var tags = synonymsTags.ToLowerInvariant().Split(','); if (!tags.Any()) return 0; @@ -163,7 +163,7 @@ public SearchStopWords GetSearchStopWords(int portalId, string cultureCode) { var cacheKey = string.Format(CacheKeyFormat, SearchStopWordsCacheKey, portalId, cultureCode); var cachArg = new CacheItemArgs(cacheKey, 120, CacheItemPriority.Default); - var list = CBO.GetCachedObject>(cachArg, GetSearchStopWordsCallBack); + var list = CBO.GetCachedObject>(cachArg, this.GetSearchStopWordsCallBack); return list == null ? null : list.FirstOrDefault(); } @@ -263,7 +263,7 @@ public void SetSearchReindexRequestTime(bool turnOn) /// public bool IsReindexRequested(int portalId, DateTime startDate) { - var reindexDateTime = GetSearchReindexRequestTime(portalId); + var reindexDateTime = this.GetSearchReindexRequestTime(portalId); return reindexDateTime > startDate; } @@ -275,10 +275,10 @@ public bool IsReindexRequested(int portalId, DateTime startDate) public IEnumerable GetPortalsToReindex(DateTime startDate) { var portals2Reindex = PortalController.Instance.GetPortals().Cast() - .Where(portal => IsReindexRequested(portal.PortalID, startDate)) + .Where(portal => this.IsReindexRequested(portal.PortalID, startDate)) .Select(portal => portal.PortalID); - if (IsReindexRequested(-1, startDate)) + if (this.IsReindexRequested(-1, startDate)) { // Include Host Level portals2Reindex = portals2Reindex.Concat(new[] { -1 }); @@ -401,7 +401,7 @@ public Tuple GetSearchMinMaxLength() /// cleaned and pre-processed search phrase public string RephraseSearchText(string searchPhrase, bool useWildCard, bool allowLeadingWildcard = false) { - searchPhrase = CleanSearchPhrase(HttpUtility.HtmlDecode(searchPhrase)); + searchPhrase = this.CleanSearchPhrase(HttpUtility.HtmlDecode(searchPhrase)); if (!useWildCard && !searchPhrase.Contains("\"")) { @@ -409,7 +409,7 @@ public string RephraseSearchText(string searchPhrase, bool useWildCard, bool all } // we have a quotation marks and/or wildcard search, adjust accordingly - var chars = FoldToASCII(searchPhrase).ToCharArray(); + var chars = this.FoldToASCII(searchPhrase).ToCharArray(); var insideQuote = false; var newPhraseBulder = new StringBuilder(); var currentWord = new StringBuilder(); @@ -431,7 +431,7 @@ public string RephraseSearchText(string searchPhrase, bool useWildCard, bool all if (!insideQuote && useWildCard) { // end of a word; we need to append a wild card to search when needed - newPhraseBulder.Append(FixLastWord(currentWord.ToString().Trim(), allowLeadingWildcard) + " "); + newPhraseBulder.Append(this.FixLastWord(currentWord.ToString().Trim(), allowLeadingWildcard) + " "); currentWord.Clear(); } break; @@ -446,7 +446,7 @@ public string RephraseSearchText(string searchPhrase, bool useWildCard, bool all } else if (useWildCard) { - newPhraseBulder.Append(FixLastWord(currentWord.ToString().Trim(), allowLeadingWildcard)); + newPhraseBulder.Append(this.FixLastWord(currentWord.ToString().Trim(), allowLeadingWildcard)); } else { @@ -582,7 +582,7 @@ private object SynonymTermsCallBack(CacheItemArgs cacheItem) var allTerms = new Dictionary>(); var portalId = int.Parse(parts[1]); var cultureCode = parts[2]; - var groups = GetSynonymsGroups(portalId, cultureCode); + var groups = this.GetSynonymsGroups(portalId, cultureCode); if (groups == null) return allTerms; foreach (var synonymsGroup in groups) @@ -621,7 +621,7 @@ private object GetSearchStopWordsCallBack(CacheItemArgs cacheItem) var portalId = int.Parse(splittedKeys[1]); var cultureCode = splittedKeys[2]; - EnsurePortalDefaultsAreSet(portalId); + this.EnsurePortalDefaultsAreSet(portalId); return CBO.FillCollection(DataProvider.Instance().GetSearchStopWords(portalId, cultureCode)); } @@ -638,7 +638,7 @@ private void EnsurePortalDefaultsAreSet(int portalId) foreach (var locale in LocaleController.Instance.GetLocales(portalId).Values) { - var resourceFile = GetResourceFile(locale.Code); + var resourceFile = this.GetResourceFile(locale.Code); var currentStopWords = CBO.FillCollection(DataProvider.Instance().GetSearchStopWords(portalId, locale.Code)); if (currentStopWords == null || currentStopWords.Count == 0) @@ -672,7 +672,7 @@ private object GetSynonymsGroupsCallBack(CacheItemArgs cacheItem) var portalId = int.Parse(cacheItem.CacheKey.Split('_')[1]); var cultureCode = cacheItem.CacheKey.Split('_')[2]; - EnsurePortalDefaultsAreSet(portalId); + this.EnsurePortalDefaultsAreSet(portalId); return CBO.FillCollection(DataProvider.Instance().GetAllSynonymsGroups(portalId, cultureCode)); } diff --git a/DNN Platform/Library/Services/Search/Internals/SearchQueryAnalyzer.cs b/DNN Platform/Library/Services/Search/Internals/SearchQueryAnalyzer.cs index cbc3c14a33f..1ed3e25d966 100644 --- a/DNN Platform/Library/Services/Search/Internals/SearchQueryAnalyzer.cs +++ b/DNN Platform/Library/Services/Search/Internals/SearchQueryAnalyzer.cs @@ -25,7 +25,7 @@ internal class SearchQueryAnalyzer : Analyzer public SearchQueryAnalyzer(bool useStemmingFilter) { - _useStemmingFilter = useStemmingFilter; + this._useStemmingFilter = useStemmingFilter; } public override TokenStream TokenStream(string fieldName, TextReader reader) @@ -45,7 +45,7 @@ public override TokenStream TokenStream(string fieldName, TextReader reader) ) ); - if (!_useStemmingFilter) + if (!this._useStemmingFilter) return filter; return new PorterStemFilter(filter); diff --git a/DNN Platform/Library/Services/Search/Internals/SearchSecurityTrimmer.cs b/DNN Platform/Library/Services/Search/Internals/SearchSecurityTrimmer.cs index a98fcf406ec..c6ccf646656 100644 --- a/DNN Platform/Library/Services/Search/Internals/SearchSecurityTrimmer.cs +++ b/DNN Platform/Library/Services/Search/Internals/SearchSecurityTrimmer.cs @@ -33,36 +33,36 @@ internal class SearchSecurityTrimmer : Collector public SearchSecurityTrimmer(SearchSecurityTrimmerContext searchContext) { - _securityChecker = searchContext.SecurityChecker; - _searcher = searchContext.Searcher; - _luceneQuery = searchContext.LuceneQuery; - _searchQuery = searchContext.SearchQuery; - _hitDocs = new List(16); + this._securityChecker = searchContext.SecurityChecker; + this._searcher = searchContext.Searcher; + this._luceneQuery = searchContext.LuceneQuery; + this._searchQuery = searchContext.SearchQuery; + this._hitDocs = new List(16); } public override bool AcceptsDocsOutOfOrder { get { return false; } } public override void SetNextReader(IndexReader reader, int docBase) { - _docBase = docBase; + this._docBase = docBase; } public override void SetScorer(Scorer scorer) { - _scorer = scorer; + this._scorer = scorer; } public override void Collect(int doc) { - _hitDocs.Add(new ScoreDoc(doc + _docBase, _scorer.Score())); + this._hitDocs.Add(new ScoreDoc(doc + this._docBase, this._scorer.Score())); } public int TotalHits { get { - if (_scoreDocs == null) PrepareScoreDocs(); - return _totalHits; + if (this._scoreDocs == null) this.PrepareScoreDocs(); + return this._totalHits; } } @@ -70,8 +70,8 @@ public List ScoreDocs { get { - if (_scoreDocs == null) PrepareScoreDocs(); - return _scoreDocs; + if (this._scoreDocs == null) this.PrepareScoreDocs(); + return this._scoreDocs; } } @@ -96,20 +96,20 @@ private void PrepareScoreDocs() { int skippedSoFar; var collectedSoFar = skippedSoFar = 0; - var pageSize = _luceneQuery.PageSize; - var toSkip = _luceneQuery.PageIndex <= 1 ? 0 : ((_luceneQuery.PageIndex - 1) * pageSize); + var pageSize = this._luceneQuery.PageSize; + var toSkip = this._luceneQuery.PageIndex <= 1 ? 0 : ((this._luceneQuery.PageIndex - 1) * pageSize); IEnumerable tempDocs = new List(); - _totalHits = _hitDocs.Count; + this._totalHits = this._hitDocs.Count; var useRelevance = false; - if (ReferenceEquals(Sort.RELEVANCE, _luceneQuery.Sort)) + if (ReferenceEquals(Sort.RELEVANCE, this._luceneQuery.Sort)) { useRelevance = true; } else { - var fields = _luceneQuery.Sort.GetSort(); + var fields = this._luceneQuery.Sort.GetSort(); if (fields == null || fields.Count() != 1) { useRelevance = true; @@ -120,26 +120,26 @@ private void PrepareScoreDocs() if (field.Type == SortField.INT || field.Type == SortField.LONG) { if(field.Reverse) - tempDocs = _hitDocs.Select(d => new { SDoc = d, Document = _searcher.Doc(d.Doc) }) - .OrderByDescending(rec => GetLongFromField(rec.Document, field)) + tempDocs = this._hitDocs.Select(d => new { SDoc = d, Document = this._searcher.Doc(d.Doc) }) + .OrderByDescending(rec => this.GetLongFromField(rec.Document, field)) .ThenByDescending(rec => rec.Document.Boost) .Select(rec => rec.SDoc); else - tempDocs = _hitDocs.Select(d => new { SDoc = d, Document = _searcher.Doc(d.Doc) }) - .OrderBy(rec => GetLongFromField(rec.Document, field)) + tempDocs = this._hitDocs.Select(d => new { SDoc = d, Document = this._searcher.Doc(d.Doc) }) + .OrderBy(rec => this.GetLongFromField(rec.Document, field)) .ThenByDescending(rec => rec.Document.Boost) .Select(rec => rec.SDoc); } else { if (field.Reverse) - tempDocs = _hitDocs.Select(d => new {SDoc = d, Document = _searcher.Doc(d.Doc)}) - .OrderByDescending(rec => GetStringFromField(rec.Document, field)) + tempDocs = this._hitDocs.Select(d => new {SDoc = d, Document = this._searcher.Doc(d.Doc)}) + .OrderByDescending(rec => this.GetStringFromField(rec.Document, field)) .ThenByDescending(rec => rec.Document.Boost) .Select(rec => rec.SDoc); else - tempDocs = _hitDocs.Select(d => new { SDoc = d, Document = _searcher.Doc(d.Doc) }) - .OrderBy(rec => GetStringFromField(rec.Document, field)) + tempDocs = this._hitDocs.Select(d => new { SDoc = d, Document = this._searcher.Doc(d.Doc) }) + .OrderBy(rec => this.GetStringFromField(rec.Document, field)) .ThenByDescending(rec => rec.Document.Boost) .Select(rec => rec.SDoc); } @@ -147,14 +147,14 @@ private void PrepareScoreDocs() } if (useRelevance) - tempDocs = _hitDocs.OrderByDescending(d => d.Score).ThenBy(d => d.Doc); + tempDocs = this._hitDocs.OrderByDescending(d => d.Score).ThenBy(d => d.Doc); var scoreDocSize = Math.Min(tempDocs.Count(), pageSize); - _scoreDocs = new List(scoreDocSize); + this._scoreDocs = new List(scoreDocSize); foreach (var scoreDoc in tempDocs) { - if (_securityChecker == null || _securityChecker(_searcher.Doc(scoreDoc.Doc), _searchQuery)) + if (this._securityChecker == null || this._securityChecker(this._searcher.Doc(scoreDoc.Doc), this._searchQuery)) { if (skippedSoFar < toSkip) { @@ -167,12 +167,12 @@ private void PrepareScoreDocs() continue; } - _scoreDocs.Add(scoreDoc); + this._scoreDocs.Add(scoreDoc); ++collectedSoFar; } else { - _totalHits--; + this._totalHits--; } } } diff --git a/DNN Platform/Library/Services/Search/Internals/SynonymFilter.cs b/DNN Platform/Library/Services/Search/Internals/SynonymFilter.cs index 76ef0a2a9d3..62eaf009ae2 100644 --- a/DNN Platform/Library/Services/Search/Internals/SynonymFilter.cs +++ b/DNN Platform/Library/Services/Search/Internals/SynonymFilter.cs @@ -31,32 +31,32 @@ internal sealed class SynonymFilter : TokenFilter public SynonymFilter(TokenStream input) : base(input) { - _termAtt = (TermAttribute) AddAttribute(); - _posIncrAtt = (PositionIncrementAttribute)AddAttribute(); + this._termAtt = (TermAttribute) this.AddAttribute(); + this._posIncrAtt = (PositionIncrementAttribute)this.AddAttribute(); } public override bool IncrementToken() { //Pop buffered synonyms - if (_synonymStack.Count > 0) + if (this._synonymStack.Count > 0) { - var syn = _synonymStack.Pop(); - RestoreState(_current); - _termAtt.SetTermBuffer(syn); + var syn = this._synonymStack.Pop(); + this.RestoreState(this._current); + this._termAtt.SetTermBuffer(syn); //set position increment to 0 - _posIncrAtt.PositionIncrement = 0; + this._posIncrAtt.PositionIncrement = 0; return true; } //read next token - if (!input.IncrementToken()) + if (!this.input.IncrementToken()) return false; //push synonyms onto stack - if (AddAliasesToStack()) + if (this.AddAliasesToStack()) { - _current = CaptureState(); //save current token + this._current = this.CaptureState(); //save current token } return true; @@ -82,13 +82,13 @@ private bool AddAliasesToStack() { cultureCode = Thread.CurrentThread.CurrentCulture.Name; } - var synonyms = SearchHelper.Instance.GetSynonyms(portalId, cultureCode, _termAtt.Term).ToArray(); + var synonyms = SearchHelper.Instance.GetSynonyms(portalId, cultureCode, this._termAtt.Term).ToArray(); if (!synonyms.Any()) return false; var cultureInfo = new CultureInfo(cultureCode); foreach (var synonym in synonyms) { - _synonymStack.Push(synonym.ToLower(cultureInfo)); + this._synonymStack.Push(synonym.ToLower(cultureInfo)); } return true; } diff --git a/DNN Platform/Library/Services/Search/ModuleIndexer.cs b/DNN Platform/Library/Services/Search/ModuleIndexer.cs index 45bb8865ac9..254ccb0fb28 100644 --- a/DNN Platform/Library/Services/Search/ModuleIndexer.cs +++ b/DNN Platform/Library/Services/Search/ModuleIndexer.cs @@ -55,17 +55,17 @@ public ModuleIndexer() : this(false) public ModuleIndexer(bool needSearchModules) { - _searchModules = new Dictionary>(); + this._searchModules = new Dictionary>(); if (needSearchModules) { var portals = PortalController.Instance.GetPortals(); foreach (var portal in portals.Cast()) { - _searchModules.Add(portal.PortalID, GetModulesForIndex(portal.PortalID)); + this._searchModules.Add(portal.PortalID, this.GetModulesForIndex(portal.PortalID)); } - _searchModules.Add(Null.NullInteger, GetModulesForIndex(Null.NullInteger)); + this._searchModules.Add(Null.NullInteger, this.GetModulesForIndex(Null.NullInteger)); } } @@ -86,11 +86,11 @@ public override int IndexSearchDocuments(int portalId, Requires.NotNull("indexer", indexer); const int saveThreshold = 1024 * 2; var totalIndexed = 0; - startDateLocal = GetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, startDateLocal); + startDateLocal = this.GetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, startDateLocal); var searchDocuments = new List(); - var searchModuleCollection = _searchModules.ContainsKey(portalId) - ? _searchModules[portalId].Where(m => m.SupportSearch).Select(m => m.ModuleInfo) - : GetSearchModules(portalId); + var searchModuleCollection = this._searchModules.ContainsKey(portalId) + ? this._searchModules[portalId].Where(m => m.SupportSearch).Select(m => m.ModuleInfo) + : this.GetSearchModules(portalId); //Some modules update LastContentModifiedOnDate (e.g. Html module) when their content changes. //We won't be calling into such modules if LastContentModifiedOnDate is prior to startDate. @@ -122,7 +122,7 @@ public override int IndexSearchDocuments(int portalId, if (searchDocuments.Count >= saveThreshold) { - totalIndexed += IndexCollectedDocs(indexer, searchDocuments, portalId, schedule); + totalIndexed += this.IndexCollectedDocs(indexer, searchDocuments, portalId, schedule); searchDocuments.Clear(); } } @@ -135,7 +135,7 @@ public override int IndexSearchDocuments(int portalId, if (searchDocuments.Count > 0) { - totalIndexed += IndexCollectedDocs(indexer, searchDocuments, portalId, schedule); + totalIndexed += this.IndexCollectedDocs(indexer, searchDocuments, portalId, schedule); } } @@ -165,7 +165,7 @@ private int IndexCollectedDocs( { indexer.Invoke(searchDocuments); var total = searchDocuments.Count; - SetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, schedule.StartDate); + this.SetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, schedule.StartDate); return total; } @@ -180,8 +180,8 @@ private int IndexCollectedDocs( public List GetModuleMetaData(int portalId, DateTime startDate) { var searchDocuments = new List(); - var searchModuleCollection = _searchModules.ContainsKey(portalId) ? - _searchModules[portalId].Select(m => m.ModuleInfo) : GetSearchModules(portalId, true); + var searchModuleCollection = this._searchModules.ContainsKey(portalId) ? + this._searchModules[portalId].Select(m => m.ModuleInfo) : this.GetSearchModules(portalId, true); foreach (ModuleInfo module in searchModuleCollection) { try @@ -271,12 +271,12 @@ public SearchDocument ConvertSearchItemInfoToSearchDocument(SearchItemInfo searc /// ----------------------------------------------------------------------------- protected IEnumerable GetSearchModules(int portalId) { - return GetSearchModules(portalId, false); + return this.GetSearchModules(portalId, false); } protected IEnumerable GetSearchModules(int portalId, bool allModules) { - return from mii in GetModulesForIndex(portalId) + return from mii in this.GetModulesForIndex(portalId) where allModules || mii.SupportSearch select mii.ModuleInfo; } diff --git a/DNN Platform/Library/Services/Search/SearchConfig.cs b/DNN Platform/Library/Services/Search/SearchConfig.cs index ef0241fbadb..80c3ec4ab65 100644 --- a/DNN Platform/Library/Services/Search/SearchConfig.cs +++ b/DNN Platform/Library/Services/Search/SearchConfig.cs @@ -44,10 +44,10 @@ public SearchConfig(int portalID) public SearchConfig(Dictionary settings) { - _SearchIncludeCommon = GetSettingAsBoolean("SearchIncludeCommon", settings, Host.SearchIncludeCommon); - _SearchIncludeNumeric = GetSettingAsBoolean("SearchIncludeNumeric", settings, Host.SearchIncludeNumeric); - _SearchMaxWordlLength = GetSettingAsInteger("MaxSearchWordLength", settings, Host.SearchMaxWordlLength); - _SearchMinWordlLength = GetSettingAsInteger("MinSearchWordLength", settings, Host.SearchMinWordlLength); + this._SearchIncludeCommon = this.GetSettingAsBoolean("SearchIncludeCommon", settings, Host.SearchIncludeCommon); + this._SearchIncludeNumeric = this.GetSettingAsBoolean("SearchIncludeNumeric", settings, Host.SearchIncludeNumeric); + this._SearchMaxWordlLength = this.GetSettingAsInteger("MaxSearchWordLength", settings, Host.SearchMaxWordlLength); + this._SearchMinWordlLength = this.GetSettingAsInteger("MinSearchWordLength", settings, Host.SearchMinWordlLength); } #endregion @@ -64,7 +64,7 @@ public bool SearchIncludeCommon { get { - return _SearchIncludeCommon; + return this._SearchIncludeCommon; } } @@ -78,7 +78,7 @@ public bool SearchIncludeNumeric { get { - return _SearchIncludeNumeric; + return this._SearchIncludeNumeric; } } @@ -92,7 +92,7 @@ public int SearchMaxWordlLength { get { - return _SearchMaxWordlLength; + return this._SearchMaxWordlLength; } } @@ -106,7 +106,7 @@ public int SearchMinWordlLength { get { - return _SearchMinWordlLength; + return this._SearchMinWordlLength; } } diff --git a/DNN Platform/Library/Services/Search/SearchContentModuleInfo.cs b/DNN Platform/Library/Services/Search/SearchContentModuleInfo.cs index d88552547c6..5f718f16317 100644 --- a/DNN Platform/Library/Services/Search/SearchContentModuleInfo.cs +++ b/DNN Platform/Library/Services/Search/SearchContentModuleInfo.cs @@ -37,11 +37,11 @@ public ISearchable ModControllerType { get { - return MModControllerType; + return this.MModControllerType; } set { - MModControllerType = value; + this.MModControllerType = value; } } #pragma warning restore 0618 @@ -50,11 +50,11 @@ public ModuleSearchBase ModSearchBaseControllerType { get { - return SearchBaseControllerType; + return this.SearchBaseControllerType; } set { - SearchBaseControllerType = value; + this.SearchBaseControllerType = value; } } @@ -62,11 +62,11 @@ public ModuleInfo ModInfo { get { - return MModInfo; + return this.MModInfo; } set { - MModInfo = value; + this.MModInfo = value; } } } diff --git a/DNN Platform/Library/Services/Search/SearchContentModuleInfoCollection.cs b/DNN Platform/Library/Services/Search/SearchContentModuleInfoCollection.cs index 8ff7f6773cd..e0a0311af90 100644 --- a/DNN Platform/Library/Services/Search/SearchContentModuleInfoCollection.cs +++ b/DNN Platform/Library/Services/Search/SearchContentModuleInfoCollection.cs @@ -39,7 +39,7 @@ public SearchContentModuleInfoCollection() /// A SearchContentModuleInfoCollection with which to initialize the collection. public SearchContentModuleInfoCollection(SearchContentModuleInfoCollection value) { - AddRange(value); + this.AddRange(value); } /// @@ -48,7 +48,7 @@ public SearchContentModuleInfoCollection(SearchContentModuleInfoCollection value /// An array of SearchContentModuleInfo objects with which to initialize the collection. public SearchContentModuleInfoCollection(SearchContentModuleInfo[] value) { - AddRange(value); + this.AddRange(value); } #endregion @@ -65,11 +65,11 @@ public SearchContentModuleInfo this[int index] { get { - return (SearchContentModuleInfo) List[index]; + return (SearchContentModuleInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } @@ -83,7 +83,7 @@ public SearchContentModuleInfo this[int index] /// An object of type SearchContentModuleInfo to add to the collection. public int Add(SearchContentModuleInfo value) { - return List.Add(value); + return this.List.Add(value); } /// @@ -93,7 +93,7 @@ public int Add(SearchContentModuleInfo value) /// The index in the collection of the specified object, if found; otherwise, -1. public int IndexOf(SearchContentModuleInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } /// @@ -103,7 +103,7 @@ public int IndexOf(SearchContentModuleInfo value) /// An object of type SearchContentModuleInfo to add to the collection. public void Insert(int index, SearchContentModuleInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } /// @@ -112,7 +112,7 @@ public void Insert(int index, SearchContentModuleInfo value) /// An object of type SearchContentModuleInfo to remove to the collection. public void Remove(SearchContentModuleInfo value) { - List.Remove(value); + this.List.Remove(value); } /// @@ -123,7 +123,7 @@ public void Remove(SearchContentModuleInfo value) public bool Contains(SearchContentModuleInfo value) { //If value is not of type SearchContentModuleInfo, this will return false. - return List.Contains(value); + return this.List.Contains(value); } /// @@ -134,7 +134,7 @@ public void AddRange(SearchContentModuleInfo[] value) { for (int i = 0; i <= value.Length - 1; i++) { - Add(value[i]); + this.Add(value[i]); } } @@ -146,7 +146,7 @@ public void AddRange(SearchContentModuleInfoCollection value) { for (int i = 0; i <= value.Count - 1; i++) { - Add((SearchContentModuleInfo) value.List[i]); + this.Add((SearchContentModuleInfo) value.List[i]); } } @@ -157,7 +157,7 @@ public void AddRange(SearchContentModuleInfoCollection value) /// The index of the array at which to begin inserting. public void CopyTo(SearchContentModuleInfo[] array, int index) { - List.CopyTo(array, index); + this.List.CopyTo(array, index); } /// @@ -166,8 +166,8 @@ public void CopyTo(SearchContentModuleInfo[] array, int index) /// Array of type SearchContentModuleInfo public SearchContentModuleInfo[] ToArray() { - var arr = new SearchContentModuleInfo[Count]; - CopyTo(arr, 0); + var arr = new SearchContentModuleInfo[this.Count]; + this.CopyTo(arr, 0); return arr; } diff --git a/DNN Platform/Library/Services/Search/SearchCriteriaCollection.cs b/DNN Platform/Library/Services/Search/SearchCriteriaCollection.cs index cc0b8d9c927..e15bebb8fac 100644 --- a/DNN Platform/Library/Services/Search/SearchCriteriaCollection.cs +++ b/DNN Platform/Library/Services/Search/SearchCriteriaCollection.cs @@ -41,7 +41,7 @@ public SearchCriteriaCollection() /// A SearchCriteriaCollection with which to initialize the collection. public SearchCriteriaCollection(SearchCriteriaCollection value) { - AddRange(value); + this.AddRange(value); } /// @@ -50,7 +50,7 @@ public SearchCriteriaCollection(SearchCriteriaCollection value) /// An array of SearchCriteria objects with which to initialize the collection. public SearchCriteriaCollection(SearchCriteria[] value) { - AddRange(value); + this.AddRange(value); } /// @@ -70,7 +70,7 @@ public SearchCriteriaCollection(string value) criterion.MustInclude = false; criterion.MustExclude = false; criterion.Criteria = word; - Add(criterion); + this.Add(criterion); } } //Add all mandatory criteria @@ -82,7 +82,7 @@ public SearchCriteriaCollection(string value) criterion.MustInclude = true; criterion.MustExclude = false; criterion.Criteria = word.Remove(0, 1); - Add(criterion); + this.Add(criterion); } } //Add all excluded criteria @@ -94,7 +94,7 @@ public SearchCriteriaCollection(string value) criterion.MustInclude = false; criterion.MustExclude = true; criterion.Criteria = word.Remove(0, 1); - Add(criterion); + this.Add(criterion); } } } @@ -113,11 +113,11 @@ public SearchCriteria this[int index] { get { - return (SearchCriteria) List[index]; + return (SearchCriteria) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } @@ -131,7 +131,7 @@ public SearchCriteria this[int index] /// An object of type SearchCriteria to add to the collection. public int Add(SearchCriteria value) { - return List.Add(value); + return this.List.Add(value); } /// @@ -141,7 +141,7 @@ public int Add(SearchCriteria value) /// The index in the collection of the specified object, if found; otherwise, -1. public int IndexOf(SearchCriteria value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } /// @@ -151,7 +151,7 @@ public int IndexOf(SearchCriteria value) /// An object of type SearchCriteria to add to the collection. public void Insert(int index, SearchCriteria value) { - List.Insert(index, value); + this.List.Insert(index, value); } /// @@ -160,7 +160,7 @@ public void Insert(int index, SearchCriteria value) /// An object of type SearchCriteria to remove to the collection. public void Remove(SearchCriteria value) { - List.Remove(value); + this.List.Remove(value); } /// @@ -170,7 +170,7 @@ public void Remove(SearchCriteria value) /// true if the collection contains the specified object; otherwise, false. public bool Contains(SearchCriteria value) { - return List.Contains(value); + return this.List.Contains(value); } /// @@ -181,7 +181,7 @@ public void AddRange(SearchCriteria[] value) { for (int i = 0; i <= value.Length - 1; i++) { - Add(value[i]); + this.Add(value[i]); } } @@ -193,7 +193,7 @@ public void AddRange(SearchCriteriaCollection value) { for (int i = 0; i <= value.Count - 1; i++) { - Add((SearchCriteria) value.List[i]); + this.Add((SearchCriteria) value.List[i]); } } @@ -204,7 +204,7 @@ public void AddRange(SearchCriteriaCollection value) /// The index of the array at which to begin inserting. public void CopyTo(SearchCriteria[] array, int index) { - List.CopyTo(array, index); + this.List.CopyTo(array, index); } /// @@ -213,8 +213,8 @@ public void CopyTo(SearchCriteria[] array, int index) /// Array of type SearchCriteria public SearchCriteria[] ToArray() { - var arr = new SearchCriteria[Count]; - CopyTo(arr, 0); + var arr = new SearchCriteria[this.Count]; + this.CopyTo(arr, 0); return arr; } diff --git a/DNN Platform/Library/Services/Search/SearchDataStore.cs b/DNN Platform/Library/Services/Search/SearchDataStore.cs index 5230cc2538e..d9e0afd3253 100644 --- a/DNN Platform/Library/Services/Search/SearchDataStore.cs +++ b/DNN Platform/Library/Services/Search/SearchDataStore.cs @@ -115,7 +115,7 @@ public override SearchResultsInfoCollection GetSearchResults(int portalId, strin var portalSettings = new PortalSettings(portal); //We will assume that the content is in the locale of the Portal - Hashtable commonWords = GetCommonWords(portalSettings.DefaultLanguage); + Hashtable commonWords = this.GetCommonWords(portalSettings.DefaultLanguage); //clean criteria criteria = criteria.ToLowerInvariant(); diff --git a/DNN Platform/Library/Services/Search/SearchEngine.cs b/DNN Platform/Library/Services/Search/SearchEngine.cs index 451012d5c7e..4a76d42ac9f 100644 --- a/DNN Platform/Library/Services/Search/SearchEngine.cs +++ b/DNN Platform/Library/Services/Search/SearchEngine.cs @@ -36,8 +36,8 @@ internal class SearchEngine { internal SearchEngine(ScheduleHistoryItem scheduler, DateTime startTime) { - SchedulerItem = scheduler; - IndexingStartTime = startTime; + this.SchedulerItem = scheduler; + this.IndexingStartTime = startTime; } #region Properties @@ -59,45 +59,45 @@ internal void IndexContent() { //Index TAB META-DATA var tabIndexer = new TabIndexer(); - var searchDocsCount = GetAndStoreSearchDocuments(tabIndexer); + var searchDocsCount = this.GetAndStoreSearchDocuments(tabIndexer); var indexedSearchDocumentCount = searchDocsCount; - AddIdexingResults("Tabs Indexed", searchDocsCount); + this.AddIdexingResults("Tabs Indexed", searchDocsCount); //Index MODULE META-DATA from modules that inherit from ModuleSearchBase var moduleIndexer = new ModuleIndexer(true); - searchDocsCount = GetAndStoreModuleMetaData(moduleIndexer); + searchDocsCount = this.GetAndStoreModuleMetaData(moduleIndexer); indexedSearchDocumentCount += searchDocsCount; - AddIdexingResults("Modules (Metadata) Indexed", searchDocsCount); + this.AddIdexingResults("Modules (Metadata) Indexed", searchDocsCount); //Index MODULE CONTENT from modules that inherit from ModuleSearchBase - searchDocsCount = GetAndStoreSearchDocuments(moduleIndexer); + searchDocsCount = this.GetAndStoreSearchDocuments(moduleIndexer); indexedSearchDocumentCount += searchDocsCount; //Index all Defunct ISearchable module content #pragma warning disable 0618 - var searchItems = GetContent(moduleIndexer); + var searchItems = this.GetContent(moduleIndexer); SearchDataStoreProvider.Instance().StoreSearchItems(searchItems); #pragma warning restore 0618 indexedSearchDocumentCount += searchItems.Count; //Both ModuleSearchBase and ISearchable module content count - AddIdexingResults("Modules (Content) Indexed", searchDocsCount + searchItems.Count); + this.AddIdexingResults("Modules (Content) Indexed", searchDocsCount + searchItems.Count); if (!HostController.Instance.GetBoolean("DisableUserCrawling", false)) { //Index User data var userIndexer = new UserIndexer(); - var userIndexed = GetAndStoreSearchDocuments(userIndexer); + var userIndexed = this.GetAndStoreSearchDocuments(userIndexer); indexedSearchDocumentCount += userIndexed; - AddIdexingResults("Users", userIndexed); + this.AddIdexingResults("Users", userIndexed); } - SchedulerItem.AddLogNote("
    Total Items Indexed: " + indexedSearchDocumentCount + ""); + this.SchedulerItem.AddLogNote("
    Total Items Indexed: " + indexedSearchDocumentCount + ""); } private void AddIdexingResults(string description, int count) { - SchedulerItem.AddLogNote(string.Format("
      {0}: {1}", description, count)); + this.SchedulerItem.AddLogNote(string.Format("
      {0}: {1}", description, count)); } internal bool CompactSearchIndexIfNeeded(ScheduleHistoryItem scheduleItem) @@ -121,7 +121,7 @@ internal bool CompactSearchIndexIfNeeded(ScheduleHistoryItem scheduleItem) ///
    internal void DeleteOldDocsBeforeReindex() { - var portal2Reindex = SearchHelper.Instance.GetPortalsToReindex(IndexingStartTime); + var portal2Reindex = SearchHelper.Instance.GetPortalsToReindex(this.IndexingStartTime); var controller = InternalSearchController.Instance; foreach (var portalId in portal2Reindex) @@ -137,7 +137,7 @@ internal void DeleteOldDocsBeforeReindex() internal void DeleteRemovedObjects() { var deletedCount = 0; - var cutoffTime = SchedulerItem.StartDate.ToUniversalTime(); + var cutoffTime = this.SchedulerItem.StartDate.ToUniversalTime(); var searchController = InternalSearchController.Instance; var dataProvider = DataProvider.Instance(); using (var reader = dataProvider.GetSearchDeletedItems(cutoffTime)) @@ -151,7 +151,7 @@ internal void DeleteRemovedObjects() } reader.Close(); } - AddIdexingResults("Deleted Objects", deletedCount); + this.AddIdexingResults("Deleted Objects", deletedCount); dataProvider.DeleteProcessedSearchDeletedItems(cutoffTime); } @@ -181,11 +181,11 @@ private int GetAndStoreSearchDocuments(IndexingProviderBase indexer) foreach (var portal in portals.Cast()) { - indexSince = FixedIndexingStartDate(portal.PortalID); + indexSince = this.FixedIndexingStartDate(portal.PortalID); try { indexedCount += indexer.IndexSearchDocuments( - portal.PortalID, SchedulerItem, indexSince, StoreSearchDocuments); + portal.PortalID, this.SchedulerItem, indexSince, StoreSearchDocuments); } catch (NotImplementedException) { @@ -198,11 +198,11 @@ private int GetAndStoreSearchDocuments(IndexingProviderBase indexer) } // Include Host Level Items - indexSince = FixedIndexingStartDate(-1); + indexSince = this.FixedIndexingStartDate(-1); try { indexedCount += indexer.IndexSearchDocuments( - Null.NullInteger, SchedulerItem, indexSince, StoreSearchDocuments); + Null.NullInteger, this.SchedulerItem, indexSince, StoreSearchDocuments); } catch (NotImplementedException) { @@ -230,14 +230,14 @@ private int GetAndStoreModuleMetaData(ModuleIndexer indexer) foreach (var portal in portals.Cast()) { - indexSince = FixedIndexingStartDate(portal.PortalID); + indexSince = this.FixedIndexingStartDate(portal.PortalID); searchDocs = indexer.GetModuleMetaData(portal.PortalID, indexSince); StoreSearchDocuments(searchDocs); indexedCount += searchDocs.Count(); } // Include Host Level Items - indexSince = FixedIndexingStartDate(Null.NullInteger); + indexSince = this.FixedIndexingStartDate(Null.NullInteger); searchDocs = indexer.GetModuleMetaData(Null.NullInteger, indexSince); StoreSearchDocuments(searchDocs); indexedCount += searchDocs.Count(); @@ -271,7 +271,7 @@ private static void StoreSearchDocuments(IEnumerable searchDocs) /// ----------------------------------------------------------------------------- private DateTime FixedIndexingStartDate(int portalId) { - var startDate = IndexingStartTime; + var startDate = this.IndexingStartTime; if (startDate < SqlDateTime.MinValue.Value || SearchHelper.Instance.IsReindexRequested(portalId, startDate)) { diff --git a/DNN Platform/Library/Services/Search/SearchEngineScheduler.cs b/DNN Platform/Library/Services/Search/SearchEngineScheduler.cs index 42b4c07cde5..44966161a27 100644 --- a/DNN Platform/Library/Services/Search/SearchEngineScheduler.cs +++ b/DNN Platform/Library/Services/Search/SearchEngineScheduler.cs @@ -32,7 +32,7 @@ public class SearchEngineScheduler : SchedulerClient public SearchEngineScheduler(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } /// ----------------------------------------------------------------------------- @@ -46,35 +46,35 @@ public override void DoWork() { try { - var lastSuccessFulDateTime = SearchHelper.Instance.GetLastSuccessfulIndexingDateTime(ScheduleHistoryItem.ScheduleID); + var lastSuccessFulDateTime = SearchHelper.Instance.GetLastSuccessfulIndexingDateTime(this.ScheduleHistoryItem.ScheduleID); Logger.Trace("Search: Site Crawler - Starting. Content change start time " + lastSuccessFulDateTime.ToString("g")); - ScheduleHistoryItem.AddLogNote(string.Format("Starting. Content change start time {0:g}", lastSuccessFulDateTime)); + this.ScheduleHistoryItem.AddLogNote(string.Format("Starting. Content change start time {0:g}", lastSuccessFulDateTime)); - var searchEngine = new SearchEngine(ScheduleHistoryItem, lastSuccessFulDateTime); + var searchEngine = new SearchEngine(this.ScheduleHistoryItem, lastSuccessFulDateTime); try { searchEngine.DeleteOldDocsBeforeReindex(); searchEngine.DeleteRemovedObjects(); searchEngine.IndexContent(); - searchEngine.CompactSearchIndexIfNeeded(ScheduleHistoryItem); + searchEngine.CompactSearchIndexIfNeeded(this.ScheduleHistoryItem); } finally { searchEngine.Commit(); } - ScheduleHistoryItem.Succeeded = true; - ScheduleHistoryItem.AddLogNote("
    Indexing Successful"); - SearchHelper.Instance.SetLastSuccessfulIndexingDateTime(ScheduleHistoryItem.ScheduleID, ScheduleHistoryItem.StartDate); + this.ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.AddLogNote("
    Indexing Successful"); + SearchHelper.Instance.SetLastSuccessfulIndexingDateTime(this.ScheduleHistoryItem.ScheduleID, this.ScheduleHistoryItem.StartDate); Logger.Trace("Search: Site Crawler - Indexing Successful"); } catch (Exception ex) { - ScheduleHistoryItem.Succeeded = false; - ScheduleHistoryItem.AddLogNote("
    EXCEPTION: " + ex.Message); - Errored(ref ex); - if (ScheduleHistoryItem.ScheduleSource != ScheduleSource.STARTED_FROM_BEGIN_REQUEST) + this.ScheduleHistoryItem.Succeeded = false; + this.ScheduleHistoryItem.AddLogNote("
    EXCEPTION: " + ex.Message); + this.Errored(ref ex); + if (this.ScheduleHistoryItem.ScheduleSource != ScheduleSource.STARTED_FROM_BEGIN_REQUEST) { Exceptions.Exceptions.LogException(ex); } diff --git a/DNN Platform/Library/Services/Search/SearchItemInfo.cs b/DNN Platform/Library/Services/Search/SearchItemInfo.cs index ee1fbd53397..a0c71ed29b4 100644 --- a/DNN Platform/Library/Services/Search/SearchItemInfo.cs +++ b/DNN Platform/Library/Services/Search/SearchItemInfo.cs @@ -61,31 +61,31 @@ public SearchItemInfo(string Title, string Description, int Author, DateTime Pub public SearchItemInfo(string Title, string Description, int Author, DateTime PubDate, int ModuleID, string SearchKey, string Content, string Guid, int Image) { - _Title = Title; - _Description = Description; - _Author = Author; - _PubDate = PubDate; - _ModuleId = ModuleID; - _SearchKey = SearchKey; - _Content = Content; - _GUID = Guid; - _ImageFileId = Image; - _HitCount = 0; + this._Title = Title; + this._Description = Description; + this._Author = Author; + this._PubDate = PubDate; + this._ModuleId = ModuleID; + this._SearchKey = SearchKey; + this._Content = Content; + this._GUID = Guid; + this._ImageFileId = Image; + this._HitCount = 0; } public SearchItemInfo(string Title, string Description, int Author, DateTime PubDate, int ModuleID, string SearchKey, string Content, string Guid, int Image, int TabID) { - _Title = Title; - _Description = Description; - _Author = Author; - _PubDate = PubDate; - _ModuleId = ModuleID; - _SearchKey = SearchKey; - _Content = Content; - _GUID = Guid; - _ImageFileId = Image; - _HitCount = 0; - _TabId = TabID; + this._Title = Title; + this._Description = Description; + this._Author = Author; + this._PubDate = PubDate; + this._ModuleId = ModuleID; + this._SearchKey = SearchKey; + this._Content = Content; + this._GUID = Guid; + this._ImageFileId = Image; + this._HitCount = 0; + this._TabId = TabID; } @@ -93,11 +93,11 @@ public int SearchItemId { get { - return _SearchItemId; + return this._SearchItemId; } set { - _SearchItemId = value; + this._SearchItemId = value; } } @@ -105,11 +105,11 @@ public string Title { get { - return _Title; + return this._Title; } set { - _Title = value; + this._Title = value; } } @@ -117,11 +117,11 @@ public string Description { get { - return _Description; + return this._Description; } set { - _Description = value; + this._Description = value; } } @@ -129,11 +129,11 @@ public int Author { get { - return _Author; + return this._Author; } set { - _Author = value; + this._Author = value; } } @@ -141,11 +141,11 @@ public DateTime PubDate { get { - return _PubDate; + return this._PubDate; } set { - _PubDate = value; + this._PubDate = value; } } @@ -153,11 +153,11 @@ public int ModuleId { get { - return _ModuleId; + return this._ModuleId; } set { - _ModuleId = value; + this._ModuleId = value; } } @@ -165,11 +165,11 @@ public string SearchKey { get { - return _SearchKey; + return this._SearchKey; } set { - _SearchKey = value; + this._SearchKey = value; } } @@ -177,11 +177,11 @@ public string Content { get { - return _Content; + return this._Content; } set { - _Content = value; + this._Content = value; } } @@ -189,11 +189,11 @@ public string GUID { get { - return _GUID; + return this._GUID; } set { - _GUID = value; + this._GUID = value; } } @@ -201,11 +201,11 @@ public int ImageFileId { get { - return _ImageFileId; + return this._ImageFileId; } set { - _ImageFileId = value; + this._ImageFileId = value; } } @@ -213,11 +213,11 @@ public int HitCount { get { - return _HitCount; + return this._HitCount; } set { - _HitCount = value; + this._HitCount = value; } } @@ -225,11 +225,11 @@ public int TabId { get { - return _TabId; + return this._TabId; } set { - _TabId = value; + this._TabId = value; } } } diff --git a/DNN Platform/Library/Services/Search/SearchItemInfoCollection.cs b/DNN Platform/Library/Services/Search/SearchItemInfoCollection.cs index d5feed61de4..9768488f2e5 100644 --- a/DNN Platform/Library/Services/Search/SearchItemInfoCollection.cs +++ b/DNN Platform/Library/Services/Search/SearchItemInfoCollection.cs @@ -41,7 +41,7 @@ public SearchItemInfoCollection() /// A SearchItemInfoCollection with which to initialize the collection. public SearchItemInfoCollection(SearchItemInfoCollection value) { - AddRange(value); + this.AddRange(value); } /// @@ -50,7 +50,7 @@ public SearchItemInfoCollection(SearchItemInfoCollection value) /// An array of SearchItemInfo objects with which to initialize the collection. public SearchItemInfoCollection(SearchItemInfo[] value) { - AddRange(value); + this.AddRange(value); } /// @@ -59,7 +59,7 @@ public SearchItemInfoCollection(SearchItemInfo[] value) /// An arraylist of SearchItemInfo objects with which to initialize the collection. public SearchItemInfoCollection(ArrayList value) { - AddRange(value); + this.AddRange(value); } #endregion @@ -76,11 +76,11 @@ public SearchItemInfo this[int index] { get { - return (SearchItemInfo) List[index]; + return (SearchItemInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } @@ -94,7 +94,7 @@ public SearchItemInfo this[int index] /// An object of type SearchItemInfo to add to the collection. public int Add(SearchItemInfo value) { - return List.Add(value); + return this.List.Add(value); } /// @@ -104,7 +104,7 @@ public int Add(SearchItemInfo value) /// The index in the collection of the specified object, if found; otherwise, -1. public int IndexOf(SearchItemInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } /// @@ -114,7 +114,7 @@ public int IndexOf(SearchItemInfo value) /// An object of type SearchItemInfo to add to the collection. public void Insert(int index, SearchItemInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } /// @@ -123,7 +123,7 @@ public void Insert(int index, SearchItemInfo value) /// An object of type SearchItemInfo to remove to the collection. public void Remove(SearchItemInfo value) { - List.Remove(value); + this.List.Remove(value); } /// @@ -133,7 +133,7 @@ public void Remove(SearchItemInfo value) /// true if the collection contains the specified object; otherwise, false. public bool Contains(SearchItemInfo value) { - return List.Contains(value); + return this.List.Contains(value); } /// @@ -144,7 +144,7 @@ public void AddRange(SearchItemInfo[] value) { for (int i = 0; i <= value.Length - 1; i++) { - Add(value[i]); + this.Add(value[i]); } } @@ -158,7 +158,7 @@ public void AddRange(ArrayList value) { if (obj is SearchItemInfo) { - Add((SearchItemInfo) obj); + this.Add((SearchItemInfo) obj); } } } @@ -171,7 +171,7 @@ public void AddRange(SearchItemInfoCollection value) { for (int i = 0; i <= value.Count - 1; i++) { - Add((SearchItemInfo) value.List[i]); + this.Add((SearchItemInfo) value.List[i]); } } @@ -182,7 +182,7 @@ public void AddRange(SearchItemInfoCollection value) /// The index of the array at which to begin inserting. public void CopyTo(SearchItemInfo[] array, int index) { - List.CopyTo(array, index); + this.List.CopyTo(array, index); } /// @@ -191,8 +191,8 @@ public void CopyTo(SearchItemInfo[] array, int index) /// Array of type SearchItemInfo public SearchItemInfo[] ToArray() { - var arr = new SearchItemInfo[Count]; - CopyTo(arr, 0); + var arr = new SearchItemInfo[this.Count]; + this.CopyTo(arr, 0); return arr; } diff --git a/DNN Platform/Library/Services/Search/SearchResultsInfo.cs b/DNN Platform/Library/Services/Search/SearchResultsInfo.cs index fbe397eaea9..c0e9223e1e2 100644 --- a/DNN Platform/Library/Services/Search/SearchResultsInfo.cs +++ b/DNN Platform/Library/Services/Search/SearchResultsInfo.cs @@ -45,11 +45,11 @@ public int SearchItemID { get { - return m_SearchItemID; + return this.m_SearchItemID; } set { - m_SearchItemID = value; + this.m_SearchItemID = value; } } @@ -57,11 +57,11 @@ public string Title { get { - return m_Title; + return this.m_Title; } set { - m_Title = value; + this.m_Title = value; } } @@ -69,11 +69,11 @@ public string Description { get { - return m_Description; + return this.m_Description; } set { - m_Description = value; + this.m_Description = value; } } @@ -81,11 +81,11 @@ public string Author { get { - return m_Author; + return this.m_Author; } set { - m_Author = value; + this.m_Author = value; } } @@ -93,11 +93,11 @@ public DateTime PubDate { get { - return m_PubDate; + return this.m_PubDate; } set { - m_PubDate = value; + this.m_PubDate = value; } } @@ -105,11 +105,11 @@ public string Guid { get { - return m_Guid; + return this.m_Guid; } set { - m_Guid = value; + this.m_Guid = value; } } @@ -117,11 +117,11 @@ public int Image { get { - return m_Image; + return this.m_Image; } set { - m_Image = value; + this.m_Image = value; } } @@ -129,11 +129,11 @@ public int TabId { get { - return m_TabId; + return this.m_TabId; } set { - m_TabId = value; + this.m_TabId = value; } } @@ -141,11 +141,11 @@ public string SearchKey { get { - return m_SearchKey; + return this.m_SearchKey; } set { - m_SearchKey = value; + this.m_SearchKey = value; } } @@ -153,11 +153,11 @@ public int Occurrences { get { - return m_Occurrences; + return this.m_Occurrences; } set { - m_Occurrences = value; + this.m_Occurrences = value; } } @@ -165,11 +165,11 @@ public int Relevance { get { - return m_Relevance; + return this.m_Relevance; } set { - m_Relevance = value; + this.m_Relevance = value; } } @@ -177,11 +177,11 @@ public int ModuleId { get { - return m_ModuleId; + return this.m_ModuleId; } set { - m_ModuleId = value; + this.m_ModuleId = value; } } @@ -189,11 +189,11 @@ public bool Delete { get { - return m_Delete; + return this.m_Delete; } set { - m_Delete = value; + this.m_Delete = value; } } @@ -201,11 +201,11 @@ public string AuthorName { get { - return m_AuthorName; + return this.m_AuthorName; } set { - m_AuthorName = value; + this.m_AuthorName = value; } } @@ -213,11 +213,11 @@ public int PortalId { get { - return m_PortalId; + return this.m_PortalId; } set { - m_PortalId = value; + this.m_PortalId = value; } } } diff --git a/DNN Platform/Library/Services/Search/SearchResultsInfoCollection.cs b/DNN Platform/Library/Services/Search/SearchResultsInfoCollection.cs index 84923b5adda..31160eeedc8 100644 --- a/DNN Platform/Library/Services/Search/SearchResultsInfoCollection.cs +++ b/DNN Platform/Library/Services/Search/SearchResultsInfoCollection.cs @@ -41,7 +41,7 @@ public SearchResultsInfoCollection() /// A SearchResultsInfoCollection with which to initialize the collection. public SearchResultsInfoCollection(SearchResultsInfoCollection value) { - AddRange(value); + this.AddRange(value); } /// @@ -50,7 +50,7 @@ public SearchResultsInfoCollection(SearchResultsInfoCollection value) /// An array of SearchResultsInfo objects with which to initialize the collection. public SearchResultsInfoCollection(SearchResultsInfo[] value) { - AddRange(value); + this.AddRange(value); } /// @@ -59,7 +59,7 @@ public SearchResultsInfoCollection(SearchResultsInfo[] value) /// An array of SearchResultsInfo objects with which to initialize the collection. public SearchResultsInfoCollection(ArrayList value) { - AddRange(value); + this.AddRange(value); } #endregion @@ -76,11 +76,11 @@ public SearchResultsInfo this[int index] { get { - return (SearchResultsInfo) List[index]; + return (SearchResultsInfo) this.List[index]; } set { - List[index] = value; + this.List[index] = value; } } @@ -94,7 +94,7 @@ public SearchResultsInfo this[int index] /// An object of type SearchResultsInfo to add to the collection. public int Add(SearchResultsInfo value) { - return List.Add(value); + return this.List.Add(value); } /// @@ -104,7 +104,7 @@ public int Add(SearchResultsInfo value) /// The index in the collection of the specified object, if found; otherwise, -1. public int IndexOf(SearchResultsInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } /// @@ -114,7 +114,7 @@ public int IndexOf(SearchResultsInfo value) /// An object of type SearchResultsInfo to add to the collection. public void Insert(int index, SearchResultsInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } /// @@ -123,7 +123,7 @@ public void Insert(int index, SearchResultsInfo value) /// An object of type SearchResultsInfo to remove to the collection. public void Remove(SearchResultsInfo value) { - List.Remove(value); + this.List.Remove(value); } /// @@ -133,7 +133,7 @@ public void Remove(SearchResultsInfo value) /// true if the collection contains the specified object; otherwise, false. public bool Contains(SearchResultsInfo value) { - return List.Contains(value); + return this.List.Contains(value); } /// @@ -144,7 +144,7 @@ public void AddRange(SearchResultsInfo[] value) { for (int i = 0; i <= value.Length - 1; i++) { - Add(value[i]); + this.Add(value[i]); } } @@ -158,7 +158,7 @@ public void AddRange(ArrayList value) { if (obj is SearchResultsInfo) { - Add((SearchResultsInfo) obj); + this.Add((SearchResultsInfo) obj); } } } @@ -171,7 +171,7 @@ public void AddRange(SearchResultsInfoCollection value) { for (int i = 0; i <= value.Count - 1; i++) { - Add((SearchResultsInfo) value.List[i]); + this.Add((SearchResultsInfo) value.List[i]); } } @@ -182,7 +182,7 @@ public void AddRange(SearchResultsInfoCollection value) /// The index of the array at which to begin inserting. public void CopyTo(SearchResultsInfo[] array, int index) { - List.CopyTo(array, index); + this.List.CopyTo(array, index); } /// @@ -191,8 +191,8 @@ public void CopyTo(SearchResultsInfo[] array, int index) /// Array of type SearchResultsInfo public SearchResultsInfo[] ToArray() { - var arr = new SearchResultsInfo[Count]; - CopyTo(arr, 0); + var arr = new SearchResultsInfo[this.Count]; + this.CopyTo(arr, 0); return arr; } diff --git a/DNN Platform/Library/Services/Search/TabIndexer.cs b/DNN Platform/Library/Services/Search/TabIndexer.cs index 1c05ea9ecad..5e97d37324d 100644 --- a/DNN Platform/Library/Services/Search/TabIndexer.cs +++ b/DNN Platform/Library/Services/Search/TabIndexer.cs @@ -47,7 +47,7 @@ public override int IndexSearchDocuments(int portalId, Requires.NotNull("indexer", indexer); const int saveThreshold = 1024; var totalIndexed = 0; - startDateLocal = GetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, startDateLocal); + startDateLocal = this.GetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, startDateLocal); var searchDocuments = new List(); var tabs = ( from t in TabController.Instance.GetTabsByPortal(portalId).AsList() @@ -67,7 +67,7 @@ from t in TabController.Instance.GetTabsByPortal(portalId).AsList() if (searchDocuments.Count >= saveThreshold) { - totalIndexed += IndexCollectedDocs(indexer, searchDocuments, portalId, schedule.ScheduleID); + totalIndexed += this.IndexCollectedDocs(indexer, searchDocuments, portalId, schedule.ScheduleID); } } catch (Exception ex) @@ -78,7 +78,7 @@ from t in TabController.Instance.GetTabsByPortal(portalId).AsList() if (searchDocuments.Count > 0) { - totalIndexed += IndexCollectedDocs(indexer, searchDocuments, portalId, schedule.ScheduleID); + totalIndexed += this.IndexCollectedDocs(indexer, searchDocuments, portalId, schedule.ScheduleID); } } @@ -123,7 +123,7 @@ private int IndexCollectedDocs(Action> indexer, { indexer.Invoke(searchDocuments); var total = searchDocuments.Count; - SetLocalTimeOfLastIndexedItem(portalId, scheduleId, searchDocuments.Last().ModifiedTimeUtc); + this.SetLocalTimeOfLastIndexedItem(portalId, scheduleId, searchDocuments.Last().ModifiedTimeUtc); searchDocuments.Clear(); return total; } diff --git a/DNN Platform/Library/Services/Search/UserIndexer.cs b/DNN Platform/Library/Services/Search/UserIndexer.cs index f7c9578cd16..d68372015f7 100644 --- a/DNN Platform/Library/Services/Search/UserIndexer.cs +++ b/DNN Platform/Library/Services/Search/UserIndexer.cs @@ -71,7 +71,7 @@ public override int IndexSearchDocuments(int portalId, const int saveThreshold = BatchSize; var totalIndexed = 0; var checkpointModified = false; - startDateLocal = GetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, startDateLocal); + startDateLocal = this.GetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, startDateLocal); var searchDocuments = new Dictionary(); var needReindex = PortalController.GetPortalSettingAsBoolean(UserIndexResetFlag, portalId, false); @@ -93,7 +93,7 @@ public override int IndexSearchDocuments(int portalId, try { int startUserId; - var checkpointData = GetLastCheckpointData(portalId, schedule.ScheduleID); + var checkpointData = this.GetLastCheckpointData(portalId, schedule.ScheduleID); if (string.IsNullOrEmpty(checkpointData) || !int.TryParse(checkpointData, out startUserId)) { startUserId = Null.NullInteger; @@ -111,9 +111,9 @@ public override int IndexSearchDocuments(int portalId, //remove existing indexes DeleteDocuments(portalId, indexedUsers); var values = searchDocuments.Values; - totalIndexed += IndexCollectedDocs(indexer, values); - SetLastCheckpointData(portalId, schedule.ScheduleID, startUserId.ToString()); - SetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, values.Last().ModifiedTimeUtc.ToLocalTime()); + totalIndexed += this.IndexCollectedDocs(indexer, values); + this.SetLastCheckpointData(portalId, schedule.ScheduleID, startUserId.ToString()); + this.SetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, values.Last().ModifiedTimeUtc.ToLocalTime()); searchDocuments.Clear(); checkpointModified = true; } @@ -124,7 +124,7 @@ public override int IndexSearchDocuments(int portalId, //remove existing indexes DeleteDocuments(portalId, indexedUsers); var values = searchDocuments.Values; - totalIndexed += IndexCollectedDocs(indexer, values); + totalIndexed += this.IndexCollectedDocs(indexer, values); checkpointModified = true; } @@ -142,8 +142,8 @@ public override int IndexSearchDocuments(int portalId, if (checkpointModified) { // at last reset start user pointer - SetLastCheckpointData(portalId, schedule.ScheduleID, Null.NullInteger.ToString()); - SetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, DateTime.Now); + this.SetLastCheckpointData(portalId, schedule.ScheduleID, Null.NullInteger.ToString()); + this.SetLocalTimeOfLastIndexedItem(portalId, schedule.ScheduleID, DateTime.Now); } return totalIndexed; } diff --git a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs index a970f7c79c9..4248317c7db 100644 --- a/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs +++ b/DNN Platform/Library/Services/Sitemap/CoreSitemapProvider.cs @@ -47,9 +47,9 @@ public override List GetUrls(int portalId, PortalSettings ps, string SitemapUrl pageUrl = null; var urls = new List(); - useLevelBasedPagePriority = bool.Parse(PortalController.GetPortalSetting("SitemapLevelMode", portalId, "False")); - minPagePriority = float.Parse(PortalController.GetPortalSetting("SitemapMinPriority", portalId, "0.1"), CultureInfo.InvariantCulture); - includeHiddenPages = bool.Parse(PortalController.GetPortalSetting("SitemapIncludeHidden", portalId, "True")); + this.useLevelBasedPagePriority = bool.Parse(PortalController.GetPortalSetting("SitemapLevelMode", portalId, "False")); + this.minPagePriority = float.Parse(PortalController.GetPortalSetting("SitemapMinPriority", portalId, "0.1"), CultureInfo.InvariantCulture); + this.includeHiddenPages = bool.Parse(PortalController.GetPortalSetting("SitemapIncludeHidden", portalId, "True")); var currentLanguage = ps.CultureCode; if (string.IsNullOrEmpty(currentLanguage)) @@ -66,13 +66,13 @@ public override List GetUrls(int portalId, PortalSettings ps, string { if (!tab.IsDeleted && !tab.DisableLink && tab.TabType == TabType.Normal && (Null.IsNull(tab.StartDate) || tab.StartDate < DateTime.Now) && - (Null.IsNull(tab.EndDate) || tab.EndDate > DateTime.Now) && IsTabPublic(tab.TabPermissions)) + (Null.IsNull(tab.EndDate) || tab.EndDate > DateTime.Now) && this.IsTabPublic(tab.TabPermissions)) { - if ((includeHiddenPages || tab.IsVisible) && tab.HasBeenPublished) + if ((this.includeHiddenPages || tab.IsVisible) && tab.HasBeenPublished) { try { - pageUrl = GetPageUrl(tab, currentLanguage, ps); + pageUrl = this.GetPageUrl(tab, currentLanguage, ps); urls.Add(pageUrl); } catch (Exception) @@ -110,7 +110,7 @@ private SitemapUrl GetPageUrl(TabInfo objTab, string language, PortalSettings ps url = "https://" + url.Substring("http://".Length); } pageUrl.Url = url; - pageUrl.Priority = GetPriority(objTab); + pageUrl.Priority = this.GetPriority(objTab); pageUrl.LastModified = objTab.LastModifiedOnDate; foreach (ModuleInfo m in ModuleController.Instance.GetTabModules(objTab.TabID).Values) { @@ -135,8 +135,8 @@ private SitemapUrl GetPageUrl(TabInfo objTab, string language, PortalSettings ps if ((!localized.IsDeleted && !localized.DisableLink && localized.TabType == TabType.Normal) && (Null.IsNull(localized.StartDate) || localized.StartDate < DateTime.Now) && (Null.IsNull(localized.EndDate) || localized.EndDate > DateTime.Now) && - (IsTabPublic(localized.TabPermissions)) && - (includeHiddenPages || localized.IsVisible) && localized.HasBeenPublished) + (this.IsTabPublic(localized.TabPermissions)) && + (this.includeHiddenPages || localized.IsVisible) && localized.HasBeenPublished) { string alternateUrl = TestableGlobals.Instance.NavigateURL(localized.TabID, localized.IsSuperTab, ps, "", localized.CultureCode); alternates.Add(new AlternateUrl() @@ -177,7 +177,7 @@ protected float GetPriority(TabInfo objTab) { float priority = objTab.SiteMapPriority; - if (useLevelBasedPagePriority) + if (this.useLevelBasedPagePriority) { if (objTab.Level >= 9) { @@ -188,9 +188,9 @@ protected float GetPriority(TabInfo objTab) priority = Convert.ToSingle(1 - (objTab.Level * 0.1)); } - if (priority < minPagePriority) + if (priority < this.minPagePriority) { - priority = minPagePriority; + priority = this.minPagePriority; } } diff --git a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs index 772c6ed35a7..d5886a78e77 100644 --- a/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs +++ b/DNN Platform/Library/Services/Sitemap/SitemapBuilder.cs @@ -40,18 +40,18 @@ public string CacheFileName { get { - if (string.IsNullOrEmpty(_cacheFileName)) + if (string.IsNullOrEmpty(this._cacheFileName)) { - var currentCulture = PortalSettings.CultureCode?.ToLowerInvariant(); + var currentCulture = this.PortalSettings.CultureCode?.ToLowerInvariant(); if (string.IsNullOrEmpty(currentCulture)) { - currentCulture = Localization.Localization.GetPageLocale(PortalSettings).Name.ToLowerInvariant(); + currentCulture = Localization.Localization.GetPageLocale(this.PortalSettings).Name.ToLowerInvariant(); } - _cacheFileName = string.Format("sitemap" + ".{0}.xml", currentCulture); + this._cacheFileName = string.Format("sitemap" + ".{0}.xml", currentCulture); } - return _cacheFileName; + return this._cacheFileName; } } @@ -59,13 +59,13 @@ public string CacheIndexFileNameFormat { get { - if (string.IsNullOrEmpty(_cacheIndexFileNameFormat)) + if (string.IsNullOrEmpty(this._cacheIndexFileNameFormat)) { - var currentCulture = Localization.Localization.GetPageLocale(PortalSettings).Name.ToLowerInvariant(); - _cacheIndexFileNameFormat = string.Format("sitemap_{{0}}" + ".{0}.xml", currentCulture); + var currentCulture = Localization.Localization.GetPageLocale(this.PortalSettings).Name.ToLowerInvariant(); + this._cacheIndexFileNameFormat = string.Format("sitemap_{{0}}" + ".{0}.xml", currentCulture); } - return _cacheIndexFileNameFormat; + return this._cacheIndexFileNameFormat; } } @@ -79,7 +79,7 @@ public string CacheIndexFileNameFormat /// public SitemapBuilder(PortalSettings ps) { - PortalSettings = ps; + this.PortalSettings = ps; LoadProviders(); } @@ -93,12 +93,12 @@ public SitemapBuilder(PortalSettings ps) /// public void BuildSiteMap(TextWriter output) { - int cacheDays = Int32.Parse(PortalController.GetPortalSetting("SitemapCacheDays", PortalSettings.PortalId, "1")); + int cacheDays = Int32.Parse(PortalController.GetPortalSetting("SitemapCacheDays", this.PortalSettings.PortalId, "1")); bool cached = cacheDays > 0; - if (cached && CacheIsValid()) + if (cached && this.CacheIsValid()) { - WriteSitemapFileToOutput(CacheFileName, output); + this.WriteSitemapFileToOutput(this.CacheFileName, output); return; } @@ -107,7 +107,7 @@ public void BuildSiteMap(TextWriter output) // excluded urls by priority float excludePriority = 0; - excludePriority = float.Parse(PortalController.GetPortalSetting("SitemapExcludePriority", PortalSettings.PortalId, "0"), NumberFormatInfo.InvariantInfo); + excludePriority = float.Parse(PortalController.GetPortalSetting("SitemapExcludePriority", this.PortalSettings.PortalId, "0"), NumberFormatInfo.InvariantInfo); // get all urls bool isProviderEnabled = false; @@ -115,22 +115,22 @@ public void BuildSiteMap(TextWriter output) float providerPriorityValue = 0; - foreach (SitemapProvider _provider in Providers) + foreach (SitemapProvider _provider in this.Providers) { - isProviderEnabled = bool.Parse(PortalController.GetPortalSetting(_provider.Name + "Enabled", PortalSettings.PortalId, "True")); + isProviderEnabled = bool.Parse(PortalController.GetPortalSetting(_provider.Name + "Enabled", this.PortalSettings.PortalId, "True")); if (isProviderEnabled) { // check if we should override the priorities - isProviderPriorityOverrided = bool.Parse(PortalController.GetPortalSetting(_provider.Name + "Override", PortalSettings.PortalId, "False")); + isProviderPriorityOverrided = bool.Parse(PortalController.GetPortalSetting(_provider.Name + "Override", this.PortalSettings.PortalId, "False")); // stored as an integer (pr * 100) to prevent from translating errors with the decimal point - providerPriorityValue = float.Parse(PortalController.GetPortalSetting(_provider.Name + "Value", PortalSettings.PortalId, "50")) / 100; + providerPriorityValue = float.Parse(PortalController.GetPortalSetting(_provider.Name + "Value", this.PortalSettings.PortalId, "50")) / 100; // Get all urls from provider List urls = new List(); try { - urls = _provider.GetUrls(PortalSettings.PortalId, PortalSettings, SITEMAP_VERSION); + urls = _provider.GetUrls(this.PortalSettings.PortalId, this.PortalSettings, SITEMAP_VERSION); } catch (Exception ex) { @@ -161,7 +161,7 @@ public void BuildSiteMap(TextWriter output) if (!cached) { cached = true; - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "SitemapCacheDays", "1"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "SitemapCacheDays", "1"); } // create all the files @@ -183,22 +183,22 @@ public void BuildSiteMap(TextWriter output) elements = elementsInFile; } - WriteSitemap(cached, output, index, allUrls.GetRange(lowerIndex, elements)); + this.WriteSitemap(cached, output, index, allUrls.GetRange(lowerIndex, elements)); } // create the sitemap index - WriteSitemapIndex(output, index - 1); + this.WriteSitemapIndex(output, index - 1); } else { // create a regular sitemap file - WriteSitemap(cached, output, 0, allUrls); + this.WriteSitemap(cached, output, 0, allUrls); } if (cached) { - WriteSitemapFileToOutput(CacheFileName, output); + this.WriteSitemapFileToOutput(this.CacheFileName, output); } } @@ -212,8 +212,8 @@ public void BuildSiteMap(TextWriter output) /// public void GetSitemapIndexFile(string index, TextWriter output) { - var currentCulture = Localization.Localization.GetPageLocale(PortalSettings).Name.ToLowerInvariant(); - WriteSitemapFileToOutput(string.Format("sitemap_{0}.{1}.xml", index, currentCulture), output); + var currentCulture = Localization.Localization.GetPageLocale(this.PortalSettings).Name.ToLowerInvariant(); + this.WriteSitemapFileToOutput(string.Format("sitemap_{0}.{1}.xml", index, currentCulture), output); } /// @@ -236,12 +236,12 @@ private void WriteSitemap(bool cached, TextWriter output, int index, List 0) ? string.Format(CacheIndexFileNameFormat, index) : CacheFileName; - sitemapOutput = new StreamWriter(PortalSettings.HomeSystemDirectoryMapPath + "Sitemap\\" + cachedFile, false, Encoding.UTF8); + var cachedFile = (index > 0) ? string.Format(this.CacheIndexFileNameFormat, index) : this.CacheFileName; + sitemapOutput = new StreamWriter(this.PortalSettings.HomeSystemDirectoryMapPath + "Sitemap\\" + cachedFile, false, Encoding.UTF8); } // Initialize writer @@ -262,7 +262,7 @@ private void WriteSitemap(bool cached, TextWriter output, int index, ListTrue is the cached file exists and is still valid, false otherwise private bool CacheIsValid() { - int cacheDays = int.Parse(PortalController.GetPortalSetting("SitemapCacheDays", PortalSettings.PortalId, "1")); - var isValid = File.Exists(PortalSettings.HomeSystemDirectoryMapPath + "Sitemap\\" + CacheFileName); + int cacheDays = int.Parse(PortalController.GetPortalSetting("SitemapCacheDays", this.PortalSettings.PortalId, "1")); + var isValid = File.Exists(this.PortalSettings.HomeSystemDirectoryMapPath + "Sitemap\\" + this.CacheFileName); if (!isValid) { return isValid; } - DateTime lastmod = File.GetLastWriteTime(PortalSettings.HomeSystemDirectoryMapPath + "/Sitemap/" + CacheFileName); + DateTime lastmod = File.GetLastWriteTime(this.PortalSettings.HomeSystemDirectoryMapPath + "/Sitemap/" + this.CacheFileName); if (lastmod.AddDays(cacheDays) < DateTime.Now) { isValid = false; @@ -389,12 +389,12 @@ private bool CacheIsValid() /// The output stream private void WriteSitemapFileToOutput(string file, TextWriter output) { - if (!File.Exists(PortalSettings.HomeSystemDirectoryMapPath + "Sitemap\\" + file)) + if (!File.Exists(this.PortalSettings.HomeSystemDirectoryMapPath + "Sitemap\\" + file)) { return; } // write the cached file to output - using (var reader = new StreamReader(PortalSettings.HomeSystemDirectoryMapPath + "/Sitemap/" + file, Encoding.UTF8)) + using (var reader = new StreamReader(this.PortalSettings.HomeSystemDirectoryMapPath + "/Sitemap/" + file, Encoding.UTF8)) { output.Write(reader.ReadToEnd()); diff --git a/DNN Platform/Library/Services/Sitemap/SitemapProvider.cs b/DNN Platform/Library/Services/Sitemap/SitemapProvider.cs index 5d06194bbda..f62f5f574df 100644 --- a/DNN Platform/Library/Services/Sitemap/SitemapProvider.cs +++ b/DNN Platform/Library/Services/Sitemap/SitemapProvider.cs @@ -24,11 +24,11 @@ public bool Enabled { get { - return bool.Parse(PortalController.GetPortalSetting(Name + "Enabled", PortalController.Instance.GetCurrentPortalSettings().PortalId, "True")); + return bool.Parse(PortalController.GetPortalSetting(this.Name + "Enabled", PortalController.Instance.GetCurrentPortalSettings().PortalId, "True")); } set { - PortalController.UpdatePortalSetting(PortalController.Instance.GetCurrentPortalSettings().PortalId, Name + "Enabled", value.ToString()); + PortalController.UpdatePortalSetting(PortalController.Instance.GetCurrentPortalSettings().PortalId, this.Name + "Enabled", value.ToString()); } } @@ -37,11 +37,11 @@ public bool OverridePriority { get { - return bool.Parse(PortalController.GetPortalSetting(Name + "Override", PortalController.Instance.GetCurrentPortalSettings().PortalId, "False")); + return bool.Parse(PortalController.GetPortalSetting(this.Name + "Override", PortalController.Instance.GetCurrentPortalSettings().PortalId, "False")); } set { - PortalController.UpdatePortalSetting(PortalController.Instance.GetCurrentPortalSettings().PortalId, Name + "Override", value.ToString()); + PortalController.UpdatePortalSetting(PortalController.Instance.GetCurrentPortalSettings().PortalId, this.Name + "Override", value.ToString()); } } @@ -50,17 +50,17 @@ public float Priority get { float value = 0; - if ((OverridePriority)) + if ((this.OverridePriority)) { // stored as an integer (pr * 100) to prevent from translating errors with the decimal point - value = float.Parse(PortalController.GetPortalSetting(Name + "Value", PortalController.Instance.GetCurrentPortalSettings().PortalId, "0.5"), NumberFormatInfo.InvariantInfo); + value = float.Parse(PortalController.GetPortalSetting(this.Name + "Value", PortalController.Instance.GetCurrentPortalSettings().PortalId, "0.5"), NumberFormatInfo.InvariantInfo); } return value; } set { - PortalController.UpdatePortalSetting(PortalController.Instance.GetCurrentPortalSettings().PortalId, Name + "Value", value.ToString(NumberFormatInfo.InvariantInfo)); + PortalController.UpdatePortalSetting(PortalController.Instance.GetCurrentPortalSettings().PortalId, this.Name + "Value", value.ToString(NumberFormatInfo.InvariantInfo)); } } diff --git a/DNN Platform/Library/Services/Social/Messaging/Data/DataService.cs b/DNN Platform/Library/Services/Social/Messaging/Data/DataService.cs index b1e03cacc0b..670f0726393 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Data/DataService.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Data/DataService.cs @@ -35,7 +35,7 @@ internal class DataService : ComponentBase, IDataServ public int SaveMessage(Message message, int portalId, int createUpdateUserId) { //need to fix groupmail - return _provider.ExecuteScalar("CoreMessaging_SaveMessage", message.MessageID, portalId ,message.To, message.From, message.Subject, message.Body, message.ConversationId, message.ReplyAllAllowed, message.SenderUserID, createUpdateUserId); + return this._provider.ExecuteScalar("CoreMessaging_SaveMessage", message.MessageID, portalId ,message.To, message.From, message.Subject, message.Body, message.ConversationId, message.ReplyAllAllowed, message.SenderUserID, createUpdateUserId); } /// Gets the message. @@ -43,7 +43,7 @@ public int SaveMessage(Message message, int portalId, int createUpdateUserId) /// A containing the message data public IDataReader GetMessage(int messageId) { - return _provider.ExecuteReader("CoreMessaging_GetMessage", messageId); + return this._provider.ExecuteReader("CoreMessaging_GetMessage", messageId); } /// Gets the last sent message. @@ -52,7 +52,7 @@ public IDataReader GetMessage(int messageId) /// A containing the last sent message data public IDataReader GetLastSentMessage(int userId, int portalId) { - return _provider.ExecuteReader("CoreMessaging_GetLastSentMessage", userId, portalId); + return this._provider.ExecuteReader("CoreMessaging_GetLastSentMessage", userId, portalId); } /// Gets the messages by sender. @@ -61,14 +61,14 @@ public IDataReader GetLastSentMessage(int userId, int portalId) /// A containing the messages for a given portal Id public IDataReader GetMessagesBySender(int messageId, int portalId) { - return _provider.ExecuteReader("CoreMessaging_GetMessagesBySender", messageId, portalId); + return this._provider.ExecuteReader("CoreMessaging_GetMessagesBySender", messageId, portalId); } /// Deletes the message. /// The message identifier. public void DeleteMessage(int messageId) { - _provider.ExecuteNonQuery("CoreMessaging_DeleteMessage", messageId); + this._provider.ExecuteNonQuery("CoreMessaging_DeleteMessage", messageId); } /// Deletes the user from conversation. @@ -76,7 +76,7 @@ public void DeleteMessage(int messageId) /// The user identifier. public void DeleteUserFromConversation(int conversationId, int userId) { - _provider.ExecuteNonQuery("CoreMessaging_DeleteUserFromConversation", conversationId, userId); + this._provider.ExecuteNonQuery("CoreMessaging_DeleteUserFromConversation", conversationId, userId); } /// Creates a message reply. @@ -89,7 +89,7 @@ public void DeleteUserFromConversation(int conversationId, int userId) /// The id of the reply created public int CreateMessageReply(int conversationId, int portalId, string body, int senderUserId, string fromName, int createUpdateUserId) { - return _provider.ExecuteScalar("CoreMessaging_CreateMessageReply", conversationId, portalId, body, senderUserId, fromName, createUpdateUserId); + return this._provider.ExecuteScalar("CoreMessaging_CreateMessageReply", conversationId, portalId, body, senderUserId, fromName, createUpdateUserId); } /// @@ -100,7 +100,7 @@ public int CreateMessageReply(int conversationId, int portalId, string body, int /// The count of recipients public int CheckReplyHasRecipients(int conversationId, int userId) { - return _provider.ExecuteScalar("CoreMessaging_CheckReplyHasRecipients", conversationId, userId); + return this._provider.ExecuteScalar("CoreMessaging_CheckReplyHasRecipients", conversationId, userId); } /// Gets the in box view. @@ -150,7 +150,7 @@ public IDataReader GetInBoxView(int userId, int portalId, int afterMessageId, in break; } - return _provider.ExecuteReader("CoreMessaging_GetMessageConversations", userId, portalId , afterMessageId, numberOfRecords, sortColumn, sortAscending, read, archived, sent); + return this._provider.ExecuteReader("CoreMessaging_GetMessageConversations", userId, portalId , afterMessageId, numberOfRecords, sortColumn, sortAscending, read, archived, sent); } /// Gets the sent box view. @@ -163,7 +163,7 @@ public IDataReader GetInBoxView(int userId, int portalId, int afterMessageId, in /// A containing the sent message box data public IDataReader GetSentBoxView(int userId, int portalId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending) { - return _provider.ExecuteReader("CoreMessaging_GetSentBox", userId, portalId, afterMessageId, numberOfRecords, sortColumn, sortAscending); + return this._provider.ExecuteReader("CoreMessaging_GetSentBox", userId, portalId, afterMessageId, numberOfRecords, sortColumn, sortAscending); } /// Gets the archive box view. @@ -176,7 +176,7 @@ public IDataReader GetSentBoxView(int userId, int portalId, int afterMessageId, /// A containing the archived messages data public IDataReader GetArchiveBoxView(int userId, int portalId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending) { - return _provider.ExecuteReader("CoreMessaging_GetArchiveBox", userId, portalId, afterMessageId, numberOfRecords, sortColumn, sortAscending); + return this._provider.ExecuteReader("CoreMessaging_GetArchiveBox", userId, portalId, afterMessageId, numberOfRecords, sortColumn, sortAscending); } /// Gets the message thread. @@ -190,7 +190,7 @@ public IDataReader GetArchiveBoxView(int userId, int portalId, int afterMessageI /// A containing the message thread data public IDataReader GetMessageThread(int conversationId, int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool @sortAscending, ref int totalRecords) { - return _provider.ExecuteReader("CoreMessaging_GetMessageThread", conversationId, userId, afterMessageId, numberOfRecords, sortColumn, sortAscending); + return this._provider.ExecuteReader("CoreMessaging_GetMessageThread", conversationId, userId, afterMessageId, numberOfRecords, sortColumn, sortAscending); } /// Updates the message read status for a given conversation. @@ -199,7 +199,7 @@ public IDataReader GetMessageThread(int conversationId, int userId, int afterMes /// if read is set to true otherwise false. public void UpdateMessageReadStatus(int conversationId, int userId, bool read) { - _provider.ExecuteNonQuery("CoreMessaging_UpdateMessageReadStatus", conversationId, userId, read); + this._provider.ExecuteNonQuery("CoreMessaging_UpdateMessageReadStatus", conversationId, userId, read); } /// Updates the message archived status. @@ -208,7 +208,7 @@ public void UpdateMessageReadStatus(int conversationId, int userId, bool read) /// if set to true archived. public void UpdateMessageArchivedStatus(int conversationId, int userId, bool archived) { - _provider.ExecuteNonQuery("CoreMessaging_UpdateMessageArchivedStatus", conversationId, userId, archived); + this._provider.ExecuteNonQuery("CoreMessaging_UpdateMessageArchivedStatus", conversationId, userId, archived); } /// Counts the new threads. @@ -217,7 +217,7 @@ public void UpdateMessageArchivedStatus(int conversationId, int userId, bool arc /// The count of new threads for a given user public int CountNewThreads(int userId, int portalId) { - return _provider.ExecuteScalar("CoreMessaging_CountNewThreads", userId, portalId); + return this._provider.ExecuteScalar("CoreMessaging_CountNewThreads", userId, portalId); } /// Counts the total conversations. @@ -226,7 +226,7 @@ public int CountNewThreads(int userId, int portalId) /// The count of new conversations for a given user public int CountTotalConversations(int userId, int portalId) { - return _provider.ExecuteScalar("CoreMessaging_CountTotalConversations", userId, portalId); + return this._provider.ExecuteScalar("CoreMessaging_CountTotalConversations", userId, portalId); } /// Counts the messages by conversation. @@ -234,7 +234,7 @@ public int CountTotalConversations(int userId, int portalId) /// The count of new messages for a given conversation public int CountMessagesByConversation(int conversationId) { - return _provider.ExecuteScalar("CoreMessaging_CountMessagesByConversation", conversationId); + return this._provider.ExecuteScalar("CoreMessaging_CountMessagesByConversation", conversationId); } /// Counts the archived messages by conversation. @@ -242,7 +242,7 @@ public int CountMessagesByConversation(int conversationId) /// The count of archived messages for a given conversation public int CountArchivedMessagesByConversation(int conversationId) { - return _provider.ExecuteScalar("CoreMessaging_CountArchivedMessagesByConversation", conversationId); + return this._provider.ExecuteScalar("CoreMessaging_CountArchivedMessagesByConversation", conversationId); } /// Counts the sent messages. @@ -251,7 +251,7 @@ public int CountArchivedMessagesByConversation(int conversationId) /// The count of messages sent for a given user public int CountSentMessages(int userId, int portalId) { - return _provider.ExecuteScalar("CoreMessaging_CountSentMessages", userId, portalId); + return this._provider.ExecuteScalar("CoreMessaging_CountSentMessages", userId, portalId); } /// Counts the archived messages. @@ -260,7 +260,7 @@ public int CountSentMessages(int userId, int portalId) /// The count of archived messages for a given user public int CountArchivedMessages(int userId, int portalId) { - return _provider.ExecuteScalar("CoreMessaging_CountArchivedMessages", userId, portalId); + return this._provider.ExecuteScalar("CoreMessaging_CountArchivedMessages", userId, portalId); } /// Counts the sent conversations. @@ -269,7 +269,7 @@ public int CountArchivedMessages(int userId, int portalId) /// The count of sent conversations for a given user public int CountSentConversations(int userId, int portalId) { - return _provider.ExecuteScalar("CoreMessaging_CountSentConversations", userId, portalId); + return this._provider.ExecuteScalar("CoreMessaging_CountSentConversations", userId, portalId); } /// Counts the archived conversations. @@ -278,7 +278,7 @@ public int CountSentConversations(int userId, int portalId) /// The count of archived conversations for a given user public int CountArchivedConversations(int userId, int portalId) { - return _provider.ExecuteScalar("CoreMessaging_CountArchivedConversations", userId, portalId); + return this._provider.ExecuteScalar("CoreMessaging_CountArchivedConversations", userId, portalId); } #endregion @@ -291,7 +291,7 @@ public int CountArchivedConversations(int userId, int portalId) /// The new message recipient Id. public int SaveMessageRecipient(MessageRecipient messageRecipient, int createUpdateUserId) { - return _provider.ExecuteScalar("CoreMessaging_SaveMessageRecipient", messageRecipient.RecipientID, messageRecipient.MessageID, messageRecipient.UserID, messageRecipient.Read, messageRecipient.Archived, createUpdateUserId); + return this._provider.ExecuteScalar("CoreMessaging_SaveMessageRecipient", messageRecipient.RecipientID, messageRecipient.MessageID, messageRecipient.UserID, messageRecipient.Read, messageRecipient.Archived, createUpdateUserId); } /// Creates the message recipients for role. @@ -300,7 +300,7 @@ public int SaveMessageRecipient(MessageRecipient messageRecipient, int createUpd /// The create update user identifier. public void CreateMessageRecipientsForRole(int messageId, string roleIds, int createUpdateUserId) { - _provider.ExecuteNonQuery("CoreMessaging_CreateMessageRecipientsForRole", messageId, roleIds, createUpdateUserId); + this._provider.ExecuteNonQuery("CoreMessaging_CreateMessageRecipientsForRole", messageId, roleIds, createUpdateUserId); } /// Gets the message recipient. @@ -308,7 +308,7 @@ public void CreateMessageRecipientsForRole(int messageId, string roleIds, int cr /// A containing the message recipient data public IDataReader GetMessageRecipient(int messageRecipientId) { - return _provider.ExecuteReader("CoreMessaging_GetMessageRecipient", messageRecipientId); + return this._provider.ExecuteReader("CoreMessaging_GetMessageRecipient", messageRecipientId); } /// Gets the message recipients by user. @@ -316,7 +316,7 @@ public IDataReader GetMessageRecipient(int messageRecipientId) /// A containing the message recipient data public IDataReader GetMessageRecipientsByUser(int userId) { - return _provider.ExecuteReader("CoreMessaging_GetMessageRecipientsByUser", userId); + return this._provider.ExecuteReader("CoreMessaging_GetMessageRecipientsByUser", userId); } /// Gets the message recipients by message. @@ -324,7 +324,7 @@ public IDataReader GetMessageRecipientsByUser(int userId) /// A containing the message recipient data public IDataReader GetMessageRecipientsByMessage(int messageId) { - return _provider.ExecuteReader("CoreMessaging_GetMessageRecipientsByMessage", messageId); + return this._provider.ExecuteReader("CoreMessaging_GetMessageRecipientsByMessage", messageId); } /// Gets the message recipient by message and user. @@ -333,14 +333,14 @@ public IDataReader GetMessageRecipientsByMessage(int messageId) /// A containing the message recipient data public IDataReader GetMessageRecipientByMessageAndUser(int messageId, int userId) { - return _provider.ExecuteReader("CoreMessaging_GetMessageRecipientsByMessageAndUser", messageId, userId); + return this._provider.ExecuteReader("CoreMessaging_GetMessageRecipientsByMessageAndUser", messageId, userId); } /// Deletes the message recipient. /// The message recipient identifier. public void DeleteMessageRecipient(int messageRecipientId) { - _provider.ExecuteNonQuery("CoreMessaging_DeleteMessageRecipient", messageRecipientId); + this._provider.ExecuteNonQuery("CoreMessaging_DeleteMessageRecipient", messageRecipientId); } /// Deletes the message recipient by message and user. @@ -348,7 +348,7 @@ public void DeleteMessageRecipient(int messageRecipientId) /// The user identifier. public void DeleteMessageRecipientByMessageAndUser(int messageId, int userId) { - _provider.ExecuteNonQuery("CoreMessaging_DeleteMessageRecipientByMessageAndUser", messageId, userId); + this._provider.ExecuteNonQuery("CoreMessaging_DeleteMessageRecipientByMessageAndUser", messageId, userId); } #endregion @@ -361,7 +361,7 @@ public void DeleteMessageRecipientByMessageAndUser(int messageId, int userId) /// The message attachment Id public int SaveMessageAttachment(MessageAttachment messageAttachment, int createUpdateUserId) { - return _provider.ExecuteScalar("CoreMessaging_SaveMessageAttachment", messageAttachment.MessageAttachmentID, messageAttachment.MessageID, messageAttachment.FileID, createUpdateUserId); + return this._provider.ExecuteScalar("CoreMessaging_SaveMessageAttachment", messageAttachment.MessageAttachmentID, messageAttachment.MessageID, messageAttachment.FileID, createUpdateUserId); } /// Gets the message attachment. @@ -369,7 +369,7 @@ public int SaveMessageAttachment(MessageAttachment messageAttachment, int create /// A containing the message attachment data public IDataReader GetMessageAttachment(int messageAttachmentId) { - return _provider.ExecuteReader("CoreMessaging_GetMessageAttachment", messageAttachmentId); + return this._provider.ExecuteReader("CoreMessaging_GetMessageAttachment", messageAttachmentId); } /// Gets the message attachments by message id. @@ -378,7 +378,7 @@ public IDataReader GetMessageAttachment(int messageAttachmentId) public IList GetMessageAttachmentsByMessage(int messageId) { var attachments = new List(); - var dr = _provider.ExecuteReader("CoreMessaging_GetMessageAttachmentsByMessage", messageId); + var dr = this._provider.ExecuteReader("CoreMessaging_GetMessageAttachmentsByMessage", messageId); try { @@ -412,7 +412,7 @@ public IList GetMessageAttachmentsByMessage(int messageId) /// The message attachment identifier. public void DeleteMessageAttachment(int messageAttachmentId) { - _provider.ExecuteNonQuery("CoreMessaging_DeleteMessageAttachment", messageAttachmentId); + this._provider.ExecuteNonQuery("CoreMessaging_DeleteMessageAttachment", messageAttachmentId); } #endregion @@ -424,14 +424,14 @@ public void DeleteMessageAttachment(int messageAttachmentId) /// Size of the page. public void ConvertLegacyMessages(int pageIndex, int pageSize) { - _provider.ExecuteNonQuery("CoreMessaging_ConvertLegacyMessages", pageIndex, pageSize); + this._provider.ExecuteNonQuery("CoreMessaging_ConvertLegacyMessages", pageIndex, pageSize); } /// Counts the legacy messages. /// A containing the messages data public IDataReader CountLegacyMessages() { - return _provider.ExecuteReader("CoreMessaging_CountLegacyMessages"); + return this._provider.ExecuteReader("CoreMessaging_CountLegacyMessages"); } #endregion @@ -444,7 +444,7 @@ public IDataReader CountLegacyMessages() /// A containing the messages data public IDataReader GetNextMessagesForInstantDispatch(Guid schedulerInstance, int batchSize) { - return _provider.ExecuteReader("CoreMessaging_GetNextMessagesForInstantDispatch", schedulerInstance,batchSize); + return this._provider.ExecuteReader("CoreMessaging_GetNextMessagesForInstantDispatch", schedulerInstance,batchSize); } /// Gets the next messages for digest dispatch. @@ -454,7 +454,7 @@ public IDataReader GetNextMessagesForInstantDispatch(Guid schedulerInstance, int /// A containing the messages data public IDataReader GetNextMessagesForDigestDispatch(int frequecy, Guid schedulerInstance, int batchSize) { - return _provider.ExecuteReader("CoreMessaging_GetNextMessagesForDigestDispatch", frequecy, schedulerInstance, batchSize); + return this._provider.ExecuteReader("CoreMessaging_GetNextMessagesForDigestDispatch", frequecy, schedulerInstance, batchSize); } /// Marks the message as dispatched. @@ -462,7 +462,7 @@ public IDataReader GetNextMessagesForDigestDispatch(int frequecy, Guid scheduler /// The recipient identifier. public void MarkMessageAsDispatched(int messageId, int recipientId) { - _provider.ExecuteNonQuery("CoreMessaging_MarkMessageAsDispatched", messageId, recipientId); + this._provider.ExecuteNonQuery("CoreMessaging_MarkMessageAsDispatched", messageId, recipientId); } /// Marks the message as sent. @@ -470,7 +470,7 @@ public void MarkMessageAsDispatched(int messageId, int recipientId) /// The recipient identifier. public void MarkMessageAsSent(int messageId, int recipientId) { - _provider.ExecuteNonQuery("CoreMessaging_MarkMessageAsSent", messageId, recipientId); + this._provider.ExecuteNonQuery("CoreMessaging_MarkMessageAsSent", messageId, recipientId); } #endregion @@ -483,7 +483,7 @@ public void MarkMessageAsSent(int messageId, int recipientId) /// A containing the user data public IDataReader GetUserPreference(int portalId, int userId) { - return _provider.ExecuteReader("CoreMessaging_GetUserPreference", portalId, userId); + return this._provider.ExecuteReader("CoreMessaging_GetUserPreference", portalId, userId); } /// Sets the user preference. @@ -493,7 +493,7 @@ public IDataReader GetUserPreference(int portalId, int userId) /// The notifications email frequency. public void SetUserPreference(int portalId, int userId, int messagesEmailFrequency, int notificationsEmailFrequency) { - _provider.ExecuteNonQuery("CoreMessaging_SetUserPreference", portalId, userId, messagesEmailFrequency, notificationsEmailFrequency); + this._provider.ExecuteNonQuery("CoreMessaging_SetUserPreference", portalId, userId, messagesEmailFrequency, notificationsEmailFrequency); } #endregion diff --git a/DNN Platform/Library/Services/Social/Messaging/Internal/InternalMessagingControllerImpl.cs b/DNN Platform/Library/Services/Social/Messaging/Internal/InternalMessagingControllerImpl.cs index 8077f8377fc..0c81870b7d5 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Internal/InternalMessagingControllerImpl.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Internal/InternalMessagingControllerImpl.cs @@ -56,7 +56,7 @@ public InternalMessagingControllerImpl(IDataService dataService) //Argument Contract Requires.NotNull("dataService", dataService); - _dataService = dataService; + this._dataService = dataService; } #endregion @@ -65,47 +65,47 @@ public InternalMessagingControllerImpl(IDataService dataService) public virtual void DeleteMessageRecipient(int messageId, int userId) { - _dataService.DeleteMessageRecipientByMessageAndUser(messageId, userId); + this._dataService.DeleteMessageRecipientByMessageAndUser(messageId, userId); } public virtual void DeleteUserFromConversation(int conversationId, int userId) { - _dataService.DeleteUserFromConversation(conversationId, userId); + this._dataService.DeleteUserFromConversation(conversationId, userId); } public virtual Message GetMessage(int messageId) { - return CBO.FillObject(_dataService.GetMessage(messageId)); + return CBO.FillObject(this._dataService.GetMessage(messageId)); } public virtual MessageRecipient GetMessageRecipient(int messageId, int userId) { - return CBO.FillObject(_dataService.GetMessageRecipientByMessageAndUser(messageId, userId)); + return CBO.FillObject(this._dataService.GetMessageRecipientByMessageAndUser(messageId, userId)); } public virtual IList GetMessageRecipients(int messageId) { - return CBO.FillCollection(_dataService.GetMessageRecipientsByMessage(messageId)); + return CBO.FillCollection(this._dataService.GetMessageRecipientsByMessage(messageId)); } public virtual void MarkArchived(int conversationId, int userId) { - _dataService.UpdateMessageArchivedStatus(conversationId, userId, true); + this._dataService.UpdateMessageArchivedStatus(conversationId, userId, true); } public virtual void MarkRead(int conversationId, int userId) { - _dataService.UpdateMessageReadStatus(conversationId, userId, true); + this._dataService.UpdateMessageReadStatus(conversationId, userId, true); } public virtual void MarkUnArchived(int conversationId, int userId) { - _dataService.UpdateMessageArchivedStatus(conversationId, userId, false); + this._dataService.UpdateMessageArchivedStatus(conversationId, userId, false); } public virtual void MarkUnRead(int conversationId, int userId) { - _dataService.UpdateMessageReadStatus(conversationId, userId, false); + this._dataService.UpdateMessageReadStatus(conversationId, userId, false); } #endregion @@ -114,7 +114,7 @@ public virtual void MarkUnRead(int conversationId, int userId) public virtual int ReplyMessage(int conversationId, string body, IList fileIDs) { - return ReplyMessage(conversationId, body, fileIDs, UserController.Instance.GetCurrentUserInfo()); + return this.ReplyMessage(conversationId, body, fileIDs, UserController.Instance.GetCurrentUserInfo()); } public virtual int ReplyMessage(int conversationId, string body, IList fileIDs, UserInfo sender) @@ -137,14 +137,14 @@ public virtual int ReplyMessage(int conversationId, string body, IList file //Profanity Filter - var profanityFilterSetting = GetPortalSetting("MessagingProfanityFilters", sender.PortalID, "NO"); + var profanityFilterSetting = this.GetPortalSetting("MessagingProfanityFilters", sender.PortalID, "NO"); if (profanityFilterSetting.Equals("YES", StringComparison.InvariantCultureIgnoreCase)) { - body = InputFilter(body); + body = this.InputFilter(body); } //call ReplyMessage - var messageId = _dataService.CreateMessageReply(conversationId, PortalController.GetEffectivePortalId(sender.PortalID), body, sender.UserID, sender.DisplayName, GetCurrentUserInfo().UserID); + var messageId = this._dataService.CreateMessageReply(conversationId, PortalController.GetEffectivePortalId(sender.PortalID), body, sender.UserID, sender.DisplayName, this.GetCurrentUserInfo().UserID); if (messageId == -1) //Parent message was not found or Recipient was not found in the message { throw new MessageOrRecipientNotFoundException(Localization.Localization.GetString("MsgMessageOrRecipientNotFound", Localization.Localization.ExceptionsResourceFile)); @@ -155,15 +155,15 @@ public virtual int ReplyMessage(int conversationId, string body, IList file { foreach (var attachment in fileIDs.Select(fileId => new MessageAttachment { MessageAttachmentID = Null.NullInteger, FileID = fileId, MessageID = messageId })) { - _dataService.SaveMessageAttachment(attachment, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataService.SaveMessageAttachment(attachment, UserController.Instance.GetCurrentUserInfo().UserID); } } // Mark reply as read and dispatched by the sender - var recipient = GetMessageRecipient(messageId, sender.UserID); + var recipient = this.GetMessageRecipient(messageId, sender.UserID); - MarkMessageAsDispatched(messageId, recipient.RecipientID); - MarkRead(conversationId, sender.UserID); + this.MarkMessageAsDispatched(messageId, recipient.RecipientID); + this.MarkRead(conversationId, sender.UserID); return messageId; } @@ -183,13 +183,13 @@ public virtual int WaitTimeForNextMessage(UserInfo sender) var waitTime = 0; // MessagingThrottlingInterval contains the number of MINUTES to wait before sending the next message - var interval = GetPortalSettingAsDouble("MessagingThrottlingInterval", sender.PortalID, DefaultMessagingThrottlingInterval) * 60; - if (interval > 0 && !IsAdminOrHost(sender)) + var interval = this.GetPortalSettingAsDouble("MessagingThrottlingInterval", sender.PortalID, DefaultMessagingThrottlingInterval) * 60; + if (interval > 0 && !this.IsAdminOrHost(sender)) { - var lastSentMessage = GetLastSentMessage(sender); + var lastSentMessage = this.GetLastSentMessage(sender); if (lastSentMessage != null) { - waitTime = (int)(interval - GetDateTimeNow().Subtract(lastSentMessage.CreatedOnDate).TotalSeconds); + waitTime = (int)(interval - this.GetDateTimeNow().Subtract(lastSentMessage.CreatedOnDate).TotalSeconds); } } return waitTime < 0 ? 0 : waitTime; @@ -200,7 +200,7 @@ public virtual int WaitTimeForNextMessage(UserInfo sender) /// Sender's UserInfo public virtual Message GetLastSentMessage(UserInfo sender) { - return CBO.FillObject(_dataService.GetLastSentMessage(sender.UserID, PortalController.GetEffectivePortalId(sender.PortalID))); + return CBO.FillObject(this._dataService.GetLastSentMessage(sender.UserID, PortalController.GetEffectivePortalId(sender.PortalID))); } /// Whether or not attachments are included with outgoing email. @@ -224,14 +224,14 @@ public virtual bool AttachmentsAllowed(int portalId) /// Portal Id public virtual int RecipientLimit(int portalId) { - return GetPortalSettingAsInteger("MessagingRecipientLimit", portalId, 5); + return this.GetPortalSettingAsInteger("MessagingRecipientLimit", portalId, 5); } ///Whether disable regular users to send message to user/group, default is false. /// Portal Id public virtual bool DisablePrivateMessage(int portalId) { - return GetPortalSetting("DisablePrivateMessage", portalId, "N") == "Y"; + return this.GetPortalSetting("DisablePrivateMessage", portalId, "N") == "Y"; } #endregion @@ -240,31 +240,31 @@ public virtual bool DisablePrivateMessage(int portalId) public virtual MessageBoxView GetArchivedMessages(int userId, int afterMessageId, int numberOfRecords) { - var reader = _dataService.GetArchiveBoxView(userId, PortalController.GetEffectivePortalId(GetCurrentUserInfo().PortalID), afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending); + var reader = this._dataService.GetArchiveBoxView(userId, PortalController.GetEffectivePortalId(this.GetCurrentUserInfo().PortalID), afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending); return new MessageBoxView { Conversations = CBO.FillCollection(reader) }; } public virtual MessageBoxView GetInbox(int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending) { - return GetInbox(userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, MessageReadStatus.Any, MessageArchivedStatus.UnArchived); + return this.GetInbox(userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, MessageReadStatus.Any, MessageArchivedStatus.UnArchived); } public virtual MessageBoxView GetInbox(int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending, MessageReadStatus readStatus, MessageArchivedStatus archivedStatus) { - var reader = _dataService.GetInBoxView(userId, PortalController.GetEffectivePortalId(GetCurrentUserInfo().PortalID), afterMessageId, numberOfRecords, sortColumn, sortAscending, readStatus, archivedStatus, MessageSentStatus.Received); + var reader = this._dataService.GetInBoxView(userId, PortalController.GetEffectivePortalId(this.GetCurrentUserInfo().PortalID), afterMessageId, numberOfRecords, sortColumn, sortAscending, readStatus, archivedStatus, MessageSentStatus.Received); return new MessageBoxView { Conversations = CBO.FillCollection(reader) }; } public virtual MessageThreadsView GetMessageThread(int conversationId, int userId, int afterMessageId, int numberOfRecords, ref int totalRecords) { - return GetMessageThread(conversationId, userId, afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending, ref totalRecords); + return this.GetMessageThread(conversationId, userId, afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending, ref totalRecords); } public virtual MessageThreadsView GetMessageThread(int conversationId, int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending, ref int totalRecords) { var messageThreadsView = new MessageThreadsView(); - var dr = _dataService.GetMessageThread(conversationId, userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, ref totalRecords); + var dr = this._dataService.GetMessageThread(conversationId, userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, ref totalRecords); try { @@ -275,7 +275,7 @@ public virtual MessageThreadsView GetMessageThread(int conversationId, int userI if (messageThreadView.Conversation.AttachmentCount > 0) { - messageThreadView.Attachments = _dataService.GetMessageAttachmentsByMessage(messageThreadView.Conversation.MessageID); + messageThreadView.Attachments = this._dataService.GetMessageAttachmentsByMessage(messageThreadView.Conversation.MessageID); } if (messageThreadsView.Conversations == null) messageThreadsView.Conversations = new List(); @@ -293,32 +293,32 @@ public virtual MessageThreadsView GetMessageThread(int conversationId, int userI public virtual MessageBoxView GetRecentInbox(int userId) { - return GetRecentInbox(userId, ConstDefaultPageIndex, ConstDefaultPageSize); + return this.GetRecentInbox(userId, ConstDefaultPageIndex, ConstDefaultPageSize); } public virtual MessageBoxView GetRecentInbox(int userId, int afterMessageId, int numberOfRecords) { - return GetInbox(userId, afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending); + return this.GetInbox(userId, afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending); } public virtual MessageBoxView GetRecentSentbox(int userId) { - return GetRecentSentbox(userId, ConstDefaultPageIndex, ConstDefaultPageSize); + return this.GetRecentSentbox(userId, ConstDefaultPageIndex, ConstDefaultPageSize); } public virtual MessageBoxView GetRecentSentbox(int userId, int afterMessageId, int numberOfRecords) { - return GetSentbox(userId, afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending); + return this.GetSentbox(userId, afterMessageId, numberOfRecords, ConstSortColumnDate, !ConstAscending); } public virtual MessageBoxView GetSentbox(int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending) { - return GetSentbox(userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, MessageReadStatus.Any, MessageArchivedStatus.UnArchived); + return this.GetSentbox(userId, afterMessageId, numberOfRecords, sortColumn, sortAscending, MessageReadStatus.Any, MessageArchivedStatus.UnArchived); } public virtual MessageBoxView GetSentbox(int userId, int afterMessageId, int numberOfRecords, string sortColumn, bool sortAscending, MessageReadStatus readStatus, MessageArchivedStatus archivedStatus) { - var reader = _dataService.GetSentBoxView(userId, PortalController.GetEffectivePortalId(GetCurrentUserInfo().PortalID), afterMessageId, numberOfRecords, sortColumn, sortAscending); + var reader = this._dataService.GetSentBoxView(userId, PortalController.GetEffectivePortalId(this.GetCurrentUserInfo().PortalID), afterMessageId, numberOfRecords, sortColumn, sortAscending); return new MessageBoxView { Conversations = CBO.FillCollection(reader) }; } @@ -329,17 +329,17 @@ public virtual MessageBoxView GetSentbox(int userId, int afterMessageId, int num public virtual int CheckReplyHasRecipients(int conversationId, int userId) { return userId <= 0 ? 0 : - conversationId <= 0 ? 0 : _dataService.CheckReplyHasRecipients(conversationId, userId); + conversationId <= 0 ? 0 : this._dataService.CheckReplyHasRecipients(conversationId, userId); } public virtual int CountArchivedMessagesByConversation(int conversationId) { - return conversationId <= 0 ? 0 : _dataService.CountArchivedMessagesByConversation(conversationId); + return conversationId <= 0 ? 0 : this._dataService.CountArchivedMessagesByConversation(conversationId); } public virtual int CountMessagesByConversation(int conversationId) { - return conversationId <= 0 ? 0 : _dataService.CountMessagesByConversation(conversationId); + return conversationId <= 0 ? 0 : this._dataService.CountMessagesByConversation(conversationId); } public virtual int CountConversations(int userId, int portalId) @@ -354,7 +354,7 @@ public virtual int CountConversations(int userId, int portalId) return (int)cacheObject; } - var count = _dataService.CountTotalConversations(userId, portalId); + var count = this._dataService.CountTotalConversations(userId, portalId); cache.Insert(cacheKey, count, (DNNCacheDependency)null, DateTime.Now.AddSeconds(DataCache.NotificationsCacheTimeInSec), System.Web.Caching.Cache.NoSlidingExpiration); return count; @@ -372,7 +372,7 @@ public virtual int CountUnreadMessages(int userId, int portalId) return (int)cacheObject; } - var count = _dataService.CountNewThreads(userId, portalId); + var count = this._dataService.CountNewThreads(userId, portalId); cache.Insert(cacheKey, count, (DNNCacheDependency)null, DateTime.Now.AddSeconds(DataCache.NotificationsCacheTimeInSec), System.Web.Caching.Cache.NoSlidingExpiration); return count; @@ -380,22 +380,22 @@ public virtual int CountUnreadMessages(int userId, int portalId) public virtual int CountSentMessages(int userId, int portalId) { - return userId <= 0 ? 0 : _dataService.CountSentMessages(userId, portalId); + return userId <= 0 ? 0 : this._dataService.CountSentMessages(userId, portalId); } public virtual int CountArchivedMessages(int userId, int portalId) { - return userId <= 0 ? 0 : _dataService.CountArchivedMessages(userId, portalId); + return userId <= 0 ? 0 : this._dataService.CountArchivedMessages(userId, portalId); } public virtual int CountSentConversations(int userId, int portalId) { - return userId <= 0 ? 0 : _dataService.CountSentConversations(userId, portalId); + return userId <= 0 ? 0 : this._dataService.CountSentConversations(userId, portalId); } public virtual int CountArchivedConversations(int userId, int portalId) { - return userId <= 0 ? 0 : _dataService.CountArchivedConversations(userId, portalId); + return userId <= 0 ? 0 : this._dataService.CountArchivedConversations(userId, portalId); } /// Gets the attachments. @@ -403,7 +403,7 @@ public virtual int CountArchivedConversations(int userId, int portalId) /// A list of message attachments for the given message public IEnumerable GetAttachments(int messageId) { - return _dataService.GetMessageAttachmentsByMessage(messageId); + return this._dataService.GetMessageAttachmentsByMessage(messageId); } #endregion @@ -452,13 +452,13 @@ internal virtual string InputFilter(string input) public void ConvertLegacyMessages(int pageIndex, int pageSize) { - _dataService.ConvertLegacyMessages(pageIndex, pageSize); + this._dataService.ConvertLegacyMessages(pageIndex, pageSize); } public int CountLegacyMessages() { var totalRecords = 0; - var dr = _dataService.CountLegacyMessages(); + var dr = this._dataService.CountLegacyMessages(); try { @@ -481,23 +481,23 @@ public int CountLegacyMessages() public IList GetNextMessagesForInstantDispatch(Guid schedulerInstance, int batchSize) { - return CBO.FillCollection(_dataService.GetNextMessagesForInstantDispatch(schedulerInstance, batchSize)); + return CBO.FillCollection(this._dataService.GetNextMessagesForInstantDispatch(schedulerInstance, batchSize)); } public IList GetNextMessagesForDigestDispatch(Frequency frequency, Guid schedulerInstance, int batchSize) { - return CBO.FillCollection(_dataService.GetNextMessagesForDigestDispatch(Convert.ToInt32(frequency), schedulerInstance, batchSize)); + return CBO.FillCollection(this._dataService.GetNextMessagesForDigestDispatch(Convert.ToInt32(frequency), schedulerInstance, batchSize)); } public virtual void MarkMessageAsDispatched(int messageId, int recipientId) { - _dataService.MarkMessageAsDispatched(messageId, recipientId); + this._dataService.MarkMessageAsDispatched(messageId, recipientId); } public virtual void MarkMessageAsSent(int messageId, int recipientId) { - _dataService.MarkMessageAsSent(messageId, recipientId); + this._dataService.MarkMessageAsSent(messageId, recipientId); } #endregion diff --git a/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageConversationView.cs b/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageConversationView.cs index eef6d6edc1a..8f83006b415 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageConversationView.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageConversationView.cs @@ -33,11 +33,11 @@ public int MessageID { get { - return _messageID; + return this._messageID; } set { - _messageID = value; + this._messageID = value; } } @@ -89,11 +89,11 @@ public string DisplayDate { get { - if (string.IsNullOrEmpty(_displayDate)) + if (string.IsNullOrEmpty(this._displayDate)) { - _displayDate = DateUtils.CalculateDateForDisplay(_createdOnDate); + this._displayDate = DateUtils.CalculateDateForDisplay(this._createdOnDate); } - return _displayDate; + return this._displayDate; } } @@ -104,11 +104,11 @@ public int KeyID { get { - return MessageID; + return this.MessageID; } set { - MessageID = value; + this.MessageID = value; } } @@ -139,7 +139,7 @@ public string SenderProfileUrl { get { - return Globals.UserProfileURL(SenderUserID); + return Globals.UserProfileURL(this.SenderUserID); } } @@ -149,19 +149,19 @@ public string SenderProfileUrl /// the data reader. public void Fill(IDataReader dr) { - MessageID = Convert.ToInt32(dr["MessageID"]); - To = Null.SetNullString(dr["To"]); - From = Null.SetNullString(dr["From"]); - Subject = Null.SetNullString(dr["Subject"]); - Body = Null.SetNullString(dr["Body"]); - ConversationId = Null.SetNullInteger(dr["ConversationID"]); - ReplyAllAllowed = Null.SetNullBoolean(dr["ReplyAllAllowed"]); - SenderUserID = Convert.ToInt32(dr["SenderUserID"]); - RowNumber = Convert.ToInt32(dr["RowNumber"]); - AttachmentCount = Convert.ToInt32(dr["AttachmentCount"]); - NewThreadCount = Convert.ToInt32(dr["NewThreadCount"]); - ThreadCount = Convert.ToInt32(dr["ThreadCount"]); - _createdOnDate = Null.SetNullDateTime(dr["CreatedOnDate"]); + this.MessageID = Convert.ToInt32(dr["MessageID"]); + this.To = Null.SetNullString(dr["To"]); + this.From = Null.SetNullString(dr["From"]); + this.Subject = Null.SetNullString(dr["Subject"]); + this.Body = Null.SetNullString(dr["Body"]); + this.ConversationId = Null.SetNullInteger(dr["ConversationID"]); + this.ReplyAllAllowed = Null.SetNullBoolean(dr["ReplyAllAllowed"]); + this.SenderUserID = Convert.ToInt32(dr["SenderUserID"]); + this.RowNumber = Convert.ToInt32(dr["RowNumber"]); + this.AttachmentCount = Convert.ToInt32(dr["AttachmentCount"]); + this.NewThreadCount = Convert.ToInt32(dr["NewThreadCount"]); + this.ThreadCount = Convert.ToInt32(dr["ThreadCount"]); + this._createdOnDate = Null.SetNullDateTime(dr["CreatedOnDate"]); } } } diff --git a/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageFileView.cs b/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageFileView.cs index 9ea823e74ba..d2a012921f0 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageFileView.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Internal/Views/MessageFileView.cs @@ -30,7 +30,7 @@ public class MessageFileView /// The size. public string Size { - get { return _size; } + get { return this._size; } set { long bytes; @@ -43,13 +43,13 @@ public string Size { if (bytes > max) { - _size = string.Format("{0:##.##} {1}", decimal.Divide(bytes, max), order); + this._size = string.Format("{0:##.##} {1}", decimal.Divide(bytes, max), order); return; } max /= scale; } - _size = "0 B"; + this._size = "0 B"; } } diff --git a/DNN Platform/Library/Services/Social/Messaging/Message.cs b/DNN Platform/Library/Services/Social/Messaging/Message.cs index a70cbd50372..8e88d1855fa 100644 --- a/DNN Platform/Library/Services/Social/Messaging/Message.cs +++ b/DNN Platform/Library/Services/Social/Messaging/Message.cs @@ -40,11 +40,11 @@ public int MessageID { get { - return _messageID; + return this._messageID; } set { - _messageID = value; + this._messageID = value; } } @@ -110,11 +110,11 @@ public string DisplayDate { get { - if (string.IsNullOrEmpty(_displayDate)) + if (string.IsNullOrEmpty(this._displayDate)) { - _displayDate = DateUtils.CalculateDateForDisplay(CreatedOnDate); + this._displayDate = DateUtils.CalculateDateForDisplay(this.CreatedOnDate); } - return _displayDate; + return this._displayDate; } } @@ -126,11 +126,11 @@ public int KeyID { get { - return MessageID; + return this.MessageID; } set { - MessageID = value; + this.MessageID = value; } } @@ -140,18 +140,18 @@ public int KeyID /// the data reader. public void Fill(IDataReader dr) { - MessageID = Convert.ToInt32(dr["MessageID"]); - PortalID = Null.SetNullInteger(dr["PortalId"]); - To = Null.SetNullString(dr["To"]); - From = Null.SetNullString(dr["From"]); - Subject = Null.SetNullString(dr["Subject"]); - Body = Null.SetNullString(dr["Body"]); - ConversationId = Null.SetNullInteger(dr["ConversationID"]); - ReplyAllAllowed = Null.SetNullBoolean(dr["ReplyAllAllowed"]); - SenderUserID = Convert.ToInt32(dr["SenderUserID"]); - NotificationTypeID = Null.SetNullInteger(dr["NotificationTypeID"]); + this.MessageID = Convert.ToInt32(dr["MessageID"]); + this.PortalID = Null.SetNullInteger(dr["PortalId"]); + this.To = Null.SetNullString(dr["To"]); + this.From = Null.SetNullString(dr["From"]); + this.Subject = Null.SetNullString(dr["Subject"]); + this.Body = Null.SetNullString(dr["Body"]); + this.ConversationId = Null.SetNullInteger(dr["ConversationID"]); + this.ReplyAllAllowed = Null.SetNullBoolean(dr["ReplyAllAllowed"]); + this.SenderUserID = Convert.ToInt32(dr["SenderUserID"]); + this.NotificationTypeID = Null.SetNullInteger(dr["NotificationTypeID"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } } diff --git a/DNN Platform/Library/Services/Social/Messaging/MessageAttachment.cs b/DNN Platform/Library/Services/Social/Messaging/MessageAttachment.cs index 281e9f28523..eb8faa407cb 100644 --- a/DNN Platform/Library/Services/Social/Messaging/MessageAttachment.cs +++ b/DNN Platform/Library/Services/Social/Messaging/MessageAttachment.cs @@ -38,11 +38,11 @@ public int MessageAttachmentID { get { - return _messageattachmentID; + return this._messageattachmentID; } set { - _messageattachmentID = value; + this._messageattachmentID = value; } } @@ -86,7 +86,7 @@ public void Fill(IDataReader dr) this.FileID = Convert.ToInt32(dr["FileID"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } diff --git a/DNN Platform/Library/Services/Social/Messaging/MessageRecipient.cs b/DNN Platform/Library/Services/Social/Messaging/MessageRecipient.cs index 04f06e16616..96a3a5277a9 100644 --- a/DNN Platform/Library/Services/Social/Messaging/MessageRecipient.cs +++ b/DNN Platform/Library/Services/Social/Messaging/MessageRecipient.cs @@ -38,11 +38,11 @@ public int RecipientID { get { - return _recipientID; + return this._recipientID; } set { - _recipientID = value; + this._recipientID = value; } } @@ -100,7 +100,7 @@ public void Fill(IDataReader dr) this.Read = Null.SetNullBoolean(dr["Read"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } } diff --git a/DNN Platform/Library/Services/Social/Messaging/MessagingController.cs b/DNN Platform/Library/Services/Social/Messaging/MessagingController.cs index 8e772dbe78e..a949d2e130f 100644 --- a/DNN Platform/Library/Services/Social/Messaging/MessagingController.cs +++ b/DNN Platform/Library/Services/Social/Messaging/MessagingController.cs @@ -73,7 +73,7 @@ public MessagingController(IDataService dataService) //Argument Contract Requires.NotNull("dataService", dataService); - _dataService = dataService; + this._dataService = dataService; } #endregion @@ -82,7 +82,7 @@ public MessagingController(IDataService dataService) public virtual void SendMessage(Message message, IList roles, IList users, IList fileIDs) { - SendMessage(message, roles, users, fileIDs, UserController.Instance.GetCurrentUserInfo()); + this.SendMessage(message, roles, users, fileIDs, UserController.Instance.GetCurrentUserInfo()); } public virtual void SendMessage(Message message, IList roles, IList users, IList fileIDs, UserInfo sender) @@ -107,7 +107,7 @@ public virtual void SendMessage(Message message, IList roles, IList roles, IList 0 && !IsAdminOrHost(sender)) + if (roles != null && roles.Count > 0 && !this.IsAdminOrHost(sender)) { if (!roles.All(role => sender.Social.Roles.Any(userRoleInfo => role.RoleID == userRoleInfo.RoleID && userRoleInfo.IsOwner))) { @@ -155,7 +155,7 @@ public virtual void SendMessage(Message message, IList roles, IList 0) { - var interval = GetPortalSettingAsDouble("MessagingThrottlingInterval", sender.PortalID, DefaultMessagingThrottlingInterval); + var interval = this.GetPortalSettingAsDouble("MessagingThrottlingInterval", sender.PortalID, DefaultMessagingThrottlingInterval); throw new ThrottlingIntervalNotMetException(string.Format(Localization.Localization.GetString("MsgThrottlingIntervalNotMet", Localization.Localization.ExceptionsResourceFile), interval)); } @@ -175,11 +175,11 @@ public virtual void SendMessage(Message message, IList roles, IList roles, IList new MessageAttachment { MessageAttachmentID = Null.NullInteger, FileID = fileId, MessageID = message.MessageID })) { - if (CanViewFile(attachment.FileID)) + if (this.CanViewFile(attachment.FileID)) { - _dataService.SaveMessageAttachment(attachment, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataService.SaveMessageAttachment(attachment, UserController.Instance.GetCurrentUserInfo().UserID); } } } @@ -211,7 +211,7 @@ public virtual void SendMessage(Message message, IList roles, IList current + (roleId + ",")) .Trim(','); - _dataService.CreateMessageRecipientsForRole(message.MessageID, roleIds, UserController.Instance.GetCurrentUserInfo().UserID); + this._dataService.CreateMessageRecipientsForRole(message.MessageID, roleIds, UserController.Instance.GetCurrentUserInfo().UserID); } //send message to each User - this should be called after CreateMessageRecipientsForRole. @@ -222,7 +222,7 @@ public virtual void SendMessage(Message message, IList roles, IList u.UserID != sender.UserID)) @@ -233,7 +233,7 @@ public virtual void SendMessage(Message message, IList roles, IListNo SMTP Servers have been configured for this host. Terminating task."); - ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.AddLogNote("
    No SMTP Servers have been configured for this host. Terminating task."); + this.ScheduleHistoryItem.Succeeded = true; } else { @@ -72,13 +72,13 @@ public override void DoWork() this.HandleFrequentDigests(schedulerInstance, remainingMessages); } - ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.Succeeded = true; } } catch (Exception ex) { - ScheduleHistoryItem.Succeeded = false; - ScheduleHistoryItem.AddLogNote("
    Messaging Scheduler Failed: " + ex); + this.ScheduleHistoryItem.Succeeded = false; + this.ScheduleHistoryItem.AddLogNote("
    Messaging Scheduler Failed: " + ex); this.Errored(ref ex); } } @@ -454,7 +454,7 @@ private int HandleFrequencyDigest(DateTime dateToCompare, string settingKeyLastR if (handledMessages < remainingMessages) { SchedulingProvider.Instance().AddScheduleItemSetting( - ScheduleHistoryItem.ScheduleID, settingKeyLastRunDate, DateTime.Now.ToString(CultureInfo.InvariantCulture)); + this.ScheduleHistoryItem.ScheduleID, settingKeyLastRunDate, DateTime.Now.ToString(CultureInfo.InvariantCulture)); } } @@ -471,7 +471,7 @@ private int HandleDigest(Guid schedulerInstance, Frequency frequency, int remain var messagesSent = 0; // get subscribers based on frequency, utilize remaining batch size as part of count of users to return (note, if multiple subscriptions have the same frequency they will be combined into 1 email) - ScheduleHistoryItem.AddLogNote("
    Messaging Scheduler Starting Digest '" + schedulerInstance + "'. "); + this.ScheduleHistoryItem.AddLogNote("
    Messaging Scheduler Starting Digest '" + schedulerInstance + "'. "); var messageLeft = true; @@ -504,7 +504,7 @@ private int HandleDigest(Guid schedulerInstance, Frequency frequency, int remain } // at this point we have sent all digest notifications for this batch - ScheduleHistoryItem.AddLogNote("Sent " + messagesSent + " digest subscription emails for this batch. "); + this.ScheduleHistoryItem.AddLogNote("Sent " + messagesSent + " digest subscription emails for this batch. "); return messagesSent; } catch (Exception e) @@ -518,7 +518,7 @@ private int HandleDigest(Guid schedulerInstance, Frequency frequency, int remain } } - ScheduleHistoryItem.AddLogNote("Sent " + messagesSent + " " + frequency + " digest subscription emails. "); + this.ScheduleHistoryItem.AddLogNote("Sent " + messagesSent + " " + frequency + " digest subscription emails. "); return messagesSent; } @@ -585,7 +585,7 @@ private static string RemoveHttpUrlsIfSiteisSSLEnabled(string stringContainingHt /// The date the schedule was ran private DateTime GetScheduleItemDateSetting(string settingKey) { - var colScheduleItemSettings = SchedulingProvider.Instance().GetScheduleItemSettings(ScheduleHistoryItem.ScheduleID); + var colScheduleItemSettings = SchedulingProvider.Instance().GetScheduleItemSettings(this.ScheduleHistoryItem.ScheduleID); var dateValue = DateTime.Now; if (colScheduleItemSettings.Count > 0) @@ -598,13 +598,13 @@ private DateTime GetScheduleItemDateSetting(string settingKey) else { SchedulingProvider.Instance().AddScheduleItemSetting( - ScheduleHistoryItem.ScheduleID, SettingLastHourlyRun, dateValue.ToString(CultureInfo.InvariantCulture)); + this.ScheduleHistoryItem.ScheduleID, SettingLastHourlyRun, dateValue.ToString(CultureInfo.InvariantCulture)); SchedulingProvider.Instance().AddScheduleItemSetting( - ScheduleHistoryItem.ScheduleID, SettingLastDailyRun, dateValue.ToString(CultureInfo.InvariantCulture)); + this.ScheduleHistoryItem.ScheduleID, SettingLastDailyRun, dateValue.ToString(CultureInfo.InvariantCulture)); SchedulingProvider.Instance().AddScheduleItemSetting( - ScheduleHistoryItem.ScheduleID, SettingLastWeeklyRun, dateValue.ToString(CultureInfo.InvariantCulture)); + this.ScheduleHistoryItem.ScheduleID, SettingLastWeeklyRun, dateValue.ToString(CultureInfo.InvariantCulture)); SchedulingProvider.Instance().AddScheduleItemSetting( - ScheduleHistoryItem.ScheduleID, SettingLastMonthlyRun, dateValue.ToString(CultureInfo.InvariantCulture)); + this.ScheduleHistoryItem.ScheduleID, SettingLastMonthlyRun, dateValue.ToString(CultureInfo.InvariantCulture)); } return dateValue; @@ -643,7 +643,7 @@ private int HandleInstantMessages(Guid schedulerInstance) } } - ScheduleHistoryItem.AddLogNote(string.Format("
    Messaging Scheduler '{0}' sent a total of {1} message(s)", schedulerInstance, messagesSent)); + this.ScheduleHistoryItem.AddLogNote(string.Format("
    Messaging Scheduler '{0}' sent a total of {1} message(s)", schedulerInstance, messagesSent)); return messagesSent; } @@ -690,7 +690,7 @@ private void SendMessage(MessageRecipient messageRecipient) // Include the attachment in the email message if configured to do so if (InternalMessagingController.Instance.AttachmentsAllowed(message.PortalID)) { - Mail.Mail.SendEmail(fromAddress, senderAddress, toAddress, subject, body, CreateAttachments(message.MessageID).ToList()); + Mail.Mail.SendEmail(fromAddress, senderAddress, toAddress, subject, body, this.CreateAttachments(message.MessageID).ToList()); } else { diff --git a/DNN Platform/Library/Services/Social/Messaging/UserPreferencesController.cs b/DNN Platform/Library/Services/Social/Messaging/UserPreferencesController.cs index a73ad65b9e0..f061d97c443 100644 --- a/DNN Platform/Library/Services/Social/Messaging/UserPreferencesController.cs +++ b/DNN Platform/Library/Services/Social/Messaging/UserPreferencesController.cs @@ -39,12 +39,12 @@ public UserPreferencesController(IDataService dataService) #region Public API public void SetUserPreference(UserPreference userPreference) { - dataService.SetUserPreference(userPreference.PortalId, userPreference.UserId, Convert.ToInt32(userPreference.MessagesEmailFrequency), Convert.ToInt32(userPreference.NotificationsEmailFrequency)); + this.dataService.SetUserPreference(userPreference.PortalId, userPreference.UserId, Convert.ToInt32(userPreference.MessagesEmailFrequency), Convert.ToInt32(userPreference.NotificationsEmailFrequency)); } public UserPreference GetUserPreference(UserInfo userinfo) { - return CBO.FillObject(dataService.GetUserPreference(userinfo.PortalID, userinfo.UserID)); + return CBO.FillObject(this.dataService.GetUserPreference(userinfo.PortalID, userinfo.UserID)); } #endregion diff --git a/DNN Platform/Library/Services/Social/Notifications/Data/DataService.cs b/DNN Platform/Library/Services/Social/Notifications/Data/DataService.cs index 316df6608f6..4c840e6eab2 100644 --- a/DNN Platform/Library/Services/Social/Notifications/Data/DataService.cs +++ b/DNN Platform/Library/Services/Social/Notifications/Data/DataService.cs @@ -29,22 +29,22 @@ private static string GetFullyQualifiedName(string procedureName) public int CreateNotificationType(string name, string description, int timeToLive, int desktopModuleId, int createUpdateUserId, bool isTask) { - return _provider.ExecuteScalar(GetFullyQualifiedName("CreateNotificationType"), name, _provider.GetNull(description), _provider.GetNull(timeToLive), _provider.GetNull(desktopModuleId), createUpdateUserId, isTask); + return this._provider.ExecuteScalar(GetFullyQualifiedName("CreateNotificationType"), name, this._provider.GetNull(description), this._provider.GetNull(timeToLive), this._provider.GetNull(desktopModuleId), createUpdateUserId, isTask); } public void DeleteNotificationType(int notificationTypeId) { - _provider.ExecuteNonQuery(GetFullyQualifiedName("DeleteNotificationType"), notificationTypeId); + this._provider.ExecuteNonQuery(GetFullyQualifiedName("DeleteNotificationType"), notificationTypeId); } public IDataReader GetNotificationType(int notificationTypeId) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotificationType"), notificationTypeId); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotificationType"), notificationTypeId); } public IDataReader GetNotificationTypeByName(string name) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeByName"), name); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeByName"), name); } #endregion @@ -53,27 +53,27 @@ public IDataReader GetNotificationTypeByName(string name) public int AddNotificationTypeAction(int notificationTypeId, string nameResourceKey, string descriptionResourceKey, string confirmResourceKey, string apiCall, int createdByUserId) { - return _provider.ExecuteScalar(GetFullyQualifiedName("AddNotificationTypeAction"), notificationTypeId, nameResourceKey, _provider.GetNull(descriptionResourceKey), _provider.GetNull(confirmResourceKey), apiCall, createdByUserId); + return this._provider.ExecuteScalar(GetFullyQualifiedName("AddNotificationTypeAction"), notificationTypeId, nameResourceKey, this._provider.GetNull(descriptionResourceKey), this._provider.GetNull(confirmResourceKey), apiCall, createdByUserId); } public void DeleteNotificationTypeAction(int notificationTypeActionId) { - _provider.ExecuteNonQuery(GetFullyQualifiedName("DeleteNotificationTypeAction"), notificationTypeActionId); + this._provider.ExecuteNonQuery(GetFullyQualifiedName("DeleteNotificationTypeAction"), notificationTypeActionId); } public IDataReader GetNotificationTypeAction(int notificationTypeActionId) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeAction"), notificationTypeActionId); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeAction"), notificationTypeActionId); } public IDataReader GetNotificationTypeActionByName(int notificationTypeId, string name) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeActionByName"), notificationTypeId, name); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeActionByName"), notificationTypeId, name); } public IDataReader GetNotificationTypeActions(int notificationTypeId) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeActions"), notificationTypeId); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotificationTypeActions"), notificationTypeId); } #endregion @@ -83,7 +83,7 @@ public IDataReader GetNotificationTypeActions(int notificationTypeId) public int SendNotification(Notification notification, int portalId) { var createdByUserId = UserController.Instance.GetCurrentUserInfo().UserID; - return _provider.ExecuteScalar(GetFullyQualifiedName("SendNotification"), + return this._provider.ExecuteScalar(GetFullyQualifiedName("SendNotification"), notification.NotificationTypeID, portalId, notification.To, @@ -92,39 +92,39 @@ public int SendNotification(Notification notification, int portalId) notification.Body, notification.SenderUserID, createdByUserId, - _provider.GetNull(notification.ExpirationDate), + this._provider.GetNull(notification.ExpirationDate), notification.IncludeDismissAction, notification.Context); } public void DeleteNotification(int notificationId) { - _provider.ExecuteNonQuery(GetFullyQualifiedName("DeleteNotification"), notificationId); + this._provider.ExecuteNonQuery(GetFullyQualifiedName("DeleteNotification"), notificationId); } public int DeleteUserNotifications(int userId, int portalId) { - return userId <= 0 ? 0 : _provider.ExecuteScalar(GetFullyQualifiedName("DeleteUserNotifications"), userId, portalId); + return userId <= 0 ? 0 : this._provider.ExecuteScalar(GetFullyQualifiedName("DeleteUserNotifications"), userId, portalId); } public int CountNotifications(int userId, int portalId) { - return userId <= 0 ? 0 : _provider.ExecuteScalar(GetFullyQualifiedName("CountNotifications"), userId, portalId); + return userId <= 0 ? 0 : this._provider.ExecuteScalar(GetFullyQualifiedName("CountNotifications"), userId, portalId); } public IDataReader GetNotifications(int userId, int portalId, int afterNotificationId, int numberOfRecords) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotifications"), userId, portalId, afterNotificationId, numberOfRecords); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotifications"), userId, portalId, afterNotificationId, numberOfRecords); } public IDataReader GetNotification(int notificationId) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotification"), notificationId); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotification"), notificationId); } public IDataReader GetNotificationByContext(int notificationTypeId, string context) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetNotificationByContext"), notificationTypeId, context); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetNotificationByContext"), notificationTypeId, context); } #endregion @@ -133,7 +133,7 @@ public IDataReader GetNotificationByContext(int notificationTypeId, string conte public bool IsToastPending(int notificationId) { - return _provider.ExecuteScalar(GetFullyQualifiedName("IsToastPending"), + return this._provider.ExecuteScalar(GetFullyQualifiedName("IsToastPending"), notificationId); } @@ -144,7 +144,7 @@ public bool IsToastPending(int notificationId) /// The Recipient User Id public void MarkReadyForToast(int notificationId, int userId) { - _provider.ExecuteNonQuery(GetFullyQualifiedName("MarkReadyForToast"), notificationId, userId); + this._provider.ExecuteNonQuery(GetFullyQualifiedName("MarkReadyForToast"), notificationId, userId); } /// @@ -154,12 +154,12 @@ public void MarkReadyForToast(int notificationId, int userId) /// The Recipient User Id public void MarkToastSent(int notificationId, int userId) { - _provider.ExecuteNonQuery(GetFullyQualifiedName("MarkToastSent"), notificationId, userId); + this._provider.ExecuteNonQuery(GetFullyQualifiedName("MarkToastSent"), notificationId, userId); } public IDataReader GetToasts(int userId, int portalId) { - return _provider.ExecuteReader(GetFullyQualifiedName("GetToasts"), userId, portalId); + return this._provider.ExecuteReader(GetFullyQualifiedName("GetToasts"), userId, portalId); } #endregion diff --git a/DNN Platform/Library/Services/Social/Notifications/Notification.cs b/DNN Platform/Library/Services/Social/Notifications/Notification.cs index 5f61ef3cea2..3cbef2eb4d9 100644 --- a/DNN Platform/Library/Services/Social/Notifications/Notification.cs +++ b/DNN Platform/Library/Services/Social/Notifications/Notification.cs @@ -41,11 +41,11 @@ public int NotificationID { get { - return _notificationID; + return this._notificationID; } set { - _notificationID = value; + this._notificationID = value; } } @@ -99,11 +99,11 @@ public string DisplayDate { get { - if (string.IsNullOrEmpty(_displayDate)) + if (string.IsNullOrEmpty(this._displayDate)) { - _displayDate = DateUtils.CalculateDateForDisplay(CreatedOnDate); + this._displayDate = DateUtils.CalculateDateForDisplay(this.CreatedOnDate); } - return _displayDate; + return this._displayDate; } } @@ -121,11 +121,11 @@ public int KeyID { get { - return NotificationID; + return this.NotificationID; } set { - NotificationID = value; + this.NotificationID = value; } } @@ -150,7 +150,7 @@ public int KeyID /// public Notification() { - SendToast = true; + this.SendToast = true; } #endregion @@ -163,32 +163,32 @@ public Notification() /// the data reader. public void Fill(IDataReader dr) { - NotificationID = Convert.ToInt32(dr["MessageID"]); - NotificationTypeID = Convert.ToInt32(dr["NotificationTypeID"]); - To = Null.SetNullString(dr["To"]); - From = Null.SetNullString(dr["From"]); - Subject = Null.SetNullString(dr["Subject"]); - Body = Null.SetNullString(dr["Body"]); - Context = Null.SetNullString(dr["Context"]); - SenderUserID = Convert.ToInt32(dr["SenderUserID"]); - ExpirationDate = Null.SetNullDateTime(dr["ExpirationDate"]); - IncludeDismissAction = Null.SetNullBoolean(dr["IncludeDismissAction"]); + this.NotificationID = Convert.ToInt32(dr["MessageID"]); + this.NotificationTypeID = Convert.ToInt32(dr["NotificationTypeID"]); + this.To = Null.SetNullString(dr["To"]); + this.From = Null.SetNullString(dr["From"]); + this.Subject = Null.SetNullString(dr["Subject"]); + this.Body = Null.SetNullString(dr["Body"]); + this.Context = Null.SetNullString(dr["Context"]); + this.SenderUserID = Convert.ToInt32(dr["SenderUserID"]); + this.ExpirationDate = Null.SetNullDateTime(dr["ExpirationDate"]); + this.IncludeDismissAction = Null.SetNullBoolean(dr["IncludeDismissAction"]); var schema = dr.GetSchemaTable(); if (schema != null) { if (schema.Select("ColumnName = 'SendToast'").Length > 0) { - SendToast = Null.SetNullBoolean(dr["SendToast"]); + this.SendToast = Null.SetNullBoolean(dr["SendToast"]); } else { - SendToast = false; + this.SendToast = false; } } //add audit column data - FillInternal(dr); + this.FillInternal(dr); } #endregion diff --git a/DNN Platform/Library/Services/Social/Notifications/NotificationType.cs b/DNN Platform/Library/Services/Social/Notifications/NotificationType.cs index 7235acac8a7..dab35bf1588 100644 --- a/DNN Platform/Library/Services/Social/Notifications/NotificationType.cs +++ b/DNN Platform/Library/Services/Social/Notifications/NotificationType.cs @@ -36,11 +36,11 @@ public int NotificationTypeId { get { - return _notificationTypeId; + return this._notificationTypeId; } set { - _notificationTypeId = value; + this._notificationTypeId = value; } } @@ -76,11 +76,11 @@ public int DesktopModuleId { get { - return _desktopModuleId; + return this._desktopModuleId; } set { - _desktopModuleId = value; + this._desktopModuleId = value; } } @@ -101,8 +101,8 @@ public int DesktopModuleId [XmlIgnore] public int KeyID { - get { return NotificationTypeId; } - set { NotificationTypeId = value; } + get { return this.NotificationTypeId; } + set { this.NotificationTypeId = value; } } /// @@ -111,19 +111,19 @@ public int KeyID /// the data reader. public void Fill(IDataReader dr) { - NotificationTypeId = Convert.ToInt32(dr["NotificationTypeID"]); - Name = dr["Name"].ToString(); - Description = Null.SetNullString(dr["Description"]); + this.NotificationTypeId = Convert.ToInt32(dr["NotificationTypeID"]); + this.Name = dr["Name"].ToString(); + this.Description = Null.SetNullString(dr["Description"]); var timeToLive = Null.SetNullInteger(dr["TTL"]); if (timeToLive != Null.NullInteger) { - TimeToLive = new TimeSpan(0, timeToLive, 0); + this.TimeToLive = new TimeSpan(0, timeToLive, 0); } - DesktopModuleId = Null.SetNullInteger(dr["DesktopModuleID"]); - IsTask = Null.SetNullBoolean(dr["IsTask"]); + this.DesktopModuleId = Null.SetNullInteger(dr["DesktopModuleID"]); + this.IsTask = Null.SetNullBoolean(dr["IsTask"]); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } #endregion diff --git a/DNN Platform/Library/Services/Social/Notifications/NotificationTypeAction.cs b/DNN Platform/Library/Services/Social/Notifications/NotificationTypeAction.cs index 6297b87021c..c69a053a216 100644 --- a/DNN Platform/Library/Services/Social/Notifications/NotificationTypeAction.cs +++ b/DNN Platform/Library/Services/Social/Notifications/NotificationTypeAction.cs @@ -34,11 +34,11 @@ public int NotificationTypeActionId { get { - return _notificationTypeActionId; + return this._notificationTypeActionId; } set { - _notificationTypeActionId = value; + this._notificationTypeActionId = value; } } @@ -86,8 +86,8 @@ public int NotificationTypeActionId [XmlIgnore] public int KeyID { - get { return NotificationTypeActionId; } - set { NotificationTypeActionId = value; } + get { return this.NotificationTypeActionId; } + set { this.NotificationTypeActionId = value; } } /// @@ -96,16 +96,16 @@ public int KeyID /// the data reader. public void Fill(IDataReader dr) { - NotificationTypeActionId = Convert.ToInt32(dr["NotificationTypeActionID"]); - NotificationTypeId = Convert.ToInt32(dr["NotificationTypeID"]); - NameResourceKey = dr["NameResourceKey"].ToString(); - DescriptionResourceKey = Null.SetNullString(dr["DescriptionResourceKey"]); - ConfirmResourceKey = Null.SetNullString(dr["ConfirmResourceKey"]); - Order = Convert.ToInt32(dr["Order"]); - APICall = dr["APICall"].ToString(); + this.NotificationTypeActionId = Convert.ToInt32(dr["NotificationTypeActionID"]); + this.NotificationTypeId = Convert.ToInt32(dr["NotificationTypeID"]); + this.NameResourceKey = dr["NameResourceKey"].ToString(); + this.DescriptionResourceKey = Null.SetNullString(dr["DescriptionResourceKey"]); + this.ConfirmResourceKey = Null.SetNullString(dr["ConfirmResourceKey"]); + this.Order = Convert.ToInt32(dr["Order"]); + this.APICall = dr["APICall"].ToString(); //add audit column data - FillInternal(dr); + this.FillInternal(dr); } #endregion diff --git a/DNN Platform/Library/Services/Social/Notifications/NotificationsController.cs b/DNN Platform/Library/Services/Social/Notifications/NotificationsController.cs index 98f7b193b1a..a831d4456dc 100644 --- a/DNN Platform/Library/Services/Social/Notifications/NotificationsController.cs +++ b/DNN Platform/Library/Services/Social/Notifications/NotificationsController.cs @@ -68,8 +68,8 @@ public NotificationsController(IDataService dataService, Messaging.Data.IDataSer Requires.NotNull("dataService", dataService); Requires.NotNull("messagingDataService", messagingDataService); - _dataService = dataService; - _messagingDataService = messagingDataService; + this._dataService = dataService; + this._messagingDataService = messagingDataService; } #endregion @@ -97,12 +97,12 @@ public void SetNotificationTypeActions(IList actions, in foreach (var action in actions) { - action.NotificationTypeActionId = _dataService.AddNotificationTypeAction(notificationTypeId, + action.NotificationTypeActionId = this._dataService.AddNotificationTypeAction(notificationTypeId, action.NameResourceKey, action.DescriptionResourceKey, action.ConfirmResourceKey, action.APICall, - GetCurrentUserId()); + this.GetCurrentUserId()); action.NotificationTypeId = notificationTypeId; } } @@ -119,7 +119,7 @@ public virtual int CountNotifications(int userId, int portalId) return (int)cacheObject; } - var count = _dataService.CountNotifications(userId, portalId); + var count = this._dataService.CountNotifications(userId, portalId); cache.Insert(cacheKey, count, (DNNCacheDependency)null, DateTime.Now.AddSeconds(DataCache.NotificationsCacheTimeInSec), System.Web.Caching.Cache.NoSlidingExpiration); return count; @@ -137,7 +137,7 @@ public virtual void SendNotification(Notification notification, int portalId, IL if (notification.SenderUserID < 1) { - notification.SenderUserID = GetAdminUser().UserID; + notification.SenderUserID = this.GetAdminUser().UserID; } if (string.IsNullOrEmpty(notification.Subject) && string.IsNullOrEmpty(notification.Body)) @@ -182,10 +182,10 @@ public virtual void SendNotification(Notification notification, int portalId, IL notification.To = sbTo.ToString().Trim(','); if (notification.ExpirationDate != new DateTime()) { - notification.ExpirationDate = GetExpirationDate(notification.NotificationTypeID); + notification.ExpirationDate = this.GetExpirationDate(notification.NotificationTypeID); } - notification.NotificationID = _dataService.SendNotification(notification, pid); + notification.NotificationID = this._dataService.SendNotification(notification, pid); //send message to Roles if (roles != null) @@ -196,7 +196,7 @@ public virtual void SendNotification(Notification notification, int portalId, IL .Aggregate(roleIds, (current, roleId) => current + (roleId + ",")) .Trim(','); - _messagingDataService.CreateMessageRecipientsForRole( + this._messagingDataService.CreateMessageRecipientsForRole( notification.NotificationID, roleIds, UserController.Instance.GetCurrentUserInfo().UserID); @@ -220,7 +220,7 @@ where InternalMessagingController.Instance.GetMessageRecipient(notification.Noti foreach (var recipient in recipients) { - _messagingDataService.SaveMessageRecipient( + this._messagingDataService.SaveMessageRecipient( recipient, UserController.Instance.GetCurrentUserInfo().UserID); } @@ -230,7 +230,7 @@ where InternalMessagingController.Instance.GetMessageRecipient(notification.Noti { foreach (var messageRecipient in InternalMessagingController.Instance.GetMessageRecipients(notification.NotificationID)) { - MarkReadyForToast(notification, messageRecipient.UserID); + this.MarkReadyForToast(notification, messageRecipient.UserID); } } } @@ -245,11 +245,11 @@ public void CreateNotificationType(NotificationType notificationType) notificationType.DesktopModuleId = Null.NullInteger; } - notificationType.NotificationTypeId = _dataService.CreateNotificationType(notificationType.Name, + notificationType.NotificationTypeId = this._dataService.CreateNotificationType(notificationType.Name, notificationType.Description, (int)notificationType.TimeToLive.TotalMinutes == 0 ? Null.NullInteger : (int)notificationType.TimeToLive.TotalMinutes, notificationType.DesktopModuleId, - GetCurrentUserId(), + this.GetCurrentUserId(), notificationType.IsTask); } @@ -260,13 +260,13 @@ public virtual void DeleteNotification(int notificationId) { DataCache.RemoveCache(string.Format(ToastsCacheKey, recipient.UserID)); } - _dataService.DeleteNotification(notificationId); + this._dataService.DeleteNotification(notificationId); } public int DeleteUserNotifications(UserInfo user) { DataCache.RemoveCache(string.Format(ToastsCacheKey, user.UserID)); - return _dataService.DeleteUserNotifications(user.UserID, user.PortalID); + return this._dataService.DeleteUserNotifications(user.UserID, user.PortalID); } public virtual void DeleteNotificationRecipient(int notificationId, int userId) @@ -276,7 +276,7 @@ public virtual void DeleteNotificationRecipient(int notificationId, int userId) var recipients = InternalMessagingController.Instance.GetMessageRecipients(notificationId); if (recipients.Count == 0) { - DeleteNotification(notificationId); + this.DeleteNotification(notificationId); } } @@ -284,40 +284,40 @@ public virtual void DeleteAllNotificationRecipients(int notificationId) { foreach (var recipient in InternalMessagingController.Instance.GetMessageRecipients(notificationId)) { - DeleteNotificationRecipient(notificationId, recipient.UserID); + this.DeleteNotificationRecipient(notificationId, recipient.UserID); } } public virtual void DeleteNotificationRecipient(int notificationTypeId, string context, int userId) { - foreach (var notification in GetNotificationByContext(notificationTypeId, context)) + foreach (var notification in this.GetNotificationByContext(notificationTypeId, context)) { - DeleteNotificationRecipient(notification.NotificationID, userId); + this.DeleteNotificationRecipient(notification.NotificationID, userId); } } public Notification GetNotification(int notificationId) { - return CBO.FillObject(_dataService.GetNotification(notificationId)); + return CBO.FillObject(this._dataService.GetNotification(notificationId)); } public virtual IList GetNotificationByContext(int notificationTypeId, string context) { - return CBO.FillCollection(_dataService.GetNotificationByContext(notificationTypeId, context)); + return CBO.FillCollection(this._dataService.GetNotificationByContext(notificationTypeId, context)); } public virtual void DeleteNotificationType(int notificationTypeId) { - _dataService.DeleteNotificationType(notificationTypeId); + this._dataService.DeleteNotificationType(notificationTypeId); - RemoveNotificationTypeCache(); + this.RemoveNotificationTypeCache(); } public virtual void DeleteNotificationTypeAction(int notificationTypeActionId) { - _dataService.DeleteNotificationTypeAction(notificationTypeActionId); + this._dataService.DeleteNotificationTypeAction(notificationTypeActionId); - RemoveNotificationTypeActionCache(); + this.RemoveNotificationTypeActionCache(); } public virtual IList GetNotifications(int userId, int portalId, int afterNotificationId, int numberOfRecords) @@ -329,14 +329,14 @@ public virtual IList GetNotifications(int userId, int portalId, in } return userId <= 0 ? new List(0) - : CBO.FillCollection(_dataService.GetNotifications(userId, pid, afterNotificationId, numberOfRecords)); + : CBO.FillCollection(this._dataService.GetNotifications(userId, pid, afterNotificationId, numberOfRecords)); } public virtual NotificationType GetNotificationType(int notificationTypeId) { var notificationTypeCacheKey = string.Format(DataCache.NotificationTypesCacheKey, notificationTypeId); var cacheItemArgs = new CacheItemArgs(notificationTypeCacheKey, DataCache.NotificationTypesTimeOut, DataCache.NotificationTypesCachePriority, notificationTypeId); - return CBO.GetCachedObject(cacheItemArgs, GetNotificationTypeCallBack); + return CBO.GetCachedObject(cacheItemArgs, this.GetNotificationTypeCallBack); } public virtual NotificationType GetNotificationType(string name) @@ -345,14 +345,14 @@ public virtual NotificationType GetNotificationType(string name) var notificationTypeCacheKey = string.Format(DataCache.NotificationTypesCacheKey, name); var cacheItemArgs = new CacheItemArgs(notificationTypeCacheKey, DataCache.NotificationTypesTimeOut, DataCache.NotificationTypesCachePriority, name); - return CBO.GetCachedObject(cacheItemArgs, GetNotificationTypeByNameCallBack); + return CBO.GetCachedObject(cacheItemArgs, this.GetNotificationTypeByNameCallBack); } public virtual NotificationTypeAction GetNotificationTypeAction(int notificationTypeActionId) { var notificationTypeActionCacheKey = string.Format(DataCache.NotificationTypeActionsCacheKey, notificationTypeActionId); var cacheItemArgs = new CacheItemArgs(notificationTypeActionCacheKey, DataCache.NotificationTypeActionsTimeOut, DataCache.NotificationTypeActionsPriority, notificationTypeActionId); - return CBO.GetCachedObject(cacheItemArgs, GetNotificationTypeActionCallBack); + return CBO.GetCachedObject(cacheItemArgs, this.GetNotificationTypeActionCallBack); } public virtual NotificationTypeAction GetNotificationTypeAction(int notificationTypeId, string name) @@ -361,12 +361,12 @@ public virtual NotificationTypeAction GetNotificationTypeAction(int notification var notificationTypeActionCacheKey = string.Format(DataCache.NotificationTypeActionsByNameCacheKey, notificationTypeId, name); var cacheItemArgs = new CacheItemArgs(notificationTypeActionCacheKey, DataCache.NotificationTypeActionsTimeOut, DataCache.NotificationTypeActionsPriority, notificationTypeId, name); - return CBO.GetCachedObject(cacheItemArgs, GetNotificationTypeActionByNameCallBack); + return CBO.GetCachedObject(cacheItemArgs, this.GetNotificationTypeActionByNameCallBack); } public virtual IList GetNotificationTypeActions(int notificationTypeId) { - return CBO.FillCollection(_dataService.GetNotificationTypeActions(notificationTypeId)); + return CBO.FillCollection(this._dataService.GetNotificationTypeActions(notificationTypeId)); } #endregion @@ -375,23 +375,23 @@ public virtual IList GetNotificationTypeActions(int noti public bool IsToastPending(int notificationId) { - return _dataService.IsToastPending(notificationId); + return this._dataService.IsToastPending(notificationId); } public void MarkReadyForToast(Notification notification, UserInfo userInfo) { - MarkReadyForToast(notification, userInfo.UserID); + this.MarkReadyForToast(notification, userInfo.UserID); } public void MarkReadyForToast(Notification notification, int userId) { DataCache.RemoveCache(string.Format(ToastsCacheKey, userId)); - _dataService.MarkReadyForToast(notification.NotificationID, userId); + this._dataService.MarkReadyForToast(notification.NotificationID, userId); } public void MarkToastSent(int notificationId, int userId) { - _dataService.MarkToastSent(notificationId, userId); + this._dataService.MarkToastSent(notificationId, userId); } public IList GetToasts(UserInfo userInfo) @@ -401,10 +401,10 @@ public IList GetToasts(UserInfo userInfo) if (toasts == null) { - toasts = CBO.FillCollection(_dataService.GetToasts(userInfo.UserID, userInfo.PortalID)); + toasts = CBO.FillCollection(this._dataService.GetToasts(userInfo.UserID, userInfo.PortalID)); foreach (var message in toasts) { - _dataService.MarkToastSent(message.NotificationID, userInfo.UserID); + this._dataService.MarkToastSent(message.NotificationID, userInfo.UserID); } //Set the cache to empty toasts object because we don't want to make calls to database everytime for empty objects. //This empty object cache would be cleared by MarkReadyForToast emthod when a new notification arrives for the user. @@ -434,7 +434,7 @@ internal virtual int GetCurrentUserId() internal virtual DateTime GetExpirationDate(int notificationTypeId) { - var notificationType = GetNotificationType(notificationTypeId); + var notificationType = this.GetNotificationType(notificationTypeId); return notificationType.TimeToLive.TotalMinutes > 0 ? DateTime.UtcNow.AddMinutes(notificationType.TimeToLive.TotalMinutes) @@ -444,26 +444,26 @@ internal virtual DateTime GetExpirationDate(int notificationTypeId) internal virtual object GetNotificationTypeActionCallBack(CacheItemArgs cacheItemArgs) { var notificationTypeActionId = (int)cacheItemArgs.ParamList[0]; - return CBO.FillObject(_dataService.GetNotificationTypeAction(notificationTypeActionId)); + return CBO.FillObject(this._dataService.GetNotificationTypeAction(notificationTypeActionId)); } internal virtual object GetNotificationTypeActionByNameCallBack(CacheItemArgs cacheItemArgs) { var notificationTypeId = (int)cacheItemArgs.ParamList[0]; var name = cacheItemArgs.ParamList[1].ToString(); - return CBO.FillObject(_dataService.GetNotificationTypeActionByName(notificationTypeId, name)); + return CBO.FillObject(this._dataService.GetNotificationTypeActionByName(notificationTypeId, name)); } internal virtual object GetNotificationTypeByNameCallBack(CacheItemArgs cacheItemArgs) { var notificationName = cacheItemArgs.ParamList[0].ToString(); - return CBO.FillObject(_dataService.GetNotificationTypeByName(notificationName)); + return CBO.FillObject(this._dataService.GetNotificationTypeByName(notificationName)); } internal virtual object GetNotificationTypeCallBack(CacheItemArgs cacheItemArgs) { var notificationTypeId = (int)cacheItemArgs.ParamList[0]; - return CBO.FillObject(_dataService.GetNotificationType(notificationTypeId)); + return CBO.FillObject(this._dataService.GetNotificationType(notificationTypeId)); } internal virtual string GetPortalSetting(string settingName, int portalId, string defaultValue) diff --git a/DNN Platform/Library/Services/Social/Subscriptions/Data/DataService.cs b/DNN Platform/Library/Services/Social/Subscriptions/Data/DataService.cs index 0d92714e1c1..f9d246ae072 100644 --- a/DNN Platform/Library/Services/Social/Subscriptions/Data/DataService.cs +++ b/DNN Platform/Library/Services/Social/Subscriptions/Data/DataService.cs @@ -17,7 +17,7 @@ public class DataService : ServiceLocator, IDataServi public DataService() { - provider = DataProvider.Instance(); + this.provider = DataProvider.Instance(); } protected override Func GetFactory() @@ -28,17 +28,17 @@ protected override Func GetFactory() #region Subscription Types public int AddSubscriptionType(string subscriptionName, string friendlyName, int desktopModuleId) { - return provider.ExecuteScalar("CoreMessaging_AddSubscriptionType", subscriptionName, friendlyName, desktopModuleId); + return this.provider.ExecuteScalar("CoreMessaging_AddSubscriptionType", subscriptionName, friendlyName, desktopModuleId); } public IDataReader GetSubscriptionTypes() { - return provider.ExecuteReader("CoreMessaging_GetSubscriptionTypes"); + return this.provider.ExecuteReader("CoreMessaging_GetSubscriptionTypes"); } public bool DeleteSubscriptionType(int subscriptionTypeId) { - return provider.ExecuteScalar("CoreMessaging_DeleteSubscriptionType", subscriptionTypeId) == 0; + return this.provider.ExecuteScalar("CoreMessaging_DeleteSubscriptionType", subscriptionTypeId) == 0; } #endregion @@ -46,46 +46,46 @@ public bool DeleteSubscriptionType(int subscriptionTypeId) #region Subscriptions public int AddSubscription(int userId, int portalId, int subscriptionTypeId, string objectKey, string description, int moduleId, int tabId, string objectData) { - return provider.ExecuteScalar("CoreMessaging_AddSubscription", + return this.provider.ExecuteScalar("CoreMessaging_AddSubscription", userId, - provider.GetNull(portalId), + this.provider.GetNull(portalId), subscriptionTypeId, objectKey, description, - provider.GetNull(moduleId), - provider.GetNull(tabId), + this.provider.GetNull(moduleId), + this.provider.GetNull(tabId), objectData); } public IDataReader GetSubscriptionsByUser(int portalId, int userId, int subscriptionTypeId) { - return provider.ExecuteReader("CoreMessaging_GetSubscriptionsByUser", provider.GetNull(portalId), userId, provider.GetNull(subscriptionTypeId)); + return this.provider.ExecuteReader("CoreMessaging_GetSubscriptionsByUser", this.provider.GetNull(portalId), userId, this.provider.GetNull(subscriptionTypeId)); } public IDataReader GetSubscriptionsByContent(int portalId, int subscriptionTypeId, string objectKey) { - return provider.ExecuteReader("CoreMessaging_GetSubscriptionsByContent", provider.GetNull(portalId), subscriptionTypeId, objectKey); + return this.provider.ExecuteReader("CoreMessaging_GetSubscriptionsByContent", this.provider.GetNull(portalId), subscriptionTypeId, objectKey); } public IDataReader IsSubscribed(int portalId, int userId, int subscriptionTypeId, string objectKey, int moduleId, int tabId) { - return provider.ExecuteReader("CoreMessaging_IsSubscribed", - provider.GetNull(portalId), + return this.provider.ExecuteReader("CoreMessaging_IsSubscribed", + this.provider.GetNull(portalId), userId, subscriptionTypeId, objectKey, - provider.GetNull(moduleId), - provider.GetNull(tabId)); + this.provider.GetNull(moduleId), + this.provider.GetNull(tabId)); } public bool DeleteSubscription(int subscriptionId) { - return provider.ExecuteScalar("CoreMessaging_DeleteSubscription", subscriptionId) == 0; + return this.provider.ExecuteScalar("CoreMessaging_DeleteSubscription", subscriptionId) == 0; } public int UpdateSubscriptionDescription(string objectKey, int portalId, string newDescription) { - return provider.ExecuteScalar("CoreMessaging_UpdateSubscriptionDescription", + return this.provider.ExecuteScalar("CoreMessaging_UpdateSubscriptionDescription", objectKey, portalId, newDescription); @@ -93,7 +93,7 @@ public int UpdateSubscriptionDescription(string objectKey, int portalId, string public void DeleteSubscriptionsByObjectKey(int portalId, string objectKey) { - provider.ExecuteNonQuery("CoreMessaging_DeleteSubscriptionsByObjectKey", portalId, objectKey); + this.provider.ExecuteNonQuery("CoreMessaging_DeleteSubscriptionsByObjectKey", portalId, objectKey); } #endregion diff --git a/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionController.cs b/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionController.cs index e0e0685dbf3..e90a6cacea0 100644 --- a/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionController.cs +++ b/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionController.cs @@ -24,8 +24,8 @@ public class SubscriptionController : ServiceLocator GetFactory() @@ -36,27 +36,27 @@ protected override Func GetFactory() #region Implemented Methods public IEnumerable GetUserSubscriptions(UserInfo user, int portalId, int subscriptionTypeId = -1) { - var subscriptions = CBO.FillCollection(dataService.GetSubscriptionsByUser( + var subscriptions = CBO.FillCollection(this.dataService.GetSubscriptionsByUser( portalId, user.UserID, subscriptionTypeId)); - return subscriptions.Where(s => subscriptionSecurityController.HasPermission(s)); + return subscriptions.Where(s => this.subscriptionSecurityController.HasPermission(s)); } public IEnumerable GetContentSubscriptions(int portalId, int subscriptionTypeId, string objectKey) { - var subscriptions = CBO.FillCollection(dataService.GetSubscriptionsByContent( + var subscriptions = CBO.FillCollection(this.dataService.GetSubscriptionsByContent( portalId, subscriptionTypeId, objectKey)); - return subscriptions.Where(s => subscriptionSecurityController.HasPermission(s)); + return subscriptions.Where(s => this.subscriptionSecurityController.HasPermission(s)); } public bool IsSubscribed(Subscription subscription) { - var fetchedSubscription = CBO.FillObject(dataService.IsSubscribed( + var fetchedSubscription = CBO.FillObject(this.dataService.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -64,7 +64,7 @@ public bool IsSubscribed(Subscription subscription) subscription.ModuleId, subscription.TabId)); - return fetchedSubscription != null && subscriptionSecurityController.HasPermission(fetchedSubscription); + return fetchedSubscription != null && this.subscriptionSecurityController.HasPermission(fetchedSubscription); } public void AddSubscription(Subscription subscription) @@ -74,7 +74,7 @@ public void AddSubscription(Subscription subscription) Requires.NotNegative("subscription.SubscriptionTypeId", subscription.SubscriptionTypeId); Requires.PropertyNotNull("subscription.ObjectKey", subscription.ObjectKey); - subscription.SubscriptionId = dataService.AddSubscription(subscription.UserId, + subscription.SubscriptionId = this.dataService.AddSubscription(subscription.UserId, subscription.PortalId, subscription.SubscriptionTypeId, subscription.ObjectKey, @@ -88,7 +88,7 @@ public void DeleteSubscription(Subscription subscription) { Requires.NotNull("subscription", subscription); - var subscriptionToDelete = CBO.FillObject(dataService.IsSubscribed( + var subscriptionToDelete = CBO.FillObject(this.dataService.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -98,7 +98,7 @@ public void DeleteSubscription(Subscription subscription) if (subscriptionToDelete == null) return; - dataService.DeleteSubscription(subscriptionToDelete.SubscriptionId); + this.dataService.DeleteSubscription(subscriptionToDelete.SubscriptionId); } public int UpdateSubscriptionDescription(string objectKey, int portalId, string newDescription) @@ -106,12 +106,12 @@ public int UpdateSubscriptionDescription(string objectKey, int portalId, string Requires.PropertyNotNull("objectKey", objectKey); Requires.NotNull("portalId", portalId); Requires.PropertyNotNull("newDescription", newDescription); - return dataService.UpdateSubscriptionDescription(objectKey, portalId, newDescription); + return this.dataService.UpdateSubscriptionDescription(objectKey, portalId, newDescription); } public void DeleteSubscriptionsByObjectKey(int portalId, string objectKey) { - dataService.DeleteSubscriptionsByObjectKey(portalId, objectKey); + this.dataService.DeleteSubscriptionsByObjectKey(portalId, objectKey); } #endregion diff --git a/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionTypeController.cs b/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionTypeController.cs index 7c83dd9a78e..a5db7e76941 100644 --- a/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionTypeController.cs +++ b/DNN Platform/Library/Services/Social/Subscriptions/SubscriptionTypeController.cs @@ -22,7 +22,7 @@ public class SubscriptionTypeController : ServiceLocator GetFactory() @@ -35,7 +35,7 @@ public void AddSubscriptionType(SubscriptionType subscriptionType) { Requires.NotNull("subscriptionType", subscriptionType); - subscriptionType.SubscriptionTypeId = dataService.AddSubscriptionType( + subscriptionType.SubscriptionTypeId = this.dataService.AddSubscriptionType( subscriptionType.SubscriptionName, subscriptionType.FriendlyName, subscriptionType.DesktopModuleId); @@ -47,7 +47,7 @@ public SubscriptionType GetSubscriptionType(Func predica { Requires.NotNull("predicate", predicate); - return GetSubscriptionTypes().SingleOrDefault(predicate); + return this.GetSubscriptionTypes().SingleOrDefault(predicate); } public IEnumerable GetSubscriptionTypes() @@ -57,14 +57,14 @@ public IEnumerable GetSubscriptionTypes() DataCache.SubscriptionTypesCachePriority); return CBO.GetCachedObject>(cacheArgs, - c => CBO.FillCollection(dataService.GetSubscriptionTypes())); + c => CBO.FillCollection(this.dataService.GetSubscriptionTypes())); } public IEnumerable GetSubscriptionTypes(Func predicate) { Requires.NotNull("predicate", predicate); - return GetSubscriptionTypes().Where(predicate); + return this.GetSubscriptionTypes().Where(predicate); } public void DeleteSubscriptionType(SubscriptionType subscriptionType) @@ -72,7 +72,7 @@ public void DeleteSubscriptionType(SubscriptionType subscriptionType) Requires.NotNull("subscriptionType", subscriptionType); Requires.NotNegative("subscriptionType.SubscriptionTypeId", subscriptionType.SubscriptionTypeId); - dataService.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId); + this.dataService.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId); CleanCache(); } #endregion diff --git a/DNN Platform/Library/Services/Syndication/RssHandler.cs b/DNN Platform/Library/Services/Syndication/RssHandler.cs index 1e84182577b..b02f20b5e2d 100644 --- a/DNN Platform/Library/Services/Syndication/RssHandler.cs +++ b/DNN Platform/Library/Services/Syndication/RssHandler.cs @@ -32,29 +32,29 @@ public class RssHandler : SyndicationHandlerBase protected override void PopulateChannel(string channelName, string userName) { ModuleInfo objModule; - if (Request == null || Settings == null || Settings.ActiveTab == null || ModuleId == Null.NullInteger) + if (this.Request == null || this.Settings == null || this.Settings.ActiveTab == null || this.ModuleId == Null.NullInteger) { return; } - Channel["title"] = Settings.PortalName; - Channel["link"] = Globals.AddHTTP(Globals.GetDomainName(Request)); - if (!String.IsNullOrEmpty(Settings.Description)) + this.Channel["title"] = this.Settings.PortalName; + this.Channel["link"] = Globals.AddHTTP(Globals.GetDomainName(this.Request)); + if (!String.IsNullOrEmpty(this.Settings.Description)) { - Channel["description"] = Settings.Description; + this.Channel["description"] = this.Settings.Description; } else { - Channel["description"] = Settings.PortalName; + this.Channel["description"] = this.Settings.PortalName; } - Channel["language"] = Settings.DefaultLanguage; - Channel["copyright"] = !string.IsNullOrEmpty(Settings.FooterText) ? Settings.FooterText.Replace("[year]", DateTime.Now.Year.ToString()) : string.Empty; - Channel["webMaster"] = Settings.Email; + this.Channel["language"] = this.Settings.DefaultLanguage; + this.Channel["copyright"] = !string.IsNullOrEmpty(this.Settings.FooterText) ? this.Settings.FooterText.Replace("[year]", DateTime.Now.Year.ToString()) : string.Empty; + this.Channel["webMaster"] = this.Settings.Email; IList searchResults = null; var query = new SearchQuery(); - query.PortalIds = new[] { Settings.PortalId }; - query.TabId = TabId; - query.ModuleId = ModuleId; + query.PortalIds = new[] { this.Settings.PortalId }; + query.TabId = this.TabId; + query.ModuleId = this.ModuleId; query.SearchTypeIds = new[] { SearchHelper.Instance.GetSearchTypeByName("module").SearchTypeId }; try @@ -71,7 +71,7 @@ protected override void PopulateChannel(string channelName, string userName) { if (!result.UniqueKey.StartsWith(Constants.ModuleMetaDataPrefixTag) && TabPermissionController.CanViewPage()) { - if (Settings.ActiveTab.StartDate < DateTime.Now && Settings.ActiveTab.EndDate > DateTime.Now) + if (this.Settings.ActiveTab.StartDate < DateTime.Now && this.Settings.ActiveTab.EndDate > DateTime.Now) { objModule = ModuleController.Instance.GetModule(result.ModuleId, query.TabId, false); if (objModule != null && objModule.DisplaySyndicate && objModule.IsDeleted == false) @@ -81,7 +81,7 @@ protected override void PopulateChannel(string channelName, string userName) if (Convert.ToDateTime(objModule.StartDate == Null.NullDate ? DateTime.MinValue : objModule.StartDate) < DateTime.Now && Convert.ToDateTime(objModule.EndDate == Null.NullDate ? DateTime.MaxValue : objModule.EndDate) > DateTime.Now) { - Channel.Items.Add(GetRssItem(result)); + this.Channel.Items.Add(this.GetRssItem(result)); } } } @@ -129,9 +129,9 @@ protected override void OnPreRender(EventArgs ea) { base.OnPreRender(ea); - Context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); - Context.Response.Cache.SetCacheability(HttpCacheability.Public); - Context.Response.Cache.VaryByParams["moduleid"] = true; + this.Context.Response.Cache.SetExpires(DateTime.Now.AddSeconds(60)); + this.Context.Response.Cache.SetCacheability(HttpCacheability.Public); + this.Context.Response.Cache.VaryByParams["moduleid"] = true; } } } diff --git a/DNN Platform/Library/Services/Syndication/SyndicationHandlerBase.cs b/DNN Platform/Library/Services/Syndication/SyndicationHandlerBase.cs index 8dc452dc673..474bc29e6ab 100644 --- a/DNN Platform/Library/Services/Syndication/SyndicationHandlerBase.cs +++ b/DNN Platform/Library/Services/Syndication/SyndicationHandlerBase.cs @@ -33,14 +33,14 @@ public int TabId { get { - if (_tabId == Null.NullInteger && Request.QueryString["tabid"] != null) + if (this._tabId == Null.NullInteger && this.Request.QueryString["tabid"] != null) { - if (! Int32.TryParse(Request.QueryString["tabid"], out _tabId)) + if (! Int32.TryParse(this.Request.QueryString["tabid"], out this._tabId)) { - _tabId = Null.NullInteger; + this._tabId = Null.NullInteger; } } - return _tabId; + return this._tabId; } } @@ -48,14 +48,14 @@ public int ModuleId { get { - if (_moduleId == Null.NullInteger && Request.QueryString["moduleid"] != null) + if (this._moduleId == Null.NullInteger && this.Request.QueryString["moduleid"] != null) { - if (! Int32.TryParse(Request.QueryString["moduleid"], out _moduleId)) + if (! Int32.TryParse(this.Request.QueryString["moduleid"], out this._moduleId)) { - _moduleId = Null.NullInteger; + this._moduleId = Null.NullInteger; } } - return _moduleId; + return this._moduleId; } } diff --git a/DNN Platform/Library/Services/Tokens/BaseCustomTokenReplace.cs b/DNN Platform/Library/Services/Tokens/BaseCustomTokenReplace.cs index 3169e21a392..2a8e30c07bc 100644 --- a/DNN Platform/Library/Services/Tokens/BaseCustomTokenReplace.cs +++ b/DNN Platform/Library/Services/Tokens/BaseCustomTokenReplace.cs @@ -2,22 +2,22 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information -using System; -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Text.RegularExpressions; +using System.Linq; +using System.Text.RegularExpressions; using DotNetNuke.ComponentModel; -using DotNetNuke.Entities.Users; - -namespace DotNetNuke.Services.Tokens -{ - /// - /// BaseCustomTokenReplace allows to add multiple sources implementing IPropertyAccess - /// - /// - public abstract class BaseCustomTokenReplace : BaseTokenReplace - { +using DotNetNuke.Entities.Users; + +namespace DotNetNuke.Services.Tokens +{ + /// + /// BaseCustomTokenReplace allows to add multiple sources implementing IPropertyAccess + /// + /// + public abstract class BaseCustomTokenReplace : BaseTokenReplace + { protected TokenProvider Provider { get => ComponentFactory.GetComponent(); } @@ -60,18 +60,18 @@ public bool DebugMessages { set => TokenContext.DebugMessages = value; } - /// - /// Gets the Format provider as Culture info from stored language or current culture - /// - /// An CultureInfo + /// + /// Gets the Format provider as Culture info from stored language or current culture + /// + /// An CultureInfo protected override CultureInfo FormatProvider { get => TokenContext.Language; - } - - /// - /// Gets/sets the language to be used, e.g. for date format - /// - /// A string, representing the locale + } + + /// + /// Gets/sets the language to be used, e.g. for date format + /// + /// A string, representing the locale public override string Language { get => TokenContext.Language.ToString(); set { @@ -82,97 +82,99 @@ public override string Language { public BaseCustomTokenReplace() { PropertySource = TokenContext.PropertySource; } - - protected override string replacedTokenValue(string objectName, string propertyName, string format) - { - string result = string.Empty; - bool propertyNotFound = false; - if (PropertySource.ContainsKey(objectName.ToLowerInvariant())) - { - result = PropertySource[objectName.ToLowerInvariant()].GetProperty(propertyName, format, FormatProvider, AccessingUser, CurrentAccessLevel, ref propertyNotFound); - } - else - { - if (DebugMessages) - { - string message = Localization.Localization.GetString("TokenReplaceUnknownObject", Localization.Localization.SharedResourceFile, FormatProvider.ToString()); - if (message == string.Empty) - { - message = "Error accessing [{0}:{1}], {0} is an unknown datasource"; - } - result = string.Format(message, objectName, propertyName); - } - } - if (DebugMessages && propertyNotFound) - { - string message; - if (result == PropertyAccess.ContentLocked) - { - message = Localization.Localization.GetString("TokenReplaceRestrictedProperty", Localization.Localization.GlobalResourceFile, FormatProvider.ToString()); - } - else - { - message = Localization.Localization.GetString("TokenReplaceUnknownProperty", Localization.Localization.GlobalResourceFile, FormatProvider.ToString()); - } - if (message == string.Empty) - { - message = "Error accessing [{0}:{1}], {1} is unknown for datasource {0}"; - } - result = string.Format(message, objectName, propertyName); - } - - return result; - } - - /// - /// returns cacheability of the passed text regarding all contained tokens - /// - /// the text to parse for tokens to replace - /// cacheability level (not - safe - fully) - /// always check cacheability before caching a module! - public CacheLevel Cacheability(string sourceText) - { - CacheLevel isSafe = CacheLevel.fullyCacheable; - if (sourceText != null && !string.IsNullOrEmpty(sourceText)) - { - //initialize PropertyAccess classes - string DummyResult = ReplaceTokens(sourceText); - - foreach (Match currentMatch in TokenizerRegex.Matches(sourceText)) - { - string strObjectName = currentMatch.Result("${object}"); - if (!String.IsNullOrEmpty(strObjectName)) - { - if (strObjectName == "[") - { - //nothing - } - else if (!PropertySource.ContainsKey(strObjectName.ToLowerInvariant())) - { - } - else - { - CacheLevel c = PropertySource[strObjectName.ToLowerInvariant()].Cacheability; - if (c < isSafe) - { - isSafe = c; - } - } - } - } - } - return isSafe; - } - - /// - /// Checks for present [Object:Property] tokens - /// - /// String with [Object:Property] tokens - /// - public bool ContainsTokens(string strSourceText) - { + + protected override string replacedTokenValue(string objectName, string propertyName, string format) + { + string result = string.Empty; + bool propertyNotFound = false; + if (this.PropertySource.ContainsKey(objectName.ToLowerInvariant())) + { + result = this.PropertySource[objectName.ToLowerInvariant()].GetProperty(propertyName, format, this.FormatProvider, this.AccessingUser, this.CurrentAccessLevel, ref propertyNotFound); + } + else + { + if (this.DebugMessages) + { + string message = Localization.Localization.GetString("TokenReplaceUnknownObject", Localization.Localization.SharedResourceFile, this.FormatProvider.ToString()); + if (message == string.Empty) + { + message = "Error accessing [{0}:{1}], {0} is an unknown datasource"; + } + result = string.Format(message, objectName, propertyName); + } + } + if (this.DebugMessages && propertyNotFound) + { + string message; + if (result == PropertyAccess.ContentLocked) + { + message = Localization.Localization.GetString("TokenReplaceRestrictedProperty", Localization.Localization.GlobalResourceFile, this.FormatProvider.ToString()); + } + else + { + message = Localization.Localization.GetString("TokenReplaceUnknownProperty", Localization.Localization.GlobalResourceFile, this.FormatProvider.ToString()); + } + if (message == string.Empty) + { + message = "Error accessing [{0}:{1}], {1} is unknown for datasource {0}"; + } + result = string.Format(message, objectName, propertyName); + } + + return result; + } + + /// + /// returns cacheability of the passed text regarding all contained tokens + /// + /// the text to parse for tokens to replace + /// cacheability level (not - safe - fully) + /// always check cacheability before caching a module! + public CacheLevel Cacheability(string sourceText) + { + CacheLevel isSafe = CacheLevel.fullyCacheable; + if (sourceText != null && !string.IsNullOrEmpty(sourceText)) + { + //initialize PropertyAccess classes + string DummyResult = this.ReplaceTokens(sourceText); + + foreach (Match currentMatch in this.TokenizerRegex.Matches(sourceText)) + { + string strObjectName = currentMatch.Result("${object}"); + if (!String.IsNullOrEmpty(strObjectName)) + { + if (strObjectName == "[") + { + //nothing + } + else if (!this.PropertySource.ContainsKey(strObjectName.ToLowerInvariant())) + { + } + else + { + CacheLevel c = this.PropertySource[strObjectName.ToLowerInvariant()].Cacheability; + if (c < isSafe) + { + isSafe = c; + } + } + } + } + } + return isSafe; + } + + /// + /// Checks for present [Object:Property] tokens + /// + /// String with [Object:Property] tokens + /// + public bool ContainsTokens(string strSourceText) + { if (string.IsNullOrEmpty(strSourceText)) + { return false; + } // also check providers, since they might support different syntax than square brackets return TokenizerRegex.Matches(strSourceText).Cast().Any(currentMatch => currentMatch.Result("${object}").Length > 0) @@ -182,6 +184,6 @@ public bool ContainsTokens(string strSourceText) protected override string ReplaceTokens(string sourceText) { return Provider is CoreTokenProvider ? base.ReplaceTokens(sourceText) : Provider.Tokenize(sourceText, TokenContext); - } - } -} + } + } +} diff --git a/DNN Platform/Library/Services/Tokens/BaseTokenReplace.cs b/DNN Platform/Library/Services/Tokens/BaseTokenReplace.cs index db645176aa2..eb86228aaea 100644 --- a/DNN Platform/Library/Services/Tokens/BaseTokenReplace.cs +++ b/DNN Platform/Library/Services/Tokens/BaseTokenReplace.cs @@ -45,7 +45,7 @@ public abstract class BaseTokenReplace /// An CultureInfo protected virtual CultureInfo FormatProvider { - get { return _formatProvider ?? (_formatProvider = Thread.CurrentThread.CurrentUICulture); } + get { return this._formatProvider ?? (this._formatProvider = Thread.CurrentThread.CurrentUICulture); } } /// @@ -56,12 +56,12 @@ public virtual string Language { get { - return _language; + return this._language; } set { - _language = value; - _formatProvider = new CultureInfo(_language); + this._language = value; + this._formatProvider = new CultureInfo(this._language); } } @@ -73,11 +73,11 @@ protected Regex TokenizerRegex { get { - var cacheKey = (UseObjectLessExpression) ? TokenReplaceCacheKeyObjectless : TokenReplaceCacheKeyDefault; + var cacheKey = (this.UseObjectLessExpression) ? TokenReplaceCacheKeyObjectless : TokenReplaceCacheKeyDefault; var tokenizer = DataCache.GetCache(cacheKey) as Regex; if (tokenizer == null) { - tokenizer = RegexUtils.GetCachedRegex(UseObjectLessExpression ? ExpressionObjectLess : ExpressionDefault); + tokenizer = RegexUtils.GetCachedRegex(this.UseObjectLessExpression ? ExpressionObjectLess : ExpressionDefault); DataCache.SetCache(cacheKey, tokenizer); } return tokenizer; @@ -94,7 +94,7 @@ protected virtual string ReplaceTokens(string sourceText) return string.Empty; } var result = new StringBuilder(); - foreach (Match currentMatch in TokenizerRegex.Matches(sourceText)) + foreach (Match currentMatch in this.TokenizerRegex.Matches(sourceText)) { string objectName = currentMatch.Result("${object}"); if (!String.IsNullOrEmpty(objectName)) @@ -106,7 +106,7 @@ protected virtual string ReplaceTokens(string sourceText) string propertyName = currentMatch.Result("${property}"); string format = currentMatch.Result("${format}"); string ifEmptyReplacment = currentMatch.Result("${ifEmpty}"); - string conversion = replacedTokenValue(objectName, propertyName, format); + string conversion = this.replacedTokenValue(objectName, propertyName, format); if (!String.IsNullOrEmpty(ifEmptyReplacment) && String.IsNullOrEmpty(conversion)) { conversion = ifEmptyReplacment; diff --git a/DNN Platform/Library/Services/Tokens/HtmlTokenReplace.cs b/DNN Platform/Library/Services/Tokens/HtmlTokenReplace.cs index 0e80d26cd8c..87cbe6ab281 100644 --- a/DNN Platform/Library/Services/Tokens/HtmlTokenReplace.cs +++ b/DNN Platform/Library/Services/Tokens/HtmlTokenReplace.cs @@ -11,10 +11,10 @@ public class HtmlTokenReplace : TokenReplace public HtmlTokenReplace(Page page) : base(Scope.DefaultSettings) { - PropertySource["css"] = new CssPropertyAccess(page); - PropertySource["js"] = new JavaScriptPropertyAccess(page); - PropertySource["javascript"] = new JavaScriptPropertyAccess(page); - PropertySource["antiforgerytoken"] = new AntiForgeryTokenPropertyAccess(); + this.PropertySource["css"] = new CssPropertyAccess(page); + this.PropertySource["js"] = new JavaScriptPropertyAccess(page); + this.PropertySource["javascript"] = new JavaScriptPropertyAccess(page); + this.PropertySource["antiforgerytoken"] = new AntiForgeryTokenPropertyAccess(); } } } diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/ArrayListPropertyAccesss.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/ArrayListPropertyAccesss.cs index 49f98968c6c..feef060d576 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/ArrayListPropertyAccesss.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/ArrayListPropertyAccesss.cs @@ -20,14 +20,14 @@ public class ArrayListPropertyAccess : IPropertyAccess public ArrayListPropertyAccess(ArrayList list) { - custom = list; + this.custom = list; } #region IPropertyAccess Members public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo AccessingUser, Scope AccessLevel, ref bool PropertyNotFound) { - if (custom == null) + if (this.custom == null) { return string.Empty; } @@ -38,9 +38,9 @@ public string GetProperty(string propertyName, string format, CultureInfo format OutputFormat = "g"; } int intIndex = int.Parse(propertyName); - if ((custom != null) && custom.Count > intIndex) + if ((this.custom != null) && this.custom.Count > intIndex) { - valueObject = custom[intIndex].ToString(); + valueObject = this.custom[intIndex].ToString(); } if ((valueObject != null)) { diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/CssPropertyAccess.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/CssPropertyAccess.cs index 8561e904ac5..09da1ed640d 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/CssPropertyAccess.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/CssPropertyAccess.cs @@ -30,7 +30,7 @@ public class CssPropertyAccess : JsonPropertyAccess public CssPropertyAccess(Page page) { - _page = page; + this._page = page; } protected override string ProcessToken(StylesheetDto model, UserInfo accessingUser, Scope accessLevel) @@ -45,11 +45,11 @@ protected override string ProcessToken(StylesheetDto model, UserInfo accessingUs } if (String.IsNullOrEmpty(model.Provider)) { - ClientResourceManager.RegisterStyleSheet(_page, model.Path, model.Priority); + ClientResourceManager.RegisterStyleSheet(this._page, model.Path, model.Priority); } else { - ClientResourceManager.RegisterStyleSheet(_page, model.Path, model.Priority, model.Provider); + ClientResourceManager.RegisterStyleSheet(this._page, model.Path, model.Priority, model.Provider); } return String.Empty; diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/DataRowPropertyAccess.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/DataRowPropertyAccess.cs index 101b083f598..492579aaef3 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/DataRowPropertyAccess.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/DataRowPropertyAccess.cs @@ -20,18 +20,18 @@ public class DataRowPropertyAccess : IPropertyAccess public DataRowPropertyAccess(DataRow row) { - dr = row; + this.dr = row; } #region IPropertyAccess Members public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo AccessingUser, Scope AccessLevel, ref bool PropertyNotFound) { - if (dr == null) + if (this.dr == null) { return string.Empty; } - object valueObject = dr[propertyName]; + object valueObject = this.dr[propertyName]; string OutputFormat = format; if (string.IsNullOrEmpty(format)) { diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/DictionaryPropertyAccess.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/DictionaryPropertyAccess.cs index 15186c9ccb0..68683d0290d 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/DictionaryPropertyAccess.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/DictionaryPropertyAccess.cs @@ -20,18 +20,18 @@ public class DictionaryPropertyAccess : IPropertyAccess public DictionaryPropertyAccess(IDictionary list) { - NameValueCollection = list; + this.NameValueCollection = list; } #region IPropertyAccess Members public virtual string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo AccessingUser, Scope AccessLevel, ref bool PropertyNotFound) { - if (NameValueCollection == null) + if (this.NameValueCollection == null) { return string.Empty; } - object valueObject = NameValueCollection[propertyName]; + object valueObject = this.NameValueCollection[propertyName]; string OutputFormat = format; if (string.IsNullOrEmpty(format)) { diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/JavaScriptPropertyAccess.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/JavaScriptPropertyAccess.cs index cf7eb16253f..a52c4251cd8 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/JavaScriptPropertyAccess.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/JavaScriptPropertyAccess.cs @@ -40,7 +40,7 @@ public class JavaScriptPropertyAccess : JsonPropertyAccess public JavaScriptPropertyAccess(Page page) { - _page = page; + this._page = page; } protected override string ProcessToken(JavaScriptDto model, UserInfo accessingUser, Scope accessLevel) @@ -57,11 +57,11 @@ protected override string ProcessToken(JavaScriptDto model, UserInfo accessingUs } if (String.IsNullOrEmpty(model.Provider)) { - ClientResourceManager.RegisterScript(_page, model.Path, model.Priority); + ClientResourceManager.RegisterScript(this._page, model.Path, model.Priority); } else { - ClientResourceManager.RegisterScript(_page, model.Path, model.Priority, model.Provider); + ClientResourceManager.RegisterScript(this._page, model.Path, model.Priority, model.Provider); } } else if (!String.IsNullOrEmpty(model.Path)) @@ -72,11 +72,11 @@ protected override string ProcessToken(JavaScriptDto model, UserInfo accessingUs } if (String.IsNullOrEmpty(model.Provider)) { - ClientResourceManager.RegisterScript(_page, model.Path, model.Priority, "", model.JsName, model.Version); + ClientResourceManager.RegisterScript(this._page, model.Path, model.Priority, "", model.JsName, model.Version); } else { - ClientResourceManager.RegisterScript(_page, model.Path, model.Priority, model.Provider, model.JsName, model.Version); + ClientResourceManager.RegisterScript(this._page, model.Path, model.Priority, model.Provider, model.JsName, model.Version); } } else diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/JsonPropertyAccess.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/JsonPropertyAccess.cs index df64769d01f..397b1d71147 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/JsonPropertyAccess.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/JsonPropertyAccess.cs @@ -27,7 +27,7 @@ public string GetProperty(string propertyName, string format, CultureInfo format var deserializedObject = JsonConvert.DeserializeObject(json); - return ProcessToken(deserializedObject, accessingUser, accessLevel); + return this.ProcessToken(deserializedObject, accessingUser, accessLevel); } protected abstract string ProcessToken(TModel model, UserInfo accessingUser, Scope accessLevel); diff --git a/DNN Platform/Library/Services/Tokens/PropertyAccess/PropertyAccess.cs b/DNN Platform/Library/Services/Tokens/PropertyAccess/PropertyAccess.cs index 9d0e478e4c5..d2bb24be338 100644 --- a/DNN Platform/Library/Services/Tokens/PropertyAccess/PropertyAccess.cs +++ b/DNN Platform/Library/Services/Tokens/PropertyAccess/PropertyAccess.cs @@ -25,7 +25,7 @@ public class PropertyAccess : IPropertyAccess public PropertyAccess(object TokenSource) { - obj = TokenSource; + this.obj = TokenSource; } public static string ContentLocked @@ -40,11 +40,11 @@ public static string ContentLocked public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo AccessingUser, Scope AccessLevel, ref bool PropertyNotFound) { - if (obj == null) + if (this.obj == null) { return string.Empty; } - return GetObjectProperty(obj, propertyName, format, formatProvider, ref PropertyNotFound); + return GetObjectProperty(this.obj, propertyName, format, formatProvider, ref PropertyNotFound); } public CacheLevel Cacheability diff --git a/DNN Platform/Library/Services/Tokens/TokenReplace.cs b/DNN Platform/Library/Services/Tokens/TokenReplace.cs index d8f3ba4a3b0..f59b3c4a8df 100644 --- a/DNN Platform/Library/Services/Tokens/TokenReplace.cs +++ b/DNN Platform/Library/Services/Tokens/TokenReplace.cs @@ -2,127 +2,130 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information -using System.Collections; -using System.Data; -using System.Web; -using DotNetNuke.Common.Utilities; -using DotNetNuke.Entities.Host; -using DotNetNuke.Entities.Modules; -using DotNetNuke.Entities.Portals; -using DotNetNuke.Entities.Users; - -namespace DotNetNuke.Services.Tokens -{ - /// - /// The TokenReplace class provides the option to replace tokens formatted - /// [object:property] or [object:property|format] or [custom:no] within a string - /// with the appropriate current property/custom values. - /// Example for Newsletter: 'Dear [user:Displayname],' ==> 'Dear Superuser Account,' - /// Supported Token Sources: User, Host, Portal, Tab, Module, Membership, Profile, - /// Row, Date, Ticks, ArrayList (Custom), IDictionary - /// - /// - public class TokenReplace : BaseCustomTokenReplace - { - /// - /// creates a new TokenReplace object for default context - /// - public TokenReplace() : this(Scope.DefaultSettings, null, null, null, Null.NullInteger) - { - } - - /// - /// creates a new TokenReplace object for default context and the current module - /// - /// ID of the current module - public TokenReplace(int moduleID) : this(Scope.DefaultSettings, null, null, null, moduleID) - { - } - - /// - /// creates a new TokenReplace object for custom context - /// - /// Security level granted by the calling object - public TokenReplace(Scope accessLevel) : this(accessLevel, null, null, null, Null.NullInteger) - { - } - - /// - /// creates a new TokenReplace object for custom context - /// - /// Security level granted by the calling object - /// ID of the current module - public TokenReplace(Scope accessLevel, int moduleID) : this(accessLevel, null, null, null, moduleID) - { - } - - /// - /// creates a new TokenReplace object for custom context - /// - /// Security level granted by the calling object - /// Locale to be used for formatting etc. - /// PortalSettings to be used - /// user, for which the properties shall be returned - public TokenReplace(Scope accessLevel, string language, PortalSettings portalSettings, UserInfo user) : this(accessLevel, language, portalSettings, user, Null.NullInteger) - { - } - - /// - /// creates a new TokenReplace object for custom context - /// - /// Security level granted by the calling object - /// Locale to be used for formatting etc. - /// PortalSettings to be used - /// user, for which the properties shall be returned - /// ID of the current module - public TokenReplace(Scope accessLevel, string language, PortalSettings portalSettings, UserInfo user, int moduleID) - { - CurrentAccessLevel = accessLevel; +using System.Collections; +using System.Data; +using System.Web; +using DotNetNuke.Common.Utilities; +using DotNetNuke.Entities.Host; +using DotNetNuke.Entities.Modules; +using DotNetNuke.Entities.Portals; +using DotNetNuke.Entities.Users; - if (accessLevel != Scope.NoSettings) { - DeterminePortal(portalSettings); - DetermineUser(user); - DetermineLanguage(language); - DetermineModule(moduleID); - } - - PropertySource["date"] = new DateTimePropertyAccess(); - PropertySource["datetime"] = new DateTimePropertyAccess(); - PropertySource["ticks"] = new TicksPropertyAccess(); - PropertySource["culture"] = new CulturePropertyAccess(); +namespace DotNetNuke.Services.Tokens +{ + /// + /// The TokenReplace class provides the option to replace tokens formatted + /// [object:property] or [object:property|format] or [custom:no] within a string + /// with the appropriate current property/custom values. + /// Example for Newsletter: 'Dear [user:Displayname],' ==> 'Dear Superuser Account,' + /// Supported Token Sources: User, Host, Portal, Tab, Module, Membership, Profile, + /// Row, Date, Ticks, ArrayList (Custom), IDictionary + /// + /// + public class TokenReplace : BaseCustomTokenReplace + { + /// + /// creates a new TokenReplace object for default context + /// + public TokenReplace() : this(Scope.DefaultSettings, null, null, null, Null.NullInteger) + { + } + + /// + /// creates a new TokenReplace object for default context and the current module + /// + /// ID of the current module + public TokenReplace(int moduleID) : this(Scope.DefaultSettings, null, null, null, moduleID) + { + } + + /// + /// creates a new TokenReplace object for custom context + /// + /// Security level granted by the calling object + public TokenReplace(Scope accessLevel) : this(accessLevel, null, null, null, Null.NullInteger) + { + } + + /// + /// creates a new TokenReplace object for custom context + /// + /// Security level granted by the calling object + /// ID of the current module + public TokenReplace(Scope accessLevel, int moduleID) : this(accessLevel, null, null, null, moduleID) + { + } + + /// + /// creates a new TokenReplace object for custom context + /// + /// Security level granted by the calling object + /// Locale to be used for formatting etc. + /// PortalSettings to be used + /// user, for which the properties shall be returned + public TokenReplace(Scope accessLevel, string language, PortalSettings portalSettings, UserInfo user) : this(accessLevel, language, portalSettings, user, Null.NullInteger) + { + } + + /// + /// creates a new TokenReplace object for custom context + /// + /// Security level granted by the calling object + /// Locale to be used for formatting etc. + /// PortalSettings to be used + /// user, for which the properties shall be returned + /// ID of the current module + public TokenReplace(Scope accessLevel, string language, PortalSettings portalSettings, UserInfo user, int moduleID) + { + this.CurrentAccessLevel = accessLevel; + + if (accessLevel != Scope.NoSettings) + { + this.DeterminePortal(portalSettings); + this.DetermineUser(user); + this.DetermineLanguage(language); + this.DetermineModule(moduleID); + } + + this.PropertySource["date"] = new DateTimePropertyAccess(); + this.PropertySource["datetime"] = new DateTimePropertyAccess(); + this.PropertySource["ticks"] = new TicksPropertyAccess(); + this.PropertySource["culture"] = new CulturePropertyAccess(); } private void DeterminePortal(PortalSettings portalSettings) { - PortalSettings = portalSettings ?? PortalController.Instance.GetCurrentPortalSettings(); + this.PortalSettings = portalSettings ?? PortalController.Instance.GetCurrentPortalSettings(); } private void DetermineUser(UserInfo user) { - AccessingUser = HttpContext.Current != null ? (UserInfo)HttpContext.Current.Items["UserInfo"] : new UserInfo(); - User = user ?? AccessingUser; + this.AccessingUser = HttpContext.Current != null ? (UserInfo)HttpContext.Current.Items["UserInfo"] : new UserInfo(); + this.User = user ?? this.AccessingUser; } private void DetermineLanguage(string language) { - Language = string.IsNullOrEmpty(language) ? new Localization.Localization().CurrentUICulture : language; + this.Language = string.IsNullOrEmpty(language) ? new Localization.Localization().CurrentUICulture : language; } private void DetermineModule(int moduleID) { if (moduleID != Null.NullInteger) - ModuleId = moduleID; - } - - /// - /// Gets/sets the current ModuleID to be used for 'User:' token replacement - /// - /// ModuleID (Integer) + { + this.ModuleId = moduleID; + } + } + + /// + /// Gets/sets the current ModuleID to be used for 'User:' token replacement + /// + /// ModuleID (Integer) public int ModuleId { get => TokenContext.Module?.ModuleID ?? Null.NullInteger; set => TokenContext.Module = GetModule(value); - } - + } + private ModuleInfo GetModule(int moduleId) { if (moduleId == TokenContext.Module?.ModuleID) @@ -136,166 +139,166 @@ private ModuleInfo GetModule(int moduleId) return ModuleController.Instance.GetModule(ModuleId, tab.TabID, false); return ModuleController.Instance.GetModule(ModuleId, Null.NullInteger, true); - } - - /// - /// Gets/sets the module settings object to use for 'Module:' token replacement - /// + } + + /// + /// Gets/sets the module settings object to use for 'Module:' token replacement + /// public ModuleInfo ModuleInfo { get => TokenContext.Module; set => TokenContext.Module = value; } - - /// - /// Gets/sets the portal settings object to use for 'Portal:' token replacement - /// - /// PortalSettings oject + + /// + /// Gets/sets the portal settings object to use for 'Portal:' token replacement + /// + /// PortalSettings oject public PortalSettings PortalSettings { get => TokenContext.Portal; set => TokenContext.Portal = value; - } - - /// - /// Gets/sets the user object to use for 'User:' token replacement - /// - /// UserInfo oject + } + + /// + /// Gets/sets the user object to use for 'User:' token replacement + /// + /// UserInfo oject public UserInfo User { get => TokenContext.User; set => TokenContext.User = value; - } - - /// - /// setup context by creating appropriate objects - /// - /// - /// security is not the purpose of the initialization, this is in the responsibility of each property access class - /// - private void InitializePropertySources() - { - //Cleanup, by default "" is returned for these objects and any property - IPropertyAccess defaultPropertyAccess = new EmptyPropertyAccess(); - PropertySource["portal"] = defaultPropertyAccess; - PropertySource["tab"] = defaultPropertyAccess; - PropertySource["host"] = defaultPropertyAccess; - PropertySource["module"] = defaultPropertyAccess; - PropertySource["user"] = defaultPropertyAccess; - PropertySource["membership"] = defaultPropertyAccess; - PropertySource["profile"] = defaultPropertyAccess; - - //initialization - if (CurrentAccessLevel >= Scope.Configuration) - { - if (PortalSettings != null) - { - PropertySource["portal"] = PortalSettings; - PropertySource["tab"] = PortalSettings.ActiveTab; - } - PropertySource["host"] = new HostPropertyAccess(); - if (ModuleInfo != null) - { - PropertySource["module"] = ModuleInfo; - } - } - if (CurrentAccessLevel >= Scope.DefaultSettings && !(User == null || User.UserID == -1)) - { - PropertySource["user"] = User; - PropertySource["membership"] = new MembershipPropertyAccess(User); - PropertySource["profile"] = new ProfilePropertyAccess(User); - } - } - - /// - /// Replaces tokens in sourceText parameter with the property values - /// - /// String with [Object:Property] tokens - /// string containing replaced values - public string ReplaceEnvironmentTokens(string sourceText) - { - return ReplaceTokens(sourceText); - } - - /// - /// Replaces tokens in sourceText parameter with the property values - /// - /// String with [Object:Property] tokens - /// - /// string containing replaced values - public string ReplaceEnvironmentTokens(string sourceText, DataRow row) - { - var rowProperties = new DataRowPropertyAccess(row); - PropertySource["field"] = rowProperties; - PropertySource["row"] = rowProperties; - return ReplaceTokens(sourceText); - } - - /// - /// Replaces tokens in sourceText parameter with the property values - /// - /// String with [Object:Property] tokens - /// - /// - /// string containing replaced values - public string ReplaceEnvironmentTokens(string sourceText, ArrayList custom, string customCaption) - { - PropertySource[customCaption.ToLowerInvariant()] = new ArrayListPropertyAccess(custom); - return ReplaceTokens(sourceText); - } - - /// - /// Replaces tokens in sourceText parameter with the property values - /// - /// String with [Object:Property] tokens - /// NameValueList for replacing [custom:name] tokens, where 'custom' is specified in next param and name is either thekey or the index number in the string - /// Token name to be used inside token [custom:name] - /// string containing replaced values - public string ReplaceEnvironmentTokens(string sourceText, IDictionary custom, string customCaption) - { - PropertySource[customCaption.ToLowerInvariant()] = new DictionaryPropertyAccess(custom); - return ReplaceTokens(sourceText); - } - - /// - /// Replaces tokens in sourceText parameter with the property values - /// - /// String with [Object:Property] tokens - /// NameValueList for replacing [custom:name] tokens, where 'custom' is specified in next param and name is either thekey or the index number in the string - /// Token names to be used inside token [custom:name], where 'custom' is one of the values in the string array - /// string containing replaced values - public string ReplaceEnvironmentTokens(string sourceText, IDictionary custom, string[] customCaptions) - { - foreach (var customCaption in customCaptions) - { - PropertySource[customCaption.ToLowerInvariant()] = new DictionaryPropertyAccess(custom); - } - return ReplaceTokens(sourceText); - } - - /// - /// Replaces tokens in sourceText parameter with the property values - /// - /// String with [Object:Property] tokens - /// NameValueList for replacing [custom:name] tokens, where 'custom' is specified in next param and name is either thekey or the index number in the string - /// Token name to be used inside token [custom:name] - /// DataRow, from which field values shall be used for replacement - /// string containing replaced values - public string ReplaceEnvironmentTokens(string sourceText, ArrayList custom, string customCaption, DataRow row) - { - var rowProperties = new DataRowPropertyAccess(row); - PropertySource["field"] = rowProperties; - PropertySource["row"] = rowProperties; - PropertySource[customCaption.ToLowerInvariant()] = new ArrayListPropertyAccess(custom); - return ReplaceTokens(sourceText); - } - - /// - /// Replaces tokens in sourceText parameter with the property values, skipping environment objects - /// - /// String with [Object:Property] tokens - /// string containing replaced values - protected override string ReplaceTokens(string sourceText) - { - InitializePropertySources(); - return base.ReplaceTokens(sourceText); - } - } -} + } + + /// + /// setup context by creating appropriate objects + /// + /// + /// security is not the purpose of the initialization, this is in the responsibility of each property access class + /// + private void InitializePropertySources() + { + //Cleanup, by default "" is returned for these objects and any property + IPropertyAccess defaultPropertyAccess = new EmptyPropertyAccess(); + this.PropertySource["portal"] = defaultPropertyAccess; + this.PropertySource["tab"] = defaultPropertyAccess; + this.PropertySource["host"] = defaultPropertyAccess; + this.PropertySource["module"] = defaultPropertyAccess; + this.PropertySource["user"] = defaultPropertyAccess; + this.PropertySource["membership"] = defaultPropertyAccess; + this.PropertySource["profile"] = defaultPropertyAccess; + + //initialization + if (this.CurrentAccessLevel >= Scope.Configuration) + { + if (this.PortalSettings != null) + { + this.PropertySource["portal"] = this.PortalSettings; + this.PropertySource["tab"] = this.PortalSettings.ActiveTab; + } + this.PropertySource["host"] = new HostPropertyAccess(); + if (this.ModuleInfo != null) + { + this.PropertySource["module"] = this.ModuleInfo; + } + } + if (this.CurrentAccessLevel >= Scope.DefaultSettings && !(this.User == null || this.User.UserID == -1)) + { + this.PropertySource["user"] = this.User; + this.PropertySource["membership"] = new MembershipPropertyAccess(this.User); + this.PropertySource["profile"] = new ProfilePropertyAccess(this.User); + } + } + + /// + /// Replaces tokens in sourceText parameter with the property values + /// + /// String with [Object:Property] tokens + /// string containing replaced values + public string ReplaceEnvironmentTokens(string sourceText) + { + return this.ReplaceTokens(sourceText); + } + + /// + /// Replaces tokens in sourceText parameter with the property values + /// + /// String with [Object:Property] tokens + /// + /// string containing replaced values + public string ReplaceEnvironmentTokens(string sourceText, DataRow row) + { + var rowProperties = new DataRowPropertyAccess(row); + this.PropertySource["field"] = rowProperties; + this.PropertySource["row"] = rowProperties; + return this.ReplaceTokens(sourceText); + } + + /// + /// Replaces tokens in sourceText parameter with the property values + /// + /// String with [Object:Property] tokens + /// + /// + /// string containing replaced values + public string ReplaceEnvironmentTokens(string sourceText, ArrayList custom, string customCaption) + { + this.PropertySource[customCaption.ToLowerInvariant()] = new ArrayListPropertyAccess(custom); + return this.ReplaceTokens(sourceText); + } + + /// + /// Replaces tokens in sourceText parameter with the property values + /// + /// String with [Object:Property] tokens + /// NameValueList for replacing [custom:name] tokens, where 'custom' is specified in next param and name is either thekey or the index number in the string + /// Token name to be used inside token [custom:name] + /// string containing replaced values + public string ReplaceEnvironmentTokens(string sourceText, IDictionary custom, string customCaption) + { + this.PropertySource[customCaption.ToLowerInvariant()] = new DictionaryPropertyAccess(custom); + return this.ReplaceTokens(sourceText); + } + + /// + /// Replaces tokens in sourceText parameter with the property values + /// + /// String with [Object:Property] tokens + /// NameValueList for replacing [custom:name] tokens, where 'custom' is specified in next param and name is either thekey or the index number in the string + /// Token names to be used inside token [custom:name], where 'custom' is one of the values in the string array + /// string containing replaced values + public string ReplaceEnvironmentTokens(string sourceText, IDictionary custom, string[] customCaptions) + { + foreach (var customCaption in customCaptions) + { + this.PropertySource[customCaption.ToLowerInvariant()] = new DictionaryPropertyAccess(custom); + } + return this.ReplaceTokens(sourceText); + } + + /// + /// Replaces tokens in sourceText parameter with the property values + /// + /// String with [Object:Property] tokens + /// NameValueList for replacing [custom:name] tokens, where 'custom' is specified in next param and name is either thekey or the index number in the string + /// Token name to be used inside token [custom:name] + /// DataRow, from which field values shall be used for replacement + /// string containing replaced values + public string ReplaceEnvironmentTokens(string sourceText, ArrayList custom, string customCaption, DataRow row) + { + var rowProperties = new DataRowPropertyAccess(row); + this.PropertySource["field"] = rowProperties; + this.PropertySource["row"] = rowProperties; + this.PropertySource[customCaption.ToLowerInvariant()] = new ArrayListPropertyAccess(custom); + return this.ReplaceTokens(sourceText); + } + + /// + /// Replaces tokens in sourceText parameter with the property values, skipping environment objects + /// + /// String with [Object:Property] tokens + /// string containing replaced values + protected override string ReplaceTokens(string sourceText) + { + this.InitializePropertySources(); + return base.ReplaceTokens(sourceText); + } + } +} diff --git a/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/InstallConfig.cs b/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/InstallConfig.cs index 3ea5979c7e8..d1d799738eb 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/InstallConfig.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/InstallConfig.cs @@ -35,9 +35,9 @@ public class InstallConfig public InstallConfig() { - Portals = new List(); - Scripts = new List(); - Settings = new List(); + this.Portals = new List(); + this.Scripts = new List(); + this.Settings = new List(); } } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/PortalConfig.cs b/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/PortalConfig.cs index f8a8915427e..4e09d88e676 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/PortalConfig.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/InstallConfiguration/PortalConfig.cs @@ -34,7 +34,7 @@ public class PortalConfig public PortalConfig() { - PortAliases = new List(); + this.PortAliases = new List(); } } } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/InstallControllerImpl.cs b/DNN Platform/Library/Services/Upgrade/Internals/InstallControllerImpl.cs index 60dade1aae8..442922d9f60 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/InstallControllerImpl.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/InstallControllerImpl.cs @@ -259,7 +259,7 @@ public void SetInstallConfig(InstallConfig installConfig) public void RemoveFromInstallConfig(string xmlNodePath) { - InstallConfig config = GetInstallConfig(); + InstallConfig config = this.GetInstallConfig(); if (config == null) { return; @@ -530,7 +530,7 @@ public bool IsAvailableLanguagePack(string cultureCode) { var newCulture = new CultureInfo(cultureCode); Thread.CurrentThread.CurrentCulture = newCulture; - GetLanguagePack(downloadUrl, installFolder); + this.GetLanguagePack(downloadUrl, installFolder); return true; } return false; @@ -547,13 +547,13 @@ public CultureInfo GetCurrentLanguage() // 1. querystring - pageCulture = GetCultureFromQs(); + pageCulture = this.GetCultureFromQs(); // 2. cookie - pageCulture = GetCultureFromCookie(); + pageCulture = this.GetCultureFromCookie(); // 3. browser - pageCulture = GetCultureFromBrowser(); + pageCulture = this.GetCultureFromBrowser(); return pageCulture; } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/ActivateLicenseStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/ActivateLicenseStep.cs index 6c3efc265fe..9f2cf0fbaa0 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/ActivateLicenseStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/ActivateLicenseStep.cs @@ -18,10 +18,10 @@ public class ActivateLicenseStep : BaseInstallationStep public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; - Details = Localization.Localization.GetString("LicenseActivation", LocalInstallResourceFile); + this.Details = Localization.Localization.GetString("LicenseActivation", this.LocalInstallResourceFile); var installConfig = InstallController.Instance.GetInstallConfig(); var licenseConfig = (installConfig != null) ? installConfig.License : null; @@ -35,18 +35,18 @@ public override void Execute() if (!activationResult.ToLowerInvariant().Contains("success")) { - Errors.Add(Localization.Localization.GetString("LicenseActivation", LocalInstallResourceFile) + ": " + activationResult); + this.Errors.Add(Localization.Localization.GetString("LicenseActivation", this.LocalInstallResourceFile) + ": " + activationResult); Logger.TraceFormat("ActivateLicense Status - {0}", activationResult); } } catch (Exception ex) { - Errors.Add(Localization.Localization.GetString("LicenseActivation", LocalInstallResourceFile) + ": " + ex.Message); + this.Errors.Add(Localization.Localization.GetString("LicenseActivation", this.LocalInstallResourceFile) + ": " + ex.Message); Logger.TraceFormat("ActivateLicense Status - {0}", ex.Message); } } - Status = Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; + this.Status = this.Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; } } } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/AddFcnModeStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/AddFcnModeStep.cs index a3dff0f9667..b036f996d00 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/AddFcnModeStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/AddFcnModeStep.cs @@ -21,16 +21,16 @@ public class AddFcnModeStep : BaseInstallationStep public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; string strError = Config.AddFCNMode(Config.FcnMode.Single); if (!string.IsNullOrEmpty(strError)) { - Errors.Add(Localization.Localization.GetString("FcnMode", LocalInstallResourceFile) + ": " + strError); + this.Errors.Add(Localization.Localization.GetString("FcnMode", this.LocalInstallResourceFile) + ": " + strError); Logger.TraceFormat("Adding FcnMode : {0}", strError); } - Status = Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; + this.Status = this.Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; } } } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/BaseInstallationStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/BaseInstallationStep.cs index bd29d6755ab..dba8941daed 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/BaseInstallationStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/BaseInstallationStep.cs @@ -33,8 +33,8 @@ public abstract class BaseInstallationStep : IInstallationStep protected BaseInstallationStep() { - Percentage = 0; - Errors = new List(); + this.Percentage = 0; + this.Errors = new List(); } #region Implementation of IInstallationStep @@ -46,14 +46,14 @@ public string Details { get { - return _details; + return this._details; } set { - _details = value; - DnnInstallLogger.InstallLogInfo(_details); - if (Activity != null) - Activity(_details); + this._details = value; + DnnInstallLogger.InstallLogInfo(this._details); + if (this.Activity != null) + this.Activity(this._details); } } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/FilePermissionCheckStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/FilePermissionCheckStep.cs index 632e30fb0e1..a18ba411961 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/FilePermissionCheckStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/FilePermissionCheckStep.cs @@ -32,8 +32,8 @@ public class FilePermissionCheckStep : BaseInstallationStep /// public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; var verifiers = new List { @@ -41,18 +41,18 @@ public override void Execute() new FileSystemPermissionVerifier(HttpContext.Current.Server.MapPath("~/App_Data")) }; - Details = Localization.Localization.GetString("FolderCreateCheck", LocalInstallResourceFile) - + Localization.Localization.GetString("FileCreateCheck", LocalInstallResourceFile) - + Localization.Localization.GetString("FileDeleteCheck", LocalInstallResourceFile) - + Localization.Localization.GetString("FolderDeleteCheck", LocalInstallResourceFile); - Logger.TraceFormat("FilePermissionCheck - {0}", Details); + this.Details = Localization.Localization.GetString("FolderCreateCheck", this.LocalInstallResourceFile) + + Localization.Localization.GetString("FileCreateCheck", this.LocalInstallResourceFile) + + Localization.Localization.GetString("FileDeleteCheck", this.LocalInstallResourceFile) + + Localization.Localization.GetString("FolderDeleteCheck", this.LocalInstallResourceFile); + Logger.TraceFormat("FilePermissionCheck - {0}", this.Details); if (!verifiers.All(v => v.VerifyAll())) - Errors.Add(string.Format(Localization.Localization.GetString("StepFailed", LocalInstallResourceFile), Details)); - Percentage = 100; + this.Errors.Add(string.Format(Localization.Localization.GetString("StepFailed", this.LocalInstallResourceFile), this.Details)); + this.Percentage = 100; - Status = Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; - Logger.TraceFormat("FilePermissionCheck Status - {0}", Status); + this.Status = this.Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; + Logger.TraceFormat("FilePermissionCheck Status - {0}", this.Status); } #endregion diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/IISVerificationStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/IISVerificationStep.cs index d94e2a4e392..c2edb5adb40 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/IISVerificationStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/IISVerificationStep.cs @@ -18,27 +18,27 @@ public class IISVerificationStep : BaseInstallationStep /// public override void Execute() { - Status = StepStatus.Running; + this.Status = StepStatus.Running; - Details = Localization.Localization.GetString("CheckingIIS", LocalInstallResourceFile); + this.Details = Localization.Localization.GetString("CheckingIIS", this.LocalInstallResourceFile); // Checks for integrated pipeline mode. if (!HttpRuntime.UsingIntegratedPipeline) { - Errors.Add(Localization.Localization.GetString("IISVerificationFail", LocalInstallResourceFile)); - Status = StepStatus.Abort; + this.Errors.Add(Localization.Localization.GetString("IISVerificationFail", this.LocalInstallResourceFile)); + this.Status = StepStatus.Abort; return; } // Check for .Net Framework 4.7.2 if (!IsDotNetVersionAtLeast(461808)) { - Errors.Add(Localization.Localization.GetString("DotNetVersion472Required", LocalInstallResourceFile)); - Status = StepStatus.Abort; + this.Errors.Add(Localization.Localization.GetString("DotNetVersion472Required", this.LocalInstallResourceFile)); + this.Status = StepStatus.Abort; return; } - Status = StepStatus.Done; + this.Status = StepStatus.Done; } private static bool IsDotNetVersionAtLeast(int version) diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs index d432a7901a8..f16dc84b1b7 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InitializeHostSettingsStep.cs @@ -33,18 +33,18 @@ public class InitializeHostSettingsStep : BaseInstallationStep /// public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; - Details = Localization.Localization.GetString("InitHostSetting", LocalInstallResourceFile); + this.Details = Localization.Localization.GetString("InitHostSetting", this.LocalInstallResourceFile); var installConfig = InstallController.Instance.GetInstallConfig(); //if any super user (even deleted) is found - exit var superUsers = UserController.GetUsers(true, true, Null.NullInteger); if (superUsers != null && superUsers.Count > 0) { - Details = "..."; - Status = StepStatus.Done; + this.Details = "..."; + this.Status = StepStatus.Done; return; } @@ -79,7 +79,7 @@ public override void Execute() //Synchronise Host Folder FolderManager.Instance.Synchronize(Null.NullInteger, "", true, true); - Status = StepStatus.Done; + this.Status = StepStatus.Done; } #endregion diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallDatabaseStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallDatabaseStep.cs index b12ff454764..b74d5094a82 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallDatabaseStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallDatabaseStep.cs @@ -31,8 +31,8 @@ public class InstallDatabaseStep : BaseInstallationStep ///
    public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; var counter = 0; const int totalSteps = 6; @@ -51,32 +51,32 @@ public override void Execute() foreach (var script in installConfig.Scripts) { var scriptFile = providerPath + script + "." + defaultProvider; - var description = Localization.Localization.GetString("InstallingDataBaseScriptStep", LocalInstallResourceFile); - Details = description + Upgrade.GetFileNameWithoutExtension(scriptFile); + var description = Localization.Localization.GetString("InstallingDataBaseScriptStep", this.LocalInstallResourceFile); + this.Details = description + Upgrade.GetFileNameWithoutExtension(scriptFile); var exception = Upgrade.ExecuteScript(scriptFile, false); if (!string.IsNullOrEmpty(exception)) { - Errors.Add(exception); - Status = StepStatus.Retry; + this.Errors.Add(exception); + this.Status = StepStatus.Retry; return; } - Percentage += percentForMiniStep; + this.Percentage += percentForMiniStep; } // update the version Globals.UpdateDataBaseVersion(new Version(installConfig.Version)); - Details = Localization.Localization.GetString("InstallingMembershipDatabaseScriptStep", LocalInstallResourceFile); + this.Details = Localization.Localization.GetString("InstallingMembershipDatabaseScriptStep", this.LocalInstallResourceFile); //Optionally Install the memberRoleProvider var exceptions = Upgrade.InstallMemberRoleProvider(providerPath, false); if (!string.IsNullOrEmpty(exceptions)) { - Errors.Add(exceptions); - Status = StepStatus.Retry; + this.Errors.Add(exceptions); + this.Status = StepStatus.Retry; return; } } - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; //Step 2 - Process the Upgrade Script files var versions = new List(); @@ -88,15 +88,15 @@ public override void Execute() { var fileName = Upgrade.GetFileNameWithoutExtension(scriptFile); var version = new Version(fileName); - string description = Localization.Localization.GetString("ProcessingUpgradeScript", LocalInstallResourceFile); - Details = description + fileName; + string description = Localization.Localization.GetString("ProcessingUpgradeScript", this.LocalInstallResourceFile); + this.Details = description + fileName; bool scriptExecuted; var exceptions = Upgrade.UpgradeVersion(scriptFile, false, out scriptExecuted); if (!string.IsNullOrEmpty(exceptions)) { - Errors.Add(exceptions); - Status = StepStatus.Retry; + this.Errors.Add(exceptions); + this.Status = StepStatus.Retry; return; } @@ -105,71 +105,71 @@ public override void Execute() versions.Add(version); } - Percentage += percentForMiniStep; + this.Percentage += percentForMiniStep; } } - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; //Step 3 - Perform version specific application upgrades foreach (Version ver in versions) { - string description = Localization.Localization.GetString("UpgradingVersionApplication", LocalInstallResourceFile); - Details = description + ver; + string description = Localization.Localization.GetString("UpgradingVersionApplication", this.LocalInstallResourceFile); + this.Details = description + ver; var exceptions = Upgrade.UpgradeApplication(providerPath, ver, false); if (!string.IsNullOrEmpty(exceptions)) { - Errors.Add(exceptions); - Status = StepStatus.Retry; + this.Errors.Add(exceptions); + this.Status = StepStatus.Retry; return; } - Percentage += percentForMiniStep; + this.Percentage += percentForMiniStep; } - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; //Step 4 - Execute config file updates foreach (Version ver in versions) { - string description = Localization.Localization.GetString("UpdatingConfigFile", LocalInstallResourceFile); - Details = description + ver; + string description = Localization.Localization.GetString("UpdatingConfigFile", this.LocalInstallResourceFile); + this.Details = description + ver; var exceptions = Upgrade.UpdateConfig(providerPath, ver, false); if (!string.IsNullOrEmpty(exceptions)) { - Errors.Add(exceptions); - Status = StepStatus.Retry; + this.Errors.Add(exceptions); + this.Status = StepStatus.Retry; return; } - Percentage += percentForMiniStep; + this.Percentage += percentForMiniStep; } - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; //Step 5 - Delete files which are no longer used foreach (Version ver in versions) { - string description = Localization.Localization.GetString("DeletingOldFiles", LocalInstallResourceFile); - Details = description + ver; + string description = Localization.Localization.GetString("DeletingOldFiles", this.LocalInstallResourceFile); + this.Details = description + ver; var exceptions = Upgrade.DeleteFiles(providerPath, ver, false); if (!string.IsNullOrEmpty(exceptions)) { - Errors.Add(exceptions); - Status = StepStatus.Retry; + this.Errors.Add(exceptions); + this.Status = StepStatus.Retry; return; } - Percentage += percentForMiniStep; + this.Percentage += percentForMiniStep; } - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; //Step 6 - Perform general application upgrades - Details = Localization.Localization.GetString("UpgradingNormalApplication", LocalInstallResourceFile); + this.Details = Localization.Localization.GetString("UpgradingNormalApplication", this.LocalInstallResourceFile); Upgrade.UpgradeApplication(); //Step 7 - Save Accept DNN Terms flag HostController.Instance.Update("AcceptDnnTerms", "Y"); DataCache.ClearHostCache(true); - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; - Status = Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; + this.Status = this.Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; } #endregion diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallExtensionsStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallExtensionsStep.cs index 64d72555a32..0f9cacf31c3 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallExtensionsStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallExtensionsStep.cs @@ -32,13 +32,13 @@ public override void Execute() var packages = Upgrade.GetInstallPackages(); if (packages.Count == 0) { - Percentage = 100; - Status = StepStatus.Done; + this.Percentage = 100; + this.Status = StepStatus.Done; return; } - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; var percentForEachStep = 100 / packages.Count; var counter = 0; @@ -46,18 +46,18 @@ public override void Execute() { var file = package.Key; var packageType = package.Value.PackageType; - var message = string.Format(Localization.Localization.GetString("InstallingExtension", LocalInstallResourceFile), packageType, Path.GetFileName(file)); - Details = message; - Logger.Trace(Details); + var message = string.Format(Localization.Localization.GetString("InstallingExtension", this.LocalInstallResourceFile), packageType, Path.GetFileName(file)); + this.Details = message; + Logger.Trace(this.Details); var success = Upgrade.InstallPackage(file, packageType, false); if (!success) { - Errors.Add(message); + this.Errors.Add(message); break; } - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; } - Status = Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; + this.Status = this.Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; } #endregion diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSiteStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSiteStep.cs index 4a27d62120b..cef096adba9 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSiteStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSiteStep.cs @@ -36,8 +36,8 @@ public class InstallSiteStep : BaseInstallationStep ///
    public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; //Set Status to None @@ -49,17 +49,17 @@ public override void Execute() var counter = 0; foreach (var portal in installConfig.Portals) { - string description = Localization.Localization.GetString("CreatingSite", LocalInstallResourceFile); - Details = string.Format(description, portal.PortalName); - CreateSite(portal, installConfig); + string description = Localization.Localization.GetString("CreatingSite", this.LocalInstallResourceFile); + this.Details = string.Format(description, portal.PortalName); + this.CreateSite(portal, installConfig); counter++; - Percentage = percentForEachStep * counter++; + this.Percentage = percentForEachStep * counter++; } Globals.ResetAppStartElapseTime(); - Status = StepStatus.Done; + this.Status = StepStatus.Done; } #endregion @@ -84,8 +84,8 @@ private void CreateSite(PortalConfig portal, InstallConfig installConfig) //Verify that portal alias is not present if (PortalAliasController.Instance.GetPortalAlias(portalAlias.ToLowerInvariant()) != null) { - string description = Localization.Localization.GetString("SkipCreatingSite", LocalInstallResourceFile); - Details = string.Format(description, portalAlias); + string description = Localization.Localization.GetString("SkipCreatingSite", this.LocalInstallResourceFile); + this.Details = string.Format(description, portalAlias); return; } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs index 647dd9f4cbb..3d507a7783e 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallSuperUserStep.cs @@ -29,18 +29,18 @@ public class InstallSuperUserStep : BaseInstallationStep ///
    public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; - Details = Localization.Localization.GetString("CreateSuperUser", LocalInstallResourceFile); + this.Details = Localization.Localization.GetString("CreateSuperUser", this.LocalInstallResourceFile); var installConfig = InstallController.Instance.GetInstallConfig(); //if any super user (even deleted) is found - exit var superUsers = UserController.GetUsers(true, true, Null.NullInteger); if (superUsers != null && superUsers.Count > 0) { - Details = "..."; - Status = StepStatus.Done; + this.Details = "..."; + this.Status = StepStatus.Done; return; } @@ -83,9 +83,9 @@ public override void Execute() UserController.CreateUser(ref superUser); } - Details = Localization.Localization.GetString("CreatingSuperUser", LocalInstallResourceFile) + installConfig.SuperUser.UserName; + this.Details = Localization.Localization.GetString("CreatingSuperUser", this.LocalInstallResourceFile) + installConfig.SuperUser.UserName; - Status = StepStatus.Done; + this.Status = StepStatus.Done; } #endregion diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallVersionStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallVersionStep.cs index 45bcd055a89..6714e1f96de 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallVersionStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/InstallVersionStep.cs @@ -21,8 +21,8 @@ public class InstallVersionStep : BaseInstallationStep public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; var databaseVersion = DataProvider.Instance().GetInstallVersion(); @@ -30,11 +30,11 @@ public override void Execute() if (!string.IsNullOrEmpty(strError)) { - Errors.Add(Localization.Localization.GetString("InstallVersion", LocalInstallResourceFile) + ": " + strError); + this.Errors.Add(Localization.Localization.GetString("InstallVersion", this.LocalInstallResourceFile) + ": " + strError); Logger.TraceFormat("Adding InstallVersion : {0}", strError); } - Status = Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; + this.Status = this.Errors.Count > 0 ? StepStatus.Retry : StepStatus.Done; } } } diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/SynchConnectionStringStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/SynchConnectionStringStep.cs index 5a7113c7462..7d1c71b5e88 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/SynchConnectionStringStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/SynchConnectionStringStep.cs @@ -30,27 +30,27 @@ public class SynchConnectionStringStep : BaseInstallationStep ///
    public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; var installConfig = InstallController.Instance.GetInstallConfig(); if(installConfig == null) { - Status = StepStatus.Done; + this.Status = StepStatus.Done; return; } var connectionConfig = installConfig.Connection; if (connectionConfig == null) { - Status = StepStatus.Done; + this.Status = StepStatus.Done; return; } if (string.IsNullOrEmpty(connectionConfig.File) && string.IsNullOrEmpty(connectionConfig.Database)) { - Errors.Add(Localization.Localization.GetString("RequiresFileOrDatabase", LocalInstallResourceFile)); - Status = StepStatus.Abort; + this.Errors.Add(Localization.Localization.GetString("RequiresFileOrDatabase", this.LocalInstallResourceFile)); + this.Status = StepStatus.Abort; return; } @@ -83,9 +83,9 @@ public override void Execute() } else { - dbowner = (string.IsNullOrEmpty(GetUpgradeConnectionStringUserID())) + dbowner = (string.IsNullOrEmpty(this.GetUpgradeConnectionStringUserID())) ? connectionConfig.User + "." - : GetUpgradeConnectionStringUserID(); + : this.GetUpgradeConnectionStringUserID(); } var connectionString = builder.ToString(); @@ -116,7 +116,7 @@ public override void Execute() modified = true; } - Status = modified ? StepStatus.AppRestart : StepStatus.Done; + this.Status = modified ? StepStatus.AppRestart : StepStatus.Done; } #endregion diff --git a/DNN Platform/Library/Services/Upgrade/Internals/Steps/UpdateLanguagePackStep.cs b/DNN Platform/Library/Services/Upgrade/Internals/Steps/UpdateLanguagePackStep.cs index b6eddc839dd..fb067daaf81 100644 --- a/DNN Platform/Library/Services/Upgrade/Internals/Steps/UpdateLanguagePackStep.cs +++ b/DNN Platform/Library/Services/Upgrade/Internals/Steps/UpdateLanguagePackStep.cs @@ -33,8 +33,8 @@ public class UpdateLanguagePackStep : BaseInstallationStep ///
    public override void Execute() { - Percentage = 0; - Status = StepStatus.Running; + this.Percentage = 0; + this.Status = StepStatus.Running; var installConfig = InstallController.Instance.GetInstallConfig(); string culture = installConfig.InstallCulture; @@ -63,7 +63,7 @@ public override void Execute() } } - Status = StepStatus.Done; + this.Status = StepStatus.Done; } #endregion diff --git a/DNN Platform/Library/Services/UserProfile/UserProfilePicHandler.cs b/DNN Platform/Library/Services/UserProfile/UserProfilePicHandler.cs index abd4db815f5..e32f779dcf6 100644 --- a/DNN Platform/Library/Services/UserProfile/UserProfilePicHandler.cs +++ b/DNN Platform/Library/Services/UserProfile/UserProfilePicHandler.cs @@ -34,7 +34,7 @@ public class UserProfilePicHandler : IHttpHandler public void ProcessRequest(HttpContext context) { - SetupCulture(); + this.SetupCulture(); var userId = -1; var width = 55; @@ -71,16 +71,16 @@ public void ProcessRequest(HttpContext context) if (width > 128) { width = 128; } - CalculateSize(ref height, ref width, ref size); + this.CalculateSize(ref height, ref width, ref size); PortalSettings settings = PortalController.Instance.GetCurrentPortalSettings(); var user = UserController.Instance.GetUser(settings.PortalId, userId); IFileInfo photoFile = null; var photoLoaded = false; - if (user != null && TryGetPhotoFile(user, out photoFile)) + if (user != null && this.TryGetPhotoFile(user, out photoFile)) { - if (!IsImageExtension(photoFile.Extension)) + if (!this.IsImageExtension(photoFile.Extension)) { try { diff --git a/DNN Platform/Library/Services/UserRequest/UserRequestIPAddressController.cs b/DNN Platform/Library/Services/UserRequest/UserRequestIPAddressController.cs index 8ec21b983d5..c9c3d9c4f18 100644 --- a/DNN Platform/Library/Services/UserRequest/UserRequestIPAddressController.cs +++ b/DNN Platform/Library/Services/UserRequest/UserRequestIPAddressController.cs @@ -16,7 +16,7 @@ public class UserRequestIPAddressController : ServiceLocator protected bool DisplayControl(DNNNodeCollection objNodes) { - return ActionManager.DisplayControl(objNodes); + return this.ActionManager.DisplayControl(objNodes); } /// ----------------------------------------------------------------------------- @@ -167,9 +167,9 @@ protected bool DisplayControl(DNNNodeCollection objNodes) ///
    protected virtual void OnAction(ActionEventArgs e) { - if (Action != null) + if (this.Action != null) { - Action(this, e); + this.Action(this, e); } } @@ -182,12 +182,12 @@ protected void ProcessAction(string ActionID) int output; if (Int32.TryParse(ActionID, out output)) { - ModuleAction action = Actions.GetActionByID(output); + ModuleAction action = this.Actions.GetActionByID(output); if (action != null) { - if (!ActionManager.ProcessAction(action)) + if (!this.ActionManager.ProcessAction(action)) { - OnAction(new ActionEventArgs(action, ModuleContext.Configuration)); + this.OnAction(new ActionEventArgs(action, this.ModuleContext.Configuration)); } } } @@ -208,7 +208,7 @@ protected override void OnLoad(EventArgs e) return; } - ActionRoot.Actions.AddRange(Actions); + this.ActionRoot.Actions.AddRange(this.Actions); } catch (Exception exc) { diff --git a/DNN Platform/Library/UI/Containers/ActionButton.cs b/DNN Platform/Library/UI/Containers/ActionButton.cs index 3dd8f37b150..2628afeff9d 100644 --- a/DNN Platform/Library/UI/Containers/ActionButton.cs +++ b/DNN Platform/Library/UI/Containers/ActionButton.cs @@ -44,13 +44,13 @@ public string CommandName { get { - EnsureChildControls(); - return _ButtonList.CommandName; + this.EnsureChildControls(); + return this._ButtonList.CommandName; } set { - EnsureChildControls(); - _ButtonList.CommandName = value; + this.EnsureChildControls(); + this._ButtonList.CommandName = value; } } @@ -67,13 +67,13 @@ public string CssClass { get { - EnsureChildControls(); - return _ButtonList.CssClass; + this.EnsureChildControls(); + return this._ButtonList.CssClass; } set { - EnsureChildControls(); - _ButtonList.CssClass = value; + this.EnsureChildControls(); + this._ButtonList.CssClass = value; } } @@ -90,13 +90,13 @@ public bool DisplayLink { get { - EnsureChildControls(); - return _ButtonList.DisplayLink; + this.EnsureChildControls(); + return this._ButtonList.DisplayLink; } set { - EnsureChildControls(); - _ButtonList.DisplayLink = value; + this.EnsureChildControls(); + this._ButtonList.DisplayLink = value; } } @@ -113,13 +113,13 @@ public bool DisplayIcon { get { - EnsureChildControls(); - return _ButtonList.DisplayIcon; + this.EnsureChildControls(); + return this._ButtonList.DisplayIcon; } set { - EnsureChildControls(); - _ButtonList.DisplayIcon = value; + this.EnsureChildControls(); + this._ButtonList.DisplayIcon = value; } } @@ -136,13 +136,13 @@ public string IconFile { get { - EnsureChildControls(); - return _ButtonList.ImageURL; + this.EnsureChildControls(); + return this._ButtonList.ImageURL; } set { - EnsureChildControls(); - _ButtonList.ImageURL = value; + this.EnsureChildControls(); + this._ButtonList.ImageURL = value; } } @@ -159,13 +159,13 @@ public string ButtonSeparator { get { - EnsureChildControls(); - return _ButtonList.ButtonSeparator; + this.EnsureChildControls(); + return this._ButtonList.ButtonSeparator; } set { - EnsureChildControls(); - _ButtonList.ButtonSeparator = value; + this.EnsureChildControls(); + this._ButtonList.ButtonSeparator = value; } } @@ -180,7 +180,7 @@ public string ButtonSeparator /// ----------------------------------------------------------------------------- private void Action_Click(object sender, ActionEventArgs e) { - ProcessAction(e.Action.ID.ToString()); + this.ProcessAction(e.Action.ID.ToString()); } #endregion @@ -196,10 +196,10 @@ protected override void CreateChildControls() { base.CreateChildControls(); - _ButtonList = new ActionButtonList(); - _ButtonList.Action += Action_Click; + this._ButtonList = new ActionButtonList(); + this._ButtonList.Action += this.Action_Click; - Controls.Add(_ButtonList); + this.Controls.Add(this._ButtonList); } #endregion diff --git a/DNN Platform/Library/UI/Containers/ActionButtonList.cs b/DNN Platform/Library/UI/Containers/ActionButtonList.cs index 9f259861aea..9dfbe0ca37a 100644 --- a/DNN Platform/Library/UI/Containers/ActionButtonList.cs +++ b/DNN Platform/Library/UI/Containers/ActionButtonList.cs @@ -46,11 +46,11 @@ protected ModuleActionCollection ModuleActions { get { - if (_ModuleActions == null) + if (this._ModuleActions == null) { - _ModuleActions = ModuleControl.ModuleContext.Actions.GetActionsByCommandName(CommandName); + this._ModuleActions = this.ModuleControl.ModuleContext.Actions.GetActionsByCommandName(this.CommandName); } - return _ModuleActions; + return this._ModuleActions; } } @@ -68,11 +68,11 @@ public string ButtonSeparator { get { - return _buttonSeparator; + return this._buttonSeparator; } set { - _buttonSeparator = value; + this._buttonSeparator = value; } } @@ -86,11 +86,11 @@ public string CommandName { get { - return _commandName; + return this._commandName; } set { - _commandName = value; + this._commandName = value; } } @@ -112,11 +112,11 @@ public bool DisplayLink { get { - return _displayLink; + return this._displayLink; } set { - _displayLink = value; + this._displayLink = value; } } @@ -141,11 +141,11 @@ public ActionManager ActionManager { get { - if (_ActionManager == null) + if (this._ActionManager == null) { - _ActionManager = new ActionManager(this); + this._ActionManager = new ActionManager(this); } - return _ActionManager; + return this._ActionManager; } } @@ -168,9 +168,9 @@ public ActionManager ActionManager ///
    protected virtual void OnAction(ActionEventArgs e) { - if (Action != null) + if (this.Action != null) { - Action(this, e); + this.Action(this, e); } } @@ -186,31 +186,31 @@ protected override void OnLoad(EventArgs e) return; } - foreach (ModuleAction action in ModuleActions) + foreach (ModuleAction action in this.ModuleActions) { - if (action != null && ActionManager.IsVisible(action)) + if (action != null && this.ActionManager.IsVisible(action)) { //Create a new ActionCommandButton var actionButton = new ActionCommandButton(); //Set all the properties actionButton.ModuleAction = action; - actionButton.ModuleControl = ModuleControl; - actionButton.CommandName = CommandName; - actionButton.CssClass = CssClass; - actionButton.DisplayLink = DisplayLink; - actionButton.DisplayIcon = DisplayIcon; - actionButton.ImageUrl = ImageURL; + actionButton.ModuleControl = this.ModuleControl; + actionButton.CommandName = this.CommandName; + actionButton.CssClass = this.CssClass; + actionButton.DisplayLink = this.DisplayLink; + actionButton.DisplayIcon = this.DisplayIcon; + actionButton.ImageUrl = this.ImageURL; //Add a handler for the Action Event - actionButton.Action += ActionButtonClick; + actionButton.Action += this.ActionButtonClick; - Controls.Add(actionButton); + this.Controls.Add(actionButton); - Controls.Add(new LiteralControl(ButtonSeparator)); + this.Controls.Add(new LiteralControl(this.ButtonSeparator)); } } - Visible = (Controls.Count > 0); + this.Visible = (this.Controls.Count > 0); } #endregion @@ -223,7 +223,7 @@ protected override void OnLoad(EventArgs e) ///
    private void ActionButtonClick(object sender, ActionEventArgs e) { - OnAction(e); + this.OnAction(e); } #endregion diff --git a/DNN Platform/Library/UI/Containers/ActionCommandButton.cs b/DNN Platform/Library/UI/Containers/ActionCommandButton.cs index 8e9eb9ea7a2..8e7dc438036 100644 --- a/DNN Platform/Library/UI/Containers/ActionCommandButton.cs +++ b/DNN Platform/Library/UI/Containers/ActionCommandButton.cs @@ -48,15 +48,15 @@ public ModuleAction ModuleAction { get { - if (_ModuleAction == null) + if (this._ModuleAction == null) { - _ModuleAction = ModuleControl.ModuleContext.Actions.GetActionByCommandName(CommandName); + this._ModuleAction = this.ModuleControl.ModuleContext.Actions.GetActionByCommandName(this.CommandName); } - return _ModuleAction; + return this._ModuleAction; } set { - _ModuleAction = value; + this._ModuleAction = value; } } @@ -74,11 +74,11 @@ public ActionManager ActionManager { get { - if (_ActionManager == null) + if (this._ActionManager == null) { - _ActionManager = new ActionManager(this); + this._ActionManager = new ActionManager(this); } - return _ActionManager; + return this._ActionManager; } } @@ -107,8 +107,8 @@ protected override void CreateChildControls() base.CreateChildControls(); //Set Causes Validation and Enables ViewState to false - CausesValidation = false; - EnableViewState = false; + this.CausesValidation = false; + this.EnableViewState = false; } /// ----------------------------------------------------------------------------- @@ -118,9 +118,9 @@ protected override void CreateChildControls() /// ----------------------------------------------------------------------------- protected virtual void OnAction(ActionEventArgs e) { - if (Action != null) + if (this.Action != null) { - Action(this, e); + this.Action(this, e); } } @@ -132,9 +132,9 @@ protected virtual void OnAction(ActionEventArgs e) protected override void OnButtonClick(EventArgs e) { base.OnButtonClick(e); - if (!ActionManager.ProcessAction(ModuleAction)) + if (!this.ActionManager.ProcessAction(this.ModuleAction)) { - OnAction(new ActionEventArgs(ModuleAction, ModuleControl.ModuleContext.Configuration)); + this.OnAction(new ActionEventArgs(this.ModuleAction, this.ModuleControl.ModuleContext.Configuration)); } } @@ -147,34 +147,34 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (ModuleAction != null && ActionManager.IsVisible(ModuleAction)) + if (this.ModuleAction != null && this.ActionManager.IsVisible(this.ModuleAction)) { - Text = ModuleAction.Title; - CommandArgument = ModuleAction.ID.ToString(); + this.Text = this.ModuleAction.Title; + this.CommandArgument = this.ModuleAction.ID.ToString(); - if (DisplayIcon && (!string.IsNullOrEmpty(ModuleAction.Icon) || !string.IsNullOrEmpty(ImageUrl))) + if (this.DisplayIcon && (!string.IsNullOrEmpty(this.ModuleAction.Icon) || !string.IsNullOrEmpty(this.ImageUrl))) { - if (!string.IsNullOrEmpty(ImageUrl)) + if (!string.IsNullOrEmpty(this.ImageUrl)) { - ImageUrl = ModuleControl.ModuleContext.Configuration.ContainerPath.Substring(0, ModuleControl.ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1) + ImageUrl; + this.ImageUrl = this.ModuleControl.ModuleContext.Configuration.ContainerPath.Substring(0, this.ModuleControl.ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1) + this.ImageUrl; } else { - if (ModuleAction.Icon.IndexOf("/") > Null.NullInteger) + if (this.ModuleAction.Icon.IndexOf("/") > Null.NullInteger) { - ImageUrl = ModuleAction.Icon; + this.ImageUrl = this.ModuleAction.Icon; } else { - ImageUrl = "~/images/" + ModuleAction.Icon; + this.ImageUrl = "~/images/" + this.ModuleAction.Icon; } } } - ActionManager.GetClientScriptURL(ModuleAction, this); + this.ActionManager.GetClientScriptURL(this.ModuleAction, this); } else { - Visible = false; + this.Visible = false; } } diff --git a/DNN Platform/Library/UI/Containers/ActionManager.cs b/DNN Platform/Library/UI/Containers/ActionManager.cs index e5ebec47eea..78072d53b48 100644 --- a/DNN Platform/Library/UI/Containers/ActionManager.cs +++ b/DNN Platform/Library/UI/Containers/ActionManager.cs @@ -55,7 +55,7 @@ public class ActionManager /// ----------------------------------------------------------------------------- public ActionManager(IActionControl actionControl) { - ActionControl = actionControl; + this.ActionControl = actionControl; } #endregion @@ -81,7 +81,7 @@ protected ModuleInstanceContext ModuleContext { get { - return ActionControl.ModuleControl.ModuleContext; + return this.ActionControl.ModuleControl.ModuleContext; } } @@ -92,15 +92,15 @@ protected ModuleInstanceContext ModuleContext private void ClearCache(ModuleAction Command) { //synchronize cache - ModuleController.SynchronizeModule(ModuleContext.ModuleId); + ModuleController.SynchronizeModule(this.ModuleContext.ModuleId); //Redirect to the same page to pick up changes - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void Delete(ModuleAction Command) { - var module = ModuleController.Instance.GetModule(int.Parse(Command.CommandArgument), ModuleContext.TabId, true); + var module = ModuleController.Instance.GetModule(int.Parse(Command.CommandArgument), this.ModuleContext.TabId, true); //Check if this is the owner instance of a shared module. var user = UserController.Instance.GetCurrentUserInfo(); @@ -112,38 +112,38 @@ private void Delete(ModuleAction Command) { //HARD Delete Shared Instance ModuleController.Instance.DeleteTabModule(instance.TabID, instance.ModuleID, false); - EventLogController.Instance.AddLog(instance, PortalSettings, user.UserID, "", EventLogController.EventLogType.MODULE_DELETED); + EventLogController.Instance.AddLog(instance, this.PortalSettings, user.UserID, "", EventLogController.EventLogType.MODULE_DELETED); } } } - ModuleController.Instance.DeleteTabModule(ModuleContext.TabId, int.Parse(Command.CommandArgument), true); - EventLogController.Instance.AddLog(module, PortalSettings, user.UserID, "", EventLogController.EventLogType.MODULE_SENT_TO_RECYCLE_BIN); + ModuleController.Instance.DeleteTabModule(this.ModuleContext.TabId, int.Parse(Command.CommandArgument), true); + EventLogController.Instance.AddLog(module, this.PortalSettings, user.UserID, "", EventLogController.EventLogType.MODULE_SENT_TO_RECYCLE_BIN); //Redirect to the same page to pick up changes - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void DoAction(ModuleAction Command) { if (Command.NewWindow) { - UrlUtils.OpenNewWindow(ActionControl.ModuleControl.Control.Page, GetType(), Command.Url); + UrlUtils.OpenNewWindow(this.ActionControl.ModuleControl.Control.Page, this.GetType(), Command.Url); } else { - Response.Redirect(Command.Url, true); + this.Response.Redirect(Command.Url, true); } } private void Localize(ModuleAction Command) { - ModuleInfo sourceModule = ModuleController.Instance.GetModule(ModuleContext.ModuleId, ModuleContext.TabId, false); + ModuleInfo sourceModule = ModuleController.Instance.GetModule(this.ModuleContext.ModuleId, this.ModuleContext.TabId, false); switch (Command.CommandName) { case ModuleActionType.LocalizeModule: - ModuleController.Instance.LocalizeModule(sourceModule, LocaleController.Instance.GetCurrentLocale(ModuleContext.PortalId)); + ModuleController.Instance.LocalizeModule(sourceModule, LocaleController.Instance.GetCurrentLocale(this.ModuleContext.PortalId)); break; case ModuleActionType.DeLocalizeModule: ModuleController.Instance.DeLocalizeModule(sourceModule); @@ -151,12 +151,12 @@ private void Localize(ModuleAction Command) } // Redirect to the same page to pick up changes - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void Translate(ModuleAction Command) { - ModuleInfo sourceModule = ModuleController.Instance.GetModule(ModuleContext.ModuleId, ModuleContext.TabId, false); + ModuleInfo sourceModule = ModuleController.Instance.GetModule(this.ModuleContext.ModuleId, this.ModuleContext.TabId, false); switch (Command.CommandName) { case ModuleActionType.TranslateModule: @@ -168,16 +168,16 @@ private void Translate(ModuleAction Command) } // Redirect to the same page to pick up changes - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void MoveToPane(ModuleAction Command) { - ModuleController.Instance.UpdateModuleOrder(ModuleContext.TabId, ModuleContext.ModuleId, -1, Command.CommandArgument); - ModuleController.Instance.UpdateTabModuleOrder(ModuleContext.TabId); + ModuleController.Instance.UpdateModuleOrder(this.ModuleContext.TabId, this.ModuleContext.ModuleId, -1, Command.CommandArgument); + ModuleController.Instance.UpdateTabModuleOrder(this.ModuleContext.TabId); //Redirect to the same page to pick up changes - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void MoveUpDown(ModuleAction Command) @@ -185,22 +185,22 @@ private void MoveUpDown(ModuleAction Command) switch (Command.CommandName) { case ModuleActionType.MoveTop: - ModuleController.Instance.UpdateModuleOrder(ModuleContext.TabId, ModuleContext.ModuleId, 0, Command.CommandArgument); + ModuleController.Instance.UpdateModuleOrder(this.ModuleContext.TabId, this.ModuleContext.ModuleId, 0, Command.CommandArgument); break; case ModuleActionType.MoveUp: - ModuleController.Instance.UpdateModuleOrder(ModuleContext.TabId, ModuleContext.ModuleId, ModuleContext.Configuration.ModuleOrder - 3, Command.CommandArgument); + ModuleController.Instance.UpdateModuleOrder(this.ModuleContext.TabId, this.ModuleContext.ModuleId, this.ModuleContext.Configuration.ModuleOrder - 3, Command.CommandArgument); break; case ModuleActionType.MoveDown: - ModuleController.Instance.UpdateModuleOrder(ModuleContext.TabId, ModuleContext.ModuleId, ModuleContext.Configuration.ModuleOrder + 3, Command.CommandArgument); + ModuleController.Instance.UpdateModuleOrder(this.ModuleContext.TabId, this.ModuleContext.ModuleId, this.ModuleContext.Configuration.ModuleOrder + 3, Command.CommandArgument); break; case ModuleActionType.MoveBottom: - ModuleController.Instance.UpdateModuleOrder(ModuleContext.TabId, ModuleContext.ModuleId, (ModuleContext.Configuration.PaneModuleCount * 2) + 1, Command.CommandArgument); + ModuleController.Instance.UpdateModuleOrder(this.ModuleContext.TabId, this.ModuleContext.ModuleId, (this.ModuleContext.Configuration.PaneModuleCount * 2) + 1, Command.CommandArgument); break; } - ModuleController.Instance.UpdateTabModuleOrder(ModuleContext.TabId); + ModuleController.Instance.UpdateTabModuleOrder(this.ModuleContext.TabId); //Redirect to the same page to pick up changes - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } #endregion @@ -215,7 +215,7 @@ private void MoveUpDown(ModuleAction Command) /// ----------------------------------------------------------------------------- public bool DisplayControl(DNNNodeCollection objNodes) { - if (objNodes != null && objNodes.Count > 0 && PortalSettings.UserMode != PortalSettings.Mode.View) + if (objNodes != null && objNodes.Count > 0 && this.PortalSettings.UserMode != PortalSettings.Mode.View) { DNNNode objRootNode = objNodes[0]; if (objRootNode.HasNodes && objRootNode.DNNNodes.Count == 0) @@ -247,7 +247,7 @@ public bool DisplayControl(DNNNodeCollection objNodes) /// ----------------------------------------------------------------------------- public ModuleAction GetAction(string commandName) { - return ActionControl.ModuleControl.ModuleContext.Actions.GetActionByCommandName(commandName); + return this.ActionControl.ModuleControl.ModuleContext.Actions.GetActionByCommandName(commandName); } /// ----------------------------------------------------------------------------- @@ -258,7 +258,7 @@ public ModuleAction GetAction(string commandName) /// ----------------------------------------------------------------------------- public ModuleAction GetAction(int id) { - return ActionControl.ModuleControl.ModuleContext.Actions.GetActionByID(id); + return this.ActionControl.ModuleControl.ModuleContext.Actions.GetActionByID(id); } /// ----------------------------------------------------------------------------- @@ -293,9 +293,9 @@ public void GetClientScriptURL(ModuleAction action, WebControl control) public bool IsVisible(ModuleAction action) { bool _IsVisible = false; - if (action.Visible && ModulePermissionController.HasModuleAccess(action.Secure, Null.NullString, ModuleContext.Configuration)) + if (action.Visible && ModulePermissionController.HasModuleAccess(action.Secure, Null.NullString, this.ModuleContext.Configuration)) { - if ((ModuleContext.PortalSettings.UserMode == PortalSettings.Mode.Edit) || (action.Secure == SecurityAccessLevel.Anonymous || action.Secure == SecurityAccessLevel.View)) + if ((this.ModuleContext.PortalSettings.UserMode == PortalSettings.Mode.Edit) || (action.Secure == SecurityAccessLevel.Anonymous || action.Secure == SecurityAccessLevel.View)) { _IsVisible = true; } @@ -323,7 +323,7 @@ public bool ProcessAction(string id) int nid = 0; if (Int32.TryParse(id, out nid)) { - bProcessed = ProcessAction(ActionControl.ModuleControl.ModuleContext.Actions.GetActionByID(nid)); + bProcessed = this.ProcessAction(this.ActionControl.ModuleControl.ModuleContext.Actions.GetActionByID(nid)); } return bProcessed; } @@ -340,49 +340,49 @@ public bool ProcessAction(ModuleAction action) switch (action.CommandName) { case ModuleActionType.ModuleHelp: - DoAction(action); + this.DoAction(action); break; case ModuleActionType.OnlineHelp: - DoAction(action); + this.DoAction(action); break; case ModuleActionType.ModuleSettings: - DoAction(action); + this.DoAction(action); break; case ModuleActionType.DeleteModule: - Delete(action); + this.Delete(action); break; case ModuleActionType.PrintModule: case ModuleActionType.SyndicateModule: - DoAction(action); + this.DoAction(action); break; case ModuleActionType.ClearCache: - ClearCache(action); + this.ClearCache(action); break; case ModuleActionType.MovePane: - MoveToPane(action); + this.MoveToPane(action); break; case ModuleActionType.MoveTop: case ModuleActionType.MoveUp: case ModuleActionType.MoveDown: case ModuleActionType.MoveBottom: - MoveUpDown(action); + this.MoveUpDown(action); break; case ModuleActionType.LocalizeModule: - Localize(action); + this.Localize(action); break; case ModuleActionType.DeLocalizeModule: - Localize(action); + this.Localize(action); break; case ModuleActionType.TranslateModule: - Translate(action); + this.Translate(action); break; case ModuleActionType.UnTranslateModule: - Translate(action); + this.Translate(action); break; default: //custom action if (!String.IsNullOrEmpty(action.Url) && action.UseActionEvent == false) { - DoAction(action); + this.DoAction(action); } else { diff --git a/DNN Platform/Library/UI/Containers/ActionsMenu.cs b/DNN Platform/Library/UI/Containers/ActionsMenu.cs index 41674d6a9af..2d5fc32cb5c 100644 --- a/DNN Platform/Library/UI/Containers/ActionsMenu.cs +++ b/DNN Platform/Library/UI/Containers/ActionsMenu.cs @@ -56,11 +56,11 @@ protected ModuleAction ActionRoot { get { - if (_ActionRoot == null) + if (this._ActionRoot == null) { - _ActionRoot = new ModuleAction(ModuleControl.ModuleContext.GetNextActionID(), " ", "", "", "action.gif"); + this._ActionRoot = new ModuleAction(this.ModuleControl.ModuleContext.GetNextActionID(), " ", "", "", "action.gif"); } - return _ActionRoot; + return this._ActionRoot; } } @@ -74,7 +74,7 @@ protected NavigationProvider ProviderControl { get { - return _ProviderControl; + return this._ProviderControl; } } @@ -92,15 +92,15 @@ public int ExpandDepth { get { - if (PopulateNodesFromClient == false || ProviderControl.SupportsPopulateOnDemand == false) + if (this.PopulateNodesFromClient == false || this.ProviderControl.SupportsPopulateOnDemand == false) { return -1; } - return _ExpandDepth; + return this._ExpandDepth; } set { - _ExpandDepth = value; + this._ExpandDepth = value; } } @@ -130,11 +130,11 @@ public string ProviderName { get { - return _ProviderName; + return this._ProviderName; } set { - _ProviderName = value; + this._ProviderName = value; } } @@ -152,11 +152,11 @@ public ActionManager ActionManager { get { - if (_ActionManager == null) + if (this._ActionManager == null) { - _ActionManager = new ActionManager(this); + this._ActionManager = new ActionManager(this); } - return _ActionManager; + return this._ActionManager; } } @@ -183,16 +183,16 @@ public ActionManager ActionManager /// ----------------------------------------------------------------------------- private void BindMenu(DNNNodeCollection objNodes) { - Visible = ActionManager.DisplayControl(objNodes); - if (Visible) + this.Visible = this.ActionManager.DisplayControl(objNodes); + if (this.Visible) { //since we always bind we need to clear the nodes for providers that maintain their state - ProviderControl.ClearNodes(); + this.ProviderControl.ClearNodes(); foreach (DNNNode objNode in objNodes) { - ProcessNodes(objNode); + this.ProcessNodes(objNode); } - ProviderControl.Bind(objNodes); + this.ProviderControl.Bind(objNodes); } } @@ -206,11 +206,11 @@ private void ProcessNodes(DNNNode objParent) { if (!String.IsNullOrEmpty(objParent.JSFunction)) { - objParent.JSFunction = string.Format("if({0}){{{1}}};", objParent.JSFunction, Page.ClientScript.GetPostBackEventReference(ProviderControl.NavigationControl, objParent.ID)); + objParent.JSFunction = string.Format("if({0}){{{1}}};", objParent.JSFunction, this.Page.ClientScript.GetPostBackEventReference(this.ProviderControl.NavigationControl, objParent.ID)); } foreach (DNNNode objNode in objParent.DNNNodes) { - ProcessNodes(objNode); + this.ProcessNodes(objNode); } } @@ -224,28 +224,28 @@ private void SetMenuDefaults() try { //--- original page set attributes --- - ProviderControl.StyleIconWidth = 15; - ProviderControl.MouseOutHideDelay = 500; - ProviderControl.MouseOverAction = NavigationProvider.HoverAction.Expand; - ProviderControl.MouseOverDisplay = NavigationProvider.HoverDisplay.None; + this.ProviderControl.StyleIconWidth = 15; + this.ProviderControl.MouseOutHideDelay = 500; + this.ProviderControl.MouseOverAction = NavigationProvider.HoverAction.Expand; + this.ProviderControl.MouseOverDisplay = NavigationProvider.HoverDisplay.None; //style sheet settings - ProviderControl.CSSControl = "ModuleTitle_MenuBar"; - ProviderControl.CSSContainerRoot = "ModuleTitle_MenuContainer"; - ProviderControl.CSSNode = "ModuleTitle_MenuItem"; - ProviderControl.CSSIcon = "ModuleTitle_MenuIcon"; - ProviderControl.CSSContainerSub = "ModuleTitle_SubMenu"; - ProviderControl.CSSBreak = "ModuleTitle_MenuBreak"; - ProviderControl.CSSNodeHover = "ModuleTitle_MenuItemSel"; - ProviderControl.CSSIndicateChildSub = "ModuleTitle_MenuArrow"; - ProviderControl.CSSIndicateChildRoot = "ModuleTitle_RootMenuArrow"; + this.ProviderControl.CSSControl = "ModuleTitle_MenuBar"; + this.ProviderControl.CSSContainerRoot = "ModuleTitle_MenuContainer"; + this.ProviderControl.CSSNode = "ModuleTitle_MenuItem"; + this.ProviderControl.CSSIcon = "ModuleTitle_MenuIcon"; + this.ProviderControl.CSSContainerSub = "ModuleTitle_SubMenu"; + this.ProviderControl.CSSBreak = "ModuleTitle_MenuBreak"; + this.ProviderControl.CSSNodeHover = "ModuleTitle_MenuItemSel"; + this.ProviderControl.CSSIndicateChildSub = "ModuleTitle_MenuArrow"; + this.ProviderControl.CSSIndicateChildRoot = "ModuleTitle_RootMenuArrow"; - ProviderControl.PathImage = Globals.ApplicationPath + "/Images/"; - ProviderControl.PathSystemImage = Globals.ApplicationPath + "/Images/"; - ProviderControl.IndicateChildImageSub = "action_right.gif"; - ProviderControl.IndicateChildren = true; - ProviderControl.StyleRoot = "background-color: Transparent; font-size: 1pt;"; - ProviderControl.NodeClick += MenuItem_Click; + this.ProviderControl.PathImage = Globals.ApplicationPath + "/Images/"; + this.ProviderControl.PathSystemImage = Globals.ApplicationPath + "/Images/"; + this.ProviderControl.IndicateChildImageSub = "action_right.gif"; + this.ProviderControl.IndicateChildren = true; + this.ProviderControl.StyleRoot = "background-color: Transparent; font-size: 1pt;"; + this.ProviderControl.NodeClick += this.MenuItem_Click; } catch (Exception exc) //Module failed to load { @@ -264,7 +264,7 @@ private void SetMenuDefaults() /// ----------------------------------------------------------------------------- protected void BindMenu() { - BindMenu(Navigation.GetActionNodes(ActionRoot, this, ExpandDepth)); + this.BindMenu(Navigation.GetActionNodes(this.ActionRoot, this, this.ExpandDepth)); } /// ----------------------------------------------------------------------------- @@ -274,9 +274,9 @@ protected void BindMenu() /// ----------------------------------------------------------------------------- protected virtual void OnAction(ActionEventArgs e) { - if (Action != null) + if (this.Action != null) { - Action(this, e); + this.Action(this, e); } } @@ -287,12 +287,12 @@ protected virtual void OnAction(ActionEventArgs e) /// ----------------------------------------------------------------------------- protected override void OnInit(EventArgs e) { - _ProviderControl = NavigationProvider.Instance(ProviderName); - ProviderControl.PopulateOnDemand += ProviderControl_PopulateOnDemand; + this._ProviderControl = NavigationProvider.Instance(this.ProviderName); + this.ProviderControl.PopulateOnDemand += this.ProviderControl_PopulateOnDemand; base.OnInit(e); - ProviderControl.ControlID = "ctl" + ID; - ProviderControl.Initialize(); - Controls.Add(ProviderControl.NavigationControl); + this.ProviderControl.ControlID = "ctl" + this.ID; + this.ProviderControl.Initialize(); + this.Controls.Add(this.ProviderControl.NavigationControl); } /// ----------------------------------------------------------------------------- @@ -305,10 +305,10 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); //Add the Actions to the Action Root - ActionRoot.Actions.AddRange(ModuleControl.ModuleContext.Actions); + this.ActionRoot.Actions.AddRange(this.ModuleControl.ModuleContext.Actions); //Set Menu Defaults - SetMenuDefaults(); + this.SetMenuDefaults(); } /// ----------------------------------------------------------------------------- @@ -319,7 +319,7 @@ protected override void OnLoad(EventArgs e) protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - BindMenu(); + this.BindMenu(); } #endregion @@ -335,10 +335,10 @@ private void MenuItem_Click(NavigationEventArgs args) { if (Globals.NumberMatchRegex.IsMatch(args.ID)) { - ModuleAction action = ModuleControl.ModuleContext.Actions.GetActionByID(Convert.ToInt32(args.ID)); - if (!ActionManager.ProcessAction(action)) + ModuleAction action = this.ModuleControl.ModuleContext.Actions.GetActionByID(Convert.ToInt32(args.ID)); + if (!this.ActionManager.ProcessAction(action)) { - OnAction(new ActionEventArgs(action, ModuleControl.ModuleContext.Configuration)); + this.OnAction(new ActionEventArgs(action, this.ModuleControl.ModuleContext.Configuration)); } } } @@ -350,20 +350,20 @@ private void MenuItem_Click(NavigationEventArgs args) /// ----------------------------------------------------------------------------- private void ProviderControl_PopulateOnDemand(NavigationEventArgs args) { - SetMenuDefaults(); - ActionRoot.Actions.AddRange(ModuleControl.ModuleContext.Actions); //Modules how add custom actions in control lifecycle will not have those actions populated... + this.SetMenuDefaults(); + this.ActionRoot.Actions.AddRange(this.ModuleControl.ModuleContext.Actions); //Modules how add custom actions in control lifecycle will not have those actions populated... - ModuleAction objAction = ActionRoot; - if (ActionRoot.ID != Convert.ToInt32(args.ID)) + ModuleAction objAction = this.ActionRoot; + if (this.ActionRoot.ID != Convert.ToInt32(args.ID)) { - objAction = ModuleControl.ModuleContext.Actions.GetActionByID(Convert.ToInt32(args.ID)); + objAction = this.ModuleControl.ModuleContext.Actions.GetActionByID(Convert.ToInt32(args.ID)); } if (args.Node == null) { - args.Node = Navigation.GetActionNode(args.ID, ProviderControl.ID, objAction, this); + args.Node = Navigation.GetActionNode(args.ID, this.ProviderControl.ID, objAction, this); } - ProviderControl.ClearNodes(); //since we always bind we need to clear the nodes for providers that maintain their state - BindMenu(Navigation.GetActionNodes(objAction, args.Node, this, ExpandDepth)); + this.ProviderControl.ClearNodes(); //since we always bind we need to clear the nodes for providers that maintain their state + this.BindMenu(Navigation.GetActionNodes(objAction, args.Node, this, this.ExpandDepth)); } #endregion diff --git a/DNN Platform/Library/UI/Containers/Container.cs b/DNN Platform/Library/UI/Containers/Container.cs index a67d20e2864..92e8b40dc16 100644 --- a/DNN Platform/Library/UI/Containers/Container.cs +++ b/DNN Platform/Library/UI/Containers/Container.cs @@ -65,7 +65,7 @@ protected HtmlContainerControl ContentPane { get { - return _contentPane ?? (_contentPane = FindControl(Globals.glbDefaultPane) as HtmlContainerControl); + return this._contentPane ?? (this._contentPane = this.FindControl(Globals.glbDefaultPane) as HtmlContainerControl); } } @@ -96,9 +96,9 @@ public IModuleControl ModuleControl get { IModuleControl moduleControl = null; - if (ModuleHost != null) + if (this.ModuleHost != null) { - moduleControl = ModuleHost.ModuleControl; + moduleControl = this.ModuleHost.ModuleControl; } return moduleControl; } @@ -113,7 +113,7 @@ public ModuleInfo ModuleConfiguration { get { - return _moduleConfiguration; + return this._moduleConfiguration; } } @@ -126,7 +126,7 @@ public ModuleHost ModuleHost { get { - return _moduleHost; + return this._moduleHost; } } @@ -153,7 +153,7 @@ public string ContainerPath { get { - return TemplateSourceDirectory + "/"; + return this.TemplateSourceDirectory + "/"; } } @@ -172,7 +172,7 @@ public string ContainerPath private void AddAdministratorOnlyHighlighting(string message) { - ContentPane.Controls.Add(new LiteralControl(string.Format("
    {0}
    ", message))); + this.ContentPane.Controls.Add(new LiteralControl(string.Format("
    {0}
    ", message))); } /// ----------------------------------------------------------------------------- @@ -192,27 +192,27 @@ private void ProcessChildControls(Control control) actions = childControl as IActionControl; if (actions != null) { - actions.ModuleControl = ModuleControl; - actions.Action += ModuleActionClick; + actions.ModuleControl = this.ModuleControl; + actions.Action += this.ModuleActionClick; } //check if control is an actionLink control var actionLink = childControl as ActionLink; if (actionLink != null) { - actionLink.ModuleControl = ModuleControl; + actionLink.ModuleControl = this.ModuleControl; } //check if control is a skin control skinControl = childControl as ISkinControl; if (skinControl != null) { - skinControl.ModuleControl = ModuleControl; + skinControl.ModuleControl = this.ModuleControl; } if (childControl.HasControls()) { //recursive call for child controls - ProcessChildControls(childControl); + this.ProcessChildControls(childControl); } } } @@ -224,19 +224,19 @@ private void ProcessChildControls(Control control) ///
    private void ProcessContentPane() { - SetAlignment(); + this.SetAlignment(); - SetBackground(); + this.SetBackground(); - SetBorder(); + this.SetBorder(); //display visual indicator if module is only visible to administrators - string viewRoles = ModuleConfiguration.InheritViewPermissions - ? TabPermissionController.GetTabPermissions(ModuleConfiguration.TabID, ModuleConfiguration.PortalID).ToString("VIEW") - : ModuleConfiguration.ModulePermissions.ToString("VIEW"); + string viewRoles = this.ModuleConfiguration.InheritViewPermissions + ? TabPermissionController.GetTabPermissions(this.ModuleConfiguration.TabID, this.ModuleConfiguration.PortalID).ToString("VIEW") + : this.ModuleConfiguration.ModulePermissions.ToString("VIEW"); - string pageEditRoles = TabPermissionController.GetTabPermissions(ModuleConfiguration.TabID, ModuleConfiguration.PortalID).ToString("EDIT"); - string moduleEditRoles = ModuleConfiguration.ModulePermissions.ToString("EDIT"); + string pageEditRoles = TabPermissionController.GetTabPermissions(this.ModuleConfiguration.TabID, this.ModuleConfiguration.PortalID).ToString("EDIT"); + string moduleEditRoles = this.ModuleConfiguration.ModulePermissions.ToString("EDIT"); viewRoles = viewRoles.Replace(";", string.Empty).Trim().ToLowerInvariant(); pageEditRoles = pageEditRoles.Replace(";", string.Empty).Trim().ToLowerInvariant(); @@ -244,27 +244,27 @@ private void ProcessContentPane() var showMessage = false; var adminMessage = Null.NullString; - if (viewRoles.Equals(PortalSettings.AdministratorRoleName, StringComparison.InvariantCultureIgnoreCase) - && (moduleEditRoles.Equals(PortalSettings.AdministratorRoleName, StringComparison.InvariantCultureIgnoreCase) + if (viewRoles.Equals(this.PortalSettings.AdministratorRoleName, StringComparison.InvariantCultureIgnoreCase) + && (moduleEditRoles.Equals(this.PortalSettings.AdministratorRoleName, StringComparison.InvariantCultureIgnoreCase) || String.IsNullOrEmpty(moduleEditRoles)) - && pageEditRoles.Equals(PortalSettings.AdministratorRoleName, StringComparison.InvariantCultureIgnoreCase)) + && pageEditRoles.Equals(this.PortalSettings.AdministratorRoleName, StringComparison.InvariantCultureIgnoreCase)) { adminMessage = Localization.GetString("ModuleVisibleAdministrator.Text"); - showMessage = !ModuleConfiguration.HideAdminBorder && !Globals.IsAdminControl(); + showMessage = !this.ModuleConfiguration.HideAdminBorder && !Globals.IsAdminControl(); } - if (ModuleConfiguration.StartDate >= DateTime.Now) + if (this.ModuleConfiguration.StartDate >= DateTime.Now) { - adminMessage = string.Format(Localization.GetString("ModuleEffective.Text"), ModuleConfiguration.StartDate); + adminMessage = string.Format(Localization.GetString("ModuleEffective.Text"), this.ModuleConfiguration.StartDate); showMessage = !Globals.IsAdminControl(); } - if (ModuleConfiguration.EndDate <= DateTime.Now) + if (this.ModuleConfiguration.EndDate <= DateTime.Now) { - adminMessage = string.Format(Localization.GetString("ModuleExpired.Text"), ModuleConfiguration.EndDate); + adminMessage = string.Format(Localization.GetString("ModuleExpired.Text"), this.ModuleConfiguration.EndDate); showMessage = !Globals.IsAdminControl(); } if (showMessage) { - AddAdministratorOnlyHighlighting(adminMessage); + this.AddAdministratorOnlyHighlighting(adminMessage); } } @@ -275,16 +275,16 @@ private void ProcessContentPane() private void ProcessFooter() { //inject the footer - if (!String.IsNullOrEmpty(ModuleConfiguration.Footer)) + if (!String.IsNullOrEmpty(this.ModuleConfiguration.Footer)) { - var footer = new Literal {Text = ModuleConfiguration.Footer}; - ContentPane.Controls.Add(footer); + var footer = new Literal {Text = this.ModuleConfiguration.Footer}; + this.ContentPane.Controls.Add(footer); } //inject an end comment around the module content if (!Globals.IsAdminControl()) { - ContentPane.Controls.Add(new LiteralControl("")); + this.ContentPane.Controls.Add(new LiteralControl("")); } } @@ -297,14 +297,14 @@ private void ProcessHeader() if (!Globals.IsAdminControl()) { //inject a start comment around the module content - ContentPane.Controls.Add(new LiteralControl("")); + this.ContentPane.Controls.Add(new LiteralControl("")); } //inject the header - if (!String.IsNullOrEmpty(ModuleConfiguration.Header)) + if (!String.IsNullOrEmpty(this.ModuleConfiguration.Header)) { - var header = new Literal {Text = ModuleConfiguration.Header}; - ContentPane.Controls.Add(header); + var header = new Literal {Text = this.ModuleConfiguration.Header}; + this.ContentPane.Controls.Add(header); } } @@ -314,48 +314,48 @@ private void ProcessHeader() ///
    private void ProcessModule() { - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"Container.ProcessModule Start (TabId:{PortalSettings.ActiveTab.TabID},ModuleID: {ModuleConfiguration.ModuleDefinition.DesktopModuleID}): Module FriendlyName: '{ModuleConfiguration.ModuleDefinition.FriendlyName}')"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"Container.ProcessModule Start (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleID: {this.ModuleConfiguration.ModuleDefinition.DesktopModuleID}): Module FriendlyName: '{this.ModuleConfiguration.ModuleDefinition.FriendlyName}')"); - if (ContentPane != null) + if (this.ContentPane != null) { //Process Content Pane Attributes - ProcessContentPane(); + this.ProcessContentPane(); // always add the actions menu as the first item in the content pane. - if (InjectActionMenu && !ModuleHost.IsViewMode(ModuleConfiguration, PortalSettings) && Request.QueryString["dnnprintmode"] != "true") + if (this.InjectActionMenu && !ModuleHost.IsViewMode(this.ModuleConfiguration, this.PortalSettings) && this.Request.QueryString["dnnprintmode"] != "true") { JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ContentPane.Controls.Add(LoadControl(PortalSettings.DefaultModuleActionMenu)); + this.ContentPane.Controls.Add(this.LoadControl(this.PortalSettings.DefaultModuleActionMenu)); //register admin.css - ClientResourceManager.RegisterAdminStylesheet(Page, Globals.HostPath + "admin.css"); + ClientResourceManager.RegisterAdminStylesheet(this.Page, Globals.HostPath + "admin.css"); } //Process Module Header - ProcessHeader(); + this.ProcessHeader(); //Try to load the module control - _moduleHost = new ModuleHost(ModuleConfiguration, ParentSkin, this); - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"Container.ProcessModule Info (TabId:{PortalSettings.ActiveTab.TabID},ModuleID: {ModuleConfiguration.ModuleDefinition.DesktopModuleID}): ControlPane.Controls.Add(ModuleHost:{_moduleHost.ID})"); + this._moduleHost = new ModuleHost(this.ModuleConfiguration, this.ParentSkin, this); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"Container.ProcessModule Info (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleID: {this.ModuleConfiguration.ModuleDefinition.DesktopModuleID}): ControlPane.Controls.Add(ModuleHost:{this._moduleHost.ID})"); - ContentPane.Controls.Add(ModuleHost); + this.ContentPane.Controls.Add(this.ModuleHost); //Process Module Footer - ProcessFooter(); + this.ProcessFooter(); //Process the Action Controls - if (ModuleHost != null && ModuleControl != null) + if (this.ModuleHost != null && this.ModuleControl != null) { - ProcessChildControls(this); + this.ProcessChildControls(this); } //Add Module Stylesheets - ProcessStylesheets(ModuleHost != null); + this.ProcessStylesheets(this.ModuleHost != null); } - if (_tracelLogger.IsDebugEnabled) - _tracelLogger.Debug($"Container.ProcessModule End (TabId:{PortalSettings.ActiveTab.TabID},ModuleID: {ModuleConfiguration.ModuleDefinition.DesktopModuleID}): Module FriendlyName: '{ModuleConfiguration.ModuleDefinition.FriendlyName}')"); + if (this._tracelLogger.IsDebugEnabled) + this._tracelLogger.Debug($"Container.ProcessModule End (TabId:{this.PortalSettings.ActiveTab.TabID},ModuleID: {this.ModuleConfiguration.ModuleDefinition.DesktopModuleID}): Module FriendlyName: '{this.ModuleConfiguration.ModuleDefinition.FriendlyName}')"); } /// ----------------------------------------------------------------------------- @@ -365,14 +365,14 @@ private void ProcessModule() ///
    private void ProcessStylesheets(bool includeModuleCss) { - ClientResourceManager.RegisterStyleSheet(Page, ContainerPath + "container.css", FileOrder.Css.ContainerCss); - ClientResourceManager.RegisterStyleSheet(Page, ContainerSrc.Replace(".ascx", ".css"), FileOrder.Css.SpecificContainerCss); + ClientResourceManager.RegisterStyleSheet(this.Page, this.ContainerPath + "container.css", FileOrder.Css.ContainerCss); + ClientResourceManager.RegisterStyleSheet(this.Page, this.ContainerSrc.Replace(".ascx", ".css"), FileOrder.Css.SpecificContainerCss); //process the base class module properties if (includeModuleCss) { - string controlSrc = ModuleConfiguration.ModuleControl.ControlSrc; - string folderName = ModuleConfiguration.DesktopModule.FolderName; + string controlSrc = this.ModuleConfiguration.ModuleControl.ControlSrc; + string folderName = this.ModuleConfiguration.DesktopModule.FolderName; string stylesheet = ""; if (String.IsNullOrEmpty(folderName)==false) @@ -385,48 +385,48 @@ private void ProcessStylesheets(bool includeModuleCss) { stylesheet = Globals.ApplicationPath + "/DesktopModules/" + folderName.Replace("\\", "/") + "/module.css"; } - ClientResourceManager.RegisterStyleSheet(Page, stylesheet, FileOrder.Css.ModuleCss); + ClientResourceManager.RegisterStyleSheet(this.Page, stylesheet, FileOrder.Css.ModuleCss); } var ix = controlSrc.LastIndexOf("/", StringComparison.Ordinal); if (ix >= 0) { stylesheet = Globals.ApplicationPath + "/" + controlSrc.Substring(0, ix + 1) + "module.css"; - ClientResourceManager.RegisterStyleSheet(Page, stylesheet, FileOrder.Css.ModuleCss); + ClientResourceManager.RegisterStyleSheet(this.Page, stylesheet, FileOrder.Css.ModuleCss); } } } private void SetAlignment() { - if (!String.IsNullOrEmpty(ModuleConfiguration.Alignment)) + if (!String.IsNullOrEmpty(this.ModuleConfiguration.Alignment)) { - if (ContentPane.Attributes["class"] != null) + if (this.ContentPane.Attributes["class"] != null) { - ContentPane.Attributes["class"] = ContentPane.Attributes["class"] + " DNNAlign" + ModuleConfiguration.Alignment.ToLowerInvariant(); + this.ContentPane.Attributes["class"] = this.ContentPane.Attributes["class"] + " DNNAlign" + this.ModuleConfiguration.Alignment.ToLowerInvariant(); } else { - ContentPane.Attributes["class"] = "DNNAlign" + ModuleConfiguration.Alignment.ToLowerInvariant(); + this.ContentPane.Attributes["class"] = "DNNAlign" + this.ModuleConfiguration.Alignment.ToLowerInvariant(); } } } private void SetBackground() { - if (!String.IsNullOrEmpty(ModuleConfiguration.Color)) + if (!String.IsNullOrEmpty(this.ModuleConfiguration.Color)) { - ContentPane.Style["background-color"] = ModuleConfiguration.Color; + this.ContentPane.Style["background-color"] = this.ModuleConfiguration.Color; } } private void SetBorder() { - if (!String.IsNullOrEmpty(ModuleConfiguration.Border)) + if (!String.IsNullOrEmpty(this.ModuleConfiguration.Border)) { - ContentPane.Style["border-top"] = String.Format("{0}px #000000 solid", ModuleConfiguration.Border); - ContentPane.Style["border-bottom"] = String.Format("{0}px #000000 solid", ModuleConfiguration.Border); - ContentPane.Style["border-right"] = String.Format("{0}px #000000 solid", ModuleConfiguration.Border); - ContentPane.Style["border-left"] = String.Format("{0}px #000000 solid", ModuleConfiguration.Border); + this.ContentPane.Style["border-top"] = String.Format("{0}px #000000 solid", this.ModuleConfiguration.Border); + this.ContentPane.Style["border-bottom"] = String.Format("{0}px #000000 solid", this.ModuleConfiguration.Border); + this.ContentPane.Style["border-right"] = String.Format("{0}px #000000 solid", this.ModuleConfiguration.Border); + this.ContentPane.Style["border-left"] = String.Format("{0}px #000000 solid", this.ModuleConfiguration.Border); } } @@ -442,7 +442,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InvokeContainerEvents(ContainerEventType.OnContainerInit); + this.InvokeContainerEvents(ContainerEventType.OnContainerInit); } /// @@ -453,7 +453,7 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); - InvokeContainerEvents(ContainerEventType.OnContainerLoad); + this.InvokeContainerEvents(ContainerEventType.OnContainerLoad); } /// ----------------------------------------------------------------------------- @@ -464,7 +464,7 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - InvokeContainerEvents(ContainerEventType.OnContainerPreRender); + this.InvokeContainerEvents(ContainerEventType.OnContainerPreRender); } /// ----------------------------------------------------------------------------- @@ -475,7 +475,7 @@ protected override void OnUnload(EventArgs e) { base.OnUnload(e); - InvokeContainerEvents(ContainerEventType.OnContainerUnLoad); + this.InvokeContainerEvents(ContainerEventType.OnContainerUnLoad); } private void InvokeContainerEvents(ContainerEventType containerEventType) @@ -497,8 +497,8 @@ private void InvokeContainerEvents(ContainerEventType containerEventType) public void SetModuleConfiguration(ModuleInfo configuration) { - _moduleConfiguration = configuration; - ProcessModule(); + this._moduleConfiguration = configuration; + this.ProcessModule(); } #endregion @@ -519,7 +519,7 @@ public void SetModuleConfiguration(ModuleInfo configuration) private void ModuleActionClick(object sender, ActionEventArgs e) { //Search through the listeners - foreach (ModuleActionEventListener listener in ParentSkin.ActionEventListeners) + foreach (ModuleActionEventListener listener in this.ParentSkin.ActionEventListeners) { //If the associated module has registered a listener if (e.ModuleConfiguration.ModuleID == listener.ModuleID) diff --git a/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventArgs.cs b/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventArgs.cs index bb487906167..76bb4338be9 100644 --- a/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventArgs.cs +++ b/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventArgs.cs @@ -22,14 +22,14 @@ public class ContainerEventArgs : EventArgs public ContainerEventArgs(Container container) { - _Container = container; + this._Container = container; } public Container Container { get { - return _Container; + return this._Container; } } } diff --git a/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventListener.cs b/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventListener.cs index 611406112ab..1a1f31b0f13 100644 --- a/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventListener.cs +++ b/DNN Platform/Library/UI/Containers/EventListeners/ContainerEventListener.cs @@ -11,15 +11,15 @@ public class ContainerEventListener public ContainerEventListener(ContainerEventType type, ContainerEventHandler e) { - _Type = type; - _ContainerEvent = e; + this._Type = type; + this._ContainerEvent = e; } public ContainerEventType EventType { get { - return _Type; + return this._Type; } } @@ -27,7 +27,7 @@ public ContainerEventHandler ContainerEvent { get { - return _ContainerEvent; + return this._ContainerEvent; } } } diff --git a/DNN Platform/Library/UI/ControlPanels/ControlPanelBase.cs b/DNN Platform/Library/UI/ControlPanels/ControlPanelBase.cs index 692011818d5..4c22401afc8 100644 --- a/DNN Platform/Library/UI/ControlPanels/ControlPanelBase.cs +++ b/DNN Platform/Library/UI/ControlPanels/ControlPanelBase.cs @@ -55,7 +55,7 @@ protected bool IsVisible { get { - return PortalSettings.ControlPanelVisible; + return this.PortalSettings.ControlPanelVisible; } } @@ -82,7 +82,7 @@ protected PortalSettings.Mode UserMode { get { - return PortalSettings.UserMode; + return this.PortalSettings.UserMode; } } @@ -97,19 +97,19 @@ public string LocalResourceFile get { string fileRoot; - if (String.IsNullOrEmpty(_localResourceFile)) + if (String.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + ID; + fileRoot = this.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + this.ID; } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -215,7 +215,7 @@ protected void AddExistingModule(int moduleId, int tabId, string paneName, int p ModuleInfo objModule; int UserId = -1; - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); UserId = objUserInfo.UserID; @@ -225,12 +225,12 @@ protected void AddExistingModule(int moduleId, int tabId, string paneName, int p { //clone the module object ( to avoid creating an object reference to the data cache ) ModuleInfo objClone = objModule.Clone(); - objClone.TabID = PortalSettings.ActiveTab.TabID; + objClone.TabID = this.PortalSettings.ActiveTab.TabID; objClone.ModuleOrder = position; objClone.PaneName = paneName; objClone.Alignment = align; ModuleController.Instance.AddModule(objClone); - EventLogController.Instance.AddLog(objClone, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_CREATED); + EventLogController.Instance.AddLog(objClone, this.PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_CREATED); } } @@ -247,12 +247,12 @@ protected void AddExistingModule(int moduleId, int tabId, string paneName, int p /// ----------------------------------------------------------------------------- protected void AddNewModule(string title, int desktopModuleId, string paneName, int position, ViewPermissionType permissionType, string align) { - TabPermissionCollection objTabPermissions = PortalSettings.ActiveTab.TabPermissions; + TabPermissionCollection objTabPermissions = this.PortalSettings.ActiveTab.TabPermissions; var objPermissionController = new PermissionController(); try { DesktopModuleInfo desktopModule; - if (!DesktopModuleController.GetDesktopModules(PortalSettings.PortalId).TryGetValue(desktopModuleId, out desktopModule)) + if (!DesktopModuleController.GetDesktopModules(this.PortalSettings.PortalId).TryGetValue(desktopModuleId, out desktopModule)) { throw new ArgumentException("desktopModuleId"); } @@ -262,7 +262,7 @@ protected void AddNewModule(string title, int desktopModuleId, string paneName, Exceptions.LogException(ex); } int UserId = -1; - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); UserId = objUserInfo.UserID; @@ -271,9 +271,9 @@ protected void AddNewModule(string title, int desktopModuleId, string paneName, ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(desktopModuleId).Values) { var objModule = new ModuleInfo(); - objModule.Initialize(PortalSettings.PortalId); - objModule.PortalID = PortalSettings.PortalId; - objModule.TabID = PortalSettings.ActiveTab.TabID; + objModule.Initialize(this.PortalSettings.PortalId); + objModule.PortalID = this.PortalSettings.PortalId; + objModule.TabID = this.PortalSettings.ActiveTab.TabID; objModule.ModuleOrder = position; if (String.IsNullOrEmpty(title)) { @@ -332,7 +332,7 @@ protected void AddNewModule(string title, int desktopModuleId, string paneName, //Only Page Editors get View permissions if "Page Editors Only" continue; } - ModulePermissionInfo objModulePermission = AddModulePermission(objModule, + ModulePermissionInfo objModulePermission = this.AddModulePermission(objModule, objSystemModulePermission, objTabPermission.RoleID, objTabPermission.UserID, @@ -341,7 +341,7 @@ protected void AddNewModule(string title, int desktopModuleId, string paneName, //ensure that every EDIT permission which allows access also provides VIEW permission if (objModulePermission.PermissionKey == "EDIT" && objModulePermission.AllowAccess) { - ModulePermissionInfo objModuleViewperm = AddModulePermission(objModule, + ModulePermissionInfo objModuleViewperm = this.AddModulePermission(objModule, (PermissionInfo) arrSystemModuleViewPermissions[0], objModulePermission.RoleID, objModulePermission.UserID, @@ -361,7 +361,7 @@ protected void AddNewModule(string title, int desktopModuleId, string paneName, //create the module permission PermissionInfo objCustomModulePermission; objCustomModulePermission = (PermissionInfo) arrCustomModulePermissions[j]; - AddModulePermission(objModule, objCustomModulePermission, objTabPermission.RoleID, objTabPermission.UserID, objTabPermission.AllowAccess); + this.AddModulePermission(objModule, objCustomModulePermission, objTabPermission.RoleID, objTabPermission.UserID, objTabPermission.AllowAccess); } } } @@ -428,7 +428,7 @@ protected bool GetModulePermission(int PortalID, string FriendlyName) /// ----------------------------------------------------------------------------- protected void SetUserMode(string userMode) { - Personalization.SetProfile("Usability", "UserMode" + PortalSettings.PortalId, userMode.ToUpper()); + Personalization.SetProfile("Usability", "UserMode" + this.PortalSettings.PortalId, userMode.ToUpper()); } /// ----------------------------------------------------------------------------- @@ -439,7 +439,7 @@ protected void SetUserMode(string userMode) /// ----------------------------------------------------------------------------- protected void SetVisibleMode(bool isVisible) { - Personalization.SetProfile("Usability", "ControlPanelVisible" + PortalSettings.PortalId, isVisible.ToString()); + Personalization.SetProfile("Usability", "ControlPanelVisible" + this.PortalSettings.PortalId, isVisible.ToString()); } protected override void OnInit(EventArgs e) diff --git a/DNN Platform/Library/UI/FavIcon.cs b/DNN Platform/Library/UI/FavIcon.cs index 2771a1f582d..dcd8a883fc2 100644 --- a/DNN Platform/Library/UI/FavIcon.cs +++ b/DNN Platform/Library/UI/FavIcon.cs @@ -27,7 +27,7 @@ public class FavIcon /// The id of the portal public FavIcon(int portalId) { - _portalId = portalId; + this._portalId = portalId; } /// @@ -38,7 +38,7 @@ public FavIcon(int portalId) /// Path to the favicon file relative to portal root, or empty string when there is no favicon set public string GetSettingPath() { - return PortalController.GetPortalSetting(SettingName, _portalId, ""); + return PortalController.GetPortalSetting(SettingName, this._portalId, ""); } /// @@ -47,8 +47,8 @@ public string GetSettingPath() /// The file id or Null.NullInteger for none public void Update(int fileId) { - PortalController.UpdatePortalSetting(_portalId, SettingName, fileId != Null.NullInteger ? string.Format("FileID={0}", fileId) : "", /*clearCache*/ true); - DataCache.ClearCache(GetCacheKey(_portalId)); + PortalController.UpdatePortalSetting(this._portalId, SettingName, fileId != Null.NullInteger ? string.Format("FileID={0}", fileId) : "", /*clearCache*/ true); + DataCache.ClearCache(GetCacheKey(this._portalId)); } /// @@ -88,16 +88,16 @@ public static string GetHeaderLink(int portalId) private string GetRelativeUrl() { - var fileInfo = GetFileInfo(); + var fileInfo = this.GetFileInfo(); return fileInfo == null ? string.Empty : FileManager.Instance.GetUrl(fileInfo); } private IFileInfo GetFileInfo() { - var path = GetSettingPath(); + var path = this.GetSettingPath(); if( ! String.IsNullOrEmpty(path) ) { - return FileManager.Instance.GetFile(_portalId, path); + return FileManager.Instance.GetFile(this._portalId, path); } return null; diff --git a/DNN Platform/Library/UI/Modules/CachedModuleControl.cs b/DNN Platform/Library/UI/Modules/CachedModuleControl.cs index 7582ca95829..82ab44fe681 100644 --- a/DNN Platform/Library/UI/Modules/CachedModuleControl.cs +++ b/DNN Platform/Library/UI/Modules/CachedModuleControl.cs @@ -36,7 +36,7 @@ public class CachedModuleControl : Literal, IModuleControl /// ----------------------------------------------------------------------------- public CachedModuleControl(string cachedContent) { - Text = cachedContent; + this.Text = cachedContent; } #region IModuleControl Members @@ -65,7 +65,7 @@ public string ControlPath { get { - return TemplateSourceDirectory + "/"; + return this.TemplateSourceDirectory + "/"; } } @@ -79,7 +79,7 @@ public string ControlName { get { - return GetType().Name.Replace("_", "."); + return this.GetType().Name.Replace("_", "."); } } @@ -95,19 +95,19 @@ public string LocalResourceFile { string fileRoot; - if (string.IsNullOrEmpty(_localResourceFile)) + if (string.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = ControlPath + "/" + Localization.LocalResourceDirectory + "/" + ID; + fileRoot = this.ControlPath + "/" + Localization.LocalResourceDirectory + "/" + this.ID; } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -121,11 +121,11 @@ public ModuleInstanceContext ModuleContext { get { - if (_moduleContext == null) + if (this._moduleContext == null) { - _moduleContext = new ModuleInstanceContext(this); + this._moduleContext = new ModuleInstanceContext(this); } - return _moduleContext; + return this._moduleContext; } } diff --git a/DNN Platform/Library/UI/Modules/Html5/Html5HostControl.cs b/DNN Platform/Library/UI/Modules/Html5/Html5HostControl.cs index 2d54179e7ff..0884a779411 100644 --- a/DNN Platform/Library/UI/Modules/Html5/Html5HostControl.cs +++ b/DNN Platform/Library/UI/Modules/Html5/Html5HostControl.cs @@ -23,7 +23,7 @@ public class Html5HostControl : ModuleControlBase, IActionable public Html5HostControl(string html5File) { - _html5File = html5File; + this._html5File = html5File; } public ModuleActionCollection ModuleActions { get; private set; } @@ -32,27 +32,27 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (!(string.IsNullOrEmpty(_html5File))) + if (!(string.IsNullOrEmpty(this._html5File))) { //Check if css file exists - var cssFile = Path.ChangeExtension(_html5File, ".css"); - if (FileExists(cssFile)) + var cssFile = Path.ChangeExtension(this._html5File, ".css"); + if (this.FileExists(cssFile)) { - ClientResourceManager.RegisterStyleSheet(Page, cssFile, FileOrder.Css.DefaultPriority); + ClientResourceManager.RegisterStyleSheet(this.Page, cssFile, FileOrder.Css.DefaultPriority); } //Check if js file exists - var jsFile = Path.ChangeExtension(_html5File, ".js"); - if (FileExists(jsFile)) + var jsFile = Path.ChangeExtension(this._html5File, ".js"); + if (this.FileExists(jsFile)) { - ClientResourceManager.RegisterScript(Page, jsFile, FileOrder.Js.DefaultPriority); + ClientResourceManager.RegisterScript(this.Page, jsFile, FileOrder.Js.DefaultPriority); } - _fileContent = GetFileContent(_html5File); + this._fileContent = this.GetFileContent(this._html5File); - ModuleActions = new ModuleActionCollection(); - var tokenReplace = new Html5ModuleTokenReplace(Page, _html5File, ModuleContext, ModuleActions); - _fileContent = tokenReplace.ReplaceEnvironmentTokens(_fileContent); + this.ModuleActions = new ModuleActionCollection(); + var tokenReplace = new Html5ModuleTokenReplace(this.Page, this._html5File, this.ModuleContext, this.ModuleActions); + this._fileContent = tokenReplace.ReplaceEnvironmentTokens(this._fileContent); } //Register for Services Framework @@ -62,7 +62,7 @@ protected override void OnInit(EventArgs e) private string GetFileContent(string filepath) { var cacheKey = string.Format(DataCache.SpaModulesContentHtmlFileCacheKey, filepath); - var absoluteFilePath = Page.Server.MapPath(filepath); + var absoluteFilePath = this.Page.Server.MapPath(filepath); var cacheItemArgs = new CacheItemArgs(cacheKey, DataCache.SpaModulesHtmlFileTimeOut, DataCache.SpaModulesHtmlFileCachePriority) { @@ -77,7 +77,7 @@ private bool FileExists(string filepath) return CBO.GetCachedObject(new CacheItemArgs(cacheKey, DataCache.SpaModulesHtmlFileTimeOut, DataCache.SpaModulesHtmlFileCachePriority), - c => File.Exists(Page.Server.MapPath(filepath))); + c => File.Exists(this.Page.Server.MapPath(filepath))); } private static string GetFileContentInternal(string filepath) @@ -92,9 +92,9 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (!(string.IsNullOrEmpty(_html5File))) + if (!(string.IsNullOrEmpty(this._html5File))) { - Controls.Add(new LiteralControl(HttpUtility.HtmlDecode(_fileContent))); + this.Controls.Add(new LiteralControl(HttpUtility.HtmlDecode(this._fileContent))); } } } diff --git a/DNN Platform/Library/UI/Modules/Html5/Html5ModuleControlFactory.cs b/DNN Platform/Library/UI/Modules/Html5/Html5ModuleControlFactory.cs index dbaeadfd82b..0e0271fe0af 100644 --- a/DNN Platform/Library/UI/Modules/Html5/Html5ModuleControlFactory.cs +++ b/DNN Platform/Library/UI/Modules/Html5/Html5ModuleControlFactory.cs @@ -17,12 +17,12 @@ public override Control CreateControl(TemplateControl containerControl, string c public override Control CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) { - return CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); + return this.CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); } public override Control CreateSettingsControl(TemplateControl containerControl, ModuleInfo moduleConfiguration, string controlSrc) { - return CreateControl(containerControl, String.Empty, controlSrc); + return this.CreateControl(containerControl, String.Empty, controlSrc); } } } diff --git a/DNN Platform/Library/UI/Modules/Html5/Html5ModuleTokenReplace.cs b/DNN Platform/Library/UI/Modules/Html5/Html5ModuleTokenReplace.cs index aa95d410633..ae252760b4b 100644 --- a/DNN Platform/Library/UI/Modules/Html5/Html5ModuleTokenReplace.cs +++ b/DNN Platform/Library/UI/Modules/Html5/Html5ModuleTokenReplace.cs @@ -22,26 +22,26 @@ public class Html5ModuleTokenReplace : HtmlTokenReplace public Html5ModuleTokenReplace(Page page, string html5File, ModuleInstanceContext moduleContext, ModuleActionCollection moduleActions) : base(page) { - AccessingUser = moduleContext.PortalSettings.UserInfo; - DebugMessages = moduleContext.PortalSettings.UserMode != Entities.Portals.PortalSettings.Mode.View; - ModuleId = moduleContext.ModuleId; - PortalSettings = moduleContext.PortalSettings; + this.AccessingUser = moduleContext.PortalSettings.UserInfo; + this.DebugMessages = moduleContext.PortalSettings.UserMode != Entities.Portals.PortalSettings.Mode.View; + this.ModuleId = moduleContext.ModuleId; + this.PortalSettings = moduleContext.PortalSettings; - PropertySource["moduleaction"] = new ModuleActionsPropertyAccess(moduleContext, moduleActions); - PropertySource["resx"] = new ModuleLocalizationPropertyAccess(moduleContext, html5File); - PropertySource["modulecontext"] = new ModuleContextPropertyAccess(moduleContext); - PropertySource["request"] = new RequestPropertyAccess(page.Request); + this.PropertySource["moduleaction"] = new ModuleActionsPropertyAccess(moduleContext, moduleActions); + this.PropertySource["resx"] = new ModuleLocalizationPropertyAccess(moduleContext, html5File); + this.PropertySource["modulecontext"] = new ModuleContextPropertyAccess(moduleContext); + this.PropertySource["request"] = new RequestPropertyAccess(page.Request); // DNN-7750 var bizClass = moduleContext.Configuration.DesktopModule.BusinessControllerClass; - var businessController = GetBusinessController(bizClass); + var businessController = this.GetBusinessController(bizClass); if (businessController != null) { var tokens = businessController.GetTokens(page, moduleContext); foreach (var token in tokens) { - PropertySource.Add(token.Key, token.Value); + this.PropertySource.Add(token.Key, token.Value); } } } diff --git a/DNN Platform/Library/UI/Modules/Html5/ModuleActionsPropertyAccess.cs b/DNN Platform/Library/UI/Modules/Html5/ModuleActionsPropertyAccess.cs index dc61c6a35a7..ae23d5babd0 100644 --- a/DNN Platform/Library/UI/Modules/Html5/ModuleActionsPropertyAccess.cs +++ b/DNN Platform/Library/UI/Modules/Html5/ModuleActionsPropertyAccess.cs @@ -43,8 +43,8 @@ public class ModuleActionsPropertyAccess : JsonPropertyAccess public ModuleActionsPropertyAccess(ModuleInstanceContext moduleContext, ModuleActionCollection moduleActions) { - _moduleContext = moduleContext; - _moduleActions = moduleActions; + this._moduleContext = moduleContext; + this._moduleActions = moduleActions; } protected override string ProcessToken(ModuleActionDto model, UserInfo accessingUser, Scope accessLevel) @@ -74,7 +74,7 @@ protected override string ProcessToken(ModuleActionDto model, UserInfo accessing } } - var moduleAction = new ModuleAction(_moduleContext.GetNextActionID()) + var moduleAction = new ModuleAction(this._moduleContext.GetNextActionID()) { Title = title, Icon = model.Icon, @@ -83,7 +83,7 @@ protected override string ProcessToken(ModuleActionDto model, UserInfo accessing if (string.IsNullOrEmpty(model.Script)) { - moduleAction.Url = _moduleContext.EditUrl(model.ControlKey); + moduleAction.Url = this._moduleContext.EditUrl(model.ControlKey); } else { @@ -92,7 +92,7 @@ protected override string ProcessToken(ModuleActionDto model, UserInfo accessing string.Format("javascript:{0}", model.Script); } - _moduleActions.Add(moduleAction); + this._moduleActions.Add(moduleAction); return String.Empty; } diff --git a/DNN Platform/Library/UI/Modules/Html5/ModuleContextPropertyAccess.cs b/DNN Platform/Library/UI/Modules/Html5/ModuleContextPropertyAccess.cs index f486612bf4e..b2d1a6bf9a1 100644 --- a/DNN Platform/Library/UI/Modules/Html5/ModuleContextPropertyAccess.cs +++ b/DNN Platform/Library/UI/Modules/Html5/ModuleContextPropertyAccess.cs @@ -16,7 +16,7 @@ public class ModuleContextPropertyAccess : IPropertyAccess public ModuleContextPropertyAccess(ModuleInstanceContext moduleContext) { - _moduleContext = moduleContext; + this._moduleContext = moduleContext; } public virtual CacheLevel Cacheability @@ -29,21 +29,21 @@ public string GetProperty(string propertyName, string format, CultureInfo format switch (propertyName.ToLowerInvariant()) { case "moduleid": - return _moduleContext.ModuleId.ToString(); + return this._moduleContext.ModuleId.ToString(); case "tabmoduleid": - return _moduleContext.TabModuleId.ToString(); + return this._moduleContext.TabModuleId.ToString(); case "tabid": - return _moduleContext.TabId.ToString(); + return this._moduleContext.TabId.ToString(); case "portalid": - return _moduleContext.Configuration.OwnerPortalID.ToString(); + return this._moduleContext.Configuration.OwnerPortalID.ToString(); case "issuperuser": - return _moduleContext.PortalSettings.UserInfo.IsSuperUser.ToString(); + return this._moduleContext.PortalSettings.UserInfo.IsSuperUser.ToString(); case "editmode": - return _moduleContext.EditMode.ToString(); + return this._moduleContext.EditMode.ToString(); default: - if (_moduleContext.Settings.ContainsKey(propertyName)) + if (this._moduleContext.Settings.ContainsKey(propertyName)) { - return (string)_moduleContext.Settings[propertyName]; + return (string)this._moduleContext.Settings[propertyName]; } break; } diff --git a/DNN Platform/Library/UI/Modules/Html5/ModuleLocalizationPropertyAccess.cs b/DNN Platform/Library/UI/Modules/Html5/ModuleLocalizationPropertyAccess.cs index fd4e73f5987..027321eb216 100644 --- a/DNN Platform/Library/UI/Modules/Html5/ModuleLocalizationPropertyAccess.cs +++ b/DNN Platform/Library/UI/Modules/Html5/ModuleLocalizationPropertyAccess.cs @@ -27,8 +27,8 @@ public class ModuleLocalizationPropertyAccess : JsonPropertyAccess public ModuleHost(ModuleInfo moduleConfiguration, Skins.Skin skin, Containers.Container container) { - ID = "ModuleContent"; - Container = container; - _moduleConfiguration = moduleConfiguration; - Skin = skin; + this.ID = "ModuleContent"; + this.Container = container; + this._moduleConfiguration = moduleConfiguration; + this.Skin = skin; } #endregion @@ -96,8 +96,8 @@ public IModuleControl ModuleControl get { //Make sure the Control tree has been created - EnsureChildControls(); - return _control as IModuleControl; + this.EnsureChildControls(); + return this._control as IModuleControl; } } @@ -127,62 +127,62 @@ private bool IsVersionRequest() private void InjectVersionToTheModuleIfSupported() { - if (!(_control is IVersionableControl)) return; + if (!(this._control is IVersionableControl)) return; - var versionableControl = _control as IVersionableControl; - if (_moduleConfiguration.ModuleVersion != Null.NullInteger) + var versionableControl = this._control as IVersionableControl; + if (this._moduleConfiguration.ModuleVersion != Null.NullInteger) { - versionableControl.SetModuleVersion(_moduleConfiguration.ModuleVersion); + versionableControl.SetModuleVersion(this._moduleConfiguration.ModuleVersion); } } private void InjectModuleContent(Control content) { - if (_moduleConfiguration.IsWebSlice && !Globals.IsAdminControl()) + if (this._moduleConfiguration.IsWebSlice && !Globals.IsAdminControl()) { //Assign the class - hslice to the Drag-N-Drop Panel - CssClass = "hslice"; + this.CssClass = "hslice"; var titleLabel = new Label { CssClass = "entry-title Hidden", - Text = !string.IsNullOrEmpty(_moduleConfiguration.WebSliceTitle) ? _moduleConfiguration.WebSliceTitle : _moduleConfiguration.ModuleTitle + Text = !string.IsNullOrEmpty(this._moduleConfiguration.WebSliceTitle) ? this._moduleConfiguration.WebSliceTitle : this._moduleConfiguration.ModuleTitle }; - Controls.Add(titleLabel); + this.Controls.Add(titleLabel); var websliceContainer = new Panel {CssClass = "entry-content"}; websliceContainer.Controls.Add(content); var expiry = new HtmlGenericControl {TagName = "abbr"}; expiry.Attributes["class"] = "endtime"; - if (!Null.IsNull(_moduleConfiguration.WebSliceExpiryDate)) + if (!Null.IsNull(this._moduleConfiguration.WebSliceExpiryDate)) { - expiry.Attributes["title"] = _moduleConfiguration.WebSliceExpiryDate.ToString("o"); + expiry.Attributes["title"] = this._moduleConfiguration.WebSliceExpiryDate.ToString("o"); websliceContainer.Controls.Add(expiry); } - else if (_moduleConfiguration.EndDate < DateTime.MaxValue) + else if (this._moduleConfiguration.EndDate < DateTime.MaxValue) { - expiry.Attributes["title"] = _moduleConfiguration.EndDate.ToString("o"); + expiry.Attributes["title"] = this._moduleConfiguration.EndDate.ToString("o"); websliceContainer.Controls.Add(expiry); } var ttl = new HtmlGenericControl {TagName = "abbr"}; ttl.Attributes["class"] = "ttl"; - if (_moduleConfiguration.WebSliceTTL > 0) + if (this._moduleConfiguration.WebSliceTTL > 0) { - ttl.Attributes["title"] = _moduleConfiguration.WebSliceTTL.ToString(); + ttl.Attributes["title"] = this._moduleConfiguration.WebSliceTTL.ToString(); websliceContainer.Controls.Add(ttl); } - else if (_moduleConfiguration.CacheTime > 0) + else if (this._moduleConfiguration.CacheTime > 0) { - ttl.Attributes["title"] = (_moduleConfiguration.CacheTime/60).ToString(); + ttl.Attributes["title"] = (this._moduleConfiguration.CacheTime/60).ToString(); websliceContainer.Controls.Add(ttl); } - Controls.Add(websliceContainer); + this.Controls.Add(websliceContainer); } else { - Controls.Add(content); + this.Controls.Add(content); } } @@ -194,10 +194,10 @@ private void InjectModuleContent(Control content) private bool DisplayContent() { //module content visibility options - var content = PortalSettings.UserMode != PortalSettings.Mode.Layout; - if (Page.Request.QueryString["content"] != null) + var content = this.PortalSettings.UserMode != PortalSettings.Mode.Layout; + if (this.Page.Request.QueryString["content"] != null) { - switch (Page.Request.QueryString["Content"].ToLowerInvariant()) + switch (this.Page.Request.QueryString["Content"].ToLowerInvariant()) { case "1": case "true": @@ -254,33 +254,33 @@ private void LoadModuleControl() { try { - if (DisplayContent()) + if (this.DisplayContent()) { //if the module supports caching and caching is enabled for the instance and the user does not have Edit rights or is currently in View mode - if (SupportsCaching() && IsViewMode(_moduleConfiguration, PortalSettings) && !IsVersionRequest()) + if (this.SupportsCaching() && IsViewMode(this._moduleConfiguration, this.PortalSettings) && !this.IsVersionRequest()) { //attempt to load the cached content - _isCached = TryLoadCached(); + this._isCached = this.TryLoadCached(); } - if (!_isCached) + if (!this._isCached) { // load the control dynamically - _control = _moduleControlPipeline.LoadModuleControl(Page, _moduleConfiguration); + this._control = this._moduleControlPipeline.LoadModuleControl(this.Page, this._moduleConfiguration); } } else //content placeholder { - _control = _moduleControlPipeline.CreateModuleControl(_moduleConfiguration); + this._control = this._moduleControlPipeline.CreateModuleControl(this._moduleConfiguration); } - if (Skin != null) + if (this.Skin != null) { //check for IMC - Skin.Communicator.LoadCommunicator(_control); + this.Skin.Communicator.LoadCommunicator(this._control); } //add module settings - ModuleControl.ModuleContext.Configuration = _moduleConfiguration; + this.ModuleControl.ModuleContext.Configuration = this._moduleConfiguration; } catch (ThreadAbortException exc) { @@ -293,12 +293,12 @@ private void LoadModuleControl() Logger.Error(exc); //add module settings - _control = _moduleControlPipeline.CreateModuleControl(_moduleConfiguration); - ModuleControl.ModuleContext.Configuration = _moduleConfiguration; + this._control = this._moduleControlPipeline.CreateModuleControl(this._moduleConfiguration); + this.ModuleControl.ModuleContext.Configuration = this._moduleConfiguration; if (TabPermissionController.CanAdminPage()) { //only display the error to page administrators - Exceptions.ProcessModuleLoadException(_control, exc); + Exceptions.ProcessModuleLoadException(this._control, exc); } else { @@ -308,7 +308,7 @@ private void LoadModuleControl() } //Enable ViewState - _control.ViewStateMode = ViewStateMode.Enabled; + this._control.ViewStateMode = ViewStateMode.Enabled; } /// @@ -320,7 +320,7 @@ private void LoadUpdatePanel() AJAX.RegisterScriptManager(); //enable Partial Rendering - var scriptManager = AJAX.GetScriptManager(Page); + var scriptManager = AJAX.GetScriptManager(this.Page); if (scriptManager != null) { scriptManager.EnablePartialRendering = true; @@ -330,7 +330,7 @@ private void LoadUpdatePanel() var updatePanel = new UpdatePanel { UpdateMode = UpdatePanelUpdateMode.Conditional, - ID = _control.ID + "_UP" + ID = this._control.ID + "_UP" }; //get update panel content template @@ -340,10 +340,10 @@ private void LoadUpdatePanel() InjectMessageControl(templateContainer); //inject module into update panel content template - templateContainer.Controls.Add(_control); + templateContainer.Controls.Add(this._control); //inject the update panel into the panel - InjectModuleContent(updatePanel); + this.InjectModuleContent(updatePanel); //create image for update progress control var progressTemplate = "
    "; @@ -356,7 +356,7 @@ private void LoadUpdatePanel() ProgressTemplate = new LiteralTemplate(progressTemplate) }; - Controls.Add(updateProgress); + this.Controls.Add(updateProgress); } /// ----------------------------------------------------------------------------- @@ -366,7 +366,7 @@ private void LoadUpdatePanel() /// A Boolean private bool SupportsCaching() { - return _moduleConfiguration.CacheTime > 0; + return this._moduleConfiguration.CacheTime > 0; } /// ----------------------------------------------------------------------------- @@ -380,11 +380,11 @@ private bool TryLoadCached() string cachedContent = string.Empty; try { - var cache = ModuleCachingProvider.Instance(_moduleConfiguration.GetEffectiveCacheMethod()); + var cache = ModuleCachingProvider.Instance(this._moduleConfiguration.GetEffectiveCacheMethod()); var varyBy = new SortedDictionary {{"locale", Thread.CurrentThread.CurrentUICulture.ToString()}}; - string cacheKey = cache.GenerateCacheKey(_moduleConfiguration.TabModuleID, varyBy); - byte[] cachedBytes = ModuleCachingProvider.Instance(_moduleConfiguration.GetEffectiveCacheMethod()).GetModule(_moduleConfiguration.TabModuleID, cacheKey); + string cacheKey = cache.GenerateCacheKey(this._moduleConfiguration.TabModuleID, varyBy); + byte[] cachedBytes = ModuleCachingProvider.Instance(this._moduleConfiguration.GetEffectiveCacheMethod()).GetModule(this._moduleConfiguration.TabModuleID, cacheKey); if (cachedBytes != null && cachedBytes.Length > 0) { @@ -401,8 +401,8 @@ private bool TryLoadCached() if (success) { this.RestoreCachedClientResourceRegistrations(cachedContent); - _control = _moduleControlPipeline.CreateCachedControl(cachedContent, _moduleConfiguration); - Controls.Add(_control); + this._control = this._moduleControlPipeline.CreateCachedControl(cachedContent, this._moduleConfiguration); + this.Controls.Add(this._control); } return success; } @@ -452,7 +452,7 @@ private void RestoreCachedClientResourceRegistrations(string cachedContent) priority = (int)FileOrder.Js.DefaultPriority; } - ClientResourceManager.RegisterScript(Page, filePath, priority, forceProvider); + ClientResourceManager.RegisterScript(this.Page, filePath, priority, forceProvider); break; case "CSS": if (string.IsNullOrEmpty(forceProvider)) @@ -465,7 +465,7 @@ private void RestoreCachedClientResourceRegistrations(string cachedContent) priority = (int)FileOrder.Css.DefaultPriority; } - ClientResourceManager.RegisterStyleSheet(Page, filePath, priority, forceProvider); + ClientResourceManager.RegisterStyleSheet(this.Page, filePath, priority, forceProvider); break; case "JS-LIBRARY": var args = filePath.Split(new[] { ',', }, StringSplitOptions.None); @@ -497,28 +497,28 @@ private void RestoreCachedClientResourceRegistrations(string cachedContent) ///
    protected override void CreateChildControls() { - Controls.Clear(); + this.Controls.Clear(); //Load Module Control (or cached control) - LoadModuleControl(); + this.LoadModuleControl(); //Optionally Inject AJAX Update Panel - if (ModuleControl != null) + if (this.ModuleControl != null) { //if module is dynamically loaded and AJAX is installed and the control supports partial rendering (defined in ModuleControls table ) - if (!_isCached && _moduleConfiguration.ModuleControl.SupportsPartialRendering && AJAX.IsInstalled()) + if (!this._isCached && this._moduleConfiguration.ModuleControl.SupportsPartialRendering && AJAX.IsInstalled()) { - LoadUpdatePanel(); + this.LoadUpdatePanel(); } else { //inject a message placeholder for common module messaging - UI.Skins.Skin.AddModuleMessage InjectMessageControl(this); - InjectVersionToTheModuleIfSupported(); + this.InjectVersionToTheModuleIfSupported(); //inject the module into the panel - InjectModuleContent(_control); + this.InjectModuleContent(this._control); } } } @@ -529,12 +529,12 @@ protected override void OnPreRender(EventArgs e) if (Host.EnableCustomModuleCssClass) { - string moduleName = ModuleControl.ModuleContext.Configuration.DesktopModule.ModuleName; + string moduleName = this.ModuleControl.ModuleContext.Configuration.DesktopModule.ModuleName; if (moduleName != null) { moduleName = Globals.CleanName(moduleName); } - Attributes.Add("class", string.Format("DNNModuleContent Mod{0}C", moduleName)); + this.Attributes.Add("class", string.Format("DNNModuleContent Mod{0}C", moduleName)); } } @@ -544,31 +544,31 @@ protected override void OnPreRender(EventArgs e) ///
    protected override void RenderContents(HtmlTextWriter writer) { - if (_isCached) + if (this._isCached) { //Render the cached control to the output stream base.RenderContents(writer); } else { - if (SupportsCaching() && IsViewMode(_moduleConfiguration, PortalSettings) && !Globals.IsAdminControl() && !IsVersionRequest()) + if (this.SupportsCaching() && IsViewMode(this._moduleConfiguration, this.PortalSettings) && !Globals.IsAdminControl() && !this.IsVersionRequest()) { //Render to cache var tempWriter = new StringWriter(); - _control.RenderControl(new HtmlTextWriter(tempWriter)); + this._control.RenderControl(new HtmlTextWriter(tempWriter)); string cachedOutput = tempWriter.ToString(); if (!string.IsNullOrEmpty(cachedOutput) && (!HttpContext.Current.Request.Browser.Crawler)) { //Save content to cache var moduleContent = Encoding.UTF8.GetBytes(cachedOutput); - var cache = ModuleCachingProvider.Instance(_moduleConfiguration.GetEffectiveCacheMethod()); + var cache = ModuleCachingProvider.Instance(this._moduleConfiguration.GetEffectiveCacheMethod()); var varyBy = new SortedDictionary {{"locale", Thread.CurrentThread.CurrentUICulture.ToString()}}; - var cacheKey = cache.GenerateCacheKey(_moduleConfiguration.TabModuleID, varyBy); - cache.SetModule(_moduleConfiguration.TabModuleID, cacheKey, new TimeSpan(0, 0, _moduleConfiguration.CacheTime), moduleContent); + var cacheKey = cache.GenerateCacheKey(this._moduleConfiguration.TabModuleID, varyBy); + cache.SetModule(this._moduleConfiguration.TabModuleID, cacheKey, new TimeSpan(0, 0, this._moduleConfiguration.CacheTime), moduleContent); } //Render the cached content to Response diff --git a/DNN Platform/Library/UI/Modules/ModuleInstanceContext.cs b/DNN Platform/Library/UI/Modules/ModuleInstanceContext.cs index 42796908221..aecb0227853 100644 --- a/DNN Platform/Library/UI/Modules/ModuleInstanceContext.cs +++ b/DNN Platform/Library/UI/Modules/ModuleInstanceContext.cs @@ -56,7 +56,7 @@ public ModuleInstanceContext() public ModuleInstanceContext(IModuleControl moduleControl) { - _moduleControl = moduleControl; + this._moduleControl = moduleControl; } #endregion @@ -72,15 +72,15 @@ public ModuleActionCollection Actions { get { - if (_actions == null) + if (this._actions == null) { - LoadActions(HttpContext.Current.Request); + this.LoadActions(HttpContext.Current.Request); } - return _actions; + return this._actions; } set { - _actions = value; + this._actions = value; } } @@ -93,11 +93,11 @@ public ModuleInfo Configuration { get { - return _configuration; + return this._configuration; } set { - _configuration = value; + this._configuration = value; } } @@ -133,28 +133,28 @@ public bool IsEditable { //Perform tri-state switch check to avoid having to perform a security //role lookup on every property access (instead caching the result) - if (!_isEditable.HasValue) + if (!this._isEditable.HasValue) { - bool blnPreview = (PortalSettings.UserMode == PortalSettings.Mode.View) || PortalSettings.IsLocked; - if (Globals.IsHostTab(PortalSettings.ActiveTab.TabID)) + bool blnPreview = (this.PortalSettings.UserMode == PortalSettings.Mode.View) || this.PortalSettings.IsLocked; + if (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID)) { blnPreview = false; } bool blnHasModuleEditPermissions = false; - if (_configuration != null) + if (this._configuration != null) { - blnHasModuleEditPermissions = ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "CONTENT", Configuration); + blnHasModuleEditPermissions = ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "CONTENT", this.Configuration); } if (blnPreview == false && blnHasModuleEditPermissions) { - _isEditable = true; + this._isEditable = true; } else { - _isEditable = false; + this._isEditable = false; } } - return _isEditable.Value; + return this._isEditable.Value; } } @@ -162,7 +162,7 @@ public bool IsHostMenu { get { - return Globals.IsHostTab(PortalSettings.ActiveTab.TabID); + return Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID); } } @@ -175,18 +175,18 @@ public int ModuleId { get { - if (_configuration != null) + if (this._configuration != null) { - return _configuration.ModuleID; + return this._configuration.ModuleID; } return Null.NullInteger; } set { - if (_configuration != null) + if (this._configuration != null) { - _configuration.ModuleID = value; + this._configuration.ModuleID = value; } } } @@ -195,7 +195,7 @@ public PortalAliasInfo PortalAlias { get { - return PortalSettings.PortalAlias; + return this.PortalSettings.PortalAlias; } } @@ -203,7 +203,7 @@ public int PortalId { get { - return PortalSettings.PortalId; + return this.PortalSettings.PortalId; } } @@ -224,18 +224,18 @@ public Hashtable Settings { get { - if (_settings == null) + if (this._settings == null) { - _settings = new ModuleController().GetModuleSettings(ModuleId, TabId); + this._settings = new ModuleController().GetModuleSettings(this.ModuleId, this.TabId); //add the TabModuleSettings to the ModuleSettings - Hashtable tabModuleSettings = new ModuleController().GetTabModuleSettings(TabModuleId, TabId); + Hashtable tabModuleSettings = new ModuleController().GetTabModuleSettings(this.TabModuleId, this.TabId); foreach (string strKey in tabModuleSettings.Keys) { - _settings[strKey] = tabModuleSettings[strKey]; + this._settings[strKey] = tabModuleSettings[strKey]; } } - return _settings; + return this._settings; } } @@ -248,9 +248,9 @@ public int TabId { get { - if (_configuration != null) + if (this._configuration != null) { - return Convert.ToInt32(_configuration.TabID); + return Convert.ToInt32(this._configuration.TabID); } return Null.NullInteger; @@ -266,18 +266,18 @@ public int TabModuleId { get { - if (_configuration != null) + if (this._configuration != null) { - return Convert.ToInt32(_configuration.TabModuleID); + return Convert.ToInt32(this._configuration.TabModuleID); } return Null.NullInteger; } set { - if (_configuration != null) + if (this._configuration != null) { - _configuration.TabModuleID = value; + this._configuration.TabModuleID = value; } } } @@ -297,25 +297,25 @@ private void AddHelpActions() { var url = string.Empty; var showInNewWindow = false; - if (!string.IsNullOrEmpty(Configuration.ModuleControl.HelpURL) && Host.EnableModuleOnLineHelp && PortalSettings.EnablePopUps) + if (!string.IsNullOrEmpty(this.Configuration.ModuleControl.HelpURL) && Host.EnableModuleOnLineHelp && this.PortalSettings.EnablePopUps) { - var supportInPopup = SupportShowInPopup(Configuration.ModuleControl.HelpURL); + var supportInPopup = this.SupportShowInPopup(this.Configuration.ModuleControl.HelpURL); if (supportInPopup) { - url = UrlUtils.PopUpUrl(Configuration.ModuleControl.HelpURL, PortalSettings, false, false, 550, 950); + url = UrlUtils.PopUpUrl(this.Configuration.ModuleControl.HelpURL, this.PortalSettings, false, false, 550, 950); } else { - url = Configuration.ModuleControl.HelpURL; + url = this.Configuration.ModuleControl.HelpURL; showInNewWindow = true; } } else { - url = NavigateUrl(TabId, "Help", false, "ctlid=" + Configuration.ModuleControlId, "moduleid=" + ModuleId); + url = this.NavigateUrl(this.TabId, "Help", false, "ctlid=" + this.Configuration.ModuleControlId, "moduleid=" + this.ModuleId); } - var helpAction = new ModuleAction(GetNextActionID()) + var helpAction = new ModuleAction(this.GetNextActionID()) { Title = Localization.GetString(ModuleActionType.ModuleHelp, Localization.GlobalResourceFile), CommandName = ModuleActionType.ModuleHelp, @@ -327,21 +327,21 @@ private void AddHelpActions() NewWindow = showInNewWindow, UseActionEvent = true }; - _moduleGenericActions.Actions.Add(helpAction); + this._moduleGenericActions.Actions.Add(helpAction); } private void AddPrintAction() { - var action = new ModuleAction(GetNextActionID()) + var action = new ModuleAction(this.GetNextActionID()) { Title = Localization.GetString(ModuleActionType.PrintModule, Localization.GlobalResourceFile), CommandName = ModuleActionType.PrintModule, CommandArgument = "", Icon = "action_print.gif", - Url = NavigateUrl(TabId, + Url = this.NavigateUrl(this.TabId, "", false, - "mid=" + ModuleId, + "mid=" + this.ModuleId, "SkinSrc=" + Globals.QueryStringEncode("[G]" + SkinController.RootSkin + "/" + Globals.glbHostSkinFolder + "/" + "No Skin"), "ContainerSrc=" + Globals.QueryStringEncode("[G]" + SkinController.RootContainer + "/" + Globals.glbHostSkinFolder + "/" + "No Container"), "dnnprintmode=true"), @@ -350,24 +350,24 @@ private void AddPrintAction() Visible = true, NewWindow = true }; - _moduleGenericActions.Actions.Add(action); + this._moduleGenericActions.Actions.Add(action); } private void AddSyndicateAction() { - var action = new ModuleAction(GetNextActionID()) + var action = new ModuleAction(this.GetNextActionID()) { Title = Localization.GetString(ModuleActionType.SyndicateModule, Localization.GlobalResourceFile), CommandName = ModuleActionType.SyndicateModule, CommandArgument = "", Icon = "action_rss.gif", - Url = NavigateUrl(PortalSettings.ActiveTab.TabID, "", "RSS.aspx", false, "moduleid=" + ModuleId), + Url = this.NavigateUrl(this.PortalSettings.ActiveTab.TabID, "", "RSS.aspx", false, "moduleid=" + this.ModuleId), Secure = SecurityAccessLevel.Anonymous, UseActionEvent = true, Visible = true, NewWindow = true }; - _moduleGenericActions.Actions.Add(action); + this._moduleGenericActions.Actions.Add(action); } /// ----------------------------------------------------------------------------- @@ -380,27 +380,27 @@ private void AddSyndicateAction() private void AddMenuMoveActions() { //module movement - _moduleMoveActions = new ModuleAction(GetNextActionID(), Localization.GetString(ModuleActionType.MoveRoot, Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, false); + this._moduleMoveActions = new ModuleAction(this.GetNextActionID(), Localization.GetString(ModuleActionType.MoveRoot, Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, false); //move module up/down - if (Configuration != null) + if (this.Configuration != null) { - if ((Configuration.ModuleOrder != 0) && (Configuration.PaneModuleIndex > 0)) + if ((this.Configuration.ModuleOrder != 0) && (this.Configuration.PaneModuleIndex > 0)) { - _moduleMoveActions.Actions.Add(GetNextActionID(), + this._moduleMoveActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.MoveTop, Localization.GlobalResourceFile), ModuleActionType.MoveTop, - Configuration.PaneName, + this.Configuration.PaneName, "action_top.gif", "", false, SecurityAccessLevel.View, true, false); - _moduleMoveActions.Actions.Add(GetNextActionID(), + this._moduleMoveActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.MoveUp, Localization.GlobalResourceFile), ModuleActionType.MoveUp, - Configuration.PaneName, + this.Configuration.PaneName, "action_up.gif", "", false, @@ -408,22 +408,22 @@ private void AddMenuMoveActions() true, false); } - if ((Configuration.ModuleOrder != 0) && (Configuration.PaneModuleIndex < (Configuration.PaneModuleCount - 1))) + if ((this.Configuration.ModuleOrder != 0) && (this.Configuration.PaneModuleIndex < (this.Configuration.PaneModuleCount - 1))) { - _moduleMoveActions.Actions.Add(GetNextActionID(), + this._moduleMoveActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.MoveDown, Localization.GlobalResourceFile), ModuleActionType.MoveDown, - Configuration.PaneName, + this.Configuration.PaneName, "action_down.gif", "", false, SecurityAccessLevel.View, true, false); - _moduleMoveActions.Actions.Add(GetNextActionID(), + this._moduleMoveActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.MoveBottom, Localization.GlobalResourceFile), ModuleActionType.MoveBottom, - Configuration.PaneName, + this.Configuration.PaneName, "action_bottom.gif", "", false, @@ -434,12 +434,12 @@ private void AddMenuMoveActions() } //move module to pane - foreach (object obj in PortalSettings.ActiveTab.Panes) + foreach (object obj in this.PortalSettings.ActiveTab.Panes) { var pane = obj as string; - if (!string.IsNullOrEmpty(pane) && Configuration != null && !Configuration.PaneName.Equals(pane, StringComparison.InvariantCultureIgnoreCase)) + if (!string.IsNullOrEmpty(pane) && this.Configuration != null && !this.Configuration.PaneName.Equals(pane, StringComparison.InvariantCultureIgnoreCase)) { - _moduleMoveActions.Actions.Add(GetNextActionID(), + this._moduleMoveActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.MovePane, Localization.GlobalResourceFile) + " " + pane, ModuleActionType.MovePane, pane, @@ -490,26 +490,26 @@ private static int GetActionsCount(int count, ModuleActionCollection actions) /// ----------------------------------------------------------------------------- private void LoadActions(HttpRequest request) { - _actions = new ModuleActionCollection(); - if (PortalSettings.IsLocked) + this._actions = new ModuleActionCollection(); + if (this.PortalSettings.IsLocked) { return; } - _moduleGenericActions = new ModuleAction(GetNextActionID(), Localization.GetString("ModuleGenericActions.Action", Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty); + this._moduleGenericActions = new ModuleAction(this.GetNextActionID(), Localization.GetString("ModuleGenericActions.Action", Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty); int maxActionId = Null.NullInteger; //check if module Implements Entities.Modules.IActionable interface - var actionable = _moduleControl as IActionable; + var actionable = this._moduleControl as IActionable; if (actionable != null) { - _moduleSpecificActions = new ModuleAction(GetNextActionID(), Localization.GetString("ModuleSpecificActions.Action", Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty); + this._moduleSpecificActions = new ModuleAction(this.GetNextActionID(), Localization.GetString("ModuleSpecificActions.Action", Localization.GlobalResourceFile), string.Empty, string.Empty, string.Empty); ModuleActionCollection moduleActions = actionable.ModuleActions; foreach (ModuleAction action in moduleActions) { - if (ModulePermissionController.HasModuleAccess(action.Secure, "CONTENT", Configuration)) + if (ModulePermissionController.HasModuleAccess(action.Secure, "CONTENT", this.Configuration)) { if (String.IsNullOrEmpty(action.Icon)) { @@ -519,41 +519,41 @@ private void LoadActions(HttpRequest request) { maxActionId = action.ID; } - _moduleSpecificActions.Actions.Add(action); + this._moduleSpecificActions.Actions.Add(action); - if (!UIUtilities.IsLegacyUI(ModuleId, action.ControlKey, PortalId) && action.Url.Contains("ctl")) + if (!UIUtilities.IsLegacyUI(this.ModuleId, action.ControlKey, this.PortalId) && action.Url.Contains("ctl")) { - action.ClientScript = UrlUtils.PopUpUrl(action.Url, _moduleControl as Control, PortalSettings, true, false); + action.ClientScript = UrlUtils.PopUpUrl(action.Url, this._moduleControl as Control, this.PortalSettings, true, false); } } } - if (_moduleSpecificActions.Actions.Count > 0) + if (this._moduleSpecificActions.Actions.Count > 0) { - _actions.Add(_moduleSpecificActions); + this._actions.Add(this._moduleSpecificActions); } } //Make sure the Next Action Id counter is correct - int actionCount = GetActionsCount(_actions.Count, _actions); - if (_nextActionId < maxActionId) + int actionCount = GetActionsCount(this._actions.Count, this._actions); + if (this._nextActionId < maxActionId) { - _nextActionId = maxActionId; + this._nextActionId = maxActionId; } - if (_nextActionId < actionCount) + if (this._nextActionId < actionCount) { - _nextActionId = actionCount; + this._nextActionId = actionCount; } //Custom injection of Module Settings when shared as ViewOnly - if (Configuration != null && (Configuration.IsShared && Configuration.IsShareableViewOnly) + if (this.Configuration != null && (this.Configuration.IsShared && this.Configuration.IsShareableViewOnly) && TabPermissionController.CanAddContentToPage()) { - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString("ModulePermissions.Action", Localization.GlobalResourceFile), "ModulePermissions", "", "action_settings.gif", - NavigateUrl(TabId, "ModulePermissions", false, "ModuleId=" + ModuleId, "ReturnURL=" + FilterUrl(request)), + this.NavigateUrl(this.TabId, "ModulePermissions", false, "ModuleId=" + this.ModuleId, "ReturnURL=" + FilterUrl(request)), false, SecurityAccessLevel.ViewPermissions, true, @@ -561,16 +561,16 @@ private void LoadActions(HttpRequest request) } else { - if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", Configuration)) + if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", this.Configuration)) { - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration)) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", this.Configuration)) { - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.ModuleSettings, Localization.GlobalResourceFile), ModuleActionType.ModuleSettings, "", "action_settings.gif", - NavigateUrl(TabId, "Module", false, "ModuleId=" + ModuleId, "ReturnURL=" + FilterUrl(request)), + this.NavigateUrl(this.TabId, "Module", false, "ModuleId=" + this.ModuleId, "ReturnURL=" + FilterUrl(request)), false, SecurityAccessLevel.Edit, true, @@ -579,19 +579,19 @@ private void LoadActions(HttpRequest request) } } - if (!string.IsNullOrEmpty(Configuration.DesktopModule.BusinessControllerClass)) + if (!string.IsNullOrEmpty(this.Configuration.DesktopModule.BusinessControllerClass)) { //check if module implements IPortable interface, and user has Admin permissions - if (Configuration.DesktopModule.IsPortable) + if (this.Configuration.DesktopModule.IsPortable) { - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "EXPORT", Configuration)) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "EXPORT", this.Configuration)) { - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.ExportModule, Localization.GlobalResourceFile), ModuleActionType.ExportModule, "", "action_export.gif", - NavigateUrl(PortalSettings.ActiveTab.TabID, "ExportModule", false, "moduleid=" + ModuleId, "ReturnURL=" + FilterUrl(request)), + this.NavigateUrl(this.PortalSettings.ActiveTab.TabID, "ExportModule", false, "moduleid=" + this.ModuleId, "ReturnURL=" + FilterUrl(request)), "", false, @@ -599,14 +599,14 @@ private void LoadActions(HttpRequest request) true, false); } - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "IMPORT", Configuration)) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "IMPORT", this.Configuration)) { - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.ImportModule, Localization.GlobalResourceFile), ModuleActionType.ImportModule, "", "action_import.gif", - NavigateUrl(PortalSettings.ActiveTab.TabID, "ImportModule", false, "moduleid=" + ModuleId, "ReturnURL=" + FilterUrl(request)), + this.NavigateUrl(this.PortalSettings.ActiveTab.TabID, "ImportModule", false, "moduleid=" + this.ModuleId, "ReturnURL=" + FilterUrl(request)), "", false, SecurityAccessLevel.View, @@ -614,36 +614,36 @@ private void LoadActions(HttpRequest request) false); } } - if (Configuration.DesktopModule.IsSearchable && Configuration.DisplaySyndicate) + if (this.Configuration.DesktopModule.IsSearchable && this.Configuration.DisplaySyndicate) { - AddSyndicateAction(); + this.AddSyndicateAction(); } } //help module actions available to content editors and administrators const string permisisonList = "CONTENT,DELETE,EDIT,EXPORT,IMPORT,MANAGE"; - if (ModulePermissionController.HasModulePermission(Configuration.ModulePermissions, permisisonList) + if (ModulePermissionController.HasModulePermission(this.Configuration.ModulePermissions, permisisonList) && request.QueryString["ctl"] != "Help" && !Globals.IsAdminControl()) { - AddHelpActions(); + this.AddHelpActions(); } //Add Print Action - if (Configuration.DisplayPrint) + if (this.Configuration.DisplayPrint) { //print module action available to everyone - AddPrintAction(); + this.AddPrintAction(); } - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Host, "MANAGE", Configuration) && !Globals.IsAdminControl()) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Host, "MANAGE", this.Configuration) && !Globals.IsAdminControl()) { - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.ViewSource, Localization.GlobalResourceFile), ModuleActionType.ViewSource, "", "action_source.gif", - NavigateUrl(TabId, "ViewSource", false, "ModuleId=" + ModuleId, "ctlid=" + Configuration.ModuleControlId, "ReturnURL=" + FilterUrl(request)), + this.NavigateUrl(this.TabId, "ViewSource", false, "ModuleId=" + this.ModuleId, "ctlid=" + this.Configuration.ModuleControlId, "ReturnURL=" + FilterUrl(request)), false, SecurityAccessLevel.Host, true, @@ -652,25 +652,25 @@ private void LoadActions(HttpRequest request) - if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", Configuration)) + if (!Globals.IsAdminControl() && ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE,MANAGE", this.Configuration)) { - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE", Configuration)) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "DELETE", this.Configuration)) { //Check if this is the owner instance of a shared module. string confirmText = "confirm('" + ClientAPI.GetSafeJSString(Localization.GetString("DeleteModule.Confirm")) + "')"; - if (!Configuration.IsShared) + if (!this.Configuration.IsShared) { - var portal = PortalController.Instance.GetPortal(PortalSettings.PortalId); - if (PortalGroupController.Instance.IsModuleShared(Configuration.ModuleID, portal)) + var portal = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); + if (PortalGroupController.Instance.IsModuleShared(this.Configuration.ModuleID, portal)) { confirmText = "confirm('" + ClientAPI.GetSafeJSString(Localization.GetString("DeleteSharedModule.Confirm")) + "')"; } } - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.DeleteModule, Localization.GlobalResourceFile), ModuleActionType.DeleteModule, - Configuration.ModuleID.ToString(), + this.Configuration.ModuleID.ToString(), "action_delete.gif", "", confirmText, @@ -679,12 +679,12 @@ private void LoadActions(HttpRequest request) true, false); } - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration)) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", this.Configuration)) { - _moduleGenericActions.Actions.Add(GetNextActionID(), + this._moduleGenericActions.Actions.Add(this.GetNextActionID(), Localization.GetString(ModuleActionType.ClearCache, Localization.GlobalResourceFile), ModuleActionType.ClearCache, - Configuration.ModuleID.ToString(), + this.Configuration.ModuleID.ToString(), "action_refresh.gif", "", false, @@ -693,28 +693,28 @@ private void LoadActions(HttpRequest request) false); } - if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", Configuration)) + if (ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Admin, "MANAGE", this.Configuration)) { //module movement - AddMenuMoveActions(); + this.AddMenuMoveActions(); } } - if (_moduleGenericActions.Actions.Count > 0) + if (this._moduleGenericActions.Actions.Count > 0) { - _actions.Add(_moduleGenericActions); + this._actions.Add(this._moduleGenericActions); } - if (_moduleMoveActions != null && _moduleMoveActions.Actions.Count > 0) + if (this._moduleMoveActions != null && this._moduleMoveActions.Actions.Count > 0) { - _actions.Add(_moduleMoveActions); + this._actions.Add(this._moduleMoveActions); } - foreach (ModuleAction action in _moduleGenericActions.Actions) + foreach (ModuleAction action in this._moduleGenericActions.Actions) { - if (!UIUtilities.IsLegacyUI(ModuleId, action.ControlKey, PortalId) && action.Url.Contains("ctl")) + if (!UIUtilities.IsLegacyUI(this.ModuleId, action.ControlKey, this.PortalId) && action.Url.Contains("ctl")) { - action.ClientScript = UrlUtils.PopUpUrl(action.Url, _moduleControl as Control, PortalSettings, true, false); + action.ClientScript = UrlUtils.PopUpUrl(action.Url, this._moduleControl as Control, this.PortalSettings, true, false); } } } @@ -737,23 +737,23 @@ private bool SupportShowInPopup(string url) public string EditUrl() { - return EditUrl("", "", "Edit"); + return this.EditUrl("", "", "Edit"); } public string EditUrl(string controlKey) { - return EditUrl("", "", controlKey); + return this.EditUrl("", "", controlKey); } public string EditUrl(string keyName, string keyValue) { - return EditUrl(keyName, keyValue, "Edit"); + return this.EditUrl(keyName, keyValue, "Edit"); } public string EditUrl(string keyName, string keyValue, string controlKey) { var parameters = new string[] { }; - return EditUrl(keyName, keyValue, controlKey, parameters); + return this.EditUrl(keyName, keyValue, controlKey, parameters); } public string EditUrl(string keyName, string keyValue, string controlKey, params string[] additionalParameters) @@ -764,9 +764,9 @@ public string EditUrl(string keyName, string keyValue, string controlKey, params key = "Edit"; } string moduleIdParam = string.Empty; - if (Configuration != null) + if (this.Configuration != null) { - moduleIdParam = string.Format("mid={0}", Configuration.ModuleID); + moduleIdParam = string.Format("mid={0}", this.Configuration.ModuleID); } string[] parameters; @@ -784,12 +784,12 @@ public string EditUrl(string keyName, string keyValue, string controlKey, params Array.Copy(additionalParameters, 0, parameters, 1, additionalParameters.Length); } - return NavigateUrl(PortalSettings.ActiveTab.TabID, key, false, parameters); + return this.NavigateUrl(this.PortalSettings.ActiveTab.TabID, key, false, parameters); } public string NavigateUrl(int tabID, string controlKey, bool pageRedirect, params string[] additionalParameters) { - return NavigateUrl(tabID, controlKey, Globals.glbDefaultPage, pageRedirect, additionalParameters); + return this.NavigateUrl(tabID, controlKey, Globals.glbDefaultPage, pageRedirect, additionalParameters); } public string NavigateUrl(int tabID, string controlKey, string pageName, bool pageRedirect, params string[] additionalParameters) @@ -800,11 +800,11 @@ public string NavigateUrl(int tabID, string controlKey, string pageName, bool pa var url = TestableGlobals.Instance.NavigateURL(tabID, isSuperTab, settings, controlKey, language, pageName, additionalParameters); // Making URLs call popups - if (PortalSettings != null && PortalSettings.EnablePopUps) + if (this.PortalSettings != null && this.PortalSettings.EnablePopUps) { - if (!UIUtilities.IsLegacyUI(ModuleId, controlKey, PortalId) && (url.Contains("ctl"))) + if (!UIUtilities.IsLegacyUI(this.ModuleId, controlKey, this.PortalId) && (url.Contains("ctl"))) { - url = UrlUtils.PopUpUrl(url, null, PortalSettings, false, pageRedirect); + url = UrlUtils.PopUpUrl(url, null, this.PortalSettings, false, pageRedirect); } } return url; @@ -812,8 +812,8 @@ public string NavigateUrl(int tabID, string controlKey, string pageName, bool pa public int GetNextActionID() { - _nextActionId += 1; - return _nextActionId; + this._nextActionId += 1; + return this._nextActionId; } #endregion diff --git a/DNN Platform/Library/UI/Modules/ModuleUserControlBase.cs b/DNN Platform/Library/UI/Modules/ModuleUserControlBase.cs index fe63abe0dea..2b8a21effd4 100644 --- a/DNN Platform/Library/UI/Modules/ModuleUserControlBase.cs +++ b/DNN Platform/Library/UI/Modules/ModuleUserControlBase.cs @@ -31,12 +31,12 @@ public class ModuleUserControlBase : UserControl, IModuleControl protected string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } protected string LocalizeSafeJsString(string key) { - return Localization.GetSafeJSString(key, LocalResourceFile); + return Localization.GetSafeJSString(key, this.LocalResourceFile); } #region IModuleControl Members @@ -65,7 +65,7 @@ public string ControlPath { get { - return TemplateSourceDirectory + "/"; + return this.TemplateSourceDirectory + "/"; } } @@ -79,7 +79,7 @@ public string ControlName { get { - return GetType().Name.Replace("_", "."); + return this.GetType().Name.Replace("_", "."); } } @@ -94,19 +94,19 @@ public string LocalResourceFile get { string fileRoot; - if (string.IsNullOrEmpty(_localResourceFile)) + if (string.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = Path.Combine(ControlPath, Localization.LocalResourceDirectory + "/" + ID); + fileRoot = Path.Combine(this.ControlPath, Localization.LocalResourceDirectory + "/" + this.ID); } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -120,11 +120,11 @@ public ModuleInstanceContext ModuleContext { get { - if (_moduleContext == null) + if (this._moduleContext == null) { - _moduleContext = new ModuleInstanceContext(this); + this._moduleContext = new ModuleInstanceContext(this); } - return _moduleContext; + return this._moduleContext; } } diff --git a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs index 3205723e436..771a42fa47e 100644 --- a/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs +++ b/DNN Platform/Library/UI/Modules/ProfileModuleUserControlBase.cs @@ -25,7 +25,7 @@ public abstract class ProfileModuleUserControlBase : ModuleUserControlBase, IPro protected INavigationManager NavigationManager { get; } public ProfileModuleUserControlBase() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region IProfileModule Members @@ -36,9 +36,9 @@ public int ProfileUserId { get { - if (!string.IsNullOrEmpty(Request.Params["UserId"])) + if (!string.IsNullOrEmpty(this.Request.Params["UserId"])) { - return Int32.Parse(Request.Params["UserId"]); + return Int32.Parse(this.Request.Params["UserId"]); } return UserController.Instance.GetCurrentUserInfo().UserID; @@ -51,12 +51,12 @@ public int ProfileUserId protected bool IsUser { - get { return ProfileUserId == ModuleContext.PortalSettings.UserId; } + get { return this.ProfileUserId == this.ModuleContext.PortalSettings.UserId; } } protected UserInfo ProfileUser { - get { return UserController.GetUserById(ModuleContext.PortalId, ProfileUserId); } + get { return UserController.GetUserById(this.ModuleContext.PortalId, this.ProfileUserId); } } #endregion @@ -66,7 +66,7 @@ protected UserInfo ProfileUser private string GetRedirectUrl() { //redirect user to default page if not specific the home tab, do this action to prevent loop redirect. - var homeTabId = ModuleContext.PortalSettings.HomeTabId; + var homeTabId = this.ModuleContext.PortalSettings.HomeTabId; string redirectUrl; if (homeTabId > Null.NullInteger) @@ -75,7 +75,7 @@ private string GetRedirectUrl() } else { - redirectUrl = TestableGlobals.Instance.GetPortalDomainName(PortalSettings.Current.PortalAlias.HTTPAlias, Request, true) + + redirectUrl = TestableGlobals.Instance.GetPortalDomainName(PortalSettings.Current.PortalAlias.HTTPAlias, this.Request, true) + "/" + Globals.glbDefaultPage; } @@ -88,16 +88,16 @@ private string GetRedirectUrl() protected override void OnInit(EventArgs e) { - if (string.IsNullOrEmpty(Request.Params["UserId"]) && - (ModuleContext.PortalSettings.ActiveTab.TabID == ModuleContext.PortalSettings.UserTabId - || ModuleContext.PortalSettings.ActiveTab.ParentId == ModuleContext.PortalSettings.UserTabId)) + if (string.IsNullOrEmpty(this.Request.Params["UserId"]) && + (this.ModuleContext.PortalSettings.ActiveTab.TabID == this.ModuleContext.PortalSettings.UserTabId + || this.ModuleContext.PortalSettings.ActiveTab.ParentId == this.ModuleContext.PortalSettings.UserTabId)) { try { //Clicked on breadcrumb - don't know which user - Response.Redirect(Request.IsAuthenticated - ? NavigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) - : GetRedirectUrl(), true); + this.Response.Redirect(this.Request.IsAuthenticated + ? this.NavigationManager.NavigateURL(this.ModuleContext.PortalSettings.ActiveTab.TabID, "", "UserId=" + this.ModuleContext.PortalSettings.UserId.ToString(CultureInfo.InvariantCulture)) + : this.GetRedirectUrl(), true); } catch (ThreadAbortException) { diff --git a/DNN Platform/Library/UI/Modules/ReflectedModuleControlFactory.cs b/DNN Platform/Library/UI/Modules/ReflectedModuleControlFactory.cs index 9e8b31052f4..d0e224e0abb 100644 --- a/DNN Platform/Library/UI/Modules/ReflectedModuleControlFactory.cs +++ b/DNN Platform/Library/UI/Modules/ReflectedModuleControlFactory.cs @@ -20,12 +20,12 @@ public override Control CreateControl(TemplateControl containerControl, string c public override Control CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) { - return CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); + return this.CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); } public override Control CreateSettingsControl(TemplateControl containerControl, ModuleInfo moduleConfiguration, string controlSrc) { - return CreateControl(containerControl, String.Empty, controlSrc); + return this.CreateControl(containerControl, String.Empty, controlSrc); } } } diff --git a/DNN Platform/Library/UI/Modules/WebFormsModuleControlFactory.cs b/DNN Platform/Library/UI/Modules/WebFormsModuleControlFactory.cs index ae5b21a23ee..5305246b948 100644 --- a/DNN Platform/Library/UI/Modules/WebFormsModuleControlFactory.cs +++ b/DNN Platform/Library/UI/Modules/WebFormsModuleControlFactory.cs @@ -18,12 +18,12 @@ public override Control CreateControl(TemplateControl containerControl, string c public override Control CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) { - return CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); + return this.CreateControl(containerControl, String.Empty, moduleConfiguration.ModuleControl.ControlSrc); } public override Control CreateSettingsControl(TemplateControl containerControl, ModuleInfo moduleConfiguration, string controlSrc) { - return CreateControl(containerControl, String.Empty, controlSrc); + return this.CreateControl(containerControl, String.Empty, controlSrc); } } } diff --git a/DNN Platform/Library/UI/Skins/Controls/ControlPanel.cs b/DNN Platform/Library/UI/Skins/Controls/ControlPanel.cs index bcc3e6e2a90..772982d47b8 100644 --- a/DNN Platform/Library/UI/Skins/Controls/ControlPanel.cs +++ b/DNN Platform/Library/UI/Skins/Controls/ControlPanel.cs @@ -22,16 +22,16 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (Request.QueryString["dnnprintmode"] != "true" && !UrlUtils.InPopUp()) + if (this.Request.QueryString["dnnprintmode"] != "true" && !UrlUtils.InPopUp()) { var objControlPanel = ControlUtilities.LoadControl(this, Host.ControlPanel); - var objForm = (HtmlForm)Page.FindControl("Form"); + var objForm = (HtmlForm)this.Page.FindControl("Form"); if(objControlPanel.IncludeInControlHierarchy) { - objControlPanel.IsDockable = IsDockable; + objControlPanel.IsDockable = this.IsDockable; if (!Host.ControlPanel.EndsWith("controlbar.ascx", StringComparison.InvariantCultureIgnoreCase)) - Controls.Add(objControlPanel); + this.Controls.Add(objControlPanel); else { if (objForm != null) @@ -40,12 +40,12 @@ protected override void OnInit(EventArgs e) } else { - Page.Controls.AddAt(0, objControlPanel); + this.Page.Controls.AddAt(0, objControlPanel); } } //register admin.css - ClientResourceManager.RegisterAdminStylesheet(Page, Globals.HostPath + "admin.css"); + ClientResourceManager.RegisterAdminStylesheet(this.Page, Globals.HostPath + "admin.css"); } } } diff --git a/DNN Platform/Library/UI/Skins/Controls/LanguageTokenReplace.cs b/DNN Platform/Library/UI/Skins/Controls/LanguageTokenReplace.cs index 1bab1fd0f1e..ac3bcbbf7f9 100644 --- a/DNN Platform/Library/UI/Skins/Controls/LanguageTokenReplace.cs +++ b/DNN Platform/Library/UI/Skins/Controls/LanguageTokenReplace.cs @@ -32,8 +32,8 @@ public class LanguageTokenReplace : TokenReplace public LanguageTokenReplace() : base(Scope.NoSettings) { - UseObjectLessExpression = true; - PropertySource[ObjectLessToken] = new LanguagePropertyAccess(this, Globals.GetPortalSettings()); + this.UseObjectLessExpression = true; + this.PropertySource[ObjectLessToken] = new LanguagePropertyAccess(this, Globals.GetPortalSettings()); } public string resourceFile { get; set; } @@ -48,8 +48,8 @@ public class LanguagePropertyAccess : IPropertyAccess public LanguagePropertyAccess(LanguageTokenReplace parent, PortalSettings settings) { - objPortal = settings; - objParent = parent; + this.objPortal = settings; + this.objParent = parent; } #region IPropertyAccess Members @@ -59,20 +59,20 @@ public string GetProperty(string propertyName, string format, CultureInfo format switch (propertyName.ToLowerInvariant()) { case "url": - return NewUrl(objParent.Language); + return this.NewUrl(this.objParent.Language); case "flagsrc": - var mappedGifFile = PathUtils.Instance.MapPath($@"{FlagIconPhysicalLocation}\{objParent.Language}.gif"); - return File.Exists(mappedGifFile) ? $"/{objParent.Language}.gif" : $@"/{NonExistingFlagIconFileName}"; + var mappedGifFile = PathUtils.Instance.MapPath($@"{FlagIconPhysicalLocation}\{this.objParent.Language}.gif"); + return File.Exists(mappedGifFile) ? $"/{this.objParent.Language}.gif" : $@"/{NonExistingFlagIconFileName}"; case "selected": - return (objParent.Language == CultureInfo.CurrentCulture.Name).ToString(); + return (this.objParent.Language == CultureInfo.CurrentCulture.Name).ToString(); case "label": - return Localization.GetString("Label", objParent.resourceFile); + return Localization.GetString("Label", this.objParent.resourceFile); case "i": return Globals.ResolveUrl("~/images/Flags"); case "p": - return Globals.ResolveUrl(PathUtils.Instance.RemoveTrailingSlash(objPortal.HomeDirectory)); + return Globals.ResolveUrl(PathUtils.Instance.RemoveTrailingSlash(this.objPortal.HomeDirectory)); case "s": - return Globals.ResolveUrl(PathUtils.Instance.RemoveTrailingSlash(objPortal.ActiveTab.SkinPath)); + return Globals.ResolveUrl(PathUtils.Instance.RemoveTrailingSlash(this.objPortal.ActiveTab.SkinPath)); case "g": return Globals.ResolveUrl("~/portals/" + Globals.glbHostSkinFolder); default: @@ -146,7 +146,7 @@ private string[] GetQsParams(string newLanguage, bool isLocalized) } break; default: - if ((arrKeys[i].ToLowerInvariant() == "portalid") && objPortal.ActiveTab.IsSuperTab) + if ((arrKeys[i].ToLowerInvariant() == "portalid") && this.objPortal.ActiveTab.IsSuperTab) { //skip parameter //navigateURL adds portalid to querystring if tab is superTab @@ -220,16 +220,16 @@ private string NewUrl(string newLanguage) var newLocale = LocaleController.Instance.GetLocale(newLanguage); //Ensure that the current ActiveTab is the culture of the new language - var tabId = objPortal.ActiveTab.TabID; + var tabId = this.objPortal.ActiveTab.TabID; var islocalized = false; - var localizedTab = TabController.Instance.GetTabByCulture(tabId, objPortal.PortalId, newLocale); + var localizedTab = TabController.Instance.GetTabByCulture(tabId, this.objPortal.PortalId, newLocale); if (localizedTab != null) { islocalized = true; if (localizedTab.IsDeleted || !TabPermissionController.CanViewPage(localizedTab)) { - var localizedPortal = PortalController.Instance.GetPortal(objPortal.PortalId, newLocale.Code); + var localizedPortal = PortalController.Instance.GetPortal(this.objPortal.PortalId, newLocale.Code); tabId = localizedPortal.HomeTabId; } else @@ -256,7 +256,7 @@ private string NewUrl(string newLanguage) } if (!string.IsNullOrEmpty(fullurl)) { - return GetCleanUrl(fullurl); + return this.GetCleanUrl(fullurl); } } } @@ -275,11 +275,11 @@ private string NewUrl(string newLanguage) } var controlKey = HttpContext.Current.Request.QueryString["ctl"]; - var queryStrings = GetQsParams(newLocale.Code, islocalized); - var isSuperTab = objPortal.ActiveTab.IsSuperTab; - var url = $"{TestableGlobals.Instance.NavigateURL(tabId, isSuperTab, objPortal, controlKey, newLanguage, queryStrings)}{rawQueryString}"; + var queryStrings = this.GetQsParams(newLocale.Code, islocalized); + var isSuperTab = this.objPortal.ActiveTab.IsSuperTab; + var url = $"{TestableGlobals.Instance.NavigateURL(tabId, isSuperTab, this.objPortal, controlKey, newLanguage, queryStrings)}{rawQueryString}"; - return GetCleanUrl(url); + return this.GetCleanUrl(url); } private string GetCleanUrl(string url) diff --git a/DNN Platform/Library/UI/Skins/Controls/ModuleMessage.cs b/DNN Platform/Library/UI/Skins/Controls/ModuleMessage.cs index 265fb2f0287..165207ca4d3 100644 --- a/DNN Platform/Library/UI/Skins/Controls/ModuleMessage.cs +++ b/DNN Platform/Library/UI/Skins/Controls/ModuleMessage.cs @@ -80,39 +80,39 @@ protected override void OnLoad(EventArgs e) //check to see if a url //was passed in for an icon - if (!String.IsNullOrEmpty(IconImage)) + if (!String.IsNullOrEmpty(this.IconImage)) { - strMessage += Text; - dnnSkinMessage.CssClass = "dnnFormMessage dnnFormWarning"; + strMessage += this.Text; + this.dnnSkinMessage.CssClass = "dnnFormMessage dnnFormWarning"; } else { - switch (IconType) + switch (this.IconType) { case ModuleMessageType.GreenSuccess: - strMessage += Text; - dnnSkinMessage.CssClass = "dnnFormMessage dnnFormSuccess"; + strMessage += this.Text; + this.dnnSkinMessage.CssClass = "dnnFormMessage dnnFormSuccess"; break; case ModuleMessageType.YellowWarning: - strMessage += Text; - dnnSkinMessage.CssClass = "dnnFormMessage dnnFormWarning"; + strMessage += this.Text; + this.dnnSkinMessage.CssClass = "dnnFormMessage dnnFormWarning"; break; case ModuleMessageType.BlueInfo: - strMessage += Text; - dnnSkinMessage.CssClass = "dnnFormMessage dnnFormInfo"; + strMessage += this.Text; + this.dnnSkinMessage.CssClass = "dnnFormMessage dnnFormInfo"; break; case ModuleMessageType.RedError: - strMessage += Text; - dnnSkinMessage.CssClass = "dnnFormMessage dnnFormValidationSummary"; + strMessage += this.Text; + this.dnnSkinMessage.CssClass = "dnnFormMessage dnnFormValidationSummary"; break; } } - lblMessage.Text = strMessage; + this.lblMessage.Text = strMessage; - if (!String.IsNullOrEmpty(Heading)) + if (!String.IsNullOrEmpty(this.Heading)) { - lblHeading.Visible = true; - lblHeading.Text = Heading; + this.lblHeading.Visible = true; + this.lblHeading.Text = this.Heading; } } catch (Exception exc) //Control failed to load @@ -126,7 +126,7 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); //set the scroll js only shown for module message and in postback mode. - scrollScript.Visible = IsPostBack && IsModuleMessage; + this.scrollScript.Visible = this.IsPostBack && this.IsModuleMessage; } #endregion diff --git a/DNN Platform/Library/UI/Skins/Controls/SkinsEditControl.cs b/DNN Platform/Library/UI/Skins/Controls/SkinsEditControl.cs index 938d8444901..806f4c3d49a 100644 --- a/DNN Platform/Library/UI/Skins/Controls/SkinsEditControl.cs +++ b/DNN Platform/Library/UI/Skins/Controls/SkinsEditControl.cs @@ -55,7 +55,7 @@ public SkinsEditControl() /// ----------------------------------------------------------------------------- public SkinsEditControl(string type) { - SystemType = type; + this.SystemType = type; } #endregion @@ -72,11 +72,11 @@ protected Dictionary DictionaryValue { get { - return Value as Dictionary; + return this.Value as Dictionary; } set { - Value = value; + this.Value = value; } } @@ -90,11 +90,11 @@ protected Dictionary OldDictionaryValue { get { - return OldValue as Dictionary; + return this.OldValue as Dictionary; } set { - OldValue = value; + this.OldValue = value; } } @@ -109,9 +109,9 @@ protected string OldStringValue get { string strValue = Null.NullString; - if (OldDictionaryValue != null) + if (this.OldDictionaryValue != null) { - foreach (string Skin in OldDictionaryValue.Values) + foreach (string Skin in this.OldDictionaryValue.Values) { strValue += Skin + ","; } @@ -131,9 +131,9 @@ protected override string StringValue get { string strValue = Null.NullString; - if (DictionaryValue != null) + if (this.DictionaryValue != null) { - foreach (string Skin in DictionaryValue.Values) + foreach (string Skin in this.DictionaryValue.Values) { strValue += Skin + ","; } @@ -142,7 +142,7 @@ protected override string StringValue } set { - Value = value; + this.Value = value; } } @@ -150,11 +150,11 @@ protected string AddedItem { get { - return _AddedItem; + return this._AddedItem; } set { - _AddedItem = value; + this._AddedItem = value; } } @@ -166,17 +166,17 @@ public void RaisePostBackEvent(string eventArgument) switch (eventArgument.Substring(0, 3)) { case "Del": - args = new PropertyEditorEventArgs(Name); - args.Value = DictionaryValue; - args.OldValue = OldDictionaryValue; + args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DictionaryValue; + args.OldValue = this.OldDictionaryValue; args.Key = int.Parse(eventArgument.Substring(7)); args.Changed = true; base.OnItemDeleted(args); break; case "Add": - args = new PropertyEditorEventArgs(Name); - args.Value = AddedItem; - args.StringValue = AddedItem; + args = new PropertyEditorEventArgs(this.Name); + args.Value = this.AddedItem; + args.StringValue = this.AddedItem; args.Changed = true; base.OnItemAdded(args); break; @@ -197,9 +197,9 @@ public void RaisePostBackEvent(string eventArgument) /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = DictionaryValue; - args.OldValue = OldDictionaryValue; + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DictionaryValue; + args.OldValue = this.OldDictionaryValue; args.StringValue = ""; args.Changed = true; base.OnValueChanged(args); @@ -215,7 +215,7 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); //Register control for PostBack - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } /// ----------------------------------------------------------------------------- @@ -227,9 +227,9 @@ protected override void OnPreRender(EventArgs e) protected override void RenderEditMode(HtmlTextWriter writer) { int length = Null.NullInteger; - if ((CustomAttributes != null)) + if ((this.CustomAttributes != null)) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is MaxLengthAttribute) { @@ -239,14 +239,14 @@ protected override void RenderEditMode(HtmlTextWriter writer) } } } - if (DictionaryValue != null) + if (this.DictionaryValue != null) { - foreach (KeyValuePair kvp in DictionaryValue) + foreach (KeyValuePair kvp in this.DictionaryValue) { //Render Hyperlink - writer.AddAttribute(HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink(this, "Delete_" + kvp.Key, false)); + writer.AddAttribute(HtmlTextWriterAttribute.Href, this.Page.ClientScript.GetPostBackClientHyperlink(this, "Delete_" + kvp.Key, false)); writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "javascript:return confirm('" + ClientAPI.GetSafeJSString(Localization.GetString("DeleteItem")) + "');"); - writer.AddAttribute(HtmlTextWriterAttribute.Title, Localization.GetString("cmdDelete", LocalResourceFile)); + writer.AddAttribute(HtmlTextWriterAttribute.Title, Localization.GetString("cmdDelete", this.LocalResourceFile)); writer.RenderBeginTag(HtmlTextWriterTag.A); //Render Image @@ -260,14 +260,14 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Render end of Hyperlink writer.RenderEndTag(); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute(HtmlTextWriterAttribute.Value, kvp.Value); if (length > Null.NullInteger) { writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, length.ToString()); } - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID + "_skin" + kvp.Key); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "_skin" + kvp.Key); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); @@ -277,8 +277,8 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Create Add Row //Render Hyperlink - writer.AddAttribute(HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink(this, "Add", false)); - writer.AddAttribute(HtmlTextWriterAttribute.Title, Localization.GetString("cmdAdd", LocalResourceFile)); + writer.AddAttribute(HtmlTextWriterAttribute.Href, this.Page.ClientScript.GetPostBackClientHyperlink(this, "Add", false)); + writer.AddAttribute(HtmlTextWriterAttribute.Title, Localization.GetString("cmdAdd", this.LocalResourceFile)); writer.RenderBeginTag(HtmlTextWriterTag.A); //Render Image @@ -292,14 +292,14 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Render end of Hyperlink writer.RenderEndTag(); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute(HtmlTextWriterAttribute.Value, Null.NullString); if (length > Null.NullInteger) { writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, length.ToString()); } - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID + "_skinnew"); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "_skinnew"); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); writer.WriteBreak(); @@ -314,11 +314,11 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - if (DictionaryValue != null) + if (this.DictionaryValue != null) { - foreach (KeyValuePair kvp in DictionaryValue) + foreach (KeyValuePair kvp in this.DictionaryValue) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(kvp.Value); writer.RenderEndTag(); @@ -334,9 +334,9 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo bool dataChanged = false; string postedValue; var newDictionaryValue = new Dictionary(); - foreach (KeyValuePair kvp in DictionaryValue) + foreach (KeyValuePair kvp in this.DictionaryValue) { - postedValue = postCollection[UniqueID + "_skin" + kvp.Key]; + postedValue = postCollection[this.UniqueID + "_skin" + kvp.Key]; if (kvp.Value.Equals(postedValue)) { newDictionaryValue[kvp.Key] = kvp.Value; @@ -347,12 +347,12 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo dataChanged = true; } } - postedValue = postCollection[UniqueID + "_skinnew"]; + postedValue = postCollection[this.UniqueID + "_skinnew"]; if (!string.IsNullOrEmpty(postedValue)) { - AddedItem = postedValue; + this.AddedItem = postedValue; } - DictionaryValue = newDictionaryValue; + this.DictionaryValue = newDictionaryValue; return dataChanged; } } diff --git a/DNN Platform/Library/UI/Skins/EventListeners/SkinEventArgs.cs b/DNN Platform/Library/UI/Skins/EventListeners/SkinEventArgs.cs index 0403e9f249c..d8be5be1e17 100644 --- a/DNN Platform/Library/UI/Skins/EventListeners/SkinEventArgs.cs +++ b/DNN Platform/Library/UI/Skins/EventListeners/SkinEventArgs.cs @@ -22,14 +22,14 @@ public class SkinEventArgs : EventArgs public SkinEventArgs(Skin skin) { - _Skin = skin; + this._Skin = skin; } public Skin Skin { get { - return _Skin; + return this._Skin; } } } diff --git a/DNN Platform/Library/UI/Skins/EventListeners/SkinEventListener.cs b/DNN Platform/Library/UI/Skins/EventListeners/SkinEventListener.cs index fc7cdb3207d..47a9f8c5448 100644 --- a/DNN Platform/Library/UI/Skins/EventListeners/SkinEventListener.cs +++ b/DNN Platform/Library/UI/Skins/EventListeners/SkinEventListener.cs @@ -8,8 +8,8 @@ public class SkinEventListener { public SkinEventListener(SkinEventType type, SkinEventHandler e) { - EventType = type; - SkinEvent = e; + this.EventType = type; + this.SkinEvent = e; } public SkinEventType EventType { get; private set; } diff --git a/DNN Platform/Library/UI/Skins/InstalledSkinInfo.cs b/DNN Platform/Library/UI/Skins/InstalledSkinInfo.cs index b2e929f05c0..d3687722ab6 100644 --- a/DNN Platform/Library/UI/Skins/InstalledSkinInfo.cs +++ b/DNN Platform/Library/UI/Skins/InstalledSkinInfo.cs @@ -23,8 +23,8 @@ public void WriteXml(XmlWriter writer) //Write start of main elemenst writer.WriteStartElement("skin"); - writer.WriteElementString("skinName", SkinName); - writer.WriteElementString("inUse", InUse.ToString()); + writer.WriteElementString("skinName", this.SkinName); + writer.WriteElementString("inUse", this.InUse.ToString()); //Write end of Host Info writer.WriteEndElement(); diff --git a/DNN Platform/Library/UI/Skins/NavObjectBase.cs b/DNN Platform/Library/UI/Skins/NavObjectBase.cs index 651d683e1c2..fcbb488a5b0 100644 --- a/DNN Platform/Library/UI/Skins/NavObjectBase.cs +++ b/DNN Platform/Library/UI/Skins/NavObjectBase.cs @@ -114,7 +114,7 @@ public List CustomAttributes { get { - return m_objCustomAttributes; + return this.m_objCustomAttributes; } } @@ -124,11 +124,11 @@ public string ProviderName { get { - return m_strProviderName; + return this.m_strProviderName; } set { - m_strProviderName = value; + this.m_strProviderName = value; } } @@ -136,7 +136,7 @@ protected NavigationProvider Control { get { - return m_objControl; + return this.m_objControl; } } @@ -144,11 +144,11 @@ public string Level { get { - return m_strLevel; + return this.m_strLevel; } set { - m_strLevel = value; + this.m_strLevel = value; } } @@ -156,11 +156,11 @@ public string ToolTip { get { - return m_strToolTip; + return this.m_strToolTip; } set { - m_strToolTip = value; + this.m_strToolTip = value; } } @@ -168,11 +168,11 @@ public bool PopulateNodesFromClient { get { - return m_blnPopulateNodesFromClient; + return this.m_blnPopulateNodesFromClient; } set { - m_blnPopulateNodesFromClient = value; + this.m_blnPopulateNodesFromClient = value; } } @@ -180,11 +180,11 @@ public int ExpandDepth { get { - return m_intExpandDepth; + return this.m_intExpandDepth; } set { - m_intExpandDepth = value; + this.m_intExpandDepth = value; } } @@ -192,11 +192,11 @@ public int StartTabId { get { - return m_intStartTabId; + return this.m_intStartTabId; } set { - m_intStartTabId = value; + this.m_intStartTabId = value; } } @@ -204,25 +204,25 @@ public string PathSystemImage { get { - if (Control == null) + if (this.Control == null) { - return m_strPathSystemImage; + return this.m_strPathSystemImage; } else { - return Control.PathSystemImage; + return this.Control.PathSystemImage; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strPathSystemImage = value; + this.m_strPathSystemImage = value; } else { - Control.PathSystemImage = value; + this.Control.PathSystemImage = value; } } } @@ -231,25 +231,25 @@ public string PathImage { get { - if (Control == null) + if (this.Control == null) { - return m_strPathImage; + return this.m_strPathImage; } else { - return Control.PathImage; + return this.Control.PathImage; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strPathImage = value; + this.m_strPathImage = value; } else { - Control.PathImage = value; + this.Control.PathImage = value; } } } @@ -258,24 +258,24 @@ public string WorkImage { get { - if (Control == null) + if (this.Control == null) { - return m_strWorkImage; + return this.m_strWorkImage; } else { - return Control.WorkImage; + return this.Control.WorkImage; } } set { - if (Control == null) + if (this.Control == null) { - m_strWorkImage = value; + this.m_strWorkImage = value; } else { - Control.WorkImage = value; + this.Control.WorkImage = value; } } } @@ -284,24 +284,24 @@ public string PathSystemScript { get { - if (Control == null) + if (this.Control == null) { - return m_strPathSystemScript; + return this.m_strPathSystemScript; } else { - return Control.PathSystemScript; + return this.Control.PathSystemScript; } } set { - if (Control == null) + if (this.Control == null) { - m_strPathSystemScript = value; + this.m_strPathSystemScript = value; } else { - Control.PathSystemScript = value; + this.Control.PathSystemScript = value; } } } @@ -311,13 +311,13 @@ public string ControlOrientation get { string retValue = ""; - if (Control == null) + if (this.Control == null) { - retValue = m_strControlOrientation; + retValue = this.m_strControlOrientation; } else { - switch (Control.ControlOrientation) + switch (this.Control.ControlOrientation) { case NavigationProvider.Orientation.Horizontal: retValue = "Horizontal"; @@ -331,19 +331,19 @@ public string ControlOrientation } set { - if (Control == null) + if (this.Control == null) { - m_strControlOrientation = value; + this.m_strControlOrientation = value; } else { switch (value.ToLowerInvariant()) { case "horizontal": - Control.ControlOrientation = NavigationProvider.Orientation.Horizontal; + this.Control.ControlOrientation = NavigationProvider.Orientation.Horizontal; break; case "vertical": - Control.ControlOrientation = NavigationProvider.Orientation.Vertical; + this.Control.ControlOrientation = NavigationProvider.Orientation.Vertical; break; } } @@ -355,13 +355,13 @@ public string ControlAlignment get { string retValue = ""; - if (Control == null) + if (this.Control == null) { - retValue = m_strControlAlignment; + retValue = this.m_strControlAlignment; } else { - switch (Control.ControlAlignment) + switch (this.Control.ControlAlignment) { case NavigationProvider.Alignment.Left: retValue = "Left"; @@ -381,25 +381,25 @@ public string ControlAlignment } set { - if (Control == null) + if (this.Control == null) { - m_strControlAlignment = value; + this.m_strControlAlignment = value; } else { switch (value.ToLowerInvariant()) { case "left": - Control.ControlAlignment = NavigationProvider.Alignment.Left; + this.Control.ControlAlignment = NavigationProvider.Alignment.Left; break; case "right": - Control.ControlAlignment = NavigationProvider.Alignment.Right; + this.Control.ControlAlignment = NavigationProvider.Alignment.Right; break; case "center": - Control.ControlAlignment = NavigationProvider.Alignment.Center; + this.Control.ControlAlignment = NavigationProvider.Alignment.Center; break; case "justify": - Control.ControlAlignment = NavigationProvider.Alignment.Justify; + this.Control.ControlAlignment = NavigationProvider.Alignment.Justify; break; } } @@ -410,24 +410,24 @@ public string ForceCrawlerDisplay { get { - if (Control == null) + if (this.Control == null) { - return m_strForceCrawlerDisplay; + return this.m_strForceCrawlerDisplay; } else { - return Control.ForceCrawlerDisplay; + return this.Control.ForceCrawlerDisplay; } } set { - if (Control == null) + if (this.Control == null) { - m_strForceCrawlerDisplay = value; + this.m_strForceCrawlerDisplay = value; } else { - Control.ForceCrawlerDisplay = value; + this.Control.ForceCrawlerDisplay = value; } } } @@ -436,24 +436,24 @@ public string ForceDownLevel { get { - if (Control == null) + if (this.Control == null) { - return m_strForceDownLevel; + return this.m_strForceDownLevel; } else { - return Control.ForceDownLevel; + return this.Control.ForceDownLevel; } } set { - if (Control == null) + if (this.Control == null) { - m_strForceDownLevel = value; + this.m_strForceDownLevel = value; } else { - Control.ForceDownLevel = value; + this.Control.ForceDownLevel = value; } } } @@ -462,24 +462,24 @@ public string MouseOutHideDelay { get { - if (Control == null) + if (this.Control == null) { - return m_strMouseOutHideDelay; + return this.m_strMouseOutHideDelay; } else { - return Control.MouseOutHideDelay.ToString(); + return this.Control.MouseOutHideDelay.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strMouseOutHideDelay = value; + this.m_strMouseOutHideDelay = value; } else { - Control.MouseOutHideDelay = Convert.ToDecimal(value); + this.Control.MouseOutHideDelay = Convert.ToDecimal(value); } } } @@ -489,13 +489,13 @@ public string MouseOverDisplay get { string retValue = ""; - if (Control == null) + if (this.Control == null) { - retValue = m_strMouseOverDisplay; + retValue = this.m_strMouseOverDisplay; } else { - switch (Control.MouseOverDisplay) + switch (this.Control.MouseOverDisplay) { case NavigationProvider.HoverDisplay.Highlight: retValue = "Highlight"; @@ -512,22 +512,22 @@ public string MouseOverDisplay } set { - if (Control == null) + if (this.Control == null) { - m_strMouseOverDisplay = value; + this.m_strMouseOverDisplay = value; } else { switch (value.ToLowerInvariant()) { case "highlight": - Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Highlight; + this.Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Highlight; break; case "outset": - Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Outset; + this.Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Outset; break; case "none": - Control.MouseOverDisplay = NavigationProvider.HoverDisplay.None; + this.Control.MouseOverDisplay = NavigationProvider.HoverDisplay.None; break; } } @@ -539,13 +539,13 @@ public string MouseOverAction get { string retValue = ""; - if (Control == null) + if (this.Control == null) { - retValue = m_strMouseOverAction; + retValue = this.m_strMouseOverAction; } else { - switch (Control.MouseOverAction) + switch (this.Control.MouseOverAction) { case NavigationProvider.HoverAction.Expand: retValue = "True"; @@ -559,19 +559,19 @@ public string MouseOverAction } set { - if (Control == null) + if (this.Control == null) { - m_strMouseOverAction = value; + this.m_strMouseOverAction = value; } else { - if (Convert.ToBoolean(GetValue(value, "True"))) + if (Convert.ToBoolean(this.GetValue(value, "True"))) { - Control.MouseOverAction = NavigationProvider.HoverAction.Expand; + this.Control.MouseOverAction = NavigationProvider.HoverAction.Expand; } else { - Control.MouseOverAction = NavigationProvider.HoverAction.None; + this.Control.MouseOverAction = NavigationProvider.HoverAction.None; } } } @@ -581,24 +581,24 @@ public string IndicateChildren { get { - if (Control == null) + if (this.Control == null) { - return m_strIndicateChildren; + return this.m_strIndicateChildren; } else { - return Control.IndicateChildren.ToString(); + return this.Control.IndicateChildren.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strIndicateChildren = value; + this.m_strIndicateChildren = value; } else { - Control.IndicateChildren = Convert.ToBoolean(value); + this.Control.IndicateChildren = Convert.ToBoolean(value); } } } @@ -607,25 +607,25 @@ public string IndicateChildImageRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strIndicateChildImageRoot; + return this.m_strIndicateChildImageRoot; } else { - return Control.IndicateChildImageRoot; + return this.Control.IndicateChildImageRoot; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strIndicateChildImageRoot = value; + this.m_strIndicateChildImageRoot = value; } else { - Control.IndicateChildImageRoot = value; + this.Control.IndicateChildImageRoot = value; } } } @@ -634,25 +634,25 @@ public string IndicateChildImageSub { get { - if (Control == null) + if (this.Control == null) { - return m_strIndicateChildImageSub; + return this.m_strIndicateChildImageSub; } else { - return Control.IndicateChildImageSub; + return this.Control.IndicateChildImageSub; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strIndicateChildImageSub = value; + this.m_strIndicateChildImageSub = value; } else { - Control.IndicateChildImageSub = value; + this.Control.IndicateChildImageSub = value; } } } @@ -661,25 +661,25 @@ public string IndicateChildImageExpandedRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strIndicateChildImageExpandedRoot; + return this.m_strIndicateChildImageExpandedRoot; } else { - return Control.IndicateChildImageExpandedRoot; + return this.Control.IndicateChildImageExpandedRoot; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strIndicateChildImageExpandedRoot = value; + this.m_strIndicateChildImageExpandedRoot = value; } else { - Control.IndicateChildImageExpandedRoot = value; + this.Control.IndicateChildImageExpandedRoot = value; } } } @@ -688,25 +688,25 @@ public string IndicateChildImageExpandedSub { get { - if (Control == null) + if (this.Control == null) { - return m_strIndicateChildImageExpandedSub; + return this.m_strIndicateChildImageExpandedSub; } else { - return Control.IndicateChildImageExpandedSub; + return this.Control.IndicateChildImageExpandedSub; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strIndicateChildImageExpandedSub = value; + this.m_strIndicateChildImageExpandedSub = value; } else { - Control.IndicateChildImageExpandedSub = value; + this.Control.IndicateChildImageExpandedSub = value; } } } @@ -715,25 +715,25 @@ public string NodeLeftHTMLRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeLeftHTMLRoot; + return this.m_strNodeLeftHTMLRoot; } else { - return Control.NodeLeftHTMLRoot; + return this.Control.NodeLeftHTMLRoot; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeLeftHTMLRoot = value; + this.m_strNodeLeftHTMLRoot = value; } else { - Control.NodeLeftHTMLRoot = value; + this.Control.NodeLeftHTMLRoot = value; } } } @@ -742,25 +742,25 @@ public string NodeRightHTMLRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeRightHTMLRoot; + return this.m_strNodeRightHTMLRoot; } else { - return Control.NodeRightHTMLRoot; + return this.Control.NodeRightHTMLRoot; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeRightHTMLRoot = value; + this.m_strNodeRightHTMLRoot = value; } else { - Control.NodeRightHTMLRoot = value; + this.Control.NodeRightHTMLRoot = value; } } } @@ -769,25 +769,25 @@ public string NodeLeftHTMLSub { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeLeftHTMLSub; + return this.m_strNodeLeftHTMLSub; } else { - return Control.NodeLeftHTMLSub; + return this.Control.NodeLeftHTMLSub; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeLeftHTMLSub = value; + this.m_strNodeLeftHTMLSub = value; } else { - Control.NodeLeftHTMLSub = value; + this.Control.NodeLeftHTMLSub = value; } } } @@ -796,25 +796,25 @@ public string NodeRightHTMLSub { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeRightHTMLSub; + return this.m_strNodeRightHTMLSub; } else { - return Control.NodeRightHTMLSub; + return this.Control.NodeRightHTMLSub; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeRightHTMLSub = value; + this.m_strNodeRightHTMLSub = value; } else { - Control.NodeRightHTMLSub = value; + this.Control.NodeRightHTMLSub = value; } } } @@ -823,25 +823,25 @@ public string NodeLeftHTMLBreadCrumbRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeLeftHTMLBreadCrumbRoot; + return this.m_strNodeLeftHTMLBreadCrumbRoot; } else { - return Control.NodeLeftHTMLBreadCrumbRoot; + return this.Control.NodeLeftHTMLBreadCrumbRoot; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeLeftHTMLBreadCrumbRoot = value; + this.m_strNodeLeftHTMLBreadCrumbRoot = value; } else { - Control.NodeLeftHTMLBreadCrumbRoot = value; + this.Control.NodeLeftHTMLBreadCrumbRoot = value; } } } @@ -850,25 +850,25 @@ public string NodeLeftHTMLBreadCrumbSub { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeLeftHTMLBreadCrumbSub; + return this.m_strNodeLeftHTMLBreadCrumbSub; } else { - return Control.NodeLeftHTMLBreadCrumbSub; + return this.Control.NodeLeftHTMLBreadCrumbSub; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeLeftHTMLBreadCrumbSub = value; + this.m_strNodeLeftHTMLBreadCrumbSub = value; } else { - Control.NodeLeftHTMLBreadCrumbSub = value; + this.Control.NodeLeftHTMLBreadCrumbSub = value; } } } @@ -877,25 +877,25 @@ public string NodeRightHTMLBreadCrumbRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeRightHTMLBreadCrumbRoot; + return this.m_strNodeRightHTMLBreadCrumbRoot; } else { - return Control.NodeRightHTMLBreadCrumbRoot; + return this.Control.NodeRightHTMLBreadCrumbRoot; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeRightHTMLBreadCrumbRoot = value; + this.m_strNodeRightHTMLBreadCrumbRoot = value; } else { - Control.NodeRightHTMLBreadCrumbRoot = value; + this.Control.NodeRightHTMLBreadCrumbRoot = value; } } } @@ -904,25 +904,25 @@ public string NodeRightHTMLBreadCrumbSub { get { - if (Control == null) + if (this.Control == null) { - return m_strNodeRightHTMLBreadCrumbSub; + return this.m_strNodeRightHTMLBreadCrumbSub; } else { - return Control.NodeRightHTMLBreadCrumbSub; + return this.Control.NodeRightHTMLBreadCrumbSub; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strNodeRightHTMLBreadCrumbSub = value; + this.m_strNodeRightHTMLBreadCrumbSub = value; } else { - Control.NodeRightHTMLBreadCrumbSub = value; + this.Control.NodeRightHTMLBreadCrumbSub = value; } } } @@ -931,25 +931,25 @@ public string SeparatorHTML { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorHTML; + return this.m_strSeparatorHTML; } else { - return Control.SeparatorHTML; + return this.Control.SeparatorHTML; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorHTML = value; + this.m_strSeparatorHTML = value; } else { - Control.SeparatorHTML = value; + this.Control.SeparatorHTML = value; } } } @@ -958,25 +958,25 @@ public string SeparatorLeftHTML { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorLeftHTML; + return this.m_strSeparatorLeftHTML; } else { - return Control.SeparatorLeftHTML; + return this.Control.SeparatorLeftHTML; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorLeftHTML = value; + this.m_strSeparatorLeftHTML = value; } else { - Control.SeparatorLeftHTML = value; + this.Control.SeparatorLeftHTML = value; } } } @@ -985,25 +985,25 @@ public string SeparatorRightHTML { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorRightHTML; + return this.m_strSeparatorRightHTML; } else { - return Control.SeparatorRightHTML; + return this.Control.SeparatorRightHTML; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorRightHTML = value; + this.m_strSeparatorRightHTML = value; } else { - Control.SeparatorRightHTML = value; + this.Control.SeparatorRightHTML = value; } } } @@ -1012,25 +1012,25 @@ public string SeparatorLeftHTMLActive { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorLeftHTMLActive; + return this.m_strSeparatorLeftHTMLActive; } else { - return Control.SeparatorLeftHTMLActive; + return this.Control.SeparatorLeftHTMLActive; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorLeftHTMLActive = value; + this.m_strSeparatorLeftHTMLActive = value; } else { - Control.SeparatorLeftHTMLActive = value; + this.Control.SeparatorLeftHTMLActive = value; } } } @@ -1039,25 +1039,25 @@ public string SeparatorRightHTMLActive { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorRightHTMLActive; + return this.m_strSeparatorRightHTMLActive; } else { - return Control.SeparatorRightHTMLActive; + return this.Control.SeparatorRightHTMLActive; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorRightHTMLActive = value; + this.m_strSeparatorRightHTMLActive = value; } else { - Control.SeparatorRightHTMLActive = value; + this.Control.SeparatorRightHTMLActive = value; } } } @@ -1066,25 +1066,25 @@ public string SeparatorLeftHTMLBreadCrumb { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorLeftHTMLBreadCrumb; + return this.m_strSeparatorLeftHTMLBreadCrumb; } else { - return Control.SeparatorLeftHTMLBreadCrumb; + return this.Control.SeparatorLeftHTMLBreadCrumb; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorLeftHTMLBreadCrumb = value; + this.m_strSeparatorLeftHTMLBreadCrumb = value; } else { - Control.SeparatorLeftHTMLBreadCrumb = value; + this.Control.SeparatorLeftHTMLBreadCrumb = value; } } } @@ -1093,25 +1093,25 @@ public string SeparatorRightHTMLBreadCrumb { get { - if (Control == null) + if (this.Control == null) { - return m_strSeparatorRightHTMLBreadCrumb; + return this.m_strSeparatorRightHTMLBreadCrumb; } else { - return Control.SeparatorRightHTMLBreadCrumb; + return this.Control.SeparatorRightHTMLBreadCrumb; } } set { - value = GetPath(value); - if (Control == null) + value = this.GetPath(value); + if (this.Control == null) { - m_strSeparatorRightHTMLBreadCrumb = value; + this.m_strSeparatorRightHTMLBreadCrumb = value; } else { - Control.SeparatorRightHTMLBreadCrumb = value; + this.Control.SeparatorRightHTMLBreadCrumb = value; } } } @@ -1120,24 +1120,24 @@ public string CSSControl { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSControl; + return this.m_strCSSControl; } else { - return Control.CSSControl; + return this.Control.CSSControl; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSControl = value; + this.m_strCSSControl = value; } else { - Control.CSSControl = value; + this.Control.CSSControl = value; } } } @@ -1146,24 +1146,24 @@ public string CSSContainerRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSContainerRoot; + return this.m_strCSSContainerRoot; } else { - return Control.CSSContainerRoot; + return this.Control.CSSContainerRoot; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSContainerRoot = value; + this.m_strCSSContainerRoot = value; } else { - Control.CSSContainerRoot = value; + this.Control.CSSContainerRoot = value; } } } @@ -1172,24 +1172,24 @@ public string CSSNode { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNode; + return this.m_strCSSNode; } else { - return Control.CSSNode; + return this.Control.CSSNode; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNode = value; + this.m_strCSSNode = value; } else { - Control.CSSNode = value; + this.Control.CSSNode = value; } } } @@ -1198,24 +1198,24 @@ public string CSSIcon { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSIcon; + return this.m_strCSSIcon; } else { - return Control.CSSIcon; + return this.Control.CSSIcon; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSIcon = value; + this.m_strCSSIcon = value; } else { - Control.CSSIcon = value; + this.Control.CSSIcon = value; } } } @@ -1224,24 +1224,24 @@ public string CSSContainerSub { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSContainerSub; + return this.m_strCSSContainerSub; } else { - return Control.CSSContainerSub; + return this.Control.CSSContainerSub; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSContainerSub = value; + this.m_strCSSContainerSub = value; } else { - Control.CSSContainerSub = value; + this.Control.CSSContainerSub = value; } } } @@ -1250,24 +1250,24 @@ public string CSSNodeHover { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNodeHover; + return this.m_strCSSNodeHover; } else { - return Control.CSSNodeHover; + return this.Control.CSSNodeHover; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNodeHover = value; + this.m_strCSSNodeHover = value; } else { - Control.CSSNodeHover = value; + this.Control.CSSNodeHover = value; } } } @@ -1276,24 +1276,24 @@ public string CSSBreak { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSBreak; + return this.m_strCSSBreak; } else { - return Control.CSSBreak; + return this.Control.CSSBreak; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSBreak = value; + this.m_strCSSBreak = value; } else { - Control.CSSBreak = value; + this.Control.CSSBreak = value; } } } @@ -1302,24 +1302,24 @@ public string CSSIndicateChildSub { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSIndicateChildSub; + return this.m_strCSSIndicateChildSub; } else { - return Control.CSSIndicateChildSub; + return this.Control.CSSIndicateChildSub; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSIndicateChildSub = value; + this.m_strCSSIndicateChildSub = value; } else { - Control.CSSIndicateChildSub = value; + this.Control.CSSIndicateChildSub = value; } } } @@ -1328,24 +1328,24 @@ public string CSSIndicateChildRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSIndicateChildRoot; + return this.m_strCSSIndicateChildRoot; } else { - return Control.CSSIndicateChildRoot; + return this.Control.CSSIndicateChildRoot; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSIndicateChildRoot = value; + this.m_strCSSIndicateChildRoot = value; } else { - Control.CSSIndicateChildRoot = value; + this.Control.CSSIndicateChildRoot = value; } } } @@ -1354,24 +1354,24 @@ public string CSSBreadCrumbRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSBreadCrumbRoot; + return this.m_strCSSBreadCrumbRoot; } else { - return Control.CSSBreadCrumbRoot; + return this.Control.CSSBreadCrumbRoot; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSBreadCrumbRoot = value; + this.m_strCSSBreadCrumbRoot = value; } else { - Control.CSSBreadCrumbRoot = value; + this.Control.CSSBreadCrumbRoot = value; } } } @@ -1380,24 +1380,24 @@ public string CSSBreadCrumbSub { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSBreadCrumbSub; + return this.m_strCSSBreadCrumbSub; } else { - return Control.CSSBreadCrumbSub; + return this.Control.CSSBreadCrumbSub; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSBreadCrumbSub = value; + this.m_strCSSBreadCrumbSub = value; } else { - Control.CSSBreadCrumbSub = value; + this.Control.CSSBreadCrumbSub = value; } } } @@ -1406,24 +1406,24 @@ public string CSSNodeRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNodeRoot; + return this.m_strCSSNodeRoot; } else { - return Control.CSSNodeRoot; + return this.Control.CSSNodeRoot; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNodeRoot = value; + this.m_strCSSNodeRoot = value; } else { - Control.CSSNodeRoot = value; + this.Control.CSSNodeRoot = value; } } } @@ -1432,24 +1432,24 @@ public string CSSNodeSelectedRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNodeSelectedRoot; + return this.m_strCSSNodeSelectedRoot; } else { - return Control.CSSNodeSelectedRoot; + return this.Control.CSSNodeSelectedRoot; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNodeSelectedRoot = value; + this.m_strCSSNodeSelectedRoot = value; } else { - Control.CSSNodeSelectedRoot = value; + this.Control.CSSNodeSelectedRoot = value; } } } @@ -1458,24 +1458,24 @@ public string CSSNodeSelectedSub { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNodeSelectedSub; + return this.m_strCSSNodeSelectedSub; } else { - return Control.CSSNodeSelectedSub; + return this.Control.CSSNodeSelectedSub; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNodeSelectedSub = value; + this.m_strCSSNodeSelectedSub = value; } else { - Control.CSSNodeSelectedSub = value; + this.Control.CSSNodeSelectedSub = value; } } } @@ -1484,24 +1484,24 @@ public string CSSNodeHoverRoot { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNodeHoverRoot; + return this.m_strCSSNodeHoverRoot; } else { - return Control.CSSNodeHoverRoot; + return this.Control.CSSNodeHoverRoot; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNodeHoverRoot = value; + this.m_strCSSNodeHoverRoot = value; } else { - Control.CSSNodeHoverRoot = value; + this.Control.CSSNodeHoverRoot = value; } } } @@ -1510,24 +1510,24 @@ public string CSSNodeHoverSub { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSNodeHoverSub; + return this.m_strCSSNodeHoverSub; } else { - return Control.CSSNodeHoverSub; + return this.Control.CSSNodeHoverSub; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSNodeHoverSub = value; + this.m_strCSSNodeHoverSub = value; } else { - Control.CSSNodeHoverSub = value; + this.Control.CSSNodeHoverSub = value; } } } @@ -1536,24 +1536,24 @@ public string CSSSeparator { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSSeparator; + return this.m_strCSSSeparator; } else { - return Control.CSSSeparator; + return this.Control.CSSSeparator; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSSeparator = value; + this.m_strCSSSeparator = value; } else { - Control.CSSSeparator = value; + this.Control.CSSSeparator = value; } } } @@ -1562,24 +1562,24 @@ public string CSSLeftSeparator { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSLeftSeparator; + return this.m_strCSSLeftSeparator; } else { - return Control.CSSLeftSeparator; + return this.Control.CSSLeftSeparator; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSLeftSeparator = value; + this.m_strCSSLeftSeparator = value; } else { - Control.CSSLeftSeparator = value; + this.Control.CSSLeftSeparator = value; } } } @@ -1588,24 +1588,24 @@ public string CSSRightSeparator { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSRightSeparator; + return this.m_strCSSRightSeparator; } else { - return Control.CSSRightSeparator; + return this.Control.CSSRightSeparator; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSRightSeparator = value; + this.m_strCSSRightSeparator = value; } else { - Control.CSSRightSeparator = value; + this.Control.CSSRightSeparator = value; } } } @@ -1614,24 +1614,24 @@ public string CSSLeftSeparatorSelection { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSLeftSeparatorSelection; + return this.m_strCSSLeftSeparatorSelection; } else { - return Control.CSSLeftSeparatorSelection; + return this.Control.CSSLeftSeparatorSelection; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSLeftSeparatorSelection = value; + this.m_strCSSLeftSeparatorSelection = value; } else { - Control.CSSLeftSeparatorSelection = value; + this.Control.CSSLeftSeparatorSelection = value; } } } @@ -1640,24 +1640,24 @@ public string CSSRightSeparatorSelection { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSRightSeparatorSelection; + return this.m_strCSSRightSeparatorSelection; } else { - return Control.CSSRightSeparatorSelection; + return this.Control.CSSRightSeparatorSelection; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSRightSeparatorSelection = value; + this.m_strCSSRightSeparatorSelection = value; } else { - Control.CSSRightSeparatorSelection = value; + this.Control.CSSRightSeparatorSelection = value; } } } @@ -1666,24 +1666,24 @@ public string CSSLeftSeparatorBreadCrumb { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSLeftSeparatorBreadCrumb; + return this.m_strCSSLeftSeparatorBreadCrumb; } else { - return Control.CSSLeftSeparatorBreadCrumb; + return this.Control.CSSLeftSeparatorBreadCrumb; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSLeftSeparatorBreadCrumb = value; + this.m_strCSSLeftSeparatorBreadCrumb = value; } else { - Control.CSSLeftSeparatorBreadCrumb = value; + this.Control.CSSLeftSeparatorBreadCrumb = value; } } } @@ -1692,24 +1692,24 @@ public string CSSRightSeparatorBreadCrumb { get { - if (Control == null) + if (this.Control == null) { - return m_strCSSRightSeparatorBreadCrumb; + return this.m_strCSSRightSeparatorBreadCrumb; } else { - return Control.CSSRightSeparatorBreadCrumb; + return this.Control.CSSRightSeparatorBreadCrumb; } } set { - if (Control == null) + if (this.Control == null) { - m_strCSSRightSeparatorBreadCrumb = value; + this.m_strCSSRightSeparatorBreadCrumb = value; } else { - Control.CSSRightSeparatorBreadCrumb = value; + this.Control.CSSRightSeparatorBreadCrumb = value; } } } @@ -1718,24 +1718,24 @@ public string StyleBackColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleBackColor; + return this.m_strStyleBackColor; } else { - return Control.StyleBackColor; + return this.Control.StyleBackColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleBackColor = value; + this.m_strStyleBackColor = value; } else { - Control.StyleBackColor = value; + this.Control.StyleBackColor = value; } } } @@ -1744,24 +1744,24 @@ public string StyleForeColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleForeColor; + return this.m_strStyleForeColor; } else { - return Control.StyleForeColor; + return this.Control.StyleForeColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleForeColor = value; + this.m_strStyleForeColor = value; } else { - Control.StyleForeColor = value; + this.Control.StyleForeColor = value; } } } @@ -1770,24 +1770,24 @@ public string StyleHighlightColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleHighlightColor; + return this.m_strStyleHighlightColor; } else { - return Control.StyleHighlightColor; + return this.Control.StyleHighlightColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleHighlightColor = value; + this.m_strStyleHighlightColor = value; } else { - Control.StyleHighlightColor = value; + this.Control.StyleHighlightColor = value; } } } @@ -1796,24 +1796,24 @@ public string StyleIconBackColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleIconBackColor; + return this.m_strStyleIconBackColor; } else { - return Control.StyleIconBackColor; + return this.Control.StyleIconBackColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleIconBackColor = value; + this.m_strStyleIconBackColor = value; } else { - Control.StyleIconBackColor = value; + this.Control.StyleIconBackColor = value; } } } @@ -1822,24 +1822,24 @@ public string StyleSelectionBorderColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleSelectionBorderColor; + return this.m_strStyleSelectionBorderColor; } else { - return Control.StyleSelectionBorderColor; + return this.Control.StyleSelectionBorderColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleSelectionBorderColor = value; + this.m_strStyleSelectionBorderColor = value; } else { - Control.StyleSelectionBorderColor = value; + this.Control.StyleSelectionBorderColor = value; } } } @@ -1848,24 +1848,24 @@ public string StyleSelectionColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleSelectionColor; + return this.m_strStyleSelectionColor; } else { - return Control.StyleSelectionColor; + return this.Control.StyleSelectionColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleSelectionColor = value; + this.m_strStyleSelectionColor = value; } else { - Control.StyleSelectionColor = value; + this.Control.StyleSelectionColor = value; } } } @@ -1874,24 +1874,24 @@ public string StyleSelectionForeColor { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleSelectionForeColor; + return this.m_strStyleSelectionForeColor; } else { - return Control.StyleSelectionForeColor; + return this.Control.StyleSelectionForeColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleSelectionForeColor = value; + this.m_strStyleSelectionForeColor = value; } else { - Control.StyleSelectionForeColor = value; + this.Control.StyleSelectionForeColor = value; } } } @@ -1900,24 +1900,24 @@ public string StyleControlHeight { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleControlHeight; + return this.m_strStyleControlHeight; } else { - return Control.StyleControlHeight.ToString(); + return this.Control.StyleControlHeight.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleControlHeight = value; + this.m_strStyleControlHeight = value; } else { - Control.StyleControlHeight = Convert.ToDecimal(value); + this.Control.StyleControlHeight = Convert.ToDecimal(value); } } } @@ -1926,24 +1926,24 @@ public string StyleBorderWidth { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleBorderWidth; + return this.m_strStyleBorderWidth; } else { - return Control.StyleBorderWidth.ToString(); + return this.Control.StyleBorderWidth.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleBorderWidth = value; + this.m_strStyleBorderWidth = value; } else { - Control.StyleBorderWidth = Convert.ToDecimal(value); + this.Control.StyleBorderWidth = Convert.ToDecimal(value); } } } @@ -1952,24 +1952,24 @@ public string StyleNodeHeight { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleNodeHeight; + return this.m_strStyleNodeHeight; } else { - return Control.StyleNodeHeight.ToString(); + return this.Control.StyleNodeHeight.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleNodeHeight = value; + this.m_strStyleNodeHeight = value; } else { - Control.StyleNodeHeight = Convert.ToDecimal(value); + this.Control.StyleNodeHeight = Convert.ToDecimal(value); } } } @@ -1978,24 +1978,24 @@ public string StyleIconWidth { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleIconWidth; + return this.m_strStyleIconWidth; } else { - return Control.StyleIconWidth.ToString(); + return this.Control.StyleIconWidth.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleIconWidth = value; + this.m_strStyleIconWidth = value; } else { - Control.StyleIconWidth = Convert.ToDecimal(value); + this.Control.StyleIconWidth = Convert.ToDecimal(value); } } } @@ -2004,24 +2004,24 @@ public string StyleFontNames { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleFontNames; + return this.m_strStyleFontNames; } else { - return Control.StyleFontNames; + return this.Control.StyleFontNames; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleFontNames = value; + this.m_strStyleFontNames = value; } else { - Control.StyleFontNames = value; + this.Control.StyleFontNames = value; } } } @@ -2030,24 +2030,24 @@ public string StyleFontSize { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleFontSize; + return this.m_strStyleFontSize; } else { - return Control.StyleFontSize.ToString(); + return this.Control.StyleFontSize.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleFontSize = value; + this.m_strStyleFontSize = value; } else { - Control.StyleFontSize = Convert.ToDecimal(value); + this.Control.StyleFontSize = Convert.ToDecimal(value); } } } @@ -2056,24 +2056,24 @@ public string StyleFontBold { get { - if (Control == null) + if (this.Control == null) { - return m_strStyleFontBold; + return this.m_strStyleFontBold; } else { - return Control.StyleFontBold; + return this.Control.StyleFontBold; } } set { - if (Control == null) + if (this.Control == null) { - m_strStyleFontBold = value; + this.m_strStyleFontBold = value; } else { - Control.StyleFontBold = value; + this.Control.StyleFontBold = value; } } } @@ -2082,24 +2082,24 @@ public string EffectsShadowColor { get { - if (Control == null) + if (this.Control == null) { - return m_strEffectsShadowColor; + return this.m_strEffectsShadowColor; } else { - return Control.EffectsShadowColor; + return this.Control.EffectsShadowColor; } } set { - if (Control == null) + if (this.Control == null) { - m_strEffectsShadowColor = value; + this.m_strEffectsShadowColor = value; } else { - Control.EffectsShadowColor = value; + this.Control.EffectsShadowColor = value; } } } @@ -2108,24 +2108,24 @@ public string EffectsStyle { get { - if (Control == null) + if (this.Control == null) { - return m_strEffectsStyle; + return this.m_strEffectsStyle; } else { - return Control.EffectsStyle; + return this.Control.EffectsStyle; } } set { - if (Control == null) + if (this.Control == null) { - m_strEffectsStyle = value; + this.m_strEffectsStyle = value; } else { - Control.EffectsStyle = value; + this.Control.EffectsStyle = value; } } } @@ -2134,24 +2134,24 @@ public string EffectsShadowStrength { get { - if (Control == null) + if (this.Control == null) { - return m_strEffectsShadowStrength; + return this.m_strEffectsShadowStrength; } else { - return Control.EffectsShadowStrength.ToString(); + return this.Control.EffectsShadowStrength.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strEffectsShadowStrength = value; + this.m_strEffectsShadowStrength = value; } else { - Control.EffectsShadowStrength = Convert.ToInt32(value); + this.Control.EffectsShadowStrength = Convert.ToInt32(value); } } } @@ -2160,24 +2160,24 @@ public string EffectsTransition { get { - if (Control == null) + if (this.Control == null) { - return m_strEffectsTransition; + return this.m_strEffectsTransition; } else { - return Control.EffectsTransition; + return this.Control.EffectsTransition; } } set { - if (Control == null) + if (this.Control == null) { - m_strEffectsTransition = value; + this.m_strEffectsTransition = value; } else { - Control.EffectsTransition = value; + this.Control.EffectsTransition = value; } } } @@ -2186,24 +2186,24 @@ public string EffectsDuration { get { - if (Control == null) + if (this.Control == null) { - return m_strEffectsDuration; + return this.m_strEffectsDuration; } else { - return Control.EffectsDuration.ToString(); + return this.Control.EffectsDuration.ToString(); } } set { - if (Control == null) + if (this.Control == null) { - m_strEffectsDuration = value; + this.m_strEffectsDuration = value; } else { - Control.EffectsDuration = Convert.ToDouble(value); + this.Control.EffectsDuration = Convert.ToDouble(value); } } } @@ -2212,24 +2212,24 @@ public string EffectsShadowDirection { get { - if (Control == null) + if (this.Control == null) { - return m_strEffectsShadowDirection; + return this.m_strEffectsShadowDirection; } else { - return Control.EffectsShadowDirection; + return this.Control.EffectsShadowDirection; } } set { - if (Control == null) + if (this.Control == null) { - m_strEffectsShadowDirection = value; + this.m_strEffectsShadowDirection = value; } else { - Control.EffectsShadowDirection = value; + this.Control.EffectsShadowDirection = value; } } } @@ -2240,12 +2240,12 @@ public string EffectsShadowDirection public DNNNodeCollection GetNavigationNodes(DNNNode objNode) { - int intRootParent = PortalSettings.ActiveTab.TabID; + int intRootParent = this.PortalSettings.ActiveTab.TabID; DNNNodeCollection objNodes = null; Navigation.ToolTipSource eToolTips; int intNavNodeOptions = 0; - int intDepth = ExpandDepth; - switch (Level.ToLowerInvariant()) + int intDepth = this.ExpandDepth; + switch (this.Level.ToLowerInvariant()) { case "child": break; @@ -2261,9 +2261,9 @@ public DNNNodeCollection GetNavigationNodes(DNNNode objNode) break; } - if (ShowHiddenTabs) intNavNodeOptions += (int) Navigation.NavNodeOptions.IncludeHiddenNodes; + if (this.ShowHiddenTabs) intNavNodeOptions += (int) Navigation.NavNodeOptions.IncludeHiddenNodes; - switch (ToolTip.ToLowerInvariant()) + switch (this.ToolTip.ToLowerInvariant()) { case "name": eToolTips = Navigation.ToolTipSource.TabName; @@ -2278,17 +2278,17 @@ public DNNNodeCollection GetNavigationNodes(DNNNode objNode) eToolTips = Navigation.ToolTipSource.None; break; } - if (PopulateNodesFromClient && Control.SupportsPopulateOnDemand) + if (this.PopulateNodesFromClient && this.Control.SupportsPopulateOnDemand) { intNavNodeOptions += (int) Navigation.NavNodeOptions.MarkPendingNodes; } - if (PopulateNodesFromClient && Control.SupportsPopulateOnDemand == false) + if (this.PopulateNodesFromClient && this.Control.SupportsPopulateOnDemand == false) { - ExpandDepth = -1; + this.ExpandDepth = -1; } - if (StartTabId != -1) + if (this.StartTabId != -1) { - intRootParent = StartTabId; + intRootParent = this.StartTabId; } if (objNode != null) { @@ -2298,7 +2298,7 @@ public DNNNodeCollection GetNavigationNodes(DNNNode objNode) } else { - objNodes = Navigation.GetNavigationNodes(Control.ClientID, eToolTips, intRootParent, intDepth, intNavNodeOptions); + objNodes = Navigation.GetNavigationNodes(this.Control.ClientID, eToolTips, intRootParent, intDepth, intNavNodeOptions); } return objNodes; } @@ -2321,15 +2321,15 @@ protected string GetValue(string strVal, string strDefault) protected void InitializeNavControl(Control objParent, string strDefaultProvider) { - if (String.IsNullOrEmpty(ProviderName)) + if (String.IsNullOrEmpty(this.ProviderName)) { - ProviderName = strDefaultProvider; + this.ProviderName = strDefaultProvider; } - m_objControl = NavigationProvider.Instance(ProviderName); - Control.ControlID = "ctl" + ID; - Control.Initialize(); - AssignControlProperties(); - objParent.Controls.Add(Control.NavigationControl); + this.m_objControl = NavigationProvider.Instance(this.ProviderName); + this.Control.ControlID = "ctl" + this.ID; + this.Control.Initialize(); + this.AssignControlProperties(); + objParent.Controls.Add(this.Control.NavigationControl); } #endregion @@ -2338,343 +2338,343 @@ protected void InitializeNavControl(Control objParent, string strDefaultProvider private void AssignControlProperties() { - if (!String.IsNullOrEmpty(m_strPathSystemImage)) + if (!String.IsNullOrEmpty(this.m_strPathSystemImage)) { - Control.PathSystemImage = m_strPathSystemImage; + this.Control.PathSystemImage = this.m_strPathSystemImage; } - if (!String.IsNullOrEmpty(m_strPathImage)) + if (!String.IsNullOrEmpty(this.m_strPathImage)) { - Control.PathImage = m_strPathImage; + this.Control.PathImage = this.m_strPathImage; } - if (!String.IsNullOrEmpty(m_strPathSystemScript)) + if (!String.IsNullOrEmpty(this.m_strPathSystemScript)) { - Control.PathSystemScript = m_strPathSystemScript; + this.Control.PathSystemScript = this.m_strPathSystemScript; } - if (!String.IsNullOrEmpty(m_strWorkImage)) + if (!String.IsNullOrEmpty(this.m_strWorkImage)) { - Control.WorkImage = m_strWorkImage; + this.Control.WorkImage = this.m_strWorkImage; } - if (!String.IsNullOrEmpty(m_strControlOrientation)) + if (!String.IsNullOrEmpty(this.m_strControlOrientation)) { - switch (m_strControlOrientation.ToLowerInvariant()) + switch (this.m_strControlOrientation.ToLowerInvariant()) { case "horizontal": - Control.ControlOrientation = NavigationProvider.Orientation.Horizontal; + this.Control.ControlOrientation = NavigationProvider.Orientation.Horizontal; break; case "vertical": - Control.ControlOrientation = NavigationProvider.Orientation.Vertical; + this.Control.ControlOrientation = NavigationProvider.Orientation.Vertical; break; } } - if (!String.IsNullOrEmpty(m_strControlAlignment)) + if (!String.IsNullOrEmpty(this.m_strControlAlignment)) { - switch (m_strControlAlignment.ToLowerInvariant()) + switch (this.m_strControlAlignment.ToLowerInvariant()) { case "left": - Control.ControlAlignment = NavigationProvider.Alignment.Left; + this.Control.ControlAlignment = NavigationProvider.Alignment.Left; break; case "right": - Control.ControlAlignment = NavigationProvider.Alignment.Right; + this.Control.ControlAlignment = NavigationProvider.Alignment.Right; break; case "center": - Control.ControlAlignment = NavigationProvider.Alignment.Center; + this.Control.ControlAlignment = NavigationProvider.Alignment.Center; break; case "justify": - Control.ControlAlignment = NavigationProvider.Alignment.Justify; + this.Control.ControlAlignment = NavigationProvider.Alignment.Justify; break; } } - Control.ForceCrawlerDisplay = GetValue(m_strForceCrawlerDisplay, "False"); - Control.ForceDownLevel = GetValue(m_strForceDownLevel, "False"); - if (!String.IsNullOrEmpty(m_strMouseOutHideDelay)) + this.Control.ForceCrawlerDisplay = this.GetValue(this.m_strForceCrawlerDisplay, "False"); + this.Control.ForceDownLevel = this.GetValue(this.m_strForceDownLevel, "False"); + if (!String.IsNullOrEmpty(this.m_strMouseOutHideDelay)) { - Control.MouseOutHideDelay = Convert.ToDecimal(m_strMouseOutHideDelay); + this.Control.MouseOutHideDelay = Convert.ToDecimal(this.m_strMouseOutHideDelay); } - if (!String.IsNullOrEmpty(m_strMouseOverDisplay)) + if (!String.IsNullOrEmpty(this.m_strMouseOverDisplay)) { - switch (m_strMouseOverDisplay.ToLowerInvariant()) + switch (this.m_strMouseOverDisplay.ToLowerInvariant()) { case "highlight": - Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Highlight; + this.Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Highlight; break; case "outset": - Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Outset; + this.Control.MouseOverDisplay = NavigationProvider.HoverDisplay.Outset; break; case "none": - Control.MouseOverDisplay = NavigationProvider.HoverDisplay.None; + this.Control.MouseOverDisplay = NavigationProvider.HoverDisplay.None; break; } } - if (Convert.ToBoolean(GetValue(m_strMouseOverAction, "True"))) + if (Convert.ToBoolean(this.GetValue(this.m_strMouseOverAction, "True"))) { - Control.MouseOverAction = NavigationProvider.HoverAction.Expand; + this.Control.MouseOverAction = NavigationProvider.HoverAction.Expand; } else { - Control.MouseOverAction = NavigationProvider.HoverAction.None; + this.Control.MouseOverAction = NavigationProvider.HoverAction.None; } - Control.IndicateChildren = Convert.ToBoolean(GetValue(m_strIndicateChildren, "True")); - if (!String.IsNullOrEmpty(m_strIndicateChildImageRoot)) + this.Control.IndicateChildren = Convert.ToBoolean(this.GetValue(this.m_strIndicateChildren, "True")); + if (!String.IsNullOrEmpty(this.m_strIndicateChildImageRoot)) { - Control.IndicateChildImageRoot = m_strIndicateChildImageRoot; + this.Control.IndicateChildImageRoot = this.m_strIndicateChildImageRoot; } - if (!String.IsNullOrEmpty(m_strIndicateChildImageSub)) + if (!String.IsNullOrEmpty(this.m_strIndicateChildImageSub)) { - Control.IndicateChildImageSub = m_strIndicateChildImageSub; + this.Control.IndicateChildImageSub = this.m_strIndicateChildImageSub; } - if (!String.IsNullOrEmpty(m_strIndicateChildImageExpandedRoot)) + if (!String.IsNullOrEmpty(this.m_strIndicateChildImageExpandedRoot)) { - Control.IndicateChildImageExpandedRoot = m_strIndicateChildImageExpandedRoot; + this.Control.IndicateChildImageExpandedRoot = this.m_strIndicateChildImageExpandedRoot; } - if (!String.IsNullOrEmpty(m_strIndicateChildImageExpandedSub)) + if (!String.IsNullOrEmpty(this.m_strIndicateChildImageExpandedSub)) { - Control.IndicateChildImageExpandedSub = m_strIndicateChildImageExpandedSub; + this.Control.IndicateChildImageExpandedSub = this.m_strIndicateChildImageExpandedSub; } - if (!String.IsNullOrEmpty(m_strNodeLeftHTMLRoot)) + if (!String.IsNullOrEmpty(this.m_strNodeLeftHTMLRoot)) { - Control.NodeLeftHTMLRoot = m_strNodeLeftHTMLRoot; + this.Control.NodeLeftHTMLRoot = this.m_strNodeLeftHTMLRoot; } - if (!String.IsNullOrEmpty(m_strNodeRightHTMLRoot)) + if (!String.IsNullOrEmpty(this.m_strNodeRightHTMLRoot)) { - Control.NodeRightHTMLRoot = m_strNodeRightHTMLRoot; + this.Control.NodeRightHTMLRoot = this.m_strNodeRightHTMLRoot; } - if (!String.IsNullOrEmpty(m_strNodeLeftHTMLSub)) + if (!String.IsNullOrEmpty(this.m_strNodeLeftHTMLSub)) { - Control.NodeLeftHTMLSub = m_strNodeLeftHTMLSub; + this.Control.NodeLeftHTMLSub = this.m_strNodeLeftHTMLSub; } - if (!String.IsNullOrEmpty(m_strNodeRightHTMLSub)) + if (!String.IsNullOrEmpty(this.m_strNodeRightHTMLSub)) { - Control.NodeRightHTMLSub = m_strNodeRightHTMLSub; + this.Control.NodeRightHTMLSub = this.m_strNodeRightHTMLSub; } - if (!String.IsNullOrEmpty(m_strNodeLeftHTMLBreadCrumbRoot)) + if (!String.IsNullOrEmpty(this.m_strNodeLeftHTMLBreadCrumbRoot)) { - Control.NodeLeftHTMLBreadCrumbRoot = m_strNodeLeftHTMLBreadCrumbRoot; + this.Control.NodeLeftHTMLBreadCrumbRoot = this.m_strNodeLeftHTMLBreadCrumbRoot; } - if (!String.IsNullOrEmpty(m_strNodeLeftHTMLBreadCrumbSub)) + if (!String.IsNullOrEmpty(this.m_strNodeLeftHTMLBreadCrumbSub)) { - Control.NodeLeftHTMLBreadCrumbSub = m_strNodeLeftHTMLBreadCrumbSub; + this.Control.NodeLeftHTMLBreadCrumbSub = this.m_strNodeLeftHTMLBreadCrumbSub; } - if (!String.IsNullOrEmpty(m_strNodeRightHTMLBreadCrumbRoot)) + if (!String.IsNullOrEmpty(this.m_strNodeRightHTMLBreadCrumbRoot)) { - Control.NodeRightHTMLBreadCrumbRoot = m_strNodeRightHTMLBreadCrumbRoot; + this.Control.NodeRightHTMLBreadCrumbRoot = this.m_strNodeRightHTMLBreadCrumbRoot; } - if (!String.IsNullOrEmpty(m_strNodeRightHTMLBreadCrumbSub)) + if (!String.IsNullOrEmpty(this.m_strNodeRightHTMLBreadCrumbSub)) { - Control.NodeRightHTMLBreadCrumbSub = m_strNodeRightHTMLBreadCrumbSub; + this.Control.NodeRightHTMLBreadCrumbSub = this.m_strNodeRightHTMLBreadCrumbSub; } - if (!String.IsNullOrEmpty(m_strSeparatorHTML)) + if (!String.IsNullOrEmpty(this.m_strSeparatorHTML)) { - Control.SeparatorHTML = m_strSeparatorHTML; + this.Control.SeparatorHTML = this.m_strSeparatorHTML; } - if (!String.IsNullOrEmpty(m_strSeparatorLeftHTML)) + if (!String.IsNullOrEmpty(this.m_strSeparatorLeftHTML)) { - Control.SeparatorLeftHTML = m_strSeparatorLeftHTML; + this.Control.SeparatorLeftHTML = this.m_strSeparatorLeftHTML; } - if (!String.IsNullOrEmpty(m_strSeparatorRightHTML)) + if (!String.IsNullOrEmpty(this.m_strSeparatorRightHTML)) { - Control.SeparatorRightHTML = m_strSeparatorRightHTML; + this.Control.SeparatorRightHTML = this.m_strSeparatorRightHTML; } - if (!String.IsNullOrEmpty(m_strSeparatorLeftHTMLActive)) + if (!String.IsNullOrEmpty(this.m_strSeparatorLeftHTMLActive)) { - Control.SeparatorLeftHTMLActive = m_strSeparatorLeftHTMLActive; + this.Control.SeparatorLeftHTMLActive = this.m_strSeparatorLeftHTMLActive; } - if (!String.IsNullOrEmpty(m_strSeparatorRightHTMLActive)) + if (!String.IsNullOrEmpty(this.m_strSeparatorRightHTMLActive)) { - Control.SeparatorRightHTMLActive = m_strSeparatorRightHTMLActive; + this.Control.SeparatorRightHTMLActive = this.m_strSeparatorRightHTMLActive; } - if (!String.IsNullOrEmpty(m_strSeparatorLeftHTMLBreadCrumb)) + if (!String.IsNullOrEmpty(this.m_strSeparatorLeftHTMLBreadCrumb)) { - Control.SeparatorLeftHTMLBreadCrumb = m_strSeparatorLeftHTMLBreadCrumb; + this.Control.SeparatorLeftHTMLBreadCrumb = this.m_strSeparatorLeftHTMLBreadCrumb; } - if (!String.IsNullOrEmpty(m_strSeparatorRightHTMLBreadCrumb)) + if (!String.IsNullOrEmpty(this.m_strSeparatorRightHTMLBreadCrumb)) { - Control.SeparatorRightHTMLBreadCrumb = m_strSeparatorRightHTMLBreadCrumb; + this.Control.SeparatorRightHTMLBreadCrumb = this.m_strSeparatorRightHTMLBreadCrumb; } - if (!String.IsNullOrEmpty(m_strCSSControl)) + if (!String.IsNullOrEmpty(this.m_strCSSControl)) { - Control.CSSControl = m_strCSSControl; + this.Control.CSSControl = this.m_strCSSControl; } - if (!String.IsNullOrEmpty(m_strCSSContainerRoot)) + if (!String.IsNullOrEmpty(this.m_strCSSContainerRoot)) { - Control.CSSContainerRoot = m_strCSSContainerRoot; + this.Control.CSSContainerRoot = this.m_strCSSContainerRoot; } - if (!String.IsNullOrEmpty(m_strCSSNode)) + if (!String.IsNullOrEmpty(this.m_strCSSNode)) { - Control.CSSNode = m_strCSSNode; + this.Control.CSSNode = this.m_strCSSNode; } - if (!String.IsNullOrEmpty(m_strCSSIcon)) + if (!String.IsNullOrEmpty(this.m_strCSSIcon)) { - Control.CSSIcon = m_strCSSIcon; + this.Control.CSSIcon = this.m_strCSSIcon; } - if (!String.IsNullOrEmpty(m_strCSSContainerSub)) + if (!String.IsNullOrEmpty(this.m_strCSSContainerSub)) { - Control.CSSContainerSub = m_strCSSContainerSub; + this.Control.CSSContainerSub = this.m_strCSSContainerSub; } - if (!String.IsNullOrEmpty(m_strCSSNodeHover)) + if (!String.IsNullOrEmpty(this.m_strCSSNodeHover)) { - Control.CSSNodeHover = m_strCSSNodeHover; + this.Control.CSSNodeHover = this.m_strCSSNodeHover; } - if (!String.IsNullOrEmpty(m_strCSSBreak)) + if (!String.IsNullOrEmpty(this.m_strCSSBreak)) { - Control.CSSBreak = m_strCSSBreak; + this.Control.CSSBreak = this.m_strCSSBreak; } - if (!String.IsNullOrEmpty(m_strCSSIndicateChildSub)) + if (!String.IsNullOrEmpty(this.m_strCSSIndicateChildSub)) { - Control.CSSIndicateChildSub = m_strCSSIndicateChildSub; + this.Control.CSSIndicateChildSub = this.m_strCSSIndicateChildSub; } - if (!String.IsNullOrEmpty(m_strCSSIndicateChildRoot)) + if (!String.IsNullOrEmpty(this.m_strCSSIndicateChildRoot)) { - Control.CSSIndicateChildRoot = m_strCSSIndicateChildRoot; + this.Control.CSSIndicateChildRoot = this.m_strCSSIndicateChildRoot; } - if (!String.IsNullOrEmpty(m_strCSSBreadCrumbRoot)) + if (!String.IsNullOrEmpty(this.m_strCSSBreadCrumbRoot)) { - Control.CSSBreadCrumbRoot = m_strCSSBreadCrumbRoot; + this.Control.CSSBreadCrumbRoot = this.m_strCSSBreadCrumbRoot; } - if (!String.IsNullOrEmpty(m_strCSSBreadCrumbSub)) + if (!String.IsNullOrEmpty(this.m_strCSSBreadCrumbSub)) { - Control.CSSBreadCrumbSub = m_strCSSBreadCrumbSub; + this.Control.CSSBreadCrumbSub = this.m_strCSSBreadCrumbSub; } - if (!String.IsNullOrEmpty(m_strCSSNodeRoot)) + if (!String.IsNullOrEmpty(this.m_strCSSNodeRoot)) { - Control.CSSNodeRoot = m_strCSSNodeRoot; + this.Control.CSSNodeRoot = this.m_strCSSNodeRoot; } - if (!String.IsNullOrEmpty(m_strCSSNodeSelectedRoot)) + if (!String.IsNullOrEmpty(this.m_strCSSNodeSelectedRoot)) { - Control.CSSNodeSelectedRoot = m_strCSSNodeSelectedRoot; + this.Control.CSSNodeSelectedRoot = this.m_strCSSNodeSelectedRoot; } - if (!String.IsNullOrEmpty(m_strCSSNodeSelectedSub)) + if (!String.IsNullOrEmpty(this.m_strCSSNodeSelectedSub)) { - Control.CSSNodeSelectedSub = m_strCSSNodeSelectedSub; + this.Control.CSSNodeSelectedSub = this.m_strCSSNodeSelectedSub; } - if (!String.IsNullOrEmpty(m_strCSSNodeHoverRoot)) + if (!String.IsNullOrEmpty(this.m_strCSSNodeHoverRoot)) { - Control.CSSNodeHoverRoot = m_strCSSNodeHoverRoot; + this.Control.CSSNodeHoverRoot = this.m_strCSSNodeHoverRoot; } - if (!String.IsNullOrEmpty(m_strCSSNodeHoverSub)) + if (!String.IsNullOrEmpty(this.m_strCSSNodeHoverSub)) { - Control.CSSNodeHoverSub = m_strCSSNodeHoverSub; + this.Control.CSSNodeHoverSub = this.m_strCSSNodeHoverSub; } - if (!String.IsNullOrEmpty(m_strCSSSeparator)) + if (!String.IsNullOrEmpty(this.m_strCSSSeparator)) { - Control.CSSSeparator = m_strCSSSeparator; + this.Control.CSSSeparator = this.m_strCSSSeparator; } - if (!String.IsNullOrEmpty(m_strCSSLeftSeparator)) + if (!String.IsNullOrEmpty(this.m_strCSSLeftSeparator)) { - Control.CSSLeftSeparator = m_strCSSLeftSeparator; + this.Control.CSSLeftSeparator = this.m_strCSSLeftSeparator; } - if (!String.IsNullOrEmpty(m_strCSSRightSeparator)) + if (!String.IsNullOrEmpty(this.m_strCSSRightSeparator)) { - Control.CSSRightSeparator = m_strCSSRightSeparator; + this.Control.CSSRightSeparator = this.m_strCSSRightSeparator; } - if (!String.IsNullOrEmpty(m_strCSSLeftSeparatorSelection)) + if (!String.IsNullOrEmpty(this.m_strCSSLeftSeparatorSelection)) { - Control.CSSLeftSeparatorSelection = m_strCSSLeftSeparatorSelection; + this.Control.CSSLeftSeparatorSelection = this.m_strCSSLeftSeparatorSelection; } - if (!String.IsNullOrEmpty(m_strCSSRightSeparatorSelection)) + if (!String.IsNullOrEmpty(this.m_strCSSRightSeparatorSelection)) { - Control.CSSRightSeparatorSelection = m_strCSSRightSeparatorSelection; + this.Control.CSSRightSeparatorSelection = this.m_strCSSRightSeparatorSelection; } - if (!String.IsNullOrEmpty(m_strCSSLeftSeparatorBreadCrumb)) + if (!String.IsNullOrEmpty(this.m_strCSSLeftSeparatorBreadCrumb)) { - Control.CSSLeftSeparatorBreadCrumb = m_strCSSLeftSeparatorBreadCrumb; + this.Control.CSSLeftSeparatorBreadCrumb = this.m_strCSSLeftSeparatorBreadCrumb; } - if (!String.IsNullOrEmpty(m_strCSSRightSeparatorBreadCrumb)) + if (!String.IsNullOrEmpty(this.m_strCSSRightSeparatorBreadCrumb)) { - Control.CSSRightSeparatorBreadCrumb = m_strCSSRightSeparatorBreadCrumb; + this.Control.CSSRightSeparatorBreadCrumb = this.m_strCSSRightSeparatorBreadCrumb; } - if (!String.IsNullOrEmpty(m_strStyleBackColor)) + if (!String.IsNullOrEmpty(this.m_strStyleBackColor)) { - Control.StyleBackColor = m_strStyleBackColor; + this.Control.StyleBackColor = this.m_strStyleBackColor; } - if (!String.IsNullOrEmpty(m_strStyleForeColor)) + if (!String.IsNullOrEmpty(this.m_strStyleForeColor)) { - Control.StyleForeColor = m_strStyleForeColor; + this.Control.StyleForeColor = this.m_strStyleForeColor; } - if (!String.IsNullOrEmpty(m_strStyleHighlightColor)) + if (!String.IsNullOrEmpty(this.m_strStyleHighlightColor)) { - Control.StyleHighlightColor = m_strStyleHighlightColor; + this.Control.StyleHighlightColor = this.m_strStyleHighlightColor; } - if (!String.IsNullOrEmpty(m_strStyleIconBackColor)) + if (!String.IsNullOrEmpty(this.m_strStyleIconBackColor)) { - Control.StyleIconBackColor = m_strStyleIconBackColor; + this.Control.StyleIconBackColor = this.m_strStyleIconBackColor; } - if (!String.IsNullOrEmpty(m_strStyleSelectionBorderColor)) + if (!String.IsNullOrEmpty(this.m_strStyleSelectionBorderColor)) { - Control.StyleSelectionBorderColor = m_strStyleSelectionBorderColor; + this.Control.StyleSelectionBorderColor = this.m_strStyleSelectionBorderColor; } - if (!String.IsNullOrEmpty(m_strStyleSelectionColor)) + if (!String.IsNullOrEmpty(this.m_strStyleSelectionColor)) { - Control.StyleSelectionColor = m_strStyleSelectionColor; + this.Control.StyleSelectionColor = this.m_strStyleSelectionColor; } - if (!String.IsNullOrEmpty(m_strStyleSelectionForeColor)) + if (!String.IsNullOrEmpty(this.m_strStyleSelectionForeColor)) { - Control.StyleSelectionForeColor = m_strStyleSelectionForeColor; + this.Control.StyleSelectionForeColor = this.m_strStyleSelectionForeColor; } - if (!String.IsNullOrEmpty(m_strStyleControlHeight)) + if (!String.IsNullOrEmpty(this.m_strStyleControlHeight)) { - Control.StyleControlHeight = Convert.ToDecimal(m_strStyleControlHeight); + this.Control.StyleControlHeight = Convert.ToDecimal(this.m_strStyleControlHeight); } - if (!String.IsNullOrEmpty(m_strStyleBorderWidth)) + if (!String.IsNullOrEmpty(this.m_strStyleBorderWidth)) { - Control.StyleBorderWidth = Convert.ToDecimal(m_strStyleBorderWidth); + this.Control.StyleBorderWidth = Convert.ToDecimal(this.m_strStyleBorderWidth); } - if (!String.IsNullOrEmpty(m_strStyleNodeHeight)) + if (!String.IsNullOrEmpty(this.m_strStyleNodeHeight)) { - Control.StyleNodeHeight = Convert.ToDecimal(m_strStyleNodeHeight); + this.Control.StyleNodeHeight = Convert.ToDecimal(this.m_strStyleNodeHeight); } - if (!String.IsNullOrEmpty(m_strStyleIconWidth)) + if (!String.IsNullOrEmpty(this.m_strStyleIconWidth)) { - Control.StyleIconWidth = Convert.ToDecimal(m_strStyleIconWidth); + this.Control.StyleIconWidth = Convert.ToDecimal(this.m_strStyleIconWidth); } - if (!String.IsNullOrEmpty(m_strStyleFontNames)) + if (!String.IsNullOrEmpty(this.m_strStyleFontNames)) { - Control.StyleFontNames = m_strStyleFontNames; + this.Control.StyleFontNames = this.m_strStyleFontNames; } - if (!String.IsNullOrEmpty(m_strStyleFontSize)) + if (!String.IsNullOrEmpty(this.m_strStyleFontSize)) { - Control.StyleFontSize = Convert.ToDecimal(m_strStyleFontSize); + this.Control.StyleFontSize = Convert.ToDecimal(this.m_strStyleFontSize); } - if (!String.IsNullOrEmpty(m_strStyleFontBold)) + if (!String.IsNullOrEmpty(this.m_strStyleFontBold)) { - Control.StyleFontBold = m_strStyleFontBold; + this.Control.StyleFontBold = this.m_strStyleFontBold; } - if (!String.IsNullOrEmpty(m_strEffectsShadowColor)) + if (!String.IsNullOrEmpty(this.m_strEffectsShadowColor)) { - Control.EffectsShadowColor = m_strEffectsShadowColor; + this.Control.EffectsShadowColor = this.m_strEffectsShadowColor; } - if (!String.IsNullOrEmpty(m_strEffectsStyle)) + if (!String.IsNullOrEmpty(this.m_strEffectsStyle)) { - Control.EffectsStyle = m_strEffectsStyle; + this.Control.EffectsStyle = this.m_strEffectsStyle; } - if (!String.IsNullOrEmpty(m_strEffectsShadowStrength)) + if (!String.IsNullOrEmpty(this.m_strEffectsShadowStrength)) { - Control.EffectsShadowStrength = Convert.ToInt32(m_strEffectsShadowStrength); + this.Control.EffectsShadowStrength = Convert.ToInt32(this.m_strEffectsShadowStrength); } - if (!String.IsNullOrEmpty(m_strEffectsTransition)) + if (!String.IsNullOrEmpty(this.m_strEffectsTransition)) { - Control.EffectsTransition = m_strEffectsTransition; + this.Control.EffectsTransition = this.m_strEffectsTransition; } - if (!String.IsNullOrEmpty(m_strEffectsDuration)) + if (!String.IsNullOrEmpty(this.m_strEffectsDuration)) { - Control.EffectsDuration = Convert.ToDouble(m_strEffectsDuration); + this.Control.EffectsDuration = Convert.ToDouble(this.m_strEffectsDuration); } - if (!String.IsNullOrEmpty(m_strEffectsShadowDirection)) + if (!String.IsNullOrEmpty(this.m_strEffectsShadowDirection)) { - Control.EffectsShadowDirection = m_strEffectsShadowDirection; + this.Control.EffectsShadowDirection = this.m_strEffectsShadowDirection; } - Control.CustomAttributes = CustomAttributes; + this.Control.CustomAttributes = this.CustomAttributes; } protected void Bind(DNNNodeCollection objNodes) { - Control.Bind(objNodes); + this.Control.Bind(objNodes); } private string GetPath(string strPath) { if (strPath.IndexOf("[SKINPATH]") > -1) { - return strPath.Replace("[SKINPATH]", PortalSettings.ActiveTab.SkinPath); + return strPath.Replace("[SKINPATH]", this.PortalSettings.ActiveTab.SkinPath); } else if (strPath.IndexOf("[APPIMAGEPATH]") > -1) { @@ -2682,13 +2682,13 @@ private string GetPath(string strPath) } else if (strPath.IndexOf("[HOMEDIRECTORY]") > -1) { - return strPath.Replace("[HOMEDIRECTORY]", PortalSettings.HomeDirectory); + return strPath.Replace("[HOMEDIRECTORY]", this.PortalSettings.HomeDirectory); } else { if (strPath.StartsWith("~")) { - return ResolveUrl(strPath); + return this.ResolveUrl(strPath); } } return strPath; diff --git a/DNN Platform/Library/UI/Skins/Pane.cs b/DNN Platform/Library/UI/Skins/Pane.cs index 3b18730f44a..e9df02bf7ac 100644 --- a/DNN Platform/Library/UI/Skins/Pane.cs +++ b/DNN Platform/Library/UI/Skins/Pane.cs @@ -61,10 +61,10 @@ public class Pane /// ----------------------------------------------------------------------------- public Pane(HtmlContainerControl pane) { - PaneControl = pane; + this.PaneControl = pane; //Disable ViewState (we enable it later in the process) - PaneControl.ViewStateMode = ViewStateMode.Disabled; - Name = pane.ID; + this.PaneControl.ViewStateMode = ViewStateMode.Disabled; + this.Name = pane.ID; } /// ----------------------------------------------------------------------------- @@ -76,8 +76,8 @@ public Pane(HtmlContainerControl pane) /// ----------------------------------------------------------------------------- public Pane(string name, HtmlContainerControl pane) { - PaneControl = pane; - Name = name; + this.PaneControl = pane; + this.Name = name; } #endregion @@ -93,7 +93,7 @@ public Pane(string name, HtmlContainerControl pane) { get { - return _containers ?? (_containers = new Dictionary()); + return this._containers ?? (this._containers = new Dictionary()); } } @@ -131,15 +131,15 @@ private bool CanCollapsePane() //the visiblity of a pane to false. Setting the visibility of a pane to //false where there are colspans and rowspans can render the skin incorrectly. bool canCollapsePane = true; - if (Containers.Count > 0) + if (this.Containers.Count > 0) { canCollapsePane = false; } - else if (PaneControl.Controls.Count == 1) + else if (this.PaneControl.Controls.Count == 1) { //Pane contains 1 control canCollapsePane = false; - var literal = PaneControl.Controls[0] as LiteralControl; + var literal = this.PaneControl.Controls[0] as LiteralControl; if (literal != null) { //Check if the literal control is just whitespace - if so we can collapse panes @@ -149,7 +149,7 @@ private bool CanCollapsePane() } } } - else if (PaneControl.Controls.Count > 1) + else if (this.PaneControl.Controls.Count > 1) { //Pane contains more than 1 control canCollapsePane = false; @@ -185,7 +185,7 @@ private Containers.Container LoadContainerByPath(string containerPath) { containerPath = containerPath.Remove(0, Globals.ApplicationPath.Length); } - container = ControlUtilities.LoadControl(PaneControl.Page, containerPath); + container = ControlUtilities.LoadControl(this.PaneControl.Page, containerPath); container.ContainerSrc = containerSrc; //call databind so that any server logic in the container is executed container.DataBind(); @@ -197,7 +197,7 @@ private Containers.Container LoadContainerByPath(string containerPath) if (TabPermissionController.CanAdminPage()) { //only display the error to administrators - _containerWrapperControl.Controls.Add(new ErrorContainer(PortalSettings, string.Format(Skin.CONTAINERLOAD_ERROR, containerPath), lex).Container); + this._containerWrapperControl.Controls.Add(new ErrorContainer(this.PortalSettings, string.Format(Skin.CONTAINERLOAD_ERROR, containerPath), lex).Container); } Exceptions.LogException(lex); } @@ -214,12 +214,12 @@ private Containers.Container LoadContainerByPath(string containerPath) private Containers.Container LoadContainerFromCookie(HttpRequest request) { Containers.Container container = null; - HttpCookie cookie = request.Cookies["_ContainerSrc" + PortalSettings.PortalId]; + HttpCookie cookie = request.Cookies["_ContainerSrc" + this.PortalSettings.PortalId]; if (cookie != null) { if (!String.IsNullOrEmpty(cookie.Value)) { - container = LoadContainerByPath(SkinController.FormatSkinSrc(cookie.Value + ".ascx", PortalSettings)); + container = this.LoadContainerByPath(SkinController.FormatSkinSrc(cookie.Value + ".ascx", this.PortalSettings)); } } return container; @@ -231,26 +231,26 @@ private Containers.Container LoadContainerFromPane() string containerSrc; var validSrc = false; - if ((PaneControl.Attributes["ContainerType"] != null) && (PaneControl.Attributes["ContainerName"] != null)) + if ((this.PaneControl.Attributes["ContainerType"] != null) && (this.PaneControl.Attributes["ContainerName"] != null)) { - containerSrc = "[" + PaneControl.Attributes["ContainerType"] + "]" + SkinController.RootContainer + "/" + PaneControl.Attributes["ContainerName"] + "/" + - PaneControl.Attributes["ContainerSrc"]; + containerSrc = "[" + this.PaneControl.Attributes["ContainerType"] + "]" + SkinController.RootContainer + "/" + this.PaneControl.Attributes["ContainerName"] + "/" + + this.PaneControl.Attributes["ContainerSrc"]; validSrc = true; } else { - containerSrc = PaneControl.Attributes["ContainerSrc"]; + containerSrc = this.PaneControl.Attributes["ContainerSrc"]; if (containerSrc.Contains("/") && !(containerSrc.StartsWith("[g]", StringComparison.InvariantCultureIgnoreCase) || containerSrc.StartsWith("[l]", StringComparison.InvariantCultureIgnoreCase))) { - containerSrc = string.Format(SkinController.IsGlobalSkin(PortalSettings.ActiveTab.SkinSrc) ? "[G]containers/{0}" : "[L]containers/{0}", containerSrc.TrimStart('/')); + containerSrc = string.Format(SkinController.IsGlobalSkin(this.PortalSettings.ActiveTab.SkinSrc) ? "[G]containers/{0}" : "[L]containers/{0}", containerSrc.TrimStart('/')); validSrc = true; } } if (validSrc) { - containerSrc = SkinController.FormatSkinSrc(containerSrc, PortalSettings); - container = LoadContainerByPath(containerSrc); + containerSrc = SkinController.FormatSkinSrc(containerSrc, this.PortalSettings); + container = this.LoadContainerByPath(containerSrc); } return container; } @@ -267,8 +267,8 @@ private Containers.Container LoadContainerFromQueryString(ModuleInfo module, Htt //load user container ( based on cookie ) if ((request.QueryString["ContainerSrc"] != null) && (module.ModuleID == previewModuleId || previewModuleId == -1)) { - string containerSrc = SkinController.FormatSkinSrc(Globals.QueryStringDecode(request.QueryString["ContainerSrc"]) + ".ascx", PortalSettings); - container = LoadContainerByPath(containerSrc); + string containerSrc = SkinController.FormatSkinSrc(Globals.QueryStringDecode(request.QueryString["ContainerSrc"]) + ".ascx", this.PortalSettings); + container = this.LoadContainerByPath(containerSrc); } return container; } @@ -286,12 +286,12 @@ private Containers.Container LoadNoContainer(ModuleInfo module) //unless the administrator is in view mode if (displayTitle) { - displayTitle = (PortalSettings.UserMode != PortalSettings.Mode.View); + displayTitle = (this.PortalSettings.UserMode != PortalSettings.Mode.View); } if (displayTitle == false) { - container = LoadContainerByPath(SkinController.FormatSkinSrc(noContainerSrc, PortalSettings)); + container = this.LoadContainerByPath(SkinController.FormatSkinSrc(noContainerSrc, this.PortalSettings)); } } return container; @@ -300,18 +300,18 @@ private Containers.Container LoadNoContainer(ModuleInfo module) private Containers.Container LoadModuleContainer(ModuleInfo module) { var containerSrc = Null.NullString; - var request = PaneControl.Page.Request; + var request = this.PaneControl.Page.Request; Containers.Container container = null; - if (PortalSettings.EnablePopUps && UrlUtils.InPopUp()) + if (this.PortalSettings.EnablePopUps && UrlUtils.InPopUp()) { containerSrc = module.ContainerPath + "popUpContainer.ascx"; //Check Skin for a popup Container - if (module.ContainerSrc == PortalSettings.ActiveTab.ContainerSrc) + if (module.ContainerSrc == this.PortalSettings.ActiveTab.ContainerSrc) { if (File.Exists(HttpContext.Current.Server.MapPath(containerSrc))) { - container = LoadContainerByPath(containerSrc); + container = this.LoadContainerByPath(containerSrc); } } @@ -319,24 +319,24 @@ private Containers.Container LoadModuleContainer(ModuleInfo module) if (container == null) { containerSrc = Globals.HostPath + "Containers/_default/popUpContainer.ascx"; - container = LoadContainerByPath(containerSrc); + container = this.LoadContainerByPath(containerSrc); } } else { - container = (LoadContainerFromQueryString(module, request) ?? LoadContainerFromCookie(request)) ?? LoadNoContainer(module); + container = (this.LoadContainerFromQueryString(module, request) ?? this.LoadContainerFromCookie(request)) ?? this.LoadNoContainer(module); if (container == null) { //Check Skin for Container - var masterModules = PortalSettings.ActiveTab.ChildModules; + var masterModules = this.PortalSettings.ActiveTab.ChildModules; if (masterModules.ContainsKey(module.ModuleID) && string.IsNullOrEmpty(masterModules[module.ModuleID].ContainerSrc)) { //look for a container specification in the skin pane - if (PaneControl != null) + if (this.PaneControl != null) { - if ((PaneControl.Attributes["ContainerSrc"] != null)) + if ((this.PaneControl.Attributes["ContainerSrc"] != null)) { - container = LoadContainerFromPane(); + container = this.LoadContainerFromPane(); } } } @@ -348,27 +348,27 @@ private Containers.Container LoadModuleContainer(ModuleInfo module) containerSrc = module.ContainerSrc; if (!String.IsNullOrEmpty(containerSrc)) { - containerSrc = SkinController.FormatSkinSrc(containerSrc, PortalSettings); - container = LoadContainerByPath(containerSrc); + containerSrc = SkinController.FormatSkinSrc(containerSrc, this.PortalSettings); + container = this.LoadContainerByPath(containerSrc); } } //error loading container - load from tab if (container == null) { - containerSrc = PortalSettings.ActiveTab.ContainerSrc; + containerSrc = this.PortalSettings.ActiveTab.ContainerSrc; if (!String.IsNullOrEmpty(containerSrc)) { - containerSrc = SkinController.FormatSkinSrc(containerSrc, PortalSettings); - container = LoadContainerByPath(containerSrc); + containerSrc = SkinController.FormatSkinSrc(containerSrc, this.PortalSettings); + container = this.LoadContainerByPath(containerSrc); } } //error loading container - load default if (container == null) { - containerSrc = SkinController.FormatSkinSrc(SkinController.GetDefaultPortalContainer(), PortalSettings); - container = LoadContainerByPath(containerSrc); + containerSrc = SkinController.FormatSkinSrc(SkinController.GetDefaultPortalContainer(), this.PortalSettings); + container = this.LoadContainerByPath(containerSrc); } } @@ -404,7 +404,7 @@ private void ModuleMoveToPanePostBack(ClientAPIPostBackEventArgs args) ModuleController.Instance.UpdateTabModuleOrder(portalSettings.ActiveTab.TabID); //Redirect to the same page to pick up changes - PaneControl.Page.Response.Redirect(PaneControl.Page.Request.RawUrl, true); + this.PaneControl.Page.Response.Redirect(this.PaneControl.Page.Request.RawUrl, true); } } @@ -432,8 +432,8 @@ private bool IsVesionableModule(ModuleInfo moduleInfo) /// ----------------------------------------------------------------------------- public void InjectModule(ModuleInfo module) { - _containerWrapperControl = new HtmlGenericControl("div"); - PaneControl.Controls.Add(_containerWrapperControl); + this._containerWrapperControl = new HtmlGenericControl("div"); + this.PaneControl.Controls.Add(this._containerWrapperControl); //inject module classes string classFormatString = "DnnModule DnnModule-{0} DnnModule-{1}"; @@ -444,25 +444,25 @@ public void InjectModule(ModuleInfo module) sanitizedModuleName = Globals.CreateValidClass(module.DesktopModule.ModuleName, false); } - if (IsVesionableModule(module)) + if (this.IsVesionableModule(module)) { classFormatString += " DnnVersionableControl"; } - _containerWrapperControl.Attributes["class"] = String.Format(classFormatString, sanitizedModuleName, module.ModuleID); + this._containerWrapperControl.Attributes["class"] = String.Format(classFormatString, sanitizedModuleName, module.ModuleID); try { - if (!Globals.IsAdminControl() && (PortalSettings.InjectModuleHyperLink || PortalSettings.UserMode != PortalSettings.Mode.View)) + if (!Globals.IsAdminControl() && (this.PortalSettings.InjectModuleHyperLink || this.PortalSettings.UserMode != PortalSettings.Mode.View)) { - _containerWrapperControl.Controls.Add(new LiteralControl("")); + this._containerWrapperControl.Controls.Add(new LiteralControl("")); } //Load container control - Containers.Container container = LoadModuleContainer(module); + Containers.Container container = this.LoadModuleContainer(module); //Add Container to Dictionary - Containers.Add(container.ID, container); + this.Containers.Add(container.ID, container); // hide anything of type ActionsMenu - as we're injecting our own menu now. container.InjectActionMenu = (container.Controls.OfType().Count() == 0); @@ -489,7 +489,7 @@ public void InjectModule(ModuleInfo module) Control title = container.FindControl("dnnTitle"); //Assume that the title control is named dnnTitle. If this becomes an issue we could loop through the controls looking for the title type of skin object dragDropContainer.ID = container.ID + "_DD"; - _containerWrapperControl.Controls.Add(dragDropContainer); + this._containerWrapperControl.Controls.Add(dragDropContainer); //inject the container into the page pane - this triggers the Pre_Init() event for the user control dragDropContainer.Controls.Add(container); @@ -507,15 +507,15 @@ public void InjectModule(ModuleInfo module) { //The title ID is actually the first child so we need to make sure at least one child exists DNNClientAPI.EnableContainerDragAndDrop(title, dragDropContainer, module.ModuleID); - ClientAPI.RegisterPostBackEventHandler(PaneControl, "MoveToPane", ModuleMoveToPanePostBack, false); + ClientAPI.RegisterPostBackEventHandler(this.PaneControl, "MoveToPane", this.ModuleMoveToPanePostBack, false); } } else { - _containerWrapperControl.Controls.Add(container); + this._containerWrapperControl.Controls.Add(container); if (Globals.IsAdminControl()) { - _containerWrapperControl.Attributes["class"] += " DnnModule-Admin"; + this._containerWrapperControl.Attributes["class"] += " DnnModule-Admin"; } } @@ -523,9 +523,9 @@ public void InjectModule(ModuleInfo module) container.SetModuleConfiguration(module); //display collapsible page panes - if (PaneControl.Visible == false) + if (this.PaneControl.Visible == false) { - PaneControl.Visible = true; + this.PaneControl.Visible = true; } } catch (ThreadAbortException) @@ -534,11 +534,11 @@ public void InjectModule(ModuleInfo module) } catch (Exception exc) { - var lex = new ModuleLoadException(string.Format(Skin.MODULEADD_ERROR, PaneControl.ID), exc); + var lex = new ModuleLoadException(string.Format(Skin.MODULEADD_ERROR, this.PaneControl.ID), exc); if (TabPermissionController.CanAdminPage()) { //only display the error to administrators - _containerWrapperControl.Controls.Add(new ErrorContainer(PortalSettings, Skin.MODULELOAD_ERROR, lex).Container); + this._containerWrapperControl.Controls.Add(new ErrorContainer(this.PortalSettings, Skin.MODULELOAD_ERROR, lex).Container); } Exceptions.LogException(exc); throw lex; @@ -552,65 +552,65 @@ public void InjectModule(ModuleInfo module) /// ----------------------------------------------------------------------------- public void ProcessPane() { - if (PaneControl != null) + if (this.PaneControl != null) { //remove excess skin non-validating attributes - PaneControl.Attributes.Remove("ContainerType"); - PaneControl.Attributes.Remove("ContainerName"); - PaneControl.Attributes.Remove("ContainerSrc"); + this.PaneControl.Attributes.Remove("ContainerType"); + this.PaneControl.Attributes.Remove("ContainerName"); + this.PaneControl.Attributes.Remove("ContainerSrc"); if (Globals.IsLayoutMode()) { - PaneControl.Visible = true; + this.PaneControl.Visible = true; //display pane border - string cssclass = PaneControl.Attributes["class"]; + string cssclass = this.PaneControl.Attributes["class"]; if (string.IsNullOrEmpty(cssclass)) { - PaneControl.Attributes["class"] = CPaneOutline; + this.PaneControl.Attributes["class"] = CPaneOutline; } else { - PaneControl.Attributes["class"] = cssclass.Replace(CPaneOutline, "").Trim().Replace(" ", " ") + " " + CPaneOutline; + this.PaneControl.Attributes["class"] = cssclass.Replace(CPaneOutline, "").Trim().Replace(" ", " ") + " " + CPaneOutline; } //display pane name - var ctlLabel = new Label { Text = "
    " + Name + "

    ", CssClass = "SubHead" }; - PaneControl.Controls.AddAt(0, ctlLabel); + var ctlLabel = new Label { Text = "
    " + this.Name + "

    ", CssClass = "SubHead" }; + this.PaneControl.Controls.AddAt(0, ctlLabel); } else { - if (PaneControl.Visible == false && TabPermissionController.CanAddContentToPage()) + if (this.PaneControl.Visible == false && TabPermissionController.CanAddContentToPage()) { - PaneControl.Visible = true; + this.PaneControl.Visible = true; } - if (CanCollapsePane()) + if (this.CanCollapsePane()) { //This pane has no controls so set the width to 0 - if (PaneControl.Attributes["style"] != null) + if (this.PaneControl.Attributes["style"] != null) { - PaneControl.Attributes.Remove("style"); + this.PaneControl.Attributes.Remove("style"); } - if (PaneControl.Attributes["class"] != null) + if (this.PaneControl.Attributes["class"] != null) { - PaneControl.Attributes["class"] = PaneControl.Attributes["class"] + " DNNEmptyPane"; + this.PaneControl.Attributes["class"] = this.PaneControl.Attributes["class"] + " DNNEmptyPane"; } else { - PaneControl.Attributes["class"] = "DNNEmptyPane"; + this.PaneControl.Attributes["class"] = "DNNEmptyPane"; } } //Add support for drag and drop if (Globals.IsEditMode()) // this call also checks for permission { - if (PaneControl.Attributes["class"] != null) + if (this.PaneControl.Attributes["class"] != null) { - PaneControl.Attributes["class"] = PaneControl.Attributes["class"] + " dnnSortable"; + this.PaneControl.Attributes["class"] = this.PaneControl.Attributes["class"] + " dnnSortable"; } else { - PaneControl.Attributes["class"] = "dnnSortable"; + this.PaneControl.Attributes["class"] = "dnnSortable"; } } } diff --git a/DNN Platform/Library/UI/Skins/Skin.cs b/DNN Platform/Library/UI/Skins/Skin.cs index 21e088f1c96..2a92521324e 100644 --- a/DNN Platform/Library/UI/Skins/Skin.cs +++ b/DNN Platform/Library/UI/Skins/Skin.cs @@ -89,8 +89,8 @@ public class Skin : UserControlBase public Skin() { - ModuleControlPipeline = Globals.DependencyProvider.GetRequiredService(); - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.ModuleControlPipeline = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -106,7 +106,7 @@ internal Control ControlPanel { get { - return _controlPanel ?? (_controlPanel = FindControl("ControlPanel")); + return this._controlPanel ?? (this._controlPanel = this.FindControl("ControlPanel")); } } @@ -125,7 +125,7 @@ internal ModuleCommunicate Communicator { get { - return _communicator; + return this._communicator; } } #endregion @@ -142,7 +142,7 @@ public Dictionary Panes { get { - return _panes ?? (_panes = new Dictionary()); + return this._panes ?? (this._panes = new Dictionary()); } } @@ -155,11 +155,11 @@ public ArrayList ActionEventListeners { get { - return _actionEventListeners ?? (_actionEventListeners = new ArrayList()); + return this._actionEventListeners ?? (this._actionEventListeners = new ArrayList()); } set { - _actionEventListeners = value; + this._actionEventListeners = value; } } @@ -173,7 +173,7 @@ public string SkinPath { get { - return TemplateSourceDirectory + "/"; + return this.TemplateSourceDirectory + "/"; } } @@ -236,9 +236,9 @@ private static Control FindControlRecursive(Control rootControl, string controlI private bool CheckExpired() { bool blnExpired = false; - if (PortalSettings.ExpiryDate != Null.NullDate) + if (this.PortalSettings.ExpiryDate != Null.NullDate) { - if (Convert.ToDateTime(PortalSettings.ExpiryDate) < DateTime.Now && !Globals.IsHostTab(PortalSettings.ActiveTab.TabID)) + if (Convert.ToDateTime(this.PortalSettings.ExpiryDate) < DateTime.Now && !Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID)) { blnExpired = true; } @@ -249,11 +249,11 @@ private bool CheckExpired() private Pane GetPane(ModuleInfo module) { Pane pane; - bool found = Panes.TryGetValue(module.PaneName.ToLowerInvariant(), out pane); + bool found = this.Panes.TryGetValue(module.PaneName.ToLowerInvariant(), out pane); if (!found) { - Panes.TryGetValue(Globals.glbDefaultPane.ToLowerInvariant(), out pane); + this.Panes.TryGetValue(Globals.glbDefaultPane.ToLowerInvariant(), out pane); } return pane; @@ -262,18 +262,18 @@ private Pane GetPane(ModuleInfo module) private void InjectControlPanel() { //if querystring dnnprintmode=true, controlpanel will not be shown - if (Request.QueryString["dnnprintmode"] != "true" && !UrlUtils.InPopUp() && Request.QueryString["hidecommandbar"] != "true") + if (this.Request.QueryString["dnnprintmode"] != "true" && !UrlUtils.InPopUp() && this.Request.QueryString["hidecommandbar"] != "true") { if (Host.AllowControlPanelToDetermineVisibility || (ControlPanelBase.IsPageAdminInternal() || ControlPanelBase.IsModuleAdminInternal())) { //ControlPanel processing var controlPanel = ControlUtilities.LoadControl(this, Host.ControlPanel); - var form = (HtmlForm)Parent.FindControl("Form"); + var form = (HtmlForm)this.Parent.FindControl("Form"); if (controlPanel.IncludeInControlHierarchy) { //inject ControlPanel control into skin - if (ControlPanel == null || HostController.Instance.GetBoolean("IgnoreControlPanelWrapper", false)) + if (this.ControlPanel == null || HostController.Instance.GetBoolean("IgnoreControlPanelWrapper", false)) { if (form != null) { @@ -281,16 +281,16 @@ private void InjectControlPanel() } else { - Page.Controls.AddAt(0, controlPanel); + this.Page.Controls.AddAt(0, controlPanel); } } else { - ControlPanel.Controls.Add(controlPanel); + this.ControlPanel.Controls.Add(controlPanel); } //register admin.css - ClientResourceManager.RegisterAdminStylesheet(Page, Globals.HostPath + "admin.css"); + ClientResourceManager.RegisterAdminStylesheet(this.Page, Globals.HostPath + "admin.css"); } } } @@ -312,7 +312,7 @@ private void InvokeSkinEvents(SkinEventType skinEventType) private void LoadPanes() { //iterate page controls - foreach (Control ctlControl in Controls) + foreach (Control ctlControl in this.Controls) { var objPaneControl = ctlControl as HtmlContainerControl; @@ -336,15 +336,15 @@ private void LoadPanes() if (!objPaneControl.ID.Equals("controlpanel", StringComparison.InvariantCultureIgnoreCase)) { //Add to the PortalSettings (for use in the Control Panel) - PortalSettings.ActiveTab.Panes.Add(objPaneControl.ID); + this.PortalSettings.ActiveTab.Panes.Add(objPaneControl.ID); //Add to the Panes collection - Panes.Add(objPaneControl.ID.ToLowerInvariant(), new Pane(objPaneControl)); + this.Panes.Add(objPaneControl.ID.ToLowerInvariant(), new Pane(objPaneControl)); } else { //Control Panel pane - _controlPanel = objPaneControl; + this._controlPanel = objPaneControl; } break; } @@ -386,21 +386,21 @@ private static Skin LoadSkin(PageBase page, string skinPath) private bool ProcessModule(ModuleInfo module) { var success = true; - if (ModuleInjectionManager.CanInjectModule(module, PortalSettings)) + if (ModuleInjectionManager.CanInjectModule(module, this.PortalSettings)) { //We need to ensure that Content Item exists since in old versions Content Items are not needed for modules - EnsureContentItemForModule(module); + this.EnsureContentItemForModule(module); - Pane pane = GetPane(module); + Pane pane = this.GetPane(module); if (pane != null) { - success = InjectModule(pane, module); + success = this.InjectModule(pane, module); } else { var lex = new ModuleLoadException(Localization.GetString("PaneNotFound.Error")); - Controls.Add(new ErrorContainer(PortalSettings, MODULELOAD_ERROR, lex).Container); + this.Controls.Add(new ErrorContainer(this.PortalSettings, MODULELOAD_ERROR, lex).Container); Exceptions.LogException(lex); } } @@ -418,7 +418,7 @@ private void HandleAccesDenied(bool redirect = false) if (redirect) { var redirectUrl = Globals.AccessDeniedURL(message); - Response.Redirect(redirectUrl, true); + this.Response.Redirect(redirectUrl, true); } else { @@ -432,12 +432,12 @@ private bool ProcessMasterModules() if (TabPermissionController.CanViewPage()) { //We need to ensure that Content Item exists since in old versions Content Items are not needed for tabs - EnsureContentItemForTab(PortalSettings.ActiveTab); + this.EnsureContentItemForTab(this.PortalSettings.ActiveTab); // Versioning checks. if (!TabController.CurrentPage.HasAVisibleVersion) { - HandleAccesDenied(true); + this.HandleAccesDenied(true); } int urlVersion; @@ -445,36 +445,36 @@ private bool ProcessMasterModules() { if (!TabVersionUtils.CanSeeVersionedPages()) { - HandleAccesDenied(false); + this.HandleAccesDenied(false); return true; } if (TabVersionController.Instance.GetTabVersions(TabController.CurrentPage.TabID).All(tabVersion => tabVersion.Version != urlVersion)) { - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.ErrorPage404, string.Empty, "status=404")); + this.Response.Redirect(this.NavigationManager.NavigateURL(this.PortalSettings.ErrorPage404, string.Empty, "status=404")); } } //check portal expiry date - if (!CheckExpired()) + if (!this.CheckExpired()) { - if ((PortalSettings.ActiveTab.StartDate < DateAndTime.Now && PortalSettings.ActiveTab.EndDate > DateAndTime.Now) || TabPermissionController.CanAdminPage() || Globals.IsLayoutMode()) + if ((this.PortalSettings.ActiveTab.StartDate < DateAndTime.Now && this.PortalSettings.ActiveTab.EndDate > DateAndTime.Now) || TabPermissionController.CanAdminPage() || Globals.IsLayoutMode()) { - foreach (var objModule in PortalSettingsController.Instance().GetTabModules(PortalSettings)) + foreach (var objModule in PortalSettingsController.Instance().GetTabModules(this.PortalSettings)) { - success = ProcessModule(objModule); + success = this.ProcessModule(objModule); } } else { - HandleAccesDenied(false); + this.HandleAccesDenied(false); } } else { AddPageMessage(this, "", - string.Format(Localization.GetString("ContractExpired.Error"), PortalSettings.PortalName, Globals.GetMediumDate(PortalSettings.ExpiryDate.ToString(CultureInfo.InvariantCulture)), PortalSettings.Email), + string.Format(Localization.GetString("ContractExpired.Error"), this.PortalSettings.PortalName, Globals.GetMediumDate(this.PortalSettings.ExpiryDate.ToString(CultureInfo.InvariantCulture)), this.PortalSettings.Email), ModuleMessage.ModuleMessageType.RedError); } } @@ -484,14 +484,14 @@ private bool ProcessMasterModules() var redirectUrl = Globals.AccessDeniedURL(Localization.GetString("TabAccess.Error")); // Current locale will use default if did'nt find any - Locale currentLocale = LocaleController.Instance.GetCurrentLocale(PortalSettings.PortalId); - if (PortalSettings.ContentLocalizationEnabled && + Locale currentLocale = LocaleController.Instance.GetCurrentLocale(this.PortalSettings.PortalId); + if (this.PortalSettings.ContentLocalizationEnabled && TabController.CurrentPage.CultureCode != currentLocale.Code) { redirectUrl = new LanguageTokenReplace {Language = currentLocale.Code}.ReplaceEnvironmentTokens("[URL]"); } - Response.Redirect(redirectUrl, true); + this.Response.Redirect(redirectUrl, true); } return success; } @@ -518,7 +518,7 @@ private void EnsureContentItemForModule(ModuleInfo module) private void ProcessPanes() { - foreach (KeyValuePair kvp in Panes) + foreach (KeyValuePair kvp in this.Panes) { kvp.Value.ProcessPane(); } @@ -529,17 +529,17 @@ private bool ProcessSlaveModule() var success = true; var key = UIUtilities.GetControlKey(); var moduleId = UIUtilities.GetModuleId(key); - var slaveModule = UIUtilities.GetSlaveModule(moduleId, key, PortalSettings.ActiveTab.TabID); + var slaveModule = UIUtilities.GetSlaveModule(moduleId, key, this.PortalSettings.ActiveTab.TabID); Pane pane; - Panes.TryGetValue(Globals.glbDefaultPane.ToLowerInvariant(), out pane); + this.Panes.TryGetValue(Globals.glbDefaultPane.ToLowerInvariant(), out pane); slaveModule.PaneName = Globals.glbDefaultPane; - slaveModule.ContainerSrc = PortalSettings.ActiveTab.ContainerSrc; + slaveModule.ContainerSrc = this.PortalSettings.ActiveTab.ContainerSrc; if (String.IsNullOrEmpty(slaveModule.ContainerSrc)) { - slaveModule.ContainerSrc = PortalSettings.DefaultPortalContainer; + slaveModule.ContainerSrc = this.PortalSettings.DefaultPortalContainer; } - slaveModule.ContainerSrc = SkinController.FormatSkinSrc(slaveModule.ContainerSrc, PortalSettings); + slaveModule.ContainerSrc = SkinController.FormatSkinSrc(slaveModule.ContainerSrc, this.PortalSettings); slaveModule.ContainerPath = SkinController.FormatSkinPath(slaveModule.ContainerSrc); var moduleControl = ModuleControlController.GetModuleControlByControlKey(key, slaveModule.ModuleDefID); @@ -567,11 +567,11 @@ private bool ProcessSlaveModule() if (ModulePermissionController.HasModuleAccess(slaveModule.ModuleControl.ControlType, permissionKey, slaveModule)) { - success = InjectModule(pane, slaveModule); + success = this.InjectModule(pane, slaveModule); } else { - Response.Redirect(Globals.AccessDeniedURL(Localization.GetString("ModuleAccess.Error")), true); + this.Response.Redirect(Globals.AccessDeniedURL(Localization.GetString("ModuleAccess.Error")), true); } } @@ -592,16 +592,16 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //Load the Panes - LoadPanes(); + this.LoadPanes(); //Load the Module Control(s) - bool success = Globals.IsAdminControl() ? ProcessSlaveModule() : ProcessMasterModules(); + bool success = Globals.IsAdminControl() ? this.ProcessSlaveModule() : this.ProcessMasterModules(); //Load the Control Panel - InjectControlPanel(); + this.InjectControlPanel(); //Register any error messages on the Skin - if (Request.QueryString["error"] != null && Host.ShowCriticalErrors) + if (this.Request.QueryString["error"] != null && Host.ShowCriticalErrors) { AddPageMessage(this, Localization.GetString("CriticalError.Error"), " ", ModuleMessage.ModuleMessageType.RedError); @@ -611,18 +611,18 @@ protected override void OnInit(EventArgs e) ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); JavaScript.RequestRegistration(CommonJs.jQueryUI); - JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn_dom); - ClientResourceManager.RegisterScript(Page, "~/resources/shared/scripts/dnn.logViewer.js"); + JavaScript.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn_dom); + ClientResourceManager.RegisterScript(this.Page, "~/resources/shared/scripts/dnn.logViewer.js"); } } if (!TabPermissionController.CanAdminPage() && !success) { //only display the warning to non-administrators (administrators will see the errors) - AddPageMessage(this, Localization.GetString("ModuleLoadWarning.Error"), string.Format(Localization.GetString("ModuleLoadWarning.Text"), PortalSettings.Email), ModuleMessage.ModuleMessageType.YellowWarning); + AddPageMessage(this, Localization.GetString("ModuleLoadWarning.Error"), string.Format(Localization.GetString("ModuleLoadWarning.Text"), this.PortalSettings.Email), ModuleMessage.ModuleMessageType.YellowWarning); } - InvokeSkinEvents(SkinEventType.OnSkinInit); + this.InvokeSkinEvents(SkinEventType.OnSkinInit); if (HttpContext.Current != null && HttpContext.Current.Items.Contains(OnInitMessage)) { @@ -638,7 +638,7 @@ protected override void OnInit(EventArgs e) } //Process the Panes attributes - ProcessPanes(); + this.ProcessPanes(); } /// ----------------------------------------------------------------------------- @@ -650,7 +650,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - InvokeSkinEvents(SkinEventType.OnSkinLoad); + this.InvokeSkinEvents(SkinEventType.OnSkinLoad); } /// ----------------------------------------------------------------------------- @@ -662,21 +662,21 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - InvokeSkinEvents(SkinEventType.OnSkinPreRender); - var isSpecialPageMode = UrlUtils.InPopUp() || Request.QueryString["dnnprintmode"] == "true"; + this.InvokeSkinEvents(SkinEventType.OnSkinPreRender); + var isSpecialPageMode = UrlUtils.InPopUp() || this.Request.QueryString["dnnprintmode"] == "true"; if (TabPermissionController.CanAddContentToPage() && Globals.IsEditMode() && !isSpecialPageMode) { //Register Drag and Drop plugin JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ClientResourceManager.RegisterStyleSheet(Page, "~/resources/shared/stylesheets/dnn.dragDrop.css", FileOrder.Css.FeatureCss); - ClientResourceManager.RegisterScript(Page, "~/resources/shared/scripts/dnn.dragDrop.js"); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/resources/shared/stylesheets/dnn.dragDrop.css", FileOrder.Css.FeatureCss); + ClientResourceManager.RegisterScript(this.Page, "~/resources/shared/scripts/dnn.dragDrop.js"); //Register Client Script var sb = new StringBuilder(); sb.AppendLine(" (function ($) {"); sb.AppendLine(" $(document).ready(function () {"); sb.AppendLine(" $('.dnnSortable').dnnModuleDragDrop({"); - sb.AppendLine(" tabId: " + PortalSettings.ActiveTab.TabID + ","); + sb.AppendLine(" tabId: " + this.PortalSettings.ActiveTab.TabID + ","); sb.AppendLine(" draggingHintText: '" + Localization.GetSafeJSString("DraggingHintText", Localization.GlobalResourceFile) + "',"); sb.AppendLine(" dragHintText: '" + Localization.GetSafeJSString("DragModuleHint", Localization.GlobalResourceFile) + "',"); sb.AppendLine(" dropHintText: '" + Localization.GetSafeJSString("DropModuleHint", Localization.GlobalResourceFile) + "',"); @@ -686,14 +686,14 @@ protected override void OnPreRender(EventArgs e) sb.AppendLine(" } (jQuery));"); var script = sb.ToString(); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "DragAndDrop", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "DragAndDrop", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "DragAndDrop", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "DragAndDrop", script, true); } } @@ -708,7 +708,7 @@ protected override void OnUnload(EventArgs e) { base.OnUnload(e); - InvokeSkinEvents(SkinEventType.OnSkinUnLoad); + this.InvokeSkinEvents(SkinEventType.OnSkinUnLoad); } #endregion @@ -993,9 +993,9 @@ public bool InjectModule(Pane pane, ModuleInfo module) //try to inject the module into the pane try { - if(PortalSettings.ActiveTab.TabID == PortalSettings.UserTabId || PortalSettings.ActiveTab.ParentId == PortalSettings.UserTabId) + if(this.PortalSettings.ActiveTab.TabID == this.PortalSettings.UserTabId || this.PortalSettings.ActiveTab.ParentId == this.PortalSettings.UserTabId) { - var profileModule = ModuleControlPipeline.LoadModuleControl(Page, module) as IProfileModule; + var profileModule = this.ModuleControlPipeline.LoadModuleControl(this.Page, module) as IProfileModule; if (profileModule == null || profileModule.DisplayModule) { pane.InjectModule(module); @@ -1028,7 +1028,7 @@ public bool InjectModule(Pane pane, ModuleInfo module) /// ----------------------------------------------------------------------------- public void RegisterModuleActionEvent(int moduleId, ActionEventHandler e) { - ActionEventListeners.Add(new ModuleActionEventListener(moduleId, e)); + this.ActionEventListeners.Add(new ModuleActionEventListener(moduleId, e)); } private static bool isFallbackSkin(string skinPath) diff --git a/DNN Platform/Library/UI/Skins/SkinControl.cs b/DNN Platform/Library/UI/Skins/SkinControl.cs index fecef229141..7e06ec84fe5 100644 --- a/DNN Platform/Library/UI/Skins/SkinControl.cs +++ b/DNN Platform/Library/UI/Skins/SkinControl.cs @@ -44,11 +44,11 @@ public string DefaultKey { get { - return _DefaultKey; + return this._DefaultKey; } set { - _DefaultKey = value; + this._DefaultKey = value; } } @@ -56,11 +56,11 @@ public string Width { get { - return Convert.ToString(ViewState["SkinControlWidth"]); + return Convert.ToString(this.ViewState["SkinControlWidth"]); } set { - _Width = value; + this._Width = value; } } @@ -68,11 +68,11 @@ public string SkinRoot { get { - return Convert.ToString(ViewState["SkinRoot"]); + return Convert.ToString(this.ViewState["SkinRoot"]); } set { - _SkinRoot = value; + this._SkinRoot = value; } } @@ -80,9 +80,9 @@ public string SkinSrc { get { - if (cboSkin.SelectedItem != null) + if (this.cboSkin.SelectedItem != null) { - return cboSkin.SelectedItem.Value; + return this.cboSkin.SelectedItem.Value; } else { @@ -91,7 +91,7 @@ public string SkinSrc } set { - _SkinSrc = value; + this._SkinSrc = value; } } @@ -100,19 +100,19 @@ public string LocalResourceFile get { string fileRoot; - if (String.IsNullOrEmpty(_localResourceFile)) + if (String.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/SkinControl.ascx"; + fileRoot = this.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/SkinControl.ascx"; } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -122,35 +122,35 @@ public string LocalResourceFile private void LoadSkins() { - cboSkin.Items.Clear(); + this.cboSkin.Items.Clear(); - if (optHost.Checked) + if (this.optHost.Checked) { // load host skins - foreach (KeyValuePair Skin in SkinController.GetSkins(_objPortal, SkinRoot, SkinScope.Host)) + foreach (KeyValuePair Skin in SkinController.GetSkins(this._objPortal, this.SkinRoot, SkinScope.Host)) { - cboSkin.Items.Add(new ListItem(Skin.Key, Skin.Value)); + this.cboSkin.Items.Add(new ListItem(Skin.Key, Skin.Value)); } } - if (optSite.Checked) + if (this.optSite.Checked) { // load portal skins - foreach (KeyValuePair Skin in SkinController.GetSkins(_objPortal, SkinRoot, SkinScope.Site)) + foreach (KeyValuePair Skin in SkinController.GetSkins(this._objPortal, this.SkinRoot, SkinScope.Site)) { - cboSkin.Items.Add(new ListItem(Skin.Key, Skin.Value)); + this.cboSkin.Items.Add(new ListItem(Skin.Key, Skin.Value)); } } - cboSkin.Items.Insert(0, new ListItem("<" + Localization.GetString(DefaultKey, LocalResourceFile) + ">", "")); + this.cboSkin.Items.Insert(0, new ListItem("<" + Localization.GetString(this.DefaultKey, this.LocalResourceFile) + ">", "")); // select current skin - for (int intIndex = 0; intIndex < cboSkin.Items.Count; intIndex++) + for (int intIndex = 0; intIndex < this.cboSkin.Items.Count; intIndex++) { - if (cboSkin.Items[intIndex].Value.Equals(Convert.ToString(ViewState["SkinSrc"]), StringComparison.InvariantCultureIgnoreCase)) + if (this.cboSkin.Items[intIndex].Value.Equals(Convert.ToString(this.ViewState["SkinSrc"]), StringComparison.InvariantCultureIgnoreCase)) { - cboSkin.Items[intIndex].Selected = true; + this.cboSkin.Items[intIndex].Selected = true; break; } } @@ -170,61 +170,61 @@ protected override void OnLoad(EventArgs e) #region Bind Handles - optHost.CheckedChanged += optHost_CheckedChanged; - optSite.CheckedChanged += optSite_CheckedChanged; - cmdPreview.Click += cmdPreview_Click; + this.optHost.CheckedChanged += this.optHost_CheckedChanged; + this.optSite.CheckedChanged += this.optSite_CheckedChanged; + this.cmdPreview.Click += this.cmdPreview_Click; #endregion try { - if (Request.QueryString["pid"] != null && (Globals.IsHostTab(PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) + if (this.Request.QueryString["pid"] != null && (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) { - _objPortal = PortalController.Instance.GetPortal(Int32.Parse(Request.QueryString["pid"])); + this._objPortal = PortalController.Instance.GetPortal(Int32.Parse(this.Request.QueryString["pid"])); } else { - _objPortal = PortalController.Instance.GetPortal(PortalSettings.PortalId); + this._objPortal = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { //save persistent values - ViewState["SkinControlWidth"] = _Width; - ViewState["SkinRoot"] = _SkinRoot; - ViewState["SkinSrc"] = _SkinSrc; + this.ViewState["SkinControlWidth"] = this._Width; + this.ViewState["SkinRoot"] = this._SkinRoot; + this.ViewState["SkinSrc"] = this._SkinSrc; //set width of control - if (!String.IsNullOrEmpty(_Width)) + if (!String.IsNullOrEmpty(this._Width)) { - cboSkin.Width = Unit.Parse(_Width); + this.cboSkin.Width = Unit.Parse(this._Width); } //set selected skin - if (!String.IsNullOrEmpty(_SkinSrc)) + if (!String.IsNullOrEmpty(this._SkinSrc)) { - switch (_SkinSrc.Substring(0, 3)) + switch (this._SkinSrc.Substring(0, 3)) { case "[L]": - optHost.Checked = false; - optSite.Checked = true; + this.optHost.Checked = false; + this.optSite.Checked = true; break; case "[G]": - optSite.Checked = false; - optHost.Checked = true; + this.optSite.Checked = false; + this.optHost.Checked = true; break; } } else { //no skin selected, initialized to site skin if any exists - string strRoot = _objPortal.HomeDirectoryMapPath + SkinRoot; + string strRoot = this._objPortal.HomeDirectoryMapPath + this.SkinRoot; if (Directory.Exists(strRoot) && Directory.GetDirectories(strRoot).Length > 0) { - optHost.Checked = false; - optSite.Checked = true; + this.optHost.Checked = false; + this.optSite.Checked = true; } } - LoadSkins(); + this.LoadSkins(); } } catch (Exception exc) //Module failed to load @@ -235,30 +235,30 @@ protected override void OnLoad(EventArgs e) protected void optHost_CheckedChanged(object sender, EventArgs e) { - LoadSkins(); + this.LoadSkins(); } protected void optSite_CheckedChanged(object sender, EventArgs e) { - LoadSkins(); + this.LoadSkins(); } protected void cmdPreview_Click(object sender, EventArgs e) { - if (!String.IsNullOrEmpty(SkinSrc)) + if (!String.IsNullOrEmpty(this.SkinSrc)) { - string strType = SkinRoot.Substring(0, SkinRoot.Length - 1); + string strType = this.SkinRoot.Substring(0, this.SkinRoot.Length - 1); - string strURL = Globals.ApplicationURL() + "&" + strType + "Src=" + Globals.QueryStringEncode(SkinSrc.Replace(".ascx", "")); + string strURL = Globals.ApplicationURL() + "&" + strType + "Src=" + Globals.QueryStringEncode(this.SkinSrc.Replace(".ascx", "")); - if (SkinRoot == SkinController.RootContainer) + if (this.SkinRoot == SkinController.RootContainer) { - if (Request.QueryString["ModuleId"] != null) + if (this.Request.QueryString["ModuleId"] != null) { - strURL += "&ModuleId=" + Request.QueryString["ModuleId"]; + strURL += "&ModuleId=" + this.Request.QueryString["ModuleId"]; } } - Response.Redirect(strURL, true); + this.Response.Redirect(strURL, true); } } diff --git a/DNN Platform/Library/UI/Skins/SkinDefaults.cs b/DNN Platform/Library/UI/Skins/SkinDefaults.cs index fcd2268675c..d3a1f6a19f6 100644 --- a/DNN Platform/Library/UI/Skins/SkinDefaults.cs +++ b/DNN Platform/Library/UI/Skins/SkinDefaults.cs @@ -33,20 +33,20 @@ private SkinDefaults(SkinDefaultType DefaultType) var dnndoc = new XmlDocument { XmlResolver = null }; dnndoc.Load(filePath); XmlNode defaultElement = dnndoc.SelectSingleNode("/configuration/skinningdefaults/" + nodename); - _folder = defaultElement.Attributes["folder"].Value; - _defaultName = defaultElement.Attributes["default"].Value; - _adminDefaultName = defaultElement.Attributes["admindefault"].Value; + this._folder = defaultElement.Attributes["folder"].Value; + this._defaultName = defaultElement.Attributes["default"].Value; + this._adminDefaultName = defaultElement.Attributes["admindefault"].Value; } public string AdminDefaultName { get { - return _adminDefaultName; + return this._adminDefaultName; } set { - _adminDefaultName = value; + this._adminDefaultName = value; } } @@ -54,11 +54,11 @@ public string DefaultName { get { - return _defaultName; + return this._defaultName; } set { - _defaultName = value; + this._defaultName = value; } } @@ -66,11 +66,11 @@ public string Folder { get { - return _folder; + return this._folder; } set { - _folder = value; + this._folder = value; } } diff --git a/DNN Platform/Library/UI/Skins/SkinFileProcessor.cs b/DNN Platform/Library/UI/Skins/SkinFileProcessor.cs index 7443428b2c0..c5526c7ce18 100644 --- a/DNN Platform/Library/UI/Skins/SkinFileProcessor.cs +++ b/DNN Platform/Library/UI/Skins/SkinFileProcessor.cs @@ -76,13 +76,13 @@ public class SkinFileProcessor /// ----------------------------------------------------------------------------- public SkinFileProcessor(string ControlKey, string ControlSrc) { - m_ControlList.Add(ControlKey, ControlSrc); + this.m_ControlList.Add(ControlKey, ControlSrc); //Instantiate the control parser with the list of skin objects - m_ControlFactory = new ControlParser(m_ControlList); + this.m_ControlFactory = new ControlParser(this.m_ControlList); //Instantiate the object parser with the list of skin objects - m_ObjectFactory = new ObjectParser(m_ControlList); + this.m_ObjectFactory = new ObjectParser(this.m_ControlList); } /// ----------------------------------------------------------------------------- @@ -105,12 +105,12 @@ public SkinFileProcessor(string ControlKey, string ControlSrc) /// ----------------------------------------------------------------------------- public SkinFileProcessor(string SkinPath, string SkinRoot, string SkinName) { - Message += SkinController.FormatMessage(INITIALIZE_PROCESSOR, SkinRoot + " :: " + SkinName, 0, false); + this.Message += SkinController.FormatMessage(this.INITIALIZE_PROCESSOR, SkinRoot + " :: " + SkinName, 0, false); //Save path information for future use - m_SkinRoot = SkinRoot; - m_SkinPath = SkinPath; - m_SkinName = SkinName; + this.m_SkinRoot = SkinRoot; + this.m_SkinPath = SkinPath; + this.m_SkinName = SkinName; //Check for and read skin package level attribute information file string FileName = this.SkinPath + this.SkinRoot + "\\" + this.SkinName + "\\" + SkinRoot.Substring(0, SkinRoot.Length - 1) + ".xml"; @@ -118,14 +118,14 @@ public SkinFileProcessor(string SkinPath, string SkinRoot, string SkinName) { try { - SkinAttributes.Load(FileName); - Message += SkinController.FormatMessage(PACKAGE_LOAD, Path.GetFileName(FileName), 2, false); + this.SkinAttributes.Load(FileName); + this.Message += SkinController.FormatMessage(this.PACKAGE_LOAD, Path.GetFileName(FileName), 2, false); } catch (Exception ex) { //could not load XML file Logger.Error(ex); - Message += SkinController.FormatMessage(string.Format(PACKAGE_LOAD_ERROR, ex.Message), Path.GetFileName(FileName), 2, true); + this.Message += SkinController.FormatMessage(string.Format(this.PACKAGE_LOAD_ERROR, ex.Message), Path.GetFileName(FileName), 2, true); } } @@ -136,26 +136,26 @@ public SkinFileProcessor(string SkinPath, string SkinRoot, string SkinName) Token = objSkinControl.ControlKey.ToUpper(); //If the control is already in the hash table - if (m_ControlList.ContainsKey(Token)) + if (this.m_ControlList.ContainsKey(Token)) { - Message += SkinController.FormatMessage(string.Format(DUPLICATE_ERROR, Token), - string.Format(DUPLICATE_DETAIL, m_ControlList[Token], objSkinControl.ControlSrc), + this.Message += SkinController.FormatMessage(string.Format(this.DUPLICATE_ERROR, Token), + string.Format(this.DUPLICATE_DETAIL, this.m_ControlList[Token], objSkinControl.ControlSrc), 2, true); } else { //Add it - Message += SkinController.FormatMessage(string.Format(LOAD_SKIN_TOKEN, Token), objSkinControl.ControlSrc, 2, false); - m_ControlList.Add(Token, objSkinControl.ControlSrc); + this.Message += SkinController.FormatMessage(string.Format(this.LOAD_SKIN_TOKEN, Token), objSkinControl.ControlSrc, 2, false); + this.m_ControlList.Add(Token, objSkinControl.ControlSrc); } } //Instantiate the control parser with the list of skin objects - m_ControlFactory = new ControlParser(m_ControlList); + this.m_ControlFactory = new ControlParser(this.m_ControlList); //Instantiate the object parser with the list of skin objects - m_ObjectFactory = new ObjectParser(m_ControlList); + this.m_ObjectFactory = new ObjectParser(this.m_ControlList); } #endregion @@ -166,7 +166,7 @@ private PathParser PathFactory { get { - return m_PathFactory; + return this.m_PathFactory; } } @@ -174,7 +174,7 @@ private ControlParser ControlFactory { get { - return m_ControlFactory; + return this.m_ControlFactory; } } @@ -182,7 +182,7 @@ private ObjectParser ObjectFactory { get { - return m_ObjectFactory; + return this.m_ObjectFactory; } } @@ -190,7 +190,7 @@ private XmlDocument SkinAttributes { get { - return m_SkinAttributes; + return this.m_SkinAttributes; } } @@ -198,11 +198,11 @@ private string Message { get { - return m_Message; + return this.m_Message; } set { - m_Message = value; + this.m_Message = value; } } @@ -214,7 +214,7 @@ public string SkinRoot { get { - return m_SkinRoot; + return this.m_SkinRoot; } } @@ -222,7 +222,7 @@ public string SkinPath { get { - return m_SkinPath; + return this.m_SkinPath; } } @@ -230,7 +230,7 @@ public string SkinName { get { - return m_SkinName; + return this.m_SkinName; } } @@ -240,26 +240,26 @@ public string SkinName public string ProcessFile(string FileName, SkinParser ParseOption) { - string strMessage = SkinController.FormatMessage(FILE_BEGIN, Path.GetFileName(FileName), 0, false); - var objSkinFile = new SkinFile(SkinRoot, FileName, SkinAttributes); + string strMessage = SkinController.FormatMessage(this.FILE_BEGIN, Path.GetFileName(FileName), 0, false); + var objSkinFile = new SkinFile(this.SkinRoot, FileName, this.SkinAttributes); switch (objSkinFile.FileExtension) { case ".htm": case ".html": string contents = objSkinFile.Contents; - strMessage += ObjectFactory.Parse(ref contents); - strMessage += PathFactory.Parse(ref contents, PathFactory.HTMLList, objSkinFile.SkinRootPath, ParseOption); - strMessage += ControlFactory.Parse(ref contents, objSkinFile.Attributes); + strMessage += this.ObjectFactory.Parse(ref contents); + strMessage += this.PathFactory.Parse(ref contents, this.PathFactory.HTMLList, objSkinFile.SkinRootPath, ParseOption); + strMessage += this.ControlFactory.Parse(ref contents, objSkinFile.Attributes); objSkinFile.Contents = contents; var Registrations = new ArrayList(); - Registrations.AddRange(ControlFactory.Registrations); - Registrations.AddRange(ObjectFactory.Registrations); + Registrations.AddRange(this.ControlFactory.Registrations); + Registrations.AddRange(this.ObjectFactory.Registrations); strMessage += objSkinFile.PrependASCXDirectives(Registrations); break; } objSkinFile.Write(); strMessage += objSkinFile.Messages; - strMessage += SkinController.FormatMessage(FILE_END, Path.GetFileName(FileName), 1, false); + strMessage += SkinController.FormatMessage(this.FILE_END, Path.GetFileName(FileName), 1, false); return strMessage; } @@ -274,25 +274,25 @@ public string ProcessFile(string FileName, SkinParser ParseOption) /// ----------------------------------------------------------------------------- public string ProcessList(ArrayList FileList) { - return ProcessList(FileList, SkinParser.Localized); + return this.ProcessList(FileList, SkinParser.Localized); } public string ProcessList(ArrayList FileList, SkinParser ParseOption) { foreach (string FileName in FileList) { - Message += ProcessFile(FileName, ParseOption); + this.Message += this.ProcessFile(FileName, ParseOption); } - Message += SkinController.FormatMessage(FILES_END, SkinRoot + " :: " + SkinName, 0, false); - return Message; + this.Message += SkinController.FormatMessage(this.FILES_END, this.SkinRoot + " :: " + this.SkinName, 0, false); + return this.Message; } public string ProcessSkin(string SkinSource, XmlDocument SkinAttributes, SkinParser ParseOption) { var objSkinFile = new SkinFile(SkinSource, SkinAttributes); string contents = objSkinFile.Contents; - Message += ControlFactory.Parse(ref contents, objSkinFile.Attributes); - Message += objSkinFile.PrependASCXDirectives(ControlFactory.Registrations); + this.Message += this.ControlFactory.Parse(ref contents, objSkinFile.Attributes); + this.Message += objSkinFile.PrependASCXDirectives(this.ControlFactory.Registrations); return contents; } @@ -339,7 +339,7 @@ private class ControlParser /// ----------------------------------------------------------------------------- public ControlParser(Hashtable ControlList) { - m_ControlList = (Hashtable)ControlList.Clone(); + this.m_ControlList = (Hashtable)ControlList.Clone(); } /// ----------------------------------------------------------------------------- @@ -361,7 +361,7 @@ internal ArrayList Registrations { get { - return m_RegisterList; + return this.m_RegisterList; } } @@ -369,7 +369,7 @@ private MatchEvaluator Handler { get { - return TokenMatchHandler; + return this.TokenMatchHandler; } } @@ -377,11 +377,11 @@ private ArrayList RegisterList { get { - return m_RegisterList; + return this.m_RegisterList; } set { - m_RegisterList = value; + this.m_RegisterList = value; } } @@ -389,7 +389,7 @@ private Hashtable ControlList { get { - return m_ControlList; + return this.m_ControlList; } } @@ -397,11 +397,11 @@ private XmlDocument Attributes { get { - return m_Attributes; + return this.m_Attributes; } set { - m_Attributes = value; + this.m_Attributes = value; } } @@ -409,11 +409,11 @@ private string Messages { get { - return m_ParseMessages; + return this.m_ParseMessages; } set { - m_ParseMessages = value; + this.m_ParseMessages = value; } } @@ -431,17 +431,17 @@ private string Messages /// ----------------------------------------------------------------------------- public string Parse(ref string Source, XmlDocument Attributes) { - Messages = string.Empty; + this.Messages = string.Empty; //set the token attributes this.Attributes = Attributes; //clear register list - RegisterList.Clear(); + this.RegisterList.Clear(); //define the regular expression to match tokens //parse the file - Source = FindTokenInstance.Replace(Source, Handler); - return Messages; + Source = FindTokenInstance.Replace(Source, this.Handler); + return this.Messages; } /// ----------------------------------------------------------------------------- @@ -476,38 +476,38 @@ private string TokenMatchHandler(Match m) //if the token has an instance name, use it to look for the corresponding attributes string AttributeNode = Token + (String.IsNullOrEmpty(m.Groups["instance"].Value) ? "" : ":" + m.Groups["instance"].Value); - Messages += SkinController.FormatMessage(TOKEN_PROC, "[" + AttributeNode + "]", 2, false); + this.Messages += SkinController.FormatMessage(TOKEN_PROC, "[" + AttributeNode + "]", 2, false); //if the token is a recognized skin control - if (ControlList.ContainsKey(Token) || Token.IndexOf("CONTENTPANE") != -1) + if (this.ControlList.ContainsKey(Token) || Token.IndexOf("CONTENTPANE") != -1) { string SkinControl = ""; - if (ControlList.ContainsKey(Token)) + if (this.ControlList.ContainsKey(Token)) { - Messages += SkinController.FormatMessage(TOKEN_SKIN, (string)ControlList[Token], 2, false); + this.Messages += SkinController.FormatMessage(TOKEN_SKIN, (string)this.ControlList[Token], 2, false); } else { - Messages += SkinController.FormatMessage(TOKEN_PANE, Token, 2, false); + this.Messages += SkinController.FormatMessage(TOKEN_PANE, Token, 2, false); } //f there is an attribute file - if (Attributes.DocumentElement != null) + if (this.Attributes.DocumentElement != null) { //look for the the node of this instance of the token - XmlNode xmlSkinAttributeRoot = Attributes.DocumentElement.SelectSingleNode("descendant::Object[Token='[" + AttributeNode + "]']"); + XmlNode xmlSkinAttributeRoot = this.Attributes.DocumentElement.SelectSingleNode("descendant::Object[Token='[" + AttributeNode + "]']"); //if the token is found if (xmlSkinAttributeRoot != null) { - Messages += SkinController.FormatMessage(TOKEN_FOUND, "[" + AttributeNode + "]", 2, false); + this.Messages += SkinController.FormatMessage(TOKEN_FOUND, "[" + AttributeNode + "]", 2, false); //process each token attribute foreach (XmlNode xmlSkinAttribute in xmlSkinAttributeRoot.SelectNodes(".//Settings/Setting")) { if (!String.IsNullOrEmpty(xmlSkinAttribute.SelectSingleNode("Value").InnerText)) { //append the formatted attribute to the inner contents of the control statement - Messages += SkinController.FormatMessage(TOKEN_FORMAT, + this.Messages += SkinController.FormatMessage(TOKEN_FORMAT, xmlSkinAttribute.SelectSingleNode("Name").InnerText + "=\"" + xmlSkinAttribute.SelectSingleNode("Value").InnerText + "\"", 2, false); @@ -518,23 +518,23 @@ private string TokenMatchHandler(Match m) } else { - Messages += SkinController.FormatMessage(TOKEN_NOTFOUND_INFILE, "[" + AttributeNode + "]", 2, false); + this.Messages += SkinController.FormatMessage(TOKEN_NOTFOUND_INFILE, "[" + AttributeNode + "]", 2, false); } } - if (ControlList.ContainsKey(Token)) + if (this.ControlList.ContainsKey(Token)) { //create the skin object user control tag SkinControl = "dnn:" + Token + " runat=\"server\" id=\"dnn" + ControlName + "\"" + SkinControl; //save control registration statement - string ControlRegistration = "<%@ Register TagPrefix=\"dnn\" TagName=\"" + Token + "\" Src=\"~/" + (string)ControlList[Token] + "\" %>" + Environment.NewLine; - if (RegisterList.Contains(ControlRegistration) == false) + string ControlRegistration = "<%@ Register TagPrefix=\"dnn\" TagName=\"" + Token + "\" Src=\"~/" + (string)this.ControlList[Token] + "\" %>" + Environment.NewLine; + if (this.RegisterList.Contains(ControlRegistration) == false) { - RegisterList.Add(ControlRegistration); + this.RegisterList.Add(ControlRegistration); } //return the control statement - Messages += SkinController.FormatMessage(CONTROL_FORMAT, "<" + SkinControl + " />", 2, false); + this.Messages += SkinController.FormatMessage(CONTROL_FORMAT, "<" + SkinControl + " />", 2, false); SkinControl = "<" + SkinControl + " />"; } @@ -547,7 +547,7 @@ private string TokenMatchHandler(Match m) SkinControl = "div runat=\"server\"" + SkinControl + ">"; } @@ -558,7 +558,7 @@ private string TokenMatchHandler(Match m) //return the unmodified token //note that this is currently protecting array syntax in embedded javascript //should be fixed in the regular expressions but is not, currently. - Messages += SkinController.FormatMessage(TOKEN_NOTFOUND, "[" + m.Groups["token"].Value + "]", 2, false); + this.Messages += SkinController.FormatMessage(TOKEN_NOTFOUND, "[" + m.Groups["token"].Value + "]", 2, false); return "[" + m.Groups["token"].Value + "]"; } } @@ -609,7 +609,7 @@ private class ObjectParser /// ----------------------------------------------------------------------------- public ObjectParser(Hashtable ControlList) { - m_ControlList = (Hashtable)ControlList.Clone(); + this.m_ControlList = (Hashtable)ControlList.Clone(); } /// ----------------------------------------------------------------------------- @@ -631,7 +631,7 @@ internal ArrayList Registrations { get { - return m_RegisterList; + return this.m_RegisterList; } } @@ -639,7 +639,7 @@ private MatchEvaluator Handler { get { - return ObjectMatchHandler; + return this.ObjectMatchHandler; } } @@ -647,11 +647,11 @@ private ArrayList RegisterList { get { - return m_RegisterList; + return this.m_RegisterList; } set { - m_RegisterList = value; + this.m_RegisterList = value; } } @@ -659,7 +659,7 @@ private Hashtable ControlList { get { - return m_ControlList; + return this.m_ControlList; } } @@ -667,11 +667,11 @@ private string Messages { get { - return m_ParseMessages; + return this.m_ParseMessages; } set { - m_ParseMessages = value; + this.m_ParseMessages = value; } } @@ -686,15 +686,15 @@ private string Messages /// ----------------------------------------------------------------------------- public string Parse(ref string Source) { - Messages = string.Empty; + this.Messages = string.Empty; //clear register list - RegisterList.Clear(); + this.RegisterList.Clear(); //parse the file - Source = FindObjectInstance.Replace(Source, Handler); + Source = FindObjectInstance.Replace(Source, this.Handler); - return Messages; + return this.Messages; } /// ----------------------------------------------------------------------------- @@ -764,20 +764,20 @@ private string ObjectMatchHandler(Match m) if (AttributeNode.Equals("dotnetnuke/server", StringComparison.InvariantCultureIgnoreCase)) { //we have a valid skin object specification - Messages += SkinController.FormatMessage(OBJECT_PROC, Token, 2, false); + this.Messages += SkinController.FormatMessage(OBJECT_PROC, Token, 2, false); //if the embedded object is a recognized skin object - if (ControlList.ContainsKey(Token) || Token == "CONTENTPANE") + if (this.ControlList.ContainsKey(Token) || Token == "CONTENTPANE") { string SkinControl = ""; - if (ControlList.ContainsKey(Token)) + if (this.ControlList.ContainsKey(Token)) { - Messages += SkinController.FormatMessage(OBJECT_SKIN, (string)ControlList[Token], 2, false); + this.Messages += SkinController.FormatMessage(OBJECT_SKIN, (string)this.ControlList[Token], 2, false); } else { - Messages += SkinController.FormatMessage(OBJECT_PANE, Token, 2, false); + this.Messages += SkinController.FormatMessage(OBJECT_PANE, Token, 2, false); } //process embedded object params @@ -789,7 +789,7 @@ private string ObjectMatchHandler(Match m) //convert multiple spaces and carriage returns into single spaces Parameters = MultiSpaceRegex.Replace(Parameters, " "); - if (ControlList.ContainsKey(Token)) + if (this.ControlList.ContainsKey(Token)) { //create the skin object user control tag SkinControl = "dnn:" + Token + " runat=\"server\" "; @@ -800,14 +800,14 @@ private string ObjectMatchHandler(Match m) SkinControl += Parameters; //save control registration statement - string ControlRegistration = "<%@ Register TagPrefix=\"dnn\" TagName=\"" + Token + "\" Src=\"~/" + (string)ControlList[Token] + "\" %>" + Environment.NewLine; - if (RegisterList.Contains(ControlRegistration) == false) + string ControlRegistration = "<%@ Register TagPrefix=\"dnn\" TagName=\"" + Token + "\" Src=\"~/" + (string)this.ControlList[Token] + "\" %>" + Environment.NewLine; + if (this.RegisterList.Contains(ControlRegistration) == false) { - RegisterList.Add(ControlRegistration); + this.RegisterList.Add(ControlRegistration); } //return the control statement - Messages += SkinController.FormatMessage(CONTROL_FORMAT, "<" + SkinControl + " />", 2, false); + this.Messages += SkinController.FormatMessage(CONTROL_FORMAT, "<" + SkinControl + " />", 2, false); SkinControl = "<" + SkinControl + "/>"; } else @@ -824,7 +824,7 @@ private string ObjectMatchHandler(Match m) SkinControl += Parameters + ">"; } return SkinControl; @@ -832,7 +832,7 @@ private string ObjectMatchHandler(Match m) else { //return the unmodified embedded object - Messages += SkinController.FormatMessage(OBJECT_NOTFOUND, Token, 2, false); + this.Messages += SkinController.FormatMessage(OBJECT_NOTFOUND, Token, 2, false); return ""; } } @@ -913,15 +913,15 @@ public ArrayList HTMLList get { //if the arraylist in uninitialized - if (m_HTMLPatterns.Count == 0) + if (this.m_HTMLPatterns.Count == 0) { //for each pattern, create a regex object - m_HTMLPatterns.AddRange(HtmlArrayPattern); + this.m_HTMLPatterns.AddRange(HtmlArrayPattern); //optimize the arraylist size since it will not change - m_HTMLPatterns.TrimToSize(); + this.m_HTMLPatterns.TrimToSize(); } - return m_HTMLPatterns; + return this.m_HTMLPatterns; } } @@ -942,15 +942,15 @@ public ArrayList CSSList get { //if the arraylist in uninitialized - if (m_CSSPatterns.Count == 0) + if (this.m_CSSPatterns.Count == 0) { //for each pattern, create a regex object - m_CSSPatterns.AddRange(CssArrayPattern); + this.m_CSSPatterns.AddRange(CssArrayPattern); //optimize the arraylist size since it will not change - m_CSSPatterns.TrimToSize(); + this.m_CSSPatterns.TrimToSize(); } - return m_CSSPatterns; + return this.m_CSSPatterns; } } @@ -958,7 +958,7 @@ private MatchEvaluator Handler { get { - return MatchHandler; + return this.MatchHandler; } } @@ -966,11 +966,11 @@ private string SkinPath { get { - return m_SkinPath; + return this.m_SkinPath; } set { - m_SkinPath = value; + this.m_SkinPath = value; } } @@ -991,7 +991,7 @@ private string SkinPath /// ----------------------------------------------------------------------------- public string Parse(ref string Source, ArrayList RegexList, string SkinPath, SkinParser ParseOption) { - m_Messages = ""; + this.m_Messages = ""; //set path propery which is file specific this.SkinPath = SkinPath; @@ -1001,9 +1001,9 @@ public string Parse(ref string Source, ArrayList RegexList, string SkinPath, Ski //process each regular expression for (int i = 0; i <= RegexList.Count - 1; i++) { - Source = ((Regex)RegexList[i]).Replace(Source, Handler); + Source = ((Regex)RegexList[i]).Replace(Source, this.Handler); } - return m_Messages; + return this.m_Messages; } /// ----------------------------------------------------------------------------- @@ -1027,14 +1027,14 @@ private string MatchHandler(Match m) //we do not want to process object tags to DotNetNuke widgets if (!m.Groups[0].Value.ToLowerInvariant().Contains("codetype=\"dotnetnuke/client\"")) { - switch (ParseOption) + switch (this.ParseOption) { case SkinParser.Localized: //if the tag does not contain the localized path - if (strNewTag.IndexOf(SkinPath) == -1) + if (strNewTag.IndexOf(this.SkinPath) == -1) { //insert the localized path - strNewTag = m.Groups["tag"].Value + SkinPath + m.Groups["content"].Value + m.Groups["endtag"].Value; + strNewTag = m.Groups["tag"].Value + this.SkinPath + m.Groups["content"].Value + m.Groups["endtag"].Value; } break; case SkinParser.Portable: @@ -1046,15 +1046,15 @@ private string MatchHandler(Match m) } //if the tag contains the localized path - if (strNewTag.IndexOf(SkinPath) != -1) + if (strNewTag.IndexOf(this.SkinPath) != -1) { //remove the localized path - strNewTag = strNewTag.Replace(SkinPath, ""); + strNewTag = strNewTag.Replace(this.SkinPath, ""); } break; } } - m_Messages += SkinController.FormatMessage(SUBST, string.Format(SUBST_DETAIL, HttpUtility.HtmlEncode(strOldTag), HttpUtility.HtmlEncode(strNewTag)), 2, false); + this.m_Messages += SkinController.FormatMessage(this.SUBST, string.Format(this.SUBST_DETAIL, HttpUtility.HtmlEncode(strOldTag), HttpUtility.HtmlEncode(strNewTag)), 2, false); return strNewTag; } } @@ -1107,8 +1107,8 @@ private class SkinFile /// ----------------------------------------------------------------------------- public SkinFile(string SkinContents, XmlDocument SkinAttributes) { - m_FileAttributes = SkinAttributes; - Contents = SkinContents; + this.m_FileAttributes = SkinAttributes; + this.Contents = SkinContents; } /// ----------------------------------------------------------------------------- @@ -1127,52 +1127,52 @@ public SkinFile(string SkinContents, XmlDocument SkinAttributes) public SkinFile(string SkinRoot, string FileName, XmlDocument SkinAttributes) { //capture file information - m_FileName = FileName; - m_FileExtension = Path.GetExtension(FileName); - m_SkinRoot = SkinRoot; - m_FileAttributes = SkinAttributes; + this.m_FileName = FileName; + this.m_FileExtension = Path.GetExtension(FileName); + this.m_SkinRoot = SkinRoot; + this.m_FileAttributes = SkinAttributes; //determine and store path to portals skin root folder string strTemp = FileName.Replace(Path.GetFileName(FileName), ""); strTemp = strTemp.Replace("\\", "/"); - m_SkinRootPath = Globals.ApplicationPath + strTemp.Substring(strTemp.ToUpper().IndexOf("/PORTALS")); + this.m_SkinRootPath = Globals.ApplicationPath + strTemp.Substring(strTemp.ToUpper().IndexOf("/PORTALS")); //read file contents - Contents = Read(FileName); + this.Contents = this.Read(FileName); //setup some attributes based on file extension - switch (FileExtension) + switch (this.FileExtension) { case ".htm": case ".html": //set output file name to .ASCX - m_WriteFileName = FileName.Replace(Path.GetExtension(FileName), ".ascx"); + this.m_WriteFileName = FileName.Replace(Path.GetExtension(FileName), ".ascx"); //capture warning if file does not contain a id="ContentPane" or [CONTENTPANE] - if (!PaneCheck1Regex.IsMatch(Contents) && !PaneCheck2Regex.IsMatch(Contents)) + if (!PaneCheck1Regex.IsMatch(this.Contents) && !PaneCheck2Regex.IsMatch(this.Contents)) { - m_Messages += SkinController.FormatMessage(FILE_FORMAT_ERROR, string.Format(FILE_FORMAT_ERROR, FileName), 2, true); + this.m_Messages += SkinController.FormatMessage(this.FILE_FORMAT_ERROR, string.Format(this.FILE_FORMAT_ERROR, FileName), 2, true); } //Check for existence of and load skin file level attribute information - if (File.Exists(FileName.Replace(FileExtension, ".xml"))) + if (File.Exists(FileName.Replace(this.FileExtension, ".xml"))) { try { - m_FileAttributes.Load(FileName.Replace(FileExtension, ".xml")); - m_Messages += SkinController.FormatMessage(FILE_LOAD, FileName, 2, false); + this.m_FileAttributes.Load(FileName.Replace(this.FileExtension, ".xml")); + this.m_Messages += SkinController.FormatMessage(this.FILE_LOAD, FileName, 2, false); } catch (Exception exc) //could not load XML file { Logger.Error(exc); - m_FileAttributes = SkinAttributes; - m_Messages += SkinController.FormatMessage(FILE_LOAD_ERROR, FileName, 2, true); + this.m_FileAttributes = SkinAttributes; + this.m_Messages += SkinController.FormatMessage(this.FILE_LOAD_ERROR, FileName, 2, true); } } break; default: //output file name is same as input file name - m_WriteFileName = FileName; + this.m_WriteFileName = FileName; break; } } @@ -1181,7 +1181,7 @@ public string SkinRoot { get { - return m_SkinRoot; + return this.m_SkinRoot; } } @@ -1189,7 +1189,7 @@ public XmlDocument Attributes { get { - return m_FileAttributes; + return this.m_FileAttributes; } } @@ -1197,7 +1197,7 @@ public string Messages { get { - return m_Messages; + return this.m_Messages; } } @@ -1205,7 +1205,7 @@ public string FileName { get { - return m_FileName; + return this.m_FileName; } } @@ -1213,7 +1213,7 @@ public string WriteFileName { get { - return m_WriteFileName; + return this.m_WriteFileName; } } @@ -1221,7 +1221,7 @@ public string FileExtension { get { - return m_FileExtension; + return this.m_FileExtension; } } @@ -1229,7 +1229,7 @@ public string SkinRootPath { get { - return m_SkinRootPath; + return this.m_SkinRootPath; } } @@ -1248,14 +1248,14 @@ private string Read(string FileName) public void Write() { //delete the file before attempting to write - if (File.Exists(WriteFileName)) + if (File.Exists(this.WriteFileName)) { - File.Delete(WriteFileName); + File.Delete(this.WriteFileName); } - m_Messages += SkinController.FormatMessage(FILE_WRITE, Path.GetFileName(WriteFileName), 2, false); - using (var objStreamWriter = new StreamWriter(WriteFileName)) + this.m_Messages += SkinController.FormatMessage(this.FILE_WRITE, Path.GetFileName(this.WriteFileName), 2, false); + using (var objStreamWriter = new StreamWriter(this.WriteFileName)) { - objStreamWriter.WriteLine(Contents); + objStreamWriter.WriteLine(this.Contents); objStreamWriter.Flush(); objStreamWriter.Close(); } @@ -1277,31 +1277,31 @@ public string PrependASCXDirectives(ArrayList Registrations) string Prefix = ""; //format and save @Control directive - Match objMatch = BodyExtractionRegex.Match(Contents); + Match objMatch = BodyExtractionRegex.Match(this.Contents); if (objMatch.Success && !string.IsNullOrEmpty(objMatch.Groups[1].Value)) { //if the skin source is an HTML document, extract the content within the tags - Contents = objMatch.Groups[1].Value; + this.Contents = objMatch.Groups[1].Value; } - if (SkinRoot == SkinController.RootSkin) + if (this.SkinRoot == SkinController.RootSkin) { Prefix += "<%@ Control language=\"vb\" AutoEventWireup=\"false\" Explicit=\"True\" Inherits=\"DotNetNuke.UI.Skins.Skin\" %>" + Environment.NewLine; } - else if (SkinRoot == SkinController.RootContainer) + else if (this.SkinRoot == SkinController.RootContainer) { Prefix += "<%@ Control language=\"vb\" AutoEventWireup=\"false\" Explicit=\"True\" Inherits=\"DotNetNuke.UI.Containers.Container\" %>" + Environment.NewLine; } - Messages += SkinController.FormatMessage(CONTROL_DIR, HttpUtility.HtmlEncode(Prefix), 2, false); + Messages += SkinController.FormatMessage(this.CONTROL_DIR, HttpUtility.HtmlEncode(Prefix), 2, false); //add preformatted Control Registrations foreach (string Item in Registrations) { - Messages += SkinController.FormatMessage(CONTROL_REG, HttpUtility.HtmlEncode(Item), 2, false); + Messages += SkinController.FormatMessage(this.CONTROL_REG, HttpUtility.HtmlEncode(Item), 2, false); Prefix += Item; } //update file contents to include ascx header information - Contents = Prefix + Contents; + this.Contents = Prefix + this.Contents; return Messages; } } diff --git a/DNN Platform/Library/UI/Skins/SkinInfo.cs b/DNN Platform/Library/UI/Skins/SkinInfo.cs index 830615c5ffa..d5e60ed6d30 100644 --- a/DNN Platform/Library/UI/Skins/SkinInfo.cs +++ b/DNN Platform/Library/UI/Skins/SkinInfo.cs @@ -34,11 +34,11 @@ public int SkinId { get { - return _SkinId; + return this._SkinId; } set { - _SkinId = value; + this._SkinId = value; } } @@ -46,11 +46,11 @@ public int PortalId { get { - return _PortalId; + return this._PortalId; } set { - _PortalId = value; + this._PortalId = value; } } @@ -58,11 +58,11 @@ public string SkinRoot { get { - return _SkinRoot; + return this._SkinRoot; } set { - _SkinRoot = value; + this._SkinRoot = value; } } @@ -70,11 +70,11 @@ public SkinType SkinType { get { - return _SkinType; + return this._SkinType; } set { - _SkinType = value; + this._SkinType = value; } } @@ -82,11 +82,11 @@ public string SkinSrc { get { - return _SkinSrc; + return this._SkinSrc; } set { - _SkinSrc = value; + this._SkinSrc = value; } } } diff --git a/DNN Platform/Library/UI/Skins/SkinPackageInfo.cs b/DNN Platform/Library/UI/Skins/SkinPackageInfo.cs index c7cefe4b87c..3fc7095fd12 100644 --- a/DNN Platform/Library/UI/Skins/SkinPackageInfo.cs +++ b/DNN Platform/Library/UI/Skins/SkinPackageInfo.cs @@ -48,11 +48,11 @@ public int PackageID { get { - return _PackageID; + return this._PackageID; } set { - _PackageID = value; + this._PackageID = value; } } @@ -60,11 +60,11 @@ public int SkinPackageID { get { - return _SkinPackageID; + return this._SkinPackageID; } set { - _SkinPackageID = value; + this._SkinPackageID = value; } } @@ -72,11 +72,11 @@ public int PortalID { get { - return _PortalID; + return this._PortalID; } set { - _PortalID = value; + this._PortalID = value; } } @@ -84,11 +84,11 @@ public string SkinName { get { - return _SkinName; + return this._SkinName; } set { - _SkinName = value; + this._SkinName = value; } } @@ -97,11 +97,11 @@ public Dictionary Skins { get { - return _Skins; + return this._Skins; } set { - _Skins = value; + this._Skins = value; } } @@ -109,11 +109,11 @@ public string SkinType { get { - return _SkinType; + return this._SkinType; } set { - _SkinType = value; + this._SkinType = value; } } @@ -123,10 +123,10 @@ public string SkinType public void Fill(IDataReader dr) { - SkinPackageID = Null.SetNullInteger(dr["SkinPackageID"]); - PackageID = Null.SetNullInteger(dr["PackageID"]); - SkinName = Null.SetNullString(dr["SkinName"]); - SkinType = Null.SetNullString(dr["SkinType"]); + this.SkinPackageID = Null.SetNullInteger(dr["SkinPackageID"]); + this.PackageID = Null.SetNullInteger(dr["PackageID"]); + this.SkinName = Null.SetNullString(dr["SkinName"]); + this.SkinType = Null.SetNullString(dr["SkinType"]); //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); @@ -137,7 +137,7 @@ public void Fill(IDataReader dr) int skinID = Null.SetNullInteger(dr["SkinID"]); if (skinID > Null.NullInteger) { - _Skins[skinID] = Null.SetNullString(dr["SkinSrc"]); + this._Skins[skinID] = Null.SetNullString(dr["SkinSrc"]); } } } @@ -147,11 +147,11 @@ public int KeyID { get { - return SkinPackageID; + return this.SkinPackageID; } set { - SkinPackageID = value; + this.SkinPackageID = value; } } diff --git a/DNN Platform/Library/UI/Skins/SkinThumbNailControl.cs b/DNN Platform/Library/UI/Skins/SkinThumbNailControl.cs index 1a63ea3c525..968b1522b14 100644 --- a/DNN Platform/Library/UI/Skins/SkinThumbNailControl.cs +++ b/DNN Platform/Library/UI/Skins/SkinThumbNailControl.cs @@ -44,17 +44,17 @@ public string Border { get { - return Convert.ToString(ViewState["SkinControlBorder"]); + return Convert.ToString(this.ViewState["SkinControlBorder"]); } set { - ViewState["SkinControlBorder"] = value; + this.ViewState["SkinControlBorder"] = value; if (!String.IsNullOrEmpty(value)) { - ControlContainer.Style.Add("border-top", value); - ControlContainer.Style.Add("border-bottom", value); - ControlContainer.Style.Add("border-left", value); - ControlContainer.Style.Add("border-right", value); + this.ControlContainer.Style.Add("border-top", value); + this.ControlContainer.Style.Add("border-bottom", value); + this.ControlContainer.Style.Add("border-left", value); + this.ControlContainer.Style.Add("border-right", value); } } } @@ -63,14 +63,14 @@ public int Columns { get { - return Convert.ToInt32(ViewState["SkinControlColumns"]); + return Convert.ToInt32(this.ViewState["SkinControlColumns"]); } set { - ViewState["SkinControlColumns"] = value; + this.ViewState["SkinControlColumns"] = value; if (value > 0) { - OptSkin.RepeatColumns = value; + this.OptSkin.RepeatColumns = value; } } } @@ -79,14 +79,14 @@ public string Height { get { - return Convert.ToString(ViewState["SkinControlHeight"]); + return Convert.ToString(this.ViewState["SkinControlHeight"]); } set { - ViewState["SkinControlHeight"] = value; + this.ViewState["SkinControlHeight"] = value; if (!String.IsNullOrEmpty(value)) { - ControlContainer.Style.Add("height", value); + this.ControlContainer.Style.Add("height", value); } } } @@ -95,11 +95,11 @@ public string SkinRoot { get { - return Convert.ToString(ViewState["SkinRoot"]); + return Convert.ToString(this.ViewState["SkinRoot"]); } set { - ViewState["SkinRoot"] = value; + this.ViewState["SkinRoot"] = value; } } @@ -107,17 +107,17 @@ public string SkinSrc { get { - return OptSkin.SelectedItem != null ? OptSkin.SelectedItem.Value : ""; + return this.OptSkin.SelectedItem != null ? this.OptSkin.SelectedItem.Value : ""; } set { //select current skin int intIndex; - for (intIndex = 0; intIndex <= OptSkin.Items.Count - 1; intIndex++) + for (intIndex = 0; intIndex <= this.OptSkin.Items.Count - 1; intIndex++) { - if (OptSkin.Items[intIndex].Value == value) + if (this.OptSkin.Items[intIndex].Value == value) { - OptSkin.Items[intIndex].Selected = true; + this.OptSkin.Items[intIndex].Selected = true; break; } } @@ -128,14 +128,14 @@ public string Width { get { - return Convert.ToString(ViewState["SkinControlWidth"]); + return Convert.ToString(this.ViewState["SkinControlWidth"]); } set { - ViewState["SkinControlWidth"] = value; + this.ViewState["SkinControlWidth"] = value; if (!String.IsNullOrEmpty(value)) { - ControlContainer.Style.Add("width", value); + this.ControlContainer.Style.Add("width", value); } } } @@ -155,7 +155,7 @@ private void AddDefaultSkin() { var strDefault = Localization.GetString("Not_Specified") + "
    "; strDefault += ""; - OptSkin.Items.Insert(0, new ListItem(strDefault, "")); + this.OptSkin.Items.Insert(0, new ListItem(strDefault, "")); } /// ----------------------------------------------------------------------------- @@ -180,7 +180,7 @@ private void AddSkin(string root, string strFolder, string strFile) { strImage += ""; } - OptSkin.Items.Add(new ListItem(FormatSkinName(strFolder, Path.GetFileNameWithoutExtension(strFile)) + "
    " + strImage, root + "/" + strFolder + "/" + Path.GetFileName(strFile))); + this.OptSkin.Items.Add(new ListItem(FormatSkinName(strFolder, Path.GetFileNameWithoutExtension(strFile)) + "
    " + strImage, root + "/" + strFolder + "/" + Path.GetFileName(strFile))); } /// ----------------------------------------------------------------------------- @@ -303,7 +303,7 @@ private static string CreateThumbnail(string strImage) /// ----------------------------------------------------------------------------- public void Clear() { - OptSkin.Items.Clear(); + this.OptSkin.Items.Clear(); } /// ----------------------------------------------------------------------------- @@ -319,14 +319,14 @@ public void LoadAllSkins(bool includeNotSpecified) //default value if (includeNotSpecified) { - AddDefaultSkin(); + this.AddDefaultSkin(); } //load host skins (includeNotSpecified = false as we have already added it) - LoadHostSkins(false); + this.LoadHostSkins(false); //load portal skins (includeNotSpecified = false as we have already added it) - LoadPortalSkins(false); + this.LoadPortalSkins(false); } /// ----------------------------------------------------------------------------- @@ -343,11 +343,11 @@ public void LoadHostSkins(bool includeNotSpecified) //default value if (includeNotSpecified) { - AddDefaultSkin(); + this.AddDefaultSkin(); } //load host skins - var strRoot = Globals.HostMapPath + SkinRoot; + var strRoot = Globals.HostMapPath + this.SkinRoot; if (Directory.Exists(strRoot)) { var arrFolders = Directory.GetDirectories(strRoot); @@ -355,7 +355,7 @@ public void LoadHostSkins(bool includeNotSpecified) { if (!strFolder.EndsWith(Globals.glbHostSkinFolder)) { - LoadSkins(strFolder, "[G]", false); + this.LoadSkins(strFolder, "[G]", false); } } } @@ -374,17 +374,17 @@ public void LoadPortalSkins(bool includeNotSpecified) //default value if (includeNotSpecified) { - AddDefaultSkin(); + this.AddDefaultSkin(); } //load portal skins - var strRoot = PortalSettings.HomeDirectoryMapPath + SkinRoot; + var strRoot = this.PortalSettings.HomeDirectoryMapPath + this.SkinRoot; if (Directory.Exists(strRoot)) { var arrFolders = Directory.GetDirectories(strRoot); foreach (var strFolder in arrFolders) { - LoadSkins(strFolder, "[L]", false); + this.LoadSkins(strFolder, "[L]", false); } } } @@ -404,7 +404,7 @@ public void LoadSkins(string strFolder, string skinType, bool includeNotSpecifie //default value if (includeNotSpecified) { - AddDefaultSkin(); + this.AddDefaultSkin(); } if (Directory.Exists(strFolder)) { @@ -413,7 +413,7 @@ public void LoadSkins(string strFolder, string skinType, bool includeNotSpecifie foreach (var strFile in arrFiles) { - AddSkin(skinType + SkinRoot, strFolder, strFile); + this.AddSkin(skinType + this.SkinRoot, strFolder, strFile); } } } diff --git a/DNN Platform/Library/UI/UserControls/Address.cs b/DNN Platform/Library/UI/UserControls/Address.cs index 50d9a527abc..a3421978724 100644 --- a/DNN Platform/Library/UI/UserControls/Address.cs +++ b/DNN Platform/Library/UI/UserControls/Address.cs @@ -107,7 +107,7 @@ public abstract class Address : UserControlBase protected Address() { - StartTabIndex = 1; + this.StartTabIndex = 1; } #endregion @@ -118,11 +118,11 @@ public int ModuleId { get { - return Convert.ToInt32(ViewState["ModuleId"]); + return Convert.ToInt32(this.ViewState["ModuleId"]); } set { - _moduleId = value; + this._moduleId = value; } } @@ -130,11 +130,11 @@ public string LabelColumnWidth { get { - return Convert.ToString(ViewState["LabelColumnWidth"]); + return Convert.ToString(this.ViewState["LabelColumnWidth"]); } set { - _labelColumnWidth = value; + this._labelColumnWidth = value; } } @@ -142,11 +142,11 @@ public string ControlColumnWidth { get { - return Convert.ToString(ViewState["ControlColumnWidth"]); + return Convert.ToString(this.ViewState["ControlColumnWidth"]); } set { - _controlColumnWidth = value; + this._controlColumnWidth = value; } } @@ -156,11 +156,11 @@ public string Street { get { - return txtStreet.Text; + return this.txtStreet.Text; } set { - _street = value; + this._street = value; } } @@ -168,11 +168,11 @@ public string Unit { get { - return txtUnit.Text; + return this.txtUnit.Text; } set { - _unit = value; + this._unit = value; } } @@ -180,11 +180,11 @@ public string City { get { - return txtCity.Text; + return this.txtCity.Text; } set { - _city = value; + this._city = value; } } @@ -193,15 +193,15 @@ public string Country get { var retValue = ""; - if (cboCountry.SelectedItem != null) + if (this.cboCountry.SelectedItem != null) { - switch (_countryData.ToLowerInvariant()) + switch (this._countryData.ToLowerInvariant()) { case "text": - retValue = cboCountry.SelectedIndex == 0 ? "" : cboCountry.SelectedItem.Text; + retValue = this.cboCountry.SelectedIndex == 0 ? "" : this.cboCountry.SelectedItem.Text; break; case "value": - retValue = cboCountry.SelectedItem.Value; + retValue = this.cboCountry.SelectedItem.Value; break; } } @@ -209,7 +209,7 @@ public string Country } set { - _country = value; + this._country = value; } } @@ -218,33 +218,33 @@ public string Region get { var retValue = ""; - if (cboRegion.Visible) + if (this.cboRegion.Visible) { - if (cboRegion.SelectedItem != null) + if (this.cboRegion.SelectedItem != null) { - switch (_regionData.ToLowerInvariant()) + switch (this._regionData.ToLowerInvariant()) { case "text": - if (cboRegion.SelectedIndex > 0) + if (this.cboRegion.SelectedIndex > 0) { - retValue = cboRegion.SelectedItem.Text; + retValue = this.cboRegion.SelectedItem.Text; } break; case "value": - retValue = cboRegion.SelectedItem.Value; + retValue = this.cboRegion.SelectedItem.Value; break; } } } else { - retValue = txtRegion.Text; + retValue = this.txtRegion.Text; } return retValue; } set { - _region = value; + this._region = value; } } @@ -252,11 +252,11 @@ public string Postal { get { - return txtPostal.Text; + return this.txtPostal.Text; } set { - _postal = value; + this._postal = value; } } @@ -264,11 +264,11 @@ public string Telephone { get { - return txtTelephone.Text; + return this.txtTelephone.Text; } set { - _telephone = value; + this._telephone = value; } } @@ -276,11 +276,11 @@ public string Cell { get { - return txtCell.Text; + return this.txtCell.Text; } set { - _cell = value; + this._cell = value; } } @@ -288,11 +288,11 @@ public string Fax { get { - return txtFax.Text; + return this.txtFax.Text; } set { - _fax = value; + this._fax = value; } } @@ -300,7 +300,7 @@ public bool ShowStreet { set { - _showStreet = value; + this._showStreet = value; } } @@ -308,7 +308,7 @@ public bool ShowUnit { set { - _showUnit = value; + this._showUnit = value; } } @@ -316,7 +316,7 @@ public bool ShowCity { set { - _showCity = value; + this._showCity = value; } } @@ -324,7 +324,7 @@ public bool ShowCountry { set { - _showCountry = value; + this._showCountry = value; } } @@ -332,7 +332,7 @@ public bool ShowRegion { set { - _showRegion = value; + this._showRegion = value; } } @@ -340,7 +340,7 @@ public bool ShowPostal { set { - _showPostal = value; + this._showPostal = value; } } @@ -348,7 +348,7 @@ public bool ShowTelephone { set { - _showTelephone = value; + this._showTelephone = value; } } @@ -356,7 +356,7 @@ public bool ShowCell { set { - _showCell = value; + this._showCell = value; } } @@ -364,7 +364,7 @@ public bool ShowFax { set { - _showFax = value; + this._showFax = value; } } @@ -372,7 +372,7 @@ public string CountryData { set { - _countryData = value; + this._countryData = value; } } @@ -380,7 +380,7 @@ public string RegionData { set { - _regionData = value; + this._regionData = value; } } @@ -403,7 +403,7 @@ public string LocalResourceFile /// private void Localize() { - var countryCode = cboCountry.SelectedItem.Value; + var countryCode = this.cboCountry.SelectedItem.Value; var ctlEntry = new ListController(); //listKey in format "Country.US:Region" var listKey = "Country." + countryCode; @@ -411,54 +411,54 @@ private void Localize() if (entryCollection.Any()) { - cboRegion.Visible = true; - txtRegion.Visible = false; + this.cboRegion.Visible = true; + this.txtRegion.Visible = false; { - cboRegion.Items.Clear(); - cboRegion.DataSource = entryCollection; - cboRegion.DataBind(); - cboRegion.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); + this.cboRegion.Items.Clear(); + this.cboRegion.DataSource = entryCollection; + this.cboRegion.DataBind(); + this.cboRegion.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); } if (countryCode.Equals("us", StringComparison.InvariantCultureIgnoreCase)) { - valRegion1.Enabled = true; - valRegion2.Enabled = false; - valRegion1.ErrorMessage = Localization.GetString("StateRequired", Localization.GetResourceFile(this, MyFileName)); - plRegion.Text = Localization.GetString("plState", Localization.GetResourceFile(this, MyFileName)); - plRegion.HelpText = Localization.GetString("plState.Help", Localization.GetResourceFile(this, MyFileName)); - plPostal.Text = Localization.GetString("plZip", Localization.GetResourceFile(this, MyFileName)); - plPostal.HelpText = Localization.GetString("plZip.Help", Localization.GetResourceFile(this, MyFileName)); + this.valRegion1.Enabled = true; + this.valRegion2.Enabled = false; + this.valRegion1.ErrorMessage = Localization.GetString("StateRequired", Localization.GetResourceFile(this, MyFileName)); + this.plRegion.Text = Localization.GetString("plState", Localization.GetResourceFile(this, MyFileName)); + this.plRegion.HelpText = Localization.GetString("plState.Help", Localization.GetResourceFile(this, MyFileName)); + this.plPostal.Text = Localization.GetString("plZip", Localization.GetResourceFile(this, MyFileName)); + this.plPostal.HelpText = Localization.GetString("plZip.Help", Localization.GetResourceFile(this, MyFileName)); } else { - valRegion1.ErrorMessage = Localization.GetString("ProvinceRequired", Localization.GetResourceFile(this, MyFileName)); - plRegion.Text = Localization.GetString("plProvince", Localization.GetResourceFile(this, MyFileName)); - plRegion.HelpText = Localization.GetString("plProvince.Help", Localization.GetResourceFile(this, MyFileName)); - plPostal.Text = Localization.GetString("plPostal", Localization.GetResourceFile(this, MyFileName)); - plPostal.HelpText = Localization.GetString("plPostal.Help", Localization.GetResourceFile(this, MyFileName)); + this.valRegion1.ErrorMessage = Localization.GetString("ProvinceRequired", Localization.GetResourceFile(this, MyFileName)); + this.plRegion.Text = Localization.GetString("plProvince", Localization.GetResourceFile(this, MyFileName)); + this.plRegion.HelpText = Localization.GetString("plProvince.Help", Localization.GetResourceFile(this, MyFileName)); + this.plPostal.Text = Localization.GetString("plPostal", Localization.GetResourceFile(this, MyFileName)); + this.plPostal.HelpText = Localization.GetString("plPostal.Help", Localization.GetResourceFile(this, MyFileName)); } - valRegion1.Enabled = true; - valRegion2.Enabled = false; + this.valRegion1.Enabled = true; + this.valRegion2.Enabled = false; } else { - cboRegion.ClearSelection(); - cboRegion.Visible = false; - txtRegion.Visible = true; - valRegion1.Enabled = false; - valRegion2.Enabled = true; - valRegion2.ErrorMessage = Localization.GetString("RegionRequired", Localization.GetResourceFile(this, MyFileName)); - plRegion.Text = Localization.GetString("plRegion", Localization.GetResourceFile(this, MyFileName)); - plRegion.HelpText = Localization.GetString("plRegion.Help", Localization.GetResourceFile(this, MyFileName)); - plPostal.Text = Localization.GetString("plPostal", Localization.GetResourceFile(this, MyFileName)); - plPostal.HelpText = Localization.GetString("plPostal.Help", Localization.GetResourceFile(this, MyFileName)); + this.cboRegion.ClearSelection(); + this.cboRegion.Visible = false; + this.txtRegion.Visible = true; + this.valRegion1.Enabled = false; + this.valRegion2.Enabled = true; + this.valRegion2.ErrorMessage = Localization.GetString("RegionRequired", Localization.GetResourceFile(this, MyFileName)); + this.plRegion.Text = Localization.GetString("plRegion", Localization.GetResourceFile(this, MyFileName)); + this.plRegion.HelpText = Localization.GetString("plRegion.Help", Localization.GetResourceFile(this, MyFileName)); + this.plPostal.Text = Localization.GetString("plPostal", Localization.GetResourceFile(this, MyFileName)); + this.plPostal.HelpText = Localization.GetString("plPostal.Help", Localization.GetResourceFile(this, MyFileName)); } - var reqRegion = PortalController.GetPortalSettingAsBoolean("addressregion", PortalSettings.PortalId, true); + var reqRegion = PortalController.GetPortalSettingAsBoolean("addressregion", this.PortalSettings.PortalId, true); if (reqRegion) { - valRegion1.Enabled = false; - valRegion2.Enabled = false; + this.valRegion1.Enabled = false; + this.valRegion2.Enabled = false; } } @@ -469,117 +469,117 @@ private void Localize() /// private void ShowRequiredFields() { - var reqStreet = PortalController.GetPortalSettingAsBoolean("addressstreet", PortalSettings.PortalId, true); - var reqCity = PortalController.GetPortalSettingAsBoolean("addresscity", PortalSettings.PortalId, true); - var reqCountry = PortalController.GetPortalSettingAsBoolean("addresscountry", PortalSettings.PortalId, true); - var reqRegion = PortalController.GetPortalSettingAsBoolean("addressregion", PortalSettings.PortalId, true); - var reqPostal = PortalController.GetPortalSettingAsBoolean("addresspostal", PortalSettings.PortalId, true); - var reqTelephone = PortalController.GetPortalSettingAsBoolean("addresstelephone", PortalSettings.PortalId, true); - var reqCell = PortalController.GetPortalSettingAsBoolean("addresscell", PortalSettings.PortalId, true); - var reqFax = PortalController.GetPortalSettingAsBoolean("addressfax", PortalSettings.PortalId, true); + var reqStreet = PortalController.GetPortalSettingAsBoolean("addressstreet", this.PortalSettings.PortalId, true); + var reqCity = PortalController.GetPortalSettingAsBoolean("addresscity", this.PortalSettings.PortalId, true); + var reqCountry = PortalController.GetPortalSettingAsBoolean("addresscountry", this.PortalSettings.PortalId, true); + var reqRegion = PortalController.GetPortalSettingAsBoolean("addressregion", this.PortalSettings.PortalId, true); + var reqPostal = PortalController.GetPortalSettingAsBoolean("addresspostal", this.PortalSettings.PortalId, true); + var reqTelephone = PortalController.GetPortalSettingAsBoolean("addresstelephone", this.PortalSettings.PortalId, true); + var reqCell = PortalController.GetPortalSettingAsBoolean("addresscell", this.PortalSettings.PortalId, true); + var reqFax = PortalController.GetPortalSettingAsBoolean("addressfax", this.PortalSettings.PortalId, true); if (TabPermissionController.CanAdminPage()) { if (reqCountry) { - chkCountry.Checked = true; - valCountry.Enabled = true; - cboCountry.CssClass = "dnnFormRequired"; + this.chkCountry.Checked = true; + this.valCountry.Enabled = true; + this.cboCountry.CssClass = "dnnFormRequired"; } else { - valCountry.Enabled = false; - cboCountry.CssClass = ""; + this.valCountry.Enabled = false; + this.cboCountry.CssClass = ""; } if (reqRegion) { - chkRegion.Checked = true; - txtRegion.CssClass = "dnnFormRequired"; - cboRegion.CssClass = "dnnFormRequired"; + this.chkRegion.Checked = true; + this.txtRegion.CssClass = "dnnFormRequired"; + this.cboRegion.CssClass = "dnnFormRequired"; - if (cboRegion.Visible) + if (this.cboRegion.Visible) { - valRegion1.Enabled = true; - valRegion2.Enabled = false; + this.valRegion1.Enabled = true; + this.valRegion2.Enabled = false; } else { - valRegion1.Enabled = false; - valRegion2.Enabled = true; + this.valRegion1.Enabled = false; + this.valRegion2.Enabled = true; } } else { - valRegion1.Enabled = false; - valRegion2.Enabled = false; - txtRegion.CssClass = ""; - cboRegion.CssClass = ""; + this.valRegion1.Enabled = false; + this.valRegion2.Enabled = false; + this.txtRegion.CssClass = ""; + this.cboRegion.CssClass = ""; } if (reqCity) { - chkCity.Checked = true; - valCity.Enabled = true; - txtCity.CssClass = "dnnFormRequired"; + this.chkCity.Checked = true; + this.valCity.Enabled = true; + this.txtCity.CssClass = "dnnFormRequired"; } else { - valCity.Enabled = false; - txtCity.CssClass = ""; + this.valCity.Enabled = false; + this.txtCity.CssClass = ""; } if (reqStreet) { - chkStreet.Checked = true; - valStreet.Enabled = true; - txtStreet.CssClass = "dnnFormRequired"; + this.chkStreet.Checked = true; + this.valStreet.Enabled = true; + this.txtStreet.CssClass = "dnnFormRequired"; } else { - valStreet.Enabled = false; - txtStreet.CssClass = ""; + this.valStreet.Enabled = false; + this.txtStreet.CssClass = ""; } if (reqPostal) { - chkPostal.Checked = true; - valPostal.Enabled = true; - txtPostal.CssClass = "dnnFormRequired"; + this.chkPostal.Checked = true; + this.valPostal.Enabled = true; + this.txtPostal.CssClass = "dnnFormRequired"; } else { - valPostal.Enabled = false; - txtPostal.CssClass = ""; + this.valPostal.Enabled = false; + this.txtPostal.CssClass = ""; } if (reqTelephone) { - chkTelephone.Checked = true; - valTelephone.Enabled = true; - txtTelephone.CssClass = "dnnFormRequired"; + this.chkTelephone.Checked = true; + this.valTelephone.Enabled = true; + this.txtTelephone.CssClass = "dnnFormRequired"; } else { - valTelephone.Enabled = false; - txtTelephone.CssClass = ""; + this.valTelephone.Enabled = false; + this.txtTelephone.CssClass = ""; } if (reqCell) { - chkCell.Checked = true; - valCell.Enabled = true; - txtCell.CssClass = "dnnFormRequired"; + this.chkCell.Checked = true; + this.valCell.Enabled = true; + this.txtCell.CssClass = "dnnFormRequired"; } else { - valCell.Enabled = false; - txtCell.CssClass = ""; + this.valCell.Enabled = false; + this.txtCell.CssClass = ""; } if (reqFax) { - chkFax.Checked = true; - valFax.Enabled = true; - txtFax.CssClass = "dnnFormRequired"; + this.chkFax.Checked = true; + this.valFax.Enabled = true; + this.txtFax.CssClass = "dnnFormRequired"; } else { - valFax.Enabled = false; - txtFax.CssClass = ""; + this.valFax.Enabled = false; + this.txtFax.CssClass = ""; } } } @@ -591,20 +591,20 @@ private void ShowRequiredFields() /// private void UpdateRequiredFields() { - if (chkCountry.Checked == false) + if (this.chkCountry.Checked == false) { - chkRegion.Checked = false; + this.chkRegion.Checked = false; } - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addressstreet", chkStreet.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addresscity", chkCity.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addresscountry", chkCountry.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addressregion", chkRegion.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addresspostal", chkPostal.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addresstelephone", chkTelephone.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addresscell", chkCell.Checked ? "" : "N"); - PortalController.UpdatePortalSetting(PortalSettings.PortalId, "addressfax", chkFax.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addressstreet", this.chkStreet.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addresscity", this.chkCity.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addresscountry", this.chkCountry.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addressregion", this.chkRegion.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addresspostal", this.chkPostal.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addresstelephone", this.chkTelephone.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addresscell", this.chkCell.Checked ? "" : "N"); + PortalController.UpdatePortalSetting(this.PortalSettings.PortalId, "addressfax", this.chkFax.Checked ? "" : "N"); - ShowRequiredFields(); + this.ShowRequiredFields(); } #endregion @@ -620,38 +620,38 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cboCountry.SelectedIndexChanged += OnCountryIndexChanged; - chkCell.CheckedChanged += OnCellCheckChanged; - chkCity.CheckedChanged += OnCityCheckChanged; - chkCountry.CheckedChanged += OnCountryCheckChanged; - chkFax.CheckedChanged += OnFaxCheckChanged; - chkPostal.CheckedChanged += OnPostalCheckChanged; - chkRegion.CheckedChanged += OnRegionCheckChanged; - chkStreet.CheckedChanged += OnStreetCheckChanged; - chkTelephone.CheckedChanged += OnTelephoneCheckChanged; + this.cboCountry.SelectedIndexChanged += this.OnCountryIndexChanged; + this.chkCell.CheckedChanged += this.OnCellCheckChanged; + this.chkCity.CheckedChanged += this.OnCityCheckChanged; + this.chkCountry.CheckedChanged += this.OnCountryCheckChanged; + this.chkFax.CheckedChanged += this.OnFaxCheckChanged; + this.chkPostal.CheckedChanged += this.OnPostalCheckChanged; + this.chkRegion.CheckedChanged += this.OnRegionCheckChanged; + this.chkStreet.CheckedChanged += this.OnStreetCheckChanged; + this.chkTelephone.CheckedChanged += this.OnTelephoneCheckChanged; try { - valStreet.ErrorMessage = Localization.GetString("StreetRequired", Localization.GetResourceFile(this, MyFileName)); - valCity.ErrorMessage = Localization.GetString("CityRequired", Localization.GetResourceFile(this, MyFileName)); - valCountry.ErrorMessage = Localization.GetString("CountryRequired", Localization.GetResourceFile(this, MyFileName)); - valPostal.ErrorMessage = Localization.GetString("PostalRequired", Localization.GetResourceFile(this, MyFileName)); - valTelephone.ErrorMessage = Localization.GetString("TelephoneRequired", Localization.GetResourceFile(this, MyFileName)); - valCell.ErrorMessage = Localization.GetString("CellRequired", Localization.GetResourceFile(this, MyFileName)); - valFax.ErrorMessage = Localization.GetString("FaxRequired", Localization.GetResourceFile(this, MyFileName)); + this.valStreet.ErrorMessage = Localization.GetString("StreetRequired", Localization.GetResourceFile(this, MyFileName)); + this.valCity.ErrorMessage = Localization.GetString("CityRequired", Localization.GetResourceFile(this, MyFileName)); + this.valCountry.ErrorMessage = Localization.GetString("CountryRequired", Localization.GetResourceFile(this, MyFileName)); + this.valPostal.ErrorMessage = Localization.GetString("PostalRequired", Localization.GetResourceFile(this, MyFileName)); + this.valTelephone.ErrorMessage = Localization.GetString("TelephoneRequired", Localization.GetResourceFile(this, MyFileName)); + this.valCell.ErrorMessage = Localization.GetString("CellRequired", Localization.GetResourceFile(this, MyFileName)); + this.valFax.ErrorMessage = Localization.GetString("FaxRequired", Localization.GetResourceFile(this, MyFileName)); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - txtStreet.TabIndex = Convert.ToInt16(StartTabIndex); - txtUnit.TabIndex = Convert.ToInt16(StartTabIndex + 1); - txtCity.TabIndex = Convert.ToInt16(StartTabIndex + 2); - cboCountry.TabIndex = Convert.ToInt16(StartTabIndex + 3); - cboRegion.TabIndex = Convert.ToInt16(StartTabIndex + 4); - txtRegion.TabIndex = Convert.ToInt16(StartTabIndex + 5); - txtPostal.TabIndex = Convert.ToInt16(StartTabIndex + 6); - txtTelephone.TabIndex = Convert.ToInt16(StartTabIndex + 7); - txtCell.TabIndex = Convert.ToInt16(StartTabIndex + 8); - txtFax.TabIndex = Convert.ToInt16(StartTabIndex + 9); + this.txtStreet.TabIndex = Convert.ToInt16(this.StartTabIndex); + this.txtUnit.TabIndex = Convert.ToInt16(this.StartTabIndex + 1); + this.txtCity.TabIndex = Convert.ToInt16(this.StartTabIndex + 2); + this.cboCountry.TabIndex = Convert.ToInt16(this.StartTabIndex + 3); + this.cboRegion.TabIndex = Convert.ToInt16(this.StartTabIndex + 4); + this.txtRegion.TabIndex = Convert.ToInt16(this.StartTabIndex + 5); + this.txtPostal.TabIndex = Convert.ToInt16(this.StartTabIndex + 6); + this.txtTelephone.TabIndex = Convert.ToInt16(this.StartTabIndex + 7); + this.txtCell.TabIndex = Convert.ToInt16(this.StartTabIndex + 8); + this.txtFax.TabIndex = Convert.ToInt16(this.StartTabIndex + 9); //", "")); + this.cboCountry.DataSource = entryCollection; + this.cboCountry.DataBind(); + this.cboCountry.Items.Insert(0, new ListItem("<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", "")); - switch (_countryData.ToLowerInvariant()) + switch (this._countryData.ToLowerInvariant()) { case "text": - if (String.IsNullOrEmpty(_country)) + if (String.IsNullOrEmpty(this._country)) { - cboCountry.SelectedIndex = 0; + this.cboCountry.SelectedIndex = 0; } else { - if (cboCountry.Items.FindByText(_country) != null) + if (this.cboCountry.Items.FindByText(this._country) != null) { - cboCountry.ClearSelection(); - cboCountry.Items.FindByText(_country).Selected = true; + this.cboCountry.ClearSelection(); + this.cboCountry.Items.FindByText(this._country).Selected = true; } } break; case "value": - if (cboCountry.Items.FindByValue(_country) != null) + if (this.cboCountry.Items.FindByValue(this._country) != null) { - cboCountry.ClearSelection(); - cboCountry.Items.FindByValue(_country).Selected = true; + this.cboCountry.ClearSelection(); + this.cboCountry.Items.FindByValue(this._country).Selected = true; } break; } - Localize(); + this.Localize(); - if (cboRegion.Visible) + if (this.cboRegion.Visible) { - switch (_regionData.ToLowerInvariant()) + switch (this._regionData.ToLowerInvariant()) { case "text": - if (String.IsNullOrEmpty(_region)) + if (String.IsNullOrEmpty(this._region)) { - cboRegion.SelectedIndex = 0; + this.cboRegion.SelectedIndex = 0; } else { - if (cboRegion.Items.FindByText(_region) != null) + if (this.cboRegion.Items.FindByText(this._region) != null) { - cboRegion.Items.FindByText(_region).Selected = true; + this.cboRegion.Items.FindByText(this._region).Selected = true; } } break; case "value": - if (cboRegion.Items.FindByValue(_region) != null) + if (this.cboRegion.Items.FindByValue(this._region) != null) { - cboRegion.Items.FindByValue(_region).Selected = true; + this.cboRegion.Items.FindByValue(this._region).Selected = true; } break; } } else { - txtRegion.Text = _region; + this.txtRegion.Text = this._region; } - txtStreet.Text = _street; - txtUnit.Text = _unit; - txtCity.Text = _city; - txtPostal.Text = _postal; - txtTelephone.Text = _telephone; - txtCell.Text = _cell; - txtFax.Text = _fax; - - divStreet.Visible = _showStreet; - divUnit.Visible = _showUnit; - divCity.Visible = _showCity; - divCountry.Visible = _showCountry; - divRegion.Visible = _showRegion; - divPostal.Visible = _showPostal; - divTelephone.Visible = _showTelephone; - divCell.Visible = _showCell; - divFax.Visible = _showFax; + this.txtStreet.Text = this._street; + this.txtUnit.Text = this._unit; + this.txtCity.Text = this._city; + this.txtPostal.Text = this._postal; + this.txtTelephone.Text = this._telephone; + this.txtCell.Text = this._cell; + this.txtFax.Text = this._fax; + + this.divStreet.Visible = this._showStreet; + this.divUnit.Visible = this._showUnit; + this.divCity.Visible = this._showCity; + this.divCountry.Visible = this._showCountry; + this.divRegion.Visible = this._showRegion; + this.divPostal.Visible = this._showPostal; + this.divTelephone.Visible = this._showTelephone; + this.divCell.Visible = this._showCell; + this.divFax.Visible = this._showFax; if (TabPermissionController.CanAdminPage()) { - chkStreet.Visible = true; - chkCity.Visible = true; - chkCountry.Visible = true; - chkRegion.Visible = true; - chkPostal.Visible = true; - chkTelephone.Visible = true; - chkCell.Visible = true; - chkFax.Visible = true; + this.chkStreet.Visible = true; + this.chkCity.Visible = true; + this.chkCountry.Visible = true; + this.chkRegion.Visible = true; + this.chkPostal.Visible = true; + this.chkTelephone.Visible = true; + this.chkCell.Visible = true; + this.chkFax.Visible = true; } - ViewState["ModuleId"] = Convert.ToString(_moduleId); - ViewState["LabelColumnWidth"] = _labelColumnWidth; - ViewState["ControlColumnWidth"] = _controlColumnWidth; + this.ViewState["ModuleId"] = Convert.ToString(this._moduleId); + this.ViewState["LabelColumnWidth"] = this._labelColumnWidth; + this.ViewState["ControlColumnWidth"] = this._controlColumnWidth; - ShowRequiredFields(); + this.ShowRequiredFields(); } } catch (Exception exc) @@ -766,7 +766,7 @@ protected void OnCountryIndexChanged(object sender, EventArgs e) { try { - Localize(); + this.Localize(); } catch (Exception exc) { @@ -778,7 +778,7 @@ protected void OnCityCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) //Module failed to load { @@ -790,7 +790,7 @@ protected void OnCountryCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { @@ -802,7 +802,7 @@ protected void OnPostalCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { @@ -814,7 +814,7 @@ protected void OnRegionCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { @@ -826,7 +826,7 @@ protected void OnStreetCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { @@ -838,7 +838,7 @@ protected void OnTelephoneCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { @@ -850,7 +850,7 @@ protected void OnCellCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { @@ -862,7 +862,7 @@ protected void OnFaxCheckChanged(object sender, EventArgs e) { try { - UpdateRequiredFields(); + this.UpdateRequiredFields(); } catch (Exception exc) { diff --git a/DNN Platform/Library/UI/UserControls/DualListControl.cs b/DNN Platform/Library/UI/UserControls/DualListControl.cs index 3ed46580de3..0a7bb2bb519 100644 --- a/DNN Platform/Library/UI/UserControls/DualListControl.cs +++ b/DNN Platform/Library/UI/UserControls/DualListControl.cs @@ -44,11 +44,11 @@ public string ListBoxWidth { get { - return Convert.ToString(ViewState[ClientID + "_ListBoxWidth"]); + return Convert.ToString(this.ViewState[this.ClientID + "_ListBoxWidth"]); } set { - _ListBoxWidth = value; + this._ListBoxWidth = value; } } @@ -56,11 +56,11 @@ public string ListBoxHeight { get { - return Convert.ToString(ViewState[ClientID + "_ListBoxHeight"]); + return Convert.ToString(this.ViewState[this.ClientID + "_ListBoxHeight"]); } set { - _ListBoxHeight = value; + this._ListBoxHeight = value; } } @@ -69,7 +69,7 @@ public ArrayList Available get { var objList = new ArrayList(); - foreach (ListItem objListItem in lstAvailable.Items) + foreach (ListItem objListItem in this.lstAvailable.Items) { objList.Add(objListItem); } @@ -77,7 +77,7 @@ public ArrayList Available } set { - _Available = value; + this._Available = value; } } @@ -86,7 +86,7 @@ public ArrayList Assigned get { var objList = new ArrayList(); - foreach (ListItem objListItem in lstAssigned.Items) + foreach (ListItem objListItem in this.lstAssigned.Items) { objList.Add(objListItem); } @@ -94,7 +94,7 @@ public ArrayList Assigned } set { - _Assigned = value; + this._Assigned = value; } } @@ -102,7 +102,7 @@ public string DataTextField { set { - _DataTextField = value; + this._DataTextField = value; } } @@ -110,7 +110,7 @@ public string DataValueField { set { - _DataValueField = value; + this._DataValueField = value; } } @@ -118,7 +118,7 @@ public bool Enabled { set { - _Enabled = value; + this._Enabled = value; } } @@ -131,56 +131,56 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdAdd.Click += cmdAdd_Click; - cmdAddAll.Click += cmdAddAll_Click; - cmdRemove.Click += cmdRemove_Click; - cmdRemoveAll.Click += cmdRemoveAll_Click; + this.cmdAdd.Click += this.cmdAdd_Click; + this.cmdAddAll.Click += this.cmdAddAll_Click; + this.cmdRemove.Click += this.cmdRemove_Click; + this.cmdRemoveAll.Click += this.cmdRemoveAll_Click; try { //Localization - Label1.Text = Localization.GetString("Available", Localization.GetResourceFile(this, MyFileName)); - Label2.Text = Localization.GetString("Assigned", Localization.GetResourceFile(this, MyFileName)); - cmdAdd.ToolTip = Localization.GetString("Add", Localization.GetResourceFile(this, MyFileName)); - cmdAddAll.ToolTip = Localization.GetString("AddAll", Localization.GetResourceFile(this, MyFileName)); - cmdRemove.ToolTip = Localization.GetString("Remove", Localization.GetResourceFile(this, MyFileName)); - cmdRemoveAll.ToolTip = Localization.GetString("RemoveAll", Localization.GetResourceFile(this, MyFileName)); + this.Label1.Text = Localization.GetString("Available", Localization.GetResourceFile(this, this.MyFileName)); + this.Label2.Text = Localization.GetString("Assigned", Localization.GetResourceFile(this, this.MyFileName)); + this.cmdAdd.ToolTip = Localization.GetString("Add", Localization.GetResourceFile(this, this.MyFileName)); + this.cmdAddAll.ToolTip = Localization.GetString("AddAll", Localization.GetResourceFile(this, this.MyFileName)); + this.cmdRemove.ToolTip = Localization.GetString("Remove", Localization.GetResourceFile(this, this.MyFileName)); + this.cmdRemoveAll.ToolTip = Localization.GetString("RemoveAll", Localization.GetResourceFile(this, this.MyFileName)); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { //set dimensions of control - if (!String.IsNullOrEmpty(_ListBoxWidth)) + if (!String.IsNullOrEmpty(this._ListBoxWidth)) { - lstAvailable.Width = Unit.Parse(_ListBoxWidth); - lstAssigned.Width = Unit.Parse(_ListBoxWidth); + this.lstAvailable.Width = Unit.Parse(this._ListBoxWidth); + this.lstAssigned.Width = Unit.Parse(this._ListBoxWidth); } - if (!String.IsNullOrEmpty(_ListBoxHeight)) + if (!String.IsNullOrEmpty(this._ListBoxHeight)) { - lstAvailable.Height = Unit.Parse(_ListBoxHeight); - lstAssigned.Height = Unit.Parse(_ListBoxHeight); + this.lstAvailable.Height = Unit.Parse(this._ListBoxHeight); + this.lstAssigned.Height = Unit.Parse(this._ListBoxHeight); } //load available - lstAvailable.DataTextField = _DataTextField; - lstAvailable.DataValueField = _DataValueField; - lstAvailable.DataSource = _Available; - lstAvailable.DataBind(); - Sort(lstAvailable); + this.lstAvailable.DataTextField = this._DataTextField; + this.lstAvailable.DataValueField = this._DataValueField; + this.lstAvailable.DataSource = this._Available; + this.lstAvailable.DataBind(); + this.Sort(this.lstAvailable); //load selected - lstAssigned.DataTextField = _DataTextField; - lstAssigned.DataValueField = _DataValueField; - lstAssigned.DataSource = _Assigned; - lstAssigned.DataBind(); - Sort(lstAssigned); + this.lstAssigned.DataTextField = this._DataTextField; + this.lstAssigned.DataValueField = this._DataValueField; + this.lstAssigned.DataSource = this._Assigned; + this.lstAssigned.DataBind(); + this.Sort(this.lstAssigned); //set enabled - lstAvailable.Enabled = _Enabled; - lstAssigned.Enabled = _Enabled; + this.lstAvailable.Enabled = this._Enabled; + this.lstAssigned.Enabled = this._Enabled; //save persistent values - ViewState[ClientID + "_ListBoxWidth"] = _ListBoxWidth; - ViewState[ClientID + "_ListBoxHeight"] = _ListBoxHeight; + this.ViewState[this.ClientID + "_ListBoxWidth"] = this._ListBoxWidth; + this.ViewState[this.ClientID + "_ListBoxHeight"] = this._ListBoxHeight; } } catch (Exception exc) //Module failed to load @@ -192,7 +192,7 @@ protected override void OnLoad(EventArgs e) private void cmdAdd_Click(object sender, EventArgs e) { var objList = new ArrayList(); - foreach (ListItem objListItem in lstAvailable.Items) + foreach (ListItem objListItem in this.lstAvailable.Items) { objList.Add(objListItem); } @@ -200,19 +200,19 @@ private void cmdAdd_Click(object sender, EventArgs e) { if (objListItem.Selected) { - lstAvailable.Items.Remove(objListItem); - lstAssigned.Items.Add(objListItem); + this.lstAvailable.Items.Remove(objListItem); + this.lstAssigned.Items.Add(objListItem); } } - lstAvailable.ClearSelection(); - lstAssigned.ClearSelection(); - Sort(lstAssigned); + this.lstAvailable.ClearSelection(); + this.lstAssigned.ClearSelection(); + this.Sort(this.lstAssigned); } private void cmdRemove_Click(object sender, EventArgs e) { var objList = new ArrayList(); - foreach (ListItem objListItem in lstAssigned.Items) + foreach (ListItem objListItem in this.lstAssigned.Items) { objList.Add(objListItem); } @@ -220,37 +220,37 @@ private void cmdRemove_Click(object sender, EventArgs e) { if (objListItem.Selected) { - lstAssigned.Items.Remove(objListItem); - lstAvailable.Items.Add(objListItem); + this.lstAssigned.Items.Remove(objListItem); + this.lstAvailable.Items.Add(objListItem); } } - lstAvailable.ClearSelection(); - lstAssigned.ClearSelection(); - Sort(lstAvailable); + this.lstAvailable.ClearSelection(); + this.lstAssigned.ClearSelection(); + this.Sort(this.lstAvailable); } private void cmdAddAll_Click(object sender, EventArgs e) { - foreach (ListItem objListItem in lstAvailable.Items) + foreach (ListItem objListItem in this.lstAvailable.Items) { - lstAssigned.Items.Add(objListItem); + this.lstAssigned.Items.Add(objListItem); } - lstAvailable.Items.Clear(); - lstAvailable.ClearSelection(); - lstAssigned.ClearSelection(); - Sort(lstAssigned); + this.lstAvailable.Items.Clear(); + this.lstAvailable.ClearSelection(); + this.lstAssigned.ClearSelection(); + this.Sort(this.lstAssigned); } private void cmdRemoveAll_Click(object sender, EventArgs e) { - foreach (ListItem objListItem in lstAssigned.Items) + foreach (ListItem objListItem in this.lstAssigned.Items) { - lstAvailable.Items.Add(objListItem); + this.lstAvailable.Items.Add(objListItem); } - lstAssigned.Items.Clear(); - lstAvailable.ClearSelection(); - lstAssigned.ClearSelection(); - Sort(lstAvailable); + this.lstAssigned.Items.Clear(); + this.lstAvailable.ClearSelection(); + this.lstAssigned.ClearSelection(); + this.Sort(this.lstAvailable); } #endregion diff --git a/DNN Platform/Library/UI/UserControls/Help.cs b/DNN Platform/Library/UI/UserControls/Help.cs index 77950611806..988c9bfa7dc 100644 --- a/DNN Platform/Library/UI/UserControls/Help.cs +++ b/DNN Platform/Library/UI/UserControls/Help.cs @@ -41,16 +41,16 @@ public abstract class Help : PortalModuleBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdCancel.Click += cmdCancel_Click; + this.cmdCancel.Click += this.cmdCancel_Click; int moduleControlId = Null.NullInteger; - if (Request.QueryString["ctlid"] != null) + if (this.Request.QueryString["ctlid"] != null) { - moduleControlId = Int32.Parse(Request.QueryString["ctlid"]); + moduleControlId = Int32.Parse(this.Request.QueryString["ctlid"]); } else if (Host.EnableModuleOnLineHelp) { - helpFrame.Text = string.Format("", Host.HelpURL); + this.helpFrame.Text = string.Format("", Host.HelpURL); } ModuleControlInfo objModuleControl = ModuleControlController.GetModuleControl(moduleControlId); @@ -58,7 +58,7 @@ protected override void OnLoad(EventArgs e) { if (!string.IsNullOrEmpty(objModuleControl.HelpURL) && Host.EnableModuleOnLineHelp) { - helpFrame.Text = string.Format("", objModuleControl.HelpURL); ; + this.helpFrame.Text = string.Format("", objModuleControl.HelpURL); ; } else { @@ -66,26 +66,26 @@ protected override void OnLoad(EventArgs e) string localResourceFile = objModuleControl.ControlSrc.Replace(fileName, Localization.LocalResourceDirectory + "/" + fileName); if (!String.IsNullOrEmpty(Localization.GetString(ModuleActionType.HelpText, localResourceFile))) { - lblHelp.Text = Localization.GetString(ModuleActionType.HelpText, localResourceFile); + this.lblHelp.Text = Localization.GetString(ModuleActionType.HelpText, localResourceFile); } else { - lblHelp.Text = Localization.GetString("lblHelp.Text", Localization.GetResourceFile(this, MyFileName)); + this.lblHelp.Text = Localization.GetString("lblHelp.Text", Localization.GetResourceFile(this, this.MyFileName)); } } - _key = objModuleControl.ControlKey; + this._key = objModuleControl.ControlKey; //display module info to Host users - if (UserInfo.IsSuperUser) + if (this.UserInfo.IsSuperUser) { - string strInfo = Localization.GetString("lblInfo.Text", Localization.GetResourceFile(this, MyFileName)); + string strInfo = Localization.GetString("lblInfo.Text", Localization.GetResourceFile(this, this.MyFileName)); strInfo = strInfo.Replace("[CONTROL]", objModuleControl.ControlKey); strInfo = strInfo.Replace("[SRC]", objModuleControl.ControlSrc); ModuleDefinitionInfo objModuleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(objModuleControl.ModuleDefID); if (objModuleDefinition != null) { strInfo = strInfo.Replace("[DEFINITION]", objModuleDefinition.FriendlyName); - DesktopModuleInfo objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, PortalId); + DesktopModuleInfo objDesktopModule = DesktopModuleController.GetDesktopModule(objModuleDefinition.DesktopModuleID, this.PortalId); if (objDesktopModule != null) { PackageInfo objPackage = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == objDesktopModule.PackageID); @@ -100,20 +100,20 @@ protected override void OnLoad(EventArgs e) } } } - lblInfo.Text = Server.HtmlDecode(strInfo); + this.lblInfo.Text = this.Server.HtmlDecode(strInfo); } - cmdHelp.Visible = !string.IsNullOrEmpty(objModuleControl.HelpURL); + this.cmdHelp.Visible = !string.IsNullOrEmpty(objModuleControl.HelpURL); } - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - if (Request.UrlReferrer != null) + if (this.Request.UrlReferrer != null) { - ViewState["UrlReferrer"] = Convert.ToString(Request.UrlReferrer); + this.ViewState["UrlReferrer"] = Convert.ToString(this.Request.UrlReferrer); } else { - ViewState["UrlReferrer"] = ""; + this.ViewState["UrlReferrer"] = ""; } } } @@ -128,7 +128,7 @@ protected void cmdCancel_Click(Object sender, EventArgs e) { try { - Response.Redirect(Convert.ToString(ViewState["UrlReferrer"]), true); + this.Response.Redirect(Convert.ToString(this.ViewState["UrlReferrer"]), true); } catch (Exception exc) //Module failed to load { diff --git a/DNN Platform/Library/UI/UserControls/HelpButtonControl.cs b/DNN Platform/Library/UI/UserControls/HelpButtonControl.cs index ef072523e30..b567dafb5da 100644 --- a/DNN Platform/Library/UI/UserControls/HelpButtonControl.cs +++ b/DNN Platform/Library/UI/UserControls/HelpButtonControl.cs @@ -64,11 +64,11 @@ public string HelpKey { get { - return _HelpKey; + return this._HelpKey; } set { - _HelpKey = value; + this._HelpKey = value; } } @@ -84,17 +84,17 @@ public string HelpText { get { - return lblHelp.Text; + return this.lblHelp.Text; } set { - lblHelp.Text = value; - imgHelp.AlternateText = HtmlUtils.Clean(value, false); + this.lblHelp.Text = value; + this.imgHelp.AlternateText = HtmlUtils.Clean(value, false); //hide the help icon if the help text is "" if (String.IsNullOrEmpty(value)) { - imgHelp.Visible = false; + this.imgHelp.Visible = false; } } } @@ -111,11 +111,11 @@ public string ResourceKey { get { - return _ResourceKey; + return this._ResourceKey; } set { - _ResourceKey = value; + this._ResourceKey = value; } } @@ -134,20 +134,20 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdHelp.Click += cmdHelp_Click; + this.cmdHelp.Click += this.cmdHelp_Click; try { - DNNClientAPI.EnableMinMax(cmdHelp, pnlHelp, true, DNNClientAPI.MinMaxPersistanceType.None); - if (String.IsNullOrEmpty(_HelpKey)) + DNNClientAPI.EnableMinMax(this.cmdHelp, this.pnlHelp, true, DNNClientAPI.MinMaxPersistanceType.None); + if (String.IsNullOrEmpty(this._HelpKey)) { //Set Help Key to the Resource Key plus ".Help" - _HelpKey = _ResourceKey + ".Help"; + this._HelpKey = this._ResourceKey + ".Help"; } - string helpText = Localization.GetString(_HelpKey, this); + string helpText = Localization.GetString(this._HelpKey, this); if (!String.IsNullOrEmpty(helpText)) { - HelpText = helpText; + this.HelpText = helpText; } } catch (Exception exc) //Module failed to load @@ -158,7 +158,7 @@ protected override void OnLoad(EventArgs e) protected void cmdHelp_Click(object sender, EventArgs e) { - pnlHelp.Visible = true; + this.pnlHelp.Visible = true; } #endregion diff --git a/DNN Platform/Library/UI/UserControls/LabelControl.cs b/DNN Platform/Library/UI/UserControls/LabelControl.cs index 06a8a20b8a2..45a5430d6c9 100644 --- a/DNN Platform/Library/UI/UserControls/LabelControl.cs +++ b/DNN Platform/Library/UI/UserControls/LabelControl.cs @@ -85,11 +85,11 @@ public string HelpText { get { - return lblHelp.Text; + return this.lblHelp.Text; } set { - lblHelp.Text = value; + this.lblHelp.Text = value; } } @@ -97,11 +97,11 @@ public string NoHelpLabelText { get { - return lblNoHelpLabel.Text; + return this.lblNoHelpLabel.Text; } set { - lblNoHelpLabel.Text = value; + this.lblNoHelpLabel.Text = value; } } @@ -131,11 +131,11 @@ public string Text { get { - return lblLabel.Text; + return this.lblLabel.Text; } set { - lblLabel.Text = value; + this.lblLabel.Text = value; } } @@ -149,11 +149,11 @@ public Unit Width { get { - return lblLabel.Width; + return this.lblLabel.Width; } set { - lblLabel.Width = value; + this.lblLabel.Width = value; } } @@ -171,7 +171,7 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - RegisterClientDependencies(); + this.RegisterClientDependencies(); } catch (Exception exc) //Module failed to load { @@ -184,65 +184,65 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); //get the localised text - if (String.IsNullOrEmpty(ResourceKey)) + if (String.IsNullOrEmpty(this.ResourceKey)) { //Set Resource Key to the ID of the control - ResourceKey = ID; + this.ResourceKey = this.ID; } - if ((!string.IsNullOrEmpty(ResourceKey))) + if ((!string.IsNullOrEmpty(this.ResourceKey))) { - var localText = Localization.GetString(ResourceKey, this); + var localText = Localization.GetString(this.ResourceKey, this); if (!string.IsNullOrEmpty(localText)) { - Text = localText + Suffix; + this.Text = localText + this.Suffix; //NoHelpLabelText = Text; } else { - Text += Suffix; + this.Text += this.Suffix; //NoHelpLabelText = Text; } } //Set Help Key to the Resource Key plus ".Help" - if (String.IsNullOrEmpty(HelpKey)) + if (String.IsNullOrEmpty(this.HelpKey)) { - HelpKey = ResourceKey + ".Help"; + this.HelpKey = this.ResourceKey + ".Help"; } - var helpText = Localization.GetString(HelpKey, this); - if ((!string.IsNullOrEmpty(helpText)) || (string.IsNullOrEmpty(HelpText))) + var helpText = Localization.GetString(this.HelpKey, this); + if ((!string.IsNullOrEmpty(helpText)) || (string.IsNullOrEmpty(this.HelpText))) { - HelpText = helpText; + this.HelpText = helpText; } - if (string.IsNullOrEmpty(HelpText)) + if (string.IsNullOrEmpty(this.HelpText)) { - pnlHelp.Visible = cmdHelp.Visible = false; + this.pnlHelp.Visible = this.cmdHelp.Visible = false; //lblHelp.Visible = false; //lblNoHelpLabel.Visible = true; } - if (!string.IsNullOrEmpty(CssClass)) + if (!string.IsNullOrEmpty(this.CssClass)) { - lblLabel.CssClass = CssClass; + this.lblLabel.CssClass = this.CssClass; } //find the reference control in the parents Controls collection - if (!String.IsNullOrEmpty(ControlName)) + if (!String.IsNullOrEmpty(this.ControlName)) { - var c = Parent.FindControl(ControlName); - var clientId = ControlName; + var c = this.Parent.FindControl(this.ControlName); + var clientId = this.ControlName; if (c != null) { clientId = c.ClientID; } - if (!string.IsNullOrEmpty(AssociateFormat)) + if (!string.IsNullOrEmpty(this.AssociateFormat)) { - clientId = string.Format(AssociateFormat, clientId); + clientId = string.Format(this.AssociateFormat, clientId); } - label.Attributes["for"] = clientId; + this.label.Attributes["for"] = clientId; } } diff --git a/DNN Platform/Library/UI/UserControls/LocaleSelectorControl.cs b/DNN Platform/Library/UI/UserControls/LocaleSelectorControl.cs index d3e6c7f73aa..a432796dd44 100644 --- a/DNN Platform/Library/UI/UserControls/LocaleSelectorControl.cs +++ b/DNN Platform/Library/UI/UserControls/LocaleSelectorControl.cs @@ -38,7 +38,7 @@ private CultureDropDownTypes DisplayType { get { - switch (ViewType) + switch (this.ViewType) { case "NATIVE": return CultureDropDownTypes.NativeName; @@ -54,15 +54,15 @@ private string ViewType { get { - if (string.IsNullOrEmpty(_ViewType)) + if (string.IsNullOrEmpty(this._ViewType)) { - _ViewType = Convert.ToString(Personalization.GetProfile("LanguageEnabler", string.Format("ViewType{0}", PortalSettings.PortalId))); + this._ViewType = Convert.ToString(Personalization.GetProfile("LanguageEnabler", string.Format("ViewType{0}", this.PortalSettings.PortalId))); } - if (string.IsNullOrEmpty(_ViewType)) + if (string.IsNullOrEmpty(this._ViewType)) { - _ViewType = "NATIVE"; + this._ViewType = "NATIVE"; } - return _ViewType; + return this._ViewType; } } @@ -70,9 +70,9 @@ private string ViewType public void BindDefaultLanguageSelector() { - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - Localization.LoadCultureDropDownList(ddlPortalDefaultLanguage, DisplayType, PortalSettings.DefaultLanguage, true); + Localization.LoadCultureDropDownList(this.ddlPortalDefaultLanguage, this.DisplayType, this.PortalSettings.DefaultLanguage, true); } } @@ -84,7 +84,7 @@ public string CultureCode { get { - return ddlPortalDefaultLanguage.SelectedValue; + return this.ddlPortalDefaultLanguage.SelectedValue; } } @@ -96,21 +96,21 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - rbViewType.SelectedIndexChanged += rbViewType_SelectedIndexChanged; + this.rbViewType.SelectedIndexChanged += this.rbViewType_SelectedIndexChanged; - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { ListItem item = default(ListItem); - item = new ListItem(Localization.GetString("NativeName.Text", Localization.GetResourceFile(this, MyFileName)), "NATIVE"); - rbViewType.Items.Add(item); - if (ViewType == "NATIVE") + item = new ListItem(Localization.GetString("NativeName.Text", Localization.GetResourceFile(this, this.MyFileName)), "NATIVE"); + this.rbViewType.Items.Add(item); + if (this.ViewType == "NATIVE") { item.Selected = true; } - item = new ListItem(Localization.GetString("EnglishName.Text", Localization.GetResourceFile(this, MyFileName)), "ENGLISH"); - rbViewType.Items.Add(item); - if (ViewType == "ENGLISH") + item = new ListItem(Localization.GetString("EnglishName.Text", Localization.GetResourceFile(this, this.MyFileName)), "ENGLISH"); + this.rbViewType.Items.Add(item); + if (this.ViewType == "ENGLISH") { item.Selected = true; } @@ -121,15 +121,15 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Visible) + if (this.Visible) { - BindDefaultLanguageSelector(); + this.BindDefaultLanguageSelector(); } } private void rbViewType_SelectedIndexChanged(object sender, EventArgs e) { - _ViewType = rbViewType.SelectedValue; + this._ViewType = this.rbViewType.SelectedValue; } #endregion diff --git a/DNN Platform/Library/UI/UserControls/ModuleAuditControl.cs b/DNN Platform/Library/UI/UserControls/ModuleAuditControl.cs index b1c3f64c783..55290b93feb 100644 --- a/DNN Platform/Library/UI/UserControls/ModuleAuditControl.cs +++ b/DNN Platform/Library/UI/UserControls/ModuleAuditControl.cs @@ -29,7 +29,7 @@ public abstract class ModuleAuditControl : UserControl private static readonly Regex CheckDateColumnRegex = new Regex(@"^-?\d+$", RegexOptions.Compiled); - private string DisplayMode => (Request.QueryString["Display"] ?? "").ToLowerInvariant(); + private string DisplayMode => (this.Request.QueryString["Display"] ?? "").ToLowerInvariant(); [Serializable] private class EntityInfo @@ -42,10 +42,10 @@ private class EntityInfo public ModuleAuditControl() { - LastModifiedDate = String.Empty; - LastModifiedByUser = String.Empty; - CreatedByUser = String.Empty; - CreatedDate = String.Empty; + this.LastModifiedDate = String.Empty; + this.LastModifiedByUser = String.Empty; + this.CreatedByUser = String.Empty; + this.CreatedDate = String.Empty; } public string CreatedDate { private get; set; } @@ -68,18 +68,18 @@ public BaseEntityInfo Entity entity.LastModifiedByUserID = value.LastModifiedByUserID; entity.LastModifiedOnDate = value.LastModifiedOnDate; - ViewState["Entity"] = entity; + this.ViewState["Entity"] = entity; } else { - ViewState["Entity"] = null; + this.ViewState["Entity"] = null; } } } private EntityInfo Model { - get { return ViewState["Entity"] as EntityInfo; } + get { return this.ViewState["Entity"] as EntityInfo; } } protected override void OnLoad(EventArgs e) @@ -88,24 +88,24 @@ protected override void OnLoad(EventArgs e) try { - if (Model != null) + if (this.Model != null) { - CreatedByUser = Model.CreatedByUserID.ToString(); - CreatedDate = Model.CreatedOnDate.ToString(); - LastModifiedByUser = Model.LastModifiedByUserID.ToString(); - LastModifiedDate = Model.LastModifiedOnDate.ToString(); + this.CreatedByUser = this.Model.CreatedByUserID.ToString(); + this.CreatedDate = this.Model.CreatedOnDate.ToString(); + this.LastModifiedByUser = this.Model.LastModifiedByUserID.ToString(); + this.LastModifiedDate = this.Model.LastModifiedOnDate.ToString(); } //check to see if updated check is redundant - var isCreatorAndUpdater = CreatedByUser == LastModifiedByUser && - Globals.NumberMatchRegex.IsMatch(CreatedByUser) && Globals.NumberMatchRegex.IsMatch(LastModifiedByUser); + var isCreatorAndUpdater = this.CreatedByUser == this.LastModifiedByUser && + Globals.NumberMatchRegex.IsMatch(this.CreatedByUser) && Globals.NumberMatchRegex.IsMatch(this.LastModifiedByUser); - _systemUser = Localization.GetString("SystemUser", Localization.GetResourceFile(this, MyFileName)); - var displayMode = DisplayMode; + this._systemUser = Localization.GetString("SystemUser", Localization.GetResourceFile(this, MyFileName)); + var displayMode = this.DisplayMode; if (displayMode != "editor" && displayMode != "settings") { - ShowCreatedString(); - ShowUpdatedString(isCreatorAndUpdater); + this.ShowCreatedString(); + this.ShowUpdatedString(isCreatorAndUpdater); } } catch (Exception exc) //Module failed to load @@ -116,58 +116,58 @@ protected override void OnLoad(EventArgs e) private void ShowCreatedString() { - if (CheckDateColumnRegex.IsMatch(CreatedByUser)) + if (CheckDateColumnRegex.IsMatch(this.CreatedByUser)) { - if (int.Parse(CreatedByUser) == Null.NullInteger) + if (int.Parse(this.CreatedByUser) == Null.NullInteger) { - CreatedByUser = _systemUser; + this.CreatedByUser = this._systemUser; } else { //contains a UserID - UserInfo userInfo = UserController.GetUserById(PortalController.Instance.GetCurrentPortalSettings().PortalId, int.Parse(CreatedByUser)); + UserInfo userInfo = UserController.GetUserById(PortalController.Instance.GetCurrentPortalSettings().PortalId, int.Parse(this.CreatedByUser)); if (userInfo != null) { - CreatedByUser = userInfo.DisplayName; + this.CreatedByUser = userInfo.DisplayName; } } } string createdString = Localization.GetString("CreatedBy", Localization.GetResourceFile(this, MyFileName)); - lblCreatedBy.Text = string.Format(createdString, CreatedByUser, CreatedDate); + this.lblCreatedBy.Text = string.Format(createdString, this.CreatedByUser, this.CreatedDate); } private void ShowUpdatedString(bool isCreatorAndUpdater) { //check to see if audit contains update information - if (string.IsNullOrEmpty(LastModifiedDate)) + if (string.IsNullOrEmpty(this.LastModifiedDate)) { return; } - if (CheckDateColumnRegex.IsMatch(LastModifiedByUser)) + if (CheckDateColumnRegex.IsMatch(this.LastModifiedByUser)) { if (isCreatorAndUpdater) { - LastModifiedByUser = CreatedByUser; + this.LastModifiedByUser = this.CreatedByUser; } - else if (int.Parse(LastModifiedByUser) == Null.NullInteger) + else if (int.Parse(this.LastModifiedByUser) == Null.NullInteger) { - LastModifiedByUser = _systemUser; + this.LastModifiedByUser = this._systemUser; } else { //contains a UserID - UserInfo userInfo = UserController.GetUserById(PortalController.Instance.GetCurrentPortalSettings().PortalId, int.Parse(LastModifiedByUser)); + UserInfo userInfo = UserController.GetUserById(PortalController.Instance.GetCurrentPortalSettings().PortalId, int.Parse(this.LastModifiedByUser)); if (userInfo != null) { - LastModifiedByUser = userInfo.DisplayName; + this.LastModifiedByUser = userInfo.DisplayName; } } } string updatedByString = Localization.GetString("UpdatedBy", Localization.GetResourceFile(this, MyFileName)); - lblUpdatedBy.Text = string.Format(updatedByString, LastModifiedByUser, LastModifiedDate); + this.lblUpdatedBy.Text = string.Format(updatedByString, this.LastModifiedByUser, this.LastModifiedDate); } } } diff --git a/DNN Platform/Library/UI/UserControls/SectionHeadControl.cs b/DNN Platform/Library/UI/UserControls/SectionHeadControl.cs index 3aa55570d5f..e52a87c7c63 100644 --- a/DNN Platform/Library/UI/UserControls/SectionHeadControl.cs +++ b/DNN Platform/Library/UI/UserControls/SectionHeadControl.cs @@ -56,11 +56,11 @@ public string CssClass { get { - return lblTitle.CssClass; + return this.lblTitle.CssClass; } set { - lblTitle.CssClass = value; + this.lblTitle.CssClass = value; } } @@ -77,11 +77,11 @@ public bool IncludeRule { get { - return _includeRule; + return this._includeRule; } set { - _includeRule = value; + this._includeRule = value; } } @@ -98,12 +98,12 @@ public bool IsExpanded { get { - return DNNClientAPI.MinMaxContentVisibile(imgIcon, -1, !_isExpanded, DNNClientAPI.MinMaxPersistanceType.Page); + return DNNClientAPI.MinMaxContentVisibile(this.imgIcon, -1, !this._isExpanded, DNNClientAPI.MinMaxPersistanceType.Page); } set { - _isExpanded = value; - DNNClientAPI.MinMaxContentVisibile(imgIcon, -1, !_isExpanded, DNNClientAPI.MinMaxPersistanceType.Page, value); + this._isExpanded = value; + DNNClientAPI.MinMaxContentVisibile(this.imgIcon, -1, !this._isExpanded, DNNClientAPI.MinMaxPersistanceType.Page, value); } } @@ -119,11 +119,11 @@ public string JavaScript { get { - return _javaScript; + return this._javaScript; } set { - _javaScript = value; + this._javaScript = value; } } @@ -140,11 +140,11 @@ public string MaxImageUrl { get { - return _maxImageUrl; + return this._maxImageUrl; } set { - _maxImageUrl = value; + this._maxImageUrl = value; } } @@ -161,11 +161,11 @@ public string MinImageUrl { get { - return _minImageUrl; + return this._minImageUrl; } set { - _minImageUrl = value; + this._minImageUrl = value; } } @@ -203,11 +203,11 @@ public string Text { get { - return lblTitle.Text; + return this.lblTitle.Text; } set { - lblTitle.Text = value; + this.lblTitle.Text = value; } } @@ -230,9 +230,9 @@ protected override void OnLoad(EventArgs e) try { //set the resourcekey attribute to the label - if (!String.IsNullOrEmpty(ResourceKey)) + if (!String.IsNullOrEmpty(this.ResourceKey)) { - lblTitle.Attributes["resourcekey"] = ResourceKey; + this.lblTitle.Attributes["resourcekey"] = this.ResourceKey; } } catch (Exception exc) //Module failed to load @@ -255,16 +255,16 @@ protected override void OnPreRender(EventArgs e) try { - var ctl = (HtmlControl) Parent.FindControl(Section); + var ctl = (HtmlControl) this.Parent.FindControl(this.Section); if (ctl != null) { - lblTitle.Attributes.Add("onclick", imgIcon.ClientID + ".click();"); - lblTitle.Attributes.Add("style", "cursor: pointer"); - DNNClientAPI.EnableMinMax(imgIcon, ctl, !IsExpanded, Page.ResolveUrl(MinImageUrl), Page.ResolveUrl(MaxImageUrl), DNNClientAPI.MinMaxPersistanceType.Page); + this.lblTitle.Attributes.Add("onclick", this.imgIcon.ClientID + ".click();"); + this.lblTitle.Attributes.Add("style", "cursor: pointer"); + DNNClientAPI.EnableMinMax(this.imgIcon, ctl, !this.IsExpanded, this.Page.ResolveUrl(this.MinImageUrl), this.Page.ResolveUrl(this.MaxImageUrl), DNNClientAPI.MinMaxPersistanceType.Page); } //optionlly show hr - pnlRule.Visible = _includeRule; + this.pnlRule.Visible = this._includeRule; } catch (Exception exc) //Module failed to load { @@ -274,10 +274,10 @@ protected override void OnPreRender(EventArgs e) protected void imgIcon_Click(object sender, ImageClickEventArgs e) { - var ctl = (HtmlControl) Parent.FindControl(Section); + var ctl = (HtmlControl) this.Parent.FindControl(this.Section); if (ctl != null) { - IsExpanded = !IsExpanded; + this.IsExpanded = !this.IsExpanded; } } diff --git a/DNN Platform/Library/UI/UserControls/TextEditor.cs b/DNN Platform/Library/UI/UserControls/TextEditor.cs index fa4ec30c145..abb015e9047 100644 --- a/DNN Platform/Library/UI/UserControls/TextEditor.cs +++ b/DNN Platform/Library/UI/UserControls/TextEditor.cs @@ -51,9 +51,9 @@ public class TextEditor : UserControl public TextEditor() { - HtmlEncode = true; - ChooseRender = true; - ChooseMode = true; + this.HtmlEncode = true; + this.ChooseRender = true; + this.ChooseMode = true; } #endregion @@ -71,17 +71,17 @@ public string DefaultMode { get { - return ViewState["DefaultMode"] == null || String.IsNullOrEmpty(ViewState["DefaultMode"].ToString()) ? "RICH" : ViewState["DefaultMode"].ToString(); + return this.ViewState["DefaultMode"] == null || String.IsNullOrEmpty(this.ViewState["DefaultMode"].ToString()) ? "RICH" : this.ViewState["DefaultMode"].ToString(); } set { if (!value.Equals("BASIC", StringComparison.OrdinalIgnoreCase)) { - ViewState["DefaultMode"] = "RICH"; + this.ViewState["DefaultMode"] = "RICH"; } else { - ViewState["DefaultMode"] = "BASIC"; + this.ViewState["DefaultMode"] = "BASIC"; } } } @@ -112,19 +112,19 @@ public string Mode //If no Preference Check if Viewstate has been saved if (String.IsNullOrEmpty(strMode)) { - if (ViewState["DesktopMode"] != null && !String.IsNullOrEmpty(ViewState["DesktopMode"].ToString())) + if (this.ViewState["DesktopMode"] != null && !String.IsNullOrEmpty(this.ViewState["DesktopMode"].ToString())) { - strMode = Convert.ToString(ViewState["DesktopMode"]); + strMode = Convert.ToString(this.ViewState["DesktopMode"]); } } //Finally if still no value Use default if (String.IsNullOrEmpty(strMode)) { - strMode = DefaultMode; + strMode = this.DefaultMode; } - if (strMode == "RICH" && !IsRichEditorAvailable) + if (strMode == "RICH" && !this.IsRichEditorAvailable) { strMode = "BASIC"; } @@ -136,7 +136,7 @@ public string Mode if (!value.Equals("BASIC", StringComparison.OrdinalIgnoreCase)) { - ViewState["DesktopMode"] = "RICH"; + this.ViewState["DesktopMode"] = "RICH"; if (objUserInfo.UserID >= 0) { @@ -145,7 +145,7 @@ public string Mode } else { - ViewState["DesktopMode"] = "BASIC"; + this.ViewState["DesktopMode"] = "BASIC"; if (objUserInfo.UserID >= 0) { @@ -160,31 +160,31 @@ public string Text { get { - switch (OptView.SelectedItem.Value) + switch (this.OptView.SelectedItem.Value) { case "BASIC": - switch (OptRender.SelectedItem.Value) + switch (this.OptRender.SelectedItem.Value) { case "T": - return Encode(HtmlUtils.ConvertToHtml(RemoveBaseTags(TxtDesktopHTML.Text))); + return this.Encode(HtmlUtils.ConvertToHtml(RemoveBaseTags(this.TxtDesktopHTML.Text))); //break; case "R": - return RemoveBaseTags(TxtDesktopHTML.Text); + return RemoveBaseTags(this.TxtDesktopHTML.Text); //break; default: - return Encode(RemoveBaseTags(TxtDesktopHTML.Text)); + return this.Encode(RemoveBaseTags(this.TxtDesktopHTML.Text)); //break; } default: - return IsRichEditorAvailable ? Encode(RemoveBaseTags(_richTextEditor.Text)) : Encode(RemoveBaseTags(TxtDesktopHTML.Text)); + return this.IsRichEditorAvailable ? this.Encode(RemoveBaseTags(this._richTextEditor.Text)) : this.Encode(RemoveBaseTags(this.TxtDesktopHTML.Text)); } } set { - TxtDesktopHTML.Text = HtmlUtils.ConvertToText(Decode(value)); - if (IsRichEditorAvailable) + this.TxtDesktopHTML.Text = HtmlUtils.ConvertToText(this.Decode(value)); + if (this.IsRichEditorAvailable) { - _richTextEditor.Text = Decode(value); + this._richTextEditor.Text = this.Decode(value); } } } @@ -194,7 +194,7 @@ public string TextRenderMode { get { - return Convert.ToString(ViewState["textrender"]); + return Convert.ToString(this.ViewState["textrender"]); } set { @@ -203,7 +203,7 @@ public string TextRenderMode { strMode = "H"; } - ViewState["textrender"] = strMode; + this.ViewState["textrender"] = strMode; } } @@ -214,7 +214,7 @@ public bool IsRichEditorAvailable { get { - return _richTextEditor != null; + return this._richTextEditor != null; } } @@ -223,7 +223,7 @@ public HtmlEditorProvider RichText { get { - return _richTextEditor; + return this._richTextEditor; } } @@ -232,7 +232,7 @@ public TextBox BasicTextEditor { get { - return TxtDesktopHTML; + return this.TxtDesktopHTML; } } @@ -247,7 +247,7 @@ public string LocalResourceFile { get { - return TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + MyFileName; + return this.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + MyFileName; } } @@ -266,7 +266,7 @@ public string LocalResourceFile /// ----------------------------------------------------------------------------- private string Decode(string strHtml) { - return HtmlEncode ? Server.HtmlDecode(strHtml) : strHtml; + return this.HtmlEncode ? this.Server.HtmlDecode(strHtml) : strHtml; } /// ----------------------------------------------------------------------------- @@ -280,7 +280,7 @@ private string Decode(string strHtml) /// ----------------------------------------------------------------------------- private string Encode(string strHtml) { - return HtmlEncode ? Server.HtmlEncode(strHtml) : strHtml; + return this.HtmlEncode ? this.Server.HtmlEncode(strHtml) : strHtml; } /// ----------------------------------------------------------------------------- @@ -292,18 +292,18 @@ private string Encode(string strHtml) /// ----------------------------------------------------------------------------- private void PopulateLists() { - if (OptRender.Items.Count == 0) + if (this.OptRender.Items.Count == 0) { - OptRender.Items.Add(new ListItem(Localization.GetString("Text", Localization.GetResourceFile(this, MyFileName)), "T")); - OptRender.Items.Add(new ListItem(Localization.GetString("Html", Localization.GetResourceFile(this, MyFileName)), "H")); - OptRender.Items.Add(new ListItem(Localization.GetString("Raw", Localization.GetResourceFile(this, MyFileName)), "R")); + this.OptRender.Items.Add(new ListItem(Localization.GetString("Text", Localization.GetResourceFile(this, MyFileName)), "T")); + this.OptRender.Items.Add(new ListItem(Localization.GetString("Html", Localization.GetResourceFile(this, MyFileName)), "H")); + this.OptRender.Items.Add(new ListItem(Localization.GetString("Raw", Localization.GetResourceFile(this, MyFileName)), "R")); } - if (OptView.Items.Count == 0) + if (this.OptView.Items.Count == 0) { - OptView.Items.Add(new ListItem(Localization.GetString("BasicTextBox", Localization.GetResourceFile(this, MyFileName)), "BASIC")); - if (IsRichEditorAvailable) + this.OptView.Items.Add(new ListItem(Localization.GetString("BasicTextBox", Localization.GetResourceFile(this, MyFileName)), "BASIC")); + if (this.IsRichEditorAvailable) { - OptView.Items.Add(new ListItem(Localization.GetString("RichTextBox", Localization.GetResourceFile(this, MyFileName)), "RICH")); + this.OptView.Items.Add(new ListItem(Localization.GetString("RichTextBox", Localization.GetResourceFile(this, MyFileName)), "RICH")); } } } @@ -317,43 +317,43 @@ private void PopulateLists() /// ----------------------------------------------------------------------------- private void SetPanels() { - if (OptView.SelectedIndex != -1) + if (this.OptView.SelectedIndex != -1) { - Mode = OptView.SelectedItem.Value; + this.Mode = this.OptView.SelectedItem.Value; } - if (!String.IsNullOrEmpty(Mode)) + if (!String.IsNullOrEmpty(this.Mode)) { - OptView.Items.FindByValue(Mode).Selected = true; + this.OptView.Items.FindByValue(this.Mode).Selected = true; } else { - OptView.SelectedIndex = 0; + this.OptView.SelectedIndex = 0; } //Set the text render mode for basic mode - if (OptRender.SelectedIndex != -1) + if (this.OptRender.SelectedIndex != -1) { - TextRenderMode = OptRender.SelectedItem.Value; + this.TextRenderMode = this.OptRender.SelectedItem.Value; } - if (!String.IsNullOrEmpty(TextRenderMode)) + if (!String.IsNullOrEmpty(this.TextRenderMode)) { - OptRender.Items.FindByValue(TextRenderMode).Selected = true; + this.OptRender.Items.FindByValue(this.TextRenderMode).Selected = true; } else { - OptRender.SelectedIndex = 0; + this.OptRender.SelectedIndex = 0; } - if (OptView.SelectedItem.Value == "BASIC") + if (this.OptView.SelectedItem.Value == "BASIC") { - DivBasicTextBox.Visible = true; - DivRichTextBox.Visible = false; - PanelView.CssClass = "dnnTextPanelView dnnTextPanelView-basic"; + this.DivBasicTextBox.Visible = true; + this.DivRichTextBox.Visible = false; + this.PanelView.CssClass = "dnnTextPanelView dnnTextPanelView-basic"; } else { - DivBasicTextBox.Visible = false; - DivRichTextBox.Visible = true; - PanelView.CssClass = "dnnTextPanelView"; + this.DivBasicTextBox.Visible = false; + this.DivRichTextBox.Visible = true; + this.PanelView.CssClass = "dnnTextPanelView"; } } @@ -367,13 +367,13 @@ private static string RemoveBaseTags(String strInput) public void ChangeMode(string mode) { - OptView.SelectedItem.Value = mode; - OptViewSelectedIndexChanged(OptView, EventArgs.Empty); + this.OptView.SelectedItem.Value = mode; + this.OptViewSelectedIndexChanged(this.OptView, EventArgs.Empty); } public void ChangeTextRenderMode(string textRenderMode) { - OptRender.SelectedItem.Value = textRenderMode; - OptRenderSelectedIndexChanged(OptRender, EventArgs.Empty); + this.OptRender.SelectedItem.Value = textRenderMode; + this.OptRenderSelectedIndexChanged(this.OptRender, EventArgs.Empty); } #endregion @@ -384,12 +384,12 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - _richTextEditor = HtmlEditorProvider.Instance(); + this._richTextEditor = HtmlEditorProvider.Instance(); - if (IsRichEditorAvailable) + if (this.IsRichEditorAvailable) { - _richTextEditor.ControlID = ID; - _richTextEditor.Initialize(); + this._richTextEditor.ControlID = this.ID; + this._richTextEditor.Initialize(); } } @@ -404,46 +404,46 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - OptRender.SelectedIndexChanged += OptRenderSelectedIndexChanged; - OptView.SelectedIndexChanged += OptViewSelectedIndexChanged; + this.OptRender.SelectedIndexChanged += this.OptRenderSelectedIndexChanged; + this.OptView.SelectedIndexChanged += this.OptViewSelectedIndexChanged; try { //Populate Radio Button Lists - PopulateLists(); + this.PopulateLists(); //Get the current user //UserInfo objUserInfo = UserController.Instance.GetCurrentUserInfo(); //Set the width and height of the controls - if (IsRichEditorAvailable) + if (this.IsRichEditorAvailable) { - _richTextEditor.Width = Width; - _richTextEditor.Height = Height; + this._richTextEditor.Width = this.Width; + this._richTextEditor.Height = this.Height; } - TxtDesktopHTML.Height = Height; - TxtDesktopHTML.Width = Width; - PanelView.Width = Width; - PanelTextEditor.Width = Width; + this.TxtDesktopHTML.Height = this.Height; + this.TxtDesktopHTML.Width = this.Width; + this.PanelView.Width = this.Width; + this.PanelTextEditor.Width = this.Width; //Optionally display the radio button lists - if (!ChooseMode) + if (!this.ChooseMode) { - PanelView.Visible = false; + this.PanelView.Visible = false; } - if (!ChooseRender) + if (!this.ChooseRender) { - DivBasicRender.Visible = false; + this.DivBasicRender.Visible = false; } //Load the editor - if (IsRichEditorAvailable) + if (this.IsRichEditorAvailable) { - PlcEditor.Controls.Add(_richTextEditor.HtmlEditorControl); + this.PlcEditor.Controls.Add(this._richTextEditor.HtmlEditorControl); } - SetPanels(); + this.SetPanels(); } catch (Exception exc) //Module failed to load { @@ -460,15 +460,15 @@ protected override void OnLoad(EventArgs e) /// ----------------------------------------------------------------------------- protected void OptRenderSelectedIndexChanged(Object sender, EventArgs e) { - if (OptRender.SelectedIndex != -1) + if (this.OptRender.SelectedIndex != -1) { - TextRenderMode = OptRender.SelectedItem.Value; + this.TextRenderMode = this.OptRender.SelectedItem.Value; } - if (Mode == "BASIC") + if (this.Mode == "BASIC") { - TxtDesktopHTML.Text = TextRenderMode == "H" ? HtmlUtils.ConvertToHtml(TxtDesktopHTML.Text) : HtmlUtils.ConvertToText(TxtDesktopHTML.Text); + this.TxtDesktopHTML.Text = this.TextRenderMode == "H" ? HtmlUtils.ConvertToHtml(this.TxtDesktopHTML.Text) : HtmlUtils.ConvertToText(this.TxtDesktopHTML.Text); } - SetPanels(); + this.SetPanels(); } /// ----------------------------------------------------------------------------- @@ -480,35 +480,35 @@ protected void OptRenderSelectedIndexChanged(Object sender, EventArgs e) /// ----------------------------------------------------------------------------- protected void OptViewSelectedIndexChanged(Object sender, EventArgs e) { - if (OptView.SelectedIndex != -1) + if (this.OptView.SelectedIndex != -1) { - Mode = OptView.SelectedItem.Value; + this.Mode = this.OptView.SelectedItem.Value; } - if (Mode == "BASIC") + if (this.Mode == "BASIC") { - switch (TextRenderMode) + switch (this.TextRenderMode) { case "T": - TxtDesktopHTML.Text = HtmlUtils.ConvertToText(_richTextEditor.Text); + this.TxtDesktopHTML.Text = HtmlUtils.ConvertToText(this._richTextEditor.Text); break; default: - TxtDesktopHTML.Text = _richTextEditor.Text; + this.TxtDesktopHTML.Text = this._richTextEditor.Text; break; } } else { - switch (TextRenderMode) + switch (this.TextRenderMode) { case "T": - _richTextEditor.Text = HtmlUtils.ConvertToHtml(TxtDesktopHTML.Text); + this._richTextEditor.Text = HtmlUtils.ConvertToHtml(this.TxtDesktopHTML.Text); break; default: - _richTextEditor.Text = TxtDesktopHTML.Text; + this._richTextEditor.Text = this.TxtDesktopHTML.Text; break; } } - SetPanels(); + this.SetPanels(); } #endregion diff --git a/DNN Platform/Library/UI/UserControls/URLControl.cs b/DNN Platform/Library/UI/UserControls/URLControl.cs index 95ae0904a99..6edab05912b 100644 --- a/DNN Platform/Library/UI/UserControls/URLControl.cs +++ b/DNN Platform/Library/UI/UserControls/URLControl.cs @@ -86,9 +86,9 @@ public string FileFilter { get { - if (ViewState["FileFilter"] != null) + if (this.ViewState["FileFilter"] != null) { - return Convert.ToString(ViewState["FileFilter"]); + return Convert.ToString(this.ViewState["FileFilter"]); } else { @@ -97,10 +97,10 @@ public string FileFilter } set { - ViewState["FileFilter"] = value; - if (IsTrackingViewState) + this.ViewState["FileFilter"] = value; + if (this.IsTrackingViewState) { - _doReloadFiles = true; + this._doReloadFiles = true; } } } @@ -109,9 +109,9 @@ public bool IncludeActiveTab { get { - if (ViewState["IncludeActiveTab"] != null) + if (this.ViewState["IncludeActiveTab"] != null) { - return Convert.ToBoolean(ViewState["IncludeActiveTab"]); + return Convert.ToBoolean(this.ViewState["IncludeActiveTab"]); } else { @@ -120,10 +120,10 @@ public bool IncludeActiveTab } set { - ViewState["IncludeActiveTab"] = value; - if (IsTrackingViewState) + this.ViewState["IncludeActiveTab"] = value; + if (this.IsTrackingViewState) { - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } } } @@ -133,19 +133,19 @@ public string LocalResourceFile get { string fileRoot; - if (String.IsNullOrEmpty(_localResourceFile)) + if (String.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/URLControl.ascx"; + fileRoot = this.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/URLControl.ascx"; } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -153,9 +153,9 @@ public bool Log { get { - if (chkLog.Visible) + if (this.chkLog.Visible) { - return chkLog.Checked; + return this.chkLog.Checked; } else { @@ -169,19 +169,19 @@ public int ModuleID get { int myMid = -2; - if (ViewState["ModuleId"] != null) + if (this.ViewState["ModuleId"] != null) { - myMid = Convert.ToInt32(ViewState["ModuleId"]); + myMid = Convert.ToInt32(this.ViewState["ModuleId"]); } - else if (Request.QueryString["mid"] != null) + else if (this.Request.QueryString["mid"] != null) { - Int32.TryParse(Request.QueryString["mid"], out myMid); + Int32.TryParse(this.Request.QueryString["mid"], out myMid); } return myMid; } set { - ViewState["ModuleId"] = value; + this.ViewState["ModuleId"] = value; } } @@ -189,11 +189,11 @@ public bool NewWindow { get { - return chkNewWindow.Visible && chkNewWindow.Checked; + return this.chkNewWindow.Visible && this.chkNewWindow.Checked; } set { - chkNewWindow.Checked = chkNewWindow.Visible && value; + this.chkNewWindow.Checked = this.chkNewWindow.Visible && value; } } @@ -201,9 +201,9 @@ public bool Required { get { - if (ViewState["Required"] != null) + if (this.ViewState["Required"] != null) { - return Convert.ToBoolean(ViewState["Required"]); + return Convert.ToBoolean(this.ViewState["Required"]); } else { @@ -212,10 +212,10 @@ public bool Required } set { - ViewState["Required"] = value; - if (IsTrackingViewState) + this.ViewState["Required"] = value; + if (this.IsTrackingViewState) { - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } } } @@ -224,9 +224,9 @@ public bool ShowFiles { get { - if (ViewState["ShowFiles"] != null) + if (this.ViewState["ShowFiles"] != null) { - return Convert.ToBoolean(ViewState["ShowFiles"]); + return Convert.ToBoolean(this.ViewState["ShowFiles"]); } else { @@ -235,10 +235,10 @@ public bool ShowFiles } set { - ViewState["ShowFiles"] = value; - if (IsTrackingViewState) + this.ViewState["ShowFiles"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -247,9 +247,9 @@ public bool ShowImages { get { - if (ViewState["ShowImages"] != null) + if (this.ViewState["ShowImages"] != null) { - return Convert.ToBoolean(ViewState["ShowImages"]); + return Convert.ToBoolean(this.ViewState["ShowImages"]); } else { @@ -258,10 +258,10 @@ public bool ShowImages } set { - ViewState["ShowImages"] = value; - if (IsTrackingViewState) + this.ViewState["ShowImages"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -270,11 +270,11 @@ public bool ShowLog { get { - return chkLog.Visible; + return this.chkLog.Visible; } set { - chkLog.Visible = value; + this.chkLog.Visible = value; } } @@ -282,11 +282,11 @@ public bool ShowNewWindow { get { - return chkNewWindow.Visible; + return this.chkNewWindow.Visible; } set { - chkNewWindow.Visible = value; + this.chkNewWindow.Visible = value; } } @@ -294,9 +294,9 @@ public bool ShowNone { get { - if (ViewState["ShowNone"] != null) + if (this.ViewState["ShowNone"] != null) { - return Convert.ToBoolean(ViewState["ShowNone"]); + return Convert.ToBoolean(this.ViewState["ShowNone"]); } else { @@ -305,10 +305,10 @@ public bool ShowNone } set { - ViewState["ShowNone"] = value; - if (IsTrackingViewState) + this.ViewState["ShowNone"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -317,9 +317,9 @@ public bool ShowTabs { get { - if (ViewState["ShowTabs"] != null) + if (this.ViewState["ShowTabs"] != null) { - return Convert.ToBoolean(ViewState["ShowTabs"]); + return Convert.ToBoolean(this.ViewState["ShowTabs"]); } else { @@ -328,10 +328,10 @@ public bool ShowTabs } set { - ViewState["ShowTabs"] = value; - if (IsTrackingViewState) + this.ViewState["ShowTabs"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -340,11 +340,11 @@ public bool ShowTrack { get { - return chkTrack.Visible; + return this.chkTrack.Visible; } set { - chkTrack.Visible = value; + this.chkTrack.Visible = value; } } @@ -352,9 +352,9 @@ public bool ShowUpLoad { get { - if (ViewState["ShowUpLoad"] != null) + if (this.ViewState["ShowUpLoad"] != null) { - return Convert.ToBoolean(ViewState["ShowUpLoad"]); + return Convert.ToBoolean(this.ViewState["ShowUpLoad"]); } else { @@ -363,10 +363,10 @@ public bool ShowUpLoad } set { - ViewState["ShowUpLoad"] = value; - if (IsTrackingViewState) + this.ViewState["ShowUpLoad"] = value; + if (this.IsTrackingViewState) { - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } } } @@ -375,9 +375,9 @@ public bool ShowUrls { get { - if (ViewState["ShowUrls"] != null) + if (this.ViewState["ShowUrls"] != null) { - return Convert.ToBoolean(ViewState["ShowUrls"]); + return Convert.ToBoolean(this.ViewState["ShowUrls"]); } else { @@ -386,10 +386,10 @@ public bool ShowUrls } set { - ViewState["ShowUrls"] = value; - if (IsTrackingViewState) + this.ViewState["ShowUrls"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -398,9 +398,9 @@ public bool ShowUsers { get { - if (ViewState["ShowUsers"] != null) + if (this.ViewState["ShowUsers"] != null) { - return Convert.ToBoolean(ViewState["ShowUsers"]); + return Convert.ToBoolean(this.ViewState["ShowUsers"]); } else { @@ -409,10 +409,10 @@ public bool ShowUsers } set { - ViewState["ShowUsers"] = value; - if (IsTrackingViewState) + this.ViewState["ShowUsers"] = value; + if (this.IsTrackingViewState) { - _doRenderTypes = true; + this._doRenderTypes = true; } } } @@ -421,9 +421,9 @@ public bool Track { get { - if (chkTrack.Visible) + if (this.chkTrack.Visible) { - return chkTrack.Checked; + return this.chkTrack.Checked; } else { @@ -438,30 +438,30 @@ public string Url { string r = ""; string strCurrentType = ""; - if (optType.Items.Count > 0 && optType.SelectedIndex >= 0) + if (this.optType.Items.Count > 0 && this.optType.SelectedIndex >= 0) { - strCurrentType = optType.SelectedItem.Value; + strCurrentType = this.optType.SelectedItem.Value; } switch (strCurrentType) { case "I": - if (cboImages.SelectedItem != null) + if (this.cboImages.SelectedItem != null) { - r = cboImages.SelectedItem.Value; + r = this.cboImages.SelectedItem.Value; } break; case "U": - if (cboUrls.Visible) + if (this.cboUrls.Visible) { - if (cboUrls.SelectedItem != null) + if (this.cboUrls.SelectedItem != null) { - r = cboUrls.SelectedItem.Value; - txtUrl.Text = r; + r = this.cboUrls.SelectedItem.Value; + this.txtUrl.Text = r; } } else { - string mCustomUrl = txtUrl.Text; + string mCustomUrl = this.txtUrl.Text; if (mCustomUrl.Equals("http://", StringComparison.InvariantCultureIgnoreCase)) { r = ""; @@ -474,9 +474,9 @@ public string Url break; case "T": string strTab = ""; - if (cboTabs.SelectedItem != null) + if (this.cboTabs.SelectedItem != null) { - strTab = cboTabs.SelectedItem.Value; + strTab = this.cboTabs.SelectedItem.Value; if (Globals.NumberMatchRegex.IsMatch(strTab) && (Convert.ToInt32(strTab) >= 0)) { r = strTab; @@ -484,11 +484,11 @@ public string Url } break; case "F": - if (cboFiles.SelectedItem != null) + if (this.cboFiles.SelectedItem != null) { - if (!String.IsNullOrEmpty(cboFiles.SelectedItem.Value)) + if (!String.IsNullOrEmpty(this.cboFiles.SelectedItem.Value)) { - r = "FileID=" + cboFiles.SelectedItem.Value; + r = "FileID=" + this.cboFiles.SelectedItem.Value; } else { @@ -497,18 +497,18 @@ public string Url } break; case "M": - if (!String.IsNullOrEmpty(txtUser.Text)) + if (!String.IsNullOrEmpty(this.txtUser.Text)) { - UserInfo objUser = UserController.GetCachedUser(_objPortal.PortalID, txtUser.Text); + UserInfo objUser = UserController.GetCachedUser(this._objPortal.PortalID, this.txtUser.Text); if (objUser != null) { r = "UserID=" + objUser.UserID; } else { - lblMessage.Text = Localization.GetString("NoUser", LocalResourceFile); - ErrorRow.Visible = true; - txtUser.Text = ""; + this.lblMessage.Text = Localization.GetString("NoUser", this.LocalResourceFile); + this.ErrorRow.Visible = true; + this.txtUser.Text = ""; } } break; @@ -517,13 +517,13 @@ public string Url } set { - ViewState["Url"] = value; - txtUrl.Text = string.Empty; + this.ViewState["Url"] = value; + this.txtUrl.Text = string.Empty; - if (IsTrackingViewState) + if (this.IsTrackingViewState) { - _doChangeURL = true; - _doReloadFiles = true; + this._doChangeURL = true; + this._doReloadFiles = true; } } } @@ -532,16 +532,16 @@ public string UrlType { get { - return Convert.ToString(ViewState["UrlType"]); + return Convert.ToString(this.ViewState["UrlType"]); } set { if (value != null && !String.IsNullOrEmpty(value.Trim())) { - ViewState["UrlType"] = value; - if (IsTrackingViewState) + this.ViewState["UrlType"] = value; + if (this.IsTrackingViewState) { - _doChangeURL = true; + this._doChangeURL = true; } } } @@ -551,20 +551,20 @@ public string Width { get { - return Convert.ToString(ViewState["SkinControlWidth"]); + return Convert.ToString(this.ViewState["SkinControlWidth"]); } set { if (!String.IsNullOrEmpty(value)) { - cboUrls.Width = Unit.Parse(value); - txtUrl.Width = Unit.Parse(value); - cboImages.Width = Unit.Parse(value); - cboTabs.Width = Unit.Parse(value); - cboFolders.Width = Unit.Parse(value); - cboFiles.Width = Unit.Parse(value); - txtUser.Width = Unit.Parse(value); - ViewState["SkinControlWidth"] = value; + this.cboUrls.Width = Unit.Parse(value); + this.txtUrl.Width = Unit.Parse(value); + this.cboImages.Width = Unit.Parse(value); + this.cboTabs.Width = Unit.Parse(value); + this.cboFolders.Width = Unit.Parse(value); + this.cboFiles.Width = Unit.Parse(value); + this.txtUser.Width = Unit.Parse(value); + this.ViewState["SkinControlWidth"] = value; } } } @@ -577,21 +577,21 @@ private ArrayList GetFileList(bool NoneSpecified) { int PortalId = Null.NullInteger; - if ((!IsHostMenu) || (Request.QueryString["pid"] != null)) + if ((!this.IsHostMenu) || (this.Request.QueryString["pid"] != null)) { - PortalId = _objPortal.PortalID; + PortalId = this._objPortal.PortalID; } - return Globals.GetFileList(PortalId, FileFilter, NoneSpecified, cboFolders.SelectedItem.Value, false); + return Globals.GetFileList(PortalId, this.FileFilter, NoneSpecified, this.cboFolders.SelectedItem.Value, false); } private void LoadFolders(string Permissions) { int PortalId = Null.NullInteger; - cboFolders.Items.Clear(); + this.cboFolders.Items.Clear(); - if ((!IsHostMenu) || (Request.QueryString["pid"] != null)) + if ((!this.IsHostMenu) || (this.Request.QueryString["pid"] != null)) { - PortalId = _objPortal.PortalID; + PortalId = this._objPortal.PortalID; } var folders = FolderManager.Instance.GetFolders(UserController.Instance.GetCurrentUserInfo(), Permissions); foreach (FolderInfo folder in folders) @@ -599,65 +599,65 @@ private void LoadFolders(string Permissions) var FolderItem = new ListItem(); if (folder.FolderPath == Null.NullString) { - FolderItem.Text = Localization.GetString("Root", LocalResourceFile); + FolderItem.Text = Localization.GetString("Root", this.LocalResourceFile); } else { FolderItem.Text = folder.DisplayPath; } FolderItem.Value = folder.FolderPath; - cboFolders.Items.Add(FolderItem); + this.cboFolders.Items.Add(FolderItem); } } private void LoadUrls() { var objUrls = new UrlController(); - cboUrls.Items.Clear(); - cboUrls.DataSource = objUrls.GetUrls(_objPortal.PortalID); - cboUrls.DataBind(); + this.cboUrls.Items.Clear(); + this.cboUrls.DataSource = objUrls.GetUrls(this._objPortal.PortalID); + this.cboUrls.DataBind(); } private void SetStorageLocationType() { - string FolderName = cboFolders.SelectedValue; + string FolderName = this.cboFolders.SelectedValue; //Check to see if this is the 'Root' folder, if so we cannot rely on its text value because it is something and not an empty string that we need to lookup the 'root' folder - if (cboFolders.SelectedValue == string.Empty) + if (this.cboFolders.SelectedValue == string.Empty) { FolderName = ""; } - var objFolderInfo = FolderManager.Instance.GetFolder(PortalSettings.PortalId, FolderName); + var objFolderInfo = FolderManager.Instance.GetFolder(this.PortalSettings.PortalId, FolderName); if (objFolderInfo != null) { var folderMapping = FolderMappingController.Instance.GetFolderMapping(objFolderInfo.PortalID, objFolderInfo.FolderMappingID); if (folderMapping.MappingName == "Standard") { - imgStorageLocationType.Visible = false; + this.imgStorageLocationType.Visible = false; } else { - imgStorageLocationType.Visible = true; - imgStorageLocationType.ImageUrl = FolderProvider.Instance(folderMapping.FolderProviderType).GetFolderProviderIconPath(); + this.imgStorageLocationType.Visible = true; + this.imgStorageLocationType.ImageUrl = FolderProvider.Instance(folderMapping.FolderProviderType).GetFolderProviderIconPath(); } } } private void DoChangeURL() { - string _Url = Convert.ToString(ViewState["Url"]); - string _Urltype = Convert.ToString(ViewState["UrlType"]); + string _Url = Convert.ToString(this.ViewState["Url"]); + string _Urltype = Convert.ToString(this.ViewState["UrlType"]); if (!String.IsNullOrEmpty(_Url)) { var objUrls = new UrlController(); string TrackingUrl = _Url; _Urltype = Globals.GetURLType(_Url).ToString("g").Substring(0, 1); - if (_Urltype == "U" && (_Url.StartsWith("~/" + PortalSettings.DefaultIconLocation, StringComparison.InvariantCultureIgnoreCase))) + if (_Urltype == "U" && (_Url.StartsWith("~/" + this.PortalSettings.DefaultIconLocation, StringComparison.InvariantCultureIgnoreCase))) { _Urltype = "I"; } - ViewState["UrlType"] = _Urltype; + this.ViewState["UrlType"] = _Urltype; if (_Urltype == "F") { if (_Url.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase)) @@ -674,7 +674,7 @@ private void DoChangeURL() //to handle legacy scenarios before the introduction of the FileServerHandler var fileName = Path.GetFileName(_Url); var folderPath = _Url.Substring(0, _Url.LastIndexOf(fileName)); - var folder = FolderManager.Instance.GetFolder(_objPortal.PortalID, folderPath); + var folder = FolderManager.Instance.GetFolder(this._objPortal.PortalID, folderPath); var fileId = -1; if (folder != null) { @@ -691,241 +691,241 @@ private void DoChangeURL() { if (_Url.StartsWith("userid=", StringComparison.InvariantCultureIgnoreCase)) { - UserInfo objUser = UserController.GetUserById(_objPortal.PortalID, int.Parse(_Url.Substring(7))); + UserInfo objUser = UserController.GetUserById(this._objPortal.PortalID, int.Parse(_Url.Substring(7))); if (objUser != null) { _Url = objUser.Username; } } } - UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(_objPortal.PortalID, TrackingUrl, ModuleID); + UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(this._objPortal.PortalID, TrackingUrl, this.ModuleID); if (objUrlTracking != null) { - chkNewWindow.Checked = objUrlTracking.NewWindow; - chkTrack.Checked = objUrlTracking.TrackClicks; - chkLog.Checked = objUrlTracking.LogActivity; + this.chkNewWindow.Checked = objUrlTracking.NewWindow; + this.chkTrack.Checked = objUrlTracking.TrackClicks; + this.chkLog.Checked = objUrlTracking.LogActivity; } else //the url does not exist in the tracking table { - chkTrack.Checked = false; - chkLog.Checked = false; + this.chkTrack.Checked = false; + this.chkLog.Checked = false; } - ViewState["Url"] = _Url; + this.ViewState["Url"] = _Url; } else { if (!String.IsNullOrEmpty(_Urltype)) { - optType.ClearSelection(); - if (optType.Items.FindByValue(_Urltype) != null) + this.optType.ClearSelection(); + if (this.optType.Items.FindByValue(_Urltype) != null) { - optType.Items.FindByValue(_Urltype).Selected = true; + this.optType.Items.FindByValue(_Urltype).Selected = true; } else { - optType.Items[0].Selected = true; + this.optType.Items[0].Selected = true; } } else { - if (optType.Items.Count > 0) + if (this.optType.Items.Count > 0) { - optType.ClearSelection(); - optType.Items[0].Selected = true; + this.optType.ClearSelection(); + this.optType.Items[0].Selected = true; } } - chkNewWindow.Checked = false; //Need check - chkTrack.Checked = false; //Need check - chkLog.Checked = false; //Need check + this.chkNewWindow.Checked = false; //Need check + this.chkTrack.Checked = false; //Need check + this.chkLog.Checked = false; //Need check } //Url type changed, then we must draw the controlos for that type - _doRenderTypeControls = true; + this._doRenderTypeControls = true; } private void DoRenderTypes() { //We must clear the list to keep the same item order string strCurrent = ""; - if (optType.SelectedIndex >= 0) + if (this.optType.SelectedIndex >= 0) { - strCurrent = optType.SelectedItem.Value; //Save current selected value + strCurrent = this.optType.SelectedItem.Value; //Save current selected value } - optType.Items.Clear(); - if (ShowNone) + this.optType.Items.Clear(); + if (this.ShowNone) { - if (optType.Items.FindByValue("N") == null) + if (this.optType.Items.FindByValue("N") == null) { - optType.Items.Add(new ListItem(Localization.GetString("NoneType", LocalResourceFile), "N")); + this.optType.Items.Add(new ListItem(Localization.GetString("NoneType", this.LocalResourceFile), "N")); } } else { - if (optType.Items.FindByValue("N") != null) + if (this.optType.Items.FindByValue("N") != null) { - optType.Items.Remove(optType.Items.FindByValue("N")); + this.optType.Items.Remove(this.optType.Items.FindByValue("N")); } } - if (ShowUrls) + if (this.ShowUrls) { - if (optType.Items.FindByValue("U") == null) + if (this.optType.Items.FindByValue("U") == null) { - optType.Items.Add(new ListItem(Localization.GetString("URLType", LocalResourceFile), "U")); + this.optType.Items.Add(new ListItem(Localization.GetString("URLType", this.LocalResourceFile), "U")); } } else { - if (optType.Items.FindByValue("U") != null) + if (this.optType.Items.FindByValue("U") != null) { - optType.Items.Remove(optType.Items.FindByValue("U")); + this.optType.Items.Remove(this.optType.Items.FindByValue("U")); } } - if (ShowTabs) + if (this.ShowTabs) { - if (optType.Items.FindByValue("T") == null) + if (this.optType.Items.FindByValue("T") == null) { - optType.Items.Add(new ListItem(Localization.GetString("TabType", LocalResourceFile), "T")); + this.optType.Items.Add(new ListItem(Localization.GetString("TabType", this.LocalResourceFile), "T")); } } else { - if (optType.Items.FindByValue("T") != null) + if (this.optType.Items.FindByValue("T") != null) { - optType.Items.Remove(optType.Items.FindByValue("T")); + this.optType.Items.Remove(this.optType.Items.FindByValue("T")); } } - if (ShowFiles) + if (this.ShowFiles) { - if (optType.Items.FindByValue("F") == null) + if (this.optType.Items.FindByValue("F") == null) { - optType.Items.Add(new ListItem(Localization.GetString("FileType", LocalResourceFile), "F")); + this.optType.Items.Add(new ListItem(Localization.GetString("FileType", this.LocalResourceFile), "F")); } } else { - if (optType.Items.FindByValue("F") != null) + if (this.optType.Items.FindByValue("F") != null) { - optType.Items.Remove(optType.Items.FindByValue("F")); + this.optType.Items.Remove(this.optType.Items.FindByValue("F")); } } - if (ShowImages) + if (this.ShowImages) { - if (optType.Items.FindByValue("I") == null) + if (this.optType.Items.FindByValue("I") == null) { - optType.Items.Add(new ListItem(Localization.GetString("ImageType", LocalResourceFile), "I")); + this.optType.Items.Add(new ListItem(Localization.GetString("ImageType", this.LocalResourceFile), "I")); } } else { - if (optType.Items.FindByValue("I") != null) + if (this.optType.Items.FindByValue("I") != null) { - optType.Items.Remove(optType.Items.FindByValue("I")); + this.optType.Items.Remove(this.optType.Items.FindByValue("I")); } } - if (ShowUsers) + if (this.ShowUsers) { - if (optType.Items.FindByValue("M") == null) + if (this.optType.Items.FindByValue("M") == null) { - optType.Items.Add(new ListItem(Localization.GetString("UserType", LocalResourceFile), "M")); + this.optType.Items.Add(new ListItem(Localization.GetString("UserType", this.LocalResourceFile), "M")); } } else { - if (optType.Items.FindByValue("M") != null) + if (this.optType.Items.FindByValue("M") != null) { - optType.Items.Remove(optType.Items.FindByValue("M")); + this.optType.Items.Remove(this.optType.Items.FindByValue("M")); } } - if (optType.Items.Count > 0) + if (this.optType.Items.Count > 0) { if (!String.IsNullOrEmpty(strCurrent)) { - if (optType.Items.FindByValue(strCurrent) != null) + if (this.optType.Items.FindByValue(strCurrent) != null) { - optType.Items.FindByValue(strCurrent).Selected = true; + this.optType.Items.FindByValue(strCurrent).Selected = true; } else { - optType.Items[0].Selected = true; - _doRenderTypeControls = true; //Type changed, re-draw + this.optType.Items[0].Selected = true; + this._doRenderTypeControls = true; //Type changed, re-draw } } else { - optType.Items[0].Selected = true; - _doRenderTypeControls = true; //Type changed, re-draw + this.optType.Items[0].Selected = true; + this._doRenderTypeControls = true; //Type changed, re-draw } - TypeRow.Visible = optType.Items.Count > 1; + this.TypeRow.Visible = this.optType.Items.Count > 1; } else { - TypeRow.Visible = false; + this.TypeRow.Visible = false; } } private void DoCorrectRadioButtonList() { - string _Urltype = Convert.ToString(ViewState["UrlType"]); + string _Urltype = Convert.ToString(this.ViewState["UrlType"]); - if (optType.Items.Count > 0) + if (this.optType.Items.Count > 0) { - optType.ClearSelection(); + this.optType.ClearSelection(); if (!String.IsNullOrEmpty(_Urltype)) { - if (optType.Items.FindByValue(_Urltype) != null) + if (this.optType.Items.FindByValue(_Urltype) != null) { - optType.Items.FindByValue(_Urltype).Selected = true; + this.optType.Items.FindByValue(_Urltype).Selected = true; } else { - optType.Items[0].Selected = true; - _Urltype = optType.Items[0].Value; - ViewState["UrlType"] = _Urltype; + this.optType.Items[0].Selected = true; + _Urltype = this.optType.Items[0].Value; + this.ViewState["UrlType"] = _Urltype; } } else { - optType.Items[0].Selected = true; - _Urltype = optType.Items[0].Value; - ViewState["UrlType"] = _Urltype; + this.optType.Items[0].Selected = true; + _Urltype = this.optType.Items[0].Value; + this.ViewState["UrlType"] = _Urltype; } } } private void DoRenderTypeControls() { - string _Url = Convert.ToString(ViewState["Url"]); - string _Urltype = Convert.ToString(ViewState["UrlType"]); + string _Url = Convert.ToString(this.ViewState["Url"]); + string _Urltype = Convert.ToString(this.ViewState["UrlType"]); var objUrls = new UrlController(); if (!String.IsNullOrEmpty(_Urltype)) { //load listitems - switch (optType.SelectedItem.Value) + switch (this.optType.SelectedItem.Value) { case "N": //None - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = false; + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; break; case "I": //System Image - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = true; + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = true; - cboImages.Items.Clear(); + this.cboImages.Items.Clear(); - string strImagesFolder = Path.Combine(Globals.ApplicationMapPath, PortalSettings.DefaultIconLocation.Replace('/', '\\')); + string strImagesFolder = Path.Combine(Globals.ApplicationMapPath, this.PortalSettings.DefaultIconLocation.Replace('/', '\\')); foreach (string strImage in Directory.GetFiles(strImagesFolder)) { string img = strImage.Replace(strImagesFolder, "").Trim('/').Trim('\\'); - cboImages.Items.Add(new ListItem(img, string.Format("~/{0}/{1}", PortalSettings.DefaultIconLocation, img).ToLowerInvariant())); + this.cboImages.Items.Add(new ListItem(img, string.Format("~/{0}/{1}", this.PortalSettings.DefaultIconLocation, img).ToLowerInvariant())); } - ListItem selecteItem = cboImages.Items.FindByValue(_Url.ToLowerInvariant()); + ListItem selecteItem = this.cboImages.Items.FindByValue(_Url.ToLowerInvariant()); if (selecteItem != null) { selecteItem.Selected = true; @@ -933,66 +933,66 @@ private void DoRenderTypeControls() break; case "U": //Url - URLRow.Visible = true; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = false; - if (String.IsNullOrEmpty(txtUrl.Text)) + this.URLRow.Visible = true; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; + if (String.IsNullOrEmpty(this.txtUrl.Text)) { - txtUrl.Text = _Url; + this.txtUrl.Text = _Url; } - if (String.IsNullOrEmpty(txtUrl.Text)) + if (String.IsNullOrEmpty(this.txtUrl.Text)) { - txtUrl.Text = "http://"; + this.txtUrl.Text = "http://"; } - txtUrl.Visible = true; + this.txtUrl.Visible = true; - cmdSelect.Visible = true; + this.cmdSelect.Visible = true; - cboUrls.Visible = false; - cmdAdd.Visible = false; - cmdDelete.Visible = false; + this.cboUrls.Visible = false; + this.cmdAdd.Visible = false; + this.cmdDelete.Visible = false; break; case "T": //tab - URLRow.Visible = false; - TabRow.Visible = true; - FileRow.Visible = false; - UserRow.Visible = false; - ImagesRow.Visible = false; + this.URLRow.Visible = false; + this.TabRow.Visible = true; + this.FileRow.Visible = false; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; - cboTabs.Items.Clear(); + this.cboTabs.Items.Clear(); PortalSettings _settings = PortalController.Instance.GetCurrentPortalSettings(); - cboTabs.DataSource = TabController.GetPortalTabs(_settings.PortalId, Null.NullInteger, !Required, "none available", true, false, false, true, false); - cboTabs.DataBind(); - if (cboTabs.Items.FindByValue(_Url) != null) + this.cboTabs.DataSource = TabController.GetPortalTabs(_settings.PortalId, Null.NullInteger, !this.Required, "none available", true, false, false, true, false); + this.cboTabs.DataBind(); + if (this.cboTabs.Items.FindByValue(_Url) != null) { - cboTabs.Items.FindByValue(_Url).Selected = true; + this.cboTabs.Items.FindByValue(_Url).Selected = true; } - if (!IncludeActiveTab && cboTabs.Items.FindByValue(_settings.ActiveTab.TabID.ToString()) != null) + if (!this.IncludeActiveTab && this.cboTabs.Items.FindByValue(_settings.ActiveTab.TabID.ToString()) != null) { - cboTabs.Items.FindByValue(_settings.ActiveTab.TabID.ToString()).Attributes.Add("disabled", "disabled"); + this.cboTabs.Items.FindByValue(_settings.ActiveTab.TabID.ToString()).Attributes.Add("disabled", "disabled"); } break; case "F": //file - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = true; - UserRow.Visible = false; - ImagesRow.Visible = false; + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = true; + this.UserRow.Visible = false; + this.ImagesRow.Visible = false; - if (ViewState["FoldersLoaded"] == null || _doReloadFolders) + if (this.ViewState["FoldersLoaded"] == null || this._doReloadFolders) { - LoadFolders("BROWSE,ADD"); - ViewState["FoldersLoaded"] = "Y"; + this.LoadFolders("BROWSE,ADD"); + this.ViewState["FoldersLoaded"] = "Y"; } - if (cboFolders.Items.Count == 0) + if (this.cboFolders.Items.Count == 0) { - lblMessage.Text = Localization.GetString("NoPermission", LocalResourceFile); - ErrorRow.Visible = true; - FileRow.Visible = false; + this.lblMessage.Text = Localization.GetString("NoPermission", this.LocalResourceFile); + this.ErrorRow.Visible = true; + this.FileRow.Visible = false; return; } @@ -1004,13 +1004,13 @@ private void DoRenderTypeControls() string LastFolderPath = string.Empty; bool _MustRedrawFiles = false; //Let's try to remember last selection - if (ViewState["LastFolderPath"] != null) + if (this.ViewState["LastFolderPath"] != null) { - LastFolderPath = Convert.ToString(ViewState["LastFolderPath"]); + LastFolderPath = Convert.ToString(this.ViewState["LastFolderPath"]); } - if (ViewState["LastFileName"] != null) + if (this.ViewState["LastFileName"] != null) { - LastFileName = Convert.ToString(ViewState["LastFileName"]); + LastFileName = Convert.ToString(this.ViewState["LastFileName"]); } if (_Url != string.Empty) { @@ -1024,34 +1024,34 @@ private void DoRenderTypeControls() FileName = LastFileName; FolderPath = LastFolderPath; } - if (cboFolders.Items.FindByValue(FolderPath) != null) + if (this.cboFolders.Items.FindByValue(FolderPath) != null) { - cboFolders.ClearSelection(); - cboFolders.Items.FindByValue(FolderPath).Selected = true; + this.cboFolders.ClearSelection(); + this.cboFolders.Items.FindByValue(FolderPath).Selected = true; } - else if (cboFolders.Items.Count > 0) + else if (this.cboFolders.Items.Count > 0) { - cboFolders.ClearSelection(); - cboFolders.Items[0].Selected = true; - FolderPath = cboFolders.Items[0].Value; + this.cboFolders.ClearSelection(); + this.cboFolders.Items[0].Selected = true; + FolderPath = this.cboFolders.Items[0].Value; } - if (ViewState["FilesLoaded"] == null || FolderPath != LastFolderPath || _doReloadFiles) + if (this.ViewState["FilesLoaded"] == null || FolderPath != LastFolderPath || this._doReloadFiles) { //Reload files only if property change or not same folder _MustRedrawFiles = true; - ViewState["FilesLoaded"] = "Y"; + this.ViewState["FilesLoaded"] = "Y"; } else { - if (cboFiles.Items.Count > 0) + if (this.cboFiles.Items.Count > 0) { - if ((Required && String.IsNullOrEmpty(cboFiles.Items[0].Value)) || (!Required && !String.IsNullOrEmpty(cboFiles.Items[0].Value))) + if ((this.Required && String.IsNullOrEmpty(this.cboFiles.Items[0].Value)) || (!this.Required && !String.IsNullOrEmpty(this.cboFiles.Items[0].Value))) { //Required state has changed, so we need to reload files _MustRedrawFiles = true; } } - else if (!Required) + else if (!this.Required) { //Required state has changed, so we need to reload files _MustRedrawFiles = true; @@ -1059,62 +1059,62 @@ private void DoRenderTypeControls() } if (_MustRedrawFiles) { - cboFiles.DataSource = GetFileList(!Required); - cboFiles.DataBind(); - if (cboFiles.Items.FindByText(FileName) != null) + this.cboFiles.DataSource = this.GetFileList(!this.Required); + this.cboFiles.DataBind(); + if (this.cboFiles.Items.FindByText(FileName) != null) { - cboFiles.ClearSelection(); - cboFiles.Items.FindByText(FileName).Selected = true; + this.cboFiles.ClearSelection(); + this.cboFiles.Items.FindByText(FileName).Selected = true; } } - cboFiles.Visible = true; - txtFile.Visible = false; + this.cboFiles.Visible = true; + this.txtFile.Visible = false; - FolderInfo objFolder = (FolderInfo)FolderManager.Instance.GetFolder(_objPortal.PortalID, FolderPath); - cmdUpload.Visible = ShowUpLoad && FolderPermissionController.CanAddFolder(objFolder); + FolderInfo objFolder = (FolderInfo)FolderManager.Instance.GetFolder(this._objPortal.PortalID, FolderPath); + this.cmdUpload.Visible = this.ShowUpLoad && FolderPermissionController.CanAddFolder(objFolder); - SetStorageLocationType(); - txtUrl.Visible = false; - cmdSave.Visible = false; - cmdCancel.Visible = false; + this.SetStorageLocationType(); + this.txtUrl.Visible = false; + this.cmdSave.Visible = false; + this.cmdCancel.Visible = false; - if (cboFolders.SelectedIndex >= 0) + if (this.cboFolders.SelectedIndex >= 0) { - ViewState["LastFolderPath"] = cboFolders.SelectedValue; + this.ViewState["LastFolderPath"] = this.cboFolders.SelectedValue; } else { - ViewState["LastFolderPath"] = ""; + this.ViewState["LastFolderPath"] = ""; } - if (cboFiles.SelectedIndex >= 0) + if (this.cboFiles.SelectedIndex >= 0) { - ViewState["LastFileName"] = cboFiles.SelectedValue; + this.ViewState["LastFileName"] = this.cboFiles.SelectedValue; } else { - ViewState["LastFileName"] = ""; + this.ViewState["LastFileName"] = ""; } break; case "M": //membership users - URLRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = true; - ImagesRow.Visible = false; - if (String.IsNullOrEmpty(txtUser.Text)) + this.URLRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = true; + this.ImagesRow.Visible = false; + if (String.IsNullOrEmpty(this.txtUser.Text)) { - txtUser.Text = _Url; + this.txtUser.Text = _Url; } break; } } else { - URLRow.Visible = false; - ImagesRow.Visible = false; - TabRow.Visible = false; - FileRow.Visible = false; - UserRow.Visible = false; + this.URLRow.Visible = false; + this.ImagesRow.Visible = false; + this.TabRow.Visible = false; + this.FileRow.Visible = false; + this.UserRow.Visible = false; } } @@ -1126,12 +1126,12 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - AJAX.RegisterPostBackControl(FindControl("cmdSave")); + AJAX.RegisterPostBackControl(this.FindControl("cmdSave")); //prevent unauthorized access - if (Request.IsAuthenticated == false) + if (this.Request.IsAuthenticated == false) { - Visible = false; + this.Visible = false; } } @@ -1139,36 +1139,36 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cboFolders.SelectedIndexChanged += cboFolders_SelectedIndexChanged; - optType.SelectedIndexChanged += optType_SelectedIndexChanged; - cmdAdd.Click += cmdAdd_Click; - cmdCancel.Click += cmdCancel_Click; - cmdDelete.Click += cmdDelete_Click; - cmdSave.Click += cmdSave_Click; - cmdSelect.Click += cmdSelect_Click; - cmdUpload.Click += cmdUpload_Click; + this.cboFolders.SelectedIndexChanged += this.cboFolders_SelectedIndexChanged; + this.optType.SelectedIndexChanged += this.optType_SelectedIndexChanged; + this.cmdAdd.Click += this.cmdAdd_Click; + this.cmdCancel.Click += this.cmdCancel_Click; + this.cmdDelete.Click += this.cmdDelete_Click; + this.cmdSave.Click += this.cmdSave_Click; + this.cmdSelect.Click += this.cmdSelect_Click; + this.cmdUpload.Click += this.cmdUpload_Click; - ErrorRow.Visible = false; + this.ErrorRow.Visible = false; try { - if ((Request.QueryString["pid"] != null) && (Globals.IsHostTab(PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) + if ((this.Request.QueryString["pid"] != null) && (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID) || UserController.Instance.GetCurrentUserInfo().IsSuperUser)) { - _objPortal = PortalController.Instance.GetPortal(Int32.Parse(Request.QueryString["pid"])); + this._objPortal = PortalController.Instance.GetPortal(Int32.Parse(this.Request.QueryString["pid"])); } else { - _objPortal = PortalController.Instance.GetPortal(PortalSettings.PortalId); + this._objPortal = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); } - if (ViewState["IsUrlControlLoaded"] == null) + if (this.ViewState["IsUrlControlLoaded"] == null) { //If Not Page.IsPostBack Then //let's make at least an initialization //The type radio button must be initialized //The url must be initialized no matter its value - _doRenderTypes = true; - _doChangeURL = true; - ClientAPI.AddButtonConfirm(cmdDelete, Localization.GetString("DeleteItem")); + this._doRenderTypes = true; + this._doChangeURL = true; + ClientAPI.AddButtonConfirm(this.cmdDelete, Localization.GetString("DeleteItem")); //The following line was mover to the pre-render event to ensure render for the first time //ViewState("IsUrlControlLoaded") = "Loaded" } @@ -1185,29 +1185,29 @@ protected override void OnPreRender(EventArgs e) try { - if (_doRenderTypes) + if (this._doRenderTypes) { - DoRenderTypes(); + this.DoRenderTypes(); } - if (_doChangeURL) + if (this._doChangeURL) { - DoChangeURL(); + this.DoChangeURL(); } - if (_doReloadFolders || _doReloadFiles) + if (this._doReloadFolders || this._doReloadFiles) { - DoCorrectRadioButtonList(); - _doRenderTypeControls = true; + this.DoCorrectRadioButtonList(); + this._doRenderTypeControls = true; } - if (_doRenderTypeControls) + if (this._doRenderTypeControls) { - if (!(_doReloadFolders || _doReloadFiles)) + if (!(this._doReloadFolders || this._doReloadFiles)) { - DoCorrectRadioButtonList(); + this.DoCorrectRadioButtonList(); } - DoRenderTypeControls(); + this.DoRenderTypeControls(); } - ViewState["Url"] = null; - ViewState["IsUrlControlLoaded"] = "Loaded"; + this.ViewState["Url"] = null; + this.ViewState["IsUrlControlLoaded"] = "Loaded"; } catch (Exception exc) { @@ -1220,125 +1220,125 @@ protected void cboFolders_SelectedIndexChanged(Object sender, EventArgs e) { int PortalId = Null.NullInteger; - if (!IsHostMenu || Request.QueryString["pid"] != null) + if (!this.IsHostMenu || this.Request.QueryString["pid"] != null) { - PortalId = _objPortal.PortalID; + PortalId = this._objPortal.PortalID; } - var objFolder = FolderManager.Instance.GetFolder(PortalId, cboFolders.SelectedValue); + var objFolder = FolderManager.Instance.GetFolder(PortalId, this.cboFolders.SelectedValue); if (FolderPermissionController.CanAddFolder((FolderInfo)objFolder)) { - if (!txtFile.Visible) + if (!this.txtFile.Visible) { - cmdSave.Visible = false; + this.cmdSave.Visible = false; //only show if not already in upload mode and not disabled - cmdUpload.Visible = ShowUpLoad; + this.cmdUpload.Visible = this.ShowUpLoad; } } else { //reset controls - cboFiles.Visible = true; - cmdUpload.Visible = false; - txtFile.Visible = false; - cmdSave.Visible = false; - cmdCancel.Visible = false; + this.cboFiles.Visible = true; + this.cmdUpload.Visible = false; + this.txtFile.Visible = false; + this.cmdSave.Visible = false; + this.cmdCancel.Visible = false; } - cboFiles.Items.Clear(); - cboFiles.DataSource = GetFileList(!Required); - cboFiles.DataBind(); - SetStorageLocationType(); - if (cboFolders.SelectedIndex >= 0) + this.cboFiles.Items.Clear(); + this.cboFiles.DataSource = this.GetFileList(!this.Required); + this.cboFiles.DataBind(); + this.SetStorageLocationType(); + if (this.cboFolders.SelectedIndex >= 0) { - ViewState["LastFolderPath"] = cboFolders.SelectedValue; + this.ViewState["LastFolderPath"] = this.cboFolders.SelectedValue; } else { - ViewState["LastFolderPath"] = ""; + this.ViewState["LastFolderPath"] = ""; } - if (cboFiles.SelectedIndex >= 0) + if (this.cboFiles.SelectedIndex >= 0) { - ViewState["LastFileName"] = cboFiles.SelectedValue; + this.ViewState["LastFileName"] = this.cboFiles.SelectedValue; } else { - ViewState["LastFileName"] = ""; + this.ViewState["LastFileName"] = ""; } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void cmdAdd_Click(object sender, EventArgs e) { - cboUrls.Visible = false; - cmdSelect.Visible = true; - txtUrl.Visible = true; - cmdAdd.Visible = false; - cmdDelete.Visible = false; - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + this.cboUrls.Visible = false; + this.cmdSelect.Visible = true; + this.txtUrl.Visible = true; + this.cmdAdd.Visible = false; + this.cmdDelete.Visible = false; + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void cmdCancel_Click(Object sender, EventArgs e) { - cboFiles.Visible = true; - cmdUpload.Visible = true; - txtFile.Visible = false; - cmdSave.Visible = false; - cmdCancel.Visible = false; - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + this.cboFiles.Visible = true; + this.cmdUpload.Visible = true; + this.txtFile.Visible = false; + this.cmdSave.Visible = false; + this.cmdCancel.Visible = false; + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void cmdDelete_Click(object sender, EventArgs e) { - if (cboUrls.SelectedItem != null) + if (this.cboUrls.SelectedItem != null) { var objUrls = new UrlController(); - objUrls.DeleteUrl(_objPortal.PortalID, cboUrls.SelectedItem.Value); - LoadUrls(); //we must reload the url list - } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + objUrls.DeleteUrl(this._objPortal.PortalID, this.cboUrls.SelectedItem.Value); + this.LoadUrls(); //we must reload the url list + } + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void cmdSave_Click(Object sender, EventArgs e) { - cmdUpload.Visible = false; + this.cmdUpload.Visible = false; //if no file is selected exit - if (String.IsNullOrEmpty(txtFile.PostedFile.FileName)) + if (String.IsNullOrEmpty(this.txtFile.PostedFile.FileName)) { return; } string ParentFolderName; - if (Globals.IsHostTab(PortalSettings.ActiveTab.TabID)) + if (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID)) { ParentFolderName = Globals.HostMapPath; } else { - ParentFolderName = PortalSettings.HomeDirectoryMapPath; + ParentFolderName = this.PortalSettings.HomeDirectoryMapPath; } - ParentFolderName += cboFolders.SelectedItem.Value; + ParentFolderName += this.cboFolders.SelectedItem.Value; - string strExtension = Path.GetExtension(txtFile.PostedFile.FileName).Replace(".", ""); - if (!String.IsNullOrEmpty(FileFilter) && ("," + FileFilter.ToLowerInvariant()).IndexOf("," + strExtension.ToLowerInvariant()) == -1) + string strExtension = Path.GetExtension(this.txtFile.PostedFile.FileName).Replace(".", ""); + if (!String.IsNullOrEmpty(this.FileFilter) && ("," + this.FileFilter.ToLowerInvariant()).IndexOf("," + strExtension.ToLowerInvariant()) == -1) { //trying to upload a file not allowed for current filter - lblMessage.Text = string.Format(Localization.GetString("UploadError", LocalResourceFile), FileFilter, strExtension); - ErrorRow.Visible = true; + this.lblMessage.Text = string.Format(Localization.GetString("UploadError", this.LocalResourceFile), this.FileFilter, strExtension); + this.ErrorRow.Visible = true; } else { @@ -1348,142 +1348,142 @@ protected void cmdSave_Click(Object sender, EventArgs e) var settings = PortalController.Instance.GetCurrentPortalSettings(); var portalID = (settings.ActiveTab.ParentId == settings.SuperTabId) ? Null.NullInteger : settings.PortalId; - var fileName = Path.GetFileName(txtFile.PostedFile.FileName); + var fileName = Path.GetFileName(this.txtFile.PostedFile.FileName); var folderPath = Globals.GetSubFolderPath(ParentFolderName.Replace("/", "\\") + fileName, portalID); var folder = folderManager.GetFolder(portalID, folderPath); - ErrorRow.Visible = false; + this.ErrorRow.Visible = false; try { - fileManager.AddFile(folder, fileName, txtFile.PostedFile.InputStream, true, true, ((FileManager)fileManager).GetContentType(Path.GetExtension(fileName))); + fileManager.AddFile(folder, fileName, this.txtFile.PostedFile.InputStream, true, true, ((FileManager)fileManager).GetContentType(Path.GetExtension(fileName))); } catch (Services.FileSystem.PermissionsNotMetException) { - lblMessage.Text += "
    " + string.Format(Localization.GetString("InsufficientFolderPermission"), folder.FolderPath); - ErrorRow.Visible = true; + this.lblMessage.Text += "
    " + string.Format(Localization.GetString("InsufficientFolderPermission"), folder.FolderPath); + this.ErrorRow.Visible = true; } catch (NoSpaceAvailableException) { - lblMessage.Text += "
    " + string.Format(Localization.GetString("DiskSpaceExceeded"), fileName); - ErrorRow.Visible = true; + this.lblMessage.Text += "
    " + string.Format(Localization.GetString("DiskSpaceExceeded"), fileName); + this.ErrorRow.Visible = true; } catch (InvalidFileExtensionException) { - lblMessage.Text += "
    " + string.Format(Localization.GetString("RestrictedFileType"), fileName, Host.AllowedExtensionWhitelist.ToDisplayString()); - ErrorRow.Visible = true; + this.lblMessage.Text += "
    " + string.Format(Localization.GetString("RestrictedFileType"), fileName, Host.AllowedExtensionWhitelist.ToDisplayString()); + this.ErrorRow.Visible = true; } catch (Exception) { - lblMessage.Text += "
    " + string.Format(Localization.GetString("SaveFileError"), fileName); - ErrorRow.Visible = true; + this.lblMessage.Text += "
    " + string.Format(Localization.GetString("SaveFileError"), fileName); + this.ErrorRow.Visible = true; } } - if (lblMessage.Text == string.Empty) + if (this.lblMessage.Text == string.Empty) { - cboFiles.Visible = true; - cmdUpload.Visible = ShowUpLoad; - txtFile.Visible = false; - cmdSave.Visible = false; - cmdCancel.Visible = false; - ErrorRow.Visible = false; + this.cboFiles.Visible = true; + this.cmdUpload.Visible = this.ShowUpLoad; + this.txtFile.Visible = false; + this.cmdSave.Visible = false; + this.cmdCancel.Visible = false; + this.ErrorRow.Visible = false; var Root = new DirectoryInfo(ParentFolderName); - cboFiles.Items.Clear(); - cboFiles.DataSource = GetFileList(false); - cboFiles.DataBind(); + this.cboFiles.Items.Clear(); + this.cboFiles.DataSource = this.GetFileList(false); + this.cboFiles.DataBind(); - string FileName = txtFile.PostedFile.FileName.Substring(txtFile.PostedFile.FileName.LastIndexOf("\\") + 1); - if (cboFiles.Items.FindByText(FileName) != null) + string FileName = this.txtFile.PostedFile.FileName.Substring(this.txtFile.PostedFile.FileName.LastIndexOf("\\") + 1); + if (this.cboFiles.Items.FindByText(FileName) != null) { - cboFiles.Items.FindByText(FileName).Selected = true; + this.cboFiles.Items.FindByText(FileName).Selected = true; } - if (cboFiles.SelectedIndex >= 0) + if (this.cboFiles.SelectedIndex >= 0) { - ViewState["LastFileName"] = cboFiles.SelectedValue; + this.ViewState["LastFileName"] = this.cboFiles.SelectedValue; } else { - ViewState["LastFileName"] = ""; + this.ViewState["LastFileName"] = ""; } } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void cmdSelect_Click(object sender, EventArgs e) { - cboUrls.Visible = true; - cmdSelect.Visible = false; - txtUrl.Visible = false; - cmdAdd.Visible = true; - cmdDelete.Visible = PortalSecurity.IsInRole(_objPortal.AdministratorRoleName); - LoadUrls(); - if (cboUrls.Items.FindByValue(txtUrl.Text) != null) - { - cboUrls.ClearSelection(); - cboUrls.Items.FindByValue(txtUrl.Text).Selected = true; - } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + this.cboUrls.Visible = true; + this.cmdSelect.Visible = false; + this.txtUrl.Visible = false; + this.cmdAdd.Visible = true; + this.cmdDelete.Visible = PortalSecurity.IsInRole(this._objPortal.AdministratorRoleName); + this.LoadUrls(); + if (this.cboUrls.Items.FindByValue(this.txtUrl.Text) != null) + { + this.cboUrls.ClearSelection(); + this.cboUrls.Items.FindByValue(this.txtUrl.Text).Selected = true; + } + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void cmdUpload_Click(object sender, EventArgs e) { - string strSaveFolder = cboFolders.SelectedValue; - LoadFolders("ADD"); - if (cboFolders.Items.FindByValue(strSaveFolder) != null) + string strSaveFolder = this.cboFolders.SelectedValue; + this.LoadFolders("ADD"); + if (this.cboFolders.Items.FindByValue(strSaveFolder) != null) { - cboFolders.Items.FindByValue(strSaveFolder).Selected = true; - cboFiles.Visible = false; - cmdUpload.Visible = false; - txtFile.Visible = true; - cmdSave.Visible = true; - cmdCancel.Visible = true; + this.cboFolders.Items.FindByValue(strSaveFolder).Selected = true; + this.cboFiles.Visible = false; + this.cmdUpload.Visible = false; + this.txtFile.Visible = true; + this.cmdSave.Visible = true; + this.cmdCancel.Visible = true; } else { - if (cboFolders.Items.Count > 0) + if (this.cboFolders.Items.Count > 0) { - cboFolders.Items[0].Selected = true; - cboFiles.Visible = false; - cmdUpload.Visible = false; - txtFile.Visible = true; - cmdSave.Visible = true; - cmdCancel.Visible = true; + this.cboFolders.Items[0].Selected = true; + this.cboFiles.Visible = false; + this.cmdUpload.Visible = false; + this.txtFile.Visible = true; + this.cmdSave.Visible = true; + this.cmdCancel.Visible = true; } else { //reset controls - LoadFolders("BROWSE,ADD"); - cboFolders.Items.FindByValue(strSaveFolder).Selected = true; - cboFiles.Visible = true; - cmdUpload.Visible = false; - txtFile.Visible = false; - cmdSave.Visible = false; - cmdCancel.Visible = false; - lblMessage.Text = Localization.GetString("NoWritePermission", LocalResourceFile); - ErrorRow.Visible = true; - } - } - _doRenderTypeControls = false; //Must not render on this postback - _doRenderTypes = false; - _doChangeURL = false; - _doReloadFolders = false; - _doReloadFiles = false; + this.LoadFolders("BROWSE,ADD"); + this.cboFolders.Items.FindByValue(strSaveFolder).Selected = true; + this.cboFiles.Visible = true; + this.cmdUpload.Visible = false; + this.txtFile.Visible = false; + this.cmdSave.Visible = false; + this.cmdCancel.Visible = false; + this.lblMessage.Text = Localization.GetString("NoWritePermission", this.LocalResourceFile); + this.ErrorRow.Visible = true; + } + } + this._doRenderTypeControls = false; //Must not render on this postback + this._doRenderTypes = false; + this._doChangeURL = false; + this._doReloadFolders = false; + this._doReloadFiles = false; } protected void optType_SelectedIndexChanged(Object sender, EventArgs e) { //Type changed, render the correct control set - ViewState["UrlType"] = optType.SelectedItem.Value; - _doRenderTypeControls = true; + this.ViewState["UrlType"] = this.optType.SelectedItem.Value; + this._doRenderTypeControls = true; } #endregion diff --git a/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs b/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs index 7632e9f10cb..4562b8ba341 100644 --- a/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs +++ b/DNN Platform/Library/UI/UserControls/URLTrackingControl.cs @@ -63,11 +63,11 @@ public string FormattedURL { get { - return _FormattedURL; + return this._FormattedURL; } set { - _FormattedURL = value; + this._FormattedURL = value; } } @@ -75,11 +75,11 @@ public string TrackingURL { get { - return _TrackingURL; + return this._TrackingURL; } set { - _TrackingURL = value; + this._TrackingURL = value; } } @@ -87,11 +87,11 @@ public string URL { get { - return _URL; + return this._URL; } set { - _URL = value; + this._URL = value; } } @@ -99,19 +99,19 @@ public int ModuleID { get { - int moduleID = _ModuleID; + int moduleID = this._ModuleID; if (moduleID == -2) { - if (Request.QueryString["mid"] != null) + if (this.Request.QueryString["mid"] != null) { - Int32.TryParse(Request.QueryString["mid"], out moduleID); + Int32.TryParse(this.Request.QueryString["mid"], out moduleID); } } return moduleID; } set { - _ModuleID = value; + this._ModuleID = value; } } @@ -120,19 +120,19 @@ public string LocalResourceFile get { string fileRoot; - if (String.IsNullOrEmpty(_localResourceFile)) + if (String.IsNullOrEmpty(this._localResourceFile)) { - fileRoot = TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/URLTrackingControl.ascx"; + fileRoot = this.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/URLTrackingControl.ascx"; } else { - fileRoot = _localResourceFile; + fileRoot = this._localResourceFile; } return fileRoot; } set { - _localResourceFile = value; + this._localResourceFile = value; } } @@ -144,82 +144,82 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdDisplay.Click += cmdDisplay_Click; + this.cmdDisplay.Click += this.cmdDisplay_Click; try { //this needs to execute always to the client script code is registred in InvokePopupCal - cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal(txtStartDate); - cmdEndCalendar.NavigateUrl = Calendar.InvokePopupCal(txtEndDate); - if (!Page.IsPostBack) + this.cmdStartCalendar.NavigateUrl = Calendar.InvokePopupCal(this.txtStartDate); + this.cmdEndCalendar.NavigateUrl = Calendar.InvokePopupCal(this.txtEndDate); + if (!this.Page.IsPostBack) { - if (!String.IsNullOrEmpty(_URL)) + if (!String.IsNullOrEmpty(this._URL)) { - lblLogURL.Text = URL; //saved for loading Log grid - TabType URLType = Globals.GetURLType(_URL); - if (URLType == TabType.File && _URL.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase) == false) + this.lblLogURL.Text = this.URL; //saved for loading Log grid + TabType URLType = Globals.GetURLType(this._URL); + if (URLType == TabType.File && this._URL.StartsWith("fileid=", StringComparison.InvariantCultureIgnoreCase) == false) { //to handle legacy scenarios before the introduction of the FileServerHandler - var fileName = Path.GetFileName(_URL); + var fileName = Path.GetFileName(this._URL); - var folderPath = _URL.Substring(0, _URL.LastIndexOf(fileName)); - var folder = FolderManager.Instance.GetFolder(PortalSettings.PortalId, folderPath); + var folderPath = this._URL.Substring(0, this._URL.LastIndexOf(fileName)); + var folder = FolderManager.Instance.GetFolder(this.PortalSettings.PortalId, folderPath); var file = FileManager.Instance.GetFile(folder, fileName); - lblLogURL.Text = "FileID=" + file.FileId; + this.lblLogURL.Text = "FileID=" + file.FileId; } var objUrls = new UrlController(); - UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(PortalSettings.PortalId, lblLogURL.Text, ModuleID); + UrlTrackingInfo objUrlTracking = objUrls.GetUrlTracking(this.PortalSettings.PortalId, this.lblLogURL.Text, this.ModuleID); if (objUrlTracking != null) { - if (String.IsNullOrEmpty(_FormattedURL)) + if (String.IsNullOrEmpty(this._FormattedURL)) { - lblURL.Text = Globals.LinkClick(URL, PortalSettings.ActiveTab.TabID, ModuleID, false); - if (!lblURL.Text.StartsWith("http") && !lblURL.Text.StartsWith("mailto")) + this.lblURL.Text = Globals.LinkClick(this.URL, this.PortalSettings.ActiveTab.TabID, this.ModuleID, false); + if (!this.lblURL.Text.StartsWith("http") && !this.lblURL.Text.StartsWith("mailto")) { - lblURL.Text = Globals.AddHTTP(Request.Url.Host) + lblURL.Text; + this.lblURL.Text = Globals.AddHTTP(this.Request.Url.Host) + this.lblURL.Text; } } else { - lblURL.Text = _FormattedURL; + this.lblURL.Text = this._FormattedURL; } - lblCreatedDate.Text = objUrlTracking.CreatedDate.ToString(); + this.lblCreatedDate.Text = objUrlTracking.CreatedDate.ToString(); if (objUrlTracking.TrackClicks) { - pnlTrack.Visible = true; - if (String.IsNullOrEmpty(_TrackingURL)) + this.pnlTrack.Visible = true; + if (String.IsNullOrEmpty(this._TrackingURL)) { - if (!URL.StartsWith("http")) + if (!this.URL.StartsWith("http")) { - lblTrackingURL.Text = Globals.AddHTTP(Request.Url.Host); + this.lblTrackingURL.Text = Globals.AddHTTP(this.Request.Url.Host); } - lblTrackingURL.Text += Globals.LinkClick(URL, PortalSettings.ActiveTab.TabID, ModuleID, objUrlTracking.TrackClicks); + this.lblTrackingURL.Text += Globals.LinkClick(this.URL, this.PortalSettings.ActiveTab.TabID, this.ModuleID, objUrlTracking.TrackClicks); } else { - lblTrackingURL.Text = _TrackingURL; + this.lblTrackingURL.Text = this._TrackingURL; } - lblClicks.Text = objUrlTracking.Clicks.ToString(); + this.lblClicks.Text = objUrlTracking.Clicks.ToString(); if (!Null.IsNull(objUrlTracking.LastClick)) { - lblLastClick.Text = objUrlTracking.LastClick.ToString(); + this.lblLastClick.Text = objUrlTracking.LastClick.ToString(); } } if (objUrlTracking.LogActivity) { - pnlLog.Visible = true; + this.pnlLog.Visible = true; - txtStartDate.Text = DateTime.Today.AddDays(-6).ToShortDateString(); - txtEndDate.Text = DateTime.Today.AddDays(1).ToShortDateString(); + this.txtStartDate.Text = DateTime.Today.AddDays(-6).ToShortDateString(); + this.txtEndDate.Text = DateTime.Today.AddDays(1).ToShortDateString(); } } } else { - Visible = false; + this.Visible = false; } } } @@ -233,21 +233,21 @@ private void cmdDisplay_Click(object sender, EventArgs e) { try { - string strStartDate = txtStartDate.Text; + string strStartDate = this.txtStartDate.Text; if (!String.IsNullOrEmpty(strStartDate)) { strStartDate = strStartDate + " 00:00"; } - string strEndDate = txtEndDate.Text; + string strEndDate = this.txtEndDate.Text; if (!String.IsNullOrEmpty(strEndDate)) { strEndDate = strEndDate + " 23:59"; } var objUrls = new UrlController(); //localize datagrid - Localization.LocalizeDataGrid(ref grdLog, LocalResourceFile); - grdLog.DataSource = objUrls.GetUrlLog(PortalSettings.PortalId, lblLogURL.Text, ModuleID, Convert.ToDateTime(strStartDate), Convert.ToDateTime(strEndDate)); - grdLog.DataBind(); + Localization.LocalizeDataGrid(ref this.grdLog, this.LocalResourceFile); + this.grdLog.DataSource = objUrls.GetUrlLog(this.PortalSettings.PortalId, this.lblLogURL.Text, this.ModuleID, Convert.ToDateTime(strStartDate), Convert.ToDateTime(strEndDate)); + this.grdLog.DataBind(); } catch (Exception exc) //Module failed to load { diff --git a/DNN Platform/Library/UI/UserControls/User.cs b/DNN Platform/Library/UI/UserControls/User.cs index 7f26f5a430e..1b345c24110 100644 --- a/DNN Platform/Library/UI/UserControls/User.cs +++ b/DNN Platform/Library/UI/UserControls/User.cs @@ -83,11 +83,11 @@ public int ModuleId { get { - return Convert.ToInt32(ViewState["ModuleId"]); + return Convert.ToInt32(this.ViewState["ModuleId"]); } set { - _ModuleId = value; + this._ModuleId = value; } } @@ -95,11 +95,11 @@ public string LabelColumnWidth { get { - return Convert.ToString(ViewState["LabelColumnWidth"]); + return Convert.ToString(this.ViewState["LabelColumnWidth"]); } set { - _LabelColumnWidth = value; + this._LabelColumnWidth = value; } } @@ -107,11 +107,11 @@ public string ControlColumnWidth { get { - return Convert.ToString(ViewState["ControlColumnWidth"]); + return Convert.ToString(this.ViewState["ControlColumnWidth"]); } set { - _ControlColumnWidth = value; + this._ControlColumnWidth = value; } } @@ -119,11 +119,11 @@ public string FirstName { get { - return txtFirstName.Text; + return this.txtFirstName.Text; } set { - _FirstName = value; + this._FirstName = value; } } @@ -131,11 +131,11 @@ public string LastName { get { - return txtLastName.Text; + return this.txtLastName.Text; } set { - _LastName = value; + this._LastName = value; } } @@ -143,11 +143,11 @@ public string UserName { get { - return txtUsername.Text; + return this.txtUsername.Text; } set { - _UserName = value; + this._UserName = value; } } @@ -155,11 +155,11 @@ public string Password { get { - return txtPassword.Text; + return this.txtPassword.Text; } set { - _Password = value; + this._Password = value; } } @@ -167,11 +167,11 @@ public string Confirm { get { - return txtConfirm.Text; + return this.txtConfirm.Text; } set { - _Confirm = value; + this._Confirm = value; } } @@ -179,11 +179,11 @@ public string Email { get { - return txtEmail.Text; + return this.txtEmail.Text; } set { - _Email = value; + this._Email = value; } } @@ -191,11 +191,11 @@ public string Website { get { - return txtWebsite.Text; + return this.txtWebsite.Text; } set { - _Website = value; + this._Website = value; } } @@ -203,11 +203,11 @@ public string IM { get { - return txtIM.Text; + return this.txtIM.Text; } set { - _IM = value; + this._IM = value; } } @@ -215,7 +215,7 @@ public int StartTabIndex { set { - _StartTabIndex = value; + this._StartTabIndex = value; } } @@ -223,7 +223,7 @@ public bool ShowPassword { set { - _ShowPassword = value; + this._ShowPassword = value; } } @@ -231,7 +231,7 @@ public string LocalResourceFile { get { - return Localization.GetResourceFile(this, MyFileName); + return Localization.GetResourceFile(this, this.MyFileName); } } @@ -251,66 +251,66 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - txtFirstName.TabIndex = Convert.ToInt16(_StartTabIndex); - txtLastName.TabIndex = Convert.ToInt16(_StartTabIndex + 1); - txtUsername.TabIndex = Convert.ToInt16(_StartTabIndex + 2); - txtPassword.TabIndex = Convert.ToInt16(_StartTabIndex + 3); - txtConfirm.TabIndex = Convert.ToInt16(_StartTabIndex + 4); - txtEmail.TabIndex = Convert.ToInt16(_StartTabIndex + 5); - txtWebsite.TabIndex = Convert.ToInt16(_StartTabIndex + 6); - txtIM.TabIndex = Convert.ToInt16(_StartTabIndex + 7); - txtFirstName.Text = _FirstName; - txtLastName.Text = _LastName; - txtEmail.Text = _Email; - txtUsername.Text = _UserName; - lblUsername.Text = _UserName; - txtPassword.Text = _Password; - txtConfirm.Text = _Confirm; - txtWebsite.Text = _Website; - txtIM.Text = _IM; - if (!String.IsNullOrEmpty(_ControlColumnWidth)) + this.txtFirstName.TabIndex = Convert.ToInt16(this._StartTabIndex); + this.txtLastName.TabIndex = Convert.ToInt16(this._StartTabIndex + 1); + this.txtUsername.TabIndex = Convert.ToInt16(this._StartTabIndex + 2); + this.txtPassword.TabIndex = Convert.ToInt16(this._StartTabIndex + 3); + this.txtConfirm.TabIndex = Convert.ToInt16(this._StartTabIndex + 4); + this.txtEmail.TabIndex = Convert.ToInt16(this._StartTabIndex + 5); + this.txtWebsite.TabIndex = Convert.ToInt16(this._StartTabIndex + 6); + this.txtIM.TabIndex = Convert.ToInt16(this._StartTabIndex + 7); + this.txtFirstName.Text = this._FirstName; + this.txtLastName.Text = this._LastName; + this.txtEmail.Text = this._Email; + this.txtUsername.Text = this._UserName; + this.lblUsername.Text = this._UserName; + this.txtPassword.Text = this._Password; + this.txtConfirm.Text = this._Confirm; + this.txtWebsite.Text = this._Website; + this.txtIM.Text = this._IM; + if (!String.IsNullOrEmpty(this._ControlColumnWidth)) { - txtFirstName.Width = Unit.Parse(_ControlColumnWidth); - txtLastName.Width = Unit.Parse(_ControlColumnWidth); - txtEmail.Width = Unit.Parse(_ControlColumnWidth); - txtUsername.Width = Unit.Parse(_ControlColumnWidth); - txtPassword.Width = Unit.Parse(_ControlColumnWidth); - txtConfirm.Width = Unit.Parse(_ControlColumnWidth); - txtWebsite.Width = Unit.Parse(_ControlColumnWidth); - txtIM.Width = Unit.Parse(_ControlColumnWidth); + this.txtFirstName.Width = Unit.Parse(this._ControlColumnWidth); + this.txtLastName.Width = Unit.Parse(this._ControlColumnWidth); + this.txtEmail.Width = Unit.Parse(this._ControlColumnWidth); + this.txtUsername.Width = Unit.Parse(this._ControlColumnWidth); + this.txtPassword.Width = Unit.Parse(this._ControlColumnWidth); + this.txtConfirm.Width = Unit.Parse(this._ControlColumnWidth); + this.txtWebsite.Width = Unit.Parse(this._ControlColumnWidth); + this.txtIM.Width = Unit.Parse(this._ControlColumnWidth); } - if (!_ShowPassword) + if (!this._ShowPassword) { - valPassword.Enabled = false; - valConfirm1.Enabled = false; - valConfirm2.Enabled = false; - PasswordRow.Visible = false; - ConfirmPasswordRow.Visible = false; - txtUsername.Visible = false; - valUsername.Enabled = false; - lblUsername.Visible = true; - lblUsernameAsterisk.Visible = false; + this.valPassword.Enabled = false; + this.valConfirm1.Enabled = false; + this.valConfirm2.Enabled = false; + this.PasswordRow.Visible = false; + this.ConfirmPasswordRow.Visible = false; + this.txtUsername.Visible = false; + this.valUsername.Enabled = false; + this.lblUsername.Visible = true; + this.lblUsernameAsterisk.Visible = false; } else { - txtUsername.Visible = true; - valUsername.Enabled = true; - lblUsername.Visible = false; - lblUsernameAsterisk.Visible = true; - valPassword.Enabled = true; - valConfirm1.Enabled = true; - valConfirm2.Enabled = true; - PasswordRow.Visible = true; - ConfirmPasswordRow.Visible = true; + this.txtUsername.Visible = true; + this.valUsername.Enabled = true; + this.lblUsername.Visible = false; + this.lblUsernameAsterisk.Visible = true; + this.valPassword.Enabled = true; + this.valConfirm1.Enabled = true; + this.valConfirm2.Enabled = true; + this.PasswordRow.Visible = true; + this.ConfirmPasswordRow.Visible = true; } - ViewState["ModuleId"] = Convert.ToString(_ModuleId); - ViewState["LabelColumnWidth"] = _LabelColumnWidth; - ViewState["ControlColumnWidth"] = _ControlColumnWidth; + this.ViewState["ModuleId"] = Convert.ToString(this._ModuleId); + this.ViewState["LabelColumnWidth"] = this._LabelColumnWidth; + this.ViewState["ControlColumnWidth"] = this._ControlColumnWidth; } - txtPassword.Attributes.Add("value", txtPassword.Text); - txtConfirm.Attributes.Add("value", txtConfirm.Text); + this.txtPassword.Attributes.Add("value", this.txtPassword.Text); + this.txtConfirm.Attributes.Add("value", this.txtConfirm.Text); } catch (Exception exc) { diff --git a/DNN Platform/Library/UI/WebControls/ActionLink.cs b/DNN Platform/Library/UI/WebControls/ActionLink.cs index 48f88f90cb0..95559921ff3 100644 --- a/DNN Platform/Library/UI/WebControls/ActionLink.cs +++ b/DNN Platform/Library/UI/WebControls/ActionLink.cs @@ -35,10 +35,10 @@ public class ActionLink : HyperLink public ActionLink() { - RequireEditMode = false; - Security = "Edit"; - ControlKey = ""; - Title = ""; + this.RequireEditMode = false; + this.Security = "Edit"; + this.ControlKey = ""; + this.Title = ""; } #endregion @@ -66,9 +66,9 @@ public ActionLink() private bool IsVisible(SecurityAccessLevel security) { bool isVisible = false; - if (ModulePermissionController.HasModuleAccess(security, Null.NullString, ModuleControl.ModuleContext.Configuration)) + if (ModulePermissionController.HasModuleAccess(security, Null.NullString, this.ModuleControl.ModuleContext.Configuration)) { - if ((RequireEditMode != true || ModuleControl.ModuleContext.PortalSettings.UserMode == PortalSettings.Mode.Edit) || (security == SecurityAccessLevel.Anonymous || security == SecurityAccessLevel.View)) + if ((this.RequireEditMode != true || this.ModuleControl.ModuleContext.PortalSettings.UserMode == PortalSettings.Mode.Edit) || (security == SecurityAccessLevel.Anonymous || security == SecurityAccessLevel.View)) { isVisible = true; } @@ -92,7 +92,7 @@ protected override void CreateChildControls() base.CreateChildControls(); //Set Causes Validation and Enables ViewState to false - EnableViewState = false; + this.EnableViewState = false; } @@ -105,21 +105,21 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Visible && IsVisible((SecurityAccessLevel)Enum.Parse(typeof(SecurityAccessLevel), Security))) + if (this.Visible && this.IsVisible((SecurityAccessLevel)Enum.Parse(typeof(SecurityAccessLevel), this.Security))) { - Text = Title; - NavigateUrl = ControlKey != "" - ? ModuleControl.ModuleContext.EditUrl(KeyName, KeyValue, ControlKey) - : ModuleControl.ModuleContext.EditUrl(Title); + this.Text = this.Title; + this.NavigateUrl = this.ControlKey != "" + ? this.ModuleControl.ModuleContext.EditUrl(this.KeyName, this.KeyValue, this.ControlKey) + : this.ModuleControl.ModuleContext.EditUrl(this.Title); - if (CssClass == "") + if (this.CssClass == "") { - CssClass = "dnnPrimaryAction"; + this.CssClass = "dnnPrimaryAction"; } } else { - Visible = false; + this.Visible = false; } } diff --git a/DNN Platform/Library/UI/WebControls/CaptchaControl.cs b/DNN Platform/Library/UI/WebControls/CaptchaControl.cs index aa97055ca24..f58b2b53d45 100644 --- a/DNN Platform/Library/UI/WebControls/CaptchaControl.cs +++ b/DNN Platform/Library/UI/WebControls/CaptchaControl.cs @@ -84,9 +84,9 @@ public class CaptchaControl : WebControl, INamingContainer, IPostBackDataHandler public CaptchaControl() { - ErrorMessage = Localization.GetString("InvalidCaptcha", Localization.SharedResourceFile); - Text = Localization.GetString("CaptchaText.Text", Localization.SharedResourceFile); - _Expiration = HostController.Instance.GetInteger("EXPIRATION_DEFAULT", EXPIRATION_DEFAULT); + this.ErrorMessage = Localization.GetString("InvalidCaptcha", Localization.SharedResourceFile); + this.Text = Localization.GetString("CaptchaText.Text", Localization.SharedResourceFile); + this._Expiration = HostController.Instance.GetInteger("EXPIRATION_DEFAULT", EXPIRATION_DEFAULT); } #endregion @@ -113,11 +113,11 @@ public Color BackGroundColor { get { - return _BackGroundColor; + return this._BackGroundColor; } set { - _BackGroundColor = value; + this._BackGroundColor = value; } } @@ -129,11 +129,11 @@ public string BackGroundImage { get { - return _BackGroundImage; + return this._BackGroundImage; } set { - _BackGroundImage = value; + this._BackGroundImage = value; } } @@ -145,11 +145,11 @@ public string CaptchaChars { get { - return _CaptchaChars; + return this._CaptchaChars; } set { - _CaptchaChars = value; + this._CaptchaChars = value; } } @@ -161,11 +161,11 @@ public Unit CaptchaHeight { get { - return _CaptchaHeight; + return this._CaptchaHeight; } set { - _CaptchaHeight = value; + this._CaptchaHeight = value; } } @@ -177,11 +177,11 @@ public int CaptchaLength { get { - return _CaptchaLength; + return this._CaptchaLength; } set { - _CaptchaLength = value; + this._CaptchaLength = value; } } @@ -193,11 +193,11 @@ public Unit CaptchaWidth { get { - return _CaptchaWidth; + return this._CaptchaWidth; } set { - _CaptchaWidth = value; + this._CaptchaWidth = value; } } @@ -232,7 +232,7 @@ public Style ErrorStyle { get { - return _ErrorStyle; + return this._ErrorStyle; } } @@ -244,11 +244,11 @@ public int Expiration { get { - return _Expiration; + return this._Expiration; } set { - _Expiration = value; + this._Expiration = value; } } @@ -260,7 +260,7 @@ public bool IsValid { get { - return _IsValid; + return this._IsValid; } } @@ -272,11 +272,11 @@ public string RenderUrl { get { - return _RenderUrl; + return this._RenderUrl; } set { - _RenderUrl = value; + this._RenderUrl = value; } } @@ -295,7 +295,7 @@ public Style TextBoxStyle { get { - return _TextBoxStyle; + return this._TextBoxStyle; } } @@ -310,11 +310,11 @@ public Style TextBoxStyle /// ----------------------------------------------------------------------------- public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - _UserText = postCollection[postDataKey]; - Validate(_UserText); - if (!_IsValid && !string.IsNullOrEmpty(_UserText)) + this._UserText = postCollection[postDataKey]; + this.Validate(this._UserText); + if (!this._IsValid && !string.IsNullOrEmpty(this._UserText)) { - _CaptchaText = GetNextCaptcha(); + this._CaptchaText = this.GetNextCaptcha(); } return false; } @@ -346,8 +346,8 @@ public void RaisePostDataChangedEvent() ///
    private string GetUrl() { - var url = ResolveUrl(RenderUrl); - url += "?" + KEY + "=" + Encrypt(EncodeTicket(), DateTime.Now.AddSeconds(Expiration)); + var url = this.ResolveUrl(this.RenderUrl); + url += "?" + KEY + "=" + Encrypt(this.EncodeTicket(), DateTime.Now.AddSeconds(this.Expiration)); //Append the Alias to the url so that it doesn't lose track of the alias it's currently on var _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); @@ -362,10 +362,10 @@ private string EncodeTicket() { var sb = new StringBuilder(); - sb.Append(CaptchaWidth.Value.ToString()); - sb.Append(_Separator + CaptchaHeight.Value); - sb.Append(_Separator + _CaptchaText); - sb.Append(_Separator + BackGroundImage); + sb.Append(this.CaptchaWidth.Value.ToString()); + sb.Append(_Separator + this.CaptchaHeight.Value); + sb.Append(_Separator + this._CaptchaText); + sb.Append(_Separator + this.BackGroundImage); return sb.ToString(); } @@ -655,12 +655,12 @@ protected override void CreateChildControls() { base.CreateChildControls(); - if ((CaptchaWidth.IsEmpty || CaptchaWidth.Type != UnitType.Pixel || CaptchaHeight.IsEmpty || CaptchaHeight.Type != UnitType.Pixel)) + if ((this.CaptchaWidth.IsEmpty || this.CaptchaWidth.Type != UnitType.Pixel || this.CaptchaHeight.IsEmpty || this.CaptchaHeight.Type != UnitType.Pixel)) { throw new InvalidOperationException("Must specify size of control in pixels."); } - _image = new Image {BorderColor = BorderColor, BorderStyle = BorderStyle, BorderWidth = BorderWidth, ToolTip = ToolTip, EnableViewState = false}; - Controls.Add(_image); + this._image = new Image {BorderColor = this.BorderColor, BorderStyle = this.BorderStyle, BorderWidth = this.BorderWidth, ToolTip = this.ToolTip, EnableViewState = false}; + this.Controls.Add(this._image); } /// @@ -672,11 +672,11 @@ protected virtual string GetNextCaptcha() var sb = new StringBuilder(); var rand = new Random(); int n; - var intMaxLength = CaptchaChars.Length; + var intMaxLength = this.CaptchaChars.Length; - for (n = 0; n <= CaptchaLength - 1; n++) + for (n = 0; n <= this.CaptchaLength - 1; n++) { - sb.Append(CaptchaChars.Substring(rand.Next(intMaxLength), 1)); + sb.Append(this.CaptchaChars.Substring(rand.Next(intMaxLength), 1)); } var challenge = sb.ToString(); @@ -685,7 +685,7 @@ protected virtual string GetNextCaptcha() // with a single server or web-farm, the cache might be cleared // which will cause a problem in such case unless sticky sessions are used. var cacheKey = string.Format(DataCache.CaptchaCacheKey, challenge); - DataCache.SetCache(cacheKey, challenge, (DNNCacheDependency)null, DateTime.Now.AddSeconds(_Expiration + 1), + DataCache.SetCache(cacheKey, challenge, (DNNCacheDependency)null, DateTime.Now.AddSeconds(this._Expiration + 1), Cache.NoSlidingExpiration, CacheItemPriority.AboveNormal, null); return challenge; } @@ -710,7 +710,7 @@ protected override void LoadViewState(object savedState) //Load the CAPTCHA Text from the ViewState if (myState[1] != null) { - _CaptchaText = Convert.ToString(myState[1]); + this._CaptchaText = Convert.ToString(myState[1]); } } //var cacheKey = string.Format(DataCache.CaptchaCacheKey, masterPortalId); @@ -724,10 +724,10 @@ protected override void LoadViewState(object savedState) protected override void OnPreRender(EventArgs e) { //Generate Random Challenge Text - _CaptchaText = GetNextCaptcha(); + this._CaptchaText = this.GetNextCaptcha(); //Enable Viewstate Encryption - Page.RegisterRequiresViewStateEncryption(); + this.Page.RegisterRequiresViewStateEncryption(); //Call Base Class method base.OnPreRender(e); @@ -735,7 +735,7 @@ protected override void OnPreRender(EventArgs e) protected virtual void OnUserValidated(ServerValidateEventArgs e) { - ServerValidateEventHandler handler = UserValidated; + ServerValidateEventHandler handler = this.UserValidated; if (handler != null) { handler(this, e); @@ -748,18 +748,18 @@ protected virtual void OnUserValidated(ServerValidateEventArgs e) /// An Html Text Writer protected override void Render(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); //Render outer
    Tag writer.AddAttribute("class", "dnnLeft"); writer.RenderBeginTag(HtmlTextWriterTag.Div); //Render image Tag - writer.AddAttribute(HtmlTextWriterAttribute.Src, GetUrl()); + writer.AddAttribute(HtmlTextWriterAttribute.Src, this.GetUrl()); writer.AddAttribute(HtmlTextWriterAttribute.Border, "0"); - if (!String.IsNullOrEmpty(ToolTip)) + if (!String.IsNullOrEmpty(this.ToolTip)) { - writer.AddAttribute(HtmlTextWriterAttribute.Alt, ToolTip); + writer.AddAttribute(HtmlTextWriterAttribute.Alt, this.ToolTip); } else { @@ -769,34 +769,34 @@ protected override void Render(HtmlTextWriter writer) writer.RenderEndTag(); //Render Help Text - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { writer.RenderBeginTag(HtmlTextWriterTag.Div); - writer.Write(Text); + writer.Write(this.Text); writer.RenderEndTag(); } //Render text box Tag - TextBoxStyle.AddAttributesToRender(writer); + this.TextBoxStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); - writer.AddAttribute(HtmlTextWriterAttribute.Style, "width:" + Width); - writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, _CaptchaText.Length.ToString()); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - if (!String.IsNullOrEmpty(AccessKey)) + writer.AddAttribute(HtmlTextWriterAttribute.Style, "width:" + this.Width); + writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, this._CaptchaText.Length.ToString()); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + if (!String.IsNullOrEmpty(this.AccessKey)) { - writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, AccessKey); + writer.AddAttribute(HtmlTextWriterAttribute.Accesskey, this.AccessKey); } - if (!Enabled) + if (!this.Enabled) { writer.AddAttribute(HtmlTextWriterAttribute.Disabled, "disabled"); } - if (TabIndex > 0) + if (this.TabIndex > 0) { - writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, TabIndex.ToString()); + writer.AddAttribute(HtmlTextWriterAttribute.Tabindex, this.TabIndex.ToString()); } - if (_UserText == _CaptchaText) + if (this._UserText == this._CaptchaText) { - writer.AddAttribute(HtmlTextWriterAttribute.Value, _UserText); + writer.AddAttribute(HtmlTextWriterAttribute.Value, this._UserText); } else { @@ -806,11 +806,11 @@ protected override void Render(HtmlTextWriter writer) writer.RenderEndTag(); //Render error message - if (!IsValid && Page.IsPostBack && !string.IsNullOrEmpty(_UserText)) + if (!this.IsValid && this.Page.IsPostBack && !string.IsNullOrEmpty(this._UserText)) { - ErrorStyle.AddAttributesToRender(writer); + this.ErrorStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - writer.Write(ErrorMessage); + writer.Write(this.ErrorMessage); writer.RenderEndTag(); } @@ -826,11 +826,11 @@ protected override object SaveViewState() var baseState = base.SaveViewState(); var allStates = new object[2]; allStates[0] = baseState; - if (string.IsNullOrEmpty(_CaptchaText)) + if (string.IsNullOrEmpty(this._CaptchaText)) { - _CaptchaText = GetNextCaptcha(); + this._CaptchaText = this.GetNextCaptcha(); } - allStates[1] = _CaptchaText; + allStates[1] = this._CaptchaText; return allStates; } @@ -850,16 +850,16 @@ public bool Validate(string userData) if (cacheObj == null) { - _IsValid = false; + this._IsValid = false; } else { - _IsValid = true; + this._IsValid = true; DataCache.RemoveCache(cacheKey); } - OnUserValidated(new ServerValidateEventArgs(_CaptchaText, _IsValid)); - return _IsValid; + this.OnUserValidated(new ServerValidateEventArgs(this._CaptchaText, this._IsValid)); + return this._IsValid; } #endregion diff --git a/DNN Platform/Library/UI/WebControls/CommandButton.cs b/DNN Platform/Library/UI/WebControls/CommandButton.cs index 5d23bea0b51..b096a87aa06 100644 --- a/DNN Platform/Library/UI/WebControls/CommandButton.cs +++ b/DNN Platform/Library/UI/WebControls/CommandButton.cs @@ -44,13 +44,13 @@ public string ButtonSeparator { get { - EnsureChildControls(); - return separator.Text; + this.EnsureChildControls(); + return this.separator.Text; } set { - EnsureChildControls(); - separator.Text = value; + this.EnsureChildControls(); + this.separator.Text = value; } } @@ -65,14 +65,14 @@ public bool CausesValidation { get { - EnsureChildControls(); - return link.CausesValidation; + this.EnsureChildControls(); + return this.link.CausesValidation; } set { - EnsureChildControls(); - icon.CausesValidation = value; - link.CausesValidation = value; + this.EnsureChildControls(); + this.icon.CausesValidation = value; + this.link.CausesValidation = value; } } @@ -86,14 +86,14 @@ public string CommandArgument { get { - EnsureChildControls(); - return link.CommandArgument; + this.EnsureChildControls(); + return this.link.CommandArgument; } set { - EnsureChildControls(); - icon.CommandArgument = value; - link.CommandArgument = value; + this.EnsureChildControls(); + this.icon.CommandArgument = value; + this.link.CommandArgument = value; } } @@ -107,14 +107,14 @@ public string CommandName { get { - EnsureChildControls(); - return link.CommandName; + this.EnsureChildControls(); + return this.link.CommandName; } set { - EnsureChildControls(); - icon.CommandName = value; - link.CommandName = value; + this.EnsureChildControls(); + this.icon.CommandName = value; + this.link.CommandName = value; } } @@ -129,13 +129,13 @@ public bool DisplayLink { get { - EnsureChildControls(); - return link.Visible; + this.EnsureChildControls(); + return this.link.Visible; } set { - EnsureChildControls(); - link.Visible = value; + this.EnsureChildControls(); + this.link.Visible = value; } } @@ -150,13 +150,13 @@ public bool DisplayIcon { get { - EnsureChildControls(); - return icon.Visible; + this.EnsureChildControls(); + return this.icon.Visible; } set { - EnsureChildControls(); - icon.Visible = value; + this.EnsureChildControls(); + this.icon.Visible = value; } } @@ -170,16 +170,16 @@ public string ImageUrl { get { - EnsureChildControls(); - if (string.IsNullOrEmpty(icon.ImageUrl)) - icon.ImageUrl = Entities.Icons.IconController.IconURL(IconKey, IconSize, IconStyle); + this.EnsureChildControls(); + if (string.IsNullOrEmpty(this.icon.ImageUrl)) + this.icon.ImageUrl = Entities.Icons.IconController.IconURL(this.IconKey, this.IconSize, this.IconStyle); - return icon.ImageUrl; + return this.icon.ImageUrl; } set { - EnsureChildControls(); - icon.ImageUrl = value; + this.EnsureChildControls(); + this.icon.ImageUrl = value; } } @@ -217,21 +217,21 @@ public string OnClick { get { - EnsureChildControls(); - return link.Attributes["onclick"]; + this.EnsureChildControls(); + return this.link.Attributes["onclick"]; } set { - EnsureChildControls(); + this.EnsureChildControls(); if (String.IsNullOrEmpty(value)) { - icon.Attributes.Remove("onclick"); - link.Attributes.Remove("onclick"); + this.icon.Attributes.Remove("onclick"); + this.link.Attributes.Remove("onclick"); } else { - icon.Attributes.Add("onclick", value); - link.Attributes.Add("onclick", value); + this.icon.Attributes.Add("onclick", value); + this.link.Attributes.Add("onclick", value); } } } @@ -246,14 +246,14 @@ public string OnClientClick { get { - EnsureChildControls(); - return link.OnClientClick; + this.EnsureChildControls(); + return this.link.OnClientClick; } set { - EnsureChildControls(); - icon.OnClientClick = value; - link.OnClientClick = value; + this.EnsureChildControls(); + this.icon.OnClientClick = value; + this.link.OnClientClick = value; } } @@ -267,21 +267,21 @@ public string ResourceKey { get { - EnsureChildControls(); - return link.Attributes["resourcekey"]; + this.EnsureChildControls(); + return this.link.Attributes["resourcekey"]; } set { - EnsureChildControls(); + this.EnsureChildControls(); if (String.IsNullOrEmpty(value)) { - icon.Attributes.Remove("resourcekey"); - link.Attributes.Remove("resourcekey"); + this.icon.Attributes.Remove("resourcekey"); + this.link.Attributes.Remove("resourcekey"); } else { - icon.Attributes.Add("resourcekey", value); - link.Attributes.Add("resourcekey", value); + this.icon.Attributes.Add("resourcekey", value); + this.link.Attributes.Add("resourcekey", value); } } } @@ -296,13 +296,13 @@ public string Text { get { - EnsureChildControls(); - return link.Text; + this.EnsureChildControls(); + return this.link.Text; } set { - EnsureChildControls(); - link.Text = value; + this.EnsureChildControls(); + this.link.Text = value; } } @@ -324,14 +324,14 @@ public string ValidationGroup { get { - EnsureChildControls(); - return link.ValidationGroup; + this.EnsureChildControls(); + return this.link.ValidationGroup; } set { - EnsureChildControls(); - icon.ValidationGroup = value; - link.ValidationGroup = value; + this.EnsureChildControls(); + this.icon.ValidationGroup = value; + this.link.ValidationGroup = value; } } @@ -350,34 +350,34 @@ public string ValidationGroup /// ----------------------------------------------------------------------------- protected override void CreateChildControls() { - Controls.Clear(); - if (String.IsNullOrEmpty(CssClass)) - { - CssClass = "CommandButton"; - } - icon = new ImageButton(); - icon.Visible = true; - icon.CausesValidation = true; - icon.Click += RaiseImageClick; - icon.Command += RaiseCommand; - Controls.Add(icon); - separator = new LiteralControl(); - separator.Text = " "; - Controls.Add(separator); - link = new LinkButton(); - link.Visible = true; - link.CausesValidation = true; - link.Click += RaiseClick; - link.Command += RaiseCommand; - Controls.Add(link); - if (DisplayIcon && !String.IsNullOrEmpty(ImageUrl)) - { - icon.EnableViewState = EnableViewState; - } - if (DisplayLink) - { - link.CssClass = CssClass; - link.EnableViewState = EnableViewState; + this.Controls.Clear(); + if (String.IsNullOrEmpty(this.CssClass)) + { + this.CssClass = "CommandButton"; + } + this.icon = new ImageButton(); + this.icon.Visible = true; + this.icon.CausesValidation = true; + this.icon.Click += this.RaiseImageClick; + this.icon.Command += this.RaiseCommand; + this.Controls.Add(this.icon); + this.separator = new LiteralControl(); + this.separator.Text = " "; + this.Controls.Add(this.separator); + this.link = new LinkButton(); + this.link.Visible = true; + this.link.CausesValidation = true; + this.link.Click += this.RaiseClick; + this.link.Command += this.RaiseCommand; + this.Controls.Add(this.link); + if (this.DisplayIcon && !String.IsNullOrEmpty(this.ImageUrl)) + { + this.icon.EnableViewState = this.EnableViewState; + } + if (this.DisplayLink) + { + this.link.CssClass = this.CssClass; + this.link.EnableViewState = this.EnableViewState; } } @@ -388,9 +388,9 @@ protected override void CreateChildControls() /// ----------------------------------------------------------------------------- protected virtual void OnButtonClick(EventArgs e) { - if (Click != null) + if (this.Click != null) { - Click(this, e); + this.Click(this, e); } } @@ -401,9 +401,9 @@ protected virtual void OnButtonClick(EventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnCommand(CommandEventArgs e) { - if (Command != null) + if (this.Command != null) { - Command(this, e); + this.Command(this, e); } } @@ -415,32 +415,32 @@ protected virtual void OnCommand(CommandEventArgs e) protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - EnsureChildControls(); - separator.Visible = DisplayLink && DisplayIcon; + this.EnsureChildControls(); + this.separator.Visible = this.DisplayLink && this.DisplayIcon; - LocalResourceFile = UIUtilities.GetLocalResourceFile(this); + this.LocalResourceFile = UIUtilities.GetLocalResourceFile(this); var tooltipText = string.Empty; - if (!string.IsNullOrEmpty(ToolTipKey)) + if (!string.IsNullOrEmpty(this.ToolTipKey)) { - tooltipText = Localization.GetString(ToolTipKey, LocalResourceFile); + tooltipText = Localization.GetString(this.ToolTipKey, this.LocalResourceFile); } - if (string.IsNullOrEmpty(tooltipText) && !string.IsNullOrEmpty(ToolTip)) + if (string.IsNullOrEmpty(tooltipText) && !string.IsNullOrEmpty(this.ToolTip)) { - tooltipText = ToolTip; + tooltipText = this.ToolTip; } if (!string.IsNullOrEmpty(tooltipText)) { - icon.ToolTip = link.ToolTip = icon.AlternateText = tooltipText; + this.icon.ToolTip = this.link.ToolTip = this.icon.AlternateText = tooltipText; } } public void RegisterForPostback() { - AJAX.RegisterPostBackControl(link); - AJAX.RegisterPostBackControl(icon); + AJAX.RegisterPostBackControl(this.link); + AJAX.RegisterPostBackControl(this.icon); } /// ----------------------------------------------------------------------------- @@ -454,7 +454,7 @@ public void RegisterForPostback() /// ----------------------------------------------------------------------------- private void RaiseClick(object sender, EventArgs e) { - OnButtonClick(e); + this.OnButtonClick(e); } /// ----------------------------------------------------------------------------- @@ -468,7 +468,7 @@ private void RaiseClick(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void RaiseCommand(object sender, CommandEventArgs e) { - OnCommand(e); + this.OnCommand(e); } /// ----------------------------------------------------------------------------- @@ -482,7 +482,7 @@ private void RaiseCommand(object sender, CommandEventArgs e) /// ----------------------------------------------------------------------------- protected void RaiseImageClick(object sender, ImageClickEventArgs e) { - OnButtonClick(new EventArgs()); + this.OnButtonClick(new EventArgs()); } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumn.cs b/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumn.cs index 43f8bcbb2ca..a0340cdba1e 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumn.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumn.cs @@ -54,7 +54,7 @@ public CheckBoxColumn() : this(false) /// ----------------------------------------------------------------------------- public CheckBoxColumn(bool autoPostBack) { - AutoPostBack = autoPostBack; + this.AutoPostBack = autoPostBack; } #endregion @@ -73,11 +73,11 @@ public bool AutoPostBack { get { - return mAutoPostBack; + return this.mAutoPostBack; } set { - mAutoPostBack = value; + this.mAutoPostBack = value; } } @@ -100,11 +100,11 @@ public string DataField { get { - return mDataField; + return this.mDataField; } set { - mDataField = value; + this.mDataField = value; } } @@ -120,11 +120,11 @@ public bool Enabled { get { - return mEnabled; + return this.mEnabled; } set { - mEnabled = value; + this.mEnabled = value; } } @@ -139,11 +139,11 @@ public string EnabledField { get { - return mEnabledField; + return this.mEnabledField; } set { - mEnabledField = value; + this.mEnabledField = value; } } @@ -158,11 +158,11 @@ public bool HeaderCheckBox { get { - return mHeaderCheckBox; + return this.mHeaderCheckBox; } set { - mHeaderCheckBox = value; + this.mHeaderCheckBox = value; } } @@ -192,18 +192,18 @@ private CheckBoxColumnTemplate CreateTemplate(ListItemType type) var template = new CheckBoxColumnTemplate(type); if (type != ListItemType.Header) { - template.AutoPostBack = AutoPostBack; + template.AutoPostBack = this.AutoPostBack; } - template.Checked = Checked; - template.DataField = DataField; - template.Enabled = Enabled; - template.EnabledField = EnabledField; - template.CheckedChanged += OnCheckedChanged; + template.Checked = this.Checked; + template.DataField = this.DataField; + template.Enabled = this.Enabled; + template.EnabledField = this.EnabledField; + template.CheckedChanged += this.OnCheckedChanged; if (type == ListItemType.Header) { - template.Text = HeaderText; + template.Text = this.HeaderText; template.AutoPostBack = true; - template.HeaderCheckBox = HeaderCheckBox; + template.HeaderCheckBox = this.HeaderCheckBox; } template.DesignMode = isDesignMode; return template; @@ -218,9 +218,9 @@ private void OnCheckedChanged(object sender, DNNDataGridCheckChangedEventArgs e) { //Add the column to the Event Args e.Column = this; - if (CheckedChanged != null) + if (this.CheckedChanged != null) { - CheckedChanged(sender, e); + this.CheckedChanged(sender, e); } } @@ -235,17 +235,17 @@ private void OnCheckedChanged(object sender, DNNDataGridCheckChangedEventArgs e) /// ----------------------------------------------------------------------------- public override void Initialize() { - ItemTemplate = CreateTemplate(ListItemType.Item); - EditItemTemplate = CreateTemplate(ListItemType.EditItem); - HeaderTemplate = CreateTemplate(ListItemType.Header); + this.ItemTemplate = this.CreateTemplate(ListItemType.Item); + this.EditItemTemplate = this.CreateTemplate(ListItemType.EditItem); + this.HeaderTemplate = this.CreateTemplate(ListItemType.Header); if (HttpContext.Current == null) { - HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; - HeaderStyle.Font.Size = new FontUnit("10pt"); - HeaderStyle.Font.Bold = true; + this.HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; + this.HeaderStyle.Font.Size = new FontUnit("10pt"); + this.HeaderStyle.Font.Bold = true; } - ItemStyle.HorizontalAlign = HorizontalAlign.Center; - HeaderStyle.HorizontalAlign = HorizontalAlign.Center; + this.ItemStyle.HorizontalAlign = HorizontalAlign.Center; + this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; } #endregion diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumnTemplate.cs b/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumnTemplate.cs index 4e8cf25e6d8..cb7b8f2731a 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumnTemplate.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/CheckBoxColumnTemplate.cs @@ -38,7 +38,7 @@ public CheckBoxColumnTemplate() : this(ListItemType.Item) public CheckBoxColumnTemplate(ListItemType itemType) { - ItemType = itemType; + this.ItemType = itemType; } /// ----------------------------------------------------------------------------- @@ -68,11 +68,11 @@ public string DataField { get { - return mDataField; + return this.mDataField; } set { - mDataField = value; + this.mDataField = value; } } @@ -96,11 +96,11 @@ public bool Enabled { get { - return mEnabled; + return this.mEnabled; } set { - mEnabled = value; + this.mEnabled = value; } } @@ -115,11 +115,11 @@ public string EnabledField { get { - return mEnabledField; + return this.mEnabledField; } set { - mEnabledField = value; + this.mEnabledField = value; } } @@ -134,11 +134,11 @@ public bool HeaderCheckBox { get { - return mHeaderCheckBox; + return this.mHeaderCheckBox; } set { - mHeaderCheckBox = value; + this.mHeaderCheckBox = value; } } @@ -152,11 +152,11 @@ public ListItemType ItemType { get { - return mItemType; + return this.mItemType; } set { - mItemType = value; + this.mItemType = value; } } @@ -170,11 +170,11 @@ public string Text { get { - return mText; + return this.mText; } set { - mText = value; + this.mText = value; } } @@ -188,16 +188,16 @@ public string Text /// ----------------------------------------------------------------------------- public void InstantiateIn(Control container) { - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - container.Controls.Add(new LiteralControl(Text + "
    ")); + container.Controls.Add(new LiteralControl(this.Text + "
    ")); } - if (ItemType != ListItemType.Header || (ItemType == ListItemType.Header && HeaderCheckBox)) + if (this.ItemType != ListItemType.Header || (this.ItemType == ListItemType.Header && this.HeaderCheckBox)) { var box = new CheckBox(); - box.AutoPostBack = AutoPostBack; - box.DataBinding += Item_DataBinding; - box.CheckedChanged += OnCheckChanged; + box.AutoPostBack = this.AutoPostBack; + box.DataBinding += this.Item_DataBinding; + box.CheckedChanged += this.OnCheckChanged; container.Controls.Add(box); } } @@ -215,35 +215,35 @@ private void Item_DataBinding(object sender, EventArgs e) { var box = (CheckBox) sender; var container = (DataGridItem) box.NamingContainer; - if (!String.IsNullOrEmpty(DataField) && ItemType != ListItemType.Header) + if (!String.IsNullOrEmpty(this.DataField) && this.ItemType != ListItemType.Header) { - if (DesignMode) + if (this.DesignMode) { box.Checked = false; } else { - box.Checked = Convert.ToBoolean(DataBinder.Eval(container.DataItem, DataField)); + box.Checked = Convert.ToBoolean(DataBinder.Eval(container.DataItem, this.DataField)); } } else { - box.Checked = Checked; + box.Checked = this.Checked; } - if (!String.IsNullOrEmpty(EnabledField)) + if (!String.IsNullOrEmpty(this.EnabledField)) { - if (DesignMode) + if (this.DesignMode) { box.Enabled = false; } else { - box.Enabled = Convert.ToBoolean(DataBinder.Eval(container.DataItem, EnabledField)); + box.Enabled = Convert.ToBoolean(DataBinder.Eval(container.DataItem, this.EnabledField)); } } else { - box.Enabled = Enabled; + box.Enabled = this.Enabled; } } @@ -259,15 +259,15 @@ private void OnCheckChanged(object sender, EventArgs e) DNNDataGridCheckChangedEventArgs evntArgs; if (container.ItemIndex == Null.NullInteger) { - evntArgs = new DNNDataGridCheckChangedEventArgs(container, box.Checked, DataField, true); + evntArgs = new DNNDataGridCheckChangedEventArgs(container, box.Checked, this.DataField, true); } else { - evntArgs = new DNNDataGridCheckChangedEventArgs(container, box.Checked, DataField, false); + evntArgs = new DNNDataGridCheckChangedEventArgs(container, box.Checked, this.DataField, false); } - if (CheckedChanged != null) + if (this.CheckedChanged != null) { - CheckedChanged(sender, evntArgs); + this.CheckedChanged(sender, evntArgs); } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGrid.cs b/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGrid.cs index e143b2e619b..4526125a577 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGrid.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGrid.cs @@ -40,9 +40,9 @@ public class DNNDataGrid : DataGrid /// ----------------------------------------------------------------------------- private void OnItemCheckedChanged(object sender, DNNDataGridCheckChangedEventArgs e) { - if (ItemCheckedChanged != null) + if (this.ItemCheckedChanged != null) { - ItemCheckedChanged(sender, e); + this.ItemCheckedChanged(sender, e); } } @@ -57,13 +57,13 @@ private void OnItemCheckedChanged(object sender, DNNDataGridCheckChangedEventArg /// ----------------------------------------------------------------------------- protected override void OnDataBinding(EventArgs e) { - foreach (DataGridColumn column in Columns) + foreach (DataGridColumn column in this.Columns) { if (ReferenceEquals(column.GetType(), typeof (CheckBoxColumn))) { //Manage CheckBox column events var cbColumn = (CheckBoxColumn) column; - cbColumn.CheckedChanged += OnItemCheckedChanged; + cbColumn.CheckedChanged += this.OnItemCheckedChanged; } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGridCheckChangedEventArgs.cs b/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGridCheckChangedEventArgs.cs index fccac3994f9..20c66565621 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGridCheckChangedEventArgs.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/DNNDataGridCheckChangedEventArgs.cs @@ -32,9 +32,9 @@ public DNNDataGridCheckChangedEventArgs(DataGridItem item, bool isChecked, strin public DNNDataGridCheckChangedEventArgs(DataGridItem item, bool isChecked, string field, bool isAll) : base(item) { - Checked = isChecked; - IsAll = isAll; - Field = field; + this.Checked = isChecked; + this.IsAll = isAll; + this.Field = field; } public bool Checked { get; set; } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumn.cs b/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumn.cs index 676515715c3..717e54f9e42 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumn.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumn.cs @@ -50,7 +50,7 @@ public DNNMultiStateBoxColumn() : this(false) /// ----------------------------------------------------------------------------- public DNNMultiStateBoxColumn(bool autoPostBack) { - AutoPostBack = autoPostBack; + this.AutoPostBack = autoPostBack; } /// ----------------------------------------------------------------------------- @@ -63,11 +63,11 @@ public bool AutoPostBack { get { - return mAutoPostBack; + return this.mAutoPostBack; } set { - mAutoPostBack = value; + this.mAutoPostBack = value; } } @@ -81,11 +81,11 @@ public string SelectedStateKey { get { - return mSelectedStateKey; + return this.mSelectedStateKey; } set { - mSelectedStateKey = value; + this.mSelectedStateKey = value; } } @@ -100,11 +100,11 @@ public string DataField { get { - return mDataField; + return this.mDataField; } set { - mDataField = value; + this.mDataField = value; } } @@ -120,11 +120,11 @@ public bool Enabled { get { - return mEnabled; + return this.mEnabled; } set { - mEnabled = value; + this.mEnabled = value; } } @@ -139,11 +139,11 @@ public string EnabledField { get { - return mEnabledField; + return this.mEnabledField; } set { - mEnabledField = value; + this.mEnabledField = value; } } @@ -157,11 +157,11 @@ public string ImagePath { get { - return mImagePath; + return this.mImagePath; } set { - mImagePath = value; + this.mImagePath = value; } } @@ -175,15 +175,15 @@ public DNNMultiStateCollection States { get { - if (mStates == null) + if (this.mStates == null) { - mStates = new DNNMultiStateCollection(new DNNMultiStateBox()); + this.mStates = new DNNMultiStateCollection(new DNNMultiStateBox()); } - return mStates; + return this.mStates; } set { - mStates = value; + this.mStates = value; } } @@ -203,20 +203,20 @@ private DNNMultiStateBoxColumnTemplate CreateTemplate(ListItemType type) var template = new DNNMultiStateBoxColumnTemplate(type); if (type != ListItemType.Header) { - template.AutoPostBack = AutoPostBack; + template.AutoPostBack = this.AutoPostBack; } - template.DataField = DataField; - template.Enabled = Enabled; - template.EnabledField = EnabledField; - template.ImagePath = ImagePath; - foreach (DNNMultiState objState in States) + template.DataField = this.DataField; + template.Enabled = this.Enabled; + template.EnabledField = this.EnabledField; + template.ImagePath = this.ImagePath; + foreach (DNNMultiState objState in this.States) { template.States.Add(objState); } - template.SelectedStateKey = SelectedStateKey; + template.SelectedStateKey = this.SelectedStateKey; if (type == ListItemType.Header) { - template.Text = HeaderText; + template.Text = this.HeaderText; template.AutoPostBack = true; } template.DesignMode = isDesignMode; @@ -230,17 +230,17 @@ private DNNMultiStateBoxColumnTemplate CreateTemplate(ListItemType type) /// ----------------------------------------------------------------------------- public override void Initialize() { - ItemTemplate = CreateTemplate(ListItemType.Item); - EditItemTemplate = CreateTemplate(ListItemType.EditItem); - HeaderTemplate = CreateTemplate(ListItemType.Header); + this.ItemTemplate = this.CreateTemplate(ListItemType.Item); + this.EditItemTemplate = this.CreateTemplate(ListItemType.EditItem); + this.HeaderTemplate = this.CreateTemplate(ListItemType.Header); if (HttpContext.Current == null) { - HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; - HeaderStyle.Font.Size = new FontUnit("10pt"); - HeaderStyle.Font.Bold = true; + this.HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; + this.HeaderStyle.Font.Size = new FontUnit("10pt"); + this.HeaderStyle.Font.Bold = true; } - ItemStyle.HorizontalAlign = HorizontalAlign.Center; - HeaderStyle.HorizontalAlign = HorizontalAlign.Center; + this.ItemStyle.HorizontalAlign = HorizontalAlign.Center; + this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumnTemplate.cs b/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumnTemplate.cs index 428e0df6d23..1868fed6163 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumnTemplate.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/DNNMultiStateBoxColumnTemplate.cs @@ -40,7 +40,7 @@ public DNNMultiStateBoxColumnTemplate() : this(ListItemType.Item) public DNNMultiStateBoxColumnTemplate(ListItemType itemType) { - ItemType = itemType; + this.ItemType = itemType; } /// ----------------------------------------------------------------------------- @@ -61,11 +61,11 @@ public string SelectedStateKey { get { - return mSelectedStateKey; + return this.mSelectedStateKey; } set { - mSelectedStateKey = value; + this.mSelectedStateKey = value; } } @@ -79,11 +79,11 @@ public string DataField { get { - return mDataField; + return this.mDataField; } set { - mDataField = value; + this.mDataField = value; } } @@ -107,11 +107,11 @@ public bool Enabled { get { - return mEnabled; + return this.mEnabled; } set { - mEnabled = value; + this.mEnabled = value; } } @@ -126,11 +126,11 @@ public string EnabledField { get { - return mEnabledField; + return this.mEnabledField; } set { - mEnabledField = value; + this.mEnabledField = value; } } @@ -144,11 +144,11 @@ public ListItemType ItemType { get { - return mItemType; + return this.mItemType; } set { - mItemType = value; + this.mItemType = value; } } @@ -162,11 +162,11 @@ public string Text { get { - return mText; + return this.mText; } set { - mText = value; + this.mText = value; } } @@ -180,11 +180,11 @@ public string ImagePath { get { - return mImagePath; + return this.mImagePath; } set { - mImagePath = value; + this.mImagePath = value; } } @@ -198,15 +198,15 @@ public DNNMultiStateCollection States { get { - if (mStates == null) + if (this.mStates == null) { - mStates = new DNNMultiStateCollection(new DNNMultiStateBox()); + this.mStates = new DNNMultiStateCollection(new DNNMultiStateBox()); } - return mStates; + return this.mStates; } set { - mStates = value; + this.mStates = value; } } @@ -220,20 +220,20 @@ public DNNMultiStateCollection States /// ----------------------------------------------------------------------------- public void InstantiateIn(Control container) { - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - container.Controls.Add(new LiteralControl(Text + "
    ")); + container.Controls.Add(new LiteralControl(this.Text + "
    ")); } - if (ItemType != ListItemType.Header) + if (this.ItemType != ListItemType.Header) { var box = new DNNMultiStateBox(); - box.AutoPostBack = AutoPostBack; - box.ImagePath = ImagePath; - foreach (DNNMultiState objState in States) + box.AutoPostBack = this.AutoPostBack; + box.ImagePath = this.ImagePath; + foreach (DNNMultiState objState in this.States) { box.States.Add(objState); } - box.DataBinding += Item_DataBinding; + box.DataBinding += this.Item_DataBinding; container.Controls.Add(box); } } @@ -249,35 +249,35 @@ private void Item_DataBinding(object sender, EventArgs e) { var box = (DNNMultiStateBox) sender; var container = (DataGridItem) box.NamingContainer; - if (!String.IsNullOrEmpty(DataField) && ItemType != ListItemType.Header) + if (!String.IsNullOrEmpty(this.DataField) && this.ItemType != ListItemType.Header) { - if (DesignMode) + if (this.DesignMode) { box.SelectedStateKey = ""; } else { - box.SelectedStateKey = Convert.ToString(DataBinder.Eval(container.DataItem, DataField)); + box.SelectedStateKey = Convert.ToString(DataBinder.Eval(container.DataItem, this.DataField)); } } else { - box.SelectedStateKey = SelectedStateKey; + box.SelectedStateKey = this.SelectedStateKey; } - if (!String.IsNullOrEmpty(EnabledField)) + if (!String.IsNullOrEmpty(this.EnabledField)) { - if (DesignMode) + if (this.DesignMode) { box.Enabled = false; } else { - box.Enabled = Convert.ToBoolean(DataBinder.Eval(container.DataItem, EnabledField)); + box.Enabled = Convert.ToBoolean(DataBinder.Eval(container.DataItem, this.EnabledField)); } } else { - box.Enabled = Enabled; + box.Enabled = this.Enabled; } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumn.cs b/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumn.cs index 774334e1652..e5ff7754144 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumn.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumn.cs @@ -39,8 +39,8 @@ public class ImageCommandColumn : TemplateColumn /// A String public ImageCommandColumnEditMode EditMode { - get { return _editMode; } - set { _editMode = value; } + get { return this._editMode; } + set { this._editMode = value; } } @@ -52,14 +52,14 @@ public string ImageURL { get { - if (!string.IsNullOrEmpty(_imageURL)) + if (!string.IsNullOrEmpty(this._imageURL)) { - return _imageURL; + return this._imageURL; } - return IconController.IconURL(IconKey, IconSize, IconStyle); + return IconController.IconURL(this.IconKey, this.IconSize, this.IconStyle); } - set { _imageURL = value; } + set { this._imageURL = value; } } @@ -121,8 +121,8 @@ public string ImageURL /// A Boolean public bool ShowImage { - get { return _showImage; } - set { _showImage = value; } + get { return this._showImage; } + set { this._showImage = value; } } @@ -150,22 +150,22 @@ private ImageCommandColumnTemplate CreateTemplate(ListItemType type) var template = new ImageCommandColumnTemplate(type); if (type != ListItemType.Header) { - template.ImageURL = ImageURL; + template.ImageURL = this.ImageURL; if (!isDesignMode) { - template.CommandName = CommandName; - template.VisibleField = VisibleField; - template.KeyField = KeyField; + template.CommandName = this.CommandName; + template.VisibleField = this.VisibleField; + template.KeyField = this.KeyField; } } - template.EditMode = EditMode; - template.NavigateURL = NavigateURL; - template.NavigateURLFormatString = NavigateURLFormatString; - template.OnClickJS = OnClickJS; - template.ShowImage = ShowImage; - template.Visible = Visible; + template.EditMode = this.EditMode; + template.NavigateURL = this.NavigateURL; + template.NavigateURLFormatString = this.NavigateURLFormatString; + template.OnClickJS = this.OnClickJS; + template.ShowImage = this.ShowImage; + template.Visible = this.Visible; - template.Text = type == ListItemType.Header ? HeaderText : Text; + template.Text = type == ListItemType.Header ? this.HeaderText : this.Text; //Set Design Mode to True template.DesignMode = isDesignMode; @@ -182,18 +182,18 @@ private ImageCommandColumnTemplate CreateTemplate(ListItemType type) ///
    public override void Initialize() { - ItemTemplate = CreateTemplate(ListItemType.Item); - EditItemTemplate = CreateTemplate(ListItemType.EditItem); - HeaderTemplate = CreateTemplate(ListItemType.Header); + this.ItemTemplate = this.CreateTemplate(ListItemType.Item); + this.EditItemTemplate = this.CreateTemplate(ListItemType.EditItem); + this.HeaderTemplate = this.CreateTemplate(ListItemType.Header); if (HttpContext.Current == null) { - HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; - HeaderStyle.Font.Size = new FontUnit("10pt"); - HeaderStyle.Font.Bold = true; + this.HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; + this.HeaderStyle.Font.Size = new FontUnit("10pt"); + this.HeaderStyle.Font.Bold = true; } - ItemStyle.HorizontalAlign = HorizontalAlign.Center; - HeaderStyle.HorizontalAlign = HorizontalAlign.Center; + this.ItemStyle.HorizontalAlign = HorizontalAlign.Center; + this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; } #endregion diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumnTemplate.cs b/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumnTemplate.cs index 449cb997957..1c6affc6e60 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumnTemplate.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/ImageCommandColumnTemplate.cs @@ -43,7 +43,7 @@ public ImageCommandColumnTemplate() : this(ListItemType.Item) public ImageCommandColumnTemplate(ListItemType itemType) { - ItemType = itemType; + this.ItemType = itemType; } #endregion @@ -76,11 +76,11 @@ public ImageCommandColumnEditMode EditMode { get { - return mEditMode; + return this.mEditMode; } set { - mEditMode = value; + this.mEditMode = value; } } @@ -102,11 +102,11 @@ public ListItemType ItemType { get { - return mItemType; + return this.mItemType; } set { - mItemType = value; + this.mItemType = value; } } @@ -153,11 +153,11 @@ public bool ShowImage { get { - return mShowImage; + return this.mShowImage; } set { - mShowImage = value; + this.mShowImage = value; } } @@ -181,11 +181,11 @@ public bool Visible { get { - return mVisible; + return this.mVisible; } set { - mVisible = value; + this.mVisible = value; } } @@ -209,77 +209,77 @@ public bool Visible /// ----------------------------------------------------------------------------- public void InstantiateIn(Control container) { - switch (ItemType) + switch (this.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: case ListItemType.SelectedItem: case ListItemType.EditItem: - if (EditMode == ImageCommandColumnEditMode.URL) + if (this.EditMode == ImageCommandColumnEditMode.URL) { var hypLink = new HyperLink(); - hypLink.ToolTip = Text; - if (!String.IsNullOrEmpty(ImageURL) && ShowImage) + hypLink.ToolTip = this.Text; + if (!String.IsNullOrEmpty(this.ImageURL) && this.ShowImage) { var img = new Image(); - if (DesignMode) + if (this.DesignMode) { - img.ImageUrl = ImageURL.Replace("~/", "../../"); + img.ImageUrl = this.ImageURL.Replace("~/", "../../"); } else { - img.ImageUrl = ImageURL; + img.ImageUrl = this.ImageURL; } hypLink.Controls.Add(img); - img.ToolTip = Text; + img.ToolTip = this.Text; } else { - hypLink.Text = Text; + hypLink.Text = this.Text; } - hypLink.DataBinding += Item_DataBinding; + hypLink.DataBinding += this.Item_DataBinding; container.Controls.Add(hypLink); } else { - if (!String.IsNullOrEmpty(ImageURL) && ShowImage) + if (!String.IsNullOrEmpty(this.ImageURL) && this.ShowImage) { var colIcon = new ImageButton(); - if (DesignMode) + if (this.DesignMode) { - colIcon.ImageUrl = ImageURL.Replace("~/", "../../"); + colIcon.ImageUrl = this.ImageURL.Replace("~/", "../../"); } else { - colIcon.ImageUrl = ImageURL; + colIcon.ImageUrl = this.ImageURL; } - colIcon.ToolTip = Text; - if (!String.IsNullOrEmpty(OnClickJS)) + colIcon.ToolTip = this.Text; + if (!String.IsNullOrEmpty(this.OnClickJS)) { - ClientAPI.AddButtonConfirm(colIcon, OnClickJS); + ClientAPI.AddButtonConfirm(colIcon, this.OnClickJS); } - colIcon.CommandName = CommandName; - colIcon.DataBinding += Item_DataBinding; + colIcon.CommandName = this.CommandName; + colIcon.DataBinding += this.Item_DataBinding; container.Controls.Add(colIcon); } - if (!String.IsNullOrEmpty(Text) && !ShowImage) + if (!String.IsNullOrEmpty(this.Text) && !this.ShowImage) { var colLink = new LinkButton(); - colLink.ToolTip = Text; - if (!String.IsNullOrEmpty(OnClickJS)) + colLink.ToolTip = this.Text; + if (!String.IsNullOrEmpty(this.OnClickJS)) { - ClientAPI.AddButtonConfirm(colLink, OnClickJS); + ClientAPI.AddButtonConfirm(colLink, this.OnClickJS); } - colLink.CommandName = CommandName; - colLink.Text = Text; - colLink.DataBinding += Item_DataBinding; + colLink.CommandName = this.CommandName; + colLink.Text = this.Text; + colLink.DataBinding += this.Item_DataBinding; container.Controls.Add(colLink); } } break; case ListItemType.Footer: case ListItemType.Header: - container.Controls.Add(new LiteralControl(Text)); + container.Controls.Add(new LiteralControl(this.Text)); break; } } @@ -299,13 +299,13 @@ public void InstantiateIn(Control container) private bool GetIsVisible(DataGridItem container) { bool isVisible; - if (!String.IsNullOrEmpty(VisibleField)) + if (!String.IsNullOrEmpty(this.VisibleField)) { - isVisible = Convert.ToBoolean(DataBinder.Eval(container.DataItem, VisibleField)); + isVisible = Convert.ToBoolean(DataBinder.Eval(container.DataItem, this.VisibleField)); } else { - isVisible = Visible; + isVisible = this.Visible; } return isVisible; } @@ -319,9 +319,9 @@ private bool GetIsVisible(DataGridItem container) private int GetValue(DataGridItem container) { int keyValue = Null.NullInteger; - if (!String.IsNullOrEmpty(KeyField)) + if (!String.IsNullOrEmpty(this.KeyField)) { - keyValue = Convert.ToInt32(DataBinder.Eval(container.DataItem, KeyField)); + keyValue = Convert.ToInt32(DataBinder.Eval(container.DataItem, this.KeyField)); } return keyValue; } @@ -339,14 +339,14 @@ private void Item_DataBinding(object sender, EventArgs e) { DataGridItem container; int keyValue = Null.NullInteger; - if (EditMode == ImageCommandColumnEditMode.URL) + if (this.EditMode == ImageCommandColumnEditMode.URL) { var hypLink = (HyperLink) sender; container = (DataGridItem) hypLink.NamingContainer; - keyValue = GetValue(container); - if (!String.IsNullOrEmpty(NavigateURLFormatString)) + keyValue = this.GetValue(container); + if (!String.IsNullOrEmpty(this.NavigateURLFormatString)) { - hypLink.NavigateUrl = string.Format(NavigateURLFormatString, keyValue); + hypLink.NavigateUrl = string.Format(this.NavigateURLFormatString, keyValue); } else { @@ -356,22 +356,22 @@ private void Item_DataBinding(object sender, EventArgs e) else { //Bind Image Button - if (!String.IsNullOrEmpty(ImageURL) && ShowImage) + if (!String.IsNullOrEmpty(this.ImageURL) && this.ShowImage) { var colIcon = (ImageButton) sender; container = (DataGridItem) colIcon.NamingContainer; - keyValue = GetValue(container); + keyValue = this.GetValue(container); colIcon.CommandArgument = keyValue.ToString(); - colIcon.Visible = GetIsVisible(container); + colIcon.Visible = this.GetIsVisible(container); } - if (!String.IsNullOrEmpty(Text) && !ShowImage) + if (!String.IsNullOrEmpty(this.Text) && !this.ShowImage) { //Bind Link Button var colLink = (LinkButton) sender; container = (DataGridItem) colLink.NamingContainer; - keyValue = GetValue(container); + keyValue = this.GetValue(container); colLink.CommandArgument = keyValue.ToString(); - colLink.Visible = GetIsVisible(container); + colLink.Visible = this.GetIsVisible(container); } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriState.cs b/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriState.cs index eccebb2b403..2440558b988 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriState.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriState.cs @@ -34,14 +34,14 @@ public PermissionTriState() //kind of ugly to lookup this data each time, but doesn't seem worth the effort to //maintain statics for the paths but require a control instance to initialize them //and lazy load the text bits when the page instance (or localization) changes - LookupScriptValues(this, out _grantImagePath, out _denyImagePath, out _nullImagePath, out _lockImagePath, out _grantAltText, out _denyAltText, out _nullAltText); + LookupScriptValues(this, out this._grantImagePath, out this._denyImagePath, out this._nullImagePath, out this._lockImagePath, out this._grantAltText, out this._denyAltText, out this._nullAltText); } protected override void OnInit(EventArgs e) { base.OnInit(e); - RegisterScripts(Page, this); + RegisterScripts(this.Page, this); } public static void RegisterScripts(Page page, Control ctl) @@ -100,50 +100,50 @@ protected override void Render(HtmlTextWriter writer) { string imagePath; string altText; - switch (Value) + switch (this.Value) { case "True": - imagePath = _grantImagePath; - altText = _grantAltText; + imagePath = this._grantImagePath; + altText = this._grantAltText; break; case "False": - imagePath = _denyImagePath; - altText = _denyAltText; + imagePath = this._denyImagePath; + altText = this._denyAltText; break; default: - imagePath = _nullImagePath; - altText = _nullAltText; + imagePath = this._nullImagePath; + altText = this._nullAltText; break; } string cssClass = "tristate"; - if (Locked) + if (this.Locked) { - imagePath = _lockImagePath; + imagePath = this._lockImagePath; cssClass += " lockedPerm"; //altText is set based on Value } - if (!SupportsDenyMode) + if (!this.SupportsDenyMode) { cssClass += " noDenyPerm"; } - if (IsFullControl) + if (this.IsFullControl) { cssClass += " fullControl"; } - if (IsView && !Locked) + if (this.IsView && !this.Locked) { cssClass += " view"; } - if (!String.IsNullOrEmpty(PermissionKey) && !IsView && !IsFullControl) + if (!String.IsNullOrEmpty(this.PermissionKey) && !this.IsView && !this.IsFullControl) { - cssClass += " " + PermissionKey.ToLowerInvariant(); + cssClass += " " + this.PermissionKey.ToLowerInvariant(); } writer.Write("{1}", imagePath, altText); diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriStateTemplate.cs b/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriStateTemplate.cs index ea70b367388..ce96dfe52cd 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriStateTemplate.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/PermissionTriStateTemplate.cs @@ -16,12 +16,12 @@ class PermissionTriStateTemplate : ITemplate public PermissionTriStateTemplate(PermissionInfo permission) { - _permission = permission; + this._permission = permission; } public void InstantiateIn(Control container) { var triState = new PermissionTriState(); - triState.DataBinding += BindToTriState; + triState.DataBinding += this.BindToTriState; container.Controls.Add(triState); } @@ -30,12 +30,12 @@ public void BindToTriState(object sender, EventArgs e) var triState = (PermissionTriState) sender; var dataRowView = ((DataRowView) ((DataGridItem)triState.NamingContainer).DataItem); - triState.Value = dataRowView[_permission.PermissionName].ToString(); - triState.Locked = !bool.Parse(dataRowView[_permission.PermissionName + "_Enabled"].ToString()); - triState.SupportsDenyMode = SupportDenyMode; - triState.IsFullControl = IsFullControl; - triState.IsView = IsView; - triState.PermissionKey = _permission.PermissionKey; + triState.Value = dataRowView[this._permission.PermissionName].ToString(); + triState.Locked = !bool.Parse(dataRowView[this._permission.PermissionName + "_Enabled"].ToString()); + triState.SupportsDenyMode = this.SupportDenyMode; + triState.IsFullControl = this.IsFullControl; + triState.IsView = this.IsView; + triState.PermissionKey = this._permission.PermissionKey; } public bool IsFullControl { get; set; } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/RolesSelectionGrid.cs b/DNN Platform/Library/UI/WebControls/DataGrids/RolesSelectionGrid.cs index 9f9278ca88e..afbdc27d8d4 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/RolesSelectionGrid.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/RolesSelectionGrid.cs @@ -50,7 +50,7 @@ public TableItemStyle AlternatingItemStyle { get { - return dgRoleSelection.AlternatingItemStyle; + return this.dgRoleSelection.AlternatingItemStyle; } } @@ -58,11 +58,11 @@ public bool AutoGenerateColumns { get { - return dgRoleSelection.AutoGenerateColumns; + return this.dgRoleSelection.AutoGenerateColumns; } set { - dgRoleSelection.AutoGenerateColumns = value; + this.dgRoleSelection.AutoGenerateColumns = value; } } @@ -70,11 +70,11 @@ public int CellSpacing { get { - return dgRoleSelection.CellSpacing; + return this.dgRoleSelection.CellSpacing; } set { - dgRoleSelection.CellSpacing = value; + this.dgRoleSelection.CellSpacing = value; } } @@ -82,7 +82,7 @@ public DataGridColumnCollection Columns { get { - return dgRoleSelection.Columns; + return this.dgRoleSelection.Columns; } } @@ -90,7 +90,7 @@ public TableItemStyle FooterStyle { get { - return dgRoleSelection.FooterStyle; + return this.dgRoleSelection.FooterStyle; } } @@ -98,11 +98,11 @@ public GridLines GridLines { get { - return dgRoleSelection.GridLines; + return this.dgRoleSelection.GridLines; } set { - dgRoleSelection.GridLines = value; + this.dgRoleSelection.GridLines = value; } } @@ -110,7 +110,7 @@ public TableItemStyle HeaderStyle { get { - return dgRoleSelection.HeaderStyle; + return this.dgRoleSelection.HeaderStyle; } } @@ -118,7 +118,7 @@ public TableItemStyle ItemStyle { get { - return dgRoleSelection.ItemStyle; + return this.dgRoleSelection.ItemStyle; } } @@ -126,7 +126,7 @@ public DataGridItemCollection Items { get { - return dgRoleSelection.Items; + return this.dgRoleSelection.Items; } } @@ -134,7 +134,7 @@ public TableItemStyle SelectedItemStyle { get { - return dgRoleSelection.SelectedItemStyle; + return this.dgRoleSelection.SelectedItemStyle; } } @@ -147,12 +147,12 @@ public ArrayList SelectedRoleNames { get { - UpdateRoleSelections(); - return (new ArrayList(CurrentRoleSelection.ToArray())); + this.UpdateRoleSelections(); + return (new ArrayList(this.CurrentRoleSelection.ToArray())); } set { - CurrentRoleSelection = value.Cast().ToList(); + this.CurrentRoleSelection = value.Cast().ToList(); } } @@ -168,15 +168,15 @@ public bool ShowUnauthenticatedUsers { get { - if (ViewState["ShowUnauthenticatedUsers"] == null) + if (this.ViewState["ShowUnauthenticatedUsers"] == null) { return false; } - return Convert.ToBoolean(ViewState["ShowUnauthenticatedUsers"]); + return Convert.ToBoolean(this.ViewState["ShowUnauthenticatedUsers"]); } set { - ViewState["ShowUnauthenticatedUsers"] = value; + this.ViewState["ShowUnauthenticatedUsers"] = value; } } @@ -187,15 +187,15 @@ public bool ShowAllUsers { get { - if (ViewState["ShowAllUsers"] == null) + if (this.ViewState["ShowAllUsers"] == null) { return false; } - return Convert.ToBoolean(ViewState["ShowAllUsers"]); + return Convert.ToBoolean(this.ViewState["ShowAllUsers"]); } set { - ViewState["ShowAllUsers"] = value; + this.ViewState["ShowAllUsers"] = value; } } @@ -207,7 +207,7 @@ private DataTable dtRolesSelection { get { - return _dtRoleSelections; + return this._dtRoleSelections; } } @@ -215,11 +215,11 @@ private IList CurrentRoleSelection { get { - return _selectedRoles ?? (_selectedRoles = new List()); + return this._selectedRoles ?? (this._selectedRoles = new List()); } set { - _selectedRoles = value; + this._selectedRoles = value; } } @@ -232,9 +232,9 @@ private IList CurrentRoleSelection ///
    private void BindData() { - EnsureChildControls(); + this.EnsureChildControls(); - BindRolesGrid(); + this.BindRolesGrid(); } /// @@ -242,41 +242,41 @@ private void BindData() /// private void BindRolesGrid() { - dtRolesSelection.Columns.Clear(); - dtRolesSelection.Rows.Clear(); + this.dtRolesSelection.Columns.Clear(); + this.dtRolesSelection.Rows.Clear(); //Add Roles Column var col = new DataColumn("RoleId", typeof (string)); - dtRolesSelection.Columns.Add(col); + this.dtRolesSelection.Columns.Add(col); //Add Roles Column col = new DataColumn("RoleName", typeof (string)); - dtRolesSelection.Columns.Add(col); + this.dtRolesSelection.Columns.Add(col); //Add Selected Column col = new DataColumn("Selected", typeof (bool)); - dtRolesSelection.Columns.Add(col); + this.dtRolesSelection.Columns.Add(col); - GetRoles(); + this.GetRoles(); - UpdateRoleSelections(); - for (int i = 0; i <= _roles.Count - 1; i++) + this.UpdateRoleSelections(); + for (int i = 0; i <= this._roles.Count - 1; i++) { - var role = _roles[i]; - DataRow row = dtRolesSelection.NewRow(); + var role = this._roles[i]; + DataRow row = this.dtRolesSelection.NewRow(); row["RoleId"] = role.RoleID; row["RoleName"] = Localization.LocalizeRole(role.RoleName); - row["Selected"] = GetSelection(role.RoleName); + row["Selected"] = this.GetSelection(role.RoleName); - dtRolesSelection.Rows.Add(row); + this.dtRolesSelection.Rows.Add(row); } - dgRoleSelection.DataSource = dtRolesSelection; - dgRoleSelection.DataBind(); + this.dgRoleSelection.DataSource = this.dtRolesSelection; + this.dgRoleSelection.DataBind(); } private bool GetSelection(string roleName) { - return CurrentRoleSelection.Any(r => r == roleName); + return this.CurrentRoleSelection.Any(r => r == roleName); } /// @@ -285,27 +285,27 @@ private bool GetSelection(string roleName) private void GetRoles() { int roleGroupId = -2; - if ((cboRoleGroups != null) && (cboRoleGroups.SelectedValue != null)) + if ((this.cboRoleGroups != null) && (this.cboRoleGroups.SelectedValue != null)) { - roleGroupId = int.Parse(cboRoleGroups.SelectedValue); + roleGroupId = int.Parse(this.cboRoleGroups.SelectedValue); } - _roles = roleGroupId > -2 + this._roles = roleGroupId > -2 ? RoleController.Instance.GetRoles(PortalController.Instance.GetCurrentPortalSettings().PortalId, r => r.RoleGroupID == roleGroupId && r.SecurityMode != SecurityMode.SocialGroup && r.Status == RoleStatus.Approved) : RoleController.Instance.GetRoles(PortalController.Instance.GetCurrentPortalSettings().PortalId, r => r.SecurityMode != SecurityMode.SocialGroup && r.Status == RoleStatus.Approved); if (roleGroupId < 0) { - if (ShowUnauthenticatedUsers) + if (this.ShowUnauthenticatedUsers) { - _roles.Add(new RoleInfo { RoleID = int.Parse(Globals.glbRoleUnauthUser), RoleName = Globals.glbRoleUnauthUserName }); + this._roles.Add(new RoleInfo { RoleID = int.Parse(Globals.glbRoleUnauthUser), RoleName = Globals.glbRoleUnauthUserName }); } - if (ShowAllUsers) + if (this.ShowAllUsers) { - _roles.Add(new RoleInfo { RoleID = int.Parse(Globals.glbRoleAllUsers), RoleName = Globals.glbRoleAllUsersName }); + this._roles.Add(new RoleInfo { RoleID = int.Parse(Globals.glbRoleAllUsers), RoleName = Globals.glbRoleAllUsersName }); } } - _roles = _roles.OrderBy(r => r.RoleName).ToList(); + this._roles = this._roles.OrderBy(r => r.RoleName).ToList(); } /// @@ -313,19 +313,19 @@ private void GetRoles() /// private void SetUpRolesGrid() { - dgRoleSelection.Columns.Clear(); + this.dgRoleSelection.Columns.Clear(); var textCol = new BoundColumn {HeaderText = " ", DataField = "RoleName"}; textCol.ItemStyle.Width = Unit.Parse("150px"); - dgRoleSelection.Columns.Add(textCol); + this.dgRoleSelection.Columns.Add(textCol); var idCol = new BoundColumn {HeaderText = "", DataField = "roleid", Visible = false}; - dgRoleSelection.Columns.Add(idCol); + this.dgRoleSelection.Columns.Add(idCol); var checkCol = new TemplateColumn(); var columnTemplate = new CheckBoxColumnTemplate {DataField = "Selected"}; checkCol.ItemTemplate = columnTemplate; checkCol.HeaderText = Localization.GetString("SelectedRole"); checkCol.ItemStyle.HorizontalAlign = HorizontalAlign.Center; checkCol.HeaderStyle.Wrap = true; - dgRoleSelection.Columns.Add(checkCol); + this.dgRoleSelection.Columns.Add(checkCol); } #endregion @@ -353,7 +353,7 @@ protected override void LoadViewState(object savedState) if (myState[1] != null) { string state = Convert.ToString(myState[1]); - CurrentRoleSelection = state != string.Empty + this.CurrentRoleSelection = state != string.Empty ? new List(state.Split(new[] {"##"}, StringSplitOptions.None)) : new List(); } @@ -372,7 +372,7 @@ protected override object SaveViewState() //Persist the TabPermisisons var sb = new StringBuilder(); bool addDelimiter = false; - foreach (string role in CurrentRoleSelection) + foreach (string role in this.CurrentRoleSelection) { if (addDelimiter) { @@ -393,40 +393,40 @@ protected override object SaveViewState() /// protected override void CreateChildControls() { - pnlRoleSlections = new Panel {CssClass = "dnnRolesGrid"}; + this.pnlRoleSlections = new Panel {CssClass = "dnnRolesGrid"}; //Optionally Add Role Group Filter PortalSettings _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); ArrayList arrGroups = RoleController.GetRoleGroups(_portalSettings.PortalId); if (arrGroups.Count > 0) { - lblGroups = new Label {Text = Localization.GetString("RoleGroupFilter")}; - pnlRoleSlections.Controls.Add(lblGroups); + this.lblGroups = new Label {Text = Localization.GetString("RoleGroupFilter")}; + this.pnlRoleSlections.Controls.Add(this.lblGroups); - pnlRoleSlections.Controls.Add(new LiteralControl("  ")); + this.pnlRoleSlections.Controls.Add(new LiteralControl("  ")); - cboRoleGroups = new DropDownList {AutoPostBack = true}; + this.cboRoleGroups = new DropDownList {AutoPostBack = true}; - cboRoleGroups.Items.Add(new ListItem(Localization.GetString("AllRoles"), "-2")); + this.cboRoleGroups.Items.Add(new ListItem(Localization.GetString("AllRoles"), "-2")); var liItem = new ListItem(Localization.GetString("GlobalRoles"), "-1") {Selected = true}; - cboRoleGroups.Items.Add(liItem); + this.cboRoleGroups.Items.Add(liItem); foreach (RoleGroupInfo roleGroup in arrGroups) { - cboRoleGroups.Items.Add(new ListItem(roleGroup.RoleGroupName, roleGroup.RoleGroupID.ToString(CultureInfo.InvariantCulture))); + this.cboRoleGroups.Items.Add(new ListItem(roleGroup.RoleGroupName, roleGroup.RoleGroupID.ToString(CultureInfo.InvariantCulture))); } - pnlRoleSlections.Controls.Add(cboRoleGroups); + this.pnlRoleSlections.Controls.Add(this.cboRoleGroups); - pnlRoleSlections.Controls.Add(new LiteralControl("

    ")); + this.pnlRoleSlections.Controls.Add(new LiteralControl("

    ")); } - dgRoleSelection = new DataGrid {AutoGenerateColumns = false, CellSpacing = 0, GridLines = GridLines.None}; - dgRoleSelection.FooterStyle.CssClass = "dnnGridFooter"; - dgRoleSelection.HeaderStyle.CssClass = "dnnGridHeader"; - dgRoleSelection.ItemStyle.CssClass = "dnnGridItem"; - dgRoleSelection.AlternatingItemStyle.CssClass = "dnnGridAltItem"; - SetUpRolesGrid(); - pnlRoleSlections.Controls.Add(dgRoleSelection); - - Controls.Add(pnlRoleSlections); + this.dgRoleSelection = new DataGrid {AutoGenerateColumns = false, CellSpacing = 0, GridLines = GridLines.None}; + this.dgRoleSelection.FooterStyle.CssClass = "dnnGridFooter"; + this.dgRoleSelection.HeaderStyle.CssClass = "dnnGridHeader"; + this.dgRoleSelection.ItemStyle.CssClass = "dnnGridItem"; + this.dgRoleSelection.AlternatingItemStyle.CssClass = "dnnGridAltItem"; + this.SetUpRolesGrid(); + this.pnlRoleSlections.Controls.Add(this.dgRoleSelection); + + this.Controls.Add(this.pnlRoleSlections); } /// @@ -434,7 +434,7 @@ protected override void CreateChildControls() /// protected override void OnPreRender(EventArgs e) { - BindData(); + this.BindData(); } /// @@ -445,7 +445,7 @@ protected override void OnPreRender(EventArgs e) protected virtual void UpdateSelection(string roleName, bool Selected) { var isMatch = false; - foreach (string currentRoleName in CurrentRoleSelection) + foreach (string currentRoleName in this.CurrentRoleSelection) { if (currentRoleName == roleName) { @@ -453,7 +453,7 @@ protected virtual void UpdateSelection(string roleName, bool Selected) if (!Selected) { //Remove from collection as we only keep selected roles - CurrentRoleSelection.Remove(currentRoleName); + this.CurrentRoleSelection.Remove(currentRoleName); } isMatch = true; break; @@ -463,7 +463,7 @@ protected virtual void UpdateSelection(string roleName, bool Selected) //Rolename not found so add new if (!isMatch && Selected) { - CurrentRoleSelection.Add(roleName); + this.CurrentRoleSelection.Add(roleName); } } @@ -472,9 +472,9 @@ protected virtual void UpdateSelection(string roleName, bool Selected) /// protected void UpdateSelections() { - EnsureChildControls(); + this.EnsureChildControls(); - UpdateRoleSelections(); + this.UpdateRoleSelections(); } /// @@ -482,15 +482,15 @@ protected void UpdateSelections() /// protected void UpdateRoleSelections() { - if (dgRoleSelection != null) + if (this.dgRoleSelection != null) { - foreach (DataGridItem dgi in dgRoleSelection.Items) + foreach (DataGridItem dgi in this.dgRoleSelection.Items) { const int i = 2; if (dgi.Cells[i].Controls.Count > 0) { var cb = (CheckBox) dgi.Cells[i].Controls[0]; - UpdateSelection(dgi.Cells[0].Text, cb.Checked); + this.UpdateSelection(dgi.Cells[0].Text, cb.Checked); } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/TextColumn.cs b/DNN Platform/Library/UI/WebControls/DataGrids/TextColumn.cs index 043dac9ebae..e97e8a0fdc3 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/TextColumn.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/TextColumn.cs @@ -62,16 +62,16 @@ private TextColumnTemplate CreateTemplate(ListItemType type) var template = new TextColumnTemplate(type); if (type != ListItemType.Header) { - template.DataField = DataField; + template.DataField = this.DataField; } - template.Width = Width; + template.Width = this.Width; if (type == ListItemType.Header) { - template.Text = HeaderText; + template.Text = this.HeaderText; } else { - template.Text = Text; + template.Text = this.Text; } template.DesignMode = isDesignMode; return template; @@ -84,18 +84,18 @@ private TextColumnTemplate CreateTemplate(ListItemType type) /// ----------------------------------------------------------------------------- public override void Initialize() { - ItemTemplate = CreateTemplate(ListItemType.Item); - EditItemTemplate = CreateTemplate(ListItemType.EditItem); - HeaderTemplate = CreateTemplate(ListItemType.Header); + this.ItemTemplate = this.CreateTemplate(ListItemType.Item); + this.EditItemTemplate = this.CreateTemplate(ListItemType.EditItem); + this.HeaderTemplate = this.CreateTemplate(ListItemType.Header); if (HttpContext.Current == null) { - ItemStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; - ItemStyle.Font.Size = new FontUnit("10pt"); - ItemStyle.HorizontalAlign = HorizontalAlign.Left; - HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; - HeaderStyle.Font.Size = new FontUnit("10pt"); - HeaderStyle.Font.Bold = true; - HeaderStyle.HorizontalAlign = HorizontalAlign.Left; + this.ItemStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; + this.ItemStyle.Font.Size = new FontUnit("10pt"); + this.ItemStyle.HorizontalAlign = HorizontalAlign.Left; + this.HeaderStyle.Font.Names = new[] {"Tahoma, Verdana, Arial"}; + this.HeaderStyle.Font.Size = new FontUnit("10pt"); + this.HeaderStyle.Font.Bold = true; + this.HeaderStyle.HorizontalAlign = HorizontalAlign.Left; } } } diff --git a/DNN Platform/Library/UI/WebControls/DataGrids/TextColumnTemplate.cs b/DNN Platform/Library/UI/WebControls/DataGrids/TextColumnTemplate.cs index 639b6e59f59..ff4baabbd5a 100644 --- a/DNN Platform/Library/UI/WebControls/DataGrids/TextColumnTemplate.cs +++ b/DNN Platform/Library/UI/WebControls/DataGrids/TextColumnTemplate.cs @@ -39,7 +39,7 @@ public TextColumnTemplate() : this(ListItemType.Item) public TextColumnTemplate(ListItemType itemType) { - ItemType = itemType; + this.ItemType = itemType; } #endregion @@ -72,11 +72,11 @@ public ListItemType ItemType { get { - return mItemType; + return this.mItemType; } set { - mItemType = value; + this.mItemType = value; } } @@ -110,25 +110,25 @@ public ListItemType ItemType /// ----------------------------------------------------------------------------- public void InstantiateIn(Control container) { - switch (ItemType) + switch (this.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: case ListItemType.SelectedItem: var lblText = new Label(); - lblText.Width = Width; - lblText.DataBinding += Item_DataBinding; + lblText.Width = this.Width; + lblText.DataBinding += this.Item_DataBinding; container.Controls.Add(lblText); break; case ListItemType.EditItem: var txtText = new TextBox(); - txtText.Width = Width; - txtText.DataBinding += Item_DataBinding; + txtText.Width = this.Width; + txtText.DataBinding += this.Item_DataBinding; container.Controls.Add(txtText); break; case ListItemType.Footer: case ListItemType.Header: - container.Controls.Add(new LiteralControl(Text)); + container.Controls.Add(new LiteralControl(this.Text)); break; } } @@ -146,17 +146,17 @@ public void InstantiateIn(Control container) private string GetValue(DataGridItem container) { string itemValue = Null.NullString; - if (!String.IsNullOrEmpty(DataField)) + if (!String.IsNullOrEmpty(this.DataField)) { - if (DesignMode) + if (this.DesignMode) { - itemValue = "DataBound to " + DataField; + itemValue = "DataBound to " + this.DataField; } else { if (container.DataItem != null) { - object evaluation = DataBinder.Eval(container.DataItem, DataField); + object evaluation = DataBinder.Eval(container.DataItem, this.DataField); if ((evaluation != null)) { itemValue = evaluation.ToString(); @@ -180,19 +180,19 @@ private void Item_DataBinding(object sender, EventArgs e) { DataGridItem container; int keyValue = Null.NullInteger; - switch (ItemType) + switch (this.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: case ListItemType.SelectedItem: var lblText = (Label) sender; container = (DataGridItem) lblText.NamingContainer; - lblText.Text = GetValue(container); + lblText.Text = this.GetValue(container); break; case ListItemType.EditItem: var txtText = (TextBox) sender; container = (DataGridItem) txtText.NamingContainer; - txtText.Text = GetValue(container); + txtText.Text = this.GetValue(container); break; } } diff --git a/DNN Platform/Library/UI/WebControls/DualListBox.cs b/DNN Platform/Library/UI/WebControls/DualListBox.cs index 40ac27b104b..78536111848 100644 --- a/DNN Platform/Library/UI/WebControls/DualListBox.cs +++ b/DNN Platform/Library/UI/WebControls/DualListBox.cs @@ -36,10 +36,10 @@ public class DualListBox : WebControl, IPostBackEventHandler, IPostBackDataHandl public DualListBox() { - ShowAddButton = true; - ShowAddAllButton = true; - ShowRemoveButton = true; - ShowRemoveAllButton = true; + this.ShowAddButton = true; + this.ShowAddAllButton = true; + this.ShowRemoveButton = true; + this.ShowRemoveAllButton = true; } #region Public Properties @@ -112,7 +112,7 @@ public Style AvailableListBoxStyle { get { - return _AvailableListBoxStyle; + return this._AvailableListBoxStyle; } } @@ -128,7 +128,7 @@ public Style ButtonStyle { get { - return _ButtonStyle; + return this._ButtonStyle; } } @@ -144,7 +144,7 @@ public TableStyle ContainerStyle { get { - return _ContainerStyle; + return this._ContainerStyle; } } @@ -160,7 +160,7 @@ public Style HeaderStyle { get { - return _HeaderStyle; + return this._HeaderStyle; } } @@ -176,7 +176,7 @@ public Style SelectedListBoxStyle { get { - return _SelectedListBoxStyle; + return this._SelectedListBoxStyle; } } #endregion @@ -191,20 +191,20 @@ public bool LoadPostData(string postDataKey, NameValueCollection postCollection) string addItems = postCollection[postDataKey + "_Available"]; if (!string.IsNullOrEmpty(addItems)) { - _AddValues = new List(); + this._AddValues = new List(); foreach (string addItem in addItems.Split(',')) { - _AddValues.Add(addItem); + this._AddValues.Add(addItem); } retValue = true; } string removeItems = postCollection[postDataKey + "_Selected"]; if (!string.IsNullOrEmpty(removeItems)) { - _RemoveValues = new List(); + this._RemoveValues = new List(); foreach (string removeItem in removeItems.Split(',')) { - _RemoveValues.Add(removeItem); + this._RemoveValues.Add(removeItem); } retValue = true; } @@ -224,16 +224,16 @@ public void RaisePostBackEvent(string eventArgument) switch (eventArgument) { case "Add": - OnAddButtonClick(new DualListBoxEventArgs(_AddValues)); + this.OnAddButtonClick(new DualListBoxEventArgs(this._AddValues)); break; case "AddAll": - OnAddAllButtonClick(new EventArgs()); + this.OnAddAllButtonClick(new EventArgs()); break; case "Remove": - OnRemoveButtonClick(new DualListBoxEventArgs(_RemoveValues)); + this.OnRemoveButtonClick(new DualListBoxEventArgs(this._RemoveValues)); break; case "RemoveAll": - OnRemoveAllButtonClick(new EventArgs()); + this.OnRemoveAllButtonClick(new EventArgs()); break; } } @@ -264,8 +264,8 @@ private NameValueCollection GetList(string listType, object dataSource) foreach (object item in dataList) { BindingFlags bindings = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static; - PropertyInfo objTextProperty = item.GetType().GetProperty(DataTextField, bindings); - PropertyInfo objValueProperty = item.GetType().GetProperty(DataValueField, bindings); + PropertyInfo objTextProperty = item.GetType().GetProperty(this.DataTextField, bindings); + PropertyInfo objValueProperty = item.GetType().GetProperty(this.DataValueField, bindings); string objValue = Convert.ToString(objValueProperty.GetValue(item, null)); string objText = Convert.ToString(objTextProperty.GetValue(item, null)); @@ -288,40 +288,40 @@ private void RenderButton(string buttonType, HtmlTextWriter writer) switch (buttonType) { case "Add": - buttonText = string.IsNullOrEmpty(AddKey) - ? AddText - : Localization.GetString(AddKey, LocalResourceFile); - imageURL = AddImageURL; + buttonText = string.IsNullOrEmpty(this.AddKey) + ? this.AddText + : Localization.GetString(this.AddKey, this.LocalResourceFile); + imageURL = this.AddImageURL; break; case "AddAll": - buttonText = string.IsNullOrEmpty(AddAllKey) - ? AddAllText - : Localization.GetString(AddAllKey, LocalResourceFile); - imageURL = AddAllImageURL; + buttonText = string.IsNullOrEmpty(this.AddAllKey) + ? this.AddAllText + : Localization.GetString(this.AddAllKey, this.LocalResourceFile); + imageURL = this.AddAllImageURL; break; case "Remove": - buttonText = string.IsNullOrEmpty(RemoveKey) - ? RemoveText - : Localization.GetString(RemoveKey, LocalResourceFile); - imageURL = RemoveImageURL; + buttonText = string.IsNullOrEmpty(this.RemoveKey) + ? this.RemoveText + : Localization.GetString(this.RemoveKey, this.LocalResourceFile); + imageURL = this.RemoveImageURL; break; case "RemoveAll": - buttonText = string.IsNullOrEmpty(RemoveAllKey) - ? RemoveAllText - : Localization.GetString(RemoveAllKey, LocalResourceFile); - imageURL = RemoveAllImageURL; + buttonText = string.IsNullOrEmpty(this.RemoveAllKey) + ? this.RemoveAllText + : Localization.GetString(this.RemoveAllKey, this.LocalResourceFile); + imageURL = this.RemoveAllImageURL; break; } //Render Hyperlink - writer.AddAttribute(HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackEventReference(GetPostBackOptions(buttonType))); + writer.AddAttribute(HtmlTextWriterAttribute.Href, this.Page.ClientScript.GetPostBackEventReference(this.GetPostBackOptions(buttonType))); writer.AddAttribute(HtmlTextWriterAttribute.Title, buttonText); writer.RenderBeginTag(HtmlTextWriterTag.A); //Render Image if (!string.IsNullOrEmpty(imageURL)) { - writer.AddAttribute(HtmlTextWriterAttribute.Src, ResolveClientUrl(imageURL)); + writer.AddAttribute(HtmlTextWriterAttribute.Src, this.ResolveClientUrl(imageURL)); writer.AddAttribute(HtmlTextWriterAttribute.Title, buttonText); writer.AddAttribute(HtmlTextWriterAttribute.Border, "0"); writer.RenderBeginTag(HtmlTextWriterTag.Img); @@ -347,13 +347,13 @@ private void RenderButtons(HtmlTextWriter writer) //render table writer.RenderBeginTag(HtmlTextWriterTag.Table); - if (ShowAddButton) + if (this.ShowAddButton) { - RenderButton("Add", writer); + this.RenderButton("Add", writer); } - if (ShowAddAllButton) + if (this.ShowAddAllButton) { - RenderButton("AddAll", writer); + this.RenderButton("AddAll", writer); } //Begin Button Row @@ -370,13 +370,13 @@ private void RenderButtons(HtmlTextWriter writer) //Render end of Button Row writer.RenderEndTag(); - if (ShowRemoveButton) + if (this.ShowRemoveButton) { - RenderButton("Remove", writer); + this.RenderButton("Remove", writer); } - if (ShowRemoveAllButton) + if (this.ShowRemoveAllButton) { - RenderButton("RemoveAll", writer); + this.RenderButton("RemoveAll", writer); } //Render end of table @@ -387,7 +387,7 @@ private void RenderListBox(string listType, object dataSource, Style style, Html { if (dataSource != null) { - NameValueCollection list = GetList(listType, dataSource); + NameValueCollection list = this.GetList(listType, dataSource); if (list != null) { if (style != null) @@ -397,7 +397,7 @@ private void RenderListBox(string listType, object dataSource, Style style, Html //Render ListBox writer.AddAttribute(HtmlTextWriterAttribute.Multiple, "multiple"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID + "_" + listType); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "_" + listType); writer.RenderBeginTag(HtmlTextWriterTag.Select); for (int i = 0; i <= list.Count - 1; i++) { @@ -418,22 +418,22 @@ private void RenderHeader(HtmlTextWriter writer) { //render Header row writer.RenderBeginTag(HtmlTextWriterTag.Tr); - if (HeaderStyle != null) + if (this.HeaderStyle != null) { - HeaderStyle.AddAttributesToRender(writer); + this.HeaderStyle.AddAttributesToRender(writer); } writer.RenderBeginTag(HtmlTextWriterTag.Td); - writer.Write(Localization.GetString(ID + "_Available", LocalResourceFile)); + writer.Write(Localization.GetString(this.ID + "_Available", this.LocalResourceFile)); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.RenderEndTag(); - if (HeaderStyle != null) + if (this.HeaderStyle != null) { - HeaderStyle.AddAttributesToRender(writer); + this.HeaderStyle.AddAttributesToRender(writer); } writer.RenderBeginTag(HtmlTextWriterTag.Td); - writer.Write(Localization.GetString(ID + "_Selected", LocalResourceFile)); + writer.Write(Localization.GetString(this.ID + "_Selected", this.LocalResourceFile)); writer.RenderEndTag(); //Render end of Header Row @@ -446,15 +446,15 @@ private void RenderListBoxes(HtmlTextWriter writer) writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.RenderBeginTag(HtmlTextWriterTag.Td); - RenderListBox("Available", AvailableDataSource, AvailableListBoxStyle, writer); + this.RenderListBox("Available", this.AvailableDataSource, this.AvailableListBoxStyle, writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); - RenderButtons(writer); + this.RenderButtons(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); - RenderListBox("Selected", SelectedDataSource, SelectedListBoxStyle, writer); + this.RenderListBox("Selected", this.SelectedDataSource, this.SelectedListBoxStyle, writer); writer.RenderEndTag(); //Render end of List Boxes Row @@ -479,59 +479,59 @@ protected virtual PostBackOptions GetPostBackOptions(string argument) protected void OnAddButtonClick(DualListBoxEventArgs e) { - if (AddButtonClick != null) + if (this.AddButtonClick != null) { - AddButtonClick(this, e); + this.AddButtonClick(this, e); } } protected void OnAddAllButtonClick(EventArgs e) { - if (AddAllButtonClick != null) + if (this.AddAllButtonClick != null) { - AddAllButtonClick(this, e); + this.AddAllButtonClick(this, e); } } protected void OnRemoveButtonClick(DualListBoxEventArgs e) { - if (RemoveButtonClick != null) + if (this.RemoveButtonClick != null) { - RemoveButtonClick(this, e); + this.RemoveButtonClick(this, e); } } protected void OnRemoveAllButtonClick(EventArgs e) { - if (RemoveAllButtonClick != null) + if (this.RemoveAllButtonClick != null) { - RemoveAllButtonClick(this, e); + this.RemoveAllButtonClick(this, e); } } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Page != null) + if (this.Page != null) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } protected override void RenderContents(HtmlTextWriter writer) { //render table - if (ContainerStyle != null) + if (this.ContainerStyle != null) { - ContainerStyle.AddAttributesToRender(writer); + this.ContainerStyle.AddAttributesToRender(writer); } writer.RenderBeginTag(HtmlTextWriterTag.Table); //Render Header Row - RenderHeader(writer); + this.RenderHeader(writer); //Render ListBox row - RenderListBoxes(writer); + this.RenderListBoxes(writer); //Render end of table writer.RenderEndTag(); diff --git a/DNN Platform/Library/UI/WebControls/Events/DualListBoxEventArgs.cs b/DNN Platform/Library/UI/WebControls/Events/DualListBoxEventArgs.cs index 3937161a7a6..741033dbd70 100644 --- a/DNN Platform/Library/UI/WebControls/Events/DualListBoxEventArgs.cs +++ b/DNN Platform/Library/UI/WebControls/Events/DualListBoxEventArgs.cs @@ -33,7 +33,7 @@ public class DualListBoxEventArgs : EventArgs /// ----------------------------------------------------------------------------- public DualListBoxEventArgs(List items) { - Items = items; + this.Items = items; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/UI/WebControls/LanguageSelector.cs b/DNN Platform/Library/UI/WebControls/LanguageSelector.cs index 6498165a3e0..0cb05af0466 100644 --- a/DNN Platform/Library/UI/WebControls/LanguageSelector.cs +++ b/DNN Platform/Library/UI/WebControls/LanguageSelector.cs @@ -83,23 +83,23 @@ public LanguageSelectionMode SelectionMode { get { - if (ViewState["SelectionMode"] == null) + if (this.ViewState["SelectionMode"] == null) { return LanguageSelectionMode.Single; } else { - return (LanguageSelectionMode) ViewState["SelectionMode"]; + return (LanguageSelectionMode) this.ViewState["SelectionMode"]; } } set { - if (SelectionMode != value) + if (this.SelectionMode != value) { - ViewState["SelectionMode"] = value; - if (Controls.Count > 0) + this.ViewState["SelectionMode"] = value; + if (this.Controls.Count > 0) { - CreateChildControls(); //Recreate if already created + this.CreateChildControls(); //Recreate if already created } } } @@ -112,23 +112,23 @@ public LanguageSelectionObject SelectionObject { get { - if (ViewState["SelectionObject"] == null) + if (this.ViewState["SelectionObject"] == null) { return LanguageSelectionObject.SpecificCulture; } else { - return (LanguageSelectionObject) ViewState["SelectionObject"]; + return (LanguageSelectionObject) this.ViewState["SelectionObject"]; } } set { - if ((int) SelectionMode != (int) value) + if ((int) this.SelectionMode != (int) value) { - ViewState["SelectionObject"] = value; - if (Controls.Count > 0) + this.ViewState["SelectionObject"] = value; + if (this.Controls.Count > 0) { - CreateChildControls(); //Recreate if already created + this.CreateChildControls(); //Recreate if already created } } } @@ -141,23 +141,23 @@ public LanguageItemStyle ItemStyle { get { - if (ViewState["ItemStyle"] == null) + if (this.ViewState["ItemStyle"] == null) { return LanguageItemStyle.FlagAndCaption; } else { - return (LanguageItemStyle) ViewState["ItemStyle"]; + return (LanguageItemStyle) this.ViewState["ItemStyle"]; } } set { - if (ItemStyle != value) + if (this.ItemStyle != value) { - ViewState["ItemStyle"] = value; - if (Controls.Count > 0) + this.ViewState["ItemStyle"] = value; + if (this.Controls.Count > 0) { - CreateChildControls(); //Recreate if already created + this.CreateChildControls(); //Recreate if already created } } } @@ -170,23 +170,23 @@ public LanguageListDirection ListDirection { get { - if (ViewState["ListDirection"] == null) + if (this.ViewState["ListDirection"] == null) { return LanguageListDirection.Vertical; } else { - return (LanguageListDirection) ViewState["ListDirection"]; + return (LanguageListDirection) this.ViewState["ListDirection"]; } } set { - if (ListDirection != value) + if (this.ListDirection != value) { - ViewState["ListDirection"] = value; - if (Controls.Count > 0) + this.ViewState["ListDirection"] = value; + if (this.Controls.Count > 0) { - CreateChildControls(); //Recreate if already created + this.CreateChildControls(); //Recreate if already created } } } @@ -199,9 +199,9 @@ public string[] SelectedLanguages { get { - EnsureChildControls(); + this.EnsureChildControls(); var a = new ArrayList(); - if (GetCultures(SelectionObject == LanguageSelectionObject.SpecificCulture).Length < 2) + if (this.GetCultures(this.SelectionObject == LanguageSelectionObject.SpecificCulture).Length < 2) { //return single language PortalSettings _Settings = PortalController.Instance.GetCurrentPortalSettings(); @@ -213,18 +213,18 @@ public string[] SelectedLanguages else { //create list of selected languages - foreach (CultureInfo c in GetCultures(SelectionObject == LanguageSelectionObject.SpecificCulture)) + foreach (CultureInfo c in this.GetCultures(this.SelectionObject == LanguageSelectionObject.SpecificCulture)) { - if (SelectionMode == LanguageSelectionMode.Single) + if (this.SelectionMode == LanguageSelectionMode.Single) { - if (((RadioButton) pnlControl.FindControl("opt" + c.Name)).Checked) + if (((RadioButton) this.pnlControl.FindControl("opt" + c.Name)).Checked) { a.Add(c.Name); } } else { - if (((CheckBox) pnlControl.FindControl("chk" + c.Name)).Checked) + if (((CheckBox) this.pnlControl.FindControl("chk" + c.Name)).Checked) { a.Add(c.Name); } @@ -235,27 +235,27 @@ public string[] SelectedLanguages } set { - EnsureChildControls(); - if (SelectionMode == LanguageSelectionMode.Single && value.Length > 1) + this.EnsureChildControls(); + if (this.SelectionMode == LanguageSelectionMode.Single && value.Length > 1) { throw new ArgumentException("Selection mode 'single' cannot have more than one selected item."); } - foreach (CultureInfo c in GetCultures(SelectionObject == LanguageSelectionObject.SpecificCulture)) + foreach (CultureInfo c in this.GetCultures(this.SelectionObject == LanguageSelectionObject.SpecificCulture)) { - if (SelectionMode == LanguageSelectionMode.Single) + if (this.SelectionMode == LanguageSelectionMode.Single) { - ((RadioButton) pnlControl.FindControl("opt" + c.Name)).Checked = false; + ((RadioButton) this.pnlControl.FindControl("opt" + c.Name)).Checked = false; } else { - ((CheckBox) pnlControl.FindControl("chk" + c.Name)).Checked = false; + ((CheckBox) this.pnlControl.FindControl("chk" + c.Name)).Checked = false; } } foreach (string strLocale in value) { - if (SelectionMode == LanguageSelectionMode.Single) + if (this.SelectionMode == LanguageSelectionMode.Single) { - Control ctl = pnlControl.FindControl("opt" + strLocale); + Control ctl = this.pnlControl.FindControl("opt" + strLocale); if (ctl != null) { ((RadioButton) ctl).Checked = true; @@ -263,7 +263,7 @@ public string[] SelectedLanguages } else { - Control ctl = pnlControl.FindControl("chk" + strLocale); + Control ctl = this.pnlControl.FindControl("chk" + strLocale); if (ctl != null) { ((CheckBox) ctl).Checked = true; @@ -282,59 +282,59 @@ public string[] SelectedLanguages ///
    protected override void CreateChildControls() { - Controls.Clear(); - pnlControl = new Panel(); - pnlControl.CssClass = "dnnLangSelector"; + this.Controls.Clear(); + this.pnlControl = new Panel(); + this.pnlControl.CssClass = "dnnLangSelector"; - Controls.Add(pnlControl); - pnlControl.Controls.Add(new LiteralControl("
      ")); + this.Controls.Add(this.pnlControl); + this.pnlControl.Controls.Add(new LiteralControl("
        ")); - foreach (var c in GetCultures(SelectionObject == LanguageSelectionObject.SpecificCulture)) + foreach (var c in this.GetCultures(this.SelectionObject == LanguageSelectionObject.SpecificCulture)) { - pnlControl.Controls.Add(new LiteralControl("
      • ")); + this.pnlControl.Controls.Add(new LiteralControl("
      • ")); var lblLocale = new HtmlGenericControl("label"); - if (SelectionMode == LanguageSelectionMode.Single) + if (this.SelectionMode == LanguageSelectionMode.Single) { var optLocale = new RadioButton(); optLocale.ID = "opt" + c.Name; - optLocale.GroupName = pnlControl.ID + "_Locale"; + optLocale.GroupName = this.pnlControl.ID + "_Locale"; if (c.Name == Localization.SystemLocale) { optLocale.Checked = true; } - pnlControl.Controls.Add(optLocale); + this.pnlControl.Controls.Add(optLocale); lblLocale.Attributes["for"] = optLocale.ClientID; } else { var chkLocale = new CheckBox(); chkLocale.ID = "chk" + c.Name; - pnlControl.Controls.Add(chkLocale); + this.pnlControl.Controls.Add(chkLocale); lblLocale.Attributes["for"] = chkLocale.ClientID; } - pnlControl.Controls.Add(lblLocale); - if (ItemStyle != LanguageItemStyle.CaptionOnly) + this.pnlControl.Controls.Add(lblLocale); + if (this.ItemStyle != LanguageItemStyle.CaptionOnly) { var imgLocale = new Image(); - imgLocale.ImageUrl = ResolveUrl("~/images/Flags/" + c.Name + ".gif"); + imgLocale.ImageUrl = this.ResolveUrl("~/images/Flags/" + c.Name + ".gif"); imgLocale.AlternateText = c.DisplayName; imgLocale.Style["vertical-align"] = "middle"; lblLocale.Controls.Add(imgLocale); } - if (ItemStyle != LanguageItemStyle.FlagOnly) + if (this.ItemStyle != LanguageItemStyle.FlagOnly) { lblLocale.Controls.Add(new LiteralControl(" " + c.DisplayName)); } - pnlControl.Controls.Add(new LiteralControl("
      • ")); + this.pnlControl.Controls.Add(new LiteralControl("")); } - pnlControl.Controls.Add(new LiteralControl("
      ")); + this.pnlControl.Controls.Add(new LiteralControl("
    ")); //Hide if not more than one language - if (GetCultures(SelectionObject == LanguageSelectionObject.SpecificCulture).Length < 2) + if (this.GetCultures(this.SelectionObject == LanguageSelectionObject.SpecificCulture).Length < 2) { - Visible = false; + this.Visible = false; } } diff --git a/DNN Platform/Library/UI/WebControls/LiteralTemplate.cs b/DNN Platform/Library/UI/WebControls/LiteralTemplate.cs index f2e2dffc55a..b27901b6a30 100644 --- a/DNN Platform/Library/UI/WebControls/LiteralTemplate.cs +++ b/DNN Platform/Library/UI/WebControls/LiteralTemplate.cs @@ -17,25 +17,25 @@ public class LiteralTemplate : ITemplate public LiteralTemplate(string html) { - m_strHTML = html; + this.m_strHTML = html; } public LiteralTemplate(Control ctl) { - m_objControl = ctl; + this.m_objControl = ctl; } #region ITemplate Members public void InstantiateIn(Control container) { - if (m_objControl == null) + if (this.m_objControl == null) { - container.Controls.Add(new LiteralControl(m_strHTML)); + container.Controls.Add(new LiteralControl(this.m_strHTML)); } else { - container.Controls.Add(m_objControl); + container.Controls.Add(this.m_objControl); } } diff --git a/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataPageHierarchyData.cs b/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataPageHierarchyData.cs index 767a8235149..fb4825b62de 100644 --- a/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataPageHierarchyData.cs +++ b/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataPageHierarchyData.cs @@ -19,7 +19,7 @@ public class NavDataPageHierarchyData : IHierarchyData, INavigateUIData public NavDataPageHierarchyData(DNNNode obj) { - m_objNode = obj; + this.m_objNode = obj; } /// @@ -32,13 +32,13 @@ public virtual string ImageUrl { get { - if (String.IsNullOrEmpty(m_objNode.Image) || m_objNode.Image.StartsWith("/")) + if (String.IsNullOrEmpty(this.m_objNode.Image) || this.m_objNode.Image.StartsWith("/")) { - return m_objNode.Image; + return this.m_objNode.Image; } else { - return PortalController.Instance.GetCurrentPortalSettings().HomeDirectory + m_objNode.Image; + return PortalController.Instance.GetCurrentPortalSettings().HomeDirectory + this.m_objNode.Image; } } } @@ -55,7 +55,7 @@ public virtual bool HasChildren { get { - return m_objNode.HasNodes; + return this.m_objNode.HasNodes; } } @@ -69,7 +69,7 @@ public virtual string Path { get { - return GetValuePath(m_objNode); + return this.GetValuePath(this.m_objNode); } } @@ -83,7 +83,7 @@ public virtual object Item { get { - return m_objNode; + return this.m_objNode; } } @@ -109,9 +109,9 @@ public virtual string Type public virtual IHierarchicalEnumerable GetChildren() { var objNodes = new NavDataPageHierarchicalEnumerable(); - if (m_objNode != null) + if (this.m_objNode != null) { - foreach (DNNNode objNode in m_objNode.DNNNodes) + foreach (DNNNode objNode in this.m_objNode.DNNNodes) { objNodes.Add(new NavDataPageHierarchyData(objNode)); } @@ -126,9 +126,9 @@ public virtual IHierarchicalEnumerable GetChildren() /// public virtual IHierarchyData GetParent() { - if (m_objNode != null) + if (this.m_objNode != null) { - return new NavDataPageHierarchyData(m_objNode.ParentNode); + return new NavDataPageHierarchyData(this.m_objNode.ParentNode); } else { @@ -150,7 +150,7 @@ public virtual string Name { get { - return GetSafeValue(m_objNode.Text, ""); + return this.GetSafeValue(this.m_objNode.Text, ""); } } @@ -164,7 +164,7 @@ public virtual string Value { get { - return GetValuePath(m_objNode); + return this.GetValuePath(this.m_objNode); } } @@ -178,7 +178,7 @@ public virtual string NavigateUrl { get { - return GetSafeValue(m_objNode.NavigateURL, ""); + return this.GetSafeValue(this.m_objNode.NavigateURL, ""); } } @@ -192,7 +192,7 @@ public virtual string Description { get { - return GetSafeValue(m_objNode.ToolTip, ""); + return this.GetSafeValue(this.m_objNode.ToolTip, ""); } } @@ -200,7 +200,7 @@ public virtual string Description public override string ToString() { - return m_objNode.Text; + return this.m_objNode.Text; } /// @@ -231,14 +231,14 @@ private string GetSafeValue(string Value, string Def) private string GetValuePath(DNNNode objNode) { DNNNode objParent = objNode.ParentNode; - string strPath = GetSafeValue(objNode.Key, ""); + string strPath = this.GetSafeValue(objNode.Key, ""); do { if (objParent == null || objParent.Level == -1) { break; } - strPath = GetSafeValue(objParent.Key, "") + "\\" + strPath; + strPath = this.GetSafeValue(objParent.Key, "") + "\\" + strPath; objParent = objParent.ParentNode; } while (true); return strPath; diff --git a/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSource.cs b/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSource.cs index 9f8907e339c..65d8c4b62cd 100644 --- a/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSource.cs +++ b/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSource.cs @@ -20,8 +20,8 @@ public class NavDataSource : HierarchicalDataSourceControl protected override HierarchicalDataSourceView GetHierarchicalView(string viewPath) { - view = new NavDataSourceView(viewPath); - return view; + this.view = new NavDataSourceView(viewPath); + return this.view; } } } diff --git a/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSourceView.cs b/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSourceView.cs index 64aeb2a19a6..38fab51b9de 100644 --- a/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSourceView.cs +++ b/DNN Platform/Library/UI/WebControls/NavDataSource/NavDataSourceView.cs @@ -21,15 +21,15 @@ public NavDataSourceView(string viewPath) { if (String.IsNullOrEmpty(viewPath)) { - m_sKey = ""; + this.m_sKey = ""; } else if (viewPath.IndexOf("\\") > -1) { - m_sKey = viewPath.Substring(viewPath.LastIndexOf("\\") + 1); + this.m_sKey = viewPath.Substring(viewPath.LastIndexOf("\\") + 1); } else { - m_sKey = viewPath; + this.m_sKey = viewPath; } } @@ -37,11 +37,11 @@ public string Namespace { get { - return m_sNamespace; + return this.m_sNamespace; } set { - m_sNamespace = value; + this.m_sNamespace = value; } } @@ -57,10 +57,10 @@ public override IHierarchicalEnumerable Select() { var objPages = new NavDataPageHierarchicalEnumerable(); DNNNodeCollection objNodes; - objNodes = Navigation.GetNavigationNodes(m_sNamespace); - if (!String.IsNullOrEmpty(m_sKey)) + objNodes = Navigation.GetNavigationNodes(this.m_sNamespace); + if (!String.IsNullOrEmpty(this.m_sKey)) { - objNodes = objNodes.FindNodeByKey(m_sKey).DNNNodes; + objNodes = objNodes.FindNodeByKey(this.m_sKey).DNNNodes; } foreach (DNNNode objNode in objNodes) { diff --git a/DNN Platform/Library/UI/WebControls/PagingControl.cs b/DNN Platform/Library/UI/WebControls/PagingControl.cs index db3867aedb3..e9aa758b1e0 100644 --- a/DNN Platform/Library/UI/WebControls/PagingControl.cs +++ b/DNN Platform/Library/UI/WebControls/PagingControl.cs @@ -38,11 +38,11 @@ public string CSSClassLinkActive { get { - return String.IsNullOrEmpty(_CSSClassLinkActive) ? "" : _CSSClassLinkActive; + return String.IsNullOrEmpty(this._CSSClassLinkActive) ? "" : this._CSSClassLinkActive; } set { - _CSSClassLinkActive = value; + this._CSSClassLinkActive = value; } } @@ -51,11 +51,11 @@ public string CSSClassLinkInactive { get { - return String.IsNullOrEmpty(_CSSClassLinkInactive) ? "" : _CSSClassLinkInactive; + return String.IsNullOrEmpty(this._CSSClassLinkInactive) ? "" : this._CSSClassLinkInactive; } set { - _CSSClassLinkInactive = value; + this._CSSClassLinkInactive = value; } } @@ -64,11 +64,11 @@ public string CSSClassPagingStatus { get { - return String.IsNullOrEmpty(_CSSClassPagingStatus) ? "" : _CSSClassPagingStatus; + return String.IsNullOrEmpty(this._CSSClassPagingStatus) ? "" : this._CSSClassPagingStatus; } set { - _CSSClassPagingStatus = value; + this._CSSClassPagingStatus = value; } } @@ -79,11 +79,11 @@ public PagingControlMode Mode { get { - return _Mode; + return this._Mode; } set { - _Mode = value; + this._Mode = value; } } @@ -103,8 +103,8 @@ public PagingControlMode Mode public void RaisePostBackEvent(string eventArgument) { - CurrentPage = int.Parse(eventArgument.Replace("Page_", "")); - OnPageChanged(new EventArgs()); + this.CurrentPage = int.Parse(eventArgument.Replace("Page_", "")); + this.OnPageChanged(new EventArgs()); } #endregion @@ -116,46 +116,46 @@ private void BindPageNumbers(int TotalRecords, int RecordsPerPage) const int pageLinksPerPage = 10; if (TotalRecords < 1 || RecordsPerPage < 1) { - _totalPages = 1; + this._totalPages = 1; return; } - _totalPages = TotalRecords/RecordsPerPage >= 1 ? Convert.ToInt32(Math.Ceiling(Convert.ToDouble(TotalRecords)/RecordsPerPage)) : 0; - if (_totalPages > 0) + this._totalPages = TotalRecords/RecordsPerPage >= 1 ? Convert.ToInt32(Math.Ceiling(Convert.ToDouble(TotalRecords)/RecordsPerPage)) : 0; + if (this._totalPages > 0) { var ht = new DataTable(); ht.Columns.Add("PageNum"); DataRow tmpRow; var LowNum = 1; - var HighNum = Convert.ToInt32(_totalPages); + var HighNum = Convert.ToInt32(this._totalPages); double tmpNum; - tmpNum = CurrentPage - pageLinksPerPage/2; + tmpNum = this.CurrentPage - pageLinksPerPage/2; if (tmpNum < 1) { tmpNum = 1; } - if (CurrentPage > (pageLinksPerPage/2)) + if (this.CurrentPage > (pageLinksPerPage/2)) { LowNum = Convert.ToInt32(Math.Floor(tmpNum)); } - if (Convert.ToInt32(_totalPages) <= pageLinksPerPage) + if (Convert.ToInt32(this._totalPages) <= pageLinksPerPage) { - HighNum = Convert.ToInt32(_totalPages); + HighNum = Convert.ToInt32(this._totalPages); } else { HighNum = LowNum + pageLinksPerPage - 1; } - if (HighNum > Convert.ToInt32(_totalPages)) + if (HighNum > Convert.ToInt32(this._totalPages)) { - HighNum = Convert.ToInt32(_totalPages); + HighNum = Convert.ToInt32(this._totalPages); if (HighNum - LowNum < pageLinksPerPage) { LowNum = HighNum - pageLinksPerPage + 1; } } - if (HighNum > Convert.ToInt32(_totalPages)) + if (HighNum > Convert.ToInt32(this._totalPages)) { - HighNum = Convert.ToInt32(_totalPages); + HighNum = Convert.ToInt32(this._totalPages); } if (LowNum < 1) { @@ -168,21 +168,21 @@ private void BindPageNumbers(int TotalRecords, int RecordsPerPage) tmpRow["PageNum"] = i; ht.Rows.Add(tmpRow); } - PageNumbers.DataSource = ht; - PageNumbers.DataBind(); + this.PageNumbers.DataSource = ht; + this.PageNumbers.DataBind(); } } private string CreateURL(string CurrentPage) { - switch (Mode) + switch (this.Mode) { case PagingControlMode.URL: - return !String.IsNullOrEmpty(QuerystringParams) - ? (!String.IsNullOrEmpty(CurrentPage) ? TestableGlobals.Instance.NavigateURL(TabID, "", QuerystringParams, "currentpage=" + CurrentPage) : TestableGlobals.Instance.NavigateURL(TabID, "", QuerystringParams)) - : (!String.IsNullOrEmpty(CurrentPage) ? TestableGlobals.Instance.NavigateURL(TabID, "", "currentpage=" + CurrentPage) : TestableGlobals.Instance.NavigateURL(TabID)); + return !String.IsNullOrEmpty(this.QuerystringParams) + ? (!String.IsNullOrEmpty(CurrentPage) ? TestableGlobals.Instance.NavigateURL(this.TabID, "", this.QuerystringParams, "currentpage=" + CurrentPage) : TestableGlobals.Instance.NavigateURL(this.TabID, "", this.QuerystringParams)) + : (!String.IsNullOrEmpty(CurrentPage) ? TestableGlobals.Instance.NavigateURL(this.TabID, "", "currentpage=" + CurrentPage) : TestableGlobals.Instance.NavigateURL(this.TabID)); default: - return Page.ClientScript.GetPostBackClientHyperlink(this, "Page_" + CurrentPage, false); + return this.Page.ClientScript.GetPostBackClientHyperlink(this, "Page_" + CurrentPage, false); } } @@ -193,13 +193,13 @@ private string CreateURL(string CurrentPage) /// private string GetLink(int PageNum) { - if (PageNum == CurrentPage) + if (PageNum == this.CurrentPage) { - return CSSClassLinkInactive.Trim().Length > 0 ? "[" + PageNum + "]" : "[" + PageNum + "]"; + return this.CSSClassLinkInactive.Trim().Length > 0 ? "[" + PageNum + "]" : "[" + PageNum + "]"; } - return CSSClassLinkActive.Trim().Length > 0 - ? "" + PageNum + "" - : "" + PageNum + ""; + return this.CSSClassLinkActive.Trim().Length > 0 + ? "" + PageNum + "" + : "" + PageNum + ""; } /// @@ -209,13 +209,13 @@ private string GetLink(int PageNum) /// private string GetPreviousLink() { - return CurrentPage > 1 && _totalPages > 0 - ? (CSSClassLinkActive.Trim().Length > 0 - ? "" + + return this.CurrentPage > 1 && this._totalPages > 0 + ? (this.CSSClassLinkActive.Trim().Length > 0 + ? "" + Localization.GetString("Previous", Localization.SharedResourceFile) + "" - : "" + Localization.GetString("Previous", Localization.SharedResourceFile) + "") - : (CSSClassLinkInactive.Trim().Length > 0 - ? "" + Localization.GetString("Previous", Localization.SharedResourceFile) + "" + : "" + Localization.GetString("Previous", Localization.SharedResourceFile) + "") + : (this.CSSClassLinkInactive.Trim().Length > 0 + ? "" + Localization.GetString("Previous", Localization.SharedResourceFile) + "" : "" + Localization.GetString("Previous", Localization.SharedResourceFile) + ""); } @@ -226,13 +226,13 @@ private string GetPreviousLink() /// private string GetNextLink() { - return CurrentPage != _totalPages && _totalPages > 0 - ? (CSSClassLinkActive.Trim().Length > 0 - ? "" + Localization.GetString("Next", Localization.SharedResourceFile) + + return this.CurrentPage != this._totalPages && this._totalPages > 0 + ? (this.CSSClassLinkActive.Trim().Length > 0 + ? "" + Localization.GetString("Next", Localization.SharedResourceFile) + "" - : "" + Localization.GetString("Next", Localization.SharedResourceFile) + "") - : (CSSClassLinkInactive.Trim().Length > 0 - ? "" + Localization.GetString("Next", Localization.SharedResourceFile) + "" + : "" + Localization.GetString("Next", Localization.SharedResourceFile) + "") + : (this.CSSClassLinkInactive.Trim().Length > 0 + ? "" + Localization.GetString("Next", Localization.SharedResourceFile) + "" : "" + Localization.GetString("Next", Localization.SharedResourceFile) + ""); } @@ -243,14 +243,14 @@ private string GetNextLink() /// private string GetFirstLink() { - if (CurrentPage > 1 && _totalPages > 0) + if (this.CurrentPage > 1 && this._totalPages > 0) { - return CSSClassLinkActive.Trim().Length > 0 - ? "" + Localization.GetString("First", Localization.SharedResourceFile) + "" - : "" + Localization.GetString("First", Localization.SharedResourceFile) + ""; + return this.CSSClassLinkActive.Trim().Length > 0 + ? "" + Localization.GetString("First", Localization.SharedResourceFile) + "" + : "" + Localization.GetString("First", Localization.SharedResourceFile) + ""; } - return CSSClassLinkInactive.Trim().Length > 0 - ? "" + Localization.GetString("First", Localization.SharedResourceFile) + "" + return this.CSSClassLinkInactive.Trim().Length > 0 + ? "" + Localization.GetString("First", Localization.SharedResourceFile) + "" : "" + Localization.GetString("First", Localization.SharedResourceFile) + ""; } @@ -261,70 +261,70 @@ private string GetFirstLink() /// private string GetLastLink() { - if (CurrentPage != _totalPages && _totalPages > 0) + if (this.CurrentPage != this._totalPages && this._totalPages > 0) { - return CSSClassLinkActive.Trim().Length > 0 - ? "" + Localization.GetString("Last", Localization.SharedResourceFile) + "" - : "" + Localization.GetString("Last", Localization.SharedResourceFile) + ""; + return this.CSSClassLinkActive.Trim().Length > 0 + ? "" + Localization.GetString("Last", Localization.SharedResourceFile) + "" + : "" + Localization.GetString("Last", Localization.SharedResourceFile) + ""; } - return CSSClassLinkInactive.Trim().Length > 0 - ? "" + Localization.GetString("Last", Localization.SharedResourceFile) + "" + return this.CSSClassLinkInactive.Trim().Length > 0 + ? "" + Localization.GetString("Last", Localization.SharedResourceFile) + "" : "" + Localization.GetString("Last", Localization.SharedResourceFile) + ""; } protected override void CreateChildControls() { - tablePageNumbers = new Table(); - cellDisplayStatus = new TableCell(); - cellDisplayLinks = new TableCell(); + this.tablePageNumbers = new Table(); + this.cellDisplayStatus = new TableCell(); + this.cellDisplayLinks = new TableCell(); //cellDisplayStatus.CssClass = "Normal"; //cellDisplayLinks.CssClass = "Normal"; - tablePageNumbers.CssClass = String.IsNullOrEmpty(CssClass) ? "PagingTable" : CssClass; - var intRowIndex = tablePageNumbers.Rows.Add(new TableRow()); - PageNumbers = new Repeater(); + this.tablePageNumbers.CssClass = String.IsNullOrEmpty(this.CssClass) ? "PagingTable" : this.CssClass; + var intRowIndex = this.tablePageNumbers.Rows.Add(new TableRow()); + this.PageNumbers = new Repeater(); var I = new PageNumberLinkTemplate(this); - PageNumbers.ItemTemplate = I; - BindPageNumbers(TotalRecords, PageSize); - cellDisplayStatus.HorizontalAlign = HorizontalAlign.Left; + this.PageNumbers.ItemTemplate = I; + this.BindPageNumbers(this.TotalRecords, this.PageSize); + this.cellDisplayStatus.HorizontalAlign = HorizontalAlign.Left; //cellDisplayStatus.Width = new Unit("50%"); - cellDisplayLinks.HorizontalAlign = HorizontalAlign.Right; + this.cellDisplayLinks.HorizontalAlign = HorizontalAlign.Right; //cellDisplayLinks.Width = new Unit("50%"); - var intTotalPages = _totalPages; + var intTotalPages = this._totalPages; if (intTotalPages == 0) { intTotalPages = 1; } - var str = string.Format(Localization.GetString("Pages"), CurrentPage, intTotalPages); + var str = string.Format(Localization.GetString("Pages"), this.CurrentPage, intTotalPages); var lit = new LiteralControl(str); - cellDisplayStatus.Controls.Add(lit); - tablePageNumbers.Rows[intRowIndex].Cells.Add(cellDisplayStatus); - tablePageNumbers.Rows[intRowIndex].Cells.Add(cellDisplayLinks); + this.cellDisplayStatus.Controls.Add(lit); + this.tablePageNumbers.Rows[intRowIndex].Cells.Add(this.cellDisplayStatus); + this.tablePageNumbers.Rows[intRowIndex].Cells.Add(this.cellDisplayLinks); } protected void OnPageChanged(EventArgs e) { - if (PageChanged != null) + if (this.PageChanged != null) { - PageChanged(this, e); + this.PageChanged(this, e); } } protected override void Render(HtmlTextWriter output) { - if (PageNumbers == null) + if (this.PageNumbers == null) { - CreateChildControls(); + this.CreateChildControls(); } var str = new StringBuilder(); - str.Append(GetFirstLink() + "   "); - str.Append(GetPreviousLink() + "   "); + str.Append(this.GetFirstLink() + "   "); + str.Append(this.GetPreviousLink() + "   "); var result = new StringBuilder(1024); - PageNumbers.RenderControl(new HtmlTextWriter(new StringWriter(result))); + this.PageNumbers.RenderControl(new HtmlTextWriter(new StringWriter(result))); str.Append(result.ToString()); - str.Append(GetNextLink() + "   "); - str.Append(GetLastLink() + "   "); - cellDisplayLinks.Controls.Add(new LiteralControl(str.ToString())); - tablePageNumbers.RenderControl(output); + str.Append(this.GetNextLink() + "   "); + str.Append(this.GetLastLink() + "   "); + this.cellDisplayLinks.Controls.Add(new LiteralControl(str.ToString())); + this.tablePageNumbers.RenderControl(output); } #region Nested type: PageNumberLinkTemplate @@ -335,7 +335,7 @@ public class PageNumberLinkTemplate : ITemplate public PageNumberLinkTemplate(PagingControl ctlPagingControl) { - _PagingControl = ctlPagingControl; + this._PagingControl = ctlPagingControl; } #region ITemplate Members @@ -343,7 +343,7 @@ public PageNumberLinkTemplate(PagingControl ctlPagingControl) void ITemplate.InstantiateIn(Control container) { var l = new Literal(); - l.DataBinding += BindData; + l.DataBinding += this.BindData; container.Controls.Add(l); } @@ -355,7 +355,7 @@ private void BindData(object sender, EventArgs e) lc = (Literal) sender; RepeaterItem container; container = (RepeaterItem) lc.NamingContainer; - lc.Text = _PagingControl.GetLink(Convert.ToInt32(DataBinder.Eval(container.DataItem, "PageNum"))) + "  "; + lc.Text = this._PagingControl.GetLink(Convert.ToInt32(DataBinder.Eval(container.DataItem, "PageNum"))) + "  "; } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/CollectionEditorInfoAdapter.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/CollectionEditorInfoAdapter.cs index 2c5fddb7bf6..5f94d57050b 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/CollectionEditorInfoAdapter.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/CollectionEditorInfoAdapter.cs @@ -36,22 +36,22 @@ public class CollectionEditorInfoAdapter : IEditorInfoAdapter public CollectionEditorInfoAdapter(object dataSource, string name, string fieldName, Hashtable fieldNames) { - DataSource = dataSource; - FieldNames = fieldNames; - Name = name; + this.DataSource = dataSource; + this.FieldNames = fieldNames; + this.Name = name; } #region IEditorInfoAdapter Members public EditorInfo CreateEditControl() { - return GetEditorInfo(); + return this.GetEditorInfo(); } public bool UpdateValue(PropertyEditorEventArgs e) { - string NameDataField = Convert.ToString(FieldNames["Name"]); - string ValueDataField = Convert.ToString(FieldNames["Value"]); + string NameDataField = Convert.ToString(this.FieldNames["Name"]); + string ValueDataField = Convert.ToString(this.FieldNames["Value"]); PropertyInfo objProperty; string PropertyName = ""; bool changed = e.Changed; @@ -62,27 +62,27 @@ public bool UpdateValue(PropertyEditorEventArgs e) bool _IsDirty = Null.NullBoolean; //Get the Name Property - objProperty = DataSource.GetType().GetProperty(NameDataField); + objProperty = this.DataSource.GetType().GetProperty(NameDataField); if (objProperty != null) { - PropertyName = Convert.ToString(objProperty.GetValue(DataSource, null)); + PropertyName = Convert.ToString(objProperty.GetValue(this.DataSource, null)); //Do we have the item in the IEnumerable Collection being changed PropertyName = PropertyName.Replace(" ", "_"); if (PropertyName == name) { //Get the Value Property - objProperty = DataSource.GetType().GetProperty(ValueDataField); + objProperty = this.DataSource.GetType().GetProperty(ValueDataField); //Set the Value property to the new value if ((!(ReferenceEquals(newValue, oldValue))) || changed) { if (objProperty.PropertyType.FullName == "System.String") { - objProperty.SetValue(DataSource, stringValue, null); + objProperty.SetValue(this.DataSource, stringValue, null); } else { - objProperty.SetValue(DataSource, newValue, null); + objProperty.SetValue(this.DataSource, newValue, null); } _IsDirty = true; } @@ -93,25 +93,25 @@ public bool UpdateValue(PropertyEditorEventArgs e) public bool UpdateVisibility(PropertyEditorEventArgs e) { - string nameDataField = Convert.ToString(FieldNames["Name"]); - string dataField = Convert.ToString(FieldNames["ProfileVisibility"]); + string nameDataField = Convert.ToString(this.FieldNames["Name"]); + string dataField = Convert.ToString(this.FieldNames["ProfileVisibility"]); string name = e.Name; object newValue = e.Value; bool dirty = Null.NullBoolean; //Get the Name Property - PropertyInfo property = DataSource.GetType().GetProperty(nameDataField); + PropertyInfo property = this.DataSource.GetType().GetProperty(nameDataField); if (property != null) { - string propertyName = Convert.ToString(property.GetValue(DataSource, null)); + string propertyName = Convert.ToString(property.GetValue(this.DataSource, null)); //Do we have the item in the IEnumerable Collection being changed propertyName = propertyName.Replace(" ", "_"); if (propertyName == name) { //Get the Value Property - property = DataSource.GetType().GetProperty(dataField); + property = this.DataSource.GetType().GetProperty(dataField); //Set the Value property to the new value - property.SetValue(DataSource, newValue, null); + property.SetValue(this.DataSource, newValue, null); dirty = true; } } @@ -127,15 +127,15 @@ public bool UpdateVisibility(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- private EditorInfo GetEditorInfo() { - string CategoryDataField = Convert.ToString(FieldNames["Category"]); - string EditorDataField = Convert.ToString(FieldNames["Editor"]); - string NameDataField = Convert.ToString(FieldNames["Name"]); - string RequiredDataField = Convert.ToString(FieldNames["Required"]); - string TypeDataField = Convert.ToString(FieldNames["Type"]); - string ValidationExpressionDataField = Convert.ToString(FieldNames["ValidationExpression"]); - string ValueDataField = Convert.ToString(FieldNames["Value"]); - string VisibilityDataField = Convert.ToString(FieldNames["ProfileVisibility"]); - string MaxLengthDataField = Convert.ToString(FieldNames["Length"]); + string CategoryDataField = Convert.ToString(this.FieldNames["Category"]); + string EditorDataField = Convert.ToString(this.FieldNames["Editor"]); + string NameDataField = Convert.ToString(this.FieldNames["Name"]); + string RequiredDataField = Convert.ToString(this.FieldNames["Required"]); + string TypeDataField = Convert.ToString(this.FieldNames["Type"]); + string ValidationExpressionDataField = Convert.ToString(this.FieldNames["ValidationExpression"]); + string ValueDataField = Convert.ToString(this.FieldNames["Value"]); + string VisibilityDataField = Convert.ToString(this.FieldNames["ProfileVisibility"]); + string MaxLengthDataField = Convert.ToString(this.FieldNames["Length"]); var editInfo = new EditorInfo(); PropertyInfo property; @@ -144,10 +144,10 @@ private EditorInfo GetEditorInfo() editInfo.Name = string.Empty; if (!String.IsNullOrEmpty(NameDataField)) { - property = DataSource.GetType().GetProperty(NameDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(NameDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.Name = Convert.ToString(property.GetValue(DataSource, null)); + editInfo.Name = Convert.ToString(property.GetValue(this.DataSource, null)); } } @@ -157,10 +157,10 @@ private EditorInfo GetEditorInfo() //Get Category Field if (!String.IsNullOrEmpty(CategoryDataField)) { - property = DataSource.GetType().GetProperty(CategoryDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(CategoryDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.Category = Convert.ToString(property.GetValue(DataSource, null)); + editInfo.Category = Convert.ToString(property.GetValue(this.DataSource, null)); } } @@ -168,10 +168,10 @@ private EditorInfo GetEditorInfo() editInfo.Value = string.Empty; if (!String.IsNullOrEmpty(ValueDataField)) { - property = DataSource.GetType().GetProperty(ValueDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(ValueDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.Value = Convert.ToString(property.GetValue(DataSource, null)); + editInfo.Value = Convert.ToString(property.GetValue(this.DataSource, null)); } } @@ -179,10 +179,10 @@ private EditorInfo GetEditorInfo() editInfo.Type = "System.String"; if (!String.IsNullOrEmpty(TypeDataField)) { - property = DataSource.GetType().GetProperty(TypeDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(TypeDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.Type = Convert.ToString(property.GetValue(DataSource, null)); + editInfo.Type = Convert.ToString(property.GetValue(this.DataSource, null)); } } @@ -190,10 +190,10 @@ private EditorInfo GetEditorInfo() editInfo.Editor = "DotNetNuke.UI.WebControls.TextEditControl, DotNetNuke"; if (!String.IsNullOrEmpty(EditorDataField)) { - property = DataSource.GetType().GetProperty(EditorDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(EditorDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.Editor = EditorInfo.GetEditor(Convert.ToInt32(property.GetValue(DataSource, null))); + editInfo.Editor = EditorInfo.GetEditor(Convert.ToInt32(property.GetValue(this.DataSource, null))); } } @@ -204,16 +204,16 @@ private EditorInfo GetEditorInfo() editInfo.Required = false; if (!String.IsNullOrEmpty(RequiredDataField)) { - property = DataSource.GetType().GetProperty(RequiredDataField); - if (!((property == null) || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(RequiredDataField); + if (!((property == null) || (property.GetValue(this.DataSource, null) == null))) { - editInfo.Required = Convert.ToBoolean(property.GetValue(DataSource, null)); + editInfo.Required = Convert.ToBoolean(property.GetValue(this.DataSource, null)); } } //Set ResourceKey Field editInfo.ResourceKey = editInfo.Name; - editInfo.ResourceKey = string.Format("{0}_{1}", Name, editInfo.Name); + editInfo.ResourceKey = string.Format("{0}_{1}", this.Name, editInfo.Name); //Set Style editInfo.ControlStyle = new Style(); @@ -225,10 +225,10 @@ private EditorInfo GetEditorInfo() }; if (!String.IsNullOrEmpty(VisibilityDataField)) { - property = DataSource.GetType().GetProperty(VisibilityDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(VisibilityDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.ProfileVisibility = (ProfileVisibility)property.GetValue(DataSource, null); + editInfo.ProfileVisibility = (ProfileVisibility)property.GetValue(this.DataSource, null); } } @@ -236,20 +236,20 @@ private EditorInfo GetEditorInfo() editInfo.ValidationExpression = string.Empty; if (!String.IsNullOrEmpty(ValidationExpressionDataField)) { - property = DataSource.GetType().GetProperty(ValidationExpressionDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(ValidationExpressionDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - editInfo.ValidationExpression = Convert.ToString(property.GetValue(DataSource, null)); + editInfo.ValidationExpression = Convert.ToString(property.GetValue(this.DataSource, null)); } } //Get Length Field if (!String.IsNullOrEmpty(MaxLengthDataField)) { - property = DataSource.GetType().GetProperty(MaxLengthDataField); - if (!(property == null || (property.GetValue(DataSource, null) == null))) + property = this.DataSource.GetType().GetProperty(MaxLengthDataField); + if (!(property == null || (property.GetValue(this.DataSource, null) == null))) { - int length = Convert.ToInt32(property.GetValue(DataSource, null)); + int length = Convert.ToInt32(property.GetValue(this.DataSource, null)); var attributes = new object[1]; attributes[0] = new MaxLengthAttribute(length); editInfo.Attributes = attributes; diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/SettingsEditorInfoAdapter.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/SettingsEditorInfoAdapter.cs index 14adccd7f21..f3e09109f87 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/SettingsEditorInfoAdapter.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/SettingsEditorInfoAdapter.cs @@ -34,9 +34,9 @@ public class SettingsEditorInfoAdapter : IEditorInfoAdapter public SettingsEditorInfoAdapter(object dataSource, object dataMember, string fieldName) { - DataMember = dataMember; - DataSource = dataSource; - FieldName = fieldName; + this.DataMember = dataMember; + this.DataSource = dataSource; + this.FieldName = fieldName; } #region IEditorInfoAdapter Members @@ -44,7 +44,7 @@ public SettingsEditorInfoAdapter(object dataSource, object dataMember, string fi public EditorInfo CreateEditControl() { - var info = (SettingInfo) DataMember; + var info = (SettingInfo) this.DataMember; var editInfo = new EditorInfo(); //Get the Name of the property @@ -89,7 +89,7 @@ public bool UpdateValue(PropertyEditorEventArgs e) object stringValue = e.StringValue; bool _IsDirty = Null.NullBoolean; - var settings = (Hashtable) DataSource; + var settings = (Hashtable) this.DataSource; IDictionaryEnumerator settingsEnumerator = settings.GetEnumerator(); while (settingsEnumerator.MoveNext()) { diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/StandardEditorInfoAdapter.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/StandardEditorInfoAdapter.cs index 22e3dced3c3..5f028c1f135 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/StandardEditorInfoAdapter.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Adapters/StandardEditorInfoAdapter.cs @@ -34,8 +34,8 @@ public class StandardEditorInfoAdapter : IEditorInfoAdapter public StandardEditorInfoAdapter(object dataSource, string fieldName) { - DataSource = dataSource; - FieldName = fieldName; + this.DataSource = dataSource; + this.FieldName = fieldName; } #region IEditorInfoAdapter Members @@ -43,10 +43,10 @@ public StandardEditorInfoAdapter(object dataSource, string fieldName) public EditorInfo CreateEditControl() { EditorInfo editInfo = null; - PropertyInfo objProperty = GetProperty(DataSource, FieldName); + PropertyInfo objProperty = this.GetProperty(this.DataSource, this.FieldName); if (objProperty != null) { - editInfo = GetEditorInfo(DataSource, objProperty); + editInfo = this.GetEditorInfo(this.DataSource, objProperty); } return editInfo; } @@ -57,14 +57,14 @@ public bool UpdateValue(PropertyEditorEventArgs e) object oldValue = e.OldValue; object newValue = e.Value; bool _IsDirty = Null.NullBoolean; - if (DataSource != null) + if (this.DataSource != null) { - PropertyInfo objProperty = DataSource.GetType().GetProperty(e.Name); + PropertyInfo objProperty = this.DataSource.GetType().GetProperty(e.Name); if (objProperty != null) { if ((!(ReferenceEquals(newValue, oldValue))) || changed) { - objProperty.SetValue(DataSource, newValue, null); + objProperty.SetValue(this.DataSource, newValue, null); _IsDirty = true; } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/CollectionEditorControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/CollectionEditorControl.cs index 5511b1c9e4f..0d62dce4454 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/CollectionEditorControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/CollectionEditorControl.cs @@ -45,7 +45,7 @@ protected override IEnumerable UnderlyingDataSource { get { - return (IEnumerable)DataSource; + return (IEnumerable)this.DataSource; } } @@ -151,15 +151,15 @@ protected override IEnumerable UnderlyingDataSource private Hashtable GetFieldNames() { var fields = new Hashtable(); - fields.Add("Category", CategoryDataField); - fields.Add("Editor", EditorDataField); - fields.Add("Name", NameDataField); - fields.Add("Required", RequiredDataField); - fields.Add("Type", TypeDataField); - fields.Add("ValidationExpression", ValidationExpressionDataField); - fields.Add("Value", ValueDataField); - fields.Add("ProfileVisibility", VisibilityDataField); - fields.Add("Length", LengthDataField); + fields.Add("Category", this.CategoryDataField); + fields.Add("Editor", this.EditorDataField); + fields.Add("Name", this.NameDataField); + fields.Add("Required", this.RequiredDataField); + fields.Add("Type", this.TypeDataField); + fields.Add("ValidationExpression", this.ValidationExpressionDataField); + fields.Add("Value", this.ValueDataField); + fields.Add("ProfileVisibility", this.VisibilityDataField); + fields.Add("Length", this.LengthDataField); return fields; } @@ -170,17 +170,17 @@ private Hashtable GetFieldNames() protected override void AddEditorRow(Table table, object obj) { - AddEditorRow(table, NameDataField, new CollectionEditorInfoAdapter(obj, ID, NameDataField, GetFieldNames())); + this.AddEditorRow(table, this.NameDataField, new CollectionEditorInfoAdapter(obj, this.ID, this.NameDataField, this.GetFieldNames())); } protected override void AddEditorRow(Panel container, object obj) { - AddEditorRow(container, NameDataField, new CollectionEditorInfoAdapter(obj, ID, NameDataField, GetFieldNames())); + this.AddEditorRow(container, this.NameDataField, new CollectionEditorInfoAdapter(obj, this.ID, this.NameDataField, this.GetFieldNames())); } protected override void AddEditorRow(object obj) { - AddEditorRow(this, NameDataField, new CollectionEditorInfoAdapter(obj, ID, NameDataField, GetFieldNames())); + this.AddEditorRow(this, this.NameDataField, new CollectionEditorInfoAdapter(obj, this.ID, this.NameDataField, this.GetFieldNames())); } /// ----------------------------------------------------------------------------- @@ -194,9 +194,9 @@ protected override string GetCategory(object obj) string _Category = Null.NullString; //Get Category Field - if (!String.IsNullOrEmpty(CategoryDataField)) + if (!String.IsNullOrEmpty(this.CategoryDataField)) { - objProperty = obj.GetType().GetProperty(CategoryDataField); + objProperty = obj.GetType().GetProperty(this.CategoryDataField); if (!(objProperty == null || (objProperty.GetValue(obj, null) == null))) { _Category = Convert.ToString(objProperty.GetValue(obj, null)); @@ -218,9 +218,9 @@ protected override string[] GetGroups(IEnumerable arrObjects) foreach (object obj in arrObjects) { //Get Category Field - if (!String.IsNullOrEmpty(CategoryDataField)) + if (!String.IsNullOrEmpty(this.CategoryDataField)) { - objProperty = obj.GetType().GetProperty(CategoryDataField); + objProperty = obj.GetType().GetProperty(this.CategoryDataField); if (!((objProperty == null) || (objProperty.GetValue(obj, null) == null))) { string _Category = Convert.ToString(objProperty.GetValue(obj, null)); @@ -250,15 +250,15 @@ protected override bool GetRowVisibility(object obj) { bool isVisible = true; PropertyInfo objProperty; - objProperty = obj.GetType().GetProperty(VisibleDataField); + objProperty = obj.GetType().GetProperty(this.VisibleDataField); if (!(objProperty == null || (objProperty.GetValue(obj, null) == null))) { isVisible = Convert.ToBoolean(objProperty.GetValue(obj, null)); } - if (!isVisible && EditMode == PropertyEditorMode.Edit) + if (!isVisible && this.EditMode == PropertyEditorMode.Edit) { //Check if property is required - as this will need to override visibility - objProperty = obj.GetType().GetProperty(RequiredDataField); + objProperty = obj.GetType().GetProperty(this.RequiredDataField); if (!(objProperty == null || (objProperty.GetValue(obj, null) == null))) { isVisible = Convert.ToBoolean(objProperty.GetValue(obj, null)); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/AutoCompleteControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/AutoCompleteControl.cs index 8e9ac315e49..a0d74da4202 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/AutoCompleteControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/AutoCompleteControl.cs @@ -25,8 +25,8 @@ class AutoCompleteControl : TextEditControl public AutoCompleteControl() { - Init += AutoCompleteControl_Init; - Load += AutoCompleteControl_Load; + this.Init += this.AutoCompleteControl_Init; + this.Load += this.AutoCompleteControl_Load; } #endregion @@ -48,9 +48,9 @@ private void AutoCompleteControl_Load(object sender, System.EventArgs e) protected override void RenderEditMode(HtmlTextWriter writer) { int length = Null.NullInteger; - if ((CustomAttributes != null)) + if ((this.CustomAttributes != null)) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is MaxLengthAttribute) { @@ -60,16 +60,16 @@ protected override void RenderEditMode(HtmlTextWriter writer) } } } - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); - writer.AddAttribute(HtmlTextWriterAttribute.Value, StringValue); + writer.AddAttribute(HtmlTextWriterAttribute.Value, this.StringValue); if (length > Null.NullInteger) { writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, length.ToString()); } - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); - writer.AddAttribute("data-name", Name); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); + writer.AddAttribute("data-name", this.Name); writer.AddAttribute("data-pid", Entities.Portals.PortalSettings.Current.PortalId.ToString()); writer.AddAttribute("data-editor", "AutoCompleteControl"); writer.RenderBeginTag(HtmlTextWriterTag.Input); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/CheckEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/CheckEditControl.cs index 22d253d399c..f7ffdeb5ce9 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/CheckEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/CheckEditControl.cs @@ -29,7 +29,7 @@ public class CheckEditControl : TrueFalseEditControl { public CheckEditControl() { - SystemType = "System.Boolean"; + this.SystemType = "System.Boolean"; } public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) @@ -40,9 +40,9 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo { boolValue = true; } - if (!BooleanValue.Equals(boolValue)) + if (!this.BooleanValue.Equals(boolValue)) { - Value = boolValue; + this.Value = boolValue; return true; } return false; @@ -51,16 +51,16 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } protected override void RenderEditMode(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Type, "checkbox"); - if ((BooleanValue)) + if ((this.BooleanValue)) { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); writer.AddAttribute(HtmlTextWriterAttribute.Value, "1"); @@ -71,8 +71,8 @@ protected override void RenderEditMode(HtmlTextWriter writer) } writer.AddAttribute("onclick", "this.value = this.checked ? '1' : '';"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } @@ -80,7 +80,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) protected override void RenderViewMode(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Type, "checkbox"); - if ((BooleanValue)) + if ((this.BooleanValue)) { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryAutocompleteControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryAutocompleteControl.cs index ce7ded35a30..ede2bab0cdd 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryAutocompleteControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryAutocompleteControl.cs @@ -30,11 +30,11 @@ private TextBox CountryName { get { - if (_CountryName == null) + if (this._CountryName == null) { - _CountryName = new TextBox(); + this._CountryName = new TextBox(); } - return _CountryName; + return this._CountryName; } } @@ -43,11 +43,11 @@ private HiddenField CountryId { get { - if (_CountryId == null) + if (this._CountryId == null) { - _CountryId = new HiddenField(); + this._CountryId = new HiddenField(); } - return _CountryId; + return this._CountryId; } } @@ -55,8 +55,8 @@ public override string EditControlClientId { get { - EnsureChildControls(); - return CountryName.ClientID; + this.EnsureChildControls(); + return this.CountryName.ClientID; } } @@ -68,9 +68,9 @@ protected override string StringValue get { string strValue = Null.NullString; - if (Value != null) + if (this.Value != null) { - strValue = Convert.ToString(Value); + strValue = Convert.ToString(this.Value); } return strValue; } @@ -79,29 +79,29 @@ protected override string StringValue protected string OldStringValue { - get { return Convert.ToString(OldValue); } + get { return Convert.ToString(this.OldValue); } } #endregion #region " Constructors " public DnnCountryAutocompleteControl() { - Init += DnnCountryRegionControl_Init; + this.Init += this.DnnCountryRegionControl_Init; } public DnnCountryAutocompleteControl(string type) { - Init += DnnCountryRegionControl_Init; - SystemType = type; + this.Init += this.DnnCountryRegionControl_Init; + this.SystemType = type; } #endregion #region " Overrides " protected override void OnDataChanged(EventArgs e) { - PropertyEditorEventArgs args = new PropertyEditorEventArgs(Name); - args.Value = StringValue; - args.OldValue = OldStringValue; - args.StringValue = StringValue; + PropertyEditorEventArgs args = new PropertyEditorEventArgs(this.Name); + args.Value = this.StringValue; + args.OldValue = this.OldStringValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -109,28 +109,28 @@ protected override void CreateChildControls() { base.CreateChildControls(); - CountryName.ControlStyle.CopyFrom(ControlStyle); - CountryName.ID = ID + "_name"; - CountryName.Attributes.Add("data-name", Name); - CountryName.Attributes.Add("data-list", "Country"); - CountryName.Attributes.Add("data-category", Category); - CountryName.Attributes.Add("data-editor", "DnnCountryAutocompleteControl"); - CountryName.Attributes.Add("data-required", Required.ToString().ToLowerInvariant()); - Controls.Add(CountryName); + this.CountryName.ControlStyle.CopyFrom(this.ControlStyle); + this.CountryName.ID = this.ID + "_name"; + this.CountryName.Attributes.Add("data-name", this.Name); + this.CountryName.Attributes.Add("data-list", "Country"); + this.CountryName.Attributes.Add("data-category", this.Category); + this.CountryName.Attributes.Add("data-editor", "DnnCountryAutocompleteControl"); + this.CountryName.Attributes.Add("data-required", this.Required.ToString().ToLowerInvariant()); + this.Controls.Add(this.CountryName); - CountryId.ID = ID + "_id"; - Controls.Add(CountryId); + this.CountryId.ID = this.ID + "_id"; + this.Controls.Add(this.CountryId); } public override bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection) { bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "_id"]; if (!presentValue.Equals(postedValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } return dataChanged; @@ -140,19 +140,19 @@ protected override void OnPreRender(System.EventArgs e) { base.OnPreRender(e); - LoadControls(); + this.LoadControls(); - if (Page != null & EditMode == PropertyEditorMode.Edit) + if (this.Page != null & this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); - Page.RegisterRequiresPostBack(CountryId); + this.Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this.CountryId); } } protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } #endregion @@ -172,19 +172,19 @@ private void DnnCountryRegionControl_Init(object sender, System.EventArgs e) private void LoadControls() { - CountryName.Text = StringValue; + this.CountryName.Text = this.StringValue; int countryId = -1; - string countryCode = StringValue; - if (!string.IsNullOrEmpty(StringValue) && int.TryParse(StringValue, out countryId)) + string countryCode = this.StringValue; + if (!string.IsNullOrEmpty(this.StringValue) && int.TryParse(this.StringValue, out countryId)) { var listController = new ListController(); var c = listController.GetListEntryInfo(countryId); - CountryName.Text = c.Text; + this.CountryName.Text = c.Text; countryCode = c.Value; } - CountryId.Value = StringValue; + this.CountryId.Value = this.StringValue; - var regionControl2 = ControlUtilities.FindFirstDescendent(Page, c => IsCoupledRegionControl(c)); + var regionControl2 = ControlUtilities.FindFirstDescendent(this.Page, c => this.IsCoupledRegionControl(c)); if (regionControl2 != null) { regionControl2.ParentKey = "Country." + countryCode; diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryEditControl.cs index 39ec3e4d581..672518048b7 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNCountryEditControl.cs @@ -33,18 +33,18 @@ public class DNNCountryEditControl : DNNListEditControl /// ----------------------------------------------------------------------------- public DNNCountryEditControl() { - AutoPostBack = true; - ListName = "Country"; - ParentKey = ""; - TextField = ListBoundField.Text; - ValueField = ListBoundField.Id; - ItemChanged += OnItemChanged; - SortAlphabetically = true; + this.AutoPostBack = true; + this.ListName = "Country"; + this.ParentKey = ""; + this.TextField = ListBoundField.Text; + this.ValueField = ListBoundField.Id; + this.ItemChanged += this.OnItemChanged; + this.SortAlphabetically = true; } void OnItemChanged(object sender, PropertyEditorEventArgs e) { - var regionContainer = ControlUtilities.FindControl(Parent, "Region", true); + var regionContainer = ControlUtilities.FindControl(this.Parent, "Region", true); if (regionContainer != null) { var regionControl = ControlUtilities.FindFirstDescendent(regionContainer); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNListEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNListEditControl.cs index 5d75eb5dac0..a87df16f7f1 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNListEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNListEditControl.cs @@ -40,10 +40,10 @@ public class DNNListEditControl : EditControl, IPostBackEventHandler public DNNListEditControl() { - ValueField = ListBoundField.Value; - TextField = ListBoundField.Text; - ParentKey = ""; - SortAlphabetically = false; + this.ValueField = ListBoundField.Value; + this.TextField = ListBoundField.Text; + this.ParentKey = ""; + this.SortAlphabetically = false; } /// ----------------------------------------------------------------------------- @@ -73,13 +73,13 @@ protected int IntegerValue get { int intValue = Null.NullInteger; - if (Value == null || string.IsNullOrEmpty((string)Value)) + if (this.Value == null || string.IsNullOrEmpty((string)this.Value)) { return intValue; } try { - intValue = Convert.ToInt32(Value); + intValue = Convert.ToInt32(this.Value); } catch (Exception exc) { @@ -99,7 +99,7 @@ protected ListEntryInfoCollection List get { var listController = new ListController(); - return listController.GetListEntryInfoCollection(ListName, ParentKey, PortalId); + return listController.GetListEntryInfoCollection(this.ListName, this.ParentKey, this.PortalId); } } @@ -110,20 +110,20 @@ protected IEnumerable ListEntries { get { - if(_listEntries == null) + if(this._listEntries == null) { var listController = new ListController(); - if (SortAlphabetically) + if (this.SortAlphabetically) { - _listEntries = listController.GetListEntryInfoItems(ListName, ParentKey, PortalId).OrderBy(s => s.SortOrder).ThenBy(s => s.Text).ToList(); + this._listEntries = listController.GetListEntryInfoItems(this.ListName, this.ParentKey, this.PortalId).OrderBy(s => s.SortOrder).ThenBy(s => s.Text).ToList(); } else { - _listEntries = listController.GetListEntryInfoItems(ListName, ParentKey, PortalId).ToList(); + this._listEntries = listController.GetListEntryInfoItems(this.ListName, this.ParentKey, this.PortalId).ToList(); } } - return _listEntries; + return this._listEntries; } } @@ -137,15 +137,15 @@ protected virtual string ListName { get { - if (_listName == Null.NullString) + if (this._listName == Null.NullString) { - _listName = DataField; + this._listName = this.DataField; } - return _listName; + return this._listName; } set { - _listName = value; + this._listName = value; } } @@ -160,14 +160,14 @@ protected int OldIntegerValue get { int intValue = Null.NullInteger; - if (OldValue == null || string.IsNullOrEmpty(OldValue.ToString())) + if (this.OldValue == null || string.IsNullOrEmpty(this.OldValue.ToString())) { return intValue; } try { //Try and cast the value to an Integer - intValue = Convert.ToInt32(OldValue); + intValue = Convert.ToInt32(this.OldValue); } catch (Exception exc) { @@ -211,7 +211,7 @@ protected string OldStringValue { get { - return Convert.ToString(OldValue); + return Convert.ToString(this.OldValue); } } @@ -225,19 +225,19 @@ protected override string StringValue { get { - return Convert.ToString(Value); + return Convert.ToString(this.Value); } set { - if (ValueField == ListBoundField.Id) + if (this.ValueField == ListBoundField.Id) { //Integer type field - Value = Int32.Parse(value); + this.Value = Int32.Parse(value); } else { //String type Field - Value = value; + this.Value = value; } } } @@ -248,9 +248,9 @@ protected override string StringValue public void RaisePostBackEvent(string eventArgument) { - if (AutoPostBack) + if (this.AutoPostBack) { - OnItemChanged(GetEventArgs()); + this.OnItemChanged(this.GetEventArgs()); } } @@ -262,20 +262,20 @@ public void RaisePostBackEvent(string eventArgument) private PropertyEditorEventArgs GetEventArgs() { - var args = new PropertyEditorEventArgs(Name); - if (ValueField == ListBoundField.Id) + var args = new PropertyEditorEventArgs(this.Name); + if (this.ValueField == ListBoundField.Id) { //This is an Integer Value - args.Value = IntegerValue; - args.OldValue = OldIntegerValue; + args.Value = this.IntegerValue; + args.OldValue = this.OldIntegerValue; } else { //This is a String Value - args.Value = StringValue; - args.OldValue = OldStringValue; + args.Value = this.StringValue; + args.OldValue = this.OldStringValue; } - args.StringValue = StringValue; + args.StringValue = this.StringValue; return args; } @@ -291,17 +291,17 @@ private PropertyEditorEventArgs GetEventArgs() protected override void OnAttributesChanged() { //Get the List settings out of the "Attributes" - if ((CustomAttributes != null)) + if ((this.CustomAttributes != null)) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is ListAttribute) { var listAtt = (ListAttribute) attribute; - ListName = listAtt.ListName; - ParentKey = listAtt.ParentKey; - TextField = listAtt.TextField; - ValueField = listAtt.ValueField; + this.ListName = listAtt.ListName; + this.ParentKey = listAtt.ParentKey; + this.TextField = listAtt.TextField; + this.ValueField = listAtt.ValueField; break; } } @@ -316,7 +316,7 @@ protected override void OnAttributesChanged() /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - base.OnValueChanged(GetEventArgs()); + base.OnValueChanged(this.GetEventArgs()); } /// ----------------------------------------------------------------------------- @@ -326,9 +326,9 @@ protected override void OnDataChanged(EventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnItemChanged(PropertyEditorEventArgs e) { - if (ItemChanged != null) + if (this.ItemChanged != null) { - ItemChanged(this, e); + this.ItemChanged(this, e); } } @@ -343,23 +343,23 @@ protected override void RenderViewMode(HtmlTextWriter writer) var objListController = new ListController(); ListEntryInfo entry = null; string entryText = Null.NullString; - switch (ValueField) + switch (this.ValueField) { case ListBoundField.Id: - entry = objListController.GetListEntryInfo(ListName, Convert.ToInt32(Value)); + entry = objListController.GetListEntryInfo(this.ListName, Convert.ToInt32(this.Value)); break; case ListBoundField.Text: - entryText = StringValue; + entryText = this.StringValue; break; case ListBoundField.Value: - entry = objListController.GetListEntryInfo(ListName, StringValue); + entry = objListController.GetListEntryInfo(this.ListName, this.StringValue); break; } - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); if (entry != null) { - switch (TextField) + switch (this.TextField) { case ListBoundField.Id: writer.Write(entry.EntryID.ToString()); @@ -390,21 +390,21 @@ protected override void RenderViewMode(HtmlTextWriter writer) protected override void RenderEditMode(HtmlTextWriter writer) { //Render the Select Tag - ControlStyle.AddAttributesToRender(writer); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); - writer.AddAttribute("data-name", Name); - writer.AddAttribute("data-list", ListName); - writer.AddAttribute("data-category", Category); + this.ControlStyle.AddAttributesToRender(writer); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); + writer.AddAttribute("data-name", this.Name); + writer.AddAttribute("data-list", this.ListName); + writer.AddAttribute("data-category", this.Category); writer.AddAttribute("data-editor", "DNNListEditControl"); - if (AutoPostBack) + if (this.AutoPostBack) { - writer.AddAttribute(HtmlTextWriterAttribute.Onchange, Page.ClientScript.GetPostBackEventReference(this, ID)); + writer.AddAttribute(HtmlTextWriterAttribute.Onchange, this.Page.ClientScript.GetPostBackEventReference(this, this.ID)); } writer.RenderBeginTag(HtmlTextWriterTag.Select); //Add the Not Specified Option - if (ValueField == ListBoundField.Text) + if (this.ValueField == ListBoundField.Text) { writer.AddAttribute(HtmlTextWriterAttribute.Value, Null.NullString); } @@ -412,7 +412,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Value, Null.NullString); } - if (StringValue == Null.NullString) + if (this.StringValue == Null.NullString) { //Add the Selected Attribute writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); @@ -423,12 +423,12 @@ protected override void RenderEditMode(HtmlTextWriter writer) writer.Write(defaultText); writer.RenderEndTag(); - foreach (ListEntryInfo item in ListEntries) + foreach (ListEntryInfo item in this.ListEntries) { string itemValue = Null.NullString; //Add the Value Attribute - switch (ValueField) + switch (this.ValueField) { case ListBoundField.Id: itemValue = item.EntryID.ToString(); @@ -441,7 +441,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) break; } writer.AddAttribute(HtmlTextWriterAttribute.Value, itemValue); - if (StringValue == itemValue) + if (this.StringValue == itemValue) { //Add the Selected Attribute writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); @@ -449,7 +449,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Render Option Tag writer.RenderBeginTag(HtmlTextWriterTag.Option); - switch (TextField) + switch (this.TextField) { case ListBoundField.Id: writer.Write(item.EntryID.ToString()); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNLocaleEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNLocaleEditControl.cs index db4bfcae950..29762cd1f37 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNLocaleEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNLocaleEditControl.cs @@ -32,7 +32,7 @@ protected LanguagesListType ListType { get { - return _ListType; + return this._ListType; } } @@ -40,7 +40,7 @@ protected string DisplayMode { get { - return _DisplayMode; + return this._DisplayMode; } } @@ -56,27 +56,27 @@ protected PortalSettings PortalSettings public void RaisePostBackEvent(string eventArgument) { - _DisplayMode = eventArgument; + this._DisplayMode = eventArgument; } #endregion private bool IsSelected(string locale) { - return locale == StringValue; + return locale == this.StringValue; } private void RenderModeButtons(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio"); writer.AddAttribute("aria-label", "Mode"); - if (DisplayMode == "English") + if (this.DisplayMode == "English") { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); } else { - writer.AddAttribute(HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackEventReference(this, "English")); + writer.AddAttribute(HtmlTextWriterAttribute.Onclick, this.Page.ClientScript.GetPostBackEventReference(this, "English")); } writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); @@ -85,13 +85,13 @@ private void RenderModeButtons(HtmlTextWriter writer) writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio"); writer.AddAttribute("aria-label", "Mode"); - if (DisplayMode == "Native") + if (this.DisplayMode == "Native") { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); } else { - writer.AddAttribute(HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackEventReference(this, "Native")); + writer.AddAttribute(HtmlTextWriterAttribute.Onclick, this.Page.ClientScript.GetPostBackEventReference(this, "Native")); } writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); @@ -103,7 +103,7 @@ private void RenderOption(HtmlTextWriter writer, CultureInfo culture) { string localeName; - if (DisplayMode == "Native") + if (this.DisplayMode == "Native") { localeName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(culture.NativeName); } @@ -115,7 +115,7 @@ private void RenderOption(HtmlTextWriter writer, CultureInfo culture) //Add the Value Attribute writer.AddAttribute(HtmlTextWriterAttribute.Value, culture.Name); - if (IsSelected(culture.Name)) + if (this.IsSelected(culture.Name)) { writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); } @@ -134,14 +134,14 @@ private void RenderOption(HtmlTextWriter writer, CultureInfo culture) protected override void OnAttributesChanged() { //Get the List settings out of the "Attributes" - if ((CustomAttributes != null)) + if ((this.CustomAttributes != null)) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { var listAtt = attribute as LanguagesListTypeAttribute; if (listAtt != null) { - _ListType = listAtt.ListType; + this._ListType = listAtt.ListType; break; } } @@ -154,9 +154,9 @@ protected override void OnAttributesChanged() /// A HtmlTextWriter. protected override void RenderViewMode(HtmlTextWriter writer) { - Locale locale = LocaleController.Instance.GetLocale(StringValue); + Locale locale = LocaleController.Instance.GetLocale(this.StringValue); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Div); if (locale != null) { @@ -176,11 +176,11 @@ protected override void RenderEditMode(HtmlTextWriter writer) writer.RenderBeginTag(HtmlTextWriterTag.Div); IList cultures = new List(); - switch (ListType) + switch (this.ListType) { case LanguagesListType.All: var culturesArray = CultureInfo.GetCultures(CultureTypes.SpecificCultures); - Array.Sort(culturesArray, new CultureInfoComparer(DisplayMode)); + Array.Sort(culturesArray, new CultureInfoComparer(this.DisplayMode)); cultures = culturesArray.ToList(); break; case LanguagesListType.Supported: @@ -189,17 +189,17 @@ protected override void RenderEditMode(HtmlTextWriter writer) .ToList(); break; case LanguagesListType.Enabled: - cultures = LocaleController.Instance.GetLocales(PortalSettings.PortalId).Values + cultures = LocaleController.Instance.GetLocales(this.PortalSettings.PortalId).Values .Select(c => CultureInfo.GetCultureInfo(c.Code)) .ToList(); break; } - var promptValue = StringValue == Null.NullString && cultures.Count > 1 && !Required; + var promptValue = this.StringValue == Null.NullString && cultures.Count > 1 && !this.Required; //Render the Select Tag - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); if (promptValue) { writer.AddAttribute(HtmlTextWriterAttribute.Onchange, "onLocaleChanged(this)"); @@ -210,7 +210,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Add the Value Attribute writer.AddAttribute(HtmlTextWriterAttribute.Value, Null.NullString); - if (StringValue == Null.NullString) + if (this.StringValue == Null.NullString) { //Add the Selected Attribute writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); @@ -221,7 +221,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) foreach (var culture in cultures) { - RenderOption(writer, culture); + this.RenderOption(writer, culture); } //Close Select Tag @@ -257,7 +257,7 @@ function onLocaleChanged(element){ writer.RenderBeginTag(HtmlTextWriterTag.Span); //Render Button Row - RenderModeButtons(writer); + this.RenderModeButtons(writer); //close span writer.RenderEndTag(); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNPageEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNPageEditControl.cs index 2d7ec2fcfe2..6a14f5b265f 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNPageEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNPageEditControl.cs @@ -47,8 +47,8 @@ protected override void RenderEditMode(HtmlTextWriter writer) List listTabs = TabController.GetPortalTabs(_portalSettings.PortalId, Null.NullInteger, true, "<" + Localization.GetString("None_Specified") + ">", true, false, true, true, false); //Render the Select Tag - ControlStyle.AddAttributesToRender(writer); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + this.ControlStyle.AddAttributesToRender(writer); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Select); for (int tabIndex = 0; tabIndex <= listTabs.Count - 1; tabIndex++) @@ -58,7 +58,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) //Add the Value Attribute writer.AddAttribute(HtmlTextWriterAttribute.Value, tab.TabID.ToString()); - if (tab.TabID == IntegerValue) + if (tab.TabID == this.IntegerValue) { //Add the Selected Attribute writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected"); @@ -82,7 +82,7 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - TabInfo linkedTabInfo = TabController.Instance.GetTab(IntegerValue, Globals.GetPortalSettings().PortalId, false); + TabInfo linkedTabInfo = TabController.Instance.GetTab(this.IntegerValue, Globals.GetPortalSettings().PortalId, false); //don't render anything if we didn't find the tab if (linkedTabInfo != null) @@ -90,11 +90,11 @@ protected override void RenderViewMode(HtmlTextWriter writer) //Not really sure how to get a good TabID and ModuleID but it's only for tracking so not to concerned int tabID = 0; int moduleID = 0; - Int32.TryParse(Page.Request.QueryString["tabid"], out tabID); - Int32.TryParse(Page.Request.QueryString["mid"], out moduleID); + Int32.TryParse(this.Page.Request.QueryString["tabid"], out tabID); + Int32.TryParse(this.Page.Request.QueryString["mid"], out moduleID); - string url = Globals.LinkClick(StringValue, tabID, moduleID, true); - ControlStyle.AddAttributesToRender(writer); + string url = Globals.LinkClick(this.StringValue, tabID, moduleID, true); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Href, url); writer.AddAttribute(HtmlTextWriterAttribute.Class, "Normal"); writer.RenderBeginTag(HtmlTextWriterTag.A); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRegionEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRegionEditControl.cs index 7c07af7539c..1cac50d24e6 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRegionEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRegionEditControl.cs @@ -42,11 +42,11 @@ private DropDownList Regions { get { - if (_Regions == null) + if (this._Regions == null) { - _Regions = new DropDownList(); + this._Regions = new DropDownList(); } - return _Regions; + return this._Regions; } } @@ -55,11 +55,11 @@ private TextBox Region { get { - if (_Region == null) + if (this._Region == null) { - _Region = new TextBox(); + this._Region = new TextBox(); } - return _Region; + return this._Region; } } @@ -68,11 +68,11 @@ private HtmlInputHidden RegionCode { get { - if (_InitialValue == null) + if (this._InitialValue == null) { - _InitialValue = new HtmlInputHidden(); + this._InitialValue = new HtmlInputHidden(); } - return _InitialValue; + return this._InitialValue; } } #endregion @@ -83,9 +83,9 @@ protected override string StringValue get { string strValue = Null.NullString; - if (Value != null) + if (this.Value != null) { - strValue = Convert.ToString(Value); + strValue = Convert.ToString(this.Value); } return strValue; } @@ -94,7 +94,7 @@ protected override string StringValue protected string OldStringValue { - get { return Convert.ToString(OldValue); } + get { return Convert.ToString(this.OldValue); } } /// @@ -110,13 +110,13 @@ protected IEnumerable ListEntries { get { - if (_listEntries == null) + if (this._listEntries == null) { var listController = new ListController(); - _listEntries = listController.GetListEntryInfoItems("Region", ParentKey, PortalId).OrderBy(s => s.SortOrder).ThenBy(s => s.Text).ToList(); + this._listEntries = listController.GetListEntryInfoItems("Region", this.ParentKey, this.PortalId).OrderBy(s => s.SortOrder).ThenBy(s => s.Text).ToList(); } - return _listEntries; + return this._listEntries; } } @@ -132,12 +132,12 @@ protected int PortalId #region Constructors public DNNRegionEditControl() { - Init += DnnRegionControl_Init; + this.Init += this.DnnRegionControl_Init; } public DNNRegionEditControl(string type) { - Init += DnnRegionControl_Init; - SystemType = type; + this.Init += this.DnnRegionControl_Init; + this.SystemType = type; } #endregion @@ -150,15 +150,15 @@ public DNNRegionEditControl(string type) protected override void OnAttributesChanged() { //Get the List settings out of the "Attributes" - if ((CustomAttributes != null)) + if ((this.CustomAttributes != null)) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is ListAttribute) { var listAtt = (ListAttribute)attribute; - ParentKey = listAtt.ParentKey; - _listEntries = null; + this.ParentKey = listAtt.ParentKey; + this._listEntries = null; break; } } @@ -167,10 +167,10 @@ protected override void OnAttributesChanged() protected override void OnDataChanged(EventArgs e) { - PropertyEditorEventArgs args = new PropertyEditorEventArgs(Name); - args.Value = StringValue; - args.OldValue = OldStringValue; - args.StringValue = StringValue; + PropertyEditorEventArgs args = new PropertyEditorEventArgs(this.Name); + args.Value = this.StringValue; + args.OldValue = this.OldStringValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -178,32 +178,32 @@ protected override void CreateChildControls() { base.CreateChildControls(); - Regions.ControlStyle.CopyFrom(ControlStyle); - Regions.ID = ID + "_dropdown"; - Regions.Attributes.Add("data-editor", "DNNRegionEditControl_DropDown"); - Regions.Attributes.Add("aria-label", "Region"); - Regions.Items.Add(new ListItem() { Text = "<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", Value = "" }); - Controls.Add(Regions); + this.Regions.ControlStyle.CopyFrom(this.ControlStyle); + this.Regions.ID = this.ID + "_dropdown"; + this.Regions.Attributes.Add("data-editor", "DNNRegionEditControl_DropDown"); + this.Regions.Attributes.Add("aria-label", "Region"); + this.Regions.Items.Add(new ListItem() { Text = "<" + Localization.GetString("Not_Specified", Localization.SharedResourceFile) + ">", Value = "" }); + this.Controls.Add(this.Regions); - Region.ControlStyle.CopyFrom(ControlStyle); - Region.ID = ID + "_text"; - Region.Attributes.Add("data-editor", "DNNRegionEditControl_Text"); - Controls.Add(Region); + this.Region.ControlStyle.CopyFrom(this.ControlStyle); + this.Region.ID = this.ID + "_text"; + this.Region.Attributes.Add("data-editor", "DNNRegionEditControl_Text"); + this.Controls.Add(this.Region); - RegionCode.ID = ID + "_value"; - RegionCode.Attributes.Add("data-editor", "DNNRegionEditControl_Hidden"); - Controls.Add(RegionCode); + this.RegionCode.ID = this.ID + "_value"; + this.RegionCode.Attributes.Add("data-editor", "DNNRegionEditControl_Hidden"); + this.Controls.Add(this.RegionCode); } public override bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection) { bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "_value"]; if (!presentValue.Equals(postedValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } return dataChanged; @@ -213,32 +213,32 @@ protected override void OnPreRender(System.EventArgs e) { base.OnPreRender(e); - LoadControls(); + this.LoadControls(); - if (Page != null & EditMode == PropertyEditorMode.Edit) + if (this.Page != null & this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); - Page.RegisterRequiresPostBack(RegionCode); + this.Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this.RegionCode); } } protected override void RenderEditMode(HtmlTextWriter writer) { - if (ListEntries != null && ListEntries.Any()) + if (this.ListEntries != null && this.ListEntries.Any()) { - foreach (ListEntryInfo item in ListEntries) + foreach (ListEntryInfo item in this.ListEntries) { - Regions.Items.Add(new ListItem() { Text = item.Text, Value = item.EntryID.ToString() }); + this.Regions.Items.Add(new ListItem() { Text = item.Text, Value = item.EntryID.ToString() }); } } - ControlStyle.AddAttributesToRender(writer); - writer.AddAttribute("data-name", Name); + this.ControlStyle.AddAttributesToRender(writer); + writer.AddAttribute("data-name", this.Name); writer.AddAttribute("data-list", "Region"); - writer.AddAttribute("data-category", Category); - writer.AddAttribute("data-required", Required.ToString().ToLowerInvariant()); + writer.AddAttribute("data-category", this.Category); + writer.AddAttribute("data-required", this.Required.ToString().ToLowerInvariant()); writer.RenderBeginTag(HtmlTextWriterTag.Div); - RenderChildren(writer); + this.RenderChildren(writer); writer.RenderEndTag(); } #endregion @@ -258,7 +258,7 @@ private void DnnRegionControl_Init(object sender, System.EventArgs e) #region Private Methods private void LoadControls() { - RegionCode.Value = StringValue; + this.RegionCode.Value = this.StringValue; } #endregion diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRichTextEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRichTextEditControl.cs index 93856975dae..497849d45b2 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRichTextEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DNN Edit Controls/DNNRichTextEditControl.cs @@ -31,12 +31,12 @@ protected Control TextEditControl { get { - if (_richTextEditor != null) + if (this._richTextEditor != null) { - return _richTextEditor.HtmlEditorControl; + return this._richTextEditor.HtmlEditorControl; } - return _defaultTextEditor; + return this._defaultTextEditor; } } @@ -44,70 +44,70 @@ protected string EditorText { get { - if (_richTextEditor != null) + if (this._richTextEditor != null) { - return _richTextEditor.Text; + return this._richTextEditor.Text; } - return _defaultTextEditor.Text; + return this._defaultTextEditor.Text; } set { - if (_richTextEditor != null) + if (this._richTextEditor != null) { - _richTextEditor.Text = value; + this._richTextEditor.Text = value; } else { - _defaultTextEditor.Text = value; + this._defaultTextEditor.Text = value; } } } protected override void CreateChildControls() { - if (EditMode == PropertyEditorMode.Edit) + if (this.EditMode == PropertyEditorMode.Edit) { var pnlEditor = new Panel(); - if(string.IsNullOrEmpty(CssClass)) + if(string.IsNullOrEmpty(this.CssClass)) { pnlEditor.CssClass ="dnnLeft"; } else { - pnlEditor.CssClass = string.Format("{0} dnnLeft", CssClass); + pnlEditor.CssClass = string.Format("{0} dnnLeft", this.CssClass); } - _richTextEditor = HtmlEditorProvider.Instance(); - if (_richTextEditor != null) + this._richTextEditor = HtmlEditorProvider.Instance(); + if (this._richTextEditor != null) { - _richTextEditor.ControlID = ID + "edit"; - _richTextEditor.Initialize(); - _richTextEditor.Height = ControlStyle.Height; - _richTextEditor.Width = ControlStyle.Width; - if (_richTextEditor.Height.IsEmpty) + this._richTextEditor.ControlID = this.ID + "edit"; + this._richTextEditor.Initialize(); + this._richTextEditor.Height = this.ControlStyle.Height; + this._richTextEditor.Width = this.ControlStyle.Width; + if (this._richTextEditor.Height.IsEmpty) { - _richTextEditor.Height = new Unit(250); + this._richTextEditor.Height = new Unit(250); } - _richTextEditor.Width = new Unit(400); + this._richTextEditor.Width = new Unit(400); } else { - _defaultTextEditor = new TextBox + this._defaultTextEditor = new TextBox { - ID = ID + "edit", - Width = ControlStyle.Width.IsEmpty ? new Unit(300) : ControlStyle.Width, - Height = ControlStyle.Height.IsEmpty ? new Unit(250) : ControlStyle.Height, + ID = this.ID + "edit", + Width = this.ControlStyle.Width.IsEmpty ? new Unit(300) : this.ControlStyle.Width, + Height = this.ControlStyle.Height.IsEmpty ? new Unit(250) : this.ControlStyle.Height, TextMode = TextBoxMode.MultiLine }; - _defaultTextEditor.Attributes.Add("aria-label", "editor"); + this._defaultTextEditor.Attributes.Add("aria-label", "editor"); } - Controls.Clear(); - pnlEditor.Controls.Add(TextEditControl); - Controls.Add(pnlEditor); + this.Controls.Clear(); + pnlEditor.Controls.Add(this.TextEditControl); + this.Controls.Add(pnlEditor); } base.CreateChildControls(); @@ -116,11 +116,11 @@ protected override void CreateChildControls() public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { var dataChanged = false; - var presentValue = StringValue; - var postedValue = EditorText; + var presentValue = this.StringValue; + var postedValue = this.EditorText; if (!presentValue.Equals(postedValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } return dataChanged; @@ -128,9 +128,9 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo protected override void OnDataChanged(EventArgs e) { - var strValue = RemoveBaseTags(Convert.ToString(Value)); - var strOldValue = RemoveBaseTags(Convert.ToString(OldValue)); - var args = new PropertyEditorEventArgs(Name) { Value = Page.Server.HtmlEncode(strValue), OldValue = Page.Server.HtmlEncode(strOldValue), StringValue = Page.Server.HtmlEncode(RemoveBaseTags(StringValue)) }; + var strValue = this.RemoveBaseTags(Convert.ToString(this.Value)); + var strOldValue = this.RemoveBaseTags(Convert.ToString(this.OldValue)); + var args = new PropertyEditorEventArgs(this.Name) { Value = this.Page.Server.HtmlEncode(strValue), OldValue = this.Page.Server.HtmlEncode(strOldValue), StringValue = this.Page.Server.HtmlEncode(this.RemoveBaseTags(this.StringValue)) }; base.OnValueChanged(args); } @@ -141,32 +141,32 @@ private string RemoveBaseTags(String strInput) protected override void OnInit(EventArgs e) { - EnsureChildControls(); + this.EnsureChildControls(); base.OnInit(e); } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (EditMode == PropertyEditorMode.Edit) + if (this.EditMode == PropertyEditorMode.Edit) { - EditorText = Page.Server.HtmlDecode(Convert.ToString(Value)); + this.EditorText = this.Page.Server.HtmlDecode(Convert.ToString(this.Value)); } - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } protected override void RenderViewMode(HtmlTextWriter writer) { - string propValue = Page.Server.HtmlDecode(Convert.ToString(Value)); - ControlStyle.AddAttributesToRender(writer); + string propValue = this.Page.Server.HtmlDecode(Convert.ToString(this.Value)); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(propValue); writer.RenderEndTag(); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateEditControl.cs index 1b87e46a50f..16c8d428c1a 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateEditControl.cs @@ -55,7 +55,7 @@ protected DateTime DateValue DateTime dteValue = Null.NullDate; try { - var dteString = Convert.ToString(Value); + var dteString = Convert.ToString(this.Value); DateTime.TryParse(dteString, CultureInfo.InvariantCulture, DateTimeStyles.None, out dteValue); } catch (Exception exc) @@ -94,10 +94,10 @@ protected virtual string Format { get { - string _Format = DefaultFormat; - if (CustomAttributes != null) + string _Format = this.DefaultFormat; + if (this.CustomAttributes != null) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is FormatAttribute) { @@ -125,7 +125,7 @@ protected DateTime OldDateValue try { //Try and cast the value to an DateTime - var dteString = OldValue as string; + var dteString = this.OldValue as string; dteValue = DateTime.Parse(dteString, CultureInfo.InvariantCulture); } catch (Exception exc) @@ -145,15 +145,15 @@ protected override string StringValue get { string _StringValue = Null.NullString; - if ((DateValue.ToUniversalTime().Date != DateTime.Parse("1754/01/01") && DateValue != Null.NullDate)) + if ((this.DateValue.ToUniversalTime().Date != DateTime.Parse("1754/01/01") && this.DateValue != Null.NullDate)) { - _StringValue = DateValue.ToString(Format); + _StringValue = this.DateValue.ToString(this.Format); } return _StringValue; } set { - Value = DateTime.Parse(value); + this.Value = DateTime.Parse(value); } } @@ -163,37 +163,37 @@ protected override void CreateChildControls() { base.CreateChildControls(); - dateField = new TextBox(); - dateField.ControlStyle.CopyFrom(ControlStyle); - dateField.ID = ID + "date"; - Controls.Add(dateField); + this.dateField = new TextBox(); + this.dateField.ControlStyle.CopyFrom(this.ControlStyle); + this.dateField.ID = this.ID + "date"; + this.Controls.Add(this.dateField); - Controls.Add(new LiteralControl(" ")); + this.Controls.Add(new LiteralControl(" ")); - linkCalendar = new HyperLink(); - linkCalendar.CssClass = "CommandButton"; - linkCalendar.Text = "  " + Localization.GetString("Calendar"); - linkCalendar.NavigateUrl = Calendar.InvokePopupCal(dateField); - Controls.Add(linkCalendar); + this.linkCalendar = new HyperLink(); + this.linkCalendar.CssClass = "CommandButton"; + this.linkCalendar.Text = "  " + Localization.GetString("Calendar"); + this.linkCalendar.NavigateUrl = Calendar.InvokePopupCal(this.dateField); + this.Controls.Add(this.linkCalendar); } protected virtual void LoadDateControls() { - if (DateValue != Null.NullDate) + if (this.DateValue != Null.NullDate) { - dateField.Text = DateValue.Date.ToString("d"); + this.dateField.Text = this.DateValue.Date.ToString("d"); } } public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { - EnsureChildControls(); + this.EnsureChildControls(); bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey + "date"]; if (!presentValue.Equals(postedValue)) { - Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture); + this.Value = DateTime.Parse(postedValue).ToString(CultureInfo.InvariantCulture); dataChanged = true; } @@ -206,10 +206,10 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo /// An EventArgs object protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = DateValue; - args.OldValue = OldDateValue; - args.StringValue = DateValue.ToString(CultureInfo.InvariantCulture); + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.DateValue; + args.OldValue = this.OldDateValue; + args.StringValue = this.DateValue.ToString(CultureInfo.InvariantCulture); base.OnValueChanged(args); } @@ -217,11 +217,11 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - LoadDateControls(); + this.LoadDateControls(); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -231,7 +231,7 @@ protected override void OnPreRender(EventArgs e) /// protected override void RenderEditMode(HtmlTextWriter writer) { - RenderChildren(writer); + this.RenderChildren(writer); } /// ----------------------------------------------------------------------------- @@ -242,9 +242,9 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - writer.Write(StringValue); + writer.Write(this.StringValue); writer.RenderEndTag(); } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateTimeEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateTimeEditControl.cs index 3c30bc83cf7..67ec670adae 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateTimeEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/DateTimeEditControl.cs @@ -57,57 +57,57 @@ protected override void OnInit(EventArgs e) base.OnInit(e); if (string.IsNullOrEmpty(CultureInfo.CurrentCulture.DateTimeFormat.AMDesignator)) { - is24HourClock = true; + this.is24HourClock = true; } } protected override void CreateChildControls() { base.CreateChildControls(); - Controls.Add(new LiteralControl("
    ")); - hourField = new DropDownList(); + this.Controls.Add(new LiteralControl("
    ")); + this.hourField = new DropDownList(); int maxHour = 12; int minHour = 1; - if (is24HourClock) + if (this.is24HourClock) { minHour = 0; maxHour = 23; } for (int i = minHour; i <= maxHour; i++) { - hourField.Items.Add(new ListItem(i.ToString("00"), i.ToString())); + this.hourField.Items.Add(new ListItem(i.ToString("00"), i.ToString())); } - hourField.ControlStyle.CopyFrom(ControlStyle); - hourField.ID = ID + "hours"; - Controls.Add(hourField); - Controls.Add(new LiteralControl(" ")); - minutesField = new DropDownList(); + this.hourField.ControlStyle.CopyFrom(this.ControlStyle); + this.hourField.ID = this.ID + "hours"; + this.Controls.Add(this.hourField); + this.Controls.Add(new LiteralControl(" ")); + this.minutesField = new DropDownList(); for (int i = 0; i <= 59; i++) { - minutesField.Items.Add(new ListItem(i.ToString("00"), i.ToString())); + this.minutesField.Items.Add(new ListItem(i.ToString("00"), i.ToString())); } - minutesField.ControlStyle.CopyFrom(ControlStyle); - minutesField.ID = ID + "minutes"; - Controls.Add(minutesField); - if (!is24HourClock) + this.minutesField.ControlStyle.CopyFrom(this.ControlStyle); + this.minutesField.ID = this.ID + "minutes"; + this.Controls.Add(this.minutesField); + if (!this.is24HourClock) { - Controls.Add(new LiteralControl(" ")); - ampmField = new DropDownList(); - ampmField.Items.Add(new ListItem("AM", "AM")); - ampmField.Items.Add(new ListItem("PM", "PM")); - ampmField.ControlStyle.CopyFrom(ControlStyle); - ampmField.ID = ID + "ampm"; - Controls.Add(ampmField); + this.Controls.Add(new LiteralControl(" ")); + this.ampmField = new DropDownList(); + this.ampmField.Items.Add(new ListItem("AM", "AM")); + this.ampmField.Items.Add(new ListItem("PM", "PM")); + this.ampmField.ControlStyle.CopyFrom(this.ControlStyle); + this.ampmField.ID = this.ID + "ampm"; + this.Controls.Add(this.ampmField); } } protected override void LoadDateControls() { base.LoadDateControls(); - int hour = DateValue.Hour; - int minute = DateValue.Minute; + int hour = this.DateValue.Hour; + int minute = this.DateValue.Minute; bool isAM = true; - if (!is24HourClock) + if (!this.is24HourClock) { if (hour >= 12) { @@ -119,23 +119,23 @@ protected override void LoadDateControls() hour = 12; } } - if (hourField.Items.FindByValue(hour.ToString()) != null) + if (this.hourField.Items.FindByValue(hour.ToString()) != null) { - hourField.Items.FindByValue(hour.ToString()).Selected = true; + this.hourField.Items.FindByValue(hour.ToString()).Selected = true; } - if (minutesField.Items.FindByValue(minute.ToString()) != null) + if (this.minutesField.Items.FindByValue(minute.ToString()) != null) { - minutesField.Items.FindByValue(minute.ToString()).Selected = true; + this.minutesField.Items.FindByValue(minute.ToString()).Selected = true; } - if (!is24HourClock) + if (!this.is24HourClock) { if (isAM) { - ampmField.SelectedIndex = 0; + this.ampmField.SelectedIndex = 0; } else { - ampmField.SelectedIndex = 1; + this.ampmField.SelectedIndex = 1; } } } @@ -143,7 +143,7 @@ protected override void LoadDateControls() public override bool LoadPostData(string postDataKey, NameValueCollection postCollection) { bool dataChanged = false; - DateTime presentValue = OldDateValue; + DateTime presentValue = this.OldDateValue; string postedDate = postCollection[postDataKey + "date"]; string postedHours = postCollection[postDataKey + "hours"]; string postedMinutes = postCollection[postDataKey + "minutes"]; @@ -153,19 +153,19 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo { DateTime.TryParse(postedDate, out postedValue); } - if (postedHours != "12" || is24HourClock) + if (postedHours != "12" || this.is24HourClock) { int hours = 0; if(Int32.TryParse(postedHours, out hours)) postedValue = postedValue.AddHours(hours); } postedValue = postedValue.AddMinutes(Int32.Parse(postedMinutes)); - if (!is24HourClock && postedAMPM.Equals("PM")) + if (!this.is24HourClock && postedAMPM.Equals("PM")) { postedValue = postedValue.AddHours(12); } if (!presentValue.Equals(postedValue)) { - Value = postedValue.ToString(CultureInfo.InvariantCulture); + this.Value = postedValue.ToString(CultureInfo.InvariantCulture); dataChanged = true; } return dataChanged; diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EditControl.cs index 087dd0481dd..33bbc2d37b4 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EditControl.cs @@ -49,14 +49,14 @@ public object[] CustomAttributes { get { - return _CustomAttributes; + return this._CustomAttributes; } set { - _CustomAttributes = value; - if ((_CustomAttributes != null) && _CustomAttributes.Length > 0) + this._CustomAttributes = value; + if ((this._CustomAttributes != null) && this._CustomAttributes.Length > 0) { - OnAttributesChanged(); + this.OnAttributesChanged(); } } } @@ -158,7 +158,7 @@ public virtual string EditControlClientId { get { - return ClientID; + return this.ClientID; } } @@ -176,11 +176,11 @@ public virtual string EditControlClientId public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection) { bool dataChanged = false; - string presentValue = StringValue; + string presentValue = this.StringValue; string postedValue = postCollection[postDataKey]; if (!presentValue.Equals(postedValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } return dataChanged; @@ -194,7 +194,7 @@ public virtual bool LoadPostData(string postDataKey, NameValueCollection postCol /// ----------------------------------------------------------------------------- public void RaisePostDataChangedEvent() { - OnDataChanged(EventArgs.Empty); + this.OnDataChanged(EventArgs.Empty); } #endregion @@ -237,9 +237,9 @@ protected virtual void OnAttributesChanged() /// ----------------------------------------------------------------------------- protected virtual void OnItemAdded(PropertyEditorEventArgs e) { - if (ItemAdded != null) + if (this.ItemAdded != null) { - ItemAdded(this, e); + this.ItemAdded(this, e); } } @@ -250,9 +250,9 @@ protected virtual void OnItemAdded(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnItemDeleted(PropertyEditorEventArgs e) { - if (ItemDeleted != null) + if (this.ItemDeleted != null) { - ItemDeleted(this, e); + this.ItemDeleted(this, e); } } @@ -264,9 +264,9 @@ protected virtual void OnItemDeleted(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnValueChanged(PropertyEditorEventArgs e) { - if (ValueChanged != null) + if (this.ValueChanged != null) { - ValueChanged(this, e); + this.ValueChanged(this, e); } } @@ -278,9 +278,9 @@ protected virtual void OnValueChanged(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void RenderViewMode(HtmlTextWriter writer) { - string propValue = Page.Server.HtmlDecode(Convert.ToString(Value)); + string propValue = this.Page.Server.HtmlDecode(Convert.ToString(this.Value)); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); var security = PortalSecurity.Instance; writer.Write(security.InputFilter(propValue, PortalSecurity.FilterFlag.NoScripting)); @@ -295,13 +295,13 @@ protected virtual void RenderViewMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected virtual void RenderEditMode(HtmlTextWriter writer) { - string propValue = Convert.ToString(Value); + string propValue = Convert.ToString(this.Value); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute(HtmlTextWriterAttribute.Value, propValue); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } @@ -314,14 +314,14 @@ protected virtual void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void Render(HtmlTextWriter writer) { - var strOldValue = OldValue as string; - if (EditMode == PropertyEditorMode.Edit || (Required && string.IsNullOrEmpty(strOldValue))) + var strOldValue = this.OldValue as string; + if (this.EditMode == PropertyEditorMode.Edit || (this.Required && string.IsNullOrEmpty(strOldValue))) { - RenderEditMode(writer); + this.RenderEditMode(writer); } else { - RenderViewMode(writer); + this.RenderViewMode(writer); } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EnumEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EnumEditControl.cs index 99c54eac624..8faa43ce3d6 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EnumEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/EnumEditControl.cs @@ -47,8 +47,8 @@ public EnumEditControl() /// ----------------------------------------------------------------------------- public EnumEditControl(string type) { - SystemType = type; - EnumType = Type.GetType(type); + this.SystemType = type; + this.EnumType = Type.GetType(type); } #endregion @@ -65,13 +65,13 @@ protected override string StringValue { get { - var retValue = Convert.ToInt32(Value); + var retValue = Convert.ToInt32(this.Value); return retValue.ToString(CultureInfo.InvariantCulture); } set { int setValue = Int32.Parse(value); - Value = setValue; + this.Value = setValue; } } @@ -87,11 +87,11 @@ protected override string StringValue /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - int intValue = Convert.ToInt32(Value); - int intOldValue = Convert.ToInt32(OldValue); + int intValue = Convert.ToInt32(this.Value); + int intOldValue = Convert.ToInt32(this.OldValue); - var args = new PropertyEditorEventArgs(Name) - {Value = Enum.ToObject(EnumType, intValue), OldValue = Enum.ToObject(EnumType, intOldValue)}; + var args = new PropertyEditorEventArgs(this.Name) + {Value = Enum.ToObject(this.EnumType, intValue), OldValue = Enum.ToObject(this.EnumType, intOldValue)}; base.OnValueChanged(args); } @@ -104,21 +104,21 @@ protected override void OnDataChanged(EventArgs e) /// ----------------------------------------------------------------------------- protected override void RenderEditMode(HtmlTextWriter writer) { - Int32 propValue = Convert.ToInt32(Value); - Array enumValues = Enum.GetValues(EnumType); + Int32 propValue = Convert.ToInt32(this.Value); + Array enumValues = Enum.GetValues(this.EnumType); //Render the Select Tag - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Select); for (int I = 0; I <= enumValues.Length - 1; I++) { int enumValue = Convert.ToInt32(enumValues.GetValue(I)); - string enumName = Enum.GetName(EnumType, enumValue); - enumName = Localization.GetString(enumName, LocalResourceFile); + string enumName = Enum.GetName(this.EnumType, enumValue); + enumName = Localization.GetString(enumName, this.LocalResourceFile); //Add the Value Attribute writer.AddAttribute(HtmlTextWriterAttribute.Value, enumValue.ToString(CultureInfo.InvariantCulture)); @@ -147,10 +147,10 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - Int32 propValue = Convert.ToInt32(Value); - string enumValue = Enum.Format(EnumType, propValue, "G"); + Int32 propValue = Convert.ToInt32(this.Value); + string enumValue = Enum.Format(this.EnumType, propValue, "G"); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(enumValue); writer.RenderEndTag(); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/IntegerEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/IntegerEditControl.cs index fbf7e54435c..80eb3a0ccaa 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/IntegerEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/IntegerEditControl.cs @@ -39,7 +39,7 @@ public class IntegerEditControl : EditControl /// ----------------------------------------------------------------------------- public IntegerEditControl() { - SystemType = "System.Int32"; + this.SystemType = "System.Int32"; } #endregion @@ -56,12 +56,12 @@ protected override string StringValue { get { - return IntegerValue.ToString(); + return this.IntegerValue.ToString(); } set { int setValue = Int32.Parse(value); - Value = setValue; + this.Value = setValue; } } @@ -79,9 +79,9 @@ protected int IntegerValue try { //Try and cast the value to an Integer - if(Value != null) + if(this.Value != null) { - Int32.TryParse(Value.ToString(), out intValue); + Int32.TryParse(this.Value.ToString(), out intValue); } } catch (Exception exc) @@ -107,7 +107,7 @@ protected int OldIntegerValue try { //Try and cast the value to an Integer - int.TryParse(OldValue.ToString(), out intValue); + int.TryParse(this.OldValue.ToString(), out intValue); } catch (Exception exc) { @@ -130,10 +130,10 @@ protected int OldIntegerValue /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = IntegerValue; - args.OldValue = OldIntegerValue; - args.StringValue = StringValue; + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.IntegerValue; + args.OldValue = this.OldIntegerValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -145,12 +145,12 @@ protected override void OnDataChanged(EventArgs e) /// ----------------------------------------------------------------------------- protected override void RenderEditMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); writer.AddAttribute(HtmlTextWriterAttribute.Size, "5"); - writer.AddAttribute(HtmlTextWriterAttribute.Value, StringValue); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + writer.AddAttribute(HtmlTextWriterAttribute.Value, this.StringValue); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/MultiLineTextEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/MultiLineTextEditControl.cs index 22293f710e0..a61a445f126 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/MultiLineTextEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/MultiLineTextEditControl.cs @@ -24,10 +24,10 @@ public class MultiLineTextEditControl : TextEditControl { protected override void RenderEditMode(HtmlTextWriter writer) { - string propValue = Convert.ToString(Value); - ControlStyle.AddAttributesToRender(writer); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + string propValue = Convert.ToString(this.Value); + this.ControlStyle.AddAttributesToRender(writer); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); writer.AddAttribute("aria-label", "editor"); writer.RenderBeginTag(HtmlTextWriterTag.Textarea); writer.Write(propValue); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TextEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TextEditControl.cs index 5f031907484..9cce2486b70 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TextEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TextEditControl.cs @@ -45,7 +45,7 @@ public TextEditControl() /// ----------------------------------------------------------------------------- public TextEditControl(string type) { - SystemType = type; + this.SystemType = type; } /// ----------------------------------------------------------------------------- @@ -58,7 +58,7 @@ protected string OldStringValue { get { - return Convert.ToString(OldValue); + return Convert.ToString(this.OldValue); } } @@ -73,15 +73,15 @@ protected override string StringValue get { string strValue = Null.NullString; - if (Value != null) + if (this.Value != null) { - strValue = Convert.ToString(Value); + strValue = Convert.ToString(this.Value); } return strValue; } set { - Value = value; + this.Value = value; } } @@ -93,10 +93,10 @@ protected override string StringValue /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = StringValue; - args.OldValue = OldStringValue; - args.StringValue = StringValue; + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.StringValue; + args.OldValue = this.OldStringValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -109,9 +109,9 @@ protected override void OnDataChanged(EventArgs e) protected override void RenderEditMode(HtmlTextWriter writer) { int length = Null.NullInteger; - if ((CustomAttributes != null)) + if ((this.CustomAttributes != null)) { - foreach (Attribute attribute in CustomAttributes) + foreach (Attribute attribute in this.CustomAttributes) { if (attribute is MaxLengthAttribute) { @@ -121,15 +121,15 @@ protected override void RenderEditMode(HtmlTextWriter writer) } } } - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); - writer.AddAttribute(HtmlTextWriterAttribute.Value, StringValue); + writer.AddAttribute(HtmlTextWriterAttribute.Value, this.StringValue); if (length > Null.NullInteger) { writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, length.ToString()); } - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); - writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TrueFalseEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TrueFalseEditControl.cs index 6abb04b4248..4902eb2af9b 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TrueFalseEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/TrueFalseEditControl.cs @@ -41,7 +41,7 @@ public class TrueFalseEditControl : EditControl /// ----------------------------------------------------------------------------- public TrueFalseEditControl() { - SystemType = "System.Boolean"; + this.SystemType = "System.Boolean"; } #endregion @@ -62,7 +62,7 @@ protected bool BooleanValue try { //Try and cast the value to an Boolean - boolValue = Convert.ToBoolean(Value); + boolValue = Convert.ToBoolean(this.Value); } catch (Exception exc) { @@ -87,7 +87,7 @@ protected bool OldBooleanValue try { //Try and cast the value to an Boolean - boolValue = Convert.ToBoolean(OldValue); + boolValue = Convert.ToBoolean(this.OldValue); } catch (Exception exc) { @@ -108,12 +108,12 @@ protected override string StringValue { get { - return BooleanValue.ToString(); + return this.BooleanValue.ToString(); } set { bool setValue = bool.Parse(value); - Value = setValue; + this.Value = setValue; } } @@ -129,10 +129,10 @@ protected override string StringValue /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = BooleanValue; - args.OldValue = OldBooleanValue; - args.StringValue = StringValue; + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.BooleanValue; + args.OldValue = this.OldBooleanValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -145,28 +145,28 @@ protected override void OnDataChanged(EventArgs e) protected override void RenderEditMode(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio"); - if ((BooleanValue)) + if ((this.BooleanValue)) { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); } writer.AddAttribute(HtmlTextWriterAttribute.Value, "True"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(Localization.GetString("True", Localization.SharedResourceFile)); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio"); - if ((!BooleanValue)) + if ((!this.BooleanValue)) { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); } writer.AddAttribute(HtmlTextWriterAttribute.Value, "False"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Input); writer.RenderEndTag(); - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write(Localization.GetString("False", Localization.SharedResourceFile)); writer.RenderEndTag(); diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/VersionEditControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/VersionEditControl.cs index facf1eec71a..642b26d0fab 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/VersionEditControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Edit Controls/VersionEditControl.cs @@ -37,11 +37,11 @@ protected override string StringValue { get { - return Value.ToString(); + return this.Value.ToString(); } set { - Value = new Version(value); + this.Value = new Version(value); } } @@ -49,7 +49,7 @@ protected Version Version { get { - return Value as Version; + return this.Value as Version; } } @@ -59,7 +59,7 @@ protected void RenderDropDownList(HtmlTextWriter writer, string type, int val) { //Render the Select Tag writer.AddAttribute(HtmlTextWriterAttribute.Type, "text"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID + "_" + type); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + "_" + type); writer.AddStyleAttribute("width", "60px"); writer.RenderBeginTag(HtmlTextWriterTag.Select); for (int i = 0; i <= 99; i++) @@ -92,10 +92,10 @@ protected void RenderDropDownList(HtmlTextWriter writer, string type, int val) /// ----------------------------------------------------------------------------- protected override void OnDataChanged(EventArgs e) { - var args = new PropertyEditorEventArgs(Name); - args.Value = Value; - args.OldValue = OldValue; - args.StringValue = StringValue; + var args = new PropertyEditorEventArgs(this.Name); + args.Value = this.Value; + args.OldValue = this.OldValue; + args.StringValue = this.StringValue; base.OnValueChanged(args); } @@ -110,9 +110,9 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (Page != null && EditMode == PropertyEditorMode.Edit) + if (this.Page != null && this.EditMode == PropertyEditorMode.Edit) { - Page.RegisterRequiresPostBack(this); + this.Page.RegisterRequiresPostBack(this); } } @@ -125,21 +125,21 @@ protected override void OnPreRender(EventArgs e) protected override void RenderEditMode(HtmlTextWriter writer) { //Render a containing span Tag - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); //Render Major - RenderDropDownList(writer, "Major", Version.Major); + this.RenderDropDownList(writer, "Major", this.Version.Major); writer.Write(" "); //Render Minor - RenderDropDownList(writer, "Minor", Version.Minor); + this.RenderDropDownList(writer, "Minor", this.Version.Minor); writer.Write(" "); //Render Build - RenderDropDownList(writer, "Build", Version.Build); + this.RenderDropDownList(writer, "Build", this.Version.Build); //Close Select Tag writer.RenderEndTag(); @@ -153,11 +153,11 @@ protected override void RenderEditMode(HtmlTextWriter writer) /// ----------------------------------------------------------------------------- protected override void RenderViewMode(HtmlTextWriter writer) { - ControlStyle.AddAttributesToRender(writer); + this.ControlStyle.AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Span); - if (Version != null) + if (this.Version != null) { - writer.Write(Version.ToString(3)); + writer.Write(this.Version.ToString(3)); } writer.RenderEndTag(); } @@ -168,11 +168,11 @@ public override bool LoadPostData(string postDataKey, NameValueCollection postCo string minorVersion = postCollection[postDataKey + "_Minor"]; string buildVersion = postCollection[postDataKey + "_Build"]; bool dataChanged = false; - Version presentValue = Version; + Version presentValue = this.Version; var postedValue = new Version(majorVersion + "." + minorVersion + "." + buildVersion); if (!postedValue.Equals(presentValue)) { - Value = postedValue; + this.Value = postedValue; dataChanged = true; } return dataChanged; diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/EditorInfo.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/EditorInfo.cs index 7993b8973d1..b52a91d2b27 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/EditorInfo.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/EditorInfo.cs @@ -31,7 +31,7 @@ public class EditorInfo { public EditorInfo() { - Visible = true; + this.Visible = true; } public object[] Attributes { get; set; } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorEventArgs.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorEventArgs.cs index 79148f2f0c0..ef57cb7fe8b 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorEventArgs.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorEventArgs.cs @@ -44,9 +44,9 @@ public PropertyEditorEventArgs(string name) : this(name, null, null) /// ----------------------------------------------------------------------------- public PropertyEditorEventArgs(string name, object newValue, object oldValue) { - Name = name; - Value = newValue; - OldValue = oldValue; + this.Name = name; + this.Value = newValue; + this.OldValue = oldValue; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorItemEventArgs.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorItemEventArgs.cs index 6faefe47d94..c1a675b10d4 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorItemEventArgs.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/Events/PropertyEditorItemEventArgs.cs @@ -32,7 +32,7 @@ public class PropertyEditorItemEventArgs : EventArgs /// ----------------------------------------------------------------------------- public PropertyEditorItemEventArgs(EditorInfo editor) { - Editor = editor; + this.Editor = editor; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/FieldEditorControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/FieldEditorControl.cs index 6ed8b5c4c5b..41c9e5bb6c4 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/FieldEditorControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/FieldEditorControl.cs @@ -62,18 +62,18 @@ public class FieldEditorControl : WebControl, INamingContainer public FieldEditorControl() { - ValidationExpression = Null.NullString; - ShowRequired = true; - LabelMode = LabelMode.None; - EditorTypeName = Null.NullString; - EditorDisplayMode = EditorDisplayMode.Div; - HelpDisplayMode = HelpDisplayMode.Always; - VisibilityStyle = new Style(); - LabelStyle = new Style(); - HelpStyle = new Style(); - EditControlStyle = new Style(); - ErrorStyle = new Style(); - ViewStateMode = ViewStateMode.Disabled; + this.ValidationExpression = Null.NullString; + this.ShowRequired = true; + this.LabelMode = LabelMode.None; + this.EditorTypeName = Null.NullString; + this.EditorDisplayMode = EditorDisplayMode.Div; + this.HelpDisplayMode = HelpDisplayMode.Always; + this.VisibilityStyle = new Style(); + this.LabelStyle = new Style(); + this.HelpStyle = new Style(); + this.EditControlStyle = new Style(); + this.ErrorStyle = new Style(); + this.ViewStateMode = ViewStateMode.Disabled; } #endregion @@ -143,22 +143,22 @@ public IEditorInfoAdapter EditorInfoAdapter { get { - if (_EditorInfoAdapter == null) + if (this._EditorInfoAdapter == null) { - if (_StdAdapter == null) + if (this._StdAdapter == null) { - _StdAdapter = new StandardEditorInfoAdapter(DataSource, DataField); + this._StdAdapter = new StandardEditorInfoAdapter(this.DataSource, this.DataField); } - return _StdAdapter; + return this._StdAdapter; } else { - return _EditorInfoAdapter; + return this._EditorInfoAdapter; } } set { - _EditorInfoAdapter = value; + this._EditorInfoAdapter = value; } } @@ -206,11 +206,11 @@ public bool IsValid { get { - if (!_Validated) + if (!this._Validated) { - Validate(); + this.Validate(); } - return _IsValid; + return this._IsValid; } } @@ -341,52 +341,52 @@ private void BuildDiv(EditorInfo editInfo) var propLabel = new PropertyLabelControl(); propLabel.ViewStateMode = ViewStateMode.Disabled; - var propEditor = BuildEditor(editInfo); - var visibility = BuildVisibility(editInfo); + var propEditor = this.BuildEditor(editInfo); + var visibility = this.BuildVisibility(editInfo); if (editInfo.LabelMode != LabelMode.None) { - propLabel = BuildLabel(editInfo); + propLabel = this.BuildLabel(editInfo); propLabel.EditControl = propEditor; } var strValue = editInfo.Value as string; - if (ShowRequired && editInfo.Required && (editInfo.EditMode == PropertyEditorMode.Edit || (editInfo.Required && string.IsNullOrEmpty(strValue)))) + if (this.ShowRequired && editInfo.Required && (editInfo.EditMode == PropertyEditorMode.Edit || (editInfo.Required && string.IsNullOrEmpty(strValue)))) { propLabel.Required = true; } if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Top) { - Controls.Add(propLabel); - Controls.Add(propEditor); + this.Controls.Add(propLabel); + this.Controls.Add(propEditor); if (visibility != null) { - Controls.Add(visibility); + this.Controls.Add(visibility); } } else { - Controls.Add(propEditor); + this.Controls.Add(propEditor); if (visibility != null) { - Controls.Add(visibility); + this.Controls.Add(visibility); } if ((propLabel != null)) { - Controls.Add(propLabel); + this.Controls.Add(propLabel); } } //Build the Validators - BuildValidators(editInfo, propEditor.ID); - if (Validators.Count > 0) + this.BuildValidators(editInfo, propEditor.ID); + if (this.Validators.Count > 0) { //Add the Validators to the editor cell - foreach (BaseValidator validator in Validators) + foreach (BaseValidator validator in this.Validators) { - validator.Width = Width; - Controls.Add(validator); + validator.Width = this.Width; + this.Controls.Add(validator); } } } @@ -399,22 +399,22 @@ private EditControl BuildEditor(EditorInfo editInfo) { EditControl propEditor = EditControlFactory.CreateEditControl(editInfo); propEditor.ViewStateMode = ViewStateMode.Enabled; - propEditor.ControlStyle.CopyFrom(EditControlStyle); - propEditor.LocalResourceFile = LocalResourceFile; - propEditor.User = User; + propEditor.ControlStyle.CopyFrom(this.EditControlStyle); + propEditor.LocalResourceFile = this.LocalResourceFile; + propEditor.User = this.User; if (editInfo.ControlStyle != null) { propEditor.ControlStyle.CopyFrom(editInfo.ControlStyle); } - propEditor.ItemAdded += CollectionItemAdded; - propEditor.ItemDeleted += CollectionItemDeleted; - propEditor.ValueChanged += ValueChanged; + propEditor.ItemAdded += this.CollectionItemAdded; + propEditor.ItemDeleted += this.CollectionItemDeleted; + propEditor.ValueChanged += this.ValueChanged; if (propEditor is DNNListEditControl) { var listEditor = (DNNListEditControl) propEditor; - listEditor.ItemChanged += ListItemChanged; + listEditor.ItemChanged += this.ListItemChanged; } - Editor = propEditor; + this.Editor = propEditor; return propEditor; } @@ -426,10 +426,10 @@ private EditControl BuildEditor(EditorInfo editInfo) private PropertyLabelControl BuildLabel(EditorInfo editInfo) { var propLabel = new PropertyLabelControl {ID = editInfo.Name + "_Label"}; - propLabel.HelpStyle.CopyFrom(HelpStyle); - propLabel.LabelStyle.CopyFrom(LabelStyle); + propLabel.HelpStyle.CopyFrom(this.HelpStyle); + propLabel.LabelStyle.CopyFrom(this.LabelStyle); var strValue = editInfo.Value as string; - switch (HelpDisplayMode) + switch (this.HelpDisplayMode) { case HelpDisplayMode.Always: propLabel.ShowHelp = true; @@ -453,7 +453,7 @@ private PropertyLabelControl BuildLabel(EditorInfo editInfo) propLabel.ResourceKey = editInfo.ResourceKey; if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Right) { - propLabel.Width = LabelWidth; + propLabel.Width = this.LabelWidth; } return propLabel; } @@ -466,16 +466,16 @@ private Image BuildRequiredIcon(EditorInfo editInfo) { Image img = null; var strValue = editInfo.Value as string; - if (ShowRequired && editInfo.Required && (editInfo.EditMode == PropertyEditorMode.Edit || (editInfo.Required && string.IsNullOrEmpty(strValue)))) + if (this.ShowRequired && editInfo.Required && (editInfo.EditMode == PropertyEditorMode.Edit || (editInfo.Required && string.IsNullOrEmpty(strValue)))) { img = new Image(); - if (String.IsNullOrEmpty(RequiredUrl) || RequiredUrl == Null.NullString) + if (String.IsNullOrEmpty(this.RequiredUrl) || this.RequiredUrl == Null.NullString) { img.ImageUrl = "~/images/required.gif"; } else { - img.ImageUrl = RequiredUrl; + img.ImageUrl = this.RequiredUrl; } img.Attributes.Add("resourcekey", editInfo.ResourceKey + ".Required"); } @@ -496,15 +496,15 @@ private void BuildTable(EditorInfo editInfo) //Build Label Cell labelCell.VerticalAlign = VerticalAlign.Top; - labelCell.Controls.Add(BuildLabel(editInfo)); + labelCell.Controls.Add(this.BuildLabel(editInfo)); if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Right) { - labelCell.Width = LabelWidth; + labelCell.Width = this.LabelWidth; } //Build Editor Cell editorCell.VerticalAlign = VerticalAlign.Top; - EditControl propEditor = BuildEditor(editInfo); - Image requiredIcon = BuildRequiredIcon(editInfo); + EditControl propEditor = this.BuildEditor(editInfo); + Image requiredIcon = this.BuildRequiredIcon(editInfo); editorCell.Controls.Add(propEditor); if (requiredIcon != null) { @@ -512,9 +512,9 @@ private void BuildTable(EditorInfo editInfo) } if (editInfo.LabelMode == LabelMode.Left || editInfo.LabelMode == LabelMode.Right) { - editorCell.Width = EditControlWidth; + editorCell.Width = this.EditControlWidth; } - VisibilityControl visibility = BuildVisibility(editInfo); + VisibilityControl visibility = this.BuildVisibility(editInfo); if (visibility != null) { editorCell.Controls.Add(new LiteralControl("  ")); @@ -557,13 +557,13 @@ private void BuildTable(EditorInfo editInfo) } //Build the Validators - BuildValidators(editInfo, propEditor.ID); + this.BuildValidators(editInfo, propEditor.ID); var validatorsRow = new TableRow(); var validatorsCell = new TableCell(); validatorsCell.ColumnSpan = 2; //Add the Validators to the editor cell - foreach (BaseValidator validator in Validators) + foreach (BaseValidator validator in this.Validators) { validatorsCell.Controls.Add(validator); } @@ -571,7 +571,7 @@ private void BuildTable(EditorInfo editInfo) tbl.Rows.Add(validatorsRow); //Add the Table to the Controls Collection - Controls.Add(tbl); + this.Controls.Add(tbl); } /// ----------------------------------------------------------------------------- @@ -583,7 +583,7 @@ private void BuildTable(EditorInfo editInfo) /// ----------------------------------------------------------------------------- private void BuildValidators(EditorInfo editInfo, string targetId) { - Validators.Clear(); + this.Validators.Clear(); //Add Required Validators if (editInfo.Required) @@ -592,15 +592,15 @@ private void BuildValidators(EditorInfo editInfo, string targetId) reqValidator.ID = editInfo.Name + "_Req"; reqValidator.ControlToValidate = targetId; reqValidator.Display = ValidatorDisplay.Dynamic; - reqValidator.ControlStyle.CopyFrom(ErrorStyle); + reqValidator.ControlStyle.CopyFrom(this.ErrorStyle); if(String.IsNullOrEmpty(reqValidator.CssClass)) { reqValidator.CssClass = "dnnFormMessage dnnFormError"; } - reqValidator.EnableClientScript = EnableClientValidation; + reqValidator.EnableClientScript = this.EnableClientValidation; reqValidator.Attributes.Add("resourcekey", editInfo.ResourceKey + ".Required"); reqValidator.ErrorMessage = editInfo.Name + " is Required"; - Validators.Add(reqValidator); + this.Validators.Add(reqValidator); } //Add Regular Expression Validators @@ -611,15 +611,15 @@ private void BuildValidators(EditorInfo editInfo, string targetId) regExValidator.ControlToValidate = targetId; regExValidator.ValidationExpression = editInfo.ValidationExpression; regExValidator.Display = ValidatorDisplay.Dynamic; - regExValidator.ControlStyle.CopyFrom(ErrorStyle); + regExValidator.ControlStyle.CopyFrom(this.ErrorStyle); if(String.IsNullOrEmpty(regExValidator.CssClass)) { regExValidator.CssClass = "dnnFormMessage dnnFormError"; } - regExValidator.EnableClientScript = EnableClientValidation; + regExValidator.EnableClientScript = this.EnableClientValidation; regExValidator.Attributes.Add("resourcekey", editInfo.ResourceKey + ".Validation"); regExValidator.ErrorMessage = editInfo.Name + " is Invalid"; - Validators.Add(regExValidator); + this.Validators.Add(regExValidator); } } @@ -631,17 +631,17 @@ private VisibilityControl BuildVisibility(EditorInfo editInfo) { VisibilityControl visControl = null; - if (ShowVisibility) + if (this.ShowVisibility) { visControl = new VisibilityControl { ID = "_visibility", Name = editInfo.Name, - User = User, + User = this.User, Value = editInfo.ProfileVisibility }; - visControl.ControlStyle.CopyFrom(VisibilityStyle); - visControl.VisibilityChanged += VisibilityChanged; + visControl.ControlStyle.CopyFrom(this.VisibilityStyle); + visControl.VisibilityChanged += this.VisibilityChanged; } return visControl; } @@ -657,55 +657,55 @@ private VisibilityControl BuildVisibility(EditorInfo editInfo) /// ----------------------------------------------------------------------------- protected virtual void CreateEditor() { - EditorInfo editInfo = EditorInfoAdapter.CreateEditControl(); + EditorInfo editInfo = this.EditorInfoAdapter.CreateEditControl(); - ID = editInfo.Name; + this.ID = editInfo.Name; if (editInfo != null) { - editInfo.User = User; + editInfo.User = this.User; if (editInfo.EditMode == PropertyEditorMode.Edit) { - editInfo.EditMode = EditMode; + editInfo.EditMode = this.EditMode; } //Get the Editor Type to use (if specified) - if (!string.IsNullOrEmpty(EditorTypeName)) + if (!string.IsNullOrEmpty(this.EditorTypeName)) { - editInfo.Editor = EditorTypeName; + editInfo.Editor = this.EditorTypeName; } //Get the Label Mode to use (if specified) - if (LabelMode != LabelMode.Left) + if (this.LabelMode != LabelMode.Left) { - editInfo.LabelMode = LabelMode; + editInfo.LabelMode = this.LabelMode; } //if Required is specified set editors property - if (Required) + if (this.Required) { - editInfo.Required = Required; + editInfo.Required = this.Required; } //Get the ValidationExpression to use (if specified) - if (!string.IsNullOrEmpty(ValidationExpression)) + if (!string.IsNullOrEmpty(this.ValidationExpression)) { - editInfo.ValidationExpression = ValidationExpression; + editInfo.ValidationExpression = this.ValidationExpression; } //Raise the ItemCreated Event - OnItemCreated(new PropertyEditorItemEventArgs(editInfo)); + this.OnItemCreated(new PropertyEditorItemEventArgs(editInfo)); - Visible = editInfo.Visible; + this.Visible = editInfo.Visible; - if (EditorDisplayMode == EditorDisplayMode.Div) + if (this.EditorDisplayMode == EditorDisplayMode.Div) { - BuildDiv(editInfo); + this.BuildDiv(editInfo); } else { - BuildTable(editInfo); + this.BuildTable(editInfo); } } } @@ -717,7 +717,7 @@ protected virtual void CreateEditor() /// ----------------------------------------------------------------------------- protected virtual void CollectionItemAdded(object sender, PropertyEditorEventArgs e) { - OnItemAdded(e); + this.OnItemAdded(e); } /// ----------------------------------------------------------------------------- @@ -727,7 +727,7 @@ protected virtual void CollectionItemAdded(object sender, PropertyEditorEventArg /// ----------------------------------------------------------------------------- protected virtual void CollectionItemDeleted(object sender, PropertyEditorEventArgs e) { - OnItemDeleted(e); + this.OnItemDeleted(e); } /// ----------------------------------------------------------------------------- @@ -737,9 +737,9 @@ protected virtual void CollectionItemDeleted(object sender, PropertyEditorEventA /// ----------------------------------------------------------------------------- protected virtual void OnItemAdded(PropertyEditorEventArgs e) { - if (ItemAdded != null) + if (this.ItemAdded != null) { - ItemAdded(this, e); + this.ItemAdded(this, e); } } @@ -750,9 +750,9 @@ protected virtual void OnItemAdded(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnItemCreated(PropertyEditorItemEventArgs e) { - if (ItemCreated != null) + if (this.ItemCreated != null) { - ItemCreated(this, e); + this.ItemCreated(this, e); } } @@ -763,9 +763,9 @@ protected virtual void OnItemCreated(PropertyEditorItemEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnItemDeleted(PropertyEditorEventArgs e) { - if (ItemDeleted != null) + if (this.ItemDeleted != null) { - ItemDeleted(this, e); + this.ItemDeleted(this, e); } } @@ -773,9 +773,9 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (String.IsNullOrEmpty(CssClass)) + if (String.IsNullOrEmpty(this.CssClass)) { - CssClass = "dnnFormItem"; + this.CssClass = "dnnFormItem"; } } @@ -786,7 +786,7 @@ protected override void OnPreRender(EventArgs e) /// ----------------------------------------------------------------------------- protected virtual void ValueChanged(object sender, PropertyEditorEventArgs e) { - IsDirty = EditorInfoAdapter.UpdateValue(e); + this.IsDirty = this.EditorInfoAdapter.UpdateValue(e); } /// ----------------------------------------------------------------------------- @@ -796,7 +796,7 @@ protected virtual void ValueChanged(object sender, PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void VisibilityChanged(object sender, PropertyEditorEventArgs e) { - IsDirty = EditorInfoAdapter.UpdateVisibility(e); + this.IsDirty = this.EditorInfoAdapter.UpdateVisibility(e); } #endregion @@ -814,19 +814,19 @@ public override void DataBind() base.OnDataBinding(EventArgs.Empty); //Clear Existing Controls - Controls.Clear(); + this.Controls.Clear(); //Clear Child View State as controls will be loaded from DataSource - ClearChildViewState(); + this.ClearChildViewState(); //Start Tracking ViewState - TrackViewState(); + this.TrackViewState(); //Create the editor - CreateEditor(); + this.CreateEditor(); //Set flag so CreateChildConrols should not be invoked later in control's lifecycle - ChildControlsCreated = true; + this.ChildControlsCreated = true; } /// ----------------------------------------------------------------------------- @@ -836,22 +836,22 @@ public override void DataBind() /// ----------------------------------------------------------------------------- public virtual void Validate() { - _IsValid = Editor.IsValid; + this._IsValid = this.Editor.IsValid; - if (_IsValid) + if (this._IsValid) { - IEnumerator valEnumerator = Validators.GetEnumerator(); + IEnumerator valEnumerator = this.Validators.GetEnumerator(); while (valEnumerator.MoveNext()) { var validator = (IValidator) valEnumerator.Current; validator.Validate(); if (!validator.IsValid) { - _IsValid = false; + this._IsValid = false; break; } } - _Validated = true; + this._Validated = true; } } @@ -867,9 +867,9 @@ public virtual void Validate() /// ----------------------------------------------------------------------------- protected virtual void ListItemChanged(object sender, PropertyEditorEventArgs e) { - if (ItemChanged != null) + if (this.ItemChanged != null) { - ItemChanged(this, e); + this.ItemChanged(this, e); } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/ProfileEditorControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/ProfileEditorControl.cs index 4a03cdeb7ff..679c3be78cf 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/ProfileEditorControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/ProfileEditorControl.cs @@ -43,19 +43,19 @@ public class ProfileEditorControl : CollectionEditorControl /// ----------------------------------------------------------------------------- protected override void CreateEditor() { - CategoryDataField = "PropertyCategory"; - EditorDataField = "DataType"; - NameDataField = "PropertyName"; - RequiredDataField = "Required"; - ValidationExpressionDataField = "ValidationExpression"; - ValueDataField = "PropertyValue"; - VisibleDataField = "Visible"; - VisibilityDataField = "ProfileVisibility"; - LengthDataField = "Length"; + this.CategoryDataField = "PropertyCategory"; + this.EditorDataField = "DataType"; + this.NameDataField = "PropertyName"; + this.RequiredDataField = "Required"; + this.ValidationExpressionDataField = "ValidationExpression"; + this.ValueDataField = "PropertyValue"; + this.VisibleDataField = "Visible"; + this.VisibilityDataField = "ProfileVisibility"; + this.LengthDataField = "Length"; base.CreateEditor(); - foreach (FieldEditorControl editor in Fields) + foreach (FieldEditorControl editor in this.Fields) { //Check whether Field is readonly string fieldName = editor.Editor.Name; @@ -76,7 +76,7 @@ protected override void CreateEditor() { string country = null; - foreach (FieldEditorControl checkEditor in Fields) + foreach (FieldEditorControl checkEditor in this.Fields) { if (checkEditor.Editor is DNNCountryEditControl) { diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ControlStyleAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ControlStyleAttribute.cs index de519d1aaab..faceb3fa5e4 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ControlStyleAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ControlStyleAttribute.cs @@ -24,7 +24,7 @@ public sealed class ControlStyleAttribute : Attribute /// The css class to apply to the associated property public ControlStyleAttribute(string cssClass) { - _CssClass = cssClass; + this._CssClass = cssClass; } /// @@ -34,8 +34,8 @@ public ControlStyleAttribute(string cssClass) /// control width. public ControlStyleAttribute(string cssClass, string width) { - _CssClass = cssClass; - _Width = Unit.Parse(width); + this._CssClass = cssClass; + this._Width = Unit.Parse(width); } /// @@ -46,16 +46,16 @@ public ControlStyleAttribute(string cssClass, string width) /// control height. public ControlStyleAttribute(string cssClass, string width, string height) { - _CssClass = cssClass; - _Height = Unit.Parse(height); - _Width = Unit.Parse(width); + this._CssClass = cssClass; + this._Height = Unit.Parse(height); + this._Width = Unit.Parse(width); } public string CssClass { get { - return _CssClass; + return this._CssClass; } } @@ -63,7 +63,7 @@ public Unit Height { get { - return _Height; + return this._Height; } } @@ -71,7 +71,7 @@ public Unit Width { get { - return _Width; + return this._Width; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/FormatAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/FormatAttribute.cs index 2dc2b20236f..77484c73b15 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/FormatAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/FormatAttribute.cs @@ -20,14 +20,14 @@ public sealed class FormatAttribute : Attribute /// public FormatAttribute(string format) { - _Format = format; + this._Format = format; } public string Format { get { - return _Format; + return this._Format; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/IsReadOnlyAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/IsReadOnlyAttribute.cs index 78142e33cec..ac8ba7a89b5 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/IsReadOnlyAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/IsReadOnlyAttribute.cs @@ -21,14 +21,14 @@ public sealed class IsReadOnlyAttribute : Attribute /// A boolean that indicates whether the property is ReadOnly public IsReadOnlyAttribute(bool read) { - _IsReadOnly = read; + this._IsReadOnly = read; } public bool IsReadOnly { get { - return _IsReadOnly; + return this._IsReadOnly; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LabelModeAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LabelModeAttribute.cs index 619648b76ec..1bdf651ef78 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LabelModeAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LabelModeAttribute.cs @@ -21,14 +21,14 @@ public sealed class LabelModeAttribute : Attribute /// The label mode to apply to the associated property public LabelModeAttribute(LabelMode mode) { - _Mode = mode; + this._Mode = mode; } public LabelMode Mode { get { - return _Mode; + return this._Mode; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LanguagesListTypeAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LanguagesListTypeAttribute.cs index 24969dbd0bf..71d984d60bc 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LanguagesListTypeAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/LanguagesListTypeAttribute.cs @@ -23,14 +23,14 @@ public sealed class LanguagesListTypeAttribute : Attribute /// The type of List public LanguagesListTypeAttribute(LanguagesListType type) { - _ListType = type; + this._ListType = type; } public LanguagesListType ListType { get { - return _ListType; + return this._ListType; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ListAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ListAttribute.cs index 9a32b4e6034..d7764346140 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ListAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/ListAttribute.cs @@ -27,17 +27,17 @@ public sealed class ListAttribute : Attribute /// Value Field. public ListAttribute(string listName, string parentKey, ListBoundField valueField, ListBoundField textField) { - _ListName = listName; - _ParentKey = parentKey; - _TextField = textField; - _ValueField = valueField; + this._ListName = listName; + this._ParentKey = parentKey; + this._TextField = textField; + this._ValueField = valueField; } public string ListName { get { - return _ListName; + return this._ListName; } } @@ -45,7 +45,7 @@ public string ParentKey { get { - return _ParentKey; + return this._ParentKey; } } @@ -53,7 +53,7 @@ public ListBoundField TextField { get { - return _TextField; + return this._TextField; } } @@ -61,7 +61,7 @@ public ListBoundField ValueField { get { - return _ValueField; + return this._ValueField; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/MaxLengthAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/MaxLengthAttribute.cs index 7c2ca5bcdbb..c8d20918c6e 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/MaxLengthAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/MaxLengthAttribute.cs @@ -22,14 +22,14 @@ public sealed class MaxLengthAttribute : Attribute /// public MaxLengthAttribute(int length) { - _Length = length; + this._Length = length; } public int Length { get { - return _Length; + return this._Length; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RegularExpressionValidatorAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RegularExpressionValidatorAttribute.cs index bec2002ad9c..b5d566a0ada 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RegularExpressionValidatorAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RegularExpressionValidatorAttribute.cs @@ -20,14 +20,14 @@ public sealed class RegularExpressionValidatorAttribute : Attribute ///
    public RegularExpressionValidatorAttribute(string expression) { - _Expression = expression; + this._Expression = expression; } public string Expression { get { - return _Expression; + return this._Expression; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RequiredAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RequiredAttribute.cs index 1d6f20ed43a..d398d8c13e7 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RequiredAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/RequiredAttribute.cs @@ -20,14 +20,14 @@ public sealed class RequiredAttribute : Attribute ///
    public RequiredAttribute(bool required) { - _Required = required; + this._Required = required; } public bool Required { get { - return _Required; + return this._Required; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/SortOrderAttribute.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/SortOrderAttribute.cs index 4681df1802d..f0873ec3248 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/SortOrderAttribute.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyAttributes/SortOrderAttribute.cs @@ -19,7 +19,7 @@ public sealed class SortOrderAttribute : Attribute /// public SortOrderAttribute(int order) { - Order = order; + this.Order = order; } public int Order { get; set; } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyEditorControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyEditorControl.cs index fe5c2f39a57..61995af2baf 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyEditorControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyEditorControl.cs @@ -46,19 +46,19 @@ public class PropertyEditorControl : WebControl, INamingContainer public PropertyEditorControl() { - VisibilityStyle = new Style(); - ItemStyle = new Style(); - LabelStyle = new Style(); - HelpStyle = new Style(); - GroupHeaderStyle = new Style(); - ErrorStyle = new Style(); - EditControlStyle = new Style(); - Fields = new ArrayList(); - ShowRequired = true; - LabelMode = LabelMode.Left; - HelpDisplayMode = HelpDisplayMode.Always; - Groups = Null.NullString; - AutoGenerate = true; + this.VisibilityStyle = new Style(); + this.ItemStyle = new Style(); + this.LabelStyle = new Style(); + this.HelpStyle = new Style(); + this.GroupHeaderStyle = new Style(); + this.ErrorStyle = new Style(); + this.EditControlStyle = new Style(); + this.Fields = new ArrayList(); + this.ShowRequired = true; + this.LabelMode = LabelMode.Left; + this.HelpDisplayMode = HelpDisplayMode.Always; + this.Groups = Null.NullString; + this.AutoGenerate = true; } #endregion @@ -81,7 +81,7 @@ protected override HtmlTextWriterTag TagKey /// ----------------------------------------------------------------------------- protected virtual IEnumerable UnderlyingDataSource { - get { return GetProperties(); } + get { return this.GetProperties(); } } #endregion @@ -164,7 +164,7 @@ public bool IsDirty { get { - return Fields.Cast().Any(editor => editor.Visible && editor.IsDirty); + return this.Fields.Cast().Any(editor => editor.Visible && editor.IsDirty); } } @@ -179,7 +179,7 @@ public bool IsValid { get { - return Fields.Cast().All(editor => !editor.Visible || editor.IsValid); + return this.Fields.Cast().All(editor => !editor.Visible || editor.IsValid); } } @@ -353,15 +353,15 @@ public bool IsValid /// ----------------------------------------------------------------------------- private IEnumerable GetProperties() { - if (DataSource != null) + if (this.DataSource != null) { //TODO: We need to add code to support using the cache in the future const BindingFlags bindings = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static; - var properties = DataSource.GetType().GetProperties(bindings); + var properties = this.DataSource.GetType().GetProperties(bindings); //Apply sort method - switch (SortMode) + switch (this.SortMode) { case PropertySortType.Alphabetical: Array.Sort(properties, new PropertyNameComparer()); @@ -380,26 +380,26 @@ private IEnumerable GetProperties() private void AddEditorRow(FieldEditorControl editor, WebControl container) { - editor.ControlStyle.CopyFrom(ItemStyle); - editor.LabelStyle.CopyFrom(LabelStyle); - editor.HelpStyle.CopyFrom(HelpStyle); - editor.ErrorStyle.CopyFrom(ErrorStyle); - editor.VisibilityStyle.CopyFrom(VisibilityStyle); - editor.EditControlStyle.CopyFrom(EditControlStyle); + editor.ControlStyle.CopyFrom(this.ItemStyle); + editor.LabelStyle.CopyFrom(this.LabelStyle); + editor.HelpStyle.CopyFrom(this.HelpStyle); + editor.ErrorStyle.CopyFrom(this.ErrorStyle); + editor.VisibilityStyle.CopyFrom(this.VisibilityStyle); + editor.EditControlStyle.CopyFrom(this.EditControlStyle); if (editor.EditControlWidth == Unit.Empty) { - editor.EditControlWidth = EditControlWidth; + editor.EditControlWidth = this.EditControlWidth; } - editor.LocalResourceFile = LocalResourceFile; - editor.RequiredUrl = RequiredUrl; - editor.ShowRequired = ShowRequired; - editor.ShowVisibility = ShowVisibility; - editor.User = User; - editor.Width = Width; - editor.ItemAdded += CollectionItemAdded; - editor.ItemChanged += ListItemChanged; - editor.ItemCreated += EditorItemCreated; - editor.ItemDeleted += CollectionItemDeleted; + editor.LocalResourceFile = this.LocalResourceFile; + editor.RequiredUrl = this.RequiredUrl; + editor.ShowRequired = this.ShowRequired; + editor.ShowVisibility = this.ShowVisibility; + editor.User = this.User; + editor.Width = this.Width; + editor.ItemAdded += this.CollectionItemAdded; + editor.ItemChanged += this.ListItemChanged; + editor.ItemCreated += this.EditorItemCreated; + editor.ItemDeleted += this.CollectionItemDeleted; editor.DataBind(); container.Controls.Add(editor); @@ -429,38 +429,38 @@ protected void AddEditorRow(Table table, string name, IEditorInfoAdapter adapter //Create a FieldEditor for this Row var editor = new FieldEditorControl { - DataSource = DataSource, + DataSource = this.DataSource, EditorInfoAdapter = adapter, DataField = name, - EditorDisplayMode = DisplayMode, - EnableClientValidation = EnableClientValidation, - EditMode = EditMode, - HelpDisplayMode = HelpDisplayMode, - LabelMode = LabelMode, - LabelWidth = LabelWidth + EditorDisplayMode = this.DisplayMode, + EnableClientValidation = this.EnableClientValidation, + EditMode = this.EditMode, + HelpDisplayMode = this.HelpDisplayMode, + LabelMode = this.LabelMode, + LabelWidth = this.LabelWidth }; - AddEditorRow(editor, cell); + this.AddEditorRow(editor, cell); - Fields.Add(editor); + this.Fields.Add(editor); } protected void AddEditorRow(WebControl container, string name, IEditorInfoAdapter adapter) { var editor = new FieldEditorControl { - DataSource = DataSource, + DataSource = this.DataSource, EditorInfoAdapter = adapter, DataField = name, - EditorDisplayMode = DisplayMode, - EnableClientValidation = EnableClientValidation, - EditMode = EditMode, - HelpDisplayMode = HelpDisplayMode, - LabelMode = LabelMode, - LabelWidth = LabelWidth + EditorDisplayMode = this.DisplayMode, + EnableClientValidation = this.EnableClientValidation, + EditMode = this.EditMode, + HelpDisplayMode = this.HelpDisplayMode, + LabelMode = this.LabelMode, + LabelWidth = this.LabelWidth }; - AddEditorRow(editor, container); + this.AddEditorRow(editor, container); - Fields.Add(editor); + this.Fields.Add(editor); } /// ----------------------------------------------------------------------------- @@ -475,44 +475,44 @@ protected void AddEditorRow(WebControl container, string name, IEditorInfoAdapte protected virtual void AddEditorRow(Table table, object obj) { var objProperty = (PropertyInfo) obj; - AddEditorRow(table, objProperty.Name, new StandardEditorInfoAdapter(DataSource, objProperty.Name)); + this.AddEditorRow(table, objProperty.Name, new StandardEditorInfoAdapter(this.DataSource, objProperty.Name)); } protected virtual void AddEditorRow(Panel container, object obj) { var objProperty = (PropertyInfo)obj; - AddEditorRow(container, objProperty.Name, new StandardEditorInfoAdapter(DataSource, objProperty.Name)); + this.AddEditorRow(container, objProperty.Name, new StandardEditorInfoAdapter(this.DataSource, objProperty.Name)); } protected virtual void AddEditorRow(object obj) { var objProperty = (PropertyInfo)obj; - AddEditorRow(this, objProperty.Name, new StandardEditorInfoAdapter(DataSource, objProperty.Name)); + this.AddEditorRow(this, objProperty.Name, new StandardEditorInfoAdapter(this.DataSource, objProperty.Name)); } protected virtual void AddFields() { - foreach (FieldEditorControl editor in Fields) + foreach (FieldEditorControl editor in this.Fields) { - editor.DataSource = DataSource; - editor.EditorInfoAdapter = new StandardEditorInfoAdapter(DataSource, editor.DataField); - editor.EditorDisplayMode = DisplayMode; - editor.EnableClientValidation = EnableClientValidation; + editor.DataSource = this.DataSource; + editor.EditorInfoAdapter = new StandardEditorInfoAdapter(this.DataSource, editor.DataField); + editor.EditorDisplayMode = this.DisplayMode; + editor.EnableClientValidation = this.EnableClientValidation; if (editor.EditMode != PropertyEditorMode.View) { - editor.EditMode = EditMode; + editor.EditMode = this.EditMode; } - editor.HelpDisplayMode = HelpDisplayMode; + editor.HelpDisplayMode = this.HelpDisplayMode; if (editor.LabelMode == LabelMode.None) { - editor.LabelMode = LabelMode; + editor.LabelMode = this.LabelMode; } if (editor.LabelWidth == Unit.Empty) { - editor.LabelWidth = LabelWidth; + editor.LabelWidth = this.LabelWidth; } - AddEditorRow(editor, this); + this.AddEditorRow(editor, this); } } @@ -524,32 +524,32 @@ protected virtual void AddFields() /// ----------------------------------------------------------------------------- protected virtual void AddFields(Table tbl) { - foreach (FieldEditorControl editor in Fields) + foreach (FieldEditorControl editor in this.Fields) { var row = new TableRow(); tbl.Rows.Add(row); var cell = new TableCell(); row.Cells.Add(cell); - editor.DataSource = DataSource; - editor.EditorInfoAdapter = new StandardEditorInfoAdapter(DataSource, editor.DataField); - editor.EditorDisplayMode = DisplayMode; - editor.EnableClientValidation = EnableClientValidation; + editor.DataSource = this.DataSource; + editor.EditorInfoAdapter = new StandardEditorInfoAdapter(this.DataSource, editor.DataField); + editor.EditorDisplayMode = this.DisplayMode; + editor.EnableClientValidation = this.EnableClientValidation; if (editor.EditMode != PropertyEditorMode.View) { - editor.EditMode = EditMode; + editor.EditMode = this.EditMode; } - editor.HelpDisplayMode = HelpDisplayMode; + editor.HelpDisplayMode = this.HelpDisplayMode; if (editor.LabelMode == LabelMode.None) { - editor.LabelMode = LabelMode; + editor.LabelMode = this.LabelMode; } if (editor.LabelWidth == Unit.Empty) { - editor.LabelWidth = LabelWidth; + editor.LabelWidth = this.LabelWidth; } - AddEditorRow(editor, cell); + this.AddEditorRow(editor, cell); } } @@ -570,27 +570,27 @@ protected virtual void AddHeader(Table tbl, string header) var spacer = new Literal {Text = " ", EnableViewState = false}; var label = new Label {ID = "lbl" + header}; - label.Attributes["resourcekey"] = ID + "_" + header + ".Header"; + label.Attributes["resourcekey"] = this.ID + "_" + header + ".Header"; label.Text = header; label.EnableViewState = false; - label.ControlStyle.CopyFrom(GroupHeaderStyle); + label.ControlStyle.CopyFrom(this.GroupHeaderStyle); panel.Controls.Add(icon); panel.Controls.Add(spacer); panel.Controls.Add(label); - if (GroupHeaderIncludeRule) + if (this.GroupHeaderIncludeRule) { panel.Controls.Add(new LiteralControl("
    ")); } - Controls.Add(panel); + this.Controls.Add(panel); //Get the Hashtable - if (_sections == null) + if (this._sections == null) { - _sections = new Hashtable(); + this._sections = new Hashtable(); } - _sections[icon] = tbl; + this._sections[icon] = tbl; } /// ----------------------------------------------------------------------------- @@ -603,52 +603,52 @@ protected virtual void CreateEditor() Table table; string[] arrGroups = null; - Controls.Clear(); - if (!String.IsNullOrEmpty(Groups)) + this.Controls.Clear(); + if (!String.IsNullOrEmpty(this.Groups)) { - arrGroups = Groups.Split(','); + arrGroups = this.Groups.Split(','); } - else if (GroupByMode != GroupByMode.None) + else if (this.GroupByMode != GroupByMode.None) { - arrGroups = GetGroups(UnderlyingDataSource); + arrGroups = this.GetGroups(this.UnderlyingDataSource); } - if (!AutoGenerate) + if (!this.AutoGenerate) { //Create a new table - if (DisplayMode == EditorDisplayMode.Div) + if (this.DisplayMode == EditorDisplayMode.Div) { - AddFields(); + this.AddFields(); } else { //Add the Table to the Controls Collection table = new Table { ID = "tbl" }; - AddFields(table); - Controls.Add(table); + this.AddFields(table); + this.Controls.Add(table); } } else { - Fields.Clear(); + this.Fields.Clear(); if (arrGroups != null && arrGroups.Length > 0) { foreach (string strGroup in arrGroups) { - if (GroupByMode == GroupByMode.Section) + if (this.GroupByMode == GroupByMode.Section) { - if (DisplayMode == EditorDisplayMode.Div) + if (this.DisplayMode == EditorDisplayMode.Div) { - var groupData = UnderlyingDataSource.Cast().Where(obj => GetCategory(obj) == strGroup.Trim() && GetRowVisibility(obj)); + var groupData = this.UnderlyingDataSource.Cast().Where(obj => this.GetCategory(obj) == strGroup.Trim() && this.GetRowVisibility(obj)); if (groupData.Count() > 0) { //Add header var header = new HtmlGenericControl("h2"); header.Attributes.Add("class", "dnnFormSectionHead"); header.Attributes.Add("id", strGroup); - Controls.Add(header); + this.Controls.Add(header); - var localizedGroupName = Localization.GetString("ProfileProperties_" + strGroup + ".Header", LocalResourceFile); + var localizedGroupName = Localization.GetString("ProfileProperties_" + strGroup + ".Header", this.LocalResourceFile); if (string.IsNullOrEmpty(localizedGroupName)) { localizedGroupName = strGroup; @@ -663,29 +663,29 @@ protected virtual void CreateEditor() foreach (object obj in groupData) { - AddEditorRow(container, obj); + this.AddEditorRow(container, obj); } - Controls.Add(fieldset); + this.Controls.Add(fieldset); } } else { //Create a new table table = new Table { ID = "tbl" + strGroup }; - foreach (object obj in UnderlyingDataSource) + foreach (object obj in this.UnderlyingDataSource) { - if (GetCategory(obj) == strGroup.Trim()) + if (this.GetCategory(obj) == strGroup.Trim()) { //Add the Editor Row to the Table - if (GetRowVisibility(obj)) + if (this.GetRowVisibility(obj)) { if (table.Rows.Count == 0) { //Add a Header - AddHeader(table, strGroup); + this.AddHeader(table, strGroup); } - AddEditorRow(table, obj); + this.AddEditorRow(table, obj); } } } @@ -693,7 +693,7 @@ protected virtual void CreateEditor() //Add the Table to the Controls Collection (if it has any rows) if (table.Rows.Count > 0) { - Controls.Add(table); + this.Controls.Add(table); } } } @@ -702,30 +702,30 @@ protected virtual void CreateEditor() else { //Create a new table - if (DisplayMode == EditorDisplayMode.Div) + if (this.DisplayMode == EditorDisplayMode.Div) { - foreach (object obj in UnderlyingDataSource) + foreach (object obj in this.UnderlyingDataSource) { //Add the Editor Row to the Table - if (GetRowVisibility(obj)) + if (this.GetRowVisibility(obj)) { - AddEditorRow(obj); + this.AddEditorRow(obj); } } } else { table = new Table { ID = "tbl" }; - foreach (object obj in UnderlyingDataSource) + foreach (object obj in this.UnderlyingDataSource) { - if (GetRowVisibility(obj)) + if (this.GetRowVisibility(obj)) { - AddEditorRow(table, obj); + this.AddEditorRow(table, obj); } } //Add the Table to the Controls Collection - Controls.Add(table); + this.Controls.Add(table); } } } @@ -801,7 +801,7 @@ protected virtual bool GetRowVisibility(object obj) isVisible = false; } } - if (!isVisible && EditMode == PropertyEditorMode.Edit) + if (!isVisible && this.EditMode == PropertyEditorMode.Edit) { //Check if property is required - as this will need to override visibility object[] requiredAttributes = objProperty.GetCustomAttributes(typeof (RequiredAttribute), true); @@ -824,9 +824,9 @@ protected virtual bool GetRowVisibility(object obj) /// ----------------------------------------------------------------------------- protected virtual void OnItemAdded(PropertyEditorEventArgs e) { - if (ItemAdded != null) + if (this.ItemAdded != null) { - ItemAdded(this, e); + this.ItemAdded(this, e); } } @@ -837,9 +837,9 @@ protected virtual void OnItemAdded(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnItemCreated(PropertyEditorItemEventArgs e) { - if (ItemCreated != null) + if (this.ItemCreated != null) { - ItemCreated(this, e); + this.ItemCreated(this, e); } } @@ -850,9 +850,9 @@ protected virtual void OnItemCreated(PropertyEditorItemEventArgs e) /// ----------------------------------------------------------------------------- protected virtual void OnItemDeleted(PropertyEditorEventArgs e) { - if (ItemDeleted != null) + if (this.ItemDeleted != null) { - ItemDeleted(this, e); + this.ItemDeleted(this, e); } } @@ -863,21 +863,21 @@ protected virtual void OnItemDeleted(PropertyEditorEventArgs e) /// ----------------------------------------------------------------------------- protected override void OnPreRender(EventArgs e) { - if (_itemChanged) + if (this._itemChanged) { //Rebind the control to the DataSource to make sure that the dependent //editors are updated - DataBind(); + this.DataBind(); } - if (String.IsNullOrEmpty(CssClass)) + if (String.IsNullOrEmpty(this.CssClass)) { - CssClass = "dnnForm"; + this.CssClass = "dnnForm"; } //Find the Min/Max buttons - if (GroupByMode == GroupByMode.Section && (_sections != null)) + if (this.GroupByMode == GroupByMode.Section && (this._sections != null)) { - foreach (DictionaryEntry key in _sections) + foreach (DictionaryEntry key in this._sections) { var tbl = (Table) key.Value; var icon = (Image) key.Key; @@ -902,19 +902,19 @@ public override void DataBind() base.OnDataBinding(EventArgs.Empty); //Clear Existing Controls - Controls.Clear(); + this.Controls.Clear(); //Clear Child View State as controls will be loaded from DataSource - ClearChildViewState(); + this.ClearChildViewState(); //Start Tracking ViewState - TrackViewState(); + this.TrackViewState(); //Create the Editor - CreateEditor(); + this.CreateEditor(); //Set flag so CreateChildConrols should not be invoked later in control's lifecycle - ChildControlsCreated = true; + this.ChildControlsCreated = true; } #endregion @@ -928,7 +928,7 @@ public override void DataBind() /// ----------------------------------------------------------------------------- protected virtual void CollectionItemAdded(object sender, PropertyEditorEventArgs e) { - OnItemAdded(e); + this.OnItemAdded(e); } /// ----------------------------------------------------------------------------- @@ -938,7 +938,7 @@ protected virtual void CollectionItemAdded(object sender, PropertyEditorEventArg /// ----------------------------------------------------------------------------- protected virtual void CollectionItemDeleted(object sender, PropertyEditorEventArgs e) { - OnItemDeleted(e); + this.OnItemDeleted(e); } /// ----------------------------------------------------------------------------- @@ -948,7 +948,7 @@ protected virtual void CollectionItemDeleted(object sender, PropertyEditorEventA /// ----------------------------------------------------------------------------- protected virtual void EditorItemCreated(object sender, PropertyEditorItemEventArgs e) { - OnItemCreated(e); + this.OnItemCreated(e); } /// ----------------------------------------------------------------------------- @@ -958,7 +958,7 @@ protected virtual void EditorItemCreated(object sender, PropertyEditorItemEventA /// ----------------------------------------------------------------------------- protected virtual void ListItemChanged(object sender, PropertyEditorEventArgs e) { - _itemChanged = true; + this._itemChanged = true; } #endregion diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyLabelControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyLabelControl.cs index f4639cd5142..ef570013416 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyLabelControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/PropertyLabelControl.cs @@ -73,13 +73,13 @@ public string Caption { get { - EnsureChildControls(); - return lblLabel.Text; + this.EnsureChildControls(); + return this.lblLabel.Text; } set { - EnsureChildControls(); - lblLabel.Text = value; + this.EnsureChildControls(); + this.lblLabel.Text = value; } } @@ -87,13 +87,13 @@ public string AssociatedControlId { get { - EnsureChildControls(); - return lblLabel.AssociatedControlID; + this.EnsureChildControls(); + return this.lblLabel.AssociatedControlID; } set { - EnsureChildControls(); - lblLabel.AssociatedControlID = value; + this.EnsureChildControls(); + this.lblLabel.AssociatedControlID = value; } } @@ -113,13 +113,13 @@ public string HelpText { get { - EnsureChildControls(); - return lblHelp.Text; + this.EnsureChildControls(); + return this.lblHelp.Text; } set { - EnsureChildControls(); - lblHelp.Text = value; + this.EnsureChildControls(); + this.lblHelp.Text = value; } } @@ -137,17 +137,17 @@ public string ResourceKey { get { - return _ResourceKey; + return this._ResourceKey; } set { - _ResourceKey = value; + this._ResourceKey = value; - EnsureChildControls(); + this.EnsureChildControls(); //Localize the Label and the Help text - lblHelp.Attributes["resourcekey"] = _ResourceKey + ".Help"; - lblLabel.Attributes["resourcekey"] = _ResourceKey + ".Text"; + this.lblHelp.Attributes["resourcekey"] = this._ResourceKey + ".Help"; + this.lblLabel.Attributes["resourcekey"] = this._ResourceKey + ".Text"; } } @@ -156,13 +156,13 @@ public bool ShowHelp { get { - EnsureChildControls(); - return cmdHelp.Visible; + this.EnsureChildControls(); + return this.cmdHelp.Visible; } set { - EnsureChildControls(); - cmdHelp.Visible = value; + this.EnsureChildControls(); + this.cmdHelp.Visible = value; } } @@ -198,8 +198,8 @@ public Style HelpStyle { get { - EnsureChildControls(); - return pnlHelp.ControlStyle; + this.EnsureChildControls(); + return this.pnlHelp.ControlStyle; } } @@ -215,8 +215,8 @@ public Style LabelStyle { get { - EnsureChildControls(); - return lblLabel.ControlStyle; + this.EnsureChildControls(); + return this.lblLabel.ControlStyle; } } @@ -233,39 +233,39 @@ public Style LabelStyle /// protected override void CreateChildControls() { - CssClass += "dnnLabel"; + this.CssClass += "dnnLabel"; - label = new HtmlGenericControl { TagName = "label" }; + this.label = new HtmlGenericControl { TagName = "label" }; - if (!DesignMode) + if (!this.DesignMode) { - cmdHelp = new LinkButton { ID = ID + "_cmdHelp", CssClass = "dnnFormHelp", CausesValidation = false, EnableViewState = false, TabIndex = -1 }; - cmdHelp.Attributes.Add("aria-label", "Help"); - lblLabel = new Label { ID = ID + "_label", EnableViewState = false }; + this.cmdHelp = new LinkButton { ID = this.ID + "_cmdHelp", CssClass = "dnnFormHelp", CausesValidation = false, EnableViewState = false, TabIndex = -1 }; + this.cmdHelp.Attributes.Add("aria-label", "Help"); + this.lblLabel = new Label { ID = this.ID + "_label", EnableViewState = false }; - label.Controls.Add(lblLabel); + this.label.Controls.Add(this.lblLabel); - Controls.Add(label); - Controls.Add(cmdHelp); + this.Controls.Add(this.label); + this.Controls.Add(this.cmdHelp); } - pnlTooltip = new Panel { CssClass = "dnnTooltip" }; + this.pnlTooltip = new Panel { CssClass = "dnnTooltip" }; - pnlHelp = new Panel { ID = ID + "_pnlHelp", EnableViewState = false, CssClass = "dnnFormHelpContent dnnClear" }; + this.pnlHelp = new Panel { ID = this.ID + "_pnlHelp", EnableViewState = false, CssClass = "dnnFormHelpContent dnnClear" }; - pnlTooltip.Controls.Add(pnlHelp); + this.pnlTooltip.Controls.Add(this.pnlHelp); - lblHelp = new Label { ID = ID + "_lblHelp", EnableViewState = false }; - pnlHelp.Controls.Add(lblHelp); + this.lblHelp = new Label { ID = this.ID + "_lblHelp", EnableViewState = false }; + this.pnlHelp.Controls.Add(this.lblHelp); var aHelpPin = new HyperLink(); aHelpPin.CssClass = "pinHelp"; aHelpPin.Attributes.Add("href", "#"); aHelpPin.Attributes.Add("aria-label", "Pin"); - pnlHelp.Controls.Add(aHelpPin); + this.pnlHelp.Controls.Add(aHelpPin); //Controls.Add(label); - Controls.Add(pnlTooltip); + this.Controls.Add(this.pnlTooltip); } /// @@ -275,20 +275,20 @@ protected override void CreateChildControls() protected override void OnDataBinding(EventArgs e) { //If there is a DataSource bind the relevent Properties - if (DataSource != null) + if (this.DataSource != null) { - EnsureChildControls(); - if (!String.IsNullOrEmpty(DataField)) + this.EnsureChildControls(); + if (!String.IsNullOrEmpty(this.DataField)) { //DataBind the Label (via the Resource Key) - var dataRow = (DataRowView) DataSource; - if (ResourceKey == string.Empty) + var dataRow = (DataRowView) this.DataSource; + if (this.ResourceKey == string.Empty) { - ResourceKey = Convert.ToString(dataRow[DataField]); + this.ResourceKey = Convert.ToString(dataRow[this.DataField]); } - if (DesignMode) + if (this.DesignMode) { - label.InnerText = Convert.ToString(dataRow[DataField]); + this.label.InnerText = Convert.ToString(dataRow[this.DataField]); } } } @@ -298,7 +298,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn); + JavaScript.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn); JavaScript.RequestRegistration(CommonJs.DnnPlugins); ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Scripts/initTooltips.js"); } @@ -310,27 +310,27 @@ protected override void OnLoad(EventArgs e) protected override void OnPreRender(EventArgs e) { //Make sure the Child Controls are created before assigning any properties - EnsureChildControls(); + this.EnsureChildControls(); - if (Required) + if (this.Required) { - lblLabel.CssClass += " dnnFormRequired"; + this.lblLabel.CssClass += " dnnFormRequired"; } //DNNClientAPI.EnableMinMax(cmdHelp, pnlHelp, true, DNNClientAPI.MinMaxPersistanceType.None); - if (EditControl != null) + if (this.EditControl != null) { - label.Attributes.Add("for", EditControl is EditControl ? ((EditControl)EditControl).EditControlClientId : EditControl.ClientID); + this.label.Attributes.Add("for", this.EditControl is EditControl ? ((EditControl)this.EditControl).EditControlClientId : this.EditControl.ClientID); } //make sure the help container have the default css class to active js handler. - if (!pnlHelp.ControlStyle.CssClass.Contains("dnnClear")) + if (!this.pnlHelp.ControlStyle.CssClass.Contains("dnnClear")) { - pnlHelp.ControlStyle.CssClass = string.Format("dnnClear {0}", pnlHelp.ControlStyle.CssClass); + this.pnlHelp.ControlStyle.CssClass = string.Format("dnnClear {0}", this.pnlHelp.ControlStyle.CssClass); } - if(!pnlHelp.ControlStyle.CssClass.Contains("dnnFormHelpContent")) + if(!this.pnlHelp.ControlStyle.CssClass.Contains("dnnFormHelpContent")) { - pnlHelp.ControlStyle.CssClass = string.Format("dnnFormHelpContent {0}", pnlHelp.ControlStyle.CssClass); + this.pnlHelp.ControlStyle.CssClass = string.Format("dnnFormHelpContent {0}", this.pnlHelp.ControlStyle.CssClass); } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingInfo.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingInfo.cs index bc3fc2e8cf1..0e0a606d575 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingInfo.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingInfo.cs @@ -30,13 +30,13 @@ public class SettingInfo public SettingInfo(object name, object value) { - Name = Convert.ToString(name); - Value = value; - _Type = value.GetType(); - Editor = EditorInfo.GetEditor(-1); + this.Name = Convert.ToString(name); + this.Value = value; + this._Type = value.GetType(); + this.Editor = EditorInfo.GetEditor(-1); string strValue = Convert.ToString(value); bool IsFound = false; - if (_Type.IsEnum) + if (this._Type.IsEnum) { IsFound = true; } @@ -45,7 +45,7 @@ public SettingInfo(object name, object value) try { bool boolValue = bool.Parse(strValue); - Editor = EditorInfo.GetEditor("Checkbox"); + this.Editor = EditorInfo.GetEditor("Checkbox"); IsFound = true; } catch (Exception exc) @@ -59,7 +59,7 @@ public SettingInfo(object name, object value) try { int intValue = int.Parse(strValue); - Editor = EditorInfo.GetEditor("Integer"); + this.Editor = EditorInfo.GetEditor("Integer"); IsFound = true; } catch (Exception exc) @@ -80,11 +80,11 @@ public Type Type { get { - return _Type; + return this._Type; } set { - _Type = value; + this._Type = value; } } } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingsEditorControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingsEditorControl.cs index 16e404ea584..1639e9ef313 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingsEditorControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/SettingsEditorControl.cs @@ -42,7 +42,7 @@ protected override IEnumerable UnderlyingDataSource { get { - return GetSettings(); + return this.GetSettings(); } } @@ -78,15 +78,15 @@ protected override IEnumerable UnderlyingDataSource /// ----------------------------------------------------------------------------- private ArrayList GetSettings() { - var settings = (Hashtable) DataSource; + var settings = (Hashtable) this.DataSource; var arrSettings = new ArrayList(); IDictionaryEnumerator settingsEnumerator = settings.GetEnumerator(); while (settingsEnumerator.MoveNext()) { var info = new SettingInfo(settingsEnumerator.Key, settingsEnumerator.Value); - if ((CustomEditors != null) && (CustomEditors[settingsEnumerator.Key] != null)) + if ((this.CustomEditors != null) && (this.CustomEditors[settingsEnumerator.Key] != null)) { - info.Editor = Convert.ToString(CustomEditors[settingsEnumerator.Key]); + info.Editor = Convert.ToString(this.CustomEditors[settingsEnumerator.Key]); } arrSettings.Add(info); } @@ -101,19 +101,19 @@ private ArrayList GetSettings() protected override void AddEditorRow(Table table, object obj) { var info = (SettingInfo) obj; - AddEditorRow(table, info.Name, new SettingsEditorInfoAdapter(DataSource, obj, ID)); + this.AddEditorRow(table, info.Name, new SettingsEditorInfoAdapter(this.DataSource, obj, this.ID)); } protected override void AddEditorRow(Panel container, object obj) { var info = (SettingInfo)obj; - AddEditorRow(container, info.Name, new SettingsEditorInfoAdapter(DataSource, obj, ID)); + this.AddEditorRow(container, info.Name, new SettingsEditorInfoAdapter(this.DataSource, obj, this.ID)); } protected override void AddEditorRow(object obj) { var info = (SettingInfo)obj; - AddEditorRow(this, info.Name, new SettingsEditorInfoAdapter(DataSource, obj, ID)); + this.AddEditorRow(this, info.Name, new SettingsEditorInfoAdapter(this.DataSource, obj, this.ID)); } /// ----------------------------------------------------------------------------- @@ -126,9 +126,9 @@ protected override bool GetRowVisibility(object obj) { var info = (SettingInfo) obj; bool _IsVisible = true; - if ((Visibility != null) && (Visibility[info.Name] != null)) + if ((this.Visibility != null) && (this.Visibility[info.Name] != null)) { - _IsVisible = Convert.ToBoolean(Visibility[info.Name]); + _IsVisible = Convert.ToBoolean(this.Visibility[info.Name]); } return _IsVisible; } diff --git a/DNN Platform/Library/UI/WebControls/PropertyEditor/VisibilityControl.cs b/DNN Platform/Library/UI/WebControls/PropertyEditor/VisibilityControl.cs index f5085981e75..ecb9f687420 100644 --- a/DNN Platform/Library/UI/WebControls/PropertyEditor/VisibilityControl.cs +++ b/DNN Platform/Library/UI/WebControls/PropertyEditor/VisibilityControl.cs @@ -39,8 +39,8 @@ public class VisibilityControl : WebControl, IPostBackDataHandler, INamingContai { protected ProfileVisibility Visibility { - get { return Value as ProfileVisibility; } - set { Value = value; } + get { return this.Value as ProfileVisibility; } + set { this.Value = value; } } #region Public Properties @@ -80,7 +80,7 @@ protected ProfileVisibility Visibility public virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection) { var dataChanged = false; - var presentVisibility = Visibility.VisibilityMode; + var presentVisibility = this.Visibility.VisibilityMode; var postedValue = Convert.ToInt32(postCollection[postDataKey]); var postedVisibility = (UserVisibilityMode) Enum.ToObject(typeof (UserVisibilityMode), postedValue); if (!presentVisibility.Equals(postedVisibility) || postedVisibility == UserVisibilityMode.FriendsAndGroups) @@ -89,7 +89,7 @@ public virtual bool LoadPostData(string postDataKey, NameValueCollection postCol { var sb = new StringBuilder(); sb.Append("G:"); - foreach (var role in User.Social.Roles) + foreach (var role in this.User.Social.Roles) { if (postCollection[postDataKey + ":group_" + role.RoleID.ToString(CultureInfo.InvariantCulture)] != null) { @@ -98,7 +98,7 @@ public virtual bool LoadPostData(string postDataKey, NameValueCollection postCol } sb.Append(";R:"); - foreach (var relationship in User.Social.Relationships) + foreach (var relationship in this.User.Social.Relationships) { if (postCollection[postDataKey + ":relationship_" + relationship.RelationshipId.ToString(CultureInfo.InvariantCulture)] != null) { @@ -106,14 +106,14 @@ public virtual bool LoadPostData(string postDataKey, NameValueCollection postCol } } - Value = new ProfileVisibility(User.PortalID, sb.ToString()) + this.Value = new ProfileVisibility(this.User.PortalID, sb.ToString()) { VisibilityMode = postedVisibility }; } else { - Value = new ProfileVisibility + this.Value = new ProfileVisibility { VisibilityMode = postedVisibility }; @@ -131,8 +131,8 @@ public virtual bool LoadPostData(string postDataKey, NameValueCollection postCol public void RaisePostDataChangedEvent() { //Raise the VisibilityChanged Event - var args = new PropertyEditorEventArgs(Name) {Value = Value}; - OnVisibilityChanged(args); + var args = new PropertyEditorEventArgs(this.Name) {Value = this.Value}; + this.OnVisibilityChanged(args); } #endregion @@ -152,10 +152,10 @@ private void RenderVisibility(HtmlTextWriter writer, string optionValue, UserVis //Render radio button writer.AddAttribute(HtmlTextWriterAttribute.Type, "radio"); - writer.AddAttribute("aria-label", ID); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + writer.AddAttribute("aria-label", this.ID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.AddAttribute(HtmlTextWriterAttribute.Value, optionValue); - if ((Visibility.VisibilityMode == selectedVisibility)) + if ((this.Visibility.VisibilityMode == selectedVisibility)) { writer.AddAttribute(HtmlTextWriterAttribute.Checked, "checked"); } @@ -174,8 +174,8 @@ private void RenderCheckboxItem(HtmlTextWriter writer, string prefix, string val //Render radio button writer.AddAttribute(HtmlTextWriterAttribute.Type, "checkbox"); - writer.AddAttribute("aria-label", ID); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID + prefix + value); + writer.AddAttribute("aria-label", this.ID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID + prefix + value); writer.AddAttribute(HtmlTextWriterAttribute.Value, value); if (selected) { @@ -193,21 +193,21 @@ private void RenderCheckboxItem(HtmlTextWriter writer, string prefix, string val private void RenderGroups(HtmlTextWriter writer) { - foreach (var group in User.Social.Roles.Where((role) => role.SecurityMode != SecurityMode.SecurityRole)) + foreach (var group in this.User.Social.Roles.Where((role) => role.SecurityMode != SecurityMode.SecurityRole)) { - RenderCheckboxItem(writer, ":group_", group.RoleID.ToString(CultureInfo.InvariantCulture), + this.RenderCheckboxItem(writer, ":group_", group.RoleID.ToString(CultureInfo.InvariantCulture), group.RoleName, - Visibility.RoleVisibilities.Count(r => r.RoleID == group.RoleID) == 1); + this.Visibility.RoleVisibilities.Count(r => r.RoleID == group.RoleID) == 1); } } private void RenderRelationships(HtmlTextWriter writer) { - foreach (var relationship in User.Social.Relationships) + foreach (var relationship in this.User.Social.Relationships) { - RenderCheckboxItem(writer, ":relationship_", relationship.RelationshipId.ToString(CultureInfo.InvariantCulture), + this.RenderCheckboxItem(writer, ":relationship_", relationship.RelationshipId.ToString(CultureInfo.InvariantCulture), relationship.Name, - Visibility.RelationshipVisibilities.Count(r => r.RelationshipId == relationship.RelationshipId) == 1); + this.Visibility.RelationshipVisibilities.Count(r => r.RelationshipId == relationship.RelationshipId) == 1); } } @@ -226,8 +226,8 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - Page.RegisterRequiresPostBack(this); - Page.ClientScript.RegisterClientScriptBlock(GetType(), "visibleChange", "$(document).ready(function(){$('.dnnFormVisibility').on('click', 'input[type=radio]', function(){$(this).parent().parent().find('ul').hide();$(this).parent().next('ul').show();});});", true); + this.Page.RegisterRequiresPostBack(this); + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "visibleChange", "$(document).ready(function(){$('.dnnFormVisibility').on('click', 'input[type=radio]', function(){$(this).parent().parent().find('ul').hide();$(this).parent().next('ul').show();});});", true); } /// @@ -236,9 +236,9 @@ protected override void OnPreRender(EventArgs e) /// protected virtual void OnVisibilityChanged(PropertyEditorEventArgs e) { - if (VisibilityChanged != null) + if (this.VisibilityChanged != null) { - VisibilityChanged(this, e); + this.VisibilityChanged(this, e); } } @@ -250,7 +250,7 @@ protected override void Render(HtmlTextWriter writer) { //Render Div container writer.AddAttribute(HtmlTextWriterAttribute.Class, "dnnFormVisibility dnnDropdownSettings"); - writer.AddAttribute(HtmlTextWriterAttribute.Name, UniqueID); + writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); writer.RenderBeginTag(HtmlTextWriterTag.Div); //Render dnnButtonDropdown @@ -284,20 +284,20 @@ protected override void Render(HtmlTextWriter writer) writer.RenderBeginTag(HtmlTextWriterTag.Ul); - RenderVisibility(writer, "0", UserVisibilityMode.AllUsers, Localization.GetString("Public").Trim()); + this.RenderVisibility(writer, "0", UserVisibilityMode.AllUsers, Localization.GetString("Public").Trim()); - RenderVisibility(writer, "1", UserVisibilityMode.MembersOnly, Localization.GetString("MembersOnly").Trim()); + this.RenderVisibility(writer, "1", UserVisibilityMode.MembersOnly, Localization.GetString("MembersOnly").Trim()); - RenderVisibility(writer, "2", UserVisibilityMode.AdminOnly, Localization.GetString("AdminOnly").Trim()); + this.RenderVisibility(writer, "2", UserVisibilityMode.AdminOnly, Localization.GetString("AdminOnly").Trim()); - RenderVisibility(writer, "3", UserVisibilityMode.FriendsAndGroups, Localization.GetString("FriendsGroups").Trim()); + this.RenderVisibility(writer, "3", UserVisibilityMode.FriendsAndGroups, Localization.GetString("FriendsGroups").Trim()); //Render UL for check Box List - writer.AddStyleAttribute(HtmlTextWriterStyle.Display, Visibility.VisibilityMode == UserVisibilityMode.FriendsAndGroups ? "block" : "none"); + writer.AddStyleAttribute(HtmlTextWriterStyle.Display, this.Visibility.VisibilityMode == UserVisibilityMode.FriendsAndGroups ? "block" : "none"); writer.RenderBeginTag(HtmlTextWriterTag.Ul); - RenderRelationships(writer); - RenderGroups(writer); + this.RenderRelationships(writer); + this.RenderGroups(writer); //Close UL writer.RenderEndTag(); diff --git a/DNN Platform/Library/WebControls/WebControlBase.cs b/DNN Platform/Library/WebControls/WebControlBase.cs index 192682bc2cd..708228abe98 100644 --- a/DNN Platform/Library/WebControls/WebControlBase.cs +++ b/DNN Platform/Library/WebControls/WebControlBase.cs @@ -31,11 +31,11 @@ public string Theme { get { - return _theme; + return this._theme; } set { - _theme = value; + this._theme = value; } } @@ -51,18 +51,18 @@ public string StyleSheetUrl { get { - if ((_styleSheetUrl.StartsWith("~"))) + if ((this._styleSheetUrl.StartsWith("~"))) { - return Globals.ResolveUrl(_styleSheetUrl); + return Globals.ResolveUrl(this._styleSheetUrl); } else { - return _styleSheetUrl; + return this._styleSheetUrl; } } set { - _styleSheetUrl = value; + this._styleSheetUrl = value; } } @@ -70,7 +70,7 @@ public bool IsHostMenu { get { - return Globals.IsHostTab(PortalSettings.ActiveTab.TabID); + return Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID); } } @@ -99,7 +99,7 @@ public bool IsAdminMenu protected override void RenderContents(HtmlTextWriter output) { - output.Write(HtmlOutput); + output.Write(this.HtmlOutput); } } } diff --git a/DNN Platform/Library/packages.config b/DNN Platform/Library/packages.config index b5f9f070330..5c1798ceab2 100644 --- a/DNN Platform/Library/packages.config +++ b/DNN Platform/Library/packages.config @@ -11,4 +11,5 @@ + \ No newline at end of file diff --git a/DNN Platform/Modules/CoreMessaging/DotNetNuke.Modules.CoreMessaging.csproj b/DNN Platform/Modules/CoreMessaging/DotNetNuke.Modules.CoreMessaging.csproj index 30aa56e6534..8c3d10a9623 100644 --- a/DNN Platform/Modules/CoreMessaging/DotNetNuke.Modules.CoreMessaging.csproj +++ b/DNN Platform/Modules/CoreMessaging/DotNetNuke.Modules.CoreMessaging.csproj @@ -1,210 +1,218 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5DEAB0D5-0F54-44C9-A167-F48264A04B3D} - {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - DotNetNuke.Modules.CoreMessaging - DotNetNuke.Modules.CoreMessaging - v4.7.2 - 512 - - true - - - 4.0 - - - - - - ..\..\..\..\Evoq.Content\ - true - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 1 - bin\DotNetNuke.Modules.CoreMessaging.XML - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\DotNetNuke.Modules.CoreMessaging.XML - 1591 - 7 - - - - False - ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll - - - False - ..\..\DotNetNuke.Web.Client\bin\DotNetNuke.Web.Client.dll - - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - False - True - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - - - - - - - - Properties\SolutionInfo.cs - - - - - - - - - Subscriptions.ascx - ASPXCodeBehind - - - Subscriptions.ascx - - - View.ascx - ASPXCodeBehind - - - View.ascx - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - ASPXCodeBehind - - - - - - - - Designer - - - - - - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - False - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - False - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 9081 - / - - - False - True - http://localhost/DNN_Platform - False - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {5DEAB0D5-0F54-44C9-A167-F48264A04B3D} + {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + DotNetNuke.Modules.CoreMessaging + DotNetNuke.Modules.CoreMessaging + v4.7.2 + 512 + + true + + + 4.0 + + + + + + ..\..\..\..\Evoq.Content\ + true + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 1 + bin\DotNetNuke.Modules.CoreMessaging.XML + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\DotNetNuke.Modules.CoreMessaging.XML + 1591 + 7 + + + + False + ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + + + False + ..\..\DotNetNuke.Web.Client\bin\DotNetNuke.Web.Client.dll + + + + ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + False + True + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + + + + + + + + Properties\SolutionInfo.cs + + + + + + + + + Subscriptions.ascx + ASPXCodeBehind + + + Subscriptions.ascx + + + View.ascx + ASPXCodeBehind + + + View.ascx + + + + + + + + + + + + stylecop.json + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + ASPXCodeBehind + + + + + + + + Designer + + + + + + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + False + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + False + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 9081 + / + + + False + True + http://localhost/DNN_Platform + False + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/DNN Platform/Modules/CoreMessaging/Services/FileUploadController.cs b/DNN Platform/Modules/CoreMessaging/Services/FileUploadController.cs index 1638a8bb6aa..4eebd57ee4a 100644 --- a/DNN Platform/Modules/CoreMessaging/Services/FileUploadController.cs +++ b/DNN Platform/Modules/CoreMessaging/Services/FileUploadController.cs @@ -32,14 +32,14 @@ public HttpResponseMessage UploadFile() try { //todo can we eliminate the HttpContext here - UploadWholeFile(HttpContextSource.Current, statuses); + this.UploadWholeFile(HttpContextSource.Current, statuses); } catch (Exception exc) { Logger.Error(exc); } - return IframeSafeJson(statuses); + return this.IframeSafeJson(statuses); } private HttpResponseMessage IframeSafeJson(List statuses) @@ -63,10 +63,10 @@ private void UploadWholeFile(HttpContextBase context, ICollection s try { - var userFolder = _folderManager.GetUserFolder(UserInfo); + var userFolder = this._folderManager.GetUserFolder(this.UserInfo); //todo: deal with the case where the exact file name already exists. - var fileInfo = _fileManager.AddFile(userFolder, fileName, file.InputStream, true); + var fileInfo = this._fileManager.AddFile(userFolder, fileName, file.InputStream, true); var fileIcon = Entities.Icons.IconController.IconURL("Ext" + fileInfo.Extension, "32x32"); if (!File.Exists(context.Server.MapPath(fileIcon))) { diff --git a/DNN Platform/Modules/CoreMessaging/Services/MessagingServiceController.cs b/DNN Platform/Modules/CoreMessaging/Services/MessagingServiceController.cs index 4a7df91e423..16f51ad70ed 100644 --- a/DNN Platform/Modules/CoreMessaging/Services/MessagingServiceController.cs +++ b/DNN Platform/Modules/CoreMessaging/Services/MessagingServiceController.cs @@ -37,18 +37,18 @@ public HttpResponseMessage Inbox(int afterMessageId, int numberOfRecords) { try { - var messageBoxView = InternalMessagingController.Instance.GetRecentInbox(UserInfo.UserID, afterMessageId, numberOfRecords); + var messageBoxView = InternalMessagingController.Instance.GetRecentInbox(this.UserInfo.UserID, afterMessageId, numberOfRecords); var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - messageBoxView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId); - messageBoxView.TotalConversations = InternalMessagingController.Instance.CountConversations(UserInfo.UserID, portalId); + messageBoxView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId); + messageBoxView.TotalConversations = InternalMessagingController.Instance.CountConversations(this.UserInfo.UserID, portalId); - return Request.CreateResponse(HttpStatusCode.OK, messageBoxView); + return this.Request.CreateResponse(HttpStatusCode.OK, messageBoxView); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -57,17 +57,17 @@ public HttpResponseMessage Sentbox(int afterMessageId, int numberOfRecords) { try { - var messageBoxView = InternalMessagingController.Instance.GetRecentSentbox(UserInfo.UserID, afterMessageId, numberOfRecords); + var messageBoxView = InternalMessagingController.Instance.GetRecentSentbox(this.UserInfo.UserID, afterMessageId, numberOfRecords); var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - messageBoxView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId); - messageBoxView.TotalConversations = InternalMessagingController.Instance.CountSentConversations(UserInfo.UserID, portalId); + messageBoxView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId); + messageBoxView.TotalConversations = InternalMessagingController.Instance.CountSentConversations(this.UserInfo.UserID, portalId); - return Request.CreateResponse(HttpStatusCode.OK, messageBoxView); + return this.Request.CreateResponse(HttpStatusCode.OK, messageBoxView); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -76,17 +76,17 @@ public HttpResponseMessage Archived(int afterMessageId, int numberOfRecords) { try { - var messageBoxView = InternalMessagingController.Instance.GetArchivedMessages(UserInfo.UserID, afterMessageId, numberOfRecords); + var messageBoxView = InternalMessagingController.Instance.GetArchivedMessages(this.UserInfo.UserID, afterMessageId, numberOfRecords); var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - messageBoxView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId); - messageBoxView.TotalConversations = InternalMessagingController.Instance.CountArchivedConversations(UserInfo.UserID, portalId); + messageBoxView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId); + messageBoxView.TotalConversations = InternalMessagingController.Instance.CountArchivedConversations(this.UserInfo.UserID, portalId); - return Request.CreateResponse(HttpStatusCode.OK, messageBoxView); + return this.Request.CreateResponse(HttpStatusCode.OK, messageBoxView); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -96,18 +96,18 @@ public HttpResponseMessage Thread(int conversationId, int afterMessageId, int nu try { var totalRecords = 0; - var messageThreadsView = InternalMessagingController.Instance.GetMessageThread(conversationId, UserInfo.UserID, afterMessageId, numberOfRecords, ref totalRecords); + var messageThreadsView = InternalMessagingController.Instance.GetMessageThread(conversationId, this.UserInfo.UserID, afterMessageId, numberOfRecords, ref totalRecords); var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - messageThreadsView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId); + messageThreadsView.TotalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId); messageThreadsView.TotalThreads = InternalMessagingController.Instance.CountMessagesByConversation(conversationId); messageThreadsView.TotalArchivedThreads = InternalMessagingController.Instance.CountArchivedMessagesByConversation(conversationId); - return Request.CreateResponse(HttpStatusCode.OK, messageThreadsView); + return this.Request.CreateResponse(HttpStatusCode.OK, messageThreadsView); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -119,19 +119,19 @@ public HttpResponseMessage Reply(ReplyDTO postData) { postData.Body = HttpUtility.UrlDecode(postData.Body); var messageId = InternalMessagingController.Instance.ReplyMessage(postData.ConversationId, postData.Body, postData.FileIds); - var message = ToExpandoObject(InternalMessagingController.Instance.GetMessage(messageId)); + var message = this.ToExpandoObject(InternalMessagingController.Instance.GetMessage(messageId)); var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - var totalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId); + var totalNewThreads = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId); var totalThreads = InternalMessagingController.Instance.CountMessagesByConversation(postData.ConversationId); var totalArchivedThreads = InternalMessagingController.Instance.CountArchivedMessagesByConversation(postData.ConversationId); - return Request.CreateResponse(HttpStatusCode.OK, new { Conversation = message, TotalNewThreads = totalNewThreads, TotalThreads = totalThreads, TotalArchivedThreads = totalArchivedThreads }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Conversation = message, TotalNewThreads = totalNewThreads, TotalThreads = totalThreads, TotalArchivedThreads = totalArchivedThreads }); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -141,13 +141,13 @@ public HttpResponseMessage MarkArchived(ConversationDTO postData) { try { - InternalMessagingController.Instance.MarkArchived(postData.ConversationId, UserInfo.UserID); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + InternalMessagingController.Instance.MarkArchived(postData.ConversationId, this.UserInfo.UserID); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -157,13 +157,13 @@ public HttpResponseMessage MarkUnArchived(ConversationDTO postData) { try { - InternalMessagingController.Instance.MarkUnArchived(postData.ConversationId, UserInfo.UserID); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + InternalMessagingController.Instance.MarkUnArchived(postData.ConversationId, this.UserInfo.UserID); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -173,13 +173,13 @@ public HttpResponseMessage MarkRead(ConversationDTO postData) { try { - InternalMessagingController.Instance.MarkRead(postData.ConversationId, UserInfo.UserID); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + InternalMessagingController.Instance.MarkRead(postData.ConversationId, this.UserInfo.UserID); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -189,13 +189,13 @@ public HttpResponseMessage MarkUnRead(ConversationDTO postData) { try { - InternalMessagingController.Instance.MarkUnRead(postData.ConversationId, UserInfo.UserID); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + InternalMessagingController.Instance.MarkUnRead(postData.ConversationId, this.UserInfo.UserID); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -205,13 +205,13 @@ public HttpResponseMessage DeleteUserFromConversation(ConversationDTO postData) { try { - InternalMessagingController.Instance.DeleteUserFromConversation(postData.ConversationId, UserInfo.UserID); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + InternalMessagingController.Instance.DeleteUserFromConversation(postData.ConversationId, this.UserInfo.UserID); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -221,17 +221,17 @@ public HttpResponseMessage Notifications(int afterNotificationId, int numberOfRe try { var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - var notificationsDomainModel = NotificationsController.Instance.GetNotifications(UserInfo.UserID, portalId, afterNotificationId, numberOfRecords); + var notificationsDomainModel = NotificationsController.Instance.GetNotifications(this.UserInfo.UserID, portalId, afterNotificationId, numberOfRecords); var notificationsViewModel = new NotificationsViewModel { - TotalNotifications = NotificationsController.Instance.CountNotifications(UserInfo.UserID, portalId), + TotalNotifications = NotificationsController.Instance.CountNotifications(this.UserInfo.UserID, portalId), Notifications = new List(notificationsDomainModel.Count) }; foreach (var notification in notificationsDomainModel) { - var user = UserController.Instance.GetUser(PortalSettings.PortalId, notification.SenderUserID); + var user = UserController.Instance.GetUser(this.PortalSettings.PortalId, notification.SenderUserID); var displayName = (user != null ? user.DisplayName : ""); var notificationViewModel = new NotificationViewModel @@ -254,9 +254,9 @@ public HttpResponseMessage Notifications(int afterNotificationId, int numberOfRe { var notificationActionViewModel = new NotificationActionViewModel { - Name = LocalizeActionString(notificationTypeAction.NameResourceKey, notificationType.DesktopModuleId), - Description = LocalizeActionString(notificationTypeAction.DescriptionResourceKey, notificationType.DesktopModuleId), - Confirm = LocalizeActionString(notificationTypeAction.ConfirmResourceKey, notificationType.DesktopModuleId), + Name = this.LocalizeActionString(notificationTypeAction.NameResourceKey, notificationType.DesktopModuleId), + Description = this.LocalizeActionString(notificationTypeAction.DescriptionResourceKey, notificationType.DesktopModuleId), + Confirm = this.LocalizeActionString(notificationTypeAction.ConfirmResourceKey, notificationType.DesktopModuleId), APICall = notificationTypeAction.APICall }; @@ -277,12 +277,12 @@ public HttpResponseMessage Notifications(int afterNotificationId, int numberOfRe notificationsViewModel.Notifications.Add(notificationViewModel); } - return Request.CreateResponse(HttpStatusCode.OK, notificationsViewModel); + return this.Request.CreateResponse(HttpStatusCode.OK, notificationsViewModel); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -292,12 +292,12 @@ public HttpResponseMessage CheckReplyHasRecipients(int conversationId) try { var recipientCount = InternalMessagingController.Instance.CheckReplyHasRecipients(conversationId, UserController.Instance.GetCurrentUserInfo().UserID); - return Request.CreateResponse(HttpStatusCode.OK, recipientCount); + return this.Request.CreateResponse(HttpStatusCode.OK, recipientCount); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -307,13 +307,13 @@ public HttpResponseMessage CountNotifications() try { var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - int notifications = NotificationsController.Instance.CountNotifications(UserInfo.UserID, portalId); - return Request.CreateResponse(HttpStatusCode.OK, notifications); + int notifications = NotificationsController.Instance.CountNotifications(this.UserInfo.UserID, portalId); + return this.Request.CreateResponse(HttpStatusCode.OK, notifications); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -323,13 +323,13 @@ public HttpResponseMessage CountUnreadMessages() try { var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); - var unreadMessages = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId); - return Request.CreateResponse(HttpStatusCode.OK, unreadMessages); + var unreadMessages = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId); + return this.Request.CreateResponse(HttpStatusCode.OK, unreadMessages); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -341,16 +341,16 @@ public HttpResponseMessage GetTotals() var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); var totalsViewModel = new TotalsViewModel { - TotalUnreadMessages = InternalMessagingController.Instance.CountUnreadMessages(UserInfo.UserID, portalId), - TotalNotifications = NotificationsController.Instance.CountNotifications(UserInfo.UserID, portalId) + TotalUnreadMessages = InternalMessagingController.Instance.CountUnreadMessages(this.UserInfo.UserID, portalId), + TotalNotifications = NotificationsController.Instance.CountNotifications(this.UserInfo.UserID, portalId) }; - return Request.CreateResponse(HttpStatusCode.OK, totalsViewModel); + return this.Request.CreateResponse(HttpStatusCode.OK, totalsViewModel); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -360,13 +360,13 @@ public HttpResponseMessage DismissAllNotifications() { try { - var deletedCount = NotificationsController.Instance.DeleteUserNotifications(UserInfo); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", count = deletedCount }); + var deletedCount = NotificationsController.Instance.DeleteUserNotifications(this.UserInfo); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", count = deletedCount }); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } #endregion @@ -396,7 +396,7 @@ private string LocalizeActionString(string key, int desktopModuleId) if (desktopModuleId > 0) { - var desktopModule = DesktopModuleController.GetDesktopModule(desktopModuleId, PortalSettings.PortalId); + var desktopModule = DesktopModuleController.GetDesktopModule(desktopModuleId, this.PortalSettings.PortalId); var resourceFile = string.Format("~/DesktopModules/{0}/{1}/{2}", desktopModule.FolderName.Replace("\\", "/"), diff --git a/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs b/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs index 49e92bbb3e2..65529824130 100644 --- a/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs +++ b/DNN Platform/Modules/CoreMessaging/Services/SubscriptionsController.cs @@ -34,7 +34,7 @@ private string LocalizationFolder get { return string.Format("~/DesktopModules/{0}/App_LocalResources/", - DesktopModuleController.GetDesktopModuleByModuleName("DotNetNuke.Modules.CoreMessaging", PortalSettings.PortalId).FolderName); + DesktopModuleController.GetDesktopModuleByModuleName("DotNetNuke.Modules.CoreMessaging", this.PortalSettings.PortalId).FolderName); } } #endregion @@ -53,7 +53,7 @@ public HttpResponseMessage GetSubscriptions(int pageIndex, int pageSize, string { try { - var subscriptions = from s in SubscriptionController.Instance.GetUserSubscriptions(UserInfo, PortalSettings.PortalId) + var subscriptions = from s in SubscriptionController.Instance.GetUserSubscriptions(this.UserInfo, this.PortalSettings.PortalId) select GetSubscriptionViewModel(s); List sortedList; @@ -92,12 +92,12 @@ public HttpResponseMessage GetSubscriptions(int pageIndex, int pageSize, string TotalResults = sortedList.Count() }; - return Request.CreateResponse(HttpStatusCode.OK, response); + return this.Request.CreateResponse(HttpStatusCode.OK, response); } catch (Exception ex) { Exceptions.LogException(ex); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } } @@ -110,19 +110,19 @@ public HttpResponseMessage UpdateSystemSubscription(InboxSubscriptionViewModel p var userPreferencesController = UserPreferencesController.Instance; var userPreference = new UserPreference { - PortalId = UserInfo.PortalID, - UserId = UserInfo.UserID, + PortalId = this.UserInfo.PortalID, + UserId = this.UserInfo.UserID, MessagesEmailFrequency = (Frequency) post.MsgFreq, NotificationsEmailFrequency = (Frequency) post.NotifyFreq }; userPreferencesController.SetUserPreference(userPreference); - return Request.CreateResponse(HttpStatusCode.OK, userPreferencesController.GetUserPreference(UserInfo)); + return this.Request.CreateResponse(HttpStatusCode.OK, userPreferencesController.GetUserPreference(this.UserInfo)); } catch (Exception ex) { Exceptions.LogException(ex); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } } @@ -132,19 +132,19 @@ public HttpResponseMessage DeleteContentSubscription(Subscription subscription) { try { - var sub = SubscriptionController.Instance.GetUserSubscriptions(UserInfo, PortalSettings.PortalId) + var sub = SubscriptionController.Instance.GetUserSubscriptions(this.UserInfo, this.PortalSettings.PortalId) .SingleOrDefault(s => s.SubscriptionId == subscription.SubscriptionId); if (sub != null) { SubscriptionController.Instance.DeleteSubscription(sub); } - return Request.CreateResponse(HttpStatusCode.OK, "unsubscribed"); + return this.Request.CreateResponse(HttpStatusCode.OK, "unsubscribed"); } catch (Exception ex) { Exceptions.LogException(ex); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message); } } @@ -156,12 +156,12 @@ public HttpResponseMessage GetLocalizationTable(string culture) { if (!string.IsNullOrEmpty(culture)) { - Localization.SetThreadCultures(new CultureInfo(culture), PortalSettings); + Localization.SetThreadCultures(new CultureInfo(culture), this.PortalSettings); } var dictionary = new Dictionary(); - var resourcesPath = LocalizationFolder; + var resourcesPath = this.LocalizationFolder; var files = Directory.GetFiles(System.Web.HttpContext.Current.Server.MapPath(resourcesPath)).Select(x => new FileInfo(x).Name).Where(f => !IsLanguageSpecific(f)).ToList(); @@ -175,13 +175,13 @@ public HttpResponseMessage GetLocalizationTable(string culture) dictionary.Add(kvp.Key, kvp.Value); } - return Request.CreateResponse(HttpStatusCode.OK, new { Table = dictionary }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Table = dictionary }); } catch (Exception ex) { Exceptions.LogException(ex); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex); } } #endregion diff --git a/DNN Platform/Modules/CoreMessaging/Subscriptions.ascx.cs b/DNN Platform/Modules/CoreMessaging/Subscriptions.ascx.cs index 3da2462bb9c..a57f4285978 100644 --- a/DNN Platform/Modules/CoreMessaging/Subscriptions.ascx.cs +++ b/DNN Platform/Modules/CoreMessaging/Subscriptions.ascx.cs @@ -33,10 +33,10 @@ public partial class Subscriptions : UserControl public ModuleInfo ModuleConfiguration { - get { return ModuleContext != null ? ModuleContext.Configuration : null; } + get { return this.ModuleContext != null ? this.ModuleContext.Configuration : null; } set { - ModuleContext.Configuration = value; + this.ModuleContext.Configuration = value; } } @@ -48,7 +48,7 @@ public ModuleInfo ModuleConfiguration protected string LocalizeString(string key) { - return Localization.GetString(key, LocalResourceFile); + return Localization.GetString(key, this.LocalResourceFile); } #endregion @@ -57,8 +57,8 @@ protected string LocalizeString(string key) public string GetSettingsAsJson() { - var settings = GetModuleSettings(PortalSettings.Current, ModuleConfiguration, Null.NullInteger); - foreach (DictionaryEntry entry in GetViewSettings()) + var settings = GetModuleSettings(PortalSettings.Current, this.ModuleConfiguration, Null.NullInteger); + foreach (DictionaryEntry entry in this.GetViewSettings()) { if (settings.ContainsKey(entry.Key)) { @@ -83,16 +83,16 @@ protected override void OnLoad(EventArgs e) ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/CoreMessaging/Scripts/LocalizationController.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/CoreMessaging/Scripts/SubscriptionsViewModel.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/CoreMessaging/Scripts/Subscription.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/CoreMessaging/subscriptions.css"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/CoreMessaging/Scripts/LocalizationController.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/CoreMessaging/Scripts/SubscriptionsViewModel.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/CoreMessaging/Scripts/Subscription.js"); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/DesktopModules/CoreMessaging/subscriptions.css"); } else { - Response.Redirect(Globals.AccessDeniedURL(), false); + this.Response.Redirect(Globals.AccessDeniedURL(), false); } } @@ -121,7 +121,7 @@ private Hashtable GetViewSettings() return new Hashtable { - { "moduleScope", string.Format("#{0}", ScopeWrapper.ClientID) }, + { "moduleScope", string.Format("#{0}", this.ScopeWrapper.ClientID) }, { "pageSize", 25 }, { "notifyFrequency", userPreference != null ? (int)userPreference.NotificationsEmailFrequency : notifyFrequency }, { "msgFrequency", userPreference != null ? (int)userPreference.MessagesEmailFrequency : messageFrequency } diff --git a/DNN Platform/Modules/CoreMessaging/View.ascx.cs b/DNN Platform/Modules/CoreMessaging/View.ascx.cs index d723f82d6b3..2864ae04da3 100644 --- a/DNN Platform/Modules/CoreMessaging/View.ascx.cs +++ b/DNN Platform/Modules/CoreMessaging/View.ascx.cs @@ -38,9 +38,9 @@ public int ProfileUserId get { var userId = Null.NullInteger; - if (!string.IsNullOrEmpty(Request.Params["UserId"])) + if (!string.IsNullOrEmpty(this.Request.Params["UserId"])) { - userId = Int32.Parse(Request.Params["UserId"]); + userId = Int32.Parse(this.Request.Params["UserId"]); } return userId; } @@ -50,7 +50,7 @@ public string ShowAttachments { get { - var allowAttachments = PortalController.GetPortalSetting("MessagingAllowAttachments", PortalId, "NO"); + var allowAttachments = PortalController.GetPortalSetting("MessagingAllowAttachments", this.PortalId, "NO"); return allowAttachments == "NO" ? "false" : "true"; } } @@ -59,8 +59,8 @@ public bool ShowSubscriptionTab { get { - return !Settings.ContainsKey("ShowSubscriptionTab") || - Settings["ShowSubscriptionTab"].ToString().Equals("true", StringComparison.InvariantCultureIgnoreCase); + return !this.Settings.ContainsKey("ShowSubscriptionTab") || + this.Settings["ShowSubscriptionTab"].ToString().Equals("true", StringComparison.InvariantCultureIgnoreCase); } } @@ -68,8 +68,8 @@ public bool DisablePrivateMessage { get { - return PortalSettings.DisablePrivateMessage && !UserInfo.IsSuperUser - && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName); + return this.PortalSettings.DisablePrivateMessage && !this.UserInfo.IsSuperUser + && !this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName); } } @@ -80,32 +80,32 @@ public bool DisablePrivateMessage override protected void OnInit(EventArgs e) { - if (!Request.IsAuthenticated) + if (!this.Request.IsAuthenticated) { // Do not redirect but hide the content of the module and display a message. - CoreMessagingContainer.Visible = false; - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ContentNotAvailable", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + this.CoreMessagingContainer.Visible = false; + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ContentNotAvailable", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); return; } - if (UserId != ProfileUserId && (PortalSettings.ActiveTab.ParentId == PortalSettings.UserTabId || TabId == PortalSettings.UserTabId)) + if (this.UserId != this.ProfileUserId && (this.PortalSettings.ActiveTab.ParentId == this.PortalSettings.UserTabId || this.TabId == this.PortalSettings.UserTabId)) { // Do not redirect but hide the content of the module. - CoreMessagingContainer.Visible = false; + this.CoreMessagingContainer.Visible = false; return; } - if (IsEditable && PermissionsNotProperlySet()) + if (this.IsEditable && this.PermissionsNotProperlySet()) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PermissionsNotProperlySet", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PermissionsNotProperlySet", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } ServicesFramework.Instance.RequestAjaxScriptSupport(); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); JavaScript.RequestRegistration(CommonJs.DnnPlugins); JavaScript.RequestRegistration(CommonJs.Knockout); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/CoreMessaging/Scripts/CoreMessaging.js"); - jQuery.RegisterFileUpload(Page); - AddIe7StyleSheet(); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/CoreMessaging/Scripts/CoreMessaging.js"); + jQuery.RegisterFileUpload(this.Page); + this.AddIe7StyleSheet(); base.OnInit(e); } @@ -116,11 +116,11 @@ override protected void OnInit(EventArgs e) private void AddIe7StyleSheet() { - var browser = Request.Browser; + var browser = this.Request.Browser; if (browser.Type == "IE" || browser.MajorVersion < 8) { const string cssLink = ""; - Page.Header.Controls.Add(new LiteralControl(cssLink)); + this.Page.Header.Controls.Add(new LiteralControl(cssLink)); } } @@ -128,14 +128,14 @@ private bool PermissionsNotProperlySet() { List permissions; - if (ModuleConfiguration.InheritViewPermissions) + if (this.ModuleConfiguration.InheritViewPermissions) { - var tabPermissionCollection = TabPermissionController.GetTabPermissions(TabId, PortalId); + var tabPermissionCollection = TabPermissionController.GetTabPermissions(this.TabId, this.PortalId); permissions = tabPermissionCollection.ToList(); } else { - permissions = ModuleConfiguration.ModulePermissions.ToList(); + permissions = this.ModuleConfiguration.ModulePermissions.ToList(); } return permissions.Find(PermissionPredicate) != null; diff --git a/DNN Platform/Modules/CoreMessaging/packages.config b/DNN Platform/Modules/CoreMessaging/packages.config index 4a4092b618b..6730d0b6c1b 100644 --- a/DNN Platform/Modules/CoreMessaging/packages.config +++ b/DNN Platform/Modules/CoreMessaging/packages.config @@ -1,8 +1,9 @@ - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/DDRMenu/Actions.cs b/DNN Platform/Modules/DDRMenu/Actions.cs index c0525ae5a02..0695de48dfb 100644 --- a/DNN Platform/Modules/DDRMenu/Actions.cs +++ b/DNN Platform/Modules/DDRMenu/Actions.cs @@ -41,12 +41,12 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - navProvider = (DDRMenuNavigationProvider)NavigationProvider.Instance("DDRMenuNavigationProvider"); - navProvider.ControlID = "ctl" + ID; - navProvider.MenuStyle = MenuStyle; - navProvider.Initialize(); + this.navProvider = (DDRMenuNavigationProvider)NavigationProvider.Instance("DDRMenuNavigationProvider"); + this.navProvider.ControlID = "ctl" + this.ID; + this.navProvider.MenuStyle = this.MenuStyle; + this.navProvider.Initialize(); - Controls.Add(navProvider.NavigationControl); + this.Controls.Add(this.navProvider.NavigationControl); } } @@ -56,7 +56,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - SetMenuDefaults(); + this.SetMenuDefaults(); } } @@ -68,8 +68,8 @@ protected override void OnPreRender(EventArgs e) try { - navProvider.TemplateArguments = TemplateArguments; - BindMenu(Navigation.GetActionNodes(ActionRoot, this, -1)); + this.navProvider.TemplateArguments = this.TemplateArguments; + this.BindMenu(Navigation.GetActionNodes(this.ActionRoot, this, -1)); } catch (Exception exc) { @@ -80,18 +80,18 @@ protected override void OnPreRender(EventArgs e) private void BindMenu(DNNNodeCollection objNodes) { - Visible = DisplayControl(objNodes); - if (!Visible) + this.Visible = this.DisplayControl(objNodes); + if (!this.Visible) { return; } - navProvider.ClearNodes(); + this.navProvider.ClearNodes(); foreach (DNNNode node in objNodes) { - ProcessNode(node); + this.ProcessNode(node); } - navProvider.Bind(objNodes, false); + this.navProvider.Bind(objNodes, false); } private void ActionClick(NavigationEventArgs args) @@ -100,7 +100,7 @@ private void ActionClick(NavigationEventArgs args) { try { - ProcessAction(args.ID); + this.ProcessAction(args.ID); } catch (Exception exc) { @@ -111,36 +111,36 @@ private void ActionClick(NavigationEventArgs args) private void AddActionIDs(ModuleAction action) { - if (!actions.ContainsKey(action.ID)) + if (!this.actions.ContainsKey(action.ID)) { - actions.Add(action.ID, action); + this.actions.Add(action.ID, action); } if (action.HasChildren()) { foreach (ModuleAction a in action.Actions) { - AddActionIDs(a); + this.AddActionIDs(a); } } } private ModuleAction FindAction(int id) { - if (actions == null) + if (this.actions == null) { - actions = new Dictionary(); - AddActionIDs(ActionRoot); + this.actions = new Dictionary(); + this.AddActionIDs(this.ActionRoot); } ModuleAction result; - return actions.TryGetValue(id, out result) ? result : null; + return this.actions.TryGetValue(id, out result) ? result : null; } private void ProcessNode(DNNNode dnnNode) { if (!dnnNode.IsBreak) { - var action = FindAction(Convert.ToInt32(dnnNode.Key)); + var action = this.FindAction(Convert.ToInt32(dnnNode.Key)); if (action != null) { dnnNode.set_CustomAttribute("CommandName", action.CommandName); @@ -153,12 +153,12 @@ private void ProcessNode(DNNNode dnnNode) dnnNode.JSFunction = string.Format( "if({0}){{{1}}};", dnnNode.JSFunction, - Page.ClientScript.GetPostBackEventReference(navProvider.NavigationControl, dnnNode.ID)); + this.Page.ClientScript.GetPostBackEventReference(this.navProvider.NavigationControl, dnnNode.ID)); } foreach (DNNNode node in dnnNode.DNNNodes) { - ProcessNode(node); + this.ProcessNode(node); } } @@ -166,25 +166,25 @@ private void SetMenuDefaults() { try { - navProvider.StyleIconWidth = 15M; - navProvider.MouseOutHideDelay = 500M; - navProvider.MouseOverAction = NavigationProvider.HoverAction.Expand; - navProvider.MouseOverDisplay = NavigationProvider.HoverDisplay.None; - navProvider.CSSControl = "ModuleTitle_MenuBar"; - navProvider.CSSContainerRoot = "ModuleTitle_MenuContainer"; - navProvider.CSSNode = "ModuleTitle_MenuItem"; - navProvider.CSSIcon = "ModuleTitle_MenuIcon"; - navProvider.CSSContainerSub = "ModuleTitle_SubMenu"; - navProvider.CSSBreak = "ModuleTitle_MenuBreak"; - navProvider.CSSNodeHover = "ModuleTitle_MenuItemSel"; - navProvider.CSSIndicateChildSub = "ModuleTitle_MenuArrow"; - navProvider.CSSIndicateChildRoot = "ModuleTitle_RootMenuArrow"; - navProvider.PathImage = Globals.ApplicationPath + "/Images/"; - navProvider.PathSystemImage = Globals.ApplicationPath + "/Images/"; - navProvider.IndicateChildImageSub = "action_right.gif"; - navProvider.IndicateChildren = true; - navProvider.StyleRoot = "background-color: Transparent; font-size: 1pt;"; - navProvider.NodeClick += ActionClick; + this.navProvider.StyleIconWidth = 15M; + this.navProvider.MouseOutHideDelay = 500M; + this.navProvider.MouseOverAction = NavigationProvider.HoverAction.Expand; + this.navProvider.MouseOverDisplay = NavigationProvider.HoverDisplay.None; + this.navProvider.CSSControl = "ModuleTitle_MenuBar"; + this.navProvider.CSSContainerRoot = "ModuleTitle_MenuContainer"; + this.navProvider.CSSNode = "ModuleTitle_MenuItem"; + this.navProvider.CSSIcon = "ModuleTitle_MenuIcon"; + this.navProvider.CSSContainerSub = "ModuleTitle_SubMenu"; + this.navProvider.CSSBreak = "ModuleTitle_MenuBreak"; + this.navProvider.CSSNodeHover = "ModuleTitle_MenuItemSel"; + this.navProvider.CSSIndicateChildSub = "ModuleTitle_MenuArrow"; + this.navProvider.CSSIndicateChildRoot = "ModuleTitle_RootMenuArrow"; + this.navProvider.PathImage = Globals.ApplicationPath + "/Images/"; + this.navProvider.PathSystemImage = Globals.ApplicationPath + "/Images/"; + this.navProvider.IndicateChildImageSub = "action_right.gif"; + this.navProvider.IndicateChildren = true; + this.navProvider.StyleRoot = "background-color: Transparent; font-size: 1pt;"; + this.navProvider.NodeClick += this.ActionClick; } catch (Exception exc) { diff --git a/DNN Platform/Modules/DDRMenu/Common/DNNContext.cs b/DNN Platform/Modules/DDRMenu/Common/DNNContext.cs index 8b9fc8f2f55..d7542090aea 100644 --- a/DNN Platform/Modules/DDRMenu/Common/DNNContext.cs +++ b/DNN Platform/Modules/DDRMenu/Common/DNNContext.cs @@ -22,16 +22,16 @@ public class DNNContext : IDisposable public Control HostControl { get; private set; } private Page _Page; - public Page Page { get { return _Page ?? (_Page = HostControl.Page); } } + public Page Page { get { return this._Page ?? (this._Page = this.HostControl.Page); } } private PortalSettings _PortalSettings; - public PortalSettings PortalSettings { get { return _PortalSettings ?? (_PortalSettings = PortalController.Instance.GetCurrentPortalSettings()); } } + public PortalSettings PortalSettings { get { return this._PortalSettings ?? (this._PortalSettings = PortalController.Instance.GetCurrentPortalSettings()); } } private TabInfo _ActiveTab; - public TabInfo ActiveTab { get { return _ActiveTab ?? (_ActiveTab = PortalSettings.ActiveTab); } } + public TabInfo ActiveTab { get { return this._ActiveTab ?? (this._ActiveTab = this.PortalSettings.ActiveTab); } } private string _SkinPath; - public string SkinPath { get { return _SkinPath ?? (_SkinPath = ActiveTab.SkinPath); } } + public string SkinPath { get { return this._SkinPath ?? (this._SkinPath = this.ActiveTab.SkinPath); } } private static string _ModuleName; public static string ModuleName { get { return _ModuleName ?? (_ModuleName = GetModuleNameFromAssembly()); } } @@ -53,15 +53,15 @@ public static string ModuleFolder public DNNContext(Control hostControl) { - HostControl = hostControl; + this.HostControl = hostControl; - savedContext = Current; + this.savedContext = Current; Current = this; } public string ResolveUrl(string relativeUrl) { - return HostControl.ResolveUrl(relativeUrl); + return this.HostControl.ResolveUrl(relativeUrl); } private static string GetModuleNameFromAssembly() @@ -74,7 +74,7 @@ private static string GetModuleNameFromAssembly() public void Dispose() { - Current = savedContext; + Current = this.savedContext; } } } diff --git a/DNN Platform/Modules/DDRMenu/Common/PathResolver.cs b/DNN Platform/Modules/DDRMenu/Common/PathResolver.cs index 8e49ebdee1b..497bd6e5081 100644 --- a/DNN Platform/Modules/DDRMenu/Common/PathResolver.cs +++ b/DNN Platform/Modules/DDRMenu/Common/PathResolver.cs @@ -82,9 +82,9 @@ public string Resolve(string path, params RelativeTo[] roots) resolvedPath = Path.Combine("~/", path); break; case RelativeTo.Manifest: - if (!string.IsNullOrEmpty(manifestFolder)) + if (!string.IsNullOrEmpty(this.manifestFolder)) { - resolvedPath = Path.Combine(manifestFolder + "/", path); + resolvedPath = Path.Combine(this.manifestFolder + "/", path); } break; case RelativeTo.Module: diff --git a/DNN Platform/Modules/DDRMenu/DDRMenuControl.cs b/DNN Platform/Modules/DDRMenu/DDRMenuControl.cs index 685cec9d1ce..59c3cf7c217 100644 --- a/DNN Platform/Modules/DDRMenu/DDRMenuControl.cs +++ b/DNN Platform/Modules/DDRMenu/DDRMenuControl.cs @@ -29,29 +29,29 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - MenuSettings.MenuStyle = MenuSettings.MenuStyle ?? "DNNMenu"; - menu = MenuBase.Instantiate(MenuSettings.MenuStyle); - menu.RootNode = RootNode ?? new MenuNode(); - menu.SkipLocalisation = SkipLocalisation; - menu.ApplySettings(MenuSettings); + this.MenuSettings.MenuStyle = this.MenuSettings.MenuStyle ?? "DNNMenu"; + this.menu = MenuBase.Instantiate(this.MenuSettings.MenuStyle); + this.menu.RootNode = this.RootNode ?? new MenuNode(); + this.menu.SkipLocalisation = this.SkipLocalisation; + this.menu.ApplySettings(this.MenuSettings); - menu.PreRender(); + this.menu.PreRender(); } } protected override void Render(HtmlTextWriter htmlWriter) { using (new DNNContext(this)) - menu.Render(htmlWriter); + this.menu.Render(htmlWriter); } public void RaisePostBackEvent(string eventArgument) { using (new DNNContext(this)) { - if (NodeClick != null) + if (this.NodeClick != null) { - NodeClick(eventArgument); + this.NodeClick(eventArgument); } } } diff --git a/DNN Platform/Modules/DDRMenu/DDRMenuNavigationProvider.cs b/DNN Platform/Modules/DDRMenu/DDRMenuNavigationProvider.cs index 6bdb1ca2c99..719e3c147e5 100644 --- a/DNN Platform/Modules/DDRMenu/DDRMenuNavigationProvider.cs +++ b/DNN Platform/Modules/DDRMenu/DDRMenuNavigationProvider.cs @@ -96,7 +96,7 @@ public class DDRMenuNavigationProvider : NavigationProvider private DDRMenuControl menuControl; - public override Control NavigationControl { get { return menuControl; } } + public override Control NavigationControl { get { return this.menuControl; } } public override string ControlID { get; set; } @@ -110,13 +110,13 @@ public class DDRMenuNavigationProvider : NavigationProvider public override void Initialize() { - menuControl = new DDRMenuControl {ID = ControlID, EnableViewState = false}; - menuControl.NodeClick += RaiseEvent_NodeClick; + this.menuControl = new DDRMenuControl {ID = this.ControlID, EnableViewState = false}; + this.menuControl.NodeClick += this.RaiseEvent_NodeClick; } public override void Bind(DNNNodeCollection objNodes) { - Bind(objNodes, true); + this.Bind(objNodes, true); } public void Bind(DNNNodeCollection objNodes, bool localise) @@ -161,9 +161,9 @@ public void Bind(DNNNodeCollection objNodes, bool localise) } } - if (CustomAttributes != null) + if (this.CustomAttributes != null) { - foreach (var attr in CustomAttributes) + foreach (var attr in this.CustomAttributes) { if (!string.IsNullOrEmpty(attr.Name)) { @@ -177,29 +177,29 @@ public void Bind(DNNNodeCollection objNodes, bool localise) objNodes = Localiser.LocaliseDNNNodeCollection(objNodes); } - menuControl.RootNode = new MenuNode(objNodes); - menuControl.SkipLocalisation = !localise; - menuControl.MenuSettings = new Settings + this.menuControl.RootNode = new MenuNode(objNodes); + this.menuControl.SkipLocalisation = !localise; + this.menuControl.MenuSettings = new Settings { - MenuStyle = GetCustomAttribute("MenuStyle") ?? MenuStyle ?? "DNNMenu", - NodeXmlPath = GetCustomAttribute("NodeXmlPath"), - NodeSelector = GetCustomAttribute("NodeSelector"), - IncludeContext = Convert.ToBoolean(GetCustomAttribute("IncludeContext") ?? "false"), - IncludeHidden = Convert.ToBoolean(GetCustomAttribute("IncludeHidden") ?? "false"), - IncludeNodes = GetCustomAttribute("IncludeNodes"), - ExcludeNodes = GetCustomAttribute("ExcludeNodes"), - NodeManipulator = GetCustomAttribute("NodeManipulator"), + MenuStyle = this.GetCustomAttribute("MenuStyle") ?? this.MenuStyle ?? "DNNMenu", + NodeXmlPath = this.GetCustomAttribute("NodeXmlPath"), + NodeSelector = this.GetCustomAttribute("NodeSelector"), + IncludeContext = Convert.ToBoolean(this.GetCustomAttribute("IncludeContext") ?? "false"), + IncludeHidden = Convert.ToBoolean(this.GetCustomAttribute("IncludeHidden") ?? "false"), + IncludeNodes = this.GetCustomAttribute("IncludeNodes"), + ExcludeNodes = this.GetCustomAttribute("ExcludeNodes"), + NodeManipulator = this.GetCustomAttribute("NodeManipulator"), ClientOptions = clientOptions, - TemplateArguments = TemplateArguments, + TemplateArguments = this.TemplateArguments, }; } private string GetCustomAttribute(string attributeName) { string xmlValue = null; - if (CustomAttributes != null) + if (this.CustomAttributes != null) { - var xmlAttr = CustomAttributes.Find(a => a.Name.Equals(attributeName, StringComparison.InvariantCultureIgnoreCase)); + var xmlAttr = this.CustomAttributes.Find(a => a.Name.Equals(attributeName, StringComparison.InvariantCultureIgnoreCase)); if (xmlAttr != null) { xmlValue = xmlAttr.Value; diff --git a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj index 1627b9c13b8..f50c76dee9e 100644 --- a/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj +++ b/DNN Platform/Modules/DDRMenu/DotNetNuke.Modules.DDRMenu.csproj @@ -181,6 +181,9 @@ + + stylecop.json + Designer @@ -209,6 +212,10 @@ + + + + diff --git a/DNN Platform/Modules/DDRMenu/Localisation/Apollo.cs b/DNN Platform/Modules/DDRMenu/Localisation/Apollo.cs index 678c5f758a5..c9393472c7d 100644 --- a/DNN Platform/Modules/DDRMenu/Localisation/Apollo.cs +++ b/DNN Platform/Modules/DDRMenu/Localisation/Apollo.cs @@ -22,7 +22,7 @@ public class Apollo : ILocalisation [Obsolete("Deprecated in 9.4.0, due to limited developer support. Scheduled removal in v10.0.0.")] public bool HaveApi() { - if (!haveChecked) + if (!this.haveChecked) { try { @@ -30,7 +30,7 @@ public bool HaveApi() { var api = Activator.CreateInstance("Apollo.LocalizationApi", "Apollo.DNN_Localization.LocalizeTab").Unwrap(); var apiType = api.GetType(); - apiMember = apiType.GetMethod("getLocalizedTab", new[] {typeof(TabInfo)}); + this.apiMember = apiType.GetMethod("getLocalizedTab", new[] {typeof(TabInfo)}); } } // ReSharper disable EmptyGeneralCatchClause @@ -38,16 +38,16 @@ public bool HaveApi() // ReSharper restore EmptyGeneralCatchClause { } - haveChecked = true; + this.haveChecked = true; } - return (apiMember != null); + return (this.apiMember != null); } [Obsolete("Deprecated in 9.4.0, due to limited developer support. Scheduled removal in v10.0.0.")] public TabInfo LocaliseTab(TabInfo tab, int portalId) { - return apiMember.Invoke(null, new object[] {tab}) as TabInfo ?? tab; + return this.apiMember.Invoke(null, new object[] {tab}) as TabInfo ?? tab; } [Obsolete("Deprecated in 9.4.0, due to limited developer support. Scheduled removal in v10.0.0.")] diff --git a/DNN Platform/Modules/DDRMenu/Localisation/Ealo.cs b/DNN Platform/Modules/DDRMenu/Localisation/Ealo.cs index 3c5dabee500..5766e6f9d80 100644 --- a/DNN Platform/Modules/DDRMenu/Localisation/Ealo.cs +++ b/DNN Platform/Modules/DDRMenu/Localisation/Ealo.cs @@ -23,13 +23,13 @@ public class Ealo : ILocalisation [Obsolete("Deprecated in 9.4.0, due to limited developer support. Scheduled removal in v10.0.0.")] public bool HaveApi() { - if (!haveChecked) + if (!this.haveChecked) { - found = (DesktopModuleController.GetDesktopModuleByModuleName("effority.Ealo.Tabs", PortalSettings.Current.PortalId) != null); - haveChecked = true; + this.found = (DesktopModuleController.GetDesktopModuleByModuleName("effority.Ealo.Tabs", PortalSettings.Current.PortalId) != null); + this.haveChecked = true; } - return found; + return this.found; } [Obsolete("Deprecated in 9.4.0, due to limited developer support. Scheduled removal in v10.0.0.")] diff --git a/DNN Platform/Modules/DDRMenu/Localisation/Generic.cs b/DNN Platform/Modules/DDRMenu/Localisation/Generic.cs index d76a35e2dd2..3037eee9cf4 100644 --- a/DNN Platform/Modules/DDRMenu/Localisation/Generic.cs +++ b/DNN Platform/Modules/DDRMenu/Localisation/Generic.cs @@ -22,7 +22,7 @@ public class Generic : ILocalisation public bool HaveApi() { - if (!haveChecked) + if (!this.haveChecked) { var modules = DesktopModuleController.GetDesktopModules(PortalSettings.Current.PortalId); foreach (var moduleKeyPair in modules) @@ -31,23 +31,23 @@ public bool HaveApi() { try { - locApi = Reflection.CreateObject(moduleKeyPair.Value.BusinessControllerClass, moduleKeyPair.Value.BusinessControllerClass); - locTab = locApi.GetType().GetMethod("LocaliseTab", new[] {typeof(TabInfo), typeof(int)}); - if (locTab != null) + this.locApi = Reflection.CreateObject(moduleKeyPair.Value.BusinessControllerClass, moduleKeyPair.Value.BusinessControllerClass); + this.locTab = this.locApi.GetType().GetMethod("LocaliseTab", new[] {typeof(TabInfo), typeof(int)}); + if (this.locTab != null) { - if (locTab.IsStatic) + if (this.locTab.IsStatic) { - locApi = null; + this.locApi = null; } break; } - locNodes = locApi.GetType().GetMethod("LocaliseNodes", new[] {typeof(DNNNodeCollection)}); - if (locNodes != null) + this.locNodes = this.locApi.GetType().GetMethod("LocaliseNodes", new[] {typeof(DNNNodeCollection)}); + if (this.locNodes != null) { - if (locNodes.IsStatic) + if (this.locNodes.IsStatic) { - locApi = null; + this.locApi = null; } break; } @@ -59,20 +59,20 @@ public bool HaveApi() // ReSharper restore EmptyGeneralCatchClause } } - haveChecked = true; + this.haveChecked = true; } - return (locTab != null) || (locNodes != null); + return (this.locTab != null) || (this.locNodes != null); } public TabInfo LocaliseTab(TabInfo tab, int portalId) { - return (locTab == null) ? null : (TabInfo)locTab.Invoke(locApi, new object[] {tab, portalId}); + return (this.locTab == null) ? null : (TabInfo)this.locTab.Invoke(this.locApi, new object[] {tab, portalId}); } public DNNNodeCollection LocaliseNodes(DNNNodeCollection nodes) { - return (locNodes == null) ? null : (DNNNodeCollection)locNodes.Invoke(locApi, new object[] {nodes}); + return (this.locNodes == null) ? null : (DNNNodeCollection)this.locNodes.Invoke(this.locApi, new object[] {nodes}); } } } diff --git a/DNN Platform/Modules/DDRMenu/Localisation/Localiser.cs b/DNN Platform/Modules/DDRMenu/Localisation/Localiser.cs index 0320cd9d5c7..83ad974c460 100644 --- a/DNN Platform/Modules/DDRMenu/Localisation/Localiser.cs +++ b/DNN Platform/Modules/DDRMenu/Localisation/Localiser.cs @@ -49,7 +49,7 @@ public void LocaliseNode(MenuNode node) var tab = (node.TabId > 0) ? TabController.Instance.GetTab(node.TabId, Null.NullInteger, false) : null; if (tab != null) { - var localised = LocaliseTab(tab); + var localised = this.LocaliseTab(tab); tab = localised ?? tab; if (localised != null) @@ -72,12 +72,12 @@ public void LocaliseNode(MenuNode node) node.TabId = -1; } - node.Children.ForEach(LocaliseNode); + node.Children.ForEach(this.LocaliseNode); } private TabInfo LocaliseTab(TabInfo tab) { - return (LocalisationApi == null) ? null : LocalisationApi.LocaliseTab(tab, portalId); + return (LocalisationApi == null) ? null : LocalisationApi.LocaliseTab(tab, this.portalId); } } } diff --git a/DNN Platform/Modules/DDRMenu/MenuBase.cs b/DNN Platform/Modules/DDRMenu/MenuBase.cs index 381f69060b1..1b9f18f8974 100644 --- a/DNN Platform/Modules/DDRMenu/MenuBase.cs +++ b/DNN Platform/Modules/DDRMenu/MenuBase.cs @@ -46,10 +46,10 @@ public static MenuBase Instantiate(string menuStyle) public TemplateDefinition TemplateDef { get; set; } private HttpContext currentContext; - private HttpContext CurrentContext { get { return currentContext ?? (currentContext = HttpContext.Current); } } + private HttpContext CurrentContext { get { return this.currentContext ?? (this.currentContext = HttpContext.Current); } } private PortalSettings hostPortalSettings; - internal PortalSettings HostPortalSettings { get { return hostPortalSettings ?? (hostPortalSettings = PortalController.Instance.GetCurrentPortalSettings()); } } + internal PortalSettings HostPortalSettings { get { return this.hostPortalSettings ?? (this.hostPortalSettings = PortalController.Instance.GetCurrentPortalSettings()); } } private readonly Dictionary nodeSelectorAliases = new Dictionary { @@ -60,96 +60,96 @@ public static MenuBase Instantiate(string menuStyle) internal void ApplySettings(Settings settings) { - menuSettings = settings; + this.menuSettings = settings; } internal virtual void PreRender() { - TemplateDef.AddTemplateArguments(menuSettings.TemplateArguments, true); - TemplateDef.AddClientOptions(menuSettings.ClientOptions, true); + this.TemplateDef.AddTemplateArguments(this.menuSettings.TemplateArguments, true); + this.TemplateDef.AddClientOptions(this.menuSettings.ClientOptions, true); - if (!String.IsNullOrEmpty(menuSettings.NodeXmlPath)) + if (!String.IsNullOrEmpty(this.menuSettings.NodeXmlPath)) { - LoadNodeXml(); + this.LoadNodeXml(); } - if (!String.IsNullOrEmpty(menuSettings.NodeSelector)) + if (!String.IsNullOrEmpty(this.menuSettings.NodeSelector)) { - ApplyNodeSelector(); + this.ApplyNodeSelector(); } - if (!String.IsNullOrEmpty(menuSettings.IncludeNodes)) + if (!String.IsNullOrEmpty(this.menuSettings.IncludeNodes)) { - FilterNodes(menuSettings.IncludeNodes, false); + this.FilterNodes(this.menuSettings.IncludeNodes, false); } - if (!String.IsNullOrEmpty(menuSettings.ExcludeNodes)) + if (!String.IsNullOrEmpty(this.menuSettings.ExcludeNodes)) { - FilterNodes(menuSettings.ExcludeNodes, true); + this.FilterNodes(this.menuSettings.ExcludeNodes, true); } - if (String.IsNullOrEmpty(menuSettings.NodeXmlPath) && !SkipLocalisation) + if (String.IsNullOrEmpty(this.menuSettings.NodeXmlPath) && !this.SkipLocalisation) { - new Localiser(HostPortalSettings.PortalId).LocaliseNode(RootNode); + new Localiser(this.HostPortalSettings.PortalId).LocaliseNode(this.RootNode); } - if (!String.IsNullOrEmpty(menuSettings.NodeManipulator)) + if (!String.IsNullOrEmpty(this.menuSettings.NodeManipulator)) { - ApplyNodeManipulator(); + this.ApplyNodeManipulator(); } - if (!menuSettings.IncludeHidden) + if (!this.menuSettings.IncludeHidden) { - FilterHiddenNodes(RootNode); + this.FilterHiddenNodes(this.RootNode); } var imagePathOption = - menuSettings.ClientOptions.Find(o => o.Name.Equals("PathImage", StringComparison.InvariantCultureIgnoreCase)); - RootNode.ApplyContext( + this.menuSettings.ClientOptions.Find(o => o.Name.Equals("PathImage", StringComparison.InvariantCultureIgnoreCase)); + this.RootNode.ApplyContext( imagePathOption == null ? DNNContext.Current.PortalSettings.HomeDirectory : imagePathOption.Value); - TemplateDef.PreRender(); + this.TemplateDef.PreRender(); } internal void Render(HtmlTextWriter htmlWriter) { if (Host.DebugMode) { - htmlWriter.Write("", menuSettings.MenuStyle); + htmlWriter.Write("", this.menuSettings.MenuStyle); } UserInfo user = null; - if (menuSettings.IncludeContext) + if (this.menuSettings.IncludeContext) { user = UserController.Instance.GetCurrentUserInfo(); user.Roles = user.Roles; // Touch roles to populate } - TemplateDef.AddClientOptions(new List {new ClientString("MenuStyle", menuSettings.MenuStyle)}, false); + this.TemplateDef.AddClientOptions(new List {new ClientString("MenuStyle", this.menuSettings.MenuStyle)}, false); - TemplateDef.Render(new MenuXml {root = RootNode, user = user}, htmlWriter); + this.TemplateDef.Render(new MenuXml {root = this.RootNode, user = user}, htmlWriter); } private void LoadNodeXml() { - menuSettings.NodeXmlPath = - MapPath( - new PathResolver(TemplateDef.Folder).Resolve( - menuSettings.NodeXmlPath, + this.menuSettings.NodeXmlPath = + this.MapPath( + new PathResolver(this.TemplateDef.Folder).Resolve( + this.menuSettings.NodeXmlPath, PathResolver.RelativeTo.Manifest, PathResolver.RelativeTo.Skin, PathResolver.RelativeTo.Module, PathResolver.RelativeTo.Portal, PathResolver.RelativeTo.Dnn)); - var cache = CurrentContext.Cache; - RootNode = cache[menuSettings.NodeXmlPath] as MenuNode; - if (RootNode != null) + var cache = this.CurrentContext.Cache; + this.RootNode = cache[this.menuSettings.NodeXmlPath] as MenuNode; + if (this.RootNode != null) { return; } - using (var reader = XmlReader.Create(menuSettings.NodeXmlPath)) + using (var reader = XmlReader.Create(this.menuSettings.NodeXmlPath)) { reader.ReadToFollowing("root"); - RootNode = (MenuNode)(new XmlSerializer(typeof(MenuNode), "").Deserialize(reader)); + this.RootNode = (MenuNode)(new XmlSerializer(typeof(MenuNode), "").Deserialize(reader)); } - cache.Insert(menuSettings.NodeXmlPath, RootNode, new CacheDependency(menuSettings.NodeXmlPath)); + cache.Insert(this.menuSettings.NodeXmlPath, this.RootNode, new CacheDependency(this.menuSettings.NodeXmlPath)); } private void FilterNodes(string nodeString, bool exclude) @@ -165,7 +165,7 @@ private void FilterNodes(string nodeString, bool exclude) { var roleName = nodeText.Substring(1, nodeText.Length - 2); filteredNodes.AddRange( - RootNode.Children.FindAll( + this.RootNode.Children.FindAll( n => { var tab = TabController.Instance.GetTab(n.TabId, Null.NullInteger, false); @@ -187,7 +187,7 @@ private void FilterNodes(string nodeString, bool exclude) { //flatten nodes first. tagged pages should be flattened and not heirarchical if (flattenedNodes != new MenuNode()) - flattenedNodes.Children = RootNode.FlattenChildren(RootNode); + flattenedNodes.Children = this.RootNode.FlattenChildren(this.RootNode); filteredNodes.AddRange( flattenedNodes.Children.FindAll( @@ -201,20 +201,20 @@ private void FilterNodes(string nodeString, bool exclude) } else { - filteredNodes.Add(RootNode.FindByNameOrId(nodeText)); + filteredNodes.Add(this.RootNode.FindByNameOrId(nodeText)); } } // if filtered for foksonomy tags, use flat tree to get all related pages in nodeselection if (flattenedNodes.HasChildren()) - RootNode = flattenedNodes; + this.RootNode = flattenedNodes; if (exclude) { - RootNode.RemoveAll(filteredNodes); + this.RootNode.RemoveAll(filteredNodes); } else { - RootNode.Children.RemoveAll(n => filteredNodes.Contains(n) == exclude); + this.RootNode.Children.RemoveAll(n => filteredNodes.Contains(n) == exclude); } } @@ -232,22 +232,22 @@ private void FilterHiddenNodes(MenuNode parentNode) parentNode.Children.RemoveAll(n => filteredNodes.Contains(n)); - parentNode.Children.ForEach(FilterHiddenNodes); + parentNode.Children.ForEach(this.FilterHiddenNodes); } private void ApplyNodeSelector() { string selector; - if (!nodeSelectorAliases.TryGetValue(menuSettings.NodeSelector.ToLowerInvariant(), out selector)) + if (!this.nodeSelectorAliases.TryGetValue(this.menuSettings.NodeSelector.ToLowerInvariant(), out selector)) { - selector = menuSettings.NodeSelector; + selector = this.menuSettings.NodeSelector; } var selectorSplit = SplitAndTrim(selector); - var currentTabId = HostPortalSettings.ActiveTab.TabID; + var currentTabId = this.HostPortalSettings.ActiveTab.TabID; - var newRoot = RootNode; + var newRoot = this.RootNode; var rootSelector = selectorSplit[0]; if (rootSelector != "*") @@ -255,23 +255,23 @@ private void ApplyNodeSelector() if (rootSelector.StartsWith("+")) { var depth = Convert.ToInt32(rootSelector); - newRoot = RootNode; + newRoot = this.RootNode; for (var i = 0; i <= depth; i++) { newRoot = newRoot.Children.Find(n => n.Breadcrumb); if (newRoot == null) { - RootNode = new MenuNode(); + this.RootNode = new MenuNode(); return; } } } else if (rootSelector.StartsWith("-") || rootSelector == "0" || rootSelector == ".") { - newRoot = RootNode.FindById(currentTabId); + newRoot = this.RootNode.FindById(currentTabId); if (newRoot == null) { - RootNode = new MenuNode(); + this.RootNode = new MenuNode(); return; } @@ -288,17 +288,17 @@ private void ApplyNodeSelector() } else { - newRoot = RootNode.FindByNameOrId(rootSelector); + newRoot = this.RootNode.FindByNameOrId(rootSelector); if (newRoot == null) { - RootNode = new MenuNode(); + this.RootNode = new MenuNode(); return; } } } // ReSharper disable PossibleNullReferenceException - RootNode = new MenuNode(newRoot.Children); + this.RootNode = new MenuNode(newRoot.Children); // ReSharper restore PossibleNullReferenceException if (selectorSplit.Count > 1) @@ -306,17 +306,17 @@ private void ApplyNodeSelector() for (var n = Convert.ToInt32(selectorSplit[1]); n > 0; n--) { var newChildren = new List(); - foreach (var child in RootNode.Children) + foreach (var child in this.RootNode.Children) { newChildren.AddRange(child.Children); } - RootNode = new MenuNode(newChildren); + this.RootNode = new MenuNode(newChildren); } } if (selectorSplit.Count > 2) { - var newChildren = RootNode.Children; + var newChildren = this.RootNode.Children; for (var n = Convert.ToInt32(selectorSplit[2]); n > 0; n--) { var nextChildren = new List(); @@ -335,15 +335,15 @@ private void ApplyNodeSelector() private void ApplyNodeManipulator() { - RootNode = + this.RootNode = new MenuNode( - ((INodeManipulator)Activator.CreateInstance(BuildManager.GetType(menuSettings.NodeManipulator, true, true))). - ManipulateNodes(RootNode.Children, HostPortalSettings)); + ((INodeManipulator)Activator.CreateInstance(BuildManager.GetType(this.menuSettings.NodeManipulator, true, true))). + ManipulateNodes(this.RootNode.Children, this.HostPortalSettings)); } protected string MapPath(string path) { - return String.IsNullOrEmpty(path) ? "" : Path.GetFullPath(CurrentContext.Server.MapPath(path)); + return String.IsNullOrEmpty(path) ? "" : Path.GetFullPath(this.CurrentContext.Server.MapPath(path)); } private static List SplitAndTrim(string str) diff --git a/DNN Platform/Modules/DDRMenu/MenuNode.cs b/DNN Platform/Modules/DDRMenu/MenuNode.cs index 6f16ef92afe..c81691d4fcb 100644 --- a/DNN Platform/Modules/DDRMenu/MenuNode.cs +++ b/DNN Platform/Modules/DDRMenu/MenuNode.cs @@ -37,8 +37,8 @@ public static List ConvertDNNNodeCollection(DNNNodeCollection dnnNodes public string LargeImage { get; set; } public string CommandName { get; set; } public string CommandArgument { get; set; } - public bool First { get { return (Parent == null) || (Parent.Children[0] == this); } } - public bool Last { get { return (Parent == null) || (Parent.Children[Parent.Children.Count - 1] == this); } } + public bool First { get { return (this.Parent == null) || (this.Parent.Children[0] == this); } } + public bool Last { get { return (this.Parent == null) || (this.Parent.Children[this.Parent.Children.Count - 1] == this); } } public string Target { get; set; } public int Depth @@ -60,7 +60,7 @@ public int Depth public string Description { get; set; } private List _Children; - public List Children { get { return _Children ?? (_Children = new List()); } set { _Children = value; } } + public List Children { get { return this._Children ?? (this._Children = new List()); } set { this._Children = value; } } public MenuNode Parent { get; set; } @@ -70,47 +70,47 @@ public MenuNode() public MenuNode(DNNNodeCollection dnnNodes) { - Children = ConvertDNNNodeCollection(dnnNodes, this); + this.Children = ConvertDNNNodeCollection(dnnNodes, this); } public MenuNode(List nodes) { - Children = nodes; - Children.ForEach(c => c.Parent = this); + this.Children = nodes; + this.Children.ForEach(c => c.Parent = this); } public MenuNode(DNNNode dnnNode, MenuNode parent) { - TabId = Convert.ToInt32(dnnNode.ID); - Text = dnnNode.Text; - Url = (dnnNode.ClickAction == eClickAction.PostBack) + this.TabId = Convert.ToInt32(dnnNode.ID); + this.Text = dnnNode.Text; + this.Url = (dnnNode.ClickAction == eClickAction.PostBack) ? "postback:" + dnnNode.ID : String.IsNullOrEmpty(dnnNode.JSFunction) ? dnnNode.NavigateURL : "javascript:" + dnnNode.JSFunction; - Enabled = dnnNode.Enabled; - Selected = dnnNode.Selected; - Breadcrumb = dnnNode.BreadCrumb; - Separator = dnnNode.IsBreak; - Icon = dnnNode.Image; - Target = dnnNode.Target; - Title = null; - Keywords = null; - Description = null; - Parent = parent; - CommandName = dnnNode.get_CustomAttribute("CommandName"); - CommandArgument = dnnNode.get_CustomAttribute("CommandArgument"); + this.Enabled = dnnNode.Enabled; + this.Selected = dnnNode.Selected; + this.Breadcrumb = dnnNode.BreadCrumb; + this.Separator = dnnNode.IsBreak; + this.Icon = dnnNode.Image; + this.Target = dnnNode.Target; + this.Title = null; + this.Keywords = null; + this.Description = null; + this.Parent = parent; + this.CommandName = dnnNode.get_CustomAttribute("CommandName"); + this.CommandArgument = dnnNode.get_CustomAttribute("CommandArgument"); DNNAbstract.DNNNodeToMenuNode(dnnNode, this); if ((dnnNode.DNNNodes != null) && (dnnNode.DNNNodes.Count > 0)) - Children = ConvertDNNNodeCollection(dnnNode.DNNNodes, this); + this.Children = ConvertDNNNodeCollection(dnnNode.DNNNodes, this); } public MenuNode FindById(int tabId) { - if (tabId == TabId) + if (tabId == this.TabId) return this; - foreach (var child in Children) + foreach (var child in this.Children) { var result = child.FindById(tabId); if (result != null) @@ -122,10 +122,10 @@ public MenuNode FindById(int tabId) public MenuNode FindByName(string tabName) { - if (tabName.Equals(Text, StringComparison.InvariantCultureIgnoreCase)) + if (tabName.Equals(this.Text, StringComparison.InvariantCultureIgnoreCase)) return this; - foreach (var child in Children) + foreach (var child in this.Children) { var result = child.FindByName(tabName); if (result != null) @@ -150,7 +150,7 @@ public List FlattenChildren(MenuNode root) { foreach (var child in children) { - flattened.AddRange(FlattenChildren(child)); + flattened.AddRange(this.FlattenChildren(child)); } } @@ -159,12 +159,12 @@ public List FlattenChildren(MenuNode root) public MenuNode FindByNameOrId(string tabNameOrId) { - if (tabNameOrId.Equals(Text, StringComparison.InvariantCultureIgnoreCase)) + if (tabNameOrId.Equals(this.Text, StringComparison.InvariantCultureIgnoreCase)) return this; - if (tabNameOrId == TabId.ToString()) + if (tabNameOrId == this.TabId.ToString()) return this; - foreach (var child in Children) + foreach (var child in this.Children) { var result = child.FindByNameOrId(tabNameOrId); if (result != null) @@ -177,7 +177,7 @@ public MenuNode FindByNameOrId(string tabNameOrId) internal void RemoveAll(List filteredNodes) { this.Children.RemoveAll(filteredNodes.Contains); - foreach (var child in Children) + foreach (var child in this.Children) { child.RemoveAll(filteredNodes); } @@ -185,21 +185,21 @@ internal void RemoveAll(List filteredNodes) public bool HasChildren() { - return (Children.Count > 0); + return (this.Children.Count > 0); } internal void ApplyContext(string defaultImagePath) { - Icon = ApplyContextToImagePath(Icon, defaultImagePath); - LargeImage = ApplyContextToImagePath(LargeImage, defaultImagePath); + this.Icon = this.ApplyContextToImagePath(this.Icon, defaultImagePath); + this.LargeImage = this.ApplyContextToImagePath(this.LargeImage, defaultImagePath); - if (Url != null && Url.StartsWith("postback:")) + if (this.Url != null && this.Url.StartsWith("postback:")) { var postbackControl = DNNContext.Current.HostControl; - Url = postbackControl.Page.ClientScript.GetPostBackClientHyperlink(postbackControl, Url.Substring(9)); + this.Url = postbackControl.Page.ClientScript.GetPostBackClientHyperlink(postbackControl, this.Url.Substring(9)); } - Children.ForEach(c => c.ApplyContext(defaultImagePath)); + this.Children.ForEach(c => c.ApplyContext(defaultImagePath)); } private string ApplyContextToImagePath(string imagePath, string defaultImagePath) @@ -231,43 +231,43 @@ public void ReadXml(XmlReader reader) switch (reader.Name.ToLowerInvariant()) { case "id": - TabId = Convert.ToInt32(reader.Value); + this.TabId = Convert.ToInt32(reader.Value); break; case "text": - Text = reader.Value; + this.Text = reader.Value; break; case "title": - Title = reader.Value; + this.Title = reader.Value; break; case "url": - Url = reader.Value; + this.Url = reader.Value; break; case "enabled": - Enabled = (reader.Value == "1"); + this.Enabled = (reader.Value == "1"); break; case "selected": - Selected = (reader.Value == "1"); + this.Selected = (reader.Value == "1"); break; case "breadcrumb": - Breadcrumb = (reader.Value == "1"); + this.Breadcrumb = (reader.Value == "1"); break; case "separator": - Separator = (reader.Value == "1"); + this.Separator = (reader.Value == "1"); break; case "icon": - Icon = reader.Value; + this.Icon = reader.Value; break; case "largeimage": - LargeImage = reader.Value; + this.LargeImage = reader.Value; break; case "commandname": - CommandName = reader.Value; + this.CommandName = reader.Value; break; case "commandargument": - CommandArgument = reader.Value; + this.CommandArgument = reader.Value; break; case "target": - Target = reader.Value; + this.Target = reader.Value; break; //default: // throw new XmlException(String.Format("Unexpected attribute '{0}'", reader.Name)); @@ -289,13 +289,13 @@ public void ReadXml(XmlReader reader) case "node": var child = new MenuNode { Parent = this }; child.ReadXml(reader); - Children.Add(child); + this.Children.Add(child); break; case "keywords": - Keywords = reader.ReadElementContentAsString().Trim(); + this.Keywords = reader.ReadElementContentAsString().Trim(); break; case "description": - Description = reader.ReadElementContentAsString().Trim(); + this.Description = reader.ReadElementContentAsString().Trim(); break; case "root": break; @@ -312,34 +312,34 @@ public void ReadXml(XmlReader reader) public void WriteXml(XmlWriter writer) { - if (Parent != null) + if (this.Parent != null) { writer.WriteStartElement("node"); - AddXmlAttribute(writer, "id", TabId); - AddXmlAttribute(writer, "text", Text); - AddXmlAttribute(writer, "title", Title); - AddXmlAttribute(writer, "url", Url); - AddXmlAttribute(writer, "enabled", Enabled); - AddXmlAttribute(writer, "selected", Selected); - AddXmlAttribute(writer, "breadcrumb", Breadcrumb); - AddXmlAttribute(writer, "separator", Separator); - AddXmlAttribute(writer, "target", Target); - AddXmlAttribute(writer, "icon", Icon); - AddXmlAttribute(writer, "largeimage", LargeImage); - AddXmlAttribute(writer, "commandname", CommandName); - AddXmlAttribute(writer, "commandargument", CommandArgument); - AddXmlAttribute(writer, "first", First); - AddXmlAttribute(writer, "last", Last); - AddXmlAttribute(writer, "only", First && Last); - AddXmlAttribute(writer, "depth", Depth); - AddXmlElement(writer, "keywords", Keywords); - AddXmlElement(writer, "description", Description); + AddXmlAttribute(writer, "id", this.TabId); + AddXmlAttribute(writer, "text", this.Text); + AddXmlAttribute(writer, "title", this.Title); + AddXmlAttribute(writer, "url", this.Url); + AddXmlAttribute(writer, "enabled", this.Enabled); + AddXmlAttribute(writer, "selected", this.Selected); + AddXmlAttribute(writer, "breadcrumb", this.Breadcrumb); + AddXmlAttribute(writer, "separator", this.Separator); + AddXmlAttribute(writer, "target", this.Target); + AddXmlAttribute(writer, "icon", this.Icon); + AddXmlAttribute(writer, "largeimage", this.LargeImage); + AddXmlAttribute(writer, "commandname", this.CommandName); + AddXmlAttribute(writer, "commandargument", this.CommandArgument); + AddXmlAttribute(writer, "first", this.First); + AddXmlAttribute(writer, "last", this.Last); + AddXmlAttribute(writer, "only", this.First && this.Last); + AddXmlAttribute(writer, "depth", this.Depth); + AddXmlElement(writer, "keywords", this.Keywords); + AddXmlElement(writer, "description", this.Description); } - Children.ForEach(c => c.WriteXml(writer)); + this.Children.ForEach(c => c.WriteXml(writer)); - if (Parent != null) + if (this.Parent != null) writer.WriteEndElement(); } diff --git a/DNN Platform/Modules/DDRMenu/MenuSettings.ascx.cs b/DNN Platform/Modules/DDRMenu/MenuSettings.ascx.cs index 70bb0e481c6..959b2ef2342 100644 --- a/DNN Platform/Modules/DDRMenu/MenuSettings.ascx.cs +++ b/DNN Platform/Modules/DDRMenu/MenuSettings.ascx.cs @@ -11,40 +11,40 @@ partial class MenuSettings : ModuleSettingsBase { public override void LoadSettings() { - if (IsPostBack) + if (this.IsPostBack) { return; } - MenuStyle.Value = Settings["MenuStyle"] ?? ""; - NodeXmlPath.Value = Settings["NodeXmlPath"] ?? ""; - NodeSelector.Value = Settings["NodeSelector"] ?? ""; - IncludeNodes.Value = Settings["IncludeNodes"] ?? ""; - ExcludeNodes.Value = Settings["ExcludeNodes"] ?? ""; - NodeManipulator.Value = Settings["NodeManipulator"] ?? ""; - IncludeContext.Value = Convert.ToBoolean(Settings["IncludeContext"] ?? "false"); - IncludeHidden.Value = Convert.ToBoolean(Settings["IncludeHidden"] ?? "false"); - TemplateArguments.Value = Settings["TemplateArguments"] ?? ""; - ClientOptions.Value = Settings["ClientOptions"] ?? ""; + this.MenuStyle.Value = this.Settings["MenuStyle"] ?? ""; + this.NodeXmlPath.Value = this.Settings["NodeXmlPath"] ?? ""; + this.NodeSelector.Value = this.Settings["NodeSelector"] ?? ""; + this.IncludeNodes.Value = this.Settings["IncludeNodes"] ?? ""; + this.ExcludeNodes.Value = this.Settings["ExcludeNodes"] ?? ""; + this.NodeManipulator.Value = this.Settings["NodeManipulator"] ?? ""; + this.IncludeContext.Value = Convert.ToBoolean(this.Settings["IncludeContext"] ?? "false"); + this.IncludeHidden.Value = Convert.ToBoolean(this.Settings["IncludeHidden"] ?? "false"); + this.TemplateArguments.Value = this.Settings["TemplateArguments"] ?? ""; + this.ClientOptions.Value = this.Settings["ClientOptions"] ?? ""; } public override void UpdateSettings() { - ModuleController.Instance.UpdateModuleSetting(ModuleId, "MenuStyle", (MenuStyle.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "NodeXmlPath", (NodeXmlPath.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "NodeSelector", (NodeSelector.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "IncludeNodes", (IncludeNodes.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ExcludeNodes", (ExcludeNodes.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "NodeManipulator", (NodeManipulator.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "IncludeContext", (IncludeContext.Value ?? "false").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "IncludeHidden", (IncludeHidden.Value ?? "false").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "TemplateArguments", (TemplateArguments.Value ?? "").ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ClientOptions", (ClientOptions.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "MenuStyle", (this.MenuStyle.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "NodeXmlPath", (this.NodeXmlPath.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "NodeSelector", (this.NodeSelector.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "IncludeNodes", (this.IncludeNodes.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ExcludeNodes", (this.ExcludeNodes.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "NodeManipulator", (this.NodeManipulator.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "IncludeContext", (this.IncludeContext.Value ?? "false").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "IncludeHidden", (this.IncludeHidden.Value ?? "false").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "TemplateArguments", (this.TemplateArguments.Value ?? "").ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ClientOptions", (this.ClientOptions.Value ?? "").ToString()); } protected override void OnPreRender(EventArgs e) { - IncludeHiddenSection.Visible = DNNAbstract.IncludeHiddenSupported(); + this.IncludeHiddenSection.Visible = DNNAbstract.IncludeHiddenSupported(); } } } diff --git a/DNN Platform/Modules/DDRMenu/MenuView.ascx.cs b/DNN Platform/Modules/DDRMenu/MenuView.ascx.cs index 6cc8bbf9d73..25c18d23ef3 100644 --- a/DNN Platform/Modules/DDRMenu/MenuView.ascx.cs +++ b/DNN Platform/Modules/DDRMenu/MenuView.ascx.cs @@ -23,27 +23,27 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - var menuStyle = GetStringSetting("MenuStyle"); + var menuStyle = this.GetStringSetting("MenuStyle"); if (String.IsNullOrEmpty(menuStyle)) { - menu = null; + this.menu = null; return; } var menuSettings = new Settings { - MenuStyle = GetStringSetting("MenuStyle"), - NodeXmlPath = GetStringSetting("NodeXmlPath"), - NodeSelector = GetStringSetting("NodeSelector"), - IncludeContext = GetBoolSetting("IncludeContext"), - IncludeHidden = GetBoolSetting("IncludeHidden"), - IncludeNodes = GetStringSetting("IncludeNodes"), - ExcludeNodes = GetStringSetting("ExcludeNodes"), - NodeManipulator = GetStringSetting("NodeManipulator"), + MenuStyle = this.GetStringSetting("MenuStyle"), + NodeXmlPath = this.GetStringSetting("NodeXmlPath"), + NodeSelector = this.GetStringSetting("NodeSelector"), + IncludeContext = this.GetBoolSetting("IncludeContext"), + IncludeHidden = this.GetBoolSetting("IncludeHidden"), + IncludeNodes = this.GetStringSetting("IncludeNodes"), + ExcludeNodes = this.GetStringSetting("ExcludeNodes"), + NodeManipulator = this.GetStringSetting("NodeManipulator"), TemplateArguments = - DDRMenu.Settings.TemplateArgumentsFromSettingString(GetStringSetting("TemplateArguments")), + DDRMenu.Settings.TemplateArgumentsFromSettingString(this.GetStringSetting("TemplateArguments")), ClientOptions = - DDRMenu.Settings.ClientOptionsFromSettingString(GetStringSetting("ClientOptions")) + DDRMenu.Settings.ClientOptionsFromSettingString(this.GetStringSetting("ClientOptions")) }; MenuNode rootNode = null; @@ -53,18 +53,18 @@ protected override void OnPreRender(EventArgs e) new MenuNode( Localiser.LocaliseDNNNodeCollection( Navigation.GetNavigationNodes( - ClientID, + this.ClientID, Navigation.ToolTipSource.None, -1, -1, DNNAbstract.GetNavNodeOptions(true)))); } - menu = MenuBase.Instantiate(menuStyle); - menu.RootNode = rootNode; - menu.ApplySettings(menuSettings); + this.menu = MenuBase.Instantiate(menuStyle); + this.menu.RootNode = rootNode; + this.menu.ApplySettings(menuSettings); - menu.PreRender(); + this.menu.PreRender(); } catch (Exception exc) { @@ -80,13 +80,13 @@ protected override void Render(HtmlTextWriter htmlWriter) try { base.Render(htmlWriter); - if (menu == null) + if (this.menu == null) { htmlWriter.WriteEncodedText("Please specify menu style in settings."); } else { - menu.Render(htmlWriter); + this.menu.Render(htmlWriter); } } catch (Exception exc) diff --git a/DNN Platform/Modules/DDRMenu/ModuleBase.cs b/DNN Platform/Modules/DDRMenu/ModuleBase.cs index b1a4c4d1d8a..cbf13d6bf4c 100644 --- a/DNN Platform/Modules/DDRMenu/ModuleBase.cs +++ b/DNN Platform/Modules/DDRMenu/ModuleBase.cs @@ -11,10 +11,10 @@ public class ModuleBase : PortalModuleBase { protected String GetStringSetting(String name, String defaultValue) { - var result = Request.QueryString[name]; + var result = this.Request.QueryString[name]; if (String.IsNullOrEmpty(result)) { - result = (String)Settings[name]; + result = (String)this.Settings[name]; } if (String.IsNullOrEmpty(result)) { @@ -35,28 +35,28 @@ protected String GetStringSetting(String name, String defaultValue) protected String GetStringSetting(String name) { - return GetStringSetting(name, ""); + return this.GetStringSetting(name, ""); } protected Int32 GetIntSetting(String name, Int32 defaultValue) { - return Convert.ToInt32(GetStringSetting(name, defaultValue.ToString())); + return Convert.ToInt32(this.GetStringSetting(name, defaultValue.ToString())); } protected Int32 GetIntSetting(String name) { - return GetIntSetting(name, 0); + return this.GetIntSetting(name, 0); } protected Boolean GetBoolSetting(String name, Boolean defaultValue) { - var result = GetStringSetting(name); + var result = this.GetStringSetting(name); return (result == "") ? defaultValue : Convert.ToBoolean(result); } protected Boolean GetBoolSetting(String name) { - return GetBoolSetting(name, false); + return this.GetBoolSetting(name, false); } } } diff --git a/DNN Platform/Modules/DDRMenu/Settings.cs b/DNN Platform/Modules/DDRMenu/Settings.cs index cd7e72e7f40..a48c6dd86e3 100644 --- a/DNN Platform/Modules/DDRMenu/Settings.cs +++ b/DNN Platform/Modules/DDRMenu/Settings.cs @@ -23,10 +23,10 @@ public class Settings public bool IncludeHidden { get; set; } private List clientOptions; - public List ClientOptions { get { return clientOptions ?? (clientOptions = new List()); } set { clientOptions = value; } } + public List ClientOptions { get { return this.clientOptions ?? (this.clientOptions = new List()); } set { this.clientOptions = value; } } private List templateArguments; - public List TemplateArguments { get { return templateArguments ?? (templateArguments = new List()); } set { templateArguments = value; } } + public List TemplateArguments { get { return this.templateArguments ?? (this.templateArguments = new List()); } set { this.templateArguments = value; } } public static Settings FromXml(string xml) { @@ -48,7 +48,7 @@ public override string ToString() { try { - return ToXml(); + return this.ToXml(); } catch (Exception exc) { diff --git a/DNN Platform/Modules/DDRMenu/SkinObject.cs b/DNN Platform/Modules/DDRMenu/SkinObject.cs index f155b35e99a..5f2646e7c97 100644 --- a/DNN Platform/Modules/DDRMenu/SkinObject.cs +++ b/DNN Platform/Modules/DDRMenu/SkinObject.cs @@ -44,36 +44,36 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - menu = MenuBase.Instantiate(MenuStyle); - menu.ApplySettings( + this.menu = MenuBase.Instantiate(this.MenuStyle); + this.menu.ApplySettings( new Settings { - MenuStyle = MenuStyle, - NodeXmlPath = NodeXmlPath, - NodeSelector = NodeSelector, - IncludeContext = IncludeContext, - IncludeHidden = IncludeHidden, - IncludeNodes = IncludeNodes, - ExcludeNodes = ExcludeNodes, - NodeManipulator = NodeManipulator, - ClientOptions = ClientOptions, - TemplateArguments = TemplateArguments + MenuStyle = this.MenuStyle, + NodeXmlPath = this.NodeXmlPath, + NodeSelector = this.NodeSelector, + IncludeContext = this.IncludeContext, + IncludeHidden = this.IncludeHidden, + IncludeNodes = this.IncludeNodes, + ExcludeNodes = this.ExcludeNodes, + NodeManipulator = this.NodeManipulator, + ClientOptions = this.ClientOptions, + TemplateArguments = this.TemplateArguments }); - if (String.IsNullOrEmpty(NodeXmlPath)) + if (String.IsNullOrEmpty(this.NodeXmlPath)) { - menu.RootNode = + this.menu.RootNode = new MenuNode( Localiser.LocaliseDNNNodeCollection( Navigation.GetNavigationNodes( - ClientID, + this.ClientID, Navigation.ToolTipSource.None, -1, -1, DNNAbstract.GetNavNodeOptions(true)))); } - menu.PreRender(); + this.menu.PreRender(); } catch (Exception exc) { @@ -89,7 +89,7 @@ protected override void Render(HtmlTextWriter writer) try { base.Render(writer); - menu.Render(writer); + this.menu.Render(writer); } catch (Exception exc) { diff --git a/DNN Platform/Modules/DDRMenu/TemplateEngine/ClientOption.cs b/DNN Platform/Modules/DDRMenu/TemplateEngine/ClientOption.cs index 03293c1301a..a5c634ad183 100644 --- a/DNN Platform/Modules/DDRMenu/TemplateEngine/ClientOption.cs +++ b/DNN Platform/Modules/DDRMenu/TemplateEngine/ClientOption.cs @@ -20,8 +20,8 @@ public ClientOption() public ClientOption(string name, string value) { - Name = name; - Value = value; + this.Name = name; + this.Value = value; } } @@ -33,8 +33,8 @@ public ClientString() public ClientString(string name, string value) { - Name = name; - Value = value; + this.Name = name; + this.Value = value; } } @@ -46,8 +46,8 @@ public ClientNumber() public ClientNumber(string name, string value) { - Name = name; - Value = value; + this.Name = name; + this.Value = value; } } @@ -59,8 +59,8 @@ public ClientBoolean() public ClientBoolean(string name, string value) { - Name = name; - Value = value; + this.Name = name; + this.Value = value; } } } diff --git a/DNN Platform/Modules/DDRMenu/TemplateEngine/RazorTemplateProcessor.cs b/DNN Platform/Modules/DDRMenu/TemplateEngine/RazorTemplateProcessor.cs index bf1ec18f5d2..e958bfbb471 100644 --- a/DNN Platform/Modules/DDRMenu/TemplateEngine/RazorTemplateProcessor.cs +++ b/DNN Platform/Modules/DDRMenu/TemplateEngine/RazorTemplateProcessor.cs @@ -45,7 +45,7 @@ public void Render(object source, HtmlTextWriter htmlWriter, TemplateDefinition model.SkinPath = resolver.Resolve("/", PathResolver.RelativeTo.Skin); var modelDictionary = model as IDictionary; liveDefinition.TemplateArguments.ForEach(a => modelDictionary.Add(a.Name, a.Value)); - htmlWriter.Write(RenderTemplate(liveDefinition.TemplateVirtualPath, model)); + htmlWriter.Write(this.RenderTemplate(liveDefinition.TemplateVirtualPath, model)); } } diff --git a/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateArgument.cs b/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateArgument.cs index d28e8864c1e..f2fb5d3c459 100644 --- a/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateArgument.cs +++ b/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateArgument.cs @@ -15,8 +15,8 @@ public TemplateArgument() public TemplateArgument(string name, string value) { - Name = name; - Value = value; + this.Name = name; + this.Value = value; } } } diff --git a/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateDefinition.cs b/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateDefinition.cs index 56bec4fc0a6..cbbe18379ca 100644 --- a/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateDefinition.cs +++ b/DNN Platform/Modules/DDRMenu/TemplateEngine/TemplateDefinition.cs @@ -279,13 +279,13 @@ private static string GetObjectCheckScript(string jsObject) public TemplateDefinition Clone() { - return (TemplateDefinition)MemberwiseClone(); + return (TemplateDefinition)this.MemberwiseClone(); } public void Reset() { - ClientOptions = new List(DefaultClientOptions); - TemplateArguments = new List(DefaultTemplateArguments); + this.ClientOptions = new List(this.DefaultClientOptions); + this.TemplateArguments = new List(this.DefaultTemplateArguments); } public void AddClientOptions(List options, bool replace) @@ -297,11 +297,11 @@ public void AddClientOptions(List options, bool replace) var option1 = option; if (replace) { - ClientOptions.RemoveAll(o => o.Name == option1.Name); + this.ClientOptions.RemoveAll(o => o.Name == option1.Name); } - if (!ClientOptions.Exists(o => o.Name == option1.Name)) + if (!this.ClientOptions.Exists(o => o.Name == option1.Name)) { - ClientOptions.Add(option); + this.ClientOptions.Add(option); } } } @@ -316,11 +316,11 @@ public void AddTemplateArguments(List args, bool replace) var arg1 = arg; if (replace) { - TemplateArguments.RemoveAll(a => a.Name == arg1.Name); + this.TemplateArguments.RemoveAll(a => a.Name == arg1.Name); } - if (!TemplateArguments.Exists(a => a.Name == arg1.Name)) + if (!this.TemplateArguments.Exists(a => a.Name == arg1.Name)) { - TemplateArguments.Add(arg); + this.TemplateArguments.Add(arg); } } } @@ -330,17 +330,17 @@ internal void PreRender() { var page = DNNContext.Current.Page; - foreach (var stylesheet in StyleSheets) + foreach (var stylesheet in this.StyleSheets) { ClientResourceManager.RegisterStyleSheet(page, stylesheet); } - foreach (var scriptUrl in ScriptUrls) + foreach (var scriptUrl in this.ScriptUrls) { ClientResourceManager.RegisterScript(page, scriptUrl); } - foreach (var libraryInfo in ScriptLibraries) + foreach (var libraryInfo in this.ScriptLibraries) { var libraryName = libraryInfo.Key; var parameters = libraryInfo.Value; @@ -360,23 +360,23 @@ internal void PreRender() } } - foreach (var scriptKey in ScriptKeys) + foreach (var scriptKey in this.ScriptKeys) { var clientScript = page.ClientScript; if (!clientScript.IsClientScriptBlockRegistered(typeof(TemplateDefinition), scriptKey)) { - clientScript.RegisterClientScriptBlock(typeof(TemplateDefinition), scriptKey, Scripts[scriptKey], false); + clientScript.RegisterClientScriptBlock(typeof(TemplateDefinition), scriptKey, this.Scripts[scriptKey], false); } } - var headContent = String.IsNullOrEmpty(TemplateHeadPath) ? "" : Utilities.CachedFileContent(TemplateHeadPath); + var headContent = String.IsNullOrEmpty(this.TemplateHeadPath) ? "" : Utilities.CachedFileContent(this.TemplateHeadPath); var expandedHead = RegexLinks.Replace(headContent, "$1" + DNNContext.Current.ActiveTab.SkinPath + "$3"); page.Header.Controls.Add(new LiteralControl(expandedHead)); } internal void Render(object source, HtmlTextWriter htmlWriter) { - Processor.Render(source, htmlWriter, this); + this.Processor.Render(source, htmlWriter, this); } } } diff --git a/DNN Platform/Modules/DDRMenu/TemplateEngine/TokenTemplateProcessor.cs b/DNN Platform/Modules/DDRMenu/TemplateEngine/TokenTemplateProcessor.cs index 52955b637c3..28852378bac 100644 --- a/DNN Platform/Modules/DDRMenu/TemplateEngine/TokenTemplateProcessor.cs +++ b/DNN Platform/Modules/DDRMenu/TemplateEngine/TokenTemplateProcessor.cs @@ -147,8 +147,8 @@ public bool LoadDefinition(TemplateDefinition baseDefinition) } current.AppendChild(xml.CreateTextNode(templateText.Substring(index))); - xsl = new XslCompiledTransform(); - xsl.Load(xml); + this.xsl = new XslCompiledTransform(); + this.xsl.Load(xml); return true; } @@ -173,7 +173,7 @@ public void Render(object source, HtmlTextWriter htmlWriter, TemplateDefinition { Utilities.SerialiserFor(source.GetType()).Serialize(xmlStream, source); xmlStream.Seek(0, SeekOrigin.Begin); - xsl.Transform(XmlReader.Create(xmlStream), args, outputWriter); + this.xsl.Transform(XmlReader.Create(xmlStream), args, outputWriter); } htmlWriter.Write(HttpUtility.HtmlDecode(sb.ToString())); diff --git a/DNN Platform/Modules/DDRMenu/TemplateEngine/XsltTemplateProcessor.cs b/DNN Platform/Modules/DDRMenu/TemplateEngine/XsltTemplateProcessor.cs index f88deba340e..4fd658a07f6 100644 --- a/DNN Platform/Modules/DDRMenu/TemplateEngine/XsltTemplateProcessor.cs +++ b/DNN Platform/Modules/DDRMenu/TemplateEngine/XsltTemplateProcessor.cs @@ -29,7 +29,7 @@ public bool LoadDefinition(TemplateDefinition baseDefinition) return false; } - xsl = Utilities.CachedXslt(baseDefinition.TemplatePath); + this.xsl = Utilities.CachedXslt(baseDefinition.TemplatePath); return true; } catch (Exception) @@ -60,7 +60,7 @@ public void Render(object source, HtmlTextWriter htmlWriter, TemplateDefinition { Utilities.SerialiserFor(source.GetType()).Serialize(xmlStream, source); xmlStream.Seek(0, SeekOrigin.Begin); - xsl.Transform(XmlReader.Create(xmlStream), args, htmlWriter); + this.xsl.Transform(XmlReader.Create(xmlStream), args, htmlWriter); } } diff --git a/DNN Platform/Modules/DDRMenu/packages.config b/DNN Platform/Modules/DDRMenu/packages.config index 015e7e36813..4fca05e5f8c 100644 --- a/DNN Platform/Modules/DDRMenu/packages.config +++ b/DNN Platform/Modules/DDRMenu/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsController.cs b/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsController.cs index 78e9c35130b..be3f074e06f 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsController.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsController.cs @@ -78,7 +78,7 @@ private IEnumerable GetPermissionViewModelCollection(IFolde // TODO Split permission between CE and PE packages string[] permissionKeys = { "ADD", "BROWSE", "COPY", "READ", "WRITE", "DELETE", "MANAGE", "VIEW", "FULLCONTROL" }; - return permissionKeys.Select(permissionKey => new PermissionViewModel { Key = permissionKey, Value = HasPermission(folder, permissionKey) }).ToList(); + return permissionKeys.Select(permissionKey => new PermissionViewModel { Key = permissionKey, Value = this.HasPermission(folder, permissionKey) }).ToList(); } private FolderMappingViewModel GetFolderMappingViewModel(FolderMappingInfo folderMapping) @@ -140,10 +140,10 @@ private List GetFolderPreviewFields(IFolderInfo folder) { var fields = new List { - GetFolderSizeField(folder), - GetTotalFilesField(folder) + this.GetFolderSizeField(folder), + this.GetTotalFilesField(folder) }; - fields.AddRange(GetAuditFields((FolderInfo)folder, folder.PortalID)); + fields.AddRange(this.GetAuditFields((FolderInfo)folder, folder.PortalID)); return fields; } @@ -151,10 +151,10 @@ private List GetFilePreviewFields(IFileInfo file) { var fields = new List { - GetFileKindField(file), - GetFileSizeField(file), + this.GetFileKindField(file), + this.GetFileSizeField(file), }; - fields.AddRange(GetAuditFields((FileInfo)file, file.PortalId)); + fields.AddRange(this.GetAuditFields((FileInfo)file, file.PortalId)); return fields; } @@ -210,11 +210,11 @@ private bool AreMappedPathsSupported(int folderMappingId) private string GetUnlinkAllowedStatus(IFolderInfo folder) { - if (AreMappedPathsSupported(folder.FolderMappingID) && folder.ParentID > 0 && GetFolder(folder.ParentID).FolderMappingID != folder.FolderMappingID) + if (this.AreMappedPathsSupported(folder.FolderMappingID) && folder.ParentID > 0 && this.GetFolder(folder.ParentID).FolderMappingID != folder.FolderMappingID) { return "onlyUnlink"; } - if (AreMappedPathsSupported(folder.FolderMappingID)) + if (this.AreMappedPathsSupported(folder.FolderMappingID)) { return "true"; } @@ -227,7 +227,7 @@ private string GetUnlinkAllowedStatus(IFolderInfo folder) public IEnumerable GetDefaultFolderProviderValues(int moduleId) { - var portalId = GetCurrentPortalId(moduleId); + var portalId = this.GetCurrentPortalId(moduleId); return new List { @@ -247,7 +247,7 @@ public IEnumerable GetDefaultFolderProviderValues(int moduleI var folderTypeId = SettingsRepository.GetDefaultFolderTypeId(moduleId); if (!folderTypeId.HasValue) { - folderTypeId = FolderMappingController.Instance.GetDefaultFolderMapping(GetCurrentPortalId(moduleId)).FolderMappingID; + folderTypeId = FolderMappingController.Instance.GetDefaultFolderMapping(this.GetCurrentPortalId(moduleId)).FolderMappingID; } return folderTypeId; } @@ -269,7 +269,7 @@ public int GetCurrentPortalId(int moduleId) public IEnumerable GetFolderMappings(int moduleId) { var portalId = this.GetCurrentPortalId(moduleId); - return FolderMappingController.Instance.GetFolderMappings(portalId).Select(GetFolderMappingViewModel); + return FolderMappingController.Instance.GetFolderMappings(portalId).Select(this.GetFolderMappingViewModel); } public IEnumerable GetFolders(int moduleId, int folderId) @@ -280,14 +280,14 @@ public IEnumerable GetFolders(int moduleId, int folderId) return new List(); } - var folder = GetFolderInfo(folderId); + var folder = this.GetFolderInfo(folderId); if (!FolderPermissionController.CanBrowseFolder((FolderInfo)folder)) { //The user cannot access the content return new List(); } - return AssetManager.Instance.GetFolders(folder, "FolderName", true).Select(GetFolderViewModel); + return AssetManager.Instance.GetFolders(folder, "FolderName", true).Select(this.GetFolderViewModel); } public PageViewModel GetFolderContent(int moduleId, int folderId, int startIndex, int numItems, string sortExpression) @@ -296,15 +296,15 @@ public PageViewModel GetFolderContent(int moduleId, int folderId, int startIndex var page = AssetManager.Instance.GetFolderContent(folderId, startIndex, numItems, sortExpression, subfolderFilter); return new PageViewModel { - Folder = GetFolderViewModel(page.Folder), - Items = page.Items.Select(GetItemViewModel).ToList(), + Folder = this.GetFolderViewModel(page.Folder), + Items = page.Items.Select(this.GetItemViewModel).ToList(), TotalCount = page.TotalCount }; } public void SyncFolderContent(int folderId, bool recursive) { - var folder = GetFolderInfo(folderId); + var folder = this.GetFolderInfo(folderId); if (!FolderPermissionController.CanBrowseFolder((FolderInfo)folder)) { @@ -322,15 +322,15 @@ public PageViewModel SearchFolderContent(int moduleId, int folderId, string patt return new PageViewModel { - Folder = GetFolderViewModel(page.Folder), - Items = page.Items.Select(GetItemViewModel).ToList(), + Folder = this.GetFolderViewModel(page.Folder), + Items = page.Items.Select(this.GetItemViewModel).ToList(), TotalCount = page.TotalCount }; } public FolderViewModel GetFolder(int folderID) { - return GetFolderViewModel(GetFolderInfo(folderID)); + return this.GetFolderViewModel(this.GetFolderInfo(folderID)); } public FolderViewModel GetRootFolder(int moduleId) @@ -363,7 +363,7 @@ public FolderViewModel GetGroupFolder(int groupId, PortalSettings portalSettings return null; } - var groupFolder = EnsureGroupFolder(groupId, portalSettings); + var groupFolder = this.EnsureGroupFolder(groupId, portalSettings); var folderViewModel = this.GetFolderViewModel(groupFolder); folderViewModel.FolderName = role.RoleName; return folderViewModel; @@ -407,26 +407,26 @@ private IFolderInfo EnsureGroupFolder(int groupId, PortalSettings portalSettings public FolderViewModel GetUserFolder(UserInfo userInfo) { - var folder = GetFolderViewModel(FolderManager.Instance.GetUserFolder(userInfo)); + var folder = this.GetFolderViewModel(FolderManager.Instance.GetUserFolder(userInfo)); folder.FolderName = LocalizationHelper.GetString("MyFolder"); return folder; } public FolderViewModel CreateFolder(string folderName, int folderParentID, int folderMappingID, string mappedPath) { - return GetFolderViewModel(AssetManager.Instance.CreateFolder( folderName,folderParentID, folderMappingID, mappedPath)); + return this.GetFolderViewModel(AssetManager.Instance.CreateFolder( folderName,folderParentID, folderMappingID, mappedPath)); } public ItemViewModel GetFile(int fileID) { - return GetItemViewModel(FileManager.Instance.GetFile(fileID, true)); + return this.GetItemViewModel(FileManager.Instance.GetFile(fileID, true)); } public void UnlinkFolder(int folderID) { var folder = FolderManager.Instance.GetFolder(folderID); // Check if user has appropiate permissions - if (!HasPermission(folder, "DELETE")) + if (!this.HasPermission(folder, "DELETE")) { throw new DotNetNukeException(LocalizationHelper.GetString("UserHasNoPermissionToUnlinkFolder.Error")); } @@ -441,11 +441,11 @@ public int GetMappedSubFoldersCount(IEnumerable items, int po return totalSubfoldersCount; } var allFolders = FolderManager.Instance.GetFolders(portalID); - foreach (var item in items.Where(i => i.IsFolder && HasPermission(FolderManager.Instance.GetFolder(i.ItemID), "VIEW"))) + foreach (var item in items.Where(i => i.IsFolder && this.HasPermission(FolderManager.Instance.GetFolder(i.ItemID), "VIEW"))) { var folder = FolderManager.Instance.GetFolder(item.ItemID); var allSubFolders = allFolders.Where(f => f.FolderPath.StartsWith(folder.FolderPath)); - totalSubfoldersCount = totalSubfoldersCount + allSubFolders.Count(f => GetUnlinkAllowedStatus(f) == "onlyUnlink"); + totalSubfoldersCount = totalSubfoldersCount + allSubFolders.Count(f => this.GetUnlinkAllowedStatus(f) == "onlyUnlink"); } return totalSubfoldersCount; } @@ -467,17 +467,17 @@ public IEnumerable DeleteItems(IEnumerable items) } } - return nonDeletedItems.Select(GetItemPathViewModel); + return nonDeletedItems.Select(this.GetItemPathViewModel); } public ItemViewModel RenameFile(int fileID, string newFileName) { - return GetItemViewModel(AssetManager.Instance.RenameFile(fileID, newFileName)); + return this.GetItemViewModel(AssetManager.Instance.RenameFile(fileID, newFileName)); } public FolderViewModel RenameFolder(int folderID, string newFolderName) { - return GetFolderViewModel(AssetManager.Instance.RenameFolder(folderID, newFolderName)); + return this.GetFolderViewModel(AssetManager.Instance.RenameFolder(folderID, newFolderName)); } public Stream GetFileContent(int fileId, out string fileName, out string contentType) @@ -485,7 +485,7 @@ public Stream GetFileContent(int fileId, out string fileName, out string content var file = FileManager.Instance.GetFile(fileId, true); var folder = FolderManager.Instance.GetFolder(file.FolderId); - if (!HasPermission(folder, "READ")) + if (!this.HasPermission(folder, "READ")) { throw new DotNetNukeException(LocalizationHelper.GetString("UserHasNoPermissionToDownload.Error")); } @@ -508,7 +508,7 @@ public CopyMoveItemViewModel CopyFile(int fileId, int destinationFolderId, bool var folder = FolderManager.Instance.GetFolder(destinationFolderId); var sourceFolder = FolderManager.Instance.GetFolder(file.FolderId); - if (!HasPermission(sourceFolder, "COPY")) + if (!this.HasPermission(sourceFolder, "COPY")) { throw new DotNetNukeException(LocalizationHelper.GetString("UserHasNoPermissionToCopyFolder.Error")); } @@ -541,7 +541,7 @@ public CopyMoveItemViewModel MoveFile(int fileId, int destinationFolderId, bool var file = FileManager.Instance.GetFile(fileId, true); var folder = FolderManager.Instance.GetFolder(destinationFolderId); var sourceFolder = FolderManager.Instance.GetFolder(file.FolderId); - if (!HasPermission(sourceFolder, "COPY")) + if (!this.HasPermission(sourceFolder, "COPY")) { throw new DotNetNukeException(LocalizationHelper.GetString("UserHasNoPermissionToMoveFolder.Error")); } @@ -563,8 +563,8 @@ public CopyMoveItemViewModel MoveFile(int fileId, int destinationFolderId, bool public CopyMoveItemViewModel MoveFolder(int folderId, int destinationFolderId, bool overwrite) { - var folder = GetFolderInfo(folderId); - if (!HasPermission(folder, "COPY")) + var folder = this.GetFolderInfo(folderId); + if (!this.HasPermission(folder, "COPY")) { throw new DotNetNukeException(LocalizationHelper.GetString("UserHasNoPermissionToMoveFolder.Error")); } @@ -581,7 +581,7 @@ public string GetUrl(int fileId) if (file != null) { var folder = FolderManager.Instance.GetFolder(file.FolderId); - if (!HasPermission(folder, "READ")) + if (!this.HasPermission(folder, "READ")) { throw new DotNetNukeException(LocalizationHelper.GetString("UserHasNoPermissionToDownload.Error")); } @@ -616,8 +616,8 @@ public virtual PreviewInfoViewModel GetFolderPreviewInfo(IFolderInfo folder) Title = LocalizationHelper.GetString("PreviewPanelTitle.Text"), ItemId = folder.FolderID, IsFolder = true, - PreviewImageUrl = GetFolderIconUrl(folder.PortalID, folder.FolderMappingID), - Fields = GetFolderPreviewFields(folder) + PreviewImageUrl = this.GetFolderIconUrl(folder.PortalID, folder.FolderMappingID), + Fields = this.GetFolderPreviewFields(folder) }; } @@ -629,7 +629,7 @@ public virtual PreviewInfoViewModel GetFilePreviewInfo(IFileInfo file, ItemViewM ItemId = file.FileId, IsFolder = false, PreviewImageUrl = item.IconUrl, - Fields = GetFilePreviewFields(file) + Fields = this.GetFilePreviewFields(file) }; return result; } @@ -669,7 +669,7 @@ protected ItemPathViewModel GetItemPathViewModel(IFolderInfo folder) IsFolder = true, ItemID = folder.FolderID, DisplayPath = folder.DisplayPath, - IconUrl = GetFolderIconUrl(folder.PortalID, folder.FolderMappingID) + IconUrl = this.GetFolderIconUrl(folder.PortalID, folder.FolderMappingID) }; } @@ -698,21 +698,21 @@ protected virtual FolderViewModel GetFolderViewModel(IFolderInfo folder) FolderPath = folder.FolderPath, PortalID = folder.PortalID, LastModifiedOnDate = folder.LastModifiedOnDate.ToString("g"), - IconUrl = GetFolderIconUrl(folder.PortalID, folder.FolderMappingID), - Permissions = GetPermissionViewModelCollection(folder), + IconUrl = this.GetFolderIconUrl(folder.PortalID, folder.FolderMappingID), + Permissions = this.GetPermissionViewModelCollection(folder), HasChildren = folder.HasChildren }; - folderViewModel.Attributes.Add(new KeyValuePair("UnlinkAllowedStatus", GetUnlinkAllowedStatus(folder))); + folderViewModel.Attributes.Add(new KeyValuePair("UnlinkAllowedStatus", this.GetUnlinkAllowedStatus(folder))); return folderViewModel; } private ItemViewModel GetItemViewModel(object item) { var folder = item as IFolderInfo; - if (folder != null) return GetItemViewModel(folder); + if (folder != null) return this.GetItemViewModel(folder); var file = item as IFileInfo; - return GetItemViewModel(file); + return this.GetItemViewModel(file); } protected virtual ItemViewModel GetItemViewModel(IFolderInfo folder) @@ -734,12 +734,12 @@ protected virtual ItemViewModel GetItemViewModel(IFolderInfo folder) ItemName = folder.FolderName, LastModifiedOnDate = folder.LastModifiedOnDate.ToString("g"), PortalID = folder.PortalID, - IconUrl = GetFolderIconUrl(folder.PortalID, folder.FolderMappingID), - Permissions = GetPermissionViewModelCollection(folder), + IconUrl = this.GetFolderIconUrl(folder.PortalID, folder.FolderMappingID), + Permissions = this.GetPermissionViewModelCollection(folder), ParentFolderID = parentFolderId, ParentFolder = parentFolderPath, FolderMappingID = folder.FolderMappingID, - UnlinkAllowedStatus = GetUnlinkAllowedStatus(folder) + UnlinkAllowedStatus = this.GetUnlinkAllowedStatus(folder) }; } @@ -754,7 +754,7 @@ protected virtual ItemViewModel GetItemViewModel(IFileInfo file) LastModifiedOnDate = file.LastModifiedOnDate.ToString("g"), PortalID = file.PortalId, IconUrl = GetFileIconUrl(file.Extension), - Permissions = GetPermissionViewModelCollection(folder), + Permissions = this.GetPermissionViewModelCollection(folder), ParentFolderID = folder.FolderID, ParentFolder = folder.FolderPath, Size = string.Format(new FileSizeFormatProvider(), "{0:fs}", file.Size), diff --git a/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsSettingsRepository.cs b/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsSettingsRepository.cs index fcad3871e08..e388557663a 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsSettingsRepository.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/Controllers/DigitalAssetsSettingsRepository.cs @@ -48,7 +48,7 @@ public DigitalAssestsMode GetMode(int moduleId) { DigitalAssestsMode mode; - if (!Enum.TryParse(GetSettingByKey(moduleId, ModeSetting), true, out mode)) + if (!Enum.TryParse(this.GetSettingByKey(moduleId, ModeSetting), true, out mode)) { return this.IsGroupMode(moduleId) ? DigitalAssestsMode.Group : DigitalAssestsMode.Normal; } @@ -116,7 +116,7 @@ private string GetSettingByKey(int moduleId, string key) internal bool SettingExists(int moduleId, string settingName) { - return !String.IsNullOrEmpty(GetSettingByKey(moduleId, settingName)); + return !String.IsNullOrEmpty(this.GetSettingByKey(moduleId, settingName)); } internal void SetDefaultFilterCondition(int moduleId) diff --git a/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/Field.cs b/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/Field.cs index 6af7d06c9a6..8469fd8dcd3 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/Field.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/Field.cs @@ -10,7 +10,7 @@ public class Field { public Field(string name) { - Name = name; + this.Name = name; } public string Name { get; private set; } diff --git a/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/FolderViewModel.cs b/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/FolderViewModel.cs index 4f92f3babf0..bf9a0b0ef29 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/FolderViewModel.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/Controllers/Models/FolderViewModel.cs @@ -10,7 +10,7 @@ public class FolderViewModel { public FolderViewModel() { - Attributes = new List>(); + this.Attributes = new List>(); } public int FolderID { get; set; } diff --git a/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/PropertiesTabContentControl.cs b/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/PropertiesTabContentControl.cs index 19bf51b9d78..babb61f7672 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/PropertiesTabContentControl.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/PropertiesTabContentControl.cs @@ -16,9 +16,9 @@ public class PropertiesTabContentControl : PortalModuleBase public virtual void ItemUpdated() { - if (OnItemUpdated != null) + if (this.OnItemUpdated != null) { - OnItemUpdated(); + this.OnItemUpdated(); } } diff --git a/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/DefaultMenuButtonItem.cs b/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/DefaultMenuButtonItem.cs index d2b97a4d4e0..7b7293b6fa3 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/DefaultMenuButtonItem.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/DefaultMenuButtonItem.cs @@ -16,14 +16,14 @@ public class DefaultMenuButtonItem : IMenuButtonItemExtensionPoint public DefaultMenuButtonItem(string itemId, string itemType, string itemCssClass, string itemText, string itemAction, string itemIcon, int itemOrder, string itemAttributes) { - ItemId = itemId; - Attributes = itemAttributes; - Type = itemType; - Text = itemText; - Icon = itemIcon; - Order = itemOrder; - CssClass = itemCssClass; - Action = itemAction; + this.ItemId = itemId; + this.Attributes = itemAttributes; + this.Type = itemType; + this.Text = itemText; + this.Icon = itemIcon; + this.Order = itemOrder; + this.CssClass = itemCssClass; + this.Action = itemAction; } public string ItemId { get; private set; } diff --git a/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/ManageFolderTypesToolBarButtonExtensionPoint.cs b/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/ManageFolderTypesToolBarButtonExtensionPoint.cs index fea7929ea0a..a28fab33f28 100644 --- a/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/ManageFolderTypesToolBarButtonExtensionPoint.cs +++ b/DNN Platform/Modules/DigitalAssets/Components/ExtensionPoint/ToolBarButton/ManageFolderTypesToolBarButtonExtensionPoint.cs @@ -35,18 +35,18 @@ public string Action { get { - if (ModuleContext == null) + if (this.ModuleContext == null) { return string.Empty; } if (PortalSettings.Current.EnablePopUps) { - return ModuleContext.EditUrl("FolderMappings"); + return this.ModuleContext.EditUrl("FolderMappings"); } else { - return string.Format("location.href = '{0}';", ModuleContext.EditUrl("FolderMappings")); + return string.Format("location.href = '{0}';", this.ModuleContext.EditUrl("FolderMappings")); } } } @@ -83,8 +83,8 @@ public int Order public bool Enabled { - get { return ModuleContext != null - && ModulePermissionController.CanManageModule(ModuleContext.Configuration); } + get { return this.ModuleContext != null + && ModulePermissionController.CanManageModule(this.ModuleContext.Configuration); } } public ModuleInstanceContext ModuleContext { get; set; } diff --git a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj index eab5609f596..4e948342e85 100644 --- a/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj +++ b/DNN Platform/Modules/DigitalAssets/DotNetNuke.Modules.DigitalAssets.csproj @@ -23,6 +23,7 @@ ..\..\..\ true + true @@ -348,6 +349,15 @@ + + + stylecop.json + + + + + + diff --git a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs index a2a22434eea..9abdbb5c472 100644 --- a/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs @@ -23,7 +23,7 @@ public partial class EditFolderMapping : PortalModuleBase private readonly INavigationManager _navigationManager; public EditFolderMapping() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Variables @@ -39,7 +39,7 @@ public int FolderPortalID { get { - return IsHostMenu ? Null.NullInteger : PortalId; + return this.IsHostMenu ? Null.NullInteger : this.PortalId; } } @@ -47,14 +47,14 @@ public int FolderMappingID { get { - if (_folderMappingID == Null.NullInteger) + if (this._folderMappingID == Null.NullInteger) { - if (!string.IsNullOrEmpty(Request.QueryString["ItemID"])) + if (!string.IsNullOrEmpty(this.Request.QueryString["ItemID"])) { - int.TryParse(Request.QueryString["ItemID"], out _folderMappingID); + int.TryParse(this.Request.QueryString["ItemID"], out this._folderMappingID); } } - return _folderMappingID; + return this._folderMappingID; } } @@ -66,44 +66,44 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (!UserInfo.IsSuperUser && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) + if (!this.UserInfo.IsSuperUser && !this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } - UpdateButton.Text = (FolderMappingID == Null.NullInteger) ? Localization.GetString("Add") : Localization.GetString("Update", LocalResourceFile); - CancelHyperLink.NavigateUrl = EditUrl("FolderMappings"); + this.UpdateButton.Text = (this.FolderMappingID == Null.NullInteger) ? Localization.GetString("Add") : Localization.GetString("Update", this.LocalResourceFile); + this.CancelHyperLink.NavigateUrl = this.EditUrl("FolderMappings"); - var controlTitle = Localization.GetString("ControlTitle", LocalResourceFile); - var controlTitlePrefix = (FolderMappingID == Null.NullInteger) ? Localization.GetString("New") : Localization.GetString("Edit"); + var controlTitle = Localization.GetString("ControlTitle", this.LocalResourceFile); + var controlTitlePrefix = (this.FolderMappingID == Null.NullInteger) ? Localization.GetString("New") : Localization.GetString("Edit"); - SyncWarningPlaceHolder.Visible = (FolderMappingID != Null.NullInteger); + this.SyncWarningPlaceHolder.Visible = (this.FolderMappingID != Null.NullInteger); - ModuleConfiguration.ModuleControl.ControlTitle = string.Format(controlTitle, controlTitlePrefix); + this.ModuleConfiguration.ModuleControl.ControlTitle = string.Format(controlTitle, controlTitlePrefix); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - UpdateButton.Click += cmdUpdate_Click; + this.UpdateButton.Click += this.cmdUpdate_Click; try { - BindFolderMappingSettings(); + this.BindFolderMappingSettings(); - if (!IsPostBack) + if (!this.IsPostBack) { - BindFolderProviders(); + this.BindFolderProviders(); - if (FolderMappingID != Null.NullInteger) + if (this.FolderMappingID != Null.NullInteger) { - BindFolderMapping(); + this.BindFolderMapping(); - if (ProviderSettingsPlaceHolder.Controls.Count > 0 && ProviderSettingsPlaceHolder.Controls[0] is FolderMappingSettingsControlBase) + if (this.ProviderSettingsPlaceHolder.Controls.Count > 0 && this.ProviderSettingsPlaceHolder.Controls[0] is FolderMappingSettingsControlBase) { - var folderMapping = _folderMappingController.GetFolderMapping(FolderMappingID); - var settingsControl = (FolderMappingSettingsControlBase)ProviderSettingsPlaceHolder.Controls[0]; + var folderMapping = this._folderMappingController.GetFolderMapping(this.FolderMappingID); + var settingsControl = (FolderMappingSettingsControlBase)this.ProviderSettingsPlaceHolder.Controls[0]; settingsControl.LoadSettings(folderMapping.FolderMappingSettings); } } @@ -117,42 +117,42 @@ protected override void OnLoad(EventArgs e) private void cmdUpdate_Click(object sender, EventArgs e) { - Page.Validate("vgEditFolderMapping"); + this.Page.Validate("vgEditFolderMapping"); - if (!Page.IsValid) return; + if (!this.Page.IsValid) return; try { var folderMapping = new FolderMappingInfo(); - if (FolderMappingID != Null.NullInteger) + if (this.FolderMappingID != Null.NullInteger) { - folderMapping = _folderMappingController.GetFolderMapping(FolderMappingID) ?? new FolderMappingInfo(); + folderMapping = this._folderMappingController.GetFolderMapping(this.FolderMappingID) ?? new FolderMappingInfo(); } - folderMapping.FolderMappingID = FolderMappingID; - folderMapping.MappingName = NameTextbox.Text; - folderMapping.FolderProviderType = FolderProvidersComboBox.SelectedValue; - folderMapping.PortalID = FolderPortalID; + folderMapping.FolderMappingID = this.FolderMappingID; + folderMapping.MappingName = this.NameTextbox.Text; + folderMapping.FolderProviderType = this.FolderProvidersComboBox.SelectedValue; + folderMapping.PortalID = this.FolderPortalID; var originalSettings = folderMapping.FolderMappingSettings; try { - var folderMappingID = FolderMappingID; + var folderMappingID = this.FolderMappingID; if (folderMappingID == Null.NullInteger) { - folderMappingID = _folderMappingController.AddFolderMapping(folderMapping); + folderMappingID = this._folderMappingController.AddFolderMapping(folderMapping); } else { - _folderMappingController.UpdateFolderMapping(folderMapping); + this._folderMappingController.UpdateFolderMapping(folderMapping); } - if (ProviderSettingsPlaceHolder.Controls.Count > 0 && ProviderSettingsPlaceHolder.Controls[0] is FolderMappingSettingsControlBase) + if (this.ProviderSettingsPlaceHolder.Controls.Count > 0 && this.ProviderSettingsPlaceHolder.Controls[0] is FolderMappingSettingsControlBase) { - var settingsControl = (FolderMappingSettingsControlBase)ProviderSettingsPlaceHolder.Controls[0]; + var settingsControl = (FolderMappingSettingsControlBase)this.ProviderSettingsPlaceHolder.Controls[0]; try { @@ -160,39 +160,39 @@ private void cmdUpdate_Click(object sender, EventArgs e) } catch { - if (FolderMappingID == Null.NullInteger) + if (this.FolderMappingID == Null.NullInteger) { - _folderMappingController.DeleteFolderMapping(FolderPortalID, folderMappingID); + this._folderMappingController.DeleteFolderMapping(this.FolderPortalID, folderMappingID); } return; } } - if (FolderMappingID != Null.NullInteger) + if (this.FolderMappingID != Null.NullInteger) { // Check if some setting has changed - var updatedSettings = _folderMappingController.GetFolderMappingSettings(FolderMappingID); + var updatedSettings = this._folderMappingController.GetFolderMappingSettings(this.FolderMappingID); if (originalSettings.Keys.Cast().Any(key => updatedSettings.ContainsKey(key) && !originalSettings[key].ToString().Equals(updatedSettings[key].ToString()))) { // Re-synchronize folders using the existing mapping. It's important to synchronize them in descending order - var folders = FolderManager.Instance.GetFolders(FolderPortalID).Where(f => f.FolderMappingID == FolderMappingID).OrderByDescending(f => f.FolderPath); + var folders = FolderManager.Instance.GetFolders(this.FolderPortalID).Where(f => f.FolderMappingID == this.FolderMappingID).OrderByDescending(f => f.FolderPath); foreach (var folder in folders) { - FolderManager.Instance.Synchronize(FolderPortalID, folder.FolderPath, false, true); + FolderManager.Instance.Synchronize(this.FolderPortalID, folder.FolderPath, false, true); } } } } catch { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("DuplicateMappingName", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("DuplicateMappingName", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } - if (!Response.IsRequestBeingRedirected) - Response.Redirect(_navigationManager.NavigateURL(TabId, "FolderMappings", "mid=" + ModuleId, "popUp=true")); + if (!this.Response.IsRequestBeingRedirected) + this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId, "FolderMappings", "mid=" + this.ModuleId, "popUp=true")); } catch (Exception exc) { @@ -202,7 +202,7 @@ private void cmdUpdate_Click(object sender, EventArgs e) protected void cboFolderProviders_SelectedIndexChanged(object sender, EventArgs e) { - BindFolderMappingSettings(); + this.BindFolderMappingSettings(); } #endregion @@ -215,33 +215,33 @@ private void BindFolderProviders() foreach (var provider in FolderProvider.GetProviderList().Keys.Where(provider => !defaultProviders.Contains(provider)).OrderBy(provider => provider)) { - FolderProvidersComboBox.AddItem(provider, provider); + this.FolderProvidersComboBox.AddItem(provider, provider); } - FolderProvidersComboBox.InsertItem(0, "", ""); + this.FolderProvidersComboBox.InsertItem(0, "", ""); } private void BindFolderMapping() { - var folderMapping = _folderMappingController.GetFolderMapping(FolderMappingID); + var folderMapping = this._folderMappingController.GetFolderMapping(this.FolderMappingID); - NameTextbox.Text = folderMapping.MappingName; + this.NameTextbox.Text = folderMapping.MappingName; - FolderProvidersComboBox.SelectedValue = folderMapping.FolderProviderType; - FolderProvidersComboBox.Enabled = false; + this.FolderProvidersComboBox.SelectedValue = folderMapping.FolderProviderType; + this.FolderProvidersComboBox.Enabled = false; } private void BindFolderMappingSettings() { string folderProviderType; - if (FolderMappingID != Null.NullInteger) + if (this.FolderMappingID != Null.NullInteger) { - var folderMapping = _folderMappingController.GetFolderMapping(FolderMappingID); + var folderMapping = this._folderMappingController.GetFolderMapping(this.FolderMappingID); folderProviderType = folderMapping.FolderProviderType; } else { - folderProviderType = FolderProvidersComboBox.SelectedValue; + folderProviderType = this.FolderProvidersComboBox.SelectedValue; } if (string.IsNullOrEmpty(folderProviderType)) return; @@ -249,7 +249,7 @@ private void BindFolderMappingSettings() var settingsControlVirtualPath = FolderProvider.Instance(folderProviderType).GetSettingsControlVirtualPath(); if (String.IsNullOrEmpty(settingsControlVirtualPath)) return; - var settingsControl = LoadControl(settingsControlVirtualPath); + var settingsControl = this.LoadControl(settingsControlVirtualPath); if (settingsControl == null || !(settingsControl is FolderMappingSettingsControlBase)) return; // This is important to allow settings control to be localizable @@ -259,8 +259,8 @@ private void BindFolderMappingSettings() settingsControl.ID = baseType.Name; } - ProviderSettingsPlaceHolder.Controls.Clear(); - ProviderSettingsPlaceHolder.Controls.Add(settingsControl); + this.ProviderSettingsPlaceHolder.Controls.Clear(); + this.ProviderSettingsPlaceHolder.Controls.Add(settingsControl); } #endregion diff --git a/DNN Platform/Modules/DigitalAssets/FileFieldsControl.ascx.cs b/DNN Platform/Modules/DigitalAssets/FileFieldsControl.ascx.cs index 2c799add980..135d8bbcf6f 100644 --- a/DNN Platform/Modules/DigitalAssets/FileFieldsControl.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FileFieldsControl.ascx.cs @@ -20,25 +20,25 @@ public partial class FileFieldsControl : PortalModuleBase, IFieldsControl { public virtual void PrepareProperties() { - FileNameInput.Text = Item.ItemName; - FileNameInvalidCharactersValidator.ValidationExpression = "^([^" + Regex.Escape(Controller.GetInvalidChars()) + "]+)$"; - FileNameInvalidCharactersValidator.ErrorMessage = Controller.GetInvalidCharsErrorText(); + this.FileNameInput.Text = this.Item.ItemName; + this.FileNameInvalidCharactersValidator.ValidationExpression = "^([^" + Regex.Escape(this.Controller.GetInvalidChars()) + "]+)$"; + this.FileNameInvalidCharactersValidator.ErrorMessage = this.Controller.GetInvalidCharsErrorText(); } private void PrepareFileAttributes() { - FileAttributeArchiveCheckBox.Checked = (File.FileAttributes & FileAttributes.Archive) == FileAttributes.Archive; - FileAttributeHiddenCheckBox.Checked = (File.FileAttributes & FileAttributes.Hidden) == FileAttributes.Hidden; - FileAttributeReadonlyCheckBox.Checked = (File.FileAttributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly; - FileAttributeSystemCheckBox.Checked = (File.FileAttributes & FileAttributes.System) == FileAttributes.System; + this.FileAttributeArchiveCheckBox.Checked = (this.File.FileAttributes & FileAttributes.Archive) == FileAttributes.Archive; + this.FileAttributeHiddenCheckBox.Checked = (this.File.FileAttributes & FileAttributes.Hidden) == FileAttributes.Hidden; + this.FileAttributeReadonlyCheckBox.Checked = (this.File.FileAttributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly; + this.FileAttributeSystemCheckBox.Checked = (this.File.FileAttributes & FileAttributes.System) == FileAttributes.System; } private FileAttributes GetFileAttributesUpdated(FileAttributes? attributes) { - var result = FileAttributeArchiveCheckBox.Checked ? (attributes | FileAttributes.Archive) : (attributes & ~FileAttributes.Archive); - result = FileAttributeHiddenCheckBox.Checked ? (result | FileAttributes.Hidden) : (result & ~FileAttributes.Hidden); - result = FileAttributeReadonlyCheckBox.Checked ? (result | FileAttributes.ReadOnly) : (result & ~FileAttributes.ReadOnly); - result = FileAttributeSystemCheckBox.Checked ? (result | FileAttributes.System) : (result & ~FileAttributes.System); + var result = this.FileAttributeArchiveCheckBox.Checked ? (attributes | FileAttributes.Archive) : (attributes & ~FileAttributes.Archive); + result = this.FileAttributeHiddenCheckBox.Checked ? (result | FileAttributes.Hidden) : (result & ~FileAttributes.Hidden); + result = this.FileAttributeReadonlyCheckBox.Checked ? (result | FileAttributes.ReadOnly) : (result & ~FileAttributes.ReadOnly); + result = this.FileAttributeSystemCheckBox.Checked ? (result | FileAttributes.System) : (result & ~FileAttributes.System); return result.Value; } @@ -59,13 +59,13 @@ protected override void OnInit(EventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - PrepareProperties(); - FileAttributesContainer.Visible = File.SupportsFileAttributes; - if (File.SupportsFileAttributes) + this.PrepareProperties(); + this.FileAttributesContainer.Visible = this.File.SupportsFileAttributes; + if (this.File.SupportsFileAttributes) { - PrepareFileAttributes(); + this.PrepareFileAttributes(); } } } @@ -87,34 +87,34 @@ public void SetItemViewModel(ItemViewModel itemViewModel) public virtual void SetPropertiesAvailability(bool availability) { - FileNameInput.Enabled = availability; - FileAttributeArchiveCheckBox.Enabled = availability; - FileAttributeHiddenCheckBox.Enabled = availability; - FileAttributeReadonlyCheckBox.Enabled = availability; - FileAttributeSystemCheckBox.Enabled = availability; + this.FileNameInput.Enabled = availability; + this.FileAttributeArchiveCheckBox.Enabled = availability; + this.FileAttributeHiddenCheckBox.Enabled = availability; + this.FileAttributeReadonlyCheckBox.Enabled = availability; + this.FileAttributeSystemCheckBox.Enabled = availability; } public virtual void SetPropertiesVisibility(bool visibility) { - FileNameInput.Visible = visibility; - FileAttributesContainer.Visible = visibility; + this.FileNameInput.Visible = visibility; + this.FileAttributesContainer.Visible = visibility; } public void SetFileInfo(IFileInfo fileInfo) { - File = fileInfo; + this.File = fileInfo; } public virtual object SaveProperties() { - Controller.RenameFile(Item.ItemID, FileNameInput.Text); - if (File.SupportsFileAttributes) + this.Controller.RenameFile(this.Item.ItemID, this.FileNameInput.Text); + if (this.File.SupportsFileAttributes) { - File = FileManager.Instance.GetFile(Item.ItemID, true); - FileManager.Instance.SetAttributes(File, GetFileAttributesUpdated(File.FileAttributes)); + this.File = FileManager.Instance.GetFile(this.Item.ItemID, true); + FileManager.Instance.SetAttributes(this.File, this.GetFileAttributesUpdated(this.File.FileAttributes)); } - return File; + return this.File; } } } diff --git a/DNN Platform/Modules/DigitalAssets/FileProperties.ascx.cs b/DNN Platform/Modules/DigitalAssets/FileProperties.ascx.cs index c6cd0f35f64..9ac7908d688 100644 --- a/DNN Platform/Modules/DigitalAssets/FileProperties.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FileProperties.ascx.cs @@ -41,7 +41,7 @@ protected string DialogTitle { get { - return fileItem.ItemName; + return this.fileItem.ItemName; } } @@ -49,7 +49,7 @@ protected bool CanManageFolder { get { - return UserInfo.IsSuperUser || FolderPermissionController.CanManageFolder((FolderInfo)folder); + return this.UserInfo.IsSuperUser || FolderPermissionController.CanManageFolder((FolderInfo)this.folder); } } @@ -57,7 +57,7 @@ protected string ActiveTab { get { - var activeTab = Request.QueryString["activeTab"]; + var activeTab = this.Request.QueryString["activeTab"]; return string.IsNullOrEmpty(activeTab) ? "" : System.Text.RegularExpressions.Regex.Replace(activeTab, "[^\\w]", ""); } } @@ -71,55 +71,55 @@ protected override void OnInit(EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); - var fileId = Convert.ToInt32(Request.Params["FileId"]); - file = FileManager.Instance.GetFile(fileId, true); - fileItem = controller.GetFile(fileId); - folder = FolderManager.Instance.GetFolder(file.FolderId); + var fileId = Convert.ToInt32(this.Request.Params["FileId"]); + this.file = FileManager.Instance.GetFile(fileId, true); + this.fileItem = this.controller.GetFile(fileId); + this.folder = FolderManager.Instance.GetFolder(this.file.FolderId); - SaveButton.Click += OnSaveClick; - CancelButton.Click += OnCancelClick; + this.SaveButton.Click += this.OnSaveClick; + this.CancelButton.Click += this.OnCancelClick; - if (FolderPermissionController.CanViewFolder((FolderInfo)folder)) + if (FolderPermissionController.CanViewFolder((FolderInfo)this.folder)) { var mef = new ExtensionPointManager(); var preViewPanelExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "PreviewInfoPanelExtensionPoint"); - previewPanelControl = Page.LoadControl(preViewPanelExtension.UserControlSrc); - PreviewPanelContainer.Controls.Add(previewPanelControl); + this.previewPanelControl = this.Page.LoadControl(preViewPanelExtension.UserControlSrc); + this.PreviewPanelContainer.Controls.Add(this.previewPanelControl); var fileFieldsExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "FileFieldsControlExtensionPoint"); - fileFieldsControl = Page.LoadControl(fileFieldsExtension.UserControlSrc); - fileFieldsControl.ID = fileFieldsControl.GetType().BaseType.Name; - FileFieldsContainer.Controls.Add(fileFieldsControl); + this.fileFieldsControl = this.Page.LoadControl(fileFieldsExtension.UserControlSrc); + this.fileFieldsControl.ID = this.fileFieldsControl.GetType().BaseType.Name; + this.FileFieldsContainer.Controls.Add(this.fileFieldsControl); - PrepareFilePreviewInfoControl(); - PrepareFileFieldsControl(); + this.PrepareFilePreviewInfoControl(); + this.PrepareFileFieldsControl(); // Tab Extension Point var tabContentControlsInstances = new List(); foreach (var extension in mef.GetEditPageTabExtensionPoints("DigitalAssets", "FilePropertiesTab")) { - if (FolderPermissionController.HasFolderPermission(folder.FolderPermissions, extension.Permission)) + if (FolderPermissionController.HasFolderPermission(this.folder.FolderPermissions, extension.Permission)) { var liElement = new HtmlGenericControl("li") { InnerHtml = "" + extension.Text + "", }; liElement.Attributes.Add("class", extension.CssClass); liElement.Attributes.Add("id", extension.EditPageTabId + "_tab"); - Tabs.Controls.Add(liElement); + this.Tabs.Controls.Add(liElement); var container = new PanelTabExtensionControl { PanelId = extension.EditPageTabId }; - var control = (PortalModuleBase)Page.LoadControl(extension.UserControlSrc); + var control = (PortalModuleBase)this.Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); - control.ModuleConfiguration = ModuleConfiguration; + control.ModuleConfiguration = this.ModuleConfiguration; var contentControl = control as PropertiesTabContentControl; if (contentControl != null) { - contentControl.OnItemUpdated += OnItemUpdated; + contentControl.OnItemUpdated += this.OnItemUpdated; tabContentControlsInstances.Add(contentControl); } container.Controls.Add(control); - TabsPanel.Controls.Add(container); + this.TabsPanel.Controls.Add(container); } } - tabContentControls = tabContentControlsInstances.ToList(); + this.tabContentControls = tabContentControlsInstances.ToList(); } } catch (Exception ex) @@ -132,21 +132,21 @@ protected override void OnLoad(EventArgs e) { try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - SetPropertiesAvailability(CanManageFolder); + this.SetPropertiesAvailability(this.CanManageFolder); } - if (!FolderPermissionController.CanViewFolder((FolderInfo)folder)) + if (!FolderPermissionController.CanViewFolder((FolderInfo)this.folder)) { - SaveButton.Visible = false; - SetPropertiesVisibility(false); - UI.Skins.Skin.AddModuleMessage(this, LocalizeString("UserCannotReadFileError"), ModuleMessage.ModuleMessageType.RedError); + this.SaveButton.Visible = false; + this.SetPropertiesVisibility(false); + UI.Skins.Skin.AddModuleMessage(this, this.LocalizeString("UserCannotReadFileError"), ModuleMessage.ModuleMessageType.RedError); } else { - SetFilePreviewInfo(); - SaveButton.Visible = FolderPermissionController.CanViewFolder((FolderInfo)folder) && FolderPermissionController.CanManageFolder((FolderInfo)folder); + this.SetFilePreviewInfo(); + this.SaveButton.Visible = FolderPermissionController.CanViewFolder((FolderInfo)this.folder) && FolderPermissionController.CanManageFolder((FolderInfo)this.folder); } } catch (DotNetNukeException dnnex) @@ -161,8 +161,8 @@ protected override void OnLoad(EventArgs e) private void OnItemUpdated() { - SetFilePreviewInfo(); - foreach (var propertiesTabContentControl in tabContentControls) + this.SetFilePreviewInfo(); + foreach (var propertiesTabContentControl in this.tabContentControls) { propertiesTabContentControl.DataBindItem(); } @@ -170,15 +170,15 @@ private void OnItemUpdated() private void OnSaveClick(object sender, EventArgs e) { - if (!Page.IsValid) + if (!this.Page.IsValid) { return; } try { - SaveFileProperties(); - Page.CloseClientDialog(true); + this.SaveFileProperties(); + this.Page.CloseClientDialog(true); } catch (ThreadAbortException) { } catch (DotNetNukeException dnnex) @@ -194,44 +194,44 @@ private void OnSaveClick(object sender, EventArgs e) private void OnCancelClick(object sender, EventArgs e) { - Page.CloseClientDialog(false); + this.Page.CloseClientDialog(false); } private void SaveFileProperties() { - file = (IFileInfo)((FileFieldsControl)fileFieldsControl).SaveProperties(); + this.file = (IFileInfo)((FileFieldsControl)this.fileFieldsControl).SaveProperties(); } private void SetPropertiesVisibility(bool visibility) { - ((FileFieldsControl)fileFieldsControl).SetPropertiesVisibility(visibility); + ((FileFieldsControl)this.fileFieldsControl).SetPropertiesVisibility(visibility); } private void SetPropertiesAvailability(bool availability) { - ((FileFieldsControl)fileFieldsControl).SetPropertiesAvailability(availability); + ((FileFieldsControl)this.fileFieldsControl).SetPropertiesAvailability(availability); } private void SetFilePreviewInfo() { - var previewPanelInstance = (PreviewPanelControl)previewPanelControl; - previewPanelInstance.SetPreviewInfo(controller.GetFilePreviewInfo(file, fileItem)); + var previewPanelInstance = (PreviewPanelControl)this.previewPanelControl; + previewPanelInstance.SetPreviewInfo(this.controller.GetFilePreviewInfo(this.file, this.fileItem)); } private void PrepareFilePreviewInfoControl() { - var previewPanelInstance = (PreviewPanelControl)previewPanelControl; - previewPanelInstance.SetController(controller); - previewPanelInstance.SetModuleConfiguration(ModuleConfiguration); + var previewPanelInstance = (PreviewPanelControl)this.previewPanelControl; + previewPanelInstance.SetController(this.controller); + previewPanelInstance.SetModuleConfiguration(this.ModuleConfiguration); } private void PrepareFileFieldsControl() { - var fileFieldsIntance = (FileFieldsControl)fileFieldsControl; - fileFieldsIntance.SetController(controller); - fileFieldsIntance.SetItemViewModel(fileItem); - fileFieldsIntance.SetFileInfo(file); - fileFieldsIntance.SetModuleConfiguration(ModuleConfiguration); + var fileFieldsIntance = (FileFieldsControl)this.fileFieldsControl; + fileFieldsIntance.SetController(this.controller); + fileFieldsIntance.SetItemViewModel(this.fileItem); + fileFieldsIntance.SetFileInfo(this.file); + fileFieldsIntance.SetModuleConfiguration(this.ModuleConfiguration); } } } diff --git a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs index 6311c7a6ff5..92ae09c824b 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderMappings.ascx.cs @@ -26,7 +26,7 @@ public partial class FolderMappings : PortalModuleBase private readonly INavigationManager _navigationManager; public FolderMappings() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Variables @@ -41,7 +41,7 @@ public int FolderPortalID { get { - return IsHostMenu ? Null.NullInteger : PortalId; + return this.IsHostMenu ? Null.NullInteger : this.PortalId; } } @@ -51,13 +51,13 @@ protected List FolderMappingsList { try { - var obj = Session["FolderMappingsList"]; + var obj = this.Session["FolderMappingsList"]; if (obj == null) { - obj = _folderMappingController.GetFolderMappings(FolderPortalID); + obj = this._folderMappingController.GetFolderMappings(this.FolderPortalID); if (obj != null) { - Session["FolderMappingsList"] = obj; + this.Session["FolderMappingsList"] = obj; } else { @@ -68,11 +68,11 @@ protected List FolderMappingsList } catch { - Session["FolderMappingsList"] = null; + this.Session["FolderMappingsList"] = null; } return new List(); } - set { Session["FolderMappingsList"] = value; } + set { this.Session["FolderMappingsList"] = value; } } #endregion @@ -83,26 +83,26 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (!UserInfo.IsSuperUser && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) + if (!this.UserInfo.IsSuperUser && !this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - JavaScript.RegisterClientReference(Page, ClientAPI.ClientNamespaceReferences.dnn); - CancelButton.NavigateUrl = _navigationManager.NavigateURL(); - NewMappingButton.Click += OnNewMappingClick; + JavaScript.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn); + this.CancelButton.NavigateUrl = this._navigationManager.NavigateURL(); + this.NewMappingButton.Click += this.OnNewMappingClick; - if (!IsPostBack) + if (!this.IsPostBack) { - Session["FolderMappingsList"] = null; + this.Session["FolderMappingsList"] = null; - if (ModuleConfiguration.ModuleControl.SupportsPopUps) + if (this.ModuleConfiguration.ModuleControl.SupportsPopUps) { - MappingsGrid.Rebind(); + this.MappingsGrid.Rebind(); } } } @@ -111,25 +111,25 @@ protected void MappingsGrid_OnItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == "Edit") { - Response.Redirect(_navigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); + this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId, "EditFolderMapping", "mid=" + this.ModuleId, "popUp=true", "ItemID=" + e.CommandArgument.ToString())); } else { - var folderMappingsList = FolderMappingsList; + var folderMappingsList = this.FolderMappingsList; var folderMapping = folderMappingsList.Find(f => f.FolderMappingID == int.Parse(e.CommandArgument.ToString())); switch (e.CommandName) { case "Delete": - _folderMappingController.DeleteFolderMapping(folderMapping.PortalID, folderMapping.FolderMappingID); + this._folderMappingController.DeleteFolderMapping(folderMapping.PortalID, folderMapping.FolderMappingID); folderMappingsList.Remove(folderMapping); break; default: break; } - FolderMappingsList = folderMappingsList; - MappingsGrid.Rebind(); + this.FolderMappingsList = folderMappingsList; + this.MappingsGrid.Rebind(); } } @@ -151,20 +151,20 @@ protected void MappingsGrid_OnItemDataBound(object sender, GridItemEventArgs e) cmdDeleteMapping.ToolTip = Localization.GetString("cmdDelete"); - var deleteMessage = string.Format(Localization.GetString("DeleteConfirm", LocalResourceFile), folderMapping.MappingName); + var deleteMessage = string.Format(Localization.GetString("DeleteConfirm", this.LocalResourceFile), folderMapping.MappingName); cmdDeleteMapping.OnClientClick = "return confirm(\"" + ClientAPI.GetSafeJSString(deleteMessage) + "\");"; } protected void MappingsGrid_OnNeedDataSource(object source, GridNeedDataSourceEventArgs e) { - MappingsGrid.DataSource = FolderMappingsList; + this.MappingsGrid.DataSource = this.FolderMappingsList; } protected void OnNewMappingClick(object sender, EventArgs e) { try { - Response.Redirect(_navigationManager.NavigateURL(TabId, "EditFolderMapping", "mid=" + ModuleId, "popUp=true")); + this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId, "EditFolderMapping", "mid=" + this.ModuleId, "popUp=true")); } catch (Exception exc) { @@ -181,7 +181,7 @@ private void UpdateFolderMappings(IList folderMappingsList) for (var i = 3; i < folderMappingsList.Count; i++) { folderMappingsList[i].Priority = i + 1; - _folderMappingController.UpdateFolderMapping(folderMappingsList[i]); + this._folderMappingController.UpdateFolderMapping(folderMappingsList[i]); } } diff --git a/DNN Platform/Modules/DigitalAssets/FolderProperties.ascx.cs b/DNN Platform/Modules/DigitalAssets/FolderProperties.ascx.cs index 5e01d1caf35..4cc8549975d 100644 --- a/DNN Platform/Modules/DigitalAssets/FolderProperties.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/FolderProperties.ascx.cs @@ -37,7 +37,7 @@ protected bool CanManageFolder { get { - return UserInfo.IsSuperUser || FolderPermissionController.CanManageFolder((FolderInfo)Folder); + return this.UserInfo.IsSuperUser || FolderPermissionController.CanManageFolder((FolderInfo)this.Folder); } } @@ -47,7 +47,7 @@ protected string DialogTitle { get { - return string.Format(LocalizeString("DialogTitle"), folderViewModel.FolderName); + return string.Format(this.LocalizeString("DialogTitle"), this.folderViewModel.FolderName); } } @@ -55,7 +55,7 @@ protected bool IsHostPortal { get { - return IsHostMenu || controller.GetCurrentPortalId(ModuleId) == Null.NullInteger; + return this.IsHostMenu || this.controller.GetCurrentPortalId(this.ModuleId) == Null.NullInteger; } } @@ -67,16 +67,16 @@ protected override void OnInit(EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); - var folderId = Convert.ToInt32(Request.Params["FolderId"]); - Folder = FolderManager.Instance.GetFolder(folderId); - HasFullControl = UserInfo.IsSuperUser || FolderPermissionController.HasFolderPermission(Folder.FolderPermissions, "FULLCONTROL"); + var folderId = Convert.ToInt32(this.Request.Params["FolderId"]); + this.Folder = FolderManager.Instance.GetFolder(folderId); + this.HasFullControl = this.UserInfo.IsSuperUser || FolderPermissionController.HasFolderPermission(this.Folder.FolderPermissions, "FULLCONTROL"); FolderViewModel rootFolder; - switch (SettingsRepository.GetMode(ModuleId)) + switch (SettingsRepository.GetMode(this.ModuleId)) { case DigitalAssestsMode.Group: - var groupId = Convert.ToInt32(Request.Params["GroupId"]); - rootFolder = controller.GetGroupFolder(groupId, PortalSettings); + var groupId = Convert.ToInt32(this.Request.Params["GroupId"]); + rootFolder = this.controller.GetGroupFolder(groupId, this.PortalSettings); if (rootFolder == null) { throw new Exception("Invalid group folder"); @@ -84,40 +84,40 @@ protected override void OnInit(EventArgs e) break; case DigitalAssestsMode.User: - rootFolder = controller.GetUserFolder(PortalSettings.UserInfo); + rootFolder = this.controller.GetUserFolder(this.PortalSettings.UserInfo); break; default: - rootFolder = controller.GetRootFolder(ModuleId); + rootFolder = this.controller.GetRootFolder(this.ModuleId); break; } - isRootFolder = rootFolder.FolderID == folderId; - folderViewModel = isRootFolder ? rootFolder : controller.GetFolder(folderId); + this.isRootFolder = rootFolder.FolderID == folderId; + this.folderViewModel = this.isRootFolder ? rootFolder : this.controller.GetFolder(folderId); // Setup controls - CancelButton.Click += OnCancelClick; - SaveButton.Click += OnSaveClick; - PrepareFolderPreviewInfo(); - cmdCopyPerm.Click += cmdCopyPerm_Click; + this.CancelButton.Click += this.OnCancelClick; + this.SaveButton.Click += this.OnSaveClick; + this.PrepareFolderPreviewInfo(); + this.cmdCopyPerm.Click += this.cmdCopyPerm_Click; var mef = new ExtensionPointManager(); var folderFieldsExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "FolderFieldsControlExtensionPoint"); if (folderFieldsExtension != null) { - folderFieldsControl = Page.LoadControl(folderFieldsExtension.UserControlSrc); - folderFieldsControl.ID = folderFieldsControl.GetType().BaseType.Name; - FolderDynamicFieldsContainer.Controls.Add(folderFieldsControl); - var fieldsControl = folderFieldsControl as IFieldsControl; + this.folderFieldsControl = this.Page.LoadControl(folderFieldsExtension.UserControlSrc); + this.folderFieldsControl.ID = this.folderFieldsControl.GetType().BaseType.Name; + this.FolderDynamicFieldsContainer.Controls.Add(this.folderFieldsControl); + var fieldsControl = this.folderFieldsControl as IFieldsControl; if (fieldsControl != null) { - fieldsControl.SetController(controller); + fieldsControl.SetController(this.controller); fieldsControl.SetItemViewModel(new ItemViewModel { - ItemID = folderViewModel.FolderID, + ItemID = this.folderViewModel.FolderID, IsFolder = true, - PortalID = folderViewModel.PortalID, - ItemName = folderViewModel.FolderName + PortalID = this.folderViewModel.PortalID, + ItemName = this.folderViewModel.FolderName }); } } @@ -132,15 +132,15 @@ private void OnSaveClick(object sender, EventArgs e) { try { - if (!Page.IsValid) + if (!this.Page.IsValid) { return; } - SaveFolderProperties(); + this.SaveFolderProperties(); - SavePermissions(); - Page.CloseClientDialog(true); + this.SavePermissions(); + this.Page.CloseClientDialog(true); } catch (ThreadAbortException) { @@ -158,51 +158,51 @@ private void OnSaveClick(object sender, EventArgs e) private void SaveFolderProperties() { - if (!CanManageFolder) + if (!this.CanManageFolder) { - throw new DotNetNukeException(LocalizeString("UserCannotEditFolderError")); + throw new DotNetNukeException(this.LocalizeString("UserCannotEditFolderError")); } - if (!isRootFolder) + if (!this.isRootFolder) { - controller.RenameFolder(folderViewModel.FolderID, FolderNameInput.Text); + this.controller.RenameFolder(this.folderViewModel.FolderID, this.FolderNameInput.Text); } - var fieldsControl = folderFieldsControl as IFieldsControl; + var fieldsControl = this.folderFieldsControl as IFieldsControl; if (fieldsControl != null) { - Folder = (IFolderInfo)fieldsControl.SaveProperties(); + this.Folder = (IFolderInfo)fieldsControl.SaveProperties(); } } private void SavePermissions() { - if (!CanManageFolder) + if (!this.CanManageFolder) { - throw new DotNetNukeException(LocalizeString("UserCannotChangePermissionsError")); + throw new DotNetNukeException(this.LocalizeString("UserCannotChangePermissionsError")); } - Folder = FolderManager.Instance.GetFolder(Folder.FolderID); - Folder.FolderPermissions.Clear(); - Folder.FolderPermissions.AddRange(PermissionsGrid.Permissions); - FolderPermissionController.SaveFolderPermissions(Folder); + this.Folder = FolderManager.Instance.GetFolder(this.Folder.FolderID); + this.Folder.FolderPermissions.Clear(); + this.Folder.FolderPermissions.AddRange(this.PermissionsGrid.Permissions); + FolderPermissionController.SaveFolderPermissions(this.Folder); } private void OnCancelClick(object sender, EventArgs e) { - Page.CloseClientDialog(false); + this.Page.CloseClientDialog(false); } private void cmdCopyPerm_Click(object sender, EventArgs e) { try { - FolderPermissionController.CopyPermissionsToSubfolders(Folder, PermissionsGrid.Permissions); - UI.Skins.Skin.AddModuleMessage(this, LocalizeString("PermissionsCopied"), ModuleMessage.ModuleMessageType.GreenSuccess); + FolderPermissionController.CopyPermissionsToSubfolders(this.Folder, this.PermissionsGrid.Permissions); + UI.Skins.Skin.AddModuleMessage(this, this.LocalizeString("PermissionsCopied"), ModuleMessage.ModuleMessageType.GreenSuccess); } catch (Exception ex) { - UI.Skins.Skin.AddModuleMessage(this, LocalizeString("PermissionCopyError"), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, this.LocalizeString("PermissionCopyError"), ModuleMessage.ModuleMessageType.RedError); Exceptions.ProcessModuleLoadException(this, ex); } } @@ -211,22 +211,22 @@ protected override void OnLoad(EventArgs e) { try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - SetupPermissionGrid(); - PrepareFolderProperties(); - SetPropertiesAvailability(FolderPermissionController.CanManageFolder((FolderInfo)Folder)); + this.SetupPermissionGrid(); + this.PrepareFolderProperties(); + this.SetPropertiesAvailability(FolderPermissionController.CanManageFolder((FolderInfo)this.Folder)); } - if (!FolderPermissionController.CanViewFolder((FolderInfo)Folder)) + if (!FolderPermissionController.CanViewFolder((FolderInfo)this.Folder)) { - SaveButton.Visible = false; - SetPropertiesVisibility(false); - UI.Skins.Skin.AddModuleMessage(this, LocalizeString("UserCannotReadFolderError"), ModuleMessage.ModuleMessageType.RedError); + this.SaveButton.Visible = false; + this.SetPropertiesVisibility(false); + UI.Skins.Skin.AddModuleMessage(this, this.LocalizeString("UserCannotReadFolderError"), ModuleMessage.ModuleMessageType.RedError); } else { - SaveButton.Visible = FolderPermissionController.CanViewFolder((FolderInfo)Folder) && FolderPermissionController.CanManageFolder((FolderInfo)Folder); + this.SaveButton.Visible = FolderPermissionController.CanViewFolder((FolderInfo)this.Folder) && FolderPermissionController.CanManageFolder((FolderInfo)this.Folder); } } catch (DotNetNukeException dnnex) @@ -241,8 +241,8 @@ protected override void OnLoad(EventArgs e) private void SetPropertiesAvailability(bool availability) { - FolderNameInput.Enabled = (!isRootFolder) && availability; - var fieldsControl = folderFieldsControl as IFieldsControl; + this.FolderNameInput.Enabled = (!this.isRootFolder) && availability; + var fieldsControl = this.folderFieldsControl as IFieldsControl; if (fieldsControl != null) { fieldsControl.SetPropertiesAvailability(availability); @@ -251,10 +251,10 @@ private void SetPropertiesAvailability(bool availability) private void SetPropertiesVisibility(bool visibility) { - FolderNameInput.Visible = visibility; - FolderTypeLiteral.Visible = visibility; - FolderInfoPreviewPanel.Visible = visibility; - var fieldsControl = folderFieldsControl as IFieldsControl; + this.FolderNameInput.Visible = visibility; + this.FolderTypeLiteral.Visible = visibility; + this.FolderInfoPreviewPanel.Visible = visibility; + var fieldsControl = this.folderFieldsControl as IFieldsControl; if (fieldsControl != null) { fieldsControl.SetPropertiesVisibility(visibility); @@ -263,13 +263,13 @@ private void SetPropertiesVisibility(bool visibility) private void PrepareFolderProperties() { - FolderNameInput.Text = folderViewModel.FolderName; - FolderTypeLiteral.Text = FolderMappingController.Instance.GetFolderMapping(folderViewModel.FolderMappingID).MappingName; + this.FolderNameInput.Text = this.folderViewModel.FolderName; + this.FolderTypeLiteral.Text = FolderMappingController.Instance.GetFolderMapping(this.folderViewModel.FolderMappingID).MappingName; - FolderNameInvalidCharactersValidator.ValidationExpression = "^([^" + Regex.Escape(controller.GetInvalidChars()) + "]+)$"; - FolderNameInvalidCharactersValidator.ErrorMessage = controller.GetInvalidCharsErrorText(); + this.FolderNameInvalidCharactersValidator.ValidationExpression = "^([^" + Regex.Escape(this.controller.GetInvalidChars()) + "]+)$"; + this.FolderNameInvalidCharactersValidator.ErrorMessage = this.controller.GetInvalidCharsErrorText(); - var fieldsControl = folderFieldsControl as IFieldsControl; + var fieldsControl = this.folderFieldsControl as IFieldsControl; if (fieldsControl != null) { fieldsControl.PrepareProperties(); @@ -278,17 +278,17 @@ private void PrepareFolderProperties() private void PrepareFolderPreviewInfo() { - var folderPreviewPanel = (PreviewPanelControl)FolderInfoPreviewPanel; + var folderPreviewPanel = (PreviewPanelControl)this.FolderInfoPreviewPanel; if (folderPreviewPanel != null) { - folderPreviewPanel.SetPreviewInfo(controller.GetFolderPreviewInfo(Folder)); + folderPreviewPanel.SetPreviewInfo(this.controller.GetFolderPreviewInfo(this.Folder)); } } private void SetupPermissionGrid() { - PermissionsGrid.FolderPath = Folder.FolderPath; - PermissionsGrid.Visible = HasFullControl && !IsHostPortal; + this.PermissionsGrid.FolderPath = this.Folder.FolderPath; + this.PermissionsGrid.Visible = this.HasFullControl && !this.IsHostPortal; } } } diff --git a/DNN Platform/Modules/DigitalAssets/PreviewFieldsControl.ascx.cs b/DNN Platform/Modules/DigitalAssets/PreviewFieldsControl.ascx.cs index cb402896c2e..ee01c9b7959 100644 --- a/DNN Platform/Modules/DigitalAssets/PreviewFieldsControl.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/PreviewFieldsControl.ascx.cs @@ -14,13 +14,13 @@ public partial class PreviewFieldsControl : UserControl { public void GenerateFieldsTable() { - FieldsTable.Rows.Clear(); - foreach (var field in Fields) + this.FieldsTable.Rows.Clear(); + foreach (var field in this.Fields) { var cellLabel = new TableCell { Text = field.DisplayName + ":", CssClass = "dnnModuleDigitalAssetsPreviewInfoFieldLabel" }; var cellValue = new TableCell { Text = field.StringValue, CssClass = "dnnModuleDigitalAssetsPreviewInfoFieldValue" }; var rowField = new TableRow { Cells = { cellLabel, cellValue }, CssClass = "dnnModuleDigitalAssetsPreviewInfoFieldsRow" }; - FieldsTable.Rows.Add(rowField); + this.FieldsTable.Rows.Add(rowField); } } diff --git a/DNN Platform/Modules/DigitalAssets/PreviewPanelControl.ascx.cs b/DNN Platform/Modules/DigitalAssets/PreviewPanelControl.ascx.cs index 811baab23f3..4a6fbc8ab7b 100644 --- a/DNN Platform/Modules/DigitalAssets/PreviewPanelControl.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/PreviewPanelControl.ascx.cs @@ -15,7 +15,7 @@ protected string Title { get { - return PreviewInfo.Title; + return this.PreviewInfo.Title; } } @@ -23,7 +23,7 @@ protected string PreviewImageUrl { get { - return PreviewInfo.PreviewImageUrl; + return this.PreviewInfo.PreviewImageUrl; } } @@ -37,23 +37,23 @@ protected string PreviewImageUrl #region Public Methods public void SetPreviewInfo(PreviewInfoViewModel previewInfoViewModel) { - PreviewInfo = previewInfoViewModel; - if (FieldsControl != null && PreviewInfo != null) + this.PreviewInfo = previewInfoViewModel; + if (this.FieldsControl != null && this.PreviewInfo != null) { - var fieldsControl = ((PreviewFieldsControl)FieldsControl); - fieldsControl.Fields = PreviewInfo.Fields; + var fieldsControl = ((PreviewFieldsControl)this.FieldsControl); + fieldsControl.Fields = this.PreviewInfo.Fields; fieldsControl.GenerateFieldsTable(); } } public void SetController(IDigitalAssetsController damController) { - Controller = damController; + this.Controller = damController; } public void SetModuleConfiguration(ModuleInfo moduleConfiguration) { - ModuleConfiguration = moduleConfiguration; + this.ModuleConfiguration = moduleConfiguration; } #endregion } diff --git a/DNN Platform/Modules/DigitalAssets/SearchBoxControl.ascx.cs b/DNN Platform/Modules/DigitalAssets/SearchBoxControl.ascx.cs index 5ae7d1831f6..33e0538da41 100644 --- a/DNN Platform/Modules/DigitalAssets/SearchBoxControl.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/SearchBoxControl.ascx.cs @@ -14,7 +14,7 @@ public partial class SearchBoxControl : PortalModuleBase { protected override void OnInit(EventArgs e) { - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/DigitalAssets/ClientScripts/dnn.DigitalAssets.SearchBox.js", FileOrder.Js.DefaultPriority + 10); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/DigitalAssets/ClientScripts/dnn.DigitalAssets.SearchBox.js", FileOrder.Js.DefaultPriority + 10); } } } diff --git a/DNN Platform/Modules/DigitalAssets/Services/ContentServiceController.cs b/DNN Platform/Modules/DigitalAssets/Services/ContentServiceController.cs index b7e75c08bbb..0051ae4a0c5 100644 --- a/DNN Platform/Modules/DigitalAssets/Services/ContentServiceController.cs +++ b/DNN Platform/Modules/DigitalAssets/Services/ContentServiceController.cs @@ -27,7 +27,7 @@ public class ContentServiceController : DnnApiController public ContentServiceController() { var f = new Factory(); - DigitalAssetsController = f.DigitalAssetsController; + this.DigitalAssetsController = f.DigitalAssetsController; } protected IDigitalAssetsController DigitalAssetsController { get; private set; } @@ -36,42 +36,42 @@ public ContentServiceController() [ValidateAntiForgeryToken] public HttpResponseMessage GetFolderContent(GetFolderContentRequest r) { - var moduleId = Request.FindModuleId(); - var p = DigitalAssetsController.GetFolderContent(moduleId, r.FolderId, r.StartIndex, r.NumItems, r.SortExpression); - return Request.CreateResponse(HttpStatusCode.OK, p); + var moduleId = this.Request.FindModuleId(); + var p = this.DigitalAssetsController.GetFolderContent(moduleId, r.FolderId, r.StartIndex, r.NumItems, r.SortExpression); + return this.Request.CreateResponse(HttpStatusCode.OK, p); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage SearchFolderContent(SearchFolderContentRequest r) { - var moduleId = Request.FindModuleId(); - var p = DigitalAssetsController.SearchFolderContent(moduleId, r.FolderId, r.Pattern, r.StartIndex, r.NumItems, r.SortExpression); - return Request.CreateResponse(HttpStatusCode.OK, p); + var moduleId = this.Request.FindModuleId(); + var p = this.DigitalAssetsController.SearchFolderContent(moduleId, r.FolderId, r.Pattern, r.StartIndex, r.NumItems, r.SortExpression); + return this.Request.CreateResponse(HttpStatusCode.OK, p); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage DeleteItems(DeleteItemsRequest request) { - var notDeletedItems = DigitalAssetsController.DeleteItems(request.Items); - return Request.CreateResponse(HttpStatusCode.OK, notDeletedItems); + var notDeletedItems = this.DigitalAssetsController.DeleteItems(request.Items); + return this.Request.CreateResponse(HttpStatusCode.OK, notDeletedItems); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage UnlinkFolder(UnlinkFolderRequest request) { - DigitalAssetsController.UnlinkFolder(request.FolderId); - return Request.CreateResponse(HttpStatusCode.OK); + this.DigitalAssetsController.UnlinkFolder(request.FolderId); + return this.Request.CreateResponse(HttpStatusCode.OK); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage GetMappedSubfoldersCount(MappedPathSubFoldersCountRequest request) { - var mappedSubfoldersCount = DigitalAssetsController.GetMappedSubFoldersCount(request.Items, PortalSettings.PortalId); - return Request.CreateResponse(HttpStatusCode.OK, mappedSubfoldersCount); + var mappedSubfoldersCount = this.DigitalAssetsController.GetMappedSubFoldersCount(request.Items, this.PortalSettings.PortalId); + return this.Request.CreateResponse(HttpStatusCode.OK, mappedSubfoldersCount); } [HttpPost] @@ -80,12 +80,12 @@ public HttpResponseMessage RenameFile(RenameFileRequest request) { try { - var itemViewModel = DigitalAssetsController.RenameFile(request.FileId, request.NewFileName); - return Request.CreateResponse(HttpStatusCode.OK, itemViewModel); + var itemViewModel = this.DigitalAssetsController.RenameFile(request.FileId, request.NewFileName); + return this.Request.CreateResponse(HttpStatusCode.OK, itemViewModel); } catch (FileAlreadyExistsException ex) { - return Request.CreateResponse(HttpStatusCode.InternalServerError, ex); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError, ex); } } @@ -94,74 +94,74 @@ public HttpResponseMessage RenameFile(RenameFileRequest request) [ValidateAntiForgeryToken] public HttpResponseMessage CopyFile(CopyMoveItemRequest request) { - var copyFileResponse = DigitalAssetsController.CopyFile(request.ItemId, request.DestinationFolderId, request.Overwrite); - return Request.CreateResponse(HttpStatusCode.OK, copyFileResponse); + var copyFileResponse = this.DigitalAssetsController.CopyFile(request.ItemId, request.DestinationFolderId, request.Overwrite); + return this.Request.CreateResponse(HttpStatusCode.OK, copyFileResponse); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage MoveFile(CopyMoveItemRequest request) { - var copyMoveFileResponse = DigitalAssetsController.MoveFile(request.ItemId, request.DestinationFolderId, request.Overwrite); - return Request.CreateResponse(HttpStatusCode.OK, copyMoveFileResponse); + var copyMoveFileResponse = this.DigitalAssetsController.MoveFile(request.ItemId, request.DestinationFolderId, request.Overwrite); + return this.Request.CreateResponse(HttpStatusCode.OK, copyMoveFileResponse); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage MoveFolder(CopyMoveItemRequest request) { - var copyMoveFolderResponse = DigitalAssetsController.MoveFolder(request.ItemId, request.DestinationFolderId, request.Overwrite); - return Request.CreateResponse(HttpStatusCode.OK, copyMoveFolderResponse); + var copyMoveFolderResponse = this.DigitalAssetsController.MoveFolder(request.ItemId, request.DestinationFolderId, request.Overwrite); + return this.Request.CreateResponse(HttpStatusCode.OK, copyMoveFolderResponse); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage GetSubFolders(GetSubFolderRequest request) { - var moduleId = Request.FindModuleId(); - var subFolders = DigitalAssetsController.GetFolders(moduleId, request.FolderId).ToList(); - return Request.CreateResponse(HttpStatusCode.OK, subFolders); + var moduleId = this.Request.FindModuleId(); + var subFolders = this.DigitalAssetsController.GetFolders(moduleId, request.FolderId).ToList(); + return this.Request.CreateResponse(HttpStatusCode.OK, subFolders); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage RenameFolder(RenameFolderRequest request) { - DigitalAssetsController.RenameFolder(request.FolderId, request.NewFolderName); - return Request.CreateResponse(HttpStatusCode.OK, "Success"); + this.DigitalAssetsController.RenameFolder(request.FolderId, request.NewFolderName); + return this.Request.CreateResponse(HttpStatusCode.OK, "Success"); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage CreateNewFolder(CreateNewFolderRequest request) { - var folder = DigitalAssetsController.CreateFolder(request.FolderName, request.ParentFolderId, + var folder = this.DigitalAssetsController.CreateFolder(request.FolderName, request.ParentFolderId, request.FolderMappingId, request.MappedName); - return Request.CreateResponse(HttpStatusCode.OK, folder); + return this.Request.CreateResponse(HttpStatusCode.OK, folder); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage SynchronizeFolder(SynchronizeFolderRequest request) { - DigitalAssetsController.SyncFolderContent(request.FolderId, request.Recursive); - return Request.CreateResponse(HttpStatusCode.OK, "Success"); + this.DigitalAssetsController.SyncFolderContent(request.FolderId, request.Recursive); + return this.Request.CreateResponse(HttpStatusCode.OK, "Success"); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage UnzipFile(UnzipFileRequest request) { - var model = DigitalAssetsController.UnzipFile(request.FileId, request.Overwrite); - return Request.CreateResponse(HttpStatusCode.OK, model); + var model = this.DigitalAssetsController.UnzipFile(request.FileId, request.Overwrite); + return this.Request.CreateResponse(HttpStatusCode.OK, model); } [HttpPost] [ValidateAntiForgeryToken] public HttpResponseMessage GetUrl(GetUrlRequest request) { - var url = DigitalAssetsController.GetUrl(request.FileId); - return Request.CreateResponse(HttpStatusCode.OK, url); + var url = this.DigitalAssetsController.GetUrl(request.FileId); + return this.Request.CreateResponse(HttpStatusCode.OK, url); } } } diff --git a/DNN Platform/Modules/DigitalAssets/Services/DownloadServiceController.cs b/DNN Platform/Modules/DigitalAssets/Services/DownloadServiceController.cs index 3bec2257c0a..71019b07960 100644 --- a/DNN Platform/Modules/DigitalAssets/Services/DownloadServiceController.cs +++ b/DNN Platform/Modules/DigitalAssets/Services/DownloadServiceController.cs @@ -25,7 +25,7 @@ public class DownloadServiceController : DnnApiController public DownloadServiceController() { var f = new Factory(); - DigitalAssetsController = f.DigitalAssetsController; + this.DigitalAssetsController = f.DigitalAssetsController; } protected IDigitalAssetsController DigitalAssetsController { get; private set; } @@ -36,7 +36,7 @@ public HttpResponseMessage Download(int fileId, bool forceDownload) var result = new HttpResponseMessage(HttpStatusCode.OK); string fileName; string contentType; - var streamContent = DigitalAssetsController.GetFileContent(fileId, out fileName, out contentType); + var streamContent = this.DigitalAssetsController.GetFileContent(fileId, out fileName, out contentType); result.Content = new StreamContent(streamContent); result.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType); result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue(forceDownload ? "attachment" : "inline"); diff --git a/DNN Platform/Modules/DigitalAssets/Services/Factory.cs b/DNN Platform/Modules/DigitalAssets/Services/Factory.cs index 9615f9077bc..330e11221c4 100644 --- a/DNN Platform/Modules/DigitalAssets/Services/Factory.cs +++ b/DNN Platform/Modules/DigitalAssets/Services/Factory.cs @@ -28,8 +28,8 @@ public IDigitalAssetsController DigitalAssetsController { get { - var dac = controllers.SingleOrDefault(c => c.Metadata.Edition == "PE"); - return dac != null ? dac.Value : controllers.Single(c => c.Metadata.Edition == "CE").Value; + var dac = this.controllers.SingleOrDefault(c => c.Metadata.Edition == "PE"); + return dac != null ? dac.Value : this.controllers.Single(c => c.Metadata.Edition == "CE").Value; } } } diff --git a/DNN Platform/Modules/DigitalAssets/Settings.ascx.cs b/DNN Platform/Modules/DigitalAssets/Settings.ascx.cs index 05d4376edd7..9062216b177 100644 --- a/DNN Platform/Modules/DigitalAssets/Settings.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/Settings.ascx.cs @@ -25,7 +25,7 @@ private DigitalAssestsMode SelectedDigitalAssestsMode get { DigitalAssestsMode mode; - Enum.TryParse(ModeComboBox.SelectedValue, true, out mode); + Enum.TryParse(this.ModeComboBox.SelectedValue, true, out mode); return mode; } } @@ -35,14 +35,14 @@ private FilterCondition SelectedFilterCondition get { FilterCondition filterCondition; - Enum.TryParse(FilterOptionsRadioButtonsList.SelectedValue, true, out filterCondition); + Enum.TryParse(this.FilterOptionsRadioButtonsList.SelectedValue, true, out filterCondition); return filterCondition; } } protected override void OnInit(EventArgs e) { - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/DigitalAssets/ClientScripts/dnn.DigitalAssets.FilterViewSettings.js", FileOrder.Js.DefaultPriority); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/DigitalAssets/ClientScripts/dnn.DigitalAssets.FilterViewSettings.js", FileOrder.Js.DefaultPriority); } /// ----------------------------------------------------------------------------- @@ -52,25 +52,25 @@ protected override void OnInit(EventArgs e) /// ----------------------------------------------------------------------------- public override void LoadSettings() { - if (Page.IsPostBack) + if (this.Page.IsPostBack) { return; } try { - DefaultFolderTypeComboBox.DataSource = FolderMappingController.Instance.GetFolderMappings(PortalId); - DefaultFolderTypeComboBox.DataBind(); + this.DefaultFolderTypeComboBox.DataSource = FolderMappingController.Instance.GetFolderMappings(this.PortalId); + this.DefaultFolderTypeComboBox.DataBind(); - var defaultFolderTypeId = new DigitalAssetsController().GetDefaultFolderTypeId(ModuleId); + var defaultFolderTypeId = new DigitalAssetsController().GetDefaultFolderTypeId(this.ModuleId); if (defaultFolderTypeId.HasValue) { - DefaultFolderTypeComboBox.SelectedValue = defaultFolderTypeId.ToString(); + this.DefaultFolderTypeComboBox.SelectedValue = defaultFolderTypeId.ToString(); } - ModeComboBox.SelectedValue = SettingsRepository.GetMode(ModuleId).ToString(); + this.ModeComboBox.SelectedValue = SettingsRepository.GetMode(this.ModuleId).ToString(); - LoadFilterViewSettings(); + this.LoadFilterViewSettings(); } catch (Exception exc) { @@ -85,16 +85,16 @@ public override void LoadSettings() /// ----------------------------------------------------------------------------- public override void UpdateSettings() { - Page.Validate(); - if (!Page.IsValid) return; + this.Page.Validate(); + if (!this.Page.IsValid) return; try { - SettingsRepository.SaveDefaultFolderTypeId(ModuleId, Convert.ToInt32(DefaultFolderTypeComboBox.SelectedValue)); + SettingsRepository.SaveDefaultFolderTypeId(this.ModuleId, Convert.ToInt32(this.DefaultFolderTypeComboBox.SelectedValue)); - SettingsRepository.SaveMode(ModuleId, SelectedDigitalAssestsMode); + SettingsRepository.SaveMode(this.ModuleId, this.SelectedDigitalAssestsMode); - UpdateFilterViewSettings(); + this.UpdateFilterViewSettings(); } catch (Exception exc) { @@ -104,7 +104,7 @@ public override void UpdateSettings() protected void ValidateFolderIsSelected(object source, ServerValidateEventArgs args) { - if (SelectedFilterCondition == FilterCondition.FilterByFolder && FilterByFolderDropDownList.SelectedFolder == null) + if (this.SelectedFilterCondition == FilterCondition.FilterByFolder && this.FilterByFolderDropDownList.SelectedFolder == null) { args.IsValid = false; return; @@ -116,38 +116,38 @@ protected void ValidateFolderIsSelected(object source, ServerValidateEventArgs a private void LoadFilterViewSettings() { //handle upgrades where FilterCondition didn't exist - SettingsRepository.SetDefaultFilterCondition(ModuleId); + SettingsRepository.SetDefaultFilterCondition(this.ModuleId); - FilterOptionsRadioButtonsList.SelectedValue = SettingsRepository.GetFilterCondition(ModuleId).ToString(); - SubfolderFilterRadioButtonList.SelectedValue = SettingsRepository.GetSubfolderFilter(ModuleId).ToString(); + this.FilterOptionsRadioButtonsList.SelectedValue = SettingsRepository.GetFilterCondition(this.ModuleId).ToString(); + this.SubfolderFilterRadioButtonList.SelectedValue = SettingsRepository.GetSubfolderFilter(this.ModuleId).ToString(); - if (FilterOptionsRadioButtonsList.SelectedValue == FilterCondition.FilterByFolder.ToString()) + if (this.FilterOptionsRadioButtonsList.SelectedValue == FilterCondition.FilterByFolder.ToString()) { - var folderId = SettingsRepository.GetRootFolderId(ModuleId); + var folderId = SettingsRepository.GetRootFolderId(this.ModuleId); if (folderId.HasValue) { var folder = FolderManager.Instance.GetFolder(folderId.Value); - FilterByFolderDropDownList.SelectedFolder = folder; + this.FilterByFolderDropDownList.SelectedFolder = folder; } } } private void UpdateFilterViewSettings() { - var filterCondition = SelectedDigitalAssestsMode != DigitalAssestsMode.Normal ? FilterCondition.NotSet : SelectedFilterCondition; + var filterCondition = this.SelectedDigitalAssestsMode != DigitalAssestsMode.Normal ? FilterCondition.NotSet : this.SelectedFilterCondition; - SettingsRepository.SaveFilterCondition(ModuleId, filterCondition); + SettingsRepository.SaveFilterCondition(this.ModuleId, filterCondition); switch (filterCondition) { case FilterCondition.NotSet: - SettingsRepository.SaveExcludeSubfolders(ModuleId, SubfolderFilter.IncludeSubfoldersFolderStructure); + SettingsRepository.SaveExcludeSubfolders(this.ModuleId, SubfolderFilter.IncludeSubfoldersFolderStructure); break; case FilterCondition.FilterByFolder: SubfolderFilter subfolderFilter; - Enum.TryParse(SubfolderFilterRadioButtonList.SelectedValue, true, out subfolderFilter); - SettingsRepository.SaveExcludeSubfolders(ModuleId, subfolderFilter); - SettingsRepository.SaveRootFolderId(ModuleId, FilterByFolderDropDownList.SelectedFolder.FolderID); + Enum.TryParse(this.SubfolderFilterRadioButtonList.SelectedValue, true, out subfolderFilter); + SettingsRepository.SaveExcludeSubfolders(this.ModuleId, subfolderFilter); + SettingsRepository.SaveRootFolderId(this.ModuleId, this.FilterByFolderDropDownList.SelectedFolder.FolderID); break; } } diff --git a/DNN Platform/Modules/DigitalAssets/View.ascx.cs b/DNN Platform/Modules/DigitalAssets/View.ascx.cs index 0551de8bc4b..9c1864fb8db 100644 --- a/DNN Platform/Modules/DigitalAssets/View.ascx.cs +++ b/DNN Platform/Modules/DigitalAssets/View.ascx.cs @@ -52,8 +52,8 @@ public partial class View : PortalModuleBase, IActionable private readonly INavigationManager _navigationManager; public View() { - controller = new Factory().DigitalAssetsController; - _navigationManager = DependencyProvider.GetRequiredService(); + this.controller = new Factory().DigitalAssetsController; + this._navigationManager = this.DependencyProvider.GetRequiredService(); } private IExtensionPointFilter Filter @@ -61,7 +61,7 @@ private IExtensionPointFilter Filter get { return new CompositeFilter() - .And(new FilterByHostMenu(IsHostPortal)) + .And(new FilterByHostMenu(this.IsHostPortal)) .And(new FilterByUnauthenticated(HttpContext.Current.Request.IsAuthenticated)); } } @@ -70,13 +70,13 @@ private NameValueCollection DAMState { get { - if (damState == null) + if (this.damState == null) { - var stateCookie = Request.Cookies["damState-" + UserId]; - damState = HttpUtility.ParseQueryString(Uri.UnescapeDataString(stateCookie != null ? stateCookie.Value : "")); + var stateCookie = this.Request.Cookies["damState-" + this.UserId]; + this.damState = HttpUtility.ParseQueryString(Uri.UnescapeDataString(stateCookie != null ? stateCookie.Value : "")); } - return damState; + return this.damState; } } @@ -86,7 +86,7 @@ protected int InitialTab { get { - return controller.GetInitialTab(Request.Params, DAMState); + return this.controller.GetInitialTab(this.Request.Params, this.DAMState); } } @@ -94,7 +94,7 @@ protected bool IsHostPortal { get { - return IsHostMenu || controller.GetCurrentPortalId(ModuleId) == Null.NullInteger; + return this.IsHostMenu || this.controller.GetCurrentPortalId(this.ModuleId) == Null.NullInteger; } } @@ -102,7 +102,7 @@ protected string InvalidCharacters { get { - return GetNoControlCharsString(controller.GetInvalidChars()); + return GetNoControlCharsString(this.controller.GetInvalidChars()); } } @@ -110,7 +110,7 @@ protected string InvalidCharactersErrorText { get { - return controller.GetInvalidCharsErrorText(); + return this.controller.GetInvalidCharsErrorText(); } } @@ -126,7 +126,7 @@ protected string NavigateUrl { get { - var url = _navigationManager.NavigateURL(TabId, "ControlKey", "mid=" + ModuleId, "ReturnUrl=" + Server.UrlEncode(_navigationManager.NavigateURL())); + var url = this._navigationManager.NavigateURL(this.TabId, "ControlKey", "mid=" + this.ModuleId, "ReturnUrl=" + this.Server.UrlEncode(this._navigationManager.NavigateURL())); //append popUp parameter var delimiter = url.Contains("?") ? "&" : "?"; @@ -148,7 +148,7 @@ protected string DefaultFolderTypeId { get { - var defaultFolderTypeId = controller.GetDefaultFolderTypeId(ModuleId); + var defaultFolderTypeId = this.controller.GetDefaultFolderTypeId(this.ModuleId); return defaultFolderTypeId.HasValue ? defaultFolderTypeId.ToString() : ""; } } @@ -157,7 +157,7 @@ protected bool FilteredContent { get { - return SettingsRepository.GetSubfolderFilter(ModuleId) != SubfolderFilter.IncludeSubfoldersFolderStructure; + return SettingsRepository.GetSubfolderFilter(this.ModuleId) != SubfolderFilter.IncludeSubfoldersFolderStructure; } } @@ -181,19 +181,19 @@ private static string GetNoControlCharsString(string text) private void InitializeFolderType() { - FolderTypeComboBox.DataSource = controller.GetFolderMappings(ModuleId); - FolderTypeComboBox.DataBind(); + this.FolderTypeComboBox.DataSource = this.controller.GetFolderMappings(this.ModuleId); + this.FolderTypeComboBox.DataBind(); } private void InitializeGrid() { - Grid.MasterTableView.PagerStyle.PrevPageToolTip = LocalizeString("PagerPreviousPage.ToolTip"); - Grid.MasterTableView.PagerStyle.NextPageToolTip = LocalizeString("PagerNextPage.ToolTip"); - Grid.MasterTableView.PagerStyle.FirstPageToolTip = LocalizeString("PagerFirstPage.ToolTip"); - Grid.MasterTableView.PagerStyle.LastPageToolTip = LocalizeString("PagerLastPage.ToolTip"); - Grid.MasterTableView.PagerStyle.PageSizeLabelText = LocalizeString("PagerPageSize.Text"); + this.Grid.MasterTableView.PagerStyle.PrevPageToolTip = this.LocalizeString("PagerPreviousPage.ToolTip"); + this.Grid.MasterTableView.PagerStyle.NextPageToolTip = this.LocalizeString("PagerNextPage.ToolTip"); + this.Grid.MasterTableView.PagerStyle.FirstPageToolTip = this.LocalizeString("PagerFirstPage.ToolTip"); + this.Grid.MasterTableView.PagerStyle.LastPageToolTip = this.LocalizeString("PagerLastPage.ToolTip"); + this.Grid.MasterTableView.PagerStyle.PageSizeLabelText = this.LocalizeString("PagerPageSize.Text"); - foreach (var columnExtension in epm.GetGridColumnExtensionPoints("DigitalAssets", "GridColumns", Filter)) + foreach (var columnExtension in this.epm.GetGridColumnExtensionPoints("DigitalAssets", "GridColumns", this.Filter)) { var column = new DnnGridBoundColumn { @@ -207,8 +207,8 @@ private void InitializeGrid() }; column.HeaderStyle.Width = columnExtension.HeaderStyleWidth; - var index = Math.Min(columnExtension.ColumnAt, Grid.Columns.Count - 1); - Grid.Columns.AddAt(index, column); + var index = Math.Min(columnExtension.ColumnAt, this.Grid.Columns.Count - 1); + this.Grid.Columns.AddAt(index, column); } } @@ -216,12 +216,12 @@ private void LoadSubfolders(DnnTreeNode node, int folderId, string nextFolderNam { nextNode = null; nextFolderId = 0; - var folders = controller.GetFolders(ModuleId, folderId); + var folders = this.controller.GetFolders(this.ModuleId, folderId); foreach (var folder in folders) { - var hasViewPermissions = HasViewPermissions(folder.Permissions); + var hasViewPermissions = this.HasViewPermissions(folder.Permissions); var newNode = this.CreateNodeFromFolder(folder); - SetupNodeAttributes(newNode, folder.Permissions, folder); + this.SetupNodeAttributes(newNode, folder.Permissions, folder); node.Nodes.Add(newNode); @@ -236,7 +236,7 @@ private void LoadSubfolders(DnnTreeNode node, int folderId, string nextFolderNam private void InitializeTreeViews(string initialPath) { - var rootFolder = RootFolderViewModel; + var rootFolder = this.RootFolderViewModel; var rootNode = this.CreateNodeFromFolder(rootFolder); rootNode.Selected = true; @@ -246,7 +246,7 @@ private void InitializeTreeViews(string initialPath) var nextNode = rootNode; foreach (var folderName in initialPath.Split('/')) { - LoadSubfolders(nextNode, folderId, folderName, out nextNode, out folderId); + this.LoadSubfolders(nextNode, folderId, folderName, out nextNode, out folderId); if (nextNode == null) { // The requested folder does not exist or the user does not have permissions @@ -266,15 +266,15 @@ private void InitializeTreeViews(string initialPath) this.SetExpandable(rootNode, false); } - SetupNodeAttributes(rootNode, GetPermissionsForRootFolder(rootFolder.Permissions), rootFolder); + this.SetupNodeAttributes(rootNode, this.GetPermissionsForRootFolder(rootFolder.Permissions), rootFolder); - FolderTreeView.Nodes.Clear(); - DestinationTreeView.Nodes.Clear(); + this.FolderTreeView.Nodes.Clear(); + this.DestinationTreeView.Nodes.Clear(); - FolderTreeView.Nodes.Add(rootNode); - DestinationTreeView.Nodes.Add(rootNode.Clone()); + this.FolderTreeView.Nodes.Add(rootNode); + this.DestinationTreeView.Nodes.Add(rootNode.Clone()); - InitializeTreeViewContextMenu(); + this.InitializeTreeViewContextMenu(); } private DnnTreeNode CreateNodeFromFolder(FolderViewModel folder) @@ -286,7 +286,7 @@ private DnnTreeNode CreateNodeFromFolder(FolderViewModel folder) Value = folder.FolderID.ToString(CultureInfo.InvariantCulture), Category = folder.FolderMappingID.ToString(CultureInfo.InvariantCulture), }; - this.SetExpandable(node, folder.HasChildren && HasViewPermissions(folder.Permissions)); + this.SetExpandable(node, folder.HasChildren && this.HasViewPermissions(folder.Permissions)); return node; } @@ -306,53 +306,53 @@ private void SetupNodeAttributes(DnnTreeNode node, IEnumerable - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/DnnExportImport/Components/Common/SummaryList.cs b/DNN Platform/Modules/DnnExportImport/Components/Common/SummaryList.cs index 781ecf30bb1..50972508da7 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Common/SummaryList.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Common/SummaryList.cs @@ -28,7 +28,7 @@ public class SummaryList : List var summaryItems = items as IList ?? items.ToList(); foreach (var summaryItem in summaryItems.OrderBy(x => x.Order)) { - Add(summaryItem); + this.Add(summaryItem); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Controllers/EntitiesController.cs b/DNN Platform/Modules/DnnExportImport/Components/Controllers/EntitiesController.cs index 1913f68fcfb..d694986a206 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Controllers/EntitiesController.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Controllers/EntitiesController.cs @@ -30,157 +30,157 @@ protected override Func GetFactory() public ExportImportJob GetFirstActiveJob() { - return CBO.Instance.FillObject(_dataProvider.GetFirstActiveJob()); + return CBO.Instance.FillObject(this._dataProvider.GetFirstActiveJob()); } public ExportImportJob GetJobById(int jobId) { - var job = CBO.Instance.FillObject(_dataProvider.GetJobById(jobId)); + var job = CBO.Instance.FillObject(this._dataProvider.GetJobById(jobId)); //System.Diagnostics.Trace.WriteLine($"xxxxxxxxx job id={job?.JobId} IsCancelled={job?.IsCancelled} xxxxxxxxx"); return job; } public IList GetJobSummaryLog(int jobId) { - return CBO.Instance.FillCollection(_dataProvider.GetJobSummaryLog(jobId)); + return CBO.Instance.FillCollection(this._dataProvider.GetJobSummaryLog(jobId)); } public IList GetJobFullLog(int jobId) { - return CBO.Instance.FillCollection(_dataProvider.GetJobFullLog(jobId)); + return CBO.Instance.FillCollection(this._dataProvider.GetJobFullLog(jobId)); } public int GetAllJobsCount(int? portalId, int? jobType, string keywords) { - return _dataProvider.GetAllJobsCount(portalId, jobType, keywords); + return this._dataProvider.GetAllJobsCount(portalId, jobType, keywords); } public IList GetAllJobs(int? portalId, int? pageSize, int? pageIndex, int? jobType, string keywords) { return CBO.Instance.FillCollection( - _dataProvider.GetAllJobs(portalId, pageSize, pageIndex, jobType, keywords)); + this._dataProvider.GetAllJobs(portalId, pageSize, pageIndex, jobType, keywords)); } public DateTime? GetLastJobTime(int portalId, JobType jobType) { - return _dataProvider.GetLastJobTime(portalId, jobType); + return this._dataProvider.GetLastJobTime(portalId, jobType); } public void UpdateJobInfo(ExportImportJob job) { - _dataProvider.UpdateJobInfo(job.JobId, job.Name, job.Description); + this._dataProvider.UpdateJobInfo(job.JobId, job.Name, job.Description); } public void UpdateJobStatus(ExportImportJob job) { - _dataProvider.UpdateJobStatus(job.JobId, job.JobStatus); + this._dataProvider.UpdateJobStatus(job.JobId, job.JobStatus); } public void SetJobCancelled(ExportImportJob job) { - _dataProvider.SetJobCancelled(job.JobId); + this._dataProvider.SetJobCancelled(job.JobId); } public void RemoveJob(ExportImportJob job) { - _dataProvider.RemoveJob(job.JobId); + this._dataProvider.RemoveJob(job.JobId); } public IList GetJobChekpoints(int jobId) { - return CBO.Instance.FillCollection(_dataProvider.GetJobChekpoints(jobId)); + return CBO.Instance.FillCollection(this._dataProvider.GetJobChekpoints(jobId)); } public void UpdateJobChekpoint(ExportImportChekpoint checkpoint) { - _dataProvider.UpsertJobChekpoint(checkpoint); + this._dataProvider.UpsertJobChekpoint(checkpoint); } public IList GetPortalTabs(int portalId, bool includeDeleted, bool includeSystem, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllPortalTabs(portalId, includeDeleted, includeSystem, toDate, fromDate)); + this._dataProvider.GetAllPortalTabs(portalId, includeDeleted, includeSystem, toDate, fromDate)); } public IList GetTabSettings(int tabId, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllTabSettings(tabId, toDate, fromDate)); + this._dataProvider.GetAllTabSettings(tabId, toDate, fromDate)); } public IList GetTabPermissions(int tabId, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllTabPermissions(tabId, toDate, fromDate)); + this._dataProvider.GetAllTabPermissions(tabId, toDate, fromDate)); } public IList GetTabUrls(int tabId, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllTabUrls(tabId, toDate, fromDate)); + this._dataProvider.GetAllTabUrls(tabId, toDate, fromDate)); } public IList GetModules(int tabId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllModules(tabId, includeDeleted, toDate, fromDate)); + this._dataProvider.GetAllModules(tabId, includeDeleted, toDate, fromDate)); } public IList GetModuleSettings(int moduleId, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllModuleSettings(moduleId, toDate, fromDate)); + this._dataProvider.GetAllModuleSettings(moduleId, toDate, fromDate)); } public IList GetModulePermissions(int moduleId, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllModulePermissions(moduleId, toDate, fromDate)); + this._dataProvider.GetAllModulePermissions(moduleId, toDate, fromDate)); } public IList GetTabModules(int tabId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllTabModules(tabId, includeDeleted, toDate, fromDate)); + this._dataProvider.GetAllTabModules(tabId, includeDeleted, toDate, fromDate)); } public IList GetTabModuleSettings(int tabId, DateTime toDate, DateTime? fromDate) { - return GetTabModuleSettings(tabId, true, toDate, fromDate); + return this.GetTabModuleSettings(tabId, true, toDate, fromDate); } public IList GetTabModuleSettings(int tabId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { return CBO.Instance.FillCollection( - _dataProvider.GetAllTabModuleSettings(tabId, includeDeleted, toDate, fromDate)); + this._dataProvider.GetAllTabModuleSettings(tabId, includeDeleted, toDate, fromDate)); } public PermissionInfo GetPermissionInfo(string permissionCode, string permissionKey, string permissionName) { return CBO.Instance.FillObject( - _dataProvider.GetPermissionInfo(permissionCode, permissionKey, permissionName)); + this._dataProvider.GetPermissionInfo(permissionCode, permissionKey, permissionName)); } public void SetTabSpecificData(int tabId, bool isDeleted, bool isVisible) { - _dataProvider.SetTabSpecificData(tabId, isDeleted, isVisible); + this._dataProvider.SetTabSpecificData(tabId, isDeleted, isVisible); } public void SetTabModuleDeleted(int tabModuleId, bool isDeleted) { - _dataProvider.SetTabModuleDeleted(tabModuleId, isDeleted); + this._dataProvider.SetTabModuleDeleted(tabModuleId, isDeleted); } public void SetUserDeleted(int portalId, int userId, bool isDeleted) { - _dataProvider.SetUserDeleted(portalId, userId, isDeleted); + this._dataProvider.SetUserDeleted(portalId, userId, isDeleted); } public void RunSchedule() { var executingServer = ServerController.GetExecutingServerName(); - var scheduleItem = SchedulingController.GetSchedule(GetSchedulerTypeFullName(), executingServer); + var scheduleItem = SchedulingController.GetSchedule(this.GetSchedulerTypeFullName(), executingServer); if (scheduleItem != null) { SchedulingProvider.Instance().RunScheduleItemNow(scheduleItem, true); diff --git a/DNN Platform/Modules/DnnExportImport/Components/Controllers/ExportController.cs b/DNN Platform/Modules/DnnExportImport/Components/Controllers/ExportController.cs index 5db0721cd19..2033b123ffd 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Controllers/ExportController.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Controllers/ExportController.cs @@ -26,7 +26,7 @@ public int QueueOperation(int userId, ExportDto exportDto) var directory = dbTime.ToString("yyyy-MM-dd_HH-mm-ss"); if (exportDto.ExportMode == ExportMode.Differential) { - exportDto.FromDateUtc = GetLastJobTime(exportDto.PortalId, JobType.Export); + exportDto.FromDateUtc = this.GetLastJobTime(exportDto.PortalId, JobType.Export); } var dataObject = JsonConvert.SerializeObject(exportDto); exportDto.IsDirty = false;//This should be set to false for new job. @@ -37,7 +37,7 @@ public int QueueOperation(int userId, ExportDto exportDto) { EntitiesController.Instance.RunSchedule(); } - AddEventLog(exportDto.PortalId, userId, jobId, Constants.LogTypeSiteExport); + this.AddEventLog(exportDto.PortalId, userId, jobId, Constants.LogTypeSiteExport); return jobId; } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Controllers/ImportController.cs b/DNN Platform/Modules/DnnExportImport/Components/Controllers/ImportController.cs index 0cf20a9576d..6c21ecf8c56 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Controllers/ImportController.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Controllers/ImportController.cs @@ -35,7 +35,7 @@ public int QueueOperation(int userId, ImportDto importDto) { EntitiesController.Instance.RunSchedule(); } - AddEventLog(importDto.PortalId, userId, jobId, Constants.LogTypeSiteImport); + this.AddEventLog(importDto.PortalId, userId, jobId, Constants.LogTypeSiteImport); return jobId; } @@ -59,12 +59,12 @@ public IEnumerable GetImportPackages(out int total, string ke var importPackagesList = importPackages as IList ?? importPackages.ToList(); importPackages = !string.IsNullOrEmpty(keyword) - ? importPackagesList.Where(GetImportPackageFilterFunc(keyword)) + ? importPackagesList.Where(this.GetImportPackageFilterFunc(keyword)) : importPackagesList; total = importPackages.Count(); string sortOrder; - var orderByFunc = GetImportPackageOrderByFunc(order, out sortOrder); + var orderByFunc = this.GetImportPackageOrderByFunc(order, out sortOrder); importPackages = sortOrder == "asc" ? importPackages.OrderBy(orderByFunc) : importPackages.OrderByDescending(orderByFunc); diff --git a/DNN Platform/Modules/DnnExportImport/Components/Controllers/SettingsController.cs b/DNN Platform/Modules/DnnExportImport/Components/Controllers/SettingsController.cs index 34c38d10629..2a6f3c95de9 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Controllers/SettingsController.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Controllers/SettingsController.cs @@ -31,7 +31,7 @@ public IEnumerable GetAllSettings() public ExportImportSetting GetSetting(string settingName) { - return GetAllSettings().ToList().FirstOrDefault(x => x.SettingName == settingName); + return this.GetAllSettings().ToList().FirstOrDefault(x => x.SettingName == settingName); } public void AddSetting(ExportImportSetting exportImportSetting) diff --git a/DNN Platform/Modules/DnnExportImport/Components/Dto/ExportDto.cs b/DNN Platform/Modules/DnnExportImport/Components/Dto/ExportDto.cs index ea6f76647a5..ee3026145de 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Dto/ExportDto.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Dto/ExportDto.cs @@ -127,9 +127,9 @@ public class ExportDto public DateTime ToDateUtc { get; set; } [JsonIgnore] - public DateTime? FromDate => FromDateUtc; + public DateTime? FromDate => this.FromDateUtc; [JsonIgnore] - public DateTime ToDate => ToDateUtc; + public DateTime ToDate => this.ToDateUtc; /// /// The pages to be exported. These are the ID's (plus other information) diff --git a/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportExportSummary.cs b/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportExportSummary.cs index 82d7f1be6ae..6f22e6db39b 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportExportSummary.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportExportSummary.cs @@ -19,7 +19,7 @@ public class ImportExportSummary : IDateTimeConverter { public ImportExportSummary() { - SummaryItems = new SummaryList(); + this.SummaryItems = new SummaryList(); } /// /// Does this import/export includes the properties definitions or not. @@ -56,7 +56,7 @@ public ImportExportSummary() /// /// Formatted Date from which data was taken to perform export. /// - public string FromDateString => Util.GetDateTimeString(FromDate); + public string FromDateString => Util.GetDateTimeString(this.FromDate); /// /// Date till which data was taken to perform export. @@ -66,7 +66,7 @@ public ImportExportSummary() /// /// Formatted Date till which data was taken to perform export. /// - public string ToDateString => Util.GetDateTimeString(ToDate); + public string ToDateString => Util.GetDateTimeString(this.ToDate); /// /// Summary of each item export. @@ -80,19 +80,19 @@ public ImportExportSummary() public void ConvertToLocal(UserInfo userInfo) { if (userInfo == null) return; - ToDate = Util.ToLocalDateTime(ToDate, userInfo); - if (FromDate != null) - FromDate = Util.ToLocalDateTime(FromDate.Value, userInfo); - ExportFileInfo?.ConvertToLocal(userInfo); + this.ToDate = Util.ToLocalDateTime(this.ToDate, userInfo); + if (this.FromDate != null) + this.FromDate = Util.ToLocalDateTime(this.FromDate.Value, userInfo); + this.ExportFileInfo?.ConvertToLocal(userInfo); - if (SummaryItems == null) return; + if (this.SummaryItems == null) return; var tempSummaryItems = new SummaryList(); - foreach (var summaryItem in SummaryItems) + foreach (var summaryItem in this.SummaryItems) { summaryItem.ConvertToLocal(userInfo); tempSummaryItems.Add(summaryItem); } - SummaryItems = tempSummaryItems; + this.SummaryItems = tempSummaryItems; } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportPackageInfo.cs b/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportPackageInfo.cs index c7fd70cda89..3ccaa159822 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportPackageInfo.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Dto/ImportPackageInfo.cs @@ -26,7 +26,7 @@ public class ImportPackageInfo : IDateTimeConverter /// /// Package file name. It is just fake name for UI representation /// - public string FileName => PackageId; + public string FileName => this.PackageId; /// /// DateTime when the package was exported. @@ -36,7 +36,7 @@ public class ImportPackageInfo : IDateTimeConverter /// /// Formatted DateTime when the package was exported. /// - public string ExporTimeString => Util.GetDateTimeString(ExporTime); + public string ExporTimeString => Util.GetDateTimeString(this.ExporTime); /// /// The portal from which the exported package was created @@ -51,7 +51,7 @@ public class ImportPackageInfo : IDateTimeConverter /// /// Path to the thumbnail image for the package. /// - public string Thumb => PackageId + ".jpg"; + public string Thumb => this.PackageId + ".jpg"; /// /// Complete summary of import package @@ -61,8 +61,8 @@ public class ImportPackageInfo : IDateTimeConverter public void ConvertToLocal(UserInfo userInfo) { if (userInfo == null) return; - ExporTime = Util.ToLocalDateTime(ExporTime, userInfo); - Summary?.ConvertToLocal(userInfo); + this.ExporTime = Util.ToLocalDateTime(this.ExporTime, userInfo); + this.Summary?.ConvertToLocal(userInfo); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/AllJobsResult.cs b/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/AllJobsResult.cs index b7eff3b3eb1..b1c7c7abafc 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/AllJobsResult.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/AllJobsResult.cs @@ -17,32 +17,32 @@ public class AllJobsResult : IDateTimeConverter public int PortalId { get; set; } public string PortalName { get; set; } public int TotalJobs { get; set; } - public string TotalJobsString => Util.FormatNumber(TotalJobs); + public string TotalJobsString => Util.FormatNumber(this.TotalJobs); public DateTime? LastExportTime { get; set; } public DateTime? LastImportTime { get; set; } - public string LastExportTimeString => Util.GetDateTimeString(LastExportTime); + public string LastExportTimeString => Util.GetDateTimeString(this.LastExportTime); - public string LastImportTimeString => Util.GetDateTimeString(LastImportTime); + public string LastImportTimeString => Util.GetDateTimeString(this.LastImportTime); public IEnumerable Jobs { get; set; } public void ConvertToLocal(UserInfo userInfo) { - LastExportTime = Util.ToLocalDateTime(LastExportTime, userInfo); - LastImportTime = Util.ToLocalDateTime(LastImportTime, userInfo); + this.LastExportTime = Util.ToLocalDateTime(this.LastExportTime, userInfo); + this.LastImportTime = Util.ToLocalDateTime(this.LastImportTime, userInfo); if (userInfo == null) return; - if (Jobs == null) return; + if (this.Jobs == null) return; var tempJobs = new List(); - foreach (var job in Jobs) + foreach (var job in this.Jobs) { job.ConvertToLocal(userInfo); tempJobs.Add(job); } - Jobs = tempJobs; + this.Jobs = tempJobs; } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/JobItem.cs b/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/JobItem.cs index 09422c134ed..631e5fa0962 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/JobItem.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Dto/Jobs/JobItem.cs @@ -23,9 +23,9 @@ public class JobItem : IDateTimeConverter public string Name { get; set; } public string Description { get; set; } public DateTime CreatedOn { get; set; } - public string CreatedOnString => Util.GetDateTimeString(CreatedOn); + public string CreatedOnString => Util.GetDateTimeString(this.CreatedOn); public DateTime? CompletedOn { get; set; } - public string CompletedOnString => Util.GetDateTimeString(CompletedOn); + public string CompletedOnString => Util.GetDateTimeString(this.CompletedOn); public string ExportFile { get; set; } //public IEnumerable Summary { get; set; } @@ -34,10 +34,10 @@ public class JobItem : IDateTimeConverter public void ConvertToLocal(UserInfo userInfo) { if (userInfo == null) return; - Summary?.ConvertToLocal(userInfo); - CreatedOn = Util.ToLocalDateTime(CreatedOn, userInfo); - if (CompletedOn != null) - CompletedOn = Util.ToLocalDateTime(CompletedOn.Value, userInfo); + this.Summary?.ConvertToLocal(userInfo); + this.CreatedOn = Util.ToLocalDateTime(this.CreatedOn, userInfo); + if (this.CompletedOn != null) + this.CompletedOn = Util.ToLocalDateTime(this.CompletedOn.Value, userInfo); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Dto/SummaryItem.cs b/DNN Platform/Modules/DnnExportImport/Components/Dto/SummaryItem.cs index 5693f41690f..237393c6aab 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Dto/SummaryItem.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Dto/SummaryItem.cs @@ -29,7 +29,7 @@ public class SummaryItem : IDateTimeConverter /// /// Formatted total items. /// - public string TotalItemsString => Util.FormatNumber(TotalItems); + public string TotalItemsString => Util.FormatNumber(this.TotalItems); /// /// Items processed. @@ -44,7 +44,7 @@ public class SummaryItem : IDateTimeConverter /// /// Formatted processed items. /// - public string ProcessedItemsString => Util.FormatNumber(ProcessedItems); + public string ProcessedItemsString => Util.FormatNumber(this.ProcessedItems); /// /// Progress in percentage. diff --git a/DNN Platform/Modules/DnnExportImport/Components/Engines/ExportImportEngine.cs b/DNN Platform/Modules/DnnExportImport/Components/Engines/ExportImportEngine.cs index b59f3389f5e..44eae0bc414 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Engines/ExportImportEngine.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Engines/ExportImportEngine.cs @@ -64,7 +64,7 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul return; } - _timeoutSeconds = GetTimeoutPerSlot(); + this._timeoutSeconds = GetTimeoutPerSlot(); var dbName = Path.Combine(ExportFolder, exportJob.Directory, Constants.ExportDbName); var finfo = new FileInfo(dbName); dbName = finfo.FullName; @@ -116,7 +116,7 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul return; } scheduleHistoryItem.AddLogNote($"
    SITE EXPORT Preparing Check Points. JOB #{exportJob.JobId}: {exportJob.Name}"); - PrepareCheckPoints(exportJob.JobId, parentServices, implementors, includedItems, checkpoints); + this.PrepareCheckPoints(exportJob.JobId, parentServices, implementors, includedItems, checkpoints); scheduleHistoryItem.AddLogNote($"
    SITE EXPORT Started. JOB #{exportJob.JobId}: {exportJob.Name}"); scheduleHistoryItem.AddLogNote($"
    Between [{exportDto.FromDateUtc ?? Constants.MinDbTime}] and [{exportDto.ToDateUtc:g}]"); @@ -152,7 +152,7 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul service.Result = result; service.Repository = ctx; service.CheckCancelled = CheckCancelledCallBack; - service.CheckPointStageCallback = CheckpointCallback; + service.CheckPointStageCallback = this.CheckpointCallback; service.CheckPoint = checkpoints.FirstOrDefault(cp => cp.Category == service.Category && cp.AssemblyName == serviceAssembly); if (service.CheckPoint == null) @@ -166,7 +166,7 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul }; // persist the record in db - CheckpointCallback(service); + this.CheckpointCallback(service); } else if (service.CheckPoint.StartDate == Null.NullDate) service.CheckPoint.StartDate = DateUtils.GetDatabaseUtcTime(); @@ -178,7 +178,7 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul } finally { - AddLogsToDatabase(exportJob.JobId, result.CompleteLog); + this.AddLogsToDatabase(exportJob.JobId, result.CompleteLog); } scheduleHistoryItem.AddLogNote("
    Exported: " + service.Category); } @@ -196,14 +196,14 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul scheduleHistoryItem.AddLogNote( "
    Orphaned services: " + string.Join(",", parentServices.Select(x => x.Category))); } - } while (parentServices.Count > 0 && !TimeIsUp); + } while (parentServices.Count > 0 && !this.TimeIsUp); RemoveTokenFromCache(exportJob); } - if (TimeIsUp) + if (this.TimeIsUp) { - result.AddSummary($"Job time slot ({_timeoutSeconds} sec) expired", + result.AddSummary($"Job time slot ({this._timeoutSeconds} sec) expired", "Job will resume in the next scheduler iteration"); } else if (exportJob.JobStatus == JobStatus.InProgress) @@ -234,7 +234,7 @@ public void Export(ExportImportJob exportJob, ExportImportResult result, Schedul public void Import(ExportImportJob importJob, ExportImportResult result, ScheduleHistoryItem scheduleHistoryItem) { scheduleHistoryItem.AddLogNote($"
    SITE IMPORT Started. JOB #{importJob.JobId}"); - _timeoutSeconds = GetTimeoutPerSlot(); + this._timeoutSeconds = GetTimeoutPerSlot(); var importDto = JsonConvert.DeserializeObject(importJob.JobObject); if (importDto == null) { @@ -301,7 +301,7 @@ public void Import(ExportImportJob importJob, ExportImportResult result, Schedul var includedItems = GetAllCategoriesToInclude(exportedDto, implementors); scheduleHistoryItem.AddLogNote($"
    SITE IMPORT Preparing Check Points. JOB #{importJob.JobId}: {importJob.Name}"); - PrepareCheckPoints(importJob.JobId, parentServices, implementors, includedItems, checkpoints); + this.PrepareCheckPoints(importJob.JobId, parentServices, implementors, includedItems, checkpoints); var firstIteration = true; AddJobToCache(importJob); @@ -333,7 +333,7 @@ public void Import(ExportImportJob importJob, ExportImportResult result, Schedul service.Result = result; service.Repository = ctx; service.CheckCancelled = CheckCancelledCallBack; - service.CheckPointStageCallback = CheckpointCallback; + service.CheckPointStageCallback = this.CheckpointCallback; service.CheckPoint = checkpoints.FirstOrDefault(cp => cp.Category == service.Category && cp.AssemblyName == serviceAssembly) ?? new ExportImportChekpoint { @@ -345,7 +345,7 @@ public void Import(ExportImportJob importJob, ExportImportResult result, Schedul }; if (service.CheckPoint.StartDate == Null.NullDate) service.CheckPoint.StartDate = DateUtils.GetDatabaseUtcTime(); - CheckpointCallback(service); + this.CheckpointCallback(service); try { @@ -353,7 +353,7 @@ public void Import(ExportImportJob importJob, ExportImportResult result, Schedul } finally { - AddLogsToDatabase(importJob.JobId, result.CompleteLog); + this.AddLogsToDatabase(importJob.JobId, result.CompleteLog); } scheduleHistoryItem.AddLogNote("
    Imported: " + service.Category); } @@ -371,12 +371,12 @@ public void Import(ExportImportJob importJob, ExportImportResult result, Schedul scheduleHistoryItem.AddLogNote( "
    Orphaned services: " + string.Join(",", parentServices.Select(x => x.Category))); } - } while (parentServices.Count > 0 && !TimeIsUp); + } while (parentServices.Count > 0 && !this.TimeIsUp); RemoveTokenFromCache(importJob); - if (TimeIsUp) + if (this.TimeIsUp) { - result.AddSummary($"Job time slot ({_timeoutSeconds} sec) expired", + result.AddSummary($"Job time slot ({this._timeoutSeconds} sec) expired", "Job will resume in the next scheduler iteration"); } else if (importJob.JobStatus == JobStatus.InProgress) @@ -428,7 +428,7 @@ private void PrepareCheckPoints(int jobId, List parentServi }; // persist the record in db - CheckpointCallback(service); + this.CheckpointCallback(service); } } @@ -459,10 +459,10 @@ private static bool CheckCancelledCallBack(ExportImportJob job) private bool CheckpointCallback(BasePortableService service) { EntitiesController.Instance.UpdateJobChekpoint(service.CheckPoint); - return TimeIsUp; + return this.TimeIsUp; } - private bool TimeIsUp => _stopWatch.Elapsed.TotalSeconds > _timeoutSeconds; + private bool TimeIsUp => this._stopWatch.Elapsed.TotalSeconds > this._timeoutSeconds; private static void AddJobToCache(ExportImportJob job) { diff --git a/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportChekpoint.cs b/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportChekpoint.cs index 1035d666f98..c6ada29ea13 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportChekpoint.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportChekpoint.cs @@ -30,12 +30,12 @@ public class ExportImportChekpoint : IHydratable public double Progress { - get { return _progress; } + get { return this._progress; } set { if (value < 0) value = 0; else if (value > 100) value = 100; - _progress = value; + this._progress = value; } } @@ -44,24 +44,24 @@ public double Progress public int KeyID { - get { return CheckpointId; } - set { CheckpointId = value; } + get { return this.CheckpointId; } + set { this.CheckpointId = value; } } public void Fill(IDataReader dr) { - CheckpointId = Null.SetNullInteger(dr[nameof(CheckpointId)]); - JobId = Null.SetNullInteger(dr[nameof(JobId)]); - AssemblyName = Null.SetNullString(dr[nameof(AssemblyName)]); - Category = Null.SetNullString(dr[nameof(Category)]); - Stage = Null.SetNullInteger(dr[nameof(Stage)]); - StageData = Null.SetNullString(dr[nameof(StageData)]); - Progress = Null.SetNullInteger(dr[nameof(Progress)]); - TotalItems = Null.SetNullInteger(dr[nameof(TotalItems)]); - ProcessedItems = Null.SetNullInteger(dr[nameof(ProcessedItems)]); - StartDate = Null.SetNullDateTime(dr[nameof(StartDate)]); - LastUpdateDate = Null.SetNullDateTime(dr[nameof(LastUpdateDate)]); - Completed = Null.SetNullBoolean(dr[nameof(Completed)]); + this.CheckpointId = Null.SetNullInteger(dr[nameof(this.CheckpointId)]); + this.JobId = Null.SetNullInteger(dr[nameof(this.JobId)]); + this.AssemblyName = Null.SetNullString(dr[nameof(this.AssemblyName)]); + this.Category = Null.SetNullString(dr[nameof(this.Category)]); + this.Stage = Null.SetNullInteger(dr[nameof(this.Stage)]); + this.StageData = Null.SetNullString(dr[nameof(this.StageData)]); + this.Progress = Null.SetNullInteger(dr[nameof(this.Progress)]); + this.TotalItems = Null.SetNullInteger(dr[nameof(this.TotalItems)]); + this.ProcessedItems = Null.SetNullInteger(dr[nameof(this.ProcessedItems)]); + this.StartDate = Null.SetNullDateTime(dr[nameof(this.StartDate)]); + this.LastUpdateDate = Null.SetNullDateTime(dr[nameof(this.LastUpdateDate)]); + this.Completed = Null.SetNullBoolean(dr[nameof(this.Completed)]); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJob.cs b/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJob.cs index da1f2871f84..023559b0c0c 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJob.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJob.cs @@ -32,39 +32,39 @@ public class ExportImportJob : IHydratable public int KeyID { - get { return JobId; } - set { JobId = value; } + get { return this.JobId; } + set { this.JobId = value; } } public void Fill(IDataReader dr) { - JobId = Null.SetNullInteger(dr[nameof(JobId)]); - PortalId = Null.SetNullInteger(dr[nameof(PortalId)]); - JobType = (JobType)Null.SetNullInteger(dr[nameof(JobType)]); - JobStatus = (JobStatus)Null.SetNullInteger(dr[nameof(JobStatus)]); - IsCancelled = Null.SetNullBoolean(dr[nameof(IsCancelled)]); - Name = Null.SetNullString(dr[nameof(Name)]); - Description = Null.SetNullString(dr[nameof(Description)]); - CreatedByUserId = Null.SetNullInteger(dr[nameof(CreatedByUserId)]); - CreatedOnDate = Null.SetNullDateTime(dr[nameof(CreatedOnDate)]); - LastModifiedOnDate = Null.SetNullDateTime(dr[nameof(LastModifiedOnDate)]); - CompletedOnDate = Null.SetNullDateTime(dr[nameof(CompletedOnDate)]); - Directory = Null.SetNullString(dr[nameof(Directory)]); - JobObject = Null.SetNullString(dr[nameof(JobObject)]); + this.JobId = Null.SetNullInteger(dr[nameof(this.JobId)]); + this.PortalId = Null.SetNullInteger(dr[nameof(this.PortalId)]); + this.JobType = (JobType)Null.SetNullInteger(dr[nameof(this.JobType)]); + this.JobStatus = (JobStatus)Null.SetNullInteger(dr[nameof(this.JobStatus)]); + this.IsCancelled = Null.SetNullBoolean(dr[nameof(this.IsCancelled)]); + this.Name = Null.SetNullString(dr[nameof(this.Name)]); + this.Description = Null.SetNullString(dr[nameof(this.Description)]); + this.CreatedByUserId = Null.SetNullInteger(dr[nameof(this.CreatedByUserId)]); + this.CreatedOnDate = Null.SetNullDateTime(dr[nameof(this.CreatedOnDate)]); + this.LastModifiedOnDate = Null.SetNullDateTime(dr[nameof(this.LastModifiedOnDate)]); + this.CompletedOnDate = Null.SetNullDateTime(dr[nameof(this.CompletedOnDate)]); + this.Directory = Null.SetNullString(dr[nameof(this.Directory)]); + this.JobObject = Null.SetNullString(dr[nameof(this.JobObject)]); - if (CreatedOnDate.Kind != DateTimeKind.Utc) + if (this.CreatedOnDate.Kind != DateTimeKind.Utc) { - CreatedOnDate = new DateTime( - CreatedOnDate.Year, CreatedOnDate.Month, CreatedOnDate.Day, - CreatedOnDate.Hour, CreatedOnDate.Minute, CreatedOnDate.Second, - CreatedOnDate.Millisecond, DateTimeKind.Utc); + this.CreatedOnDate = new DateTime( + this.CreatedOnDate.Year, this.CreatedOnDate.Month, this.CreatedOnDate.Day, + this.CreatedOnDate.Hour, this.CreatedOnDate.Minute, this.CreatedOnDate.Second, + this.CreatedOnDate.Millisecond, DateTimeKind.Utc); } - if (LastModifiedOnDate.Kind != DateTimeKind.Utc) + if (this.LastModifiedOnDate.Kind != DateTimeKind.Utc) { - LastModifiedOnDate = new DateTime( - LastModifiedOnDate.Year, LastModifiedOnDate.Month, LastModifiedOnDate.Day, - LastModifiedOnDate.Hour, LastModifiedOnDate.Minute, LastModifiedOnDate.Second, - LastModifiedOnDate.Millisecond, DateTimeKind.Utc); + this.LastModifiedOnDate = new DateTime( + this.LastModifiedOnDate.Year, this.LastModifiedOnDate.Month, this.LastModifiedOnDate.Day, + this.LastModifiedOnDate.Hour, this.LastModifiedOnDate.Minute, this.LastModifiedOnDate.Second, + this.LastModifiedOnDate.Millisecond, DateTimeKind.Utc); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJobLog.cs b/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJobLog.cs index 9712252bdca..5a2bbe4b33c 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJobLog.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Entities/ExportImportJobLog.cs @@ -24,18 +24,18 @@ public class ExportImportJobLog : IHydratable public int KeyID { - get { return JobLogId; } - set { JobLogId = value; } + get { return this.JobLogId; } + set { this.JobLogId = value; } } public void Fill(IDataReader dr) { - JobLogId = Null.SetNullInteger(dr[nameof(JobLogId)]); - JobId = Null.SetNullInteger(dr[nameof(JobId)]); - Name = Null.SetNullString(dr[nameof(Name)]); - Value = Null.SetNullString(dr[nameof(Value)]); - Level = Null.SetNullInteger(dr[nameof(Level)]); - CreatedOnDate = Null.SetNullDateTime(dr[nameof(CreatedOnDate)]); + this.JobLogId = Null.SetNullInteger(dr[nameof(this.JobLogId)]); + this.JobId = Null.SetNullInteger(dr[nameof(this.JobId)]); + this.Name = Null.SetNullString(dr[nameof(this.Name)]); + this.Value = Null.SetNullString(dr[nameof(this.Value)]); + this.Level = Null.SetNullInteger(dr[nameof(this.Level)]); + this.CreatedOnDate = Null.SetNullDateTime(dr[nameof(this.CreatedOnDate)]); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Models/ExportImportResult.cs b/DNN Platform/Modules/DnnExportImport/Components/Models/ExportImportResult.cs index 8c81f936ebc..09eb2779584 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Models/ExportImportResult.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Models/ExportImportResult.cs @@ -17,17 +17,17 @@ public class ExportImportResult public IList Summary { - get { return CompleteLog.Where(item => item.ReportLevel >= ReportLevel.Info).ToList(); } + get { return this.CompleteLog.Where(item => item.ReportLevel >= ReportLevel.Info).ToList(); } } public ExportImportResult() { - CompleteLog = CompleteLog = new List(); + this.CompleteLog = this.CompleteLog = new List(); } public LogItem AddSummary(string name, string value) { - return AddLogEntry(name, value, ReportLevel.Info); + return this.AddLogEntry(name, value, ReportLevel.Info); } public LogItem AddLogEntry(string name, string value, ReportLevel level = ReportLevel.Verbose) @@ -40,7 +40,7 @@ public LogItem AddLogEntry(string name, string value, ReportLevel level = Report CreatedOnDate = DateUtils.GetDatabaseUtcTime(), }; - CompleteLog.Add(item); + this.CompleteLog.Add(item); return item; } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Providers/DataProvider.cs b/DNN Platform/Modules/DnnExportImport/Components/Providers/DataProvider.cs index 2c2c3bb0576..58e8ad0dc70 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Providers/DataProvider.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Providers/DataProvider.cs @@ -40,31 +40,31 @@ private DataProvider() public void UpdateRecordChangers(string tableName, string primaryKeyName, int primaryKeyId, int? createdBy, int? modifiedBy) { - _dataProvider.ExecuteNonQuery( + this._dataProvider.ExecuteNonQuery( "Export_GenericUpdateRecordChangers", tableName, primaryKeyName, primaryKeyId, createdBy, modifiedBy); } public void UpdateUniqueId(string tableName, string primaryKeyName, int primaryKeyId, Guid uniqueId) { - _dataProvider.ExecuteNonQuery("Export_UpdateUniqueId", tableName, primaryKeyName, primaryKeyId, uniqueId); + this._dataProvider.ExecuteNonQuery("Export_UpdateUniqueId", tableName, primaryKeyName, primaryKeyId, uniqueId); } public void UpdateSettingRecordChangers(string tableName, string primaryKeyName, int parentKeyId, string settingName, int? createdBy, int? modifiedBy) { - _dataProvider.ExecuteNonQuery( + this._dataProvider.ExecuteNonQuery( "Export_GenedicUpdateSettingsRecordChangers", tableName, primaryKeyName, parentKeyId, settingName, createdBy, modifiedBy); } public int AddNewJob(int portalId, int userId, JobType jobType, string jobName, string jobDescription, string directory, string serializedObject) { - return _dataProvider.ExecuteScalar("ExportImportJobs_Add", portalId, + return this._dataProvider.ExecuteScalar("ExportImportJobs_Add", portalId, (int)jobType, userId, jobName, jobDescription, directory, serializedObject); } public void UpdateJobInfo(int jobId, string name, string description) { - _dataProvider.ExecuteNonQuery("ExportImportJobs_UpdateInfo", jobId, name, description); + this._dataProvider.ExecuteNonQuery("ExportImportJobs_UpdateInfo", jobId, name, description); } public void UpdateJobStatus(int jobId, JobStatus jobStatus) @@ -73,71 +73,71 @@ public void UpdateJobStatus(int jobId, JobStatus jobStatus) if (jobStatus == JobStatus.Failed || jobStatus == JobStatus.Successful) completeDate = DateUtils.GetDatabaseUtcTime(); - _dataProvider.ExecuteNonQuery( + this._dataProvider.ExecuteNonQuery( "ExportImportJobs_UpdateStatus", jobId, jobStatus, completeDate); } public void SetJobCancelled(int jobId) { - _dataProvider.ExecuteNonQuery("ExportImportJobs_SetCancelled", jobId); + this._dataProvider.ExecuteNonQuery("ExportImportJobs_SetCancelled", jobId); } public void RemoveJob(int jobId) { // using 60 sec timeout because cascading deletes in logs might take a lot of time - _dataProvider.ExecuteNonQuery(60, "ExportImportJobs_Remove", jobId); + this._dataProvider.ExecuteNonQuery(60, "ExportImportJobs_Remove", jobId); } public IDataReader GetExportImportSettings() { - return _dataProvider.ExecuteReader("ExportImport_Settings"); + return this._dataProvider.ExecuteReader("ExportImport_Settings"); } public void AddExportImportSetting(ExportImportSetting exportImportSetting) { - _dataProvider.ExecuteNonQuery("ExportImport_AddSetting", exportImportSetting.SettingName, + this._dataProvider.ExecuteNonQuery("ExportImport_AddSetting", exportImportSetting.SettingName, exportImportSetting.SettingValue, exportImportSetting.SettingIsSecure, exportImportSetting.CreatedByUserId); } public IDataReader GetFirstActiveJob() { - return _dataProvider.ExecuteReader("ExportImportJobs_FirstActive"); + return this._dataProvider.ExecuteReader("ExportImportJobs_FirstActive"); } public IDataReader GetJobById(int jobId) { - return _dataProvider.ExecuteReader("ExportImportJobs_GetById", jobId); + return this._dataProvider.ExecuteReader("ExportImportJobs_GetById", jobId); } public IDataReader GetJobSummaryLog(int jobId) { - return _dataProvider.ExecuteReader("ExportImportJobLogs_Summary", jobId); + return this._dataProvider.ExecuteReader("ExportImportJobLogs_Summary", jobId); } public IDataReader GetJobFullLog(int jobId) { - return _dataProvider.ExecuteReader("ExportImportJobLogs_Full", jobId); + return this._dataProvider.ExecuteReader("ExportImportJobLogs_Full", jobId); } public int GetAllJobsCount(int? portalId, int? jobType, string keywords) { - return _dataProvider.ExecuteScalar("ExportImport_GetJobsCount", portalId, jobType, keywords); + return this._dataProvider.ExecuteScalar("ExportImport_GetJobsCount", portalId, jobType, keywords); } public IDataReader GetAllJobs(int? portalId, int? pageSize, int? pageIndex, int? jobType, string keywords) { - return _dataProvider.ExecuteReader( + return this._dataProvider.ExecuteReader( "ExportImportJobs_GetAll", portalId, pageSize, pageIndex, jobType, keywords); } public IDataReader GetJobChekpoints(int jobId) { - return _dataProvider.ExecuteReader("ExportImportCheckpoints_GetByJob", jobId); + return this._dataProvider.ExecuteReader("ExportImportCheckpoints_GetByJob", jobId); } public DateTime? GetLastJobTime(int portalId, JobType jobType) { - var datim = _dataProvider.ExecuteScalar("ExportImportJobLogs_LastJobTime", portalId, jobType); + var datim = this._dataProvider.ExecuteScalar("ExportImportJobLogs_LastJobTime", portalId, jobType); if (datim.HasValue) { var d = datim.Value; @@ -148,116 +148,116 @@ public IDataReader GetJobChekpoints(int jobId) public void UpsertJobChekpoint(ExportImportChekpoint checkpoint) { - _dataProvider.ExecuteNonQuery("ExportImportCheckpoints_Upsert", + this._dataProvider.ExecuteNonQuery("ExportImportCheckpoints_Upsert", checkpoint.JobId, checkpoint.AssemblyName, checkpoint.Category, checkpoint.Stage, checkpoint.StageData, - Null.SetNullInteger(Math.Floor(checkpoint.Progress)), checkpoint.TotalItems, checkpoint.ProcessedItems, _dataProvider.GetNull(checkpoint.StartDate), checkpoint.Completed); + Null.SetNullInteger(Math.Floor(checkpoint.Progress)), checkpoint.TotalItems, checkpoint.ProcessedItems, this._dataProvider.GetNull(checkpoint.StartDate), checkpoint.Completed); } public IDataReader GetAllScopeTypes() { - return _dataProvider.ExecuteReader("ExportTaxonomy_ScopeTypes"); + return this._dataProvider.ExecuteReader("ExportTaxonomy_ScopeTypes"); } public IDataReader GetAllVocabularyTypes() { - return _dataProvider.ExecuteReader("ExportTaxonomy_VocabularyTypes"); + return this._dataProvider.ExecuteReader("ExportTaxonomy_VocabularyTypes"); } public IDataReader GetAllTerms(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("ExportTaxonomy_Terms", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("ExportTaxonomy_Terms", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetAllVocabularies(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("ExportTaxonomy_Vocabularies", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("ExportTaxonomy_Vocabularies", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetAllRoleGroups(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_RoleGroups", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_RoleGroups", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetAllRoles(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_Roles", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_Roles", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetAllRoleSettings(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_RoleSettings", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_RoleSettings", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public int GetRoleIdByName(int portalId, string roleName) { - return _dataProvider.ExecuteScalar("Export_RoleIdByName", _dataProvider.GetNull(portalId), roleName); + return this._dataProvider.ExecuteScalar("Export_RoleIdByName", this._dataProvider.GetNull(portalId), roleName); } public void SetRoleAutoAssign(int roleId) { - _dataProvider.ExecuteNonQuery("Export_RoleSetAutoAssign", roleId); + this._dataProvider.ExecuteNonQuery("Export_RoleSetAutoAssign", roleId); } public IDataReader GetPropertyDefinitionsByPortal(int portalId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { - return _dataProvider - .ExecuteReader("Export_GetPropertyDefinitionsByPortal", portalId, includeDeleted, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider + .ExecuteReader("Export_GetPropertyDefinitionsByPortal", portalId, includeDeleted, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetAllUsers(int portalId, int pageIndex, int pageSize, bool includeDeleted, DateTime toDateUtc, DateTime? fromDateUtc) { - return _dataProvider + return this._dataProvider .ExecuteReader("Export_GetAllUsers", portalId, pageIndex, pageSize, includeDeleted, toDateUtc, - _dataProvider.GetNull(fromDateUtc), false); + this._dataProvider.GetNull(fromDateUtc), false); } public int GetUsersCount(int portalId, bool includeDeleted, DateTime toDateUtc, DateTime? fromDateUtc) { - return _dataProvider - .ExecuteScalar("Export_GetAllUsers", portalId, 0, 0, includeDeleted, toDateUtc, _dataProvider.GetNull(fromDateUtc), true); + return this._dataProvider + .ExecuteScalar("Export_GetAllUsers", portalId, 0, 0, includeDeleted, toDateUtc, this._dataProvider.GetNull(fromDateUtc), true); } public void UpdateUserChangers(int userId, string createdByUserName, string modifiedByUserName) { - _dataProvider.ExecuteNonQuery( + this._dataProvider.ExecuteNonQuery( "Export_UpdateUsersChangers", userId, createdByUserName, modifiedByUserName); } public IDataReader GetPortalSettings(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_GetPortalSettings", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_GetPortalSettings", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetPortalLanguages(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_GetPortalLanguages", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_GetPortalLanguages", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetPortalLocalizations(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_GetPortalLocalizations", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_GetPortalLocalizations", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetFolders(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_GetFolders", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_GetFolders", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetFolderPermissionsByPath(int portalId, string folderPath, DateTime toDate, DateTime? fromDate) { - return _dataProvider - .ExecuteReader("Export_GetFolderPermissionsByPath", portalId, folderPath, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider + .ExecuteReader("Export_GetFolderPermissionsByPath", portalId, folderPath, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetFolderMappings(int portalId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_GetFolderMappings", portalId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_GetFolderMappings", portalId, toDate, this._dataProvider.GetNull(fromDate)); } public IDataReader GetFiles(int portalId, int? folderId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_GetFiles", portalId, folderId, toDate, _dataProvider.GetNull(fromDate)); + return this._dataProvider.ExecuteReader("Export_GetFiles", portalId, folderId, toDate, this._dataProvider.GetNull(fromDate)); } public int? GetPermissionId(string permissionCode, string permissionKey, string permissionName) @@ -268,7 +268,7 @@ public IDataReader GetFiles(int portalId, int? folderId, DateTime toDate, DateTi DataCache.PermissionsCachePriority), c => CBO.FillCollection( - _dataProvider.ExecuteReader("GetPermissions"))) + this._dataProvider.ExecuteReader("GetPermissions"))) .FirstOrDefault(x => x.PermissionCode == permissionCode && x.PermissionKey == permissionKey && x.PermissionName.Equals(permissionName, StringComparison.InvariantCultureIgnoreCase))?.PermissionID; @@ -276,102 +276,102 @@ public IDataReader GetFiles(int portalId, int? folderId, DateTime toDate, DateTi public IDataReader GetAllPortalTabs(int portalId, bool includeDeleted, bool includeSystem, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_Tabs", portalId, includeDeleted, includeSystem, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_Tabs", portalId, includeDeleted, includeSystem, toDate, fromDate); } public IDataReader GetAllTabSettings(int tabId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_TabSettings", tabId, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_TabSettings", tabId, toDate, fromDate); } public IDataReader GetAllTabPermissions(int tabId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_TabPermissions", tabId, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_TabPermissions", tabId, toDate, fromDate); } public IDataReader GetAllTabUrls(int tabId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_TabUrls", tabId, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_TabUrls", tabId, toDate, fromDate); } public IDataReader GetAllModules(int tabId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_Modules", tabId, includeDeleted, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_Modules", tabId, includeDeleted, toDate, fromDate); } public IDataReader GetAllModuleSettings(int moduleId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_ModuleSettings", moduleId, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_ModuleSettings", moduleId, toDate, fromDate); } public IDataReader GetAllModulePermissions(int moduleId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_ModulePermissions", moduleId, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_ModulePermissions", moduleId, toDate, fromDate); } public IDataReader GetAllTabModules(int tabId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_TabModules", tabId, includeDeleted, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_TabModules", tabId, includeDeleted, toDate, fromDate); } public bool CheckTabModuleUniqueIdExists(Guid uniqueId) { - return _dataProvider.ExecuteScalar("ExportImport_CheckTabModuleUniqueIdExists", uniqueId) > 0; + return this._dataProvider.ExecuteScalar("ExportImport_CheckTabModuleUniqueIdExists", uniqueId) > 0; } public bool CheckTabUniqueIdExists(Guid uniqueId) { - return _dataProvider.ExecuteScalar("ExportImport_CheckTabUniqueIdExists", uniqueId) > 0; + return this._dataProvider.ExecuteScalar("ExportImport_CheckTabUniqueIdExists", uniqueId) > 0; } public IDataReader GetAllTabModuleSettings(int tabId, bool includeDeleted, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_TabModuleSettings", tabId, includeDeleted, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_TabModuleSettings", tabId, includeDeleted, toDate, fromDate); } public void SetTabSpecificData(int tabId, bool isDeleted, bool isVisible) { - _dataProvider.ExecuteNonQuery("Export_SetTabSpecificData", tabId, isDeleted, isVisible); + this._dataProvider.ExecuteNonQuery("Export_SetTabSpecificData", tabId, isDeleted, isVisible); } public void SetTabModuleDeleted(int tabModuleId, bool isDeleted) { - _dataProvider.ExecuteNonQuery("Export_SetTabModuleDeleted", tabModuleId, isDeleted); + this._dataProvider.ExecuteNonQuery("Export_SetTabModuleDeleted", tabModuleId, isDeleted); } public void SetUserDeleted(int portalId, int userId, bool isDeleted) { - _dataProvider.ExecuteNonQuery("Export_SetUserDeleted", portalId, userId, isDeleted); + this._dataProvider.ExecuteNonQuery("Export_SetUserDeleted", portalId, userId, isDeleted); } public IDataReader GetPermissionInfo(string permissionCode, string permissionKey, string permissionName) { - return _dataProvider.ExecuteReader("Export_GetPermissionInfo", permissionCode, permissionKey, permissionName); + return this._dataProvider.ExecuteReader("Export_GetPermissionInfo", permissionCode, permissionKey, permissionName); } public void UpdateTabUrlChangers(int tabId, int seqNum, int? createdBy, int? modifiedBy) { - _dataProvider.ExecuteNonQuery("Export_UpdateTabUrlChangers", tabId, seqNum, createdBy, modifiedBy); + this._dataProvider.ExecuteNonQuery("Export_UpdateTabUrlChangers", tabId, seqNum, createdBy, modifiedBy); } public IDataReader GetAllWorkflows(int portalId, bool includeDeleted) { - return _dataProvider.ExecuteReader("Export_ContentWorkflows", portalId, includeDeleted); + return this._dataProvider.ExecuteReader("Export_ContentWorkflows", portalId, includeDeleted); } public IDataReader GetAllWorkflowSources(int workflowId) { - return _dataProvider.ExecuteReader("Export_ContentWorkflowSources", workflowId); + return this._dataProvider.ExecuteReader("Export_ContentWorkflowSources", workflowId); } public IDataReader GetAllWorkflowStates(int workflowId) { - return _dataProvider.ExecuteReader("Export_ContentWorkflowStates", workflowId); + return this._dataProvider.ExecuteReader("Export_ContentWorkflowStates", workflowId); } public IDataReader GetAllWorkflowStatePermissions(int workflowStateId, DateTime toDate, DateTime? fromDate) { - return _dataProvider.ExecuteReader("Export_ContentWorkflowStatePermissions", workflowStateId, toDate, fromDate); + return this._dataProvider.ExecuteReader("Export_ContentWorkflowStatePermissions", workflowStateId, toDate, fromDate); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Scheduler/ExportImportScheduler.cs b/DNN Platform/Modules/DnnExportImport/Components/Scheduler/ExportImportScheduler.cs index 120860105d1..b656905c848 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Scheduler/ExportImportScheduler.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Scheduler/ExportImportScheduler.cs @@ -39,7 +39,7 @@ public class ExportImportScheduler : SchedulerClient public ExportImportScheduler(ScheduleHistoryItem objScheduleHistoryItem) { - ScheduleHistoryItem = objScheduleHistoryItem; + this.ScheduleHistoryItem = objScheduleHistoryItem; } public override void DoWork() @@ -51,15 +51,15 @@ public override void DoWork() var job = EntitiesController.Instance.GetFirstActiveJob(); if (job == null) { - ScheduleHistoryItem.Succeeded = true; - ScheduleHistoryItem.AddLogNote("
    No Site Export/Import jobs queued for processing."); + this.ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.AddLogNote("
    No Site Export/Import jobs queued for processing."); } else if (job.IsCancelled) { job.JobStatus = JobStatus.Cancelled; EntitiesController.Instance.UpdateJobStatus(job); - ScheduleHistoryItem.Succeeded = true; - ScheduleHistoryItem.AddLogNote("
    Site Export/Import jobs was previously cancelled."); + this.ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.AddLogNote("
    Site Export/Import jobs was previously cancelled."); } else { @@ -77,7 +77,7 @@ public override void DoWork() case JobType.Export: try { - engine.Export(job, result, ScheduleHistoryItem); + engine.Export(job, result, this.ScheduleHistoryItem); } catch (Exception ex) { @@ -90,17 +90,17 @@ public override void DoWork() case JobType.Import: try { - engine.Import(job, result, ScheduleHistoryItem); + engine.Import(job, result, this.ScheduleHistoryItem); } catch (ThreadAbortException) { - ScheduleHistoryItem.TimeLapse = EmergencyScheduleFrequency; - ScheduleHistoryItem.TimeLapseMeasurement = EmergencyScheduleFrequencyUnit; - ScheduleHistoryItem.RetryTimeLapse = EmergencyScheduleRetry; - ScheduleHistoryItem.RetryTimeLapseMeasurement = EmergencyScheduleRetryUnit; - ScheduleHistoryItem.RetainHistoryNum = EmergencyHistoryNumber; + this.ScheduleHistoryItem.TimeLapse = EmergencyScheduleFrequency; + this.ScheduleHistoryItem.TimeLapseMeasurement = EmergencyScheduleFrequencyUnit; + this.ScheduleHistoryItem.RetryTimeLapse = EmergencyScheduleRetry; + this.ScheduleHistoryItem.RetryTimeLapseMeasurement = EmergencyScheduleRetryUnit; + this.ScheduleHistoryItem.RetainHistoryNum = EmergencyHistoryNumber; - SchedulingController.UpdateSchedule(ScheduleHistoryItem); + SchedulingController.UpdateSchedule(this.ScheduleHistoryItem); SchedulingController.PurgeScheduleHistory(); @@ -124,20 +124,20 @@ public override void DoWork() throw new Exception("Unknown job type: " + job.JobType); } - ScheduleHistoryItem.Succeeded = true; + this.ScheduleHistoryItem.Succeeded = true; //restore schedule item running timelapse to default. if (succeeded - && ScheduleHistoryItem.TimeLapse == EmergencyScheduleFrequency - && ScheduleHistoryItem.TimeLapseMeasurement == EmergencyScheduleFrequencyUnit) + && this.ScheduleHistoryItem.TimeLapse == EmergencyScheduleFrequency + && this.ScheduleHistoryItem.TimeLapseMeasurement == EmergencyScheduleFrequencyUnit) { - ScheduleHistoryItem.TimeLapse = DefaultScheduleFrequency; - ScheduleHistoryItem.TimeLapseMeasurement = DefaultScheduleFrequencyUnit; - ScheduleHistoryItem.RetryTimeLapse = DefaultScheduleRetry; - ScheduleHistoryItem.RetryTimeLapseMeasurement = DefaultScheduleRetryUnit; - ScheduleHistoryItem.RetainHistoryNum = DefaultHistoryNumber; + this.ScheduleHistoryItem.TimeLapse = DefaultScheduleFrequency; + this.ScheduleHistoryItem.TimeLapseMeasurement = DefaultScheduleFrequencyUnit; + this.ScheduleHistoryItem.RetryTimeLapse = DefaultScheduleRetry; + this.ScheduleHistoryItem.RetryTimeLapseMeasurement = DefaultScheduleRetryUnit; + this.ScheduleHistoryItem.RetainHistoryNum = DefaultHistoryNumber; - SchedulingController.UpdateSchedule(ScheduleHistoryItem); + SchedulingController.UpdateSchedule(this.ScheduleHistoryItem); } var sb = new StringBuilder(); @@ -155,7 +155,7 @@ public override void DoWork() sb.Append(""); } - ScheduleHistoryItem.AddLogNote(sb.ToString()); + this.ScheduleHistoryItem.AddLogNote(sb.ToString()); engine.AddLogsToDatabase(job.JobId, result.CompleteLog); Logger.Trace("Site Export/Import: Job Finished"); @@ -164,9 +164,9 @@ public override void DoWork() } catch (Exception ex) { - ScheduleHistoryItem.Succeeded = false; - ScheduleHistoryItem.AddLogNote("
    Export/Import EXCEPTION: " + ex.Message); - Errored(ref ex); + this.ScheduleHistoryItem.Succeeded = false; + this.ScheduleHistoryItem.AddLogNote("
    Export/Import EXCEPTION: " + ex.Message); + this.Errored(ref ex); // this duplicates the logging //if (ScheduleHistoryItem.ScheduleSource != ScheduleSource.STARTED_FROM_BEGIN_REQUEST) //{ diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/AssetsExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/AssetsExportService.cs index c27de5aa5c8..a4447c28d9d 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/AssetsExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/AssetsExportService.cs @@ -43,13 +43,13 @@ public class AssetsExportService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; //Skip the export if all the folders have been processed already. - if (CheckPoint.Stage >= 1) + if (this.CheckPoint.Stage >= 1) return; //Create Zip File to hold files - var skip = GetCurrentSkip(); + var skip = this.GetCurrentSkip(); var currentIndex = skip; var totalFolderExported = 0; var totalFolderPermissionsExported = 0; @@ -57,9 +57,9 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) var portalId = exportJob.PortalId; try { - var assetsFile = string.Format(_assetsFolder, exportJob.Directory.TrimEnd('\\').TrimEnd('/')); + var assetsFile = string.Format(this._assetsFolder, exportJob.Directory.TrimEnd('\\').TrimEnd('/')); - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); @@ -73,15 +73,15 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalFolders : CheckPoint.TotalItems; - CheckPoint.ProcessedItems = skip; - CheckPoint.Progress = CheckPoint.TotalItems > 0 ? skip * 100.0 / CheckPoint.TotalItems : 0; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalFolders : this.CheckPoint.TotalItems; + this.CheckPoint.ProcessedItems = skip; + this.CheckPoint.Progress = this.CheckPoint.TotalItems > 0 ? skip * 100.0 / this.CheckPoint.TotalItems : 0; + if (this.CheckPointStageCallback(this)) return; using (var zipArchive = CompressionUtil.OpenCreate(assetsFile)) { foreach (var folder in folders) { - if (CheckCancelled(exportJob)) break; + if (this.CheckCancelled(exportJob)) break; var isUserFolder = false; var files = @@ -100,11 +100,11 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { //If parent id exists then change the parent folder id to parent id. folder.ParentId = - Repository.GetItem( + this.Repository.GetItem( x => x.FolderId == Convert.ToInt32(folder.ParentId))?.Id; } - Repository.CreateItem(folder, null); + this.Repository.CreateItem(folder, null); totalFolderExported++; //Include permissions only if IncludePermissions=true if (exportDto.IncludePermissions) @@ -112,10 +112,10 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) var permissions = CBO.FillCollection(DataProvider.Instance() .GetFolderPermissionsByPath(portalId, folder.FolderPath, toDate, fromDate)); - Repository.CreateItems(permissions, folder.Id); + this.Repository.CreateItems(permissions, folder.Id); totalFolderPermissionsExported += permissions.Count; } - Repository.CreateItems(files, folder.Id); + this.Repository.CreateItems(files, folder.Id); totalFilesExported += files.Count; var folderOffset = portal.HomeDirectoryMapPath.Length + (portal.HomeDirectoryMapPath.EndsWith("\\") ? 0 : 1); @@ -123,95 +123,95 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) if (folder.StorageLocation != (int)FolderController.StorageLocationTypes.DatabaseSecure) { - CompressionUtil.AddFilesToArchive(zipArchive, files.Select(file => portal.HomeDirectoryMapPath + folder.FolderPath + GetActualFileName(file)), + CompressionUtil.AddFilesToArchive(zipArchive, files.Select(file => portal.HomeDirectoryMapPath + folder.FolderPath + this.GetActualFileName(file)), folderOffset, isUserFolder ? "TempUsers" : null); } - CheckPoint.ProcessedItems++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalFolders; - CheckPoint.StageData = null; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalFolders; + this.CheckPoint.StageData = null; currentIndex++; //After every 10 items, call the checkpoint stage. This is to avoid too many frequent updates to DB. - if (currentIndex % 10 == 0 && CheckPointStageCallback(this)) return; - Repository.RebuildIndex(x => x.Id, true); - Repository.RebuildIndex(x => x.UserId); - Repository.RebuildIndex(x => x.ReferenceId); + if (currentIndex % 10 == 0 && this.CheckPointStageCallback(this)) return; + this.Repository.RebuildIndex(x => x.Id, true); + this.Repository.RebuildIndex(x => x.UserId); + this.Repository.RebuildIndex(x => x.ReferenceId); } } - CheckPoint.Completed = true; - CheckPoint.Stage++; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; currentIndex = 0; - CheckPoint.Progress = 100; + this.CheckPoint.Progress = 100; } } finally { - CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; - CheckPointStageCallback(this); - Result.AddSummary("Exported Folders", totalFolderExported.ToString()); - Result.AddSummary("Exported Folder Permissions", totalFolderPermissionsExported.ToString()); - Result.AddSummary("Exported Files", totalFilesExported.ToString()); + this.CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; + this.CheckPointStageCallback(this); + this.Result.AddSummary("Exported Folders", totalFolderExported.ToString()); + this.Result.AddSummary("Exported Folder Permissions", totalFolderPermissionsExported.ToString()); + this.Result.AddSummary("Exported Files", totalFilesExported.ToString()); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; //Stage 1: Portals files unzipped. //Stage 2: All folders and files imported. //Stage 3: Synchronization completed. //Skip the export if all the folders have been processed already. - if (CheckPoint.Stage >= 2 || CheckPoint.Completed) + if (this.CheckPoint.Stage >= 2 || this.CheckPoint.Completed) return; var totalFolderImported = 0; var totalFolderPermissionsImported = 0; var totalFilesImported = 0; - var skip = GetCurrentSkip(); + var skip = this.GetCurrentSkip(); var currentIndex = skip; var portalId = importJob.PortalId; var portal = PortalController.Instance.GetPortal(portalId); - var assetsFile = string.Format(_assetsFolder, importJob.Directory.TrimEnd('\\').TrimEnd('/')); + var assetsFile = string.Format(this._assetsFolder, importJob.Directory.TrimEnd('\\').TrimEnd('/')); var userFolderPath = string.Format(UsersAssetsTempFolder, portal.HomeDirectoryMapPath.TrimEnd('\\')); - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { if (!File.Exists(assetsFile)) { - Result.AddLogEntry("AssetsFileNotFound", "Assets file not found. Skipping assets import", + this.Result.AddLogEntry("AssetsFileNotFound", "Assets file not found. Skipping assets import", ReportLevel.Warn); - CheckPoint.Completed = true; - CheckPointStageCallback(this); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); } else { CompressionUtil.UnZipArchive(assetsFile, portal.HomeDirectoryMapPath, importDto.CollisionResolution == CollisionResolution.Overwrite); //Stage 1: Once unzipping of portal files is completed. - CheckPoint.Stage++; - CheckPoint.StageData = null; - CheckPoint.Progress = 10; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + this.CheckPoint.Progress = 10; + if (this.CheckPointStageCallback(this)) return; } } - if (CheckPoint.Stage == 1) + if (this.CheckPoint.Stage == 1) { try { //Stage 2 starts - var sourceFolders = Repository.GetAllItems(x => x.CreatedOnDate, true, skip).ToList(); + var sourceFolders = this.Repository.GetAllItems(x => x.CreatedOnDate, true, skip).ToList(); var totalFolders = sourceFolders.Any() ? sourceFolders.Count : 0; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalFolders : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalFolders : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; foreach (var sourceFolder in sourceFolders) { - if (CheckCancelled(importJob)) break; + if (this.CheckCancelled(importJob)) break; // PROCESS FOLDERS //Create new or update existing folder - if (ProcessFolder(importJob, importDto, sourceFolder)) + if (this.ProcessFolder(importJob, importDto, sourceFolder)) { totalFolderImported++; @@ -220,7 +220,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) { // PROCESS FOLDER PERMISSIONS var sourceFolderPermissions = - Repository.GetRelatedItems(sourceFolder.Id).ToList(); + this.Repository.GetRelatedItems(sourceFolder.Id).ToList(); //Replace folderId for each permission with new one. sourceFolderPermissions.ForEach(x => { @@ -237,7 +237,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) foreach (var folderPermission in sourceFolderPermissions) { - ProcessFolderPermission(importJob, importDto, folderPermission, + this.ProcessFolderPermission(importJob, importDto, folderPermission, localPermissions); } totalFolderPermissionsImported += sourceFolderPermissions.Count; @@ -245,7 +245,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) // PROCESS FILES var sourceFiles = - Repository.GetRelatedItems(sourceFolder.Id).ToList(); + this.Repository.GetRelatedItems(sourceFolder.Id).ToList(); //Replace folderId for each file with new one. sourceFiles.ForEach(x => { @@ -261,32 +261,32 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) foreach (var file in sourceFiles) { - ProcessFiles(importJob, importDto, file, localFiles); + this.ProcessFiles(importJob, importDto, file, localFiles); } totalFilesImported += sourceFiles.Count; } currentIndex++; - CheckPoint.ProcessedItems++; - CheckPoint.Progress = 10 + CheckPoint.ProcessedItems * 90.0 / totalFolders; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = 10 + this.CheckPoint.ProcessedItems * 90.0 / totalFolders; //After every 10 items, call the checkpoint stage. This is to avoid too many frequent updates to DB. - if (currentIndex % 10 == 0 && CheckPointStageCallback(this)) return; + if (currentIndex % 10 == 0 && this.CheckPointStageCallback(this)) return; } currentIndex = 0; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.Progress = 100; } finally { - CheckPoint.StageData = currentIndex > 0 + this.CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; - CheckPointStageCallback(this); + this.CheckPointStageCallback(this); - Result.AddSummary("Imported Folders", totalFolderImported.ToString()); - Result.AddSummary("Imported Folder Permissions", totalFolderPermissionsImported.ToString()); - Result.AddSummary("Imported Files", totalFilesImported.ToString()); + this.Result.AddSummary("Imported Folders", totalFolderImported.ToString()); + this.Result.AddSummary("Imported Folder Permissions", totalFolderPermissionsImported.ToString()); + this.Result.AddSummary("Imported Files", totalFilesImported.ToString()); if (Directory.Exists(userFolderPath) && currentIndex == 0) Directory.Delete(userFolderPath, true); @@ -296,7 +296,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) public override int GetImportTotal() { - return Repository.GetCount(); + return this.Repository.GetCount(); } private bool ProcessFolder(ExportImportJob importJob, ImportDto importDto, ExportFolder folder) @@ -323,7 +323,7 @@ private bool ProcessFolder(ExportImportJob importJob, ImportDto importDto, Expor folder.FolderPath = string.IsNullOrEmpty(folder.FolderPath) ? "" : folder.FolderPath; var folderMapping = FolderMappingController.Instance.GetFolderMapping(portalId, folder.FolderMappingName); if (folderMapping == null) return false; - var workFlowId = GetLocalWorkFlowId(folder.WorkflowId); + var workFlowId = this.GetLocalWorkFlowId(folder.WorkflowId); if (isUpdate) { Util.FixDateTime(existingFolder); @@ -337,7 +337,7 @@ private bool ProcessFolder(ExportImportJob importJob, ImportDto importDto, Expor if (folder.UserId != null && folder.UserId > 0 && !string.IsNullOrEmpty(folder.Username)) { - SyncUserFolder(importJob.PortalId, folder); + this.SyncUserFolder(importJob.PortalId, folder); } } else @@ -372,7 +372,7 @@ private bool ProcessFolder(ExportImportJob importJob, ImportDto importDto, Expor var newFolder = FolderManager.Instance.GetUserFolder(userInfo); folder.FolderId = newFolder.FolderID; folder.FolderPath = newFolder.FolderPath; - SyncUserFolder(importJob.PortalId, folder); + this.SyncUserFolder(importJob.PortalId, folder); return true; } else @@ -556,9 +556,9 @@ private string GetActualFileName(ExportFile objFile) private int GetCurrentSkip() { - if (!string.IsNullOrEmpty(CheckPoint.StageData)) + if (!string.IsNullOrEmpty(this.CheckPoint.StageData)) { - dynamic stageData = JsonConvert.DeserializeObject(CheckPoint.StageData); + dynamic stageData = JsonConvert.DeserializeObject(this.CheckPoint.StageData); return Convert.ToInt32(stageData.skip) ?? 0; } return 0; @@ -568,7 +568,7 @@ private int GetLocalWorkFlowId(int? exportedWorkFlowId) { if (exportedWorkFlowId != null && exportedWorkFlowId > 1) // 1 is direct publish { - var state = Repository.GetItem(item => item.WorkflowID == exportedWorkFlowId); + var state = this.Repository.GetItem(item => item.WorkflowID == exportedWorkFlowId); return state?.LocalId ?? -1; } return -1; diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/PackagesExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/PackagesExportService.cs index 9c833c76a1e..c14b00d0432 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/PackagesExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/PackagesExportService.cs @@ -35,13 +35,13 @@ public class PackagesExportService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; //Skip the export if all the folders have been processed already. - if (CheckPoint.Stage >= 1) + if (this.CheckPoint.Stage >= 1) return; //Create Zip File to hold files - var skip = GetCurrentSkip(); + var skip = this.GetCurrentSkip(); var currentIndex = skip; var totalPackagesExported = 0; try @@ -49,75 +49,75 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) var packagesZipFileFormat = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{{0}}\\{Constants.ExportZipPackages}"; var packagesZipFile = string.Format(packagesZipFileFormat, exportJob.Directory.TrimEnd('\\').TrimEnd('/')); - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { var fromDate = exportDto.FromDateUtc ?? Constants.MinDbTime; var toDate = exportDto.ToDateUtc; //export skin packages. var extensionPackagesBackupFolder = Path.Combine(Globals.ApplicationMapPath, DotNetNuke.Services.Installer.Util.BackupInstallPackageFolder); - var skinPackageFiles = Directory.GetFiles(extensionPackagesBackupFolder).Where(f => IsValidPackage(f, fromDate, toDate)).ToList(); + var skinPackageFiles = Directory.GetFiles(extensionPackagesBackupFolder).Where(f => this.IsValidPackage(f, fromDate, toDate)).ToList(); var totalPackages = skinPackageFiles.Count; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalPackages : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalPackages : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; foreach (var file in skinPackageFiles) { - var exportPackage = GenerateExportPackage(file); + var exportPackage = this.GenerateExportPackage(file); if (exportPackage != null) { - Repository.CreateItem(exportPackage, null); + this.Repository.CreateItem(exportPackage, null); totalPackagesExported += 1; var folderOffset = Path.GetDirectoryName(file)?.Length + 1; CompressionUtil.AddFileToArchive(file, packagesZipFile, folderOffset.GetValueOrDefault(0)); } - CheckPoint.ProcessedItems++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalPackages; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalPackages; currentIndex++; //After every 10 items, call the checkpoint stage. This is to avoid too many frequent updates to DB. - if (currentIndex % 10 == 0 && CheckPointStageCallback(this)) return; + if (currentIndex % 10 == 0 && this.CheckPointStageCallback(this)) return; } - CheckPoint.Stage++; + this.CheckPoint.Stage++; currentIndex = 0; - CheckPoint.Completed = true; - CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; } } finally { - CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; - CheckPointStageCallback(this); - Result.AddSummary("Exported Packages", totalPackagesExported.ToString()); + this.CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; + this.CheckPointStageCallback(this); + this.Result.AddSummary("Exported Packages", totalPackagesExported.ToString()); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; //Skip the export if all the templates have been processed already. - if (CheckPoint.Stage >= 1 || CheckPoint.Completed) + if (this.CheckPoint.Stage >= 1 || this.CheckPoint.Completed) return; - _exportImportJob = importJob; + this._exportImportJob = importJob; - ProcessImportModulePackages(importDto); + this.ProcessImportModulePackages(importDto); } public override int GetImportTotal() { - return Repository.GetCount(); + return this.Repository.GetCount(); } private int GetCurrentSkip() { - if (!string.IsNullOrEmpty(CheckPoint.StageData)) + if (!string.IsNullOrEmpty(this.CheckPoint.StageData)) { - dynamic stageData = JsonConvert.DeserializeObject(CheckPoint.StageData); + dynamic stageData = JsonConvert.DeserializeObject(this.CheckPoint.StageData); return Convert.ToInt32(stageData.skip) ?? 0; } return 0; @@ -176,18 +176,18 @@ private void ProcessImportModulePackage(ExportPackage exportPackage, String temp (existPackage.Version == version && collisionResolution == CollisionResolution.Ignore))) { - Result.AddLogEntry("Import Package ignores", + this.Result.AddLogEntry("Import Package ignores", $"{packageName} has higher version {existPackage.Version} installed, ignore import it"); return; } - InstallPackage(filePath); - Result.AddLogEntry("Import Package completed", $"{packageName} version: {version}"); + this.InstallPackage(filePath); + this.Result.AddLogEntry("Import Package completed", $"{packageName} version: {version}"); } catch (Exception ex) { - Result.AddLogEntry("Import Package error", + this.Result.AddLogEntry("Import Package error", $"{exportPackage.PackageName} : {exportPackage.Version} - {ex.Message}"); Logger.Error(ex); } @@ -195,36 +195,36 @@ private void ProcessImportModulePackage(ExportPackage exportPackage, String temp private void ProcessImportModulePackages(ImportDto importDto) { - var packageZipFile = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{_exportImportJob.Directory.TrimEnd('\\', '/')}\\{Constants.ExportZipPackages}"; + var packageZipFile = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{this._exportImportJob.Directory.TrimEnd('\\', '/')}\\{Constants.ExportZipPackages}"; var tempFolder = $"{Path.GetDirectoryName(packageZipFile)}\\{DateTime.Now.Ticks}"; if (File.Exists(packageZipFile)) { CompressionUtil.UnZipArchive(packageZipFile, tempFolder); - var exportPackages = Repository.GetAllItems().ToList(); + var exportPackages = this.Repository.GetAllItems().ToList(); - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? exportPackages.Count : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? exportPackages.Count : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { try { foreach (var exportPackage in exportPackages) { - ProcessImportModulePackage(exportPackage, tempFolder, importDto.CollisionResolution); + this.ProcessImportModulePackage(exportPackage, tempFolder, importDto.CollisionResolution); - CheckPoint.ProcessedItems++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / exportPackages.Count; - if (CheckPointStageCallback(this)) break; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / exportPackages.Count; + if (this.CheckPointStageCallback(this)) break; } - CheckPoint.Stage++; - CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.Completed = true; } finally { - CheckPointStageCallback(this); + this.CheckPointStageCallback(this); try { FileSystemUtils.DeleteFolderRecursive(tempFolder); @@ -238,9 +238,9 @@ private void ProcessImportModulePackages(ImportDto importDto) } else { - CheckPoint.Completed = true; - CheckPointStageCallback(this); - Result.AddLogEntry("PackagesFileNotFound", "Packages file not found. Skipping packages import", ReportLevel.Warn); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); + this.Result.AddLogEntry("PackagesFileNotFound", "Packages file not found. Skipping packages import", ReportLevel.Warn); } } @@ -269,7 +269,7 @@ public void InstallPackage(string filePath) } catch (Exception ex) { - Result.AddLogEntry("Import Package error", $"{filePath}. ERROR: {ex.Message}"); + this.Result.AddLogEntry("Import Package error", $"{filePath}. ERROR: {ex.Message}"); Logger.Error(ex); } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/PageTemplatesExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/PageTemplatesExportService.cs index 69aebd103bc..48c40eeff24 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/PageTemplatesExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/PageTemplatesExportService.cs @@ -32,21 +32,21 @@ public class PageTemplatesExportService : AssetsExportService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; //Skip the export if all the folders have been processed already. - if (CheckPoint.Stage >= 1) + if (this.CheckPoint.Stage >= 1) return; //Create Zip File to hold files - var skip = GetCurrentSkip(); + var skip = this.GetCurrentSkip(); var currentIndex = skip; var totalTemplatesExported = 0; var portalId = exportJob.PortalId; try { - var templatesFile = string.Format(_templatesFolder, exportJob.Directory.TrimEnd('\\').TrimEnd('/')); + var templatesFile = string.Format(this._templatesFolder, exportJob.Directory.TrimEnd('\\').TrimEnd('/')); - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); @@ -61,63 +61,63 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) var totalTemplates = templates.Count; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalTemplates : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalTemplates : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; foreach (var template in templates) { - Repository.CreateItem(template, null); + this.Repository.CreateItem(template, null); totalTemplatesExported += 1; var folderOffset = portal.HomeDirectoryMapPath.Length + (portal.HomeDirectoryMapPath.EndsWith("\\") ? 0 : 1); var folder = FolderManager.Instance.GetFolder(template.FolderId); CompressionUtil.AddFileToArchive( - portal.HomeDirectoryMapPath + folder.FolderPath + GetActualFileName(template), templatesFile, + portal.HomeDirectoryMapPath + folder.FolderPath + this.GetActualFileName(template), templatesFile, folderOffset); - CheckPoint.ProcessedItems++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalTemplates; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalTemplates; currentIndex++; //After every 10 items, call the checkpoint stage. This is to avoid too many frequent updates to DB. - if (currentIndex % 10 == 0 && CheckPointStageCallback(this)) return; + if (currentIndex % 10 == 0 && this.CheckPointStageCallback(this)) return; } - CheckPoint.Stage++; + this.CheckPoint.Stage++; currentIndex = 0; - CheckPoint.Completed = true; - CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; } } finally { - CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; - CheckPointStageCallback(this); - Result.AddSummary("Exported Templates", totalTemplatesExported.ToString()); + this.CheckPoint.StageData = currentIndex > 0 ? JsonConvert.SerializeObject(new { skip = currentIndex }) : null; + this.CheckPointStageCallback(this); + this.Result.AddSummary("Exported Templates", totalTemplatesExported.ToString()); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; //Skip the export if all the templates have been processed already. - if (CheckPoint.Stage >= 2 || CheckPoint.Completed) + if (this.CheckPoint.Stage >= 2 || this.CheckPoint.Completed) return; var portalId = importJob.PortalId; - var templatesFile = string.Format(_templatesFolder, importJob.Directory.TrimEnd('\\').TrimEnd('/')); - var totalTemplates = GetImportTotal(); + var templatesFile = string.Format(this._templatesFolder, importJob.Directory.TrimEnd('\\').TrimEnd('/')); + var totalTemplates = this.GetImportTotal(); - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalTemplates : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalTemplates : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { if (!File.Exists(templatesFile)) { - Result.AddLogEntry("TemplatesFileNotFound", "Templates file not found. Skipping templates import", + this.Result.AddLogEntry("TemplatesFileNotFound", "Templates file not found. Skipping templates import", ReportLevel.Warn); - CheckPoint.Completed = true; - CheckPointStageCallback(this); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); } else { @@ -126,30 +126,30 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) CompressionUtil.UnZipArchive(templatesFile, portal.HomeDirectoryMapPath, importDto.CollisionResolution == CollisionResolution.Overwrite); - Result.AddSummary("Imported templates", totalTemplates.ToString()); - CheckPoint.Stage++; - CheckPoint.StageData = null; - CheckPoint.Progress = 90; - CheckPoint.TotalItems = totalTemplates; - CheckPoint.ProcessedItems = totalTemplates; - if (CheckPointStageCallback(this)) return; + this.Result.AddSummary("Imported templates", totalTemplates.ToString()); + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + this.CheckPoint.Progress = 90; + this.CheckPoint.TotalItems = totalTemplates; + this.CheckPoint.ProcessedItems = totalTemplates; + if (this.CheckPointStageCallback(this)) return; } } - if (CheckPoint.Stage == 1) + if (this.CheckPoint.Stage == 1) { Func predicate = x => x.Folder; - var templates = Repository.GetAllItems(predicate).Select(x => x.Folder).Distinct(); + var templates = this.Repository.GetAllItems(predicate).Select(x => x.Folder).Distinct(); templates.ForEach(x => FolderManager.Instance.Synchronize(importJob.PortalId, x)); - CheckPoint.Stage++; - CheckPoint.Completed = true; - CheckPoint.Progress = 100; - CheckPointStageCallback(this); + this.CheckPoint.Stage++; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; + this.CheckPointStageCallback(this); } } public override int GetImportTotal() { - return Repository.GetCount(); + return this.Repository.GetCount(); } private string GetActualFileName(ExportPageTemplate objFile) @@ -161,9 +161,9 @@ private string GetActualFileName(ExportPageTemplate objFile) private int GetCurrentSkip() { - if (!string.IsNullOrEmpty(CheckPoint.StageData)) + if (!string.IsNullOrEmpty(this.CheckPoint.StageData)) { - dynamic stageData = JsonConvert.DeserializeObject(CheckPoint.StageData); + dynamic stageData = JsonConvert.DeserializeObject(this.CheckPoint.StageData); return Convert.ToInt32(stageData.skip) ?? 0; } return 0; diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/PagesExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/PagesExportService.cs index 05f04d87fba..6dd0441c41f 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/PagesExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/PagesExportService.cs @@ -54,7 +54,7 @@ public class PagesExportService : BasePortableService public virtual bool IgnoreParentMatch { get; set; } = false; - protected ImportDto ImportDto => _importDto; + protected ImportDto ImportDto => this._importDto; private ProgressTotals _totals; private DataProvider _dataProvider; @@ -73,130 +73,130 @@ public class PagesExportService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckPoint.Stage > 0) return; - if (CheckCancelled(exportJob)) return; + if (this.CheckPoint.Stage > 0) return; + if (this.CheckCancelled(exportJob)) return; var checkedPages = exportDto.Pages.Where(p => p.CheckedState == TriCheckedState.Checked || p.CheckedState == TriCheckedState.CheckedWithAllChildren); if (checkedPages.Any()) { - _exportImportJob = exportJob; - _exportDto = exportDto; - _tabController = TabController.Instance; - _moduleController = ModuleController.Instance; - ProcessExportPages(); + this._exportImportJob = exportJob; + this._exportDto = exportDto; + this._tabController = TabController.Instance; + this._moduleController = ModuleController.Instance; + this.ProcessExportPages(); } - CheckPoint.Progress = 100; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPoint.StageData = null; - CheckPointStageCallback(this); + this.CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + this.CheckPointStageCallback(this); } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckPoint.Stage > 0) return; - if (CheckCancelled(importJob)) return; + if (this.CheckPoint.Stage > 0) return; + if (this.CheckCancelled(importJob)) return; - _exportImportJob = importJob; - _importDto = importDto; - _exportDto = importDto.ExportDto; - _tabController = TabController.Instance; - _moduleController = ModuleController.Instance; + this._exportImportJob = importJob; + this._importDto = importDto; + this._exportDto = importDto.ExportDto; + this._tabController = TabController.Instance; + this._moduleController = ModuleController.Instance; - ProcessImportPages(); + this.ProcessImportPages(); - CheckPoint.Progress = 100; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPoint.StageData = null; - CheckPointStageCallback(this); + this.CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + this.CheckPointStageCallback(this); } public override int GetImportTotal() { - return Repository.GetCount(x => x.IsSystem == IncludeSystem); + return this.Repository.GetCount(x => x.IsSystem == this.IncludeSystem); } #region import methods private void ProcessImportPages() { - _dataProvider = DataProvider.Instance(); - _totals = string.IsNullOrEmpty(CheckPoint.StageData) + this._dataProvider = DataProvider.Instance(); + this._totals = string.IsNullOrEmpty(this.CheckPoint.StageData) ? new ProgressTotals() - : JsonConvert.DeserializeObject(CheckPoint.StageData); + : JsonConvert.DeserializeObject(this.CheckPoint.StageData); - var portalId = _exportImportJob.PortalId; + var portalId = this._exportImportJob.PortalId; - var localTabs = _tabController.GetTabsByPortal(portalId).Values.ToList(); + var localTabs = this._tabController.GetTabsByPortal(portalId).Values.ToList(); - var exportedTabs = Repository.GetItems(x => x.IsSystem == (Category == Constants.Category_Templates)) + var exportedTabs = this.Repository.GetItems(x => x.IsSystem == (this.Category == Constants.Category_Templates)) .OrderBy(t => t.Level).ThenBy(t => t.ParentId).ThenBy(t => t.TabOrder).ToList(); //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? exportedTabs.Count : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; - var progressStep = 100.0 / exportedTabs.OrderByDescending(x => x.Id).Count(x => x.Id < _totals.LastProcessedId); + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? exportedTabs.Count : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; + var progressStep = 100.0 / exportedTabs.OrderByDescending(x => x.Id).Count(x => x.Id < this._totals.LastProcessedId); var index = 0; var referenceTabs = new List(); - _importContentList.Clear(); + this._importContentList.Clear(); foreach (var otherTab in exportedTabs) { - if (CheckCancelled(_exportImportJob)) break; - if (_totals.LastProcessedId > index) continue; // this is the exported DB row ID; not the TabID + if (this.CheckCancelled(this._exportImportJob)) break; + if (this._totals.LastProcessedId > index) continue; // this is the exported DB row ID; not the TabID - ProcessImportPage(otherTab, exportedTabs, localTabs, referenceTabs); + this.ProcessImportPage(otherTab, exportedTabs, localTabs, referenceTabs); - CheckPoint.ProcessedItems++; - CheckPoint.Progress += progressStep; - if (CheckPointStageCallback(this)) break; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress += progressStep; + if (this.CheckPointStageCallback(this)) break; - _totals.LastProcessedId = index++; - CheckPoint.StageData = JsonConvert.SerializeObject(_totals); + this._totals.LastProcessedId = index++; + this.CheckPoint.StageData = JsonConvert.SerializeObject(this._totals); } //repair pages which linked to other pages - RepairReferenceTabs(referenceTabs, localTabs, exportedTabs); + this.RepairReferenceTabs(referenceTabs, localTabs, exportedTabs); - _searchedParentTabs.Clear(); - ReportImportTotals(); + this._searchedParentTabs.Clear(); + this.ReportImportTotals(); } protected virtual void ProcessImportPage(ExportTab otherTab, IList exportedTabs, IList localTabs, IList referenceTabs) { - var portalId = _exportImportJob.PortalId; - var createdBy = Util.GetUserIdByName(_exportImportJob, otherTab.CreatedByUserID, otherTab.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, otherTab.LastModifiedByUserID, otherTab.LastModifiedByUserName); + var portalId = this._exportImportJob.PortalId; + var createdBy = Util.GetUserIdByName(this._exportImportJob, otherTab.CreatedByUserID, otherTab.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, otherTab.LastModifiedByUserID, otherTab.LastModifiedByUserName); var localTab = localTabs.FirstOrDefault(t => otherTab.UniqueId.Equals(t.UniqueId)) ?? localTabs.FirstOrDefault(t => otherTab.TabPath.Equals(t.TabPath, StringComparison.InvariantCultureIgnoreCase) && IsSameCulture(t.CultureCode, otherTab.CultureCode)); - var isParentPresent = IsParentTabPresentInExport(otherTab, exportedTabs, localTabs); + var isParentPresent = this.IsParentTabPresentInExport(otherTab, exportedTabs, localTabs); if (localTab != null) { localTab.TabSettings.Remove("TabImported"); otherTab.LocalId = localTab.TabID; - switch (_importDto.CollisionResolution) + switch (this._importDto.CollisionResolution) { case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored Tab", $"{otherTab.TabName} ({otherTab.TabPath})"); + this.Result.AddLogEntry("Ignored Tab", $"{otherTab.TabName} ({otherTab.TabPath})"); break; case CollisionResolution.Overwrite: - if (!IsTabPublished(localTab)) return; + if (!this.IsTabPublished(localTab)) return; SetTabData(localTab, otherTab); - localTab.StateID = GetLocalStateId(otherTab.StateID); - var parentId = IgnoreParentMatch ? otherTab.ParentId.GetValueOrDefault(Null.NullInteger) : TryFindLocalParentTabId(otherTab, exportedTabs, localTabs); + localTab.StateID = this.GetLocalStateId(otherTab.StateID); + var parentId = this.IgnoreParentMatch ? otherTab.ParentId.GetValueOrDefault(Null.NullInteger) : TryFindLocalParentTabId(otherTab, exportedTabs, localTabs); if (parentId == -1 && otherTab.ParentId > 0) { if (!isParentPresent) { - Result.AddLogEntry("Importing existing tab skipped as its parent was not found", $"{otherTab.TabName} ({otherTab.TabPath})", ReportLevel.Warn); + this.Result.AddLogEntry("Importing existing tab skipped as its parent was not found", $"{otherTab.TabName} ({otherTab.TabPath})", ReportLevel.Warn); return; } - CheckForPartialImportedTabs(otherTab); + this.CheckForPartialImportedTabs(otherTab); } var tabType = Globals.GetURLType(otherTab.Url); if (tabType == TabType.Tab && !referenceTabs.Contains(localTab.TabID)) @@ -211,7 +211,7 @@ protected virtual void ProcessImportPage(ExportTab otherTab, IList ex if (localTab.UniqueId != otherTab.UniqueId && !DataProvider.Instance().CheckTabUniqueIdExists(otherTab.UniqueId)) { localTab.UniqueId = otherTab.UniqueId; - UpdateTabUniqueId(localTab.TabID, localTab.UniqueId); + this.UpdateTabUniqueId(localTab.TabID, localTab.UniqueId); } try { @@ -221,40 +221,40 @@ protected virtual void ProcessImportPage(ExportTab otherTab, IList ex { localTab.Url = otherTab.Url; } - SetPartialImportSettings(otherTab, localTab); - _tabController.UpdateTab(localTab); + this.SetPartialImportSettings(otherTab, localTab); + this._tabController.UpdateTab(localTab); DotNetNuke.Data.DataProvider.Instance().UpdateTabOrder(localTab.TabID, localTab.TabOrder, localTab.ParentId, Null.NullInteger); } catch (Exception ex) { - Result.AddLogEntry($"Importing tab '{otherTab.TabName}' exception", ex.Message, ReportLevel.Error); + this.Result.AddLogEntry($"Importing tab '{otherTab.TabName}' exception", ex.Message, ReportLevel.Error); return; } - UpdateTabChangers(localTab.TabID, createdBy, modifiedBy); - UpdateDefaultLanguageGuid(portalId, localTab, otherTab, exportedTabs); - AddTabRelatedItems(localTab, otherTab, false); - TriggerImportEvent(localTab); - Result.AddLogEntry("Updated Tab", $"{otherTab.TabName} ({otherTab.TabPath})"); - _totals.TotalTabs++; + this.UpdateTabChangers(localTab.TabID, createdBy, modifiedBy); + this.UpdateDefaultLanguageGuid(portalId, localTab, otherTab, exportedTabs); + this.AddTabRelatedItems(localTab, otherTab, false); + this.TriggerImportEvent(localTab); + this.Result.AddLogEntry("Updated Tab", $"{otherTab.TabName} ({otherTab.TabPath})"); + this._totals.TotalTabs++; break; default: - throw new ArgumentOutOfRangeException(_importDto.CollisionResolution.ToString()); + throw new ArgumentOutOfRangeException(this._importDto.CollisionResolution.ToString()); } } else { localTab = new TabInfo { PortalID = portalId }; SetTabData(localTab, otherTab); - localTab.StateID = GetLocalStateId(otherTab.StateID); - var parentId = IgnoreParentMatch ? otherTab.ParentId.GetValueOrDefault(Null.NullInteger) : TryFindLocalParentTabId(otherTab, exportedTabs, localTabs); + localTab.StateID = this.GetLocalStateId(otherTab.StateID); + var parentId = this.IgnoreParentMatch ? otherTab.ParentId.GetValueOrDefault(Null.NullInteger) : TryFindLocalParentTabId(otherTab, exportedTabs, localTabs); var checkPartial = false; if (parentId == -1 && otherTab.ParentId > 0) { if (!isParentPresent) { - Result.AddLogEntry("Importing new tab skipped as its parent was not found", $"{otherTab.TabName} ({otherTab.TabPath})", ReportLevel.Warn); + this.Result.AddLogEntry("Importing new tab skipped as its parent was not found", $"{otherTab.TabName} ({otherTab.TabPath})", ReportLevel.Warn); return; } @@ -270,8 +270,8 @@ protected virtual void ProcessImportPage(ExportTab otherTab, IList ex localTab.Url = otherTab.Url; } localTab.UniqueId = Guid.NewGuid(); - SetPartialImportSettings(otherTab, localTab); - otherTab.LocalId = localTab.TabID = _tabController.AddTab(localTab, false); + this.SetPartialImportSettings(otherTab, localTab); + otherTab.LocalId = localTab.TabID = this._tabController.AddTab(localTab, false); DotNetNuke.Data.DataProvider.Instance().UpdateTabOrder(localTab.TabID, localTab.TabOrder, localTab.ParentId, Null.NullInteger); localTabs.Add(localTab); @@ -282,16 +282,16 @@ protected virtual void ProcessImportPage(ExportTab otherTab, IList ex if (checkPartial) { - CheckForPartialImportedTabs(otherTab); + this.CheckForPartialImportedTabs(otherTab); } } catch (Exception ex) { - Result.AddLogEntry($"Importing tab '{otherTab.TabName}' exception", ex.Message, ReportLevel.Error); + this.Result.AddLogEntry($"Importing tab '{otherTab.TabName}' exception", ex.Message, ReportLevel.Error); return; } - UpdateTabChangers(localTab.TabID, createdBy, modifiedBy); + this.UpdateTabChangers(localTab.TabID, createdBy, modifiedBy); // this is not saved upon updating the tab localTab.IsVisible = otherTab.IsVisible; @@ -301,30 +301,30 @@ protected virtual void ProcessImportPage(ExportTab otherTab, IList ex if (!DataProvider.Instance().CheckTabUniqueIdExists(otherTab.UniqueId)) { localTab.UniqueId = otherTab.UniqueId; - UpdateTabUniqueId(localTab.TabID, localTab.UniqueId); + this.UpdateTabUniqueId(localTab.TabID, localTab.UniqueId); } - Result.AddLogEntry("Added Tab", $"{otherTab.TabName} ({otherTab.TabPath})"); - _totals.TotalTabs++; - UpdateDefaultLanguageGuid(portalId, localTab, otherTab, exportedTabs); - AddTabRelatedItems(localTab, otherTab, true); - TriggerImportEvent(localTab); + this.Result.AddLogEntry("Added Tab", $"{otherTab.TabName} ({otherTab.TabPath})"); + this._totals.TotalTabs++; + this.UpdateDefaultLanguageGuid(portalId, localTab, otherTab, exportedTabs); + this.AddTabRelatedItems(localTab, otherTab, true); + this.TriggerImportEvent(localTab); } var portalSettings = new PortalSettings(portalId); if (otherTab.IsDeleted) { - _tabController.SoftDeleteTab(localTab.TabID, portalSettings); + this._tabController.SoftDeleteTab(localTab.TabID, portalSettings); } else { - var tab = _tabController.GetTab(localTab.TabID, portalId); + var tab = this._tabController.GetTab(localTab.TabID, portalId); if (tab.IsDeleted) { - RestoreTab(tab, portalSettings); + this.RestoreTab(tab, portalSettings); } } - UpdateParentInPartialImportTabs(localTab, otherTab, portalId, exportedTabs, localTabs); + this.UpdateParentInPartialImportTabs(localTab, otherTab, portalId, exportedTabs, localTabs); } public void RestoreTab(TabInfo tab, PortalSettings portalSettings) @@ -336,7 +336,7 @@ public void RestoreTab(TabInfo tab, PortalSettings portalSettings) TabWorkflowSettings.Instance.SetWorkflowEnabled(tab.PortalID, tab.TabID, false); } - _tabController.RestoreTab(tab, portalSettings); + this._tabController.RestoreTab(tab, portalSettings); if (changeControlStateForTab.IsChangeControlEnabledForTab) { @@ -380,7 +380,7 @@ private void UpdateDefaultLanguageGuid(int portalId, TabInfo localTab, ExportTab if (defaultLanguagePageToImport != null && defaultLanguagePageToImport.LocalId.HasValue) { - var defaultLanguagePageLocal = _tabController.GetTab(defaultLanguagePageToImport.LocalId.Value, portalId); + var defaultLanguagePageLocal = this._tabController.GetTab(defaultLanguagePageToImport.LocalId.Value, portalId); if (defaultLanguagePageLocal != null) { @@ -404,7 +404,7 @@ private void TriggerImportEvent(TabInfo localTab) { localTab.TabSettings.Add("TabImported", "Y"); } - _tabController.UpdateTab(localTab); + this._tabController.UpdateTab(localTab); TabController.Instance.DeleteTabSetting(localTab.TabID, "TabImported"); } catch (Exception) @@ -415,41 +415,41 @@ private void TriggerImportEvent(TabInfo localTab) private void AddTabRelatedItems(TabInfo localTab, ExportTab otherTab, bool isNew) { - _totals.TotalTabSettings += ImportTabSettings(localTab, otherTab, isNew); - _totals.TotalTabPermissions += ImportTabPermissions(localTab, otherTab, isNew); - _totals.TotalTabUrls += ImportTabUrls(localTab, otherTab, isNew); - _totals.TotalTabModules += ImportTabModulesAndRelatedItems(localTab, otherTab, isNew); + this._totals.TotalTabSettings += this.ImportTabSettings(localTab, otherTab, isNew); + this._totals.TotalTabPermissions += this.ImportTabPermissions(localTab, otherTab, isNew); + this._totals.TotalTabUrls += this.ImportTabUrls(localTab, otherTab, isNew); + this._totals.TotalTabModules += this.ImportTabModulesAndRelatedItems(localTab, otherTab, isNew); } private int ImportTabSettings(TabInfo localTab, ExportTab otherTab, bool isNew) { - var tabSettings = Repository.GetRelatedItems(otherTab.Id).ToList(); + var tabSettings = this.Repository.GetRelatedItems(otherTab.Id).ToList(); foreach (var other in tabSettings) { var localValue = isNew ? string.Empty : Convert.ToString(localTab.TabSettings[other.SettingName]); if (string.IsNullOrEmpty(localValue)) { - _tabController.UpdateTabSetting(localTab.TabID, other.SettingName, other.SettingValue); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateSettingRecordChangers("TabSettings", "TabID", + this._tabController.UpdateTabSetting(localTab.TabID, other.SettingName, other.SettingValue); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateSettingRecordChangers("TabSettings", "TabID", localTab.TabID, other.SettingName, createdBy, modifiedBy); - Result.AddLogEntry("Added tab setting", $"{other.SettingName} - {other.TabID}"); + this.Result.AddLogEntry("Added tab setting", $"{other.SettingName} - {other.TabID}"); } else { - switch (_importDto.CollisionResolution) + switch (this._importDto.CollisionResolution) { case CollisionResolution.Overwrite: if (localValue != other.SettingValue) { // the next will clear the cache - _tabController.UpdateTabSetting(localTab.TabID, other.SettingName, other.SettingValue); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateSettingRecordChangers("TabSettings", "TabID", + this._tabController.UpdateTabSetting(localTab.TabID, other.SettingName, other.SettingValue); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateSettingRecordChangers("TabSettings", "TabID", localTab.TabID, other.SettingName, createdBy, modifiedBy); - Result.AddLogEntry("Updated tab setting", $"{other.SettingName} - {other.TabID}"); + this.Result.AddLogEntry("Updated tab setting", $"{other.SettingName} - {other.TabID}"); } else { @@ -457,10 +457,10 @@ private int ImportTabSettings(TabInfo localTab, ExportTab otherTab, bool isNew) } break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored tab setting", other.SettingName); + this.Result.AddLogEntry("Ignored tab setting", other.SettingName); break; default: - throw new ArgumentOutOfRangeException(_importDto.CollisionResolution.ToString()); + throw new ArgumentOutOfRangeException(this._importDto.CollisionResolution.ToString()); } } } @@ -470,15 +470,15 @@ private int ImportTabSettings(TabInfo localTab, ExportTab otherTab, bool isNew) private int ImportTabPermissions(TabInfo localTab, ExportTab otherTab, bool isNew) { - if (!_exportDto.IncludePermissions) return 0; + if (!this._exportDto.IncludePermissions) return 0; var noRole = Convert.ToInt32(Globals.glbRoleNothing); var count = 0; - var tabPermissions = Repository.GetRelatedItems(otherTab.Id).ToList(); + var tabPermissions = this.Repository.GetRelatedItems(otherTab.Id).ToList(); var localTabPermissions = localTab.TabPermissions.OfType().ToList(); foreach (var other in tabPermissions) { - var roleId = Util.GetRoleIdByName(_importDto.PortalId, other.RoleID ?? noRole, other.RoleName); - var userId = UserController.GetUserByName(_importDto.PortalId, other.Username)?.UserID; + var roleId = Util.GetRoleIdByName(this._importDto.PortalId, other.RoleID ?? noRole, other.RoleName); + var userId = UserController.GetUserByName(this._importDto.PortalId, other.Username)?.UserID; var local = isNew ? null : localTabPermissions.FirstOrDefault( x => x.PermissionCode == other.PermissionCode && x.PermissionKey == other.PermissionKey @@ -487,16 +487,16 @@ private int ImportTabPermissions(TabInfo localTab, ExportTab otherTab, bool isNe var isUpdate = false; if (local != null) { - switch (_importDto.CollisionResolution) + switch (this._importDto.CollisionResolution) { case CollisionResolution.Overwrite: isUpdate = true; break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored tab permission", other.PermissionKey); + this.Result.AddLogEntry("Ignored tab permission", other.PermissionKey); break; default: - throw new ArgumentOutOfRangeException(_importDto.CollisionResolution.ToString()); + throw new ArgumentOutOfRangeException(this._importDto.CollisionResolution.ToString()); } } @@ -528,7 +528,7 @@ private int ImportTabPermissions(TabInfo localTab, ExportTab otherTab, bool isNe { if (userId == null) { - Result.AddLogEntry("Couldn't add tab permission; User is undefined!", + this.Result.AddLogEntry("Couldn't add tab permission; User is undefined!", $"{other.PermissionKey} - {other.PermissionID}", ReportLevel.Warn); continue; } @@ -538,7 +538,7 @@ private int ImportTabPermissions(TabInfo localTab, ExportTab otherTab, bool isNe { if (roleId == null) { - Result.AddLogEntry("Couldn't add tab permission; Role is undefined!", + this.Result.AddLogEntry("Couldn't add tab permission; Role is undefined!", $"{other.PermissionKey} - {other.PermissionID}", ReportLevel.Warn); continue; } @@ -549,12 +549,12 @@ private int ImportTabPermissions(TabInfo localTab, ExportTab otherTab, bool isNe //var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); //var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); //UpdateTabPermissionChangers(local.TabPermissionID, createdBy, modifiedBy); - Result.AddLogEntry("Added tab permission", $"{other.PermissionKey} - {other.PermissionID}"); + this.Result.AddLogEntry("Added tab permission", $"{other.PermissionKey} - {other.PermissionID}"); count++; } else { - Result.AddLogEntry("Couldn't add tab permission; Permission is undefined!", + this.Result.AddLogEntry("Couldn't add tab permission; Permission is undefined!", $"{other.PermissionKey} - {other.PermissionID}", ReportLevel.Warn); } } @@ -571,38 +571,38 @@ private int ImportTabPermissions(TabInfo localTab, ExportTab otherTab, bool isNe private int ImportTabUrls(TabInfo localTab, ExportTab otherTab, bool isNew) { var count = 0; - var tabUrls = Repository.GetRelatedItems(otherTab.Id).ToList(); + var tabUrls = this.Repository.GetRelatedItems(otherTab.Id).ToList(); var localUrls = localTab.TabUrls; foreach (var other in tabUrls) { var local = isNew ? null : localUrls.FirstOrDefault(url => url.SeqNum == other.SeqNum); if (local != null) { - switch (_importDto.CollisionResolution) + switch (this._importDto.CollisionResolution) { case CollisionResolution.Overwrite: try { local.Url = other.Url; - TabController.Instance.SaveTabUrl(local, _importDto.PortalId, true); - Result.AddLogEntry("Update Tab Url", other.Url); + TabController.Instance.SaveTabUrl(local, this._importDto.PortalId, true); + this.Result.AddLogEntry("Update Tab Url", other.Url); count++; } catch (Exception ex) { - Result.AddLogEntry("EXCEPTION updating tab, Tab ID=" + local.TabId, ex.Message, ReportLevel.Error); + this.Result.AddLogEntry("EXCEPTION updating tab, Tab ID=" + local.TabId, ex.Message, ReportLevel.Error); } break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored tab url", other.Url); + this.Result.AddLogEntry("Ignored tab url", other.Url); break; default: - throw new ArgumentOutOfRangeException(_importDto.CollisionResolution.ToString()); + throw new ArgumentOutOfRangeException(this._importDto.CollisionResolution.ToString()); } } else { - var alias = PortalAliasController.Instance.GetPortalAliasesByPortalId(_importDto.PortalId).FirstOrDefault(a => a.IsPrimary); + var alias = PortalAliasController.Instance.GetPortalAliasesByPortalId(this._importDto.PortalId).FirstOrDefault(a => a.IsPrimary); local = new TabUrlInfo { TabId = localTab.TabID, @@ -618,18 +618,18 @@ private int ImportTabUrls(TabInfo localTab, ExportTab otherTab, bool isNew) try { - TabController.Instance.SaveTabUrl(local, _importDto.PortalId, true); + TabController.Instance.SaveTabUrl(local, this._importDto.PortalId, true); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateTabUrlChangers(local.TabId, local.SeqNum, createdBy, modifiedBy); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateTabUrlChangers(local.TabId, local.SeqNum, createdBy, modifiedBy); - Result.AddLogEntry("Added Tab Url", other.Url); + this.Result.AddLogEntry("Added Tab Url", other.Url); count++; } catch (Exception ex) { - Result.AddLogEntry("EXCEPTION adding tab, Tab ID=" + local.TabId, ex.Message, ReportLevel.Error); + this.Result.AddLogEntry("EXCEPTION adding tab, Tab ID=" + local.TabId, ex.Message, ReportLevel.Error); } } } @@ -640,17 +640,17 @@ private int ImportTabUrls(TabInfo localTab, ExportTab otherTab, bool isNew) private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab, bool isNew) { var count = 0; - var exportedModules = Repository.GetRelatedItems(otherTab.Id).ToList(); - var exportedTabModules = Repository.GetRelatedItems(otherTab.Id) + var exportedModules = this.Repository.GetRelatedItems(otherTab.Id).ToList(); + var exportedTabModules = this.Repository.GetRelatedItems(otherTab.Id) .OrderBy(m => m.PaneName?.ToLowerInvariant()).ThenBy(m => m.ModuleOrder).ToList(); var localExportModules = isNew ? new List() : EntitiesController.Instance.GetModules(localTab.TabID, true, Constants.MaxDbTime, null).ToList(); - var localTabModules = isNew ? new List() : _moduleController.GetTabModules(localTab.TabID).Values.ToList(); + var localTabModules = isNew ? new List() : this._moduleController.GetTabModules(localTab.TabID).Values.ToList(); var allExistingIds = localTabModules.Select(l => l.ModuleID).ToList(); var allImportedIds = new List(); - var localOrders = BuildModuleOrders(localTabModules); - var exportOrders = BuildModuleOrders(exportedTabModules); + var localOrders = this.BuildModuleOrders(localTabModules); + var exportOrders = this.BuildModuleOrders(exportedTabModules); foreach (var other in exportedTabModules) { var locals = new List(localTabModules.Where(m => m.UniqueId == other.UniqueId && m.IsDeleted == other.IsDeleted)); @@ -658,7 +658,7 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab { locals = new List(localTabModules.Where(m => m.ModuleDefinition.FriendlyName == other.FriendlyName && m.PaneName == other.PaneName - && ModuleOrderMatched(m, other, localOrders, exportOrders) + && this.ModuleOrderMatched(m, other, localOrders, exportOrders) && m.IsDeleted == other.IsDeleted)).ToList(); } @@ -668,12 +668,12 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab var moduleDefinition = ModuleDefinitionController.GetModuleDefinitionByFriendlyName(other.FriendlyName); if (moduleDefinition == null) { - Result.AddLogEntry("Error adding tab module, ModuleDef=" + other.FriendlyName, + this.Result.AddLogEntry("Error adding tab module, ModuleDef=" + other.FriendlyName, "The modue definition is not present in the system", ReportLevel.Error); continue; // the module is not installed, therefore ignore it } - var sharedModules = Repository.FindItems(m => m.ModuleID == other.ModuleID); + var sharedModules = this.Repository.FindItems(m => m.ModuleID == other.ModuleID); var sharedModule = sharedModules.FirstOrDefault(m => m.LocalId.HasValue); if (locals.Count == 0) @@ -715,53 +715,53 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab IsShareableViewOnly = other.IsShareableViewOnly, StartDate = otherModule.StartDate.GetValueOrDefault(DateTime.MinValue), EndDate = otherModule.EndDate.GetValueOrDefault(DateTime.MinValue), - PortalID = _exportImportJob.PortalId + PortalID = this._exportImportJob.PortalId }; //Logger.Error($"Local Tab ID={local.TabID}, ModuleID={local.ModuleID}, ModuleDefID={local.ModuleDefID}"); try { //this will create up to 2 records: Module (if it is not already there) and TabModule - otherModule.LocalId = _moduleController.AddModule(local); + otherModule.LocalId = this._moduleController.AddModule(local); other.LocalId = local.TabModuleID; - Repository.UpdateItem(otherModule); + this.Repository.UpdateItem(otherModule); allImportedIds.Add(local.ModuleID); // this is not saved upon adding the module if (other.IsDeleted && !otherTab.IsDeleted) { local.IsDeleted = other.IsDeleted; - _moduleController.DeleteTabModule(local.TabID, local.ModuleID, true); + this._moduleController.DeleteTabModule(local.TabID, local.ModuleID, true); } - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - UpdateTabModuleChangers(local.TabModuleID, createdBy, modifiedBy); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this.UpdateTabModuleChangers(local.TabModuleID, createdBy, modifiedBy); if (sharedModule == null) { - createdBy = Util.GetUserIdByName(_exportImportJob, otherModule.CreatedByUserID, otherModule.CreatedByUserName); - modifiedBy = Util.GetUserIdByName(_exportImportJob, otherModule.LastModifiedByUserID, otherModule.LastModifiedByUserName); - UpdateModuleChangers(local.ModuleID, createdBy, modifiedBy); + createdBy = Util.GetUserIdByName(this._exportImportJob, otherModule.CreatedByUserID, otherModule.CreatedByUserName); + modifiedBy = Util.GetUserIdByName(this._exportImportJob, otherModule.LastModifiedByUserID, otherModule.LastModifiedByUserName); + this.UpdateModuleChangers(local.ModuleID, createdBy, modifiedBy); - _totals.TotalModuleSettings += ImportModuleSettings(local, otherModule, isNew); - _totals.TotalModulePermissions += ImportModulePermissions(local, otherModule, isNew); - _totals.TotalTabModuleSettings += ImportTabModuleSettings(local, other, isNew); + this._totals.TotalModuleSettings += this.ImportModuleSettings(local, otherModule, isNew); + this._totals.TotalModulePermissions += this.ImportModulePermissions(local, otherModule, isNew); + this._totals.TotalTabModuleSettings += this.ImportTabModuleSettings(local, other, isNew); - if (_exportDto.IncludeContent) + if (this._exportDto.IncludeContent) { - _totals.TotalContents += ImportPortableContent(localTab.TabID, local, otherModule, isNew); + this._totals.TotalContents += this.ImportPortableContent(localTab.TabID, local, otherModule, isNew); } - Result.AddLogEntry("Added module", local.ModuleID.ToString()); + this.Result.AddLogEntry("Added module", local.ModuleID.ToString()); } - Result.AddLogEntry("Added tab module", local.TabModuleID.ToString()); + this.Result.AddLogEntry("Added tab module", local.TabModuleID.ToString()); count++; } catch (Exception ex) { - Result.AddLogEntry("EXCEPTION importing tab module, Module ID=" + local.ModuleID, ex.Message, ReportLevel.Error); + this.Result.AddLogEntry("EXCEPTION importing tab module, Module ID=" + local.ModuleID, ex.Message, ReportLevel.Error); Logger.Error(ex); } } @@ -812,13 +812,13 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab InheritViewPermissions = other.InheritViewPermissions, IsShareable = other.IsShareable, IsShareableViewOnly = other.IsShareableViewOnly, - PortalID = _exportImportJob.PortalId + PortalID = this._exportImportJob.PortalId }; //this will create up to 2 records: Module (if it is not already there) and TabModule - otherModule.LocalId = _moduleController.AddModule(local); + otherModule.LocalId = this._moduleController.AddModule(local); other.LocalId = local.TabModuleID; - Repository.UpdateItem(otherModule); + this.Repository.UpdateItem(otherModule); allImportedIds.Add(local.ModuleID); // this is not saved upon updating the module @@ -826,9 +826,9 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab { local.IsDeleted = other.IsDeleted; if (other.IsDeleted) - _moduleController.DeleteTabModule(local.TabID, local.ModuleID, true); + this._moduleController.DeleteTabModule(local.TabID, local.ModuleID, true); else - _moduleController.RestoreModule(local); + this._moduleController.RestoreModule(local); } } else @@ -881,15 +881,15 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab if (local.UniqueId != other.UniqueId && !DataProvider.Instance().CheckTabModuleUniqueIdExists(other.UniqueId)) { local.UniqueId = other.UniqueId; - UpdateModuleUniqueId(local.TabModuleID, other.UniqueId); + this.UpdateModuleUniqueId(local.TabModuleID, other.UniqueId); } // updates both module and tab module db records - UpdateModuleWithIsDeletedHandling(other, otherModule, local); + this.UpdateModuleWithIsDeletedHandling(other, otherModule, local); other.LocalId = local.TabModuleID; otherModule.LocalId = localExpModule.ModuleID; - Repository.UpdateItem(otherModule); + this.Repository.UpdateItem(otherModule); allImportedIds.Add(local.ModuleID); // this is not saved upon updating the module @@ -898,49 +898,49 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab local.IsDeleted = other.IsDeleted; if (other.IsDeleted) { - _moduleController.DeleteTabModule(local.TabID, local.ModuleID, true); + this._moduleController.DeleteTabModule(local.TabID, local.ModuleID, true); } else { - _moduleController.RestoreModule(local); + this._moduleController.RestoreModule(local); } } } - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - UpdateTabModuleChangers(local.TabModuleID, createdBy, modifiedBy); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this.UpdateTabModuleChangers(local.TabModuleID, createdBy, modifiedBy); - createdBy = Util.GetUserIdByName(_exportImportJob, otherModule.CreatedByUserID, otherModule.CreatedByUserName); - modifiedBy = Util.GetUserIdByName(_exportImportJob, otherModule.LastModifiedByUserID, otherModule.LastModifiedByUserName); - UpdateModuleChangers(local.ModuleID, createdBy, modifiedBy); + createdBy = Util.GetUserIdByName(this._exportImportJob, otherModule.CreatedByUserID, otherModule.CreatedByUserName); + modifiedBy = Util.GetUserIdByName(this._exportImportJob, otherModule.LastModifiedByUserID, otherModule.LastModifiedByUserName); + this.UpdateModuleChangers(local.ModuleID, createdBy, modifiedBy); - _totals.TotalTabModuleSettings += ImportTabModuleSettings(local, other, isNew); + this._totals.TotalTabModuleSettings += this.ImportTabModuleSettings(local, other, isNew); - _totals.TotalModuleSettings += ImportModuleSettings(local, otherModule, isNew); - _totals.TotalModulePermissions += ImportModulePermissions(local, otherModule, isNew); + this._totals.TotalModuleSettings += this.ImportModuleSettings(local, otherModule, isNew); + this._totals.TotalModulePermissions += this.ImportModulePermissions(local, otherModule, isNew); - if (_exportDto.IncludeContent) + if (this._exportDto.IncludeContent) { - _totals.TotalContents += ImportPortableContent(localTab.TabID, local, otherModule, isNew); + this._totals.TotalContents += this.ImportPortableContent(localTab.TabID, local, otherModule, isNew); } - Result.AddLogEntry("Updated tab module", local.TabModuleID.ToString()); - Result.AddLogEntry("Updated module", local.ModuleID.ToString()); + this.Result.AddLogEntry("Updated tab module", local.TabModuleID.ToString()); + this.Result.AddLogEntry("Updated module", local.ModuleID.ToString()); count++; } catch (Exception ex) { - Result.AddLogEntry("EXCEPTION importing tab module, Module ID=" + local.ModuleID, ex.Message, ReportLevel.Error); + this.Result.AddLogEntry("EXCEPTION importing tab module, Module ID=" + local.ModuleID, ex.Message, ReportLevel.Error); Logger.Error(ex); } } } } - if (!isNew && _exportDto.ExportMode == ExportMode.Full && - _importDto.CollisionResolution == CollisionResolution.Overwrite) + if (!isNew && this._exportDto.ExportMode == ExportMode.Full && + this._importDto.CollisionResolution == CollisionResolution.Overwrite) { // delete left over tab modules for full import in an existing page var unimported = allExistingIds.Distinct().Except(allImportedIds); @@ -948,13 +948,13 @@ private int ImportTabModulesAndRelatedItems(TabInfo localTab, ExportTab otherTab { try { - _moduleController.DeleteTabModule(localTab.TabID, moduleId, false); + this._moduleController.DeleteTabModule(localTab.TabID, moduleId, false); } catch (Exception ex) { Logger.Error(new Exception($"Delete TabModule Failed: {moduleId}", ex)); } - Result.AddLogEntry("Removed existing tab module", "Module ID=" + moduleId); + this.Result.AddLogEntry("Removed existing tab module", "Module ID=" + moduleId); } } @@ -970,9 +970,9 @@ updating Modules. private void UpdateModuleWithIsDeletedHandling(ExportTabModule exportTabModule, ExportModule exportModule, ModuleInfo importModule) { importModule.IsDeleted = exportModule.IsDeleted; - ActionInWorkflowlessContext(importModule.TabID, () => + this.ActionInWorkflowlessContext(importModule.TabID, () => { - _moduleController.UpdateModule(importModule); + this._moduleController.UpdateModule(importModule); }); importModule.IsDeleted = exportTabModule.IsDeleted; } @@ -1051,34 +1051,34 @@ private IDictionary BuildModuleOrders(IList modules) private int ImportModuleSettings(ModuleInfo localModule, ExportModule otherModule, bool isNew) { var count = 0; - var moduleSettings = Repository.GetRelatedItems(otherModule.Id).ToList(); + var moduleSettings = this.Repository.GetRelatedItems(otherModule.Id).ToList(); foreach (var other in moduleSettings) { var localValue = isNew ? string.Empty : Convert.ToString(localModule.ModuleSettings[other.SettingName]); if (string.IsNullOrEmpty(localValue)) { - _moduleController.UpdateModuleSetting(localModule.ModuleID, other.SettingName, other.SettingValue); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateSettingRecordChangers("ModuleSettings", "ModuleID", + this._moduleController.UpdateModuleSetting(localModule.ModuleID, other.SettingName, other.SettingValue); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateSettingRecordChangers("ModuleSettings", "ModuleID", localModule.ModuleID, other.SettingName, createdBy, modifiedBy); - Result.AddLogEntry("Added module setting", $"{other.SettingName} - {other.ModuleID}"); + this.Result.AddLogEntry("Added module setting", $"{other.SettingName} - {other.ModuleID}"); count++; } else { - switch (_importDto.CollisionResolution) + switch (this._importDto.CollisionResolution) { case CollisionResolution.Overwrite: if (localValue != other.SettingValue) { // the next will clear the cache - _moduleController.UpdateModuleSetting(localModule.ModuleID, other.SettingName, other.SettingValue); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateSettingRecordChangers("ModuleSettings", "ModuleID", + this._moduleController.UpdateModuleSetting(localModule.ModuleID, other.SettingName, other.SettingValue); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateSettingRecordChangers("ModuleSettings", "ModuleID", localModule.ModuleID, other.SettingName, createdBy, modifiedBy); - Result.AddLogEntry("Updated module setting", $"{other.SettingName} - {other.ModuleID}"); + this.Result.AddLogEntry("Updated module setting", $"{other.SettingName} - {other.ModuleID}"); count++; } else @@ -1087,10 +1087,10 @@ private int ImportModuleSettings(ModuleInfo localModule, ExportModule otherModul } break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored module setting", other.SettingName); + this.Result.AddLogEntry("Ignored module setting", other.SettingName); break; default: - throw new ArgumentOutOfRangeException(_importDto.CollisionResolution.ToString()); + throw new ArgumentOutOfRangeException(this._importDto.CollisionResolution.ToString()); } } } @@ -1102,14 +1102,14 @@ private int ImportModulePermissions(ModuleInfo localModule, ExportModule otherMo { var count = 0; var noRole = Convert.ToInt32(Globals.glbRoleNothing); - var modulePermissions = Repository.GetRelatedItems(otherModule.Id).ToList(); + var modulePermissions = this.Repository.GetRelatedItems(otherModule.Id).ToList(); var localModulePermissions = isNew ? new List() : localModule.ModulePermissions.OfType().ToList(); foreach (var other in modulePermissions) { - var userId = UserController.GetUserByName(_importDto.PortalId, other.Username)?.UserID; - var roleId = Util.GetRoleIdByName(_importDto.PortalId, other.RoleID ?? noRole, other.RoleName); + var userId = UserController.GetUserByName(this._importDto.PortalId, other.Username)?.UserID; + var roleId = Util.GetRoleIdByName(this._importDto.PortalId, other.RoleID ?? noRole, other.RoleName); var permissionId = DataProvider.Instance().GetPermissionId(other.PermissionCode, other.PermissionKey, other.PermissionName); if (permissionId != null) @@ -1142,7 +1142,7 @@ private int ImportModulePermissions(ModuleInfo localModule, ExportModule otherMo other.LocalId = localModule.ModulePermissions.Add(local, true); - Result.AddLogEntry("Added module permission", $"{other.PermissionKey} - {other.PermissionID}"); + this.Result.AddLogEntry("Added module permission", $"{other.PermissionKey} - {other.PermissionID}"); count++; } } @@ -1157,16 +1157,16 @@ private int ImportModulePermissions(ModuleInfo localModule, ExportModule otherMo private int ImportPortableContent(int tabId, ModuleInfo localModule, ExportModule otherModule, bool isNew) { - var exportedContent = Repository.FindItems(m => m.ModuleID == otherModule.ModuleID).ToList(); + var exportedContent = this.Repository.FindItems(m => m.ModuleID == otherModule.ModuleID).ToList(); if (exportedContent.Count > 0) { var moduleDef = ModuleDefinitionController.GetModuleDefinitionByID(localModule.ModuleDefID); - var desktopModuleInfo = DesktopModuleController.GetDesktopModule(moduleDef.DesktopModuleID, _exportDto.PortalId); + var desktopModuleInfo = DesktopModuleController.GetDesktopModule(moduleDef.DesktopModuleID, this._exportDto.PortalId); if (!string.IsNullOrEmpty(desktopModuleInfo?.BusinessControllerClass)) { try { - var module = _moduleController.GetModule(localModule.ModuleID, tabId, true); + var module = this._moduleController.GetModule(localModule.ModuleID, tabId, true); if (!string.IsNullOrEmpty(module.DesktopModule.BusinessControllerClass) && module.DesktopModule.IsPortable) { var businessController = Reflection.CreateObject(module.DesktopModule.BusinessControllerClass, module.DesktopModule.BusinessControllerClass); @@ -1174,21 +1174,21 @@ private int ImportPortableContent(int tabId, ModuleInfo localModule, ExportModul if (controller != null) { //Note: there is no chek whether the content exists or not to manage conflict resolution - if (isNew || _importDto.CollisionResolution == CollisionResolution.Overwrite) + if (isNew || this._importDto.CollisionResolution == CollisionResolution.Overwrite) { var restoreCount = 0; var version = DotNetNukeContext.Current.Application.Version.ToString(3); - ActionInWorkflowlessContext(tabId, () => + this.ActionInWorkflowlessContext(tabId, () => { foreach (var moduleContent in exportedContent) { if (!moduleContent.IsRestored - || !_importContentList.Any(i => i.ExportModuleId == otherModule.ModuleID && i.LocalModuleId == localModule.ModuleID)) + || !this._importContentList.Any(i => i.ExportModuleId == otherModule.ModuleID && i.LocalModuleId == localModule.ModuleID)) { try { - _importContentList.Add(new ImportModuleMapping { ExportModuleId = otherModule.ModuleID, LocalModuleId = localModule.ModuleID }); + this._importContentList.Add(new ImportModuleMapping { ExportModuleId = otherModule.ModuleID, LocalModuleId = localModule.ModuleID }); var content = moduleContent.XmlContent; if (content.IndexOf('\x03') >= 0) { @@ -1196,14 +1196,14 @@ private int ImportPortableContent(int tabId, ModuleInfo localModule, ExportModul content = content.Replace('\x03', ' '); } - controller.ImportModule(localModule.ModuleID, content, version, _exportImportJob.CreatedByUserId); + controller.ImportModule(localModule.ModuleID, content, version, this._exportImportJob.CreatedByUserId); moduleContent.IsRestored = true; - Repository.UpdateItem(moduleContent); + this.Repository.UpdateItem(moduleContent); restoreCount++; } catch (Exception ex) { - Result.AddLogEntry("Error importing module data, Module ID=" + localModule.ModuleID, ex.Message, ReportLevel.Error); + this.Result.AddLogEntry("Error importing module data, Module ID=" + localModule.ModuleID, ex.Message, ReportLevel.Error); Logger.ErrorFormat("ModuleContent: (Module ID={0}). Error: {1}{2}{3}", localModule.ModuleID, ex, Environment.NewLine, moduleContent.XmlContent); } @@ -1213,7 +1213,7 @@ private int ImportPortableContent(int tabId, ModuleInfo localModule, ExportModul if (restoreCount > 0) { - Result.AddLogEntry("Added/Updated module content inside Tab ID=" + tabId, "Module ID=" + localModule.ModuleID); + this.Result.AddLogEntry("Added/Updated module content inside Tab ID=" + tabId, "Module ID=" + localModule.ModuleID); return restoreCount; } } @@ -1222,7 +1222,7 @@ private int ImportPortableContent(int tabId, ModuleInfo localModule, ExportModul } catch (Exception ex) { - Result.AddLogEntry("Error cerating business class type", desktopModuleInfo.BusinessControllerClass, ReportLevel.Error); + this.Result.AddLogEntry("Error cerating business class type", desktopModuleInfo.BusinessControllerClass, ReportLevel.Error); Logger.Error("Error cerating business class type. " + ex); } } @@ -1233,7 +1233,7 @@ private int ImportPortableContent(int tabId, ModuleInfo localModule, ExportModul private void ActionInWorkflowlessContext(int tabId, Action action) { bool versionEnabledPortalLevel, versionEnabledTabLevel, workflowEnabledPortalLevel, workflowEnabledTabLevel; - DisableVersioning(tabId, out versionEnabledPortalLevel, out versionEnabledTabLevel, out workflowEnabledPortalLevel, out workflowEnabledTabLevel); + this.DisableVersioning(tabId, out versionEnabledPortalLevel, out versionEnabledTabLevel, out workflowEnabledPortalLevel, out workflowEnabledTabLevel); try { @@ -1241,7 +1241,7 @@ private void ActionInWorkflowlessContext(int tabId, Action action) } finally { - RestoreVersioning(tabId, versionEnabledPortalLevel, versionEnabledTabLevel, workflowEnabledPortalLevel, workflowEnabledTabLevel); + this.RestoreVersioning(tabId, versionEnabledPortalLevel, versionEnabledTabLevel, workflowEnabledPortalLevel, workflowEnabledTabLevel); } } @@ -1251,7 +1251,7 @@ private void DisableVersioning(int tabId, out bool workflowEnabledPortalLevel, out bool workflowEnabledTabLevel) { - var portalId = _importDto.PortalId; + var portalId = this._importDto.PortalId; versionEnabledPortalLevel = TabVersionSettings.Instance.IsVersioningEnabled(portalId); versionEnabledTabLevel = TabVersionSettings.Instance.IsVersioningEnabled(portalId, tabId); TabVersionSettings.Instance.SetEnabledVersioningForPortal(portalId, false); @@ -1269,7 +1269,7 @@ private void RestoreVersioning(int tabId, bool workflowEnabledPortalLevel, bool workflowEnabledTabLevel) { - var portalId = _importDto.PortalId; + var portalId = this._importDto.PortalId; TabVersionSettings.Instance.SetEnabledVersioningForPortal(portalId, versionEnabledPortalLevel); TabVersionSettings.Instance.SetEnabledVersioningForTab(tabId, versionEnabledTabLevel); TabWorkflowSettings.Instance.SetWorkflowEnabled(portalId, workflowEnabledPortalLevel); @@ -1279,35 +1279,35 @@ private void RestoreVersioning(int tabId, private int ImportTabModuleSettings(ModuleInfo localTabModule, ExportTabModule otherTabModule, bool isNew) { var count = 0; - var tabModuleSettings = Repository.GetRelatedItems(otherTabModule.Id).ToList(); + var tabModuleSettings = this.Repository.GetRelatedItems(otherTabModule.Id).ToList(); foreach (var other in tabModuleSettings) { var localValue = isNew ? "" : Convert.ToString(localTabModule.TabModuleSettings[other.SettingName]); if (string.IsNullOrEmpty(localValue)) { // the next will clear the cache - _moduleController.UpdateTabModuleSetting(localTabModule.TabModuleID, other.SettingName, other.SettingValue); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateSettingRecordChangers("TabModuleSettings", "TabModuleID", + this._moduleController.UpdateTabModuleSetting(localTabModule.TabModuleID, other.SettingName, other.SettingValue); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateSettingRecordChangers("TabModuleSettings", "TabModuleID", localTabModule.TabModuleID, other.SettingName, createdBy, modifiedBy); - Result.AddLogEntry("Added tab module setting", $"{other.SettingName} - {other.TabModuleID}"); + this.Result.AddLogEntry("Added tab module setting", $"{other.SettingName} - {other.TabModuleID}"); count++; } else { - switch (_importDto.CollisionResolution) + switch (this._importDto.CollisionResolution) { case CollisionResolution.Overwrite: if (localValue != other.SettingValue) { // the next will clear the cache - _moduleController.UpdateTabModuleSetting(localTabModule.TabModuleID, other.SettingName, other.SettingValue); - var createdBy = Util.GetUserIdByName(_exportImportJob, other.CreatedByUserID, other.CreatedByUserName); - var modifiedBy = Util.GetUserIdByName(_exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); - _dataProvider.UpdateSettingRecordChangers("TabModuleSettings", "TabModuleID", + this._moduleController.UpdateTabModuleSetting(localTabModule.TabModuleID, other.SettingName, other.SettingValue); + var createdBy = Util.GetUserIdByName(this._exportImportJob, other.CreatedByUserID, other.CreatedByUserName); + var modifiedBy = Util.GetUserIdByName(this._exportImportJob, other.LastModifiedByUserID, other.LastModifiedByUserName); + this._dataProvider.UpdateSettingRecordChangers("TabModuleSettings", "TabModuleID", localTabModule.TabModuleID, other.SettingName, createdBy, modifiedBy); - Result.AddLogEntry("Updated tab module setting", $"{other.SettingName} - {other.TabModuleID}"); + this.Result.AddLogEntry("Updated tab module setting", $"{other.SettingName} - {other.TabModuleID}"); count++; } else @@ -1316,10 +1316,10 @@ private int ImportTabModuleSettings(ModuleInfo localTabModule, ExportTabModule o } break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored module setting", other.SettingName); + this.Result.AddLogEntry("Ignored module setting", other.SettingName); break; default: - throw new ArgumentOutOfRangeException(_importDto.CollisionResolution.ToString()); + throw new ArgumentOutOfRangeException(this._importDto.CollisionResolution.ToString()); } } } @@ -1427,58 +1427,58 @@ private void RepairReferenceTabs(IList referenceTabs, IList localT private void UpdateTabChangers(int tabId, int createdBy, int modifiedBy) { - _dataProvider.UpdateRecordChangers("Tabs", "TabID", tabId, createdBy, modifiedBy); + this._dataProvider.UpdateRecordChangers("Tabs", "TabID", tabId, createdBy, modifiedBy); } // ReSharper disable UnusedMember.Local private void UpdateTabPermissionChangers(int tabPermissionId, int createdBy, int modifiedBy) { - _dataProvider.UpdateRecordChangers("TabPermission", "TabPermissionID", tabPermissionId, createdBy, modifiedBy); + this._dataProvider.UpdateRecordChangers("TabPermission", "TabPermissionID", tabPermissionId, createdBy, modifiedBy); } private void UpdateTabSettingChangers(int tabId, string settingName, int createdBy, int modifiedBy) { - _dataProvider.UpdateSettingRecordChangers("TabSettings", "TabID", tabId, settingName, createdBy, modifiedBy); + this._dataProvider.UpdateSettingRecordChangers("TabSettings", "TabID", tabId, settingName, createdBy, modifiedBy); } private void UpdateTabUrlChangers(int tabUrlId, int createdBy, int modifiedBy) { - _dataProvider.UpdateRecordChangers("TabUrls", "TabUrlID", tabUrlId, createdBy, modifiedBy); + this._dataProvider.UpdateRecordChangers("TabUrls", "TabUrlID", tabUrlId, createdBy, modifiedBy); } private void UpdateTabModuleChangers(int tabModuleId, int createdBy, int modifiedBy) { - _dataProvider.UpdateRecordChangers("TabModules", "TabModuleID", tabModuleId, createdBy, modifiedBy); + this._dataProvider.UpdateRecordChangers("TabModules", "TabModuleID", tabModuleId, createdBy, modifiedBy); } private void UpdateTabModuleSettingsChangers(int tabModuleId, string settingName, int createdBy, int modifiedBy) { - _dataProvider.UpdateSettingRecordChangers("TabModuleSettings", "TabModuleID", tabModuleId, settingName, createdBy, modifiedBy); + this._dataProvider.UpdateSettingRecordChangers("TabModuleSettings", "TabModuleID", tabModuleId, settingName, createdBy, modifiedBy); } private void UpdateModuleChangers(int moduleId, int createdBy, int modifiedBy) { - _dataProvider.UpdateRecordChangers("Modules", "ModuleID", moduleId, createdBy, modifiedBy); + this._dataProvider.UpdateRecordChangers("Modules", "ModuleID", moduleId, createdBy, modifiedBy); } private void UpdateModulePermissionChangers(int modulePermissionId, int createdBy, int modifiedBy) { - _dataProvider.UpdateRecordChangers("ModulePermission", "ModulePermissionID", modulePermissionId, createdBy, modifiedBy); + this._dataProvider.UpdateRecordChangers("ModulePermission", "ModulePermissionID", modulePermissionId, createdBy, modifiedBy); } private void UpdateModuleSettingsChangers(int moduleId, string settingName, int createdBy, int modifiedBy) { - _dataProvider.UpdateSettingRecordChangers("ModuleSettings", "ModuleID", moduleId, settingName, createdBy, modifiedBy); + this._dataProvider.UpdateSettingRecordChangers("ModuleSettings", "ModuleID", moduleId, settingName, createdBy, modifiedBy); } private void UpdateTabUniqueId(int tabId, Guid uniqueId) { - _dataProvider.UpdateUniqueId("Tabs", "TabID", tabId, uniqueId); + this._dataProvider.UpdateUniqueId("Tabs", "TabID", tabId, uniqueId); } private void UpdateModuleUniqueId(int tabModuleId, Guid uniqueId) { - _dataProvider.UpdateUniqueId("TabModules", "TabModuleID", tabModuleId, uniqueId); + this._dataProvider.UpdateUniqueId("TabModules", "TabModuleID", tabModuleId, uniqueId); } @@ -1490,94 +1490,94 @@ private void UpdateModuleUniqueId(int tabModuleId, Guid uniqueId) private void ProcessExportPages() { - var selectedPages = _exportDto.Pages; - _totals = string.IsNullOrEmpty(CheckPoint.StageData) + var selectedPages = this._exportDto.Pages; + this._totals = string.IsNullOrEmpty(this.CheckPoint.StageData) ? new ProgressTotals() - : JsonConvert.DeserializeObject(CheckPoint.StageData); + : JsonConvert.DeserializeObject(this.CheckPoint.StageData); - var portalId = _exportImportJob.PortalId; + var portalId = this._exportImportJob.PortalId; - var toDate = _exportImportJob.CreatedOnDate.ToLocalTime(); - var fromDate = (_exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); + var toDate = this._exportImportJob.CreatedOnDate.ToLocalTime(); + var fromDate = (this._exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var isAllIncluded = selectedPages.Any(p => p.TabId == -1 && p.CheckedState == TriCheckedState.CheckedWithAllChildren); var allTabs = EntitiesController.Instance.GetPortalTabs(portalId, - _exportDto.IncludeDeletions, IncludeSystem, toDate, fromDate) // ordered by TabID + this._exportDto.IncludeDeletions, this.IncludeSystem, toDate, fromDate) // ordered by TabID .OrderBy(tab => tab.TabPath).ToArray(); //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? allTabs.Length : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? allTabs.Length : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; var progressStep = 100.0 / allTabs.Length; - CheckPoint.TotalItems = IncludeSystem || isAllIncluded + this.CheckPoint.TotalItems = this.IncludeSystem || isAllIncluded ? allTabs.Length : allTabs.Count(otherPg => IsTabIncluded(otherPg, allTabs, selectedPages)); //Note: We assume no new tabs were added while running; otherwise, some tabs might get skipped. for (var index = 0; index < allTabs.Length; index++) { - if (CheckCancelled(_exportImportJob)) break; + if (this.CheckCancelled(this._exportImportJob)) break; var otherPg = allTabs.ElementAt(index); - if (_totals.LastProcessedId > index) continue; + if (this._totals.LastProcessedId > index) continue; - if (IncludeSystem || isAllIncluded || IsTabIncluded(otherPg, allTabs, selectedPages)) + if (this.IncludeSystem || isAllIncluded || IsTabIncluded(otherPg, allTabs, selectedPages)) { - var tab = _tabController.GetTab(otherPg.TabID, portalId); + var tab = this._tabController.GetTab(otherPg.TabID, portalId); //Do not export tab which has never been published. if (tab.HasBeenPublished) { - var exportPage = SaveExportPage(tab); + var exportPage = this.SaveExportPage(tab); - _totals.TotalTabSettings += - ExportTabSettings(exportPage, toDate, fromDate); + this._totals.TotalTabSettings += + this.ExportTabSettings(exportPage, toDate, fromDate); - _totals.TotalTabPermissions += - ExportTabPermissions(exportPage, toDate, fromDate); + this._totals.TotalTabPermissions += + this.ExportTabPermissions(exportPage, toDate, fromDate); - _totals.TotalTabUrls += - ExportTabUrls(exportPage, toDate, fromDate); + this._totals.TotalTabUrls += + this.ExportTabUrls(exportPage, toDate, fromDate); - _totals.TotalModules += - ExportTabModulesAndRelatedItems(exportPage, toDate, fromDate); + this._totals.TotalModules += + this.ExportTabModulesAndRelatedItems(exportPage, toDate, fromDate); - _totals.TotalTabModules += - ExportTabModules(exportPage, _exportDto.IncludeDeletions, toDate, fromDate); + this._totals.TotalTabModules += + this.ExportTabModules(exportPage, this._exportDto.IncludeDeletions, toDate, fromDate); - _totals.TotalTabModuleSettings += - ExportTabModuleSettings(exportPage, _exportDto.IncludeDeletions, toDate, fromDate); - _totals.TotalTabs++; + this._totals.TotalTabModuleSettings += + this.ExportTabModuleSettings(exportPage, this._exportDto.IncludeDeletions, toDate, fromDate); + this._totals.TotalTabs++; } - _totals.LastProcessedId = index; + this._totals.LastProcessedId = index; } - CheckPoint.Progress += progressStep; - CheckPoint.ProcessedItems++; - CheckPoint.StageData = JsonConvert.SerializeObject(_totals); - if (CheckPointStageCallback(this)) break; + this.CheckPoint.Progress += progressStep; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.StageData = JsonConvert.SerializeObject(this._totals); + if (this.CheckPointStageCallback(this)) break; } - ReportExportTotals(); - UpdateTotalProcessedPackages(); + this.ReportExportTotals(); + this.UpdateTotalProcessedPackages(); } private int ExportTabSettings(ExportTab exportPage, DateTime toDate, DateTime? fromDate) { var tabSettings = EntitiesController.Instance.GetTabSettings(exportPage.TabId, toDate, fromDate); if (tabSettings.Count > 0) - Repository.CreateItems(tabSettings, exportPage.Id); + this.Repository.CreateItems(tabSettings, exportPage.Id); return tabSettings.Count; } private int ExportTabPermissions(ExportTab exportPage, DateTime toDate, DateTime? fromDate) { - if (!_exportDto.IncludePermissions) return 0; + if (!this._exportDto.IncludePermissions) return 0; var tabPermissions = EntitiesController.Instance.GetTabPermissions(exportPage.TabId, toDate, fromDate); if (tabPermissions.Count > 0) - Repository.CreateItems(tabPermissions, exportPage.Id); + this.Repository.CreateItems(tabPermissions, exportPage.Id); return tabPermissions.Count; } @@ -1585,7 +1585,7 @@ private int ExportTabUrls(ExportTab exportPage, DateTime toDate, DateTime? fromD { var tabUrls = EntitiesController.Instance.GetTabUrls(exportPage.TabId, toDate, fromDate); if (tabUrls.Count > 0) - Repository.CreateItems(tabUrls, exportPage.Id); + this.Repository.CreateItems(tabUrls, exportPage.Id); return tabUrls.Count; } @@ -1593,7 +1593,7 @@ private int ExportTabModules(ExportTab exportPage, bool includeDeleted, DateTime { var tabModules = EntitiesController.Instance.GetTabModules(exportPage.TabId, includeDeleted, toDate, fromDate); if (tabModules.Count > 0) - Repository.CreateItems(tabModules, exportPage.Id); + this.Repository.CreateItems(tabModules, exportPage.Id); return tabModules.Count; } @@ -1601,32 +1601,32 @@ private int ExportTabModuleSettings(ExportTab exportPage, bool includeDeleted, D { var tabModuleSettings = EntitiesController.Instance.GetTabModuleSettings(exportPage.TabId, includeDeleted, toDate, fromDate); if (tabModuleSettings.Count > 0) - Repository.CreateItems(tabModuleSettings, exportPage.Id); + this.Repository.CreateItems(tabModuleSettings, exportPage.Id); return tabModuleSettings.Count; } private int ExportTabModulesAndRelatedItems(ExportTab exportPage, DateTime toDate, DateTime? fromDate) { - var modules = EntitiesController.Instance.GetModules(exportPage.TabId, _exportDto.IncludeDeletions, toDate, fromDate); + var modules = EntitiesController.Instance.GetModules(exportPage.TabId, this._exportDto.IncludeDeletions, toDate, fromDate); if (modules.Count > 0) { - Repository.CreateItems(modules, exportPage.Id); + this.Repository.CreateItems(modules, exportPage.Id); foreach (var exportModule in modules) { - _totals.TotalModuleSettings += - ExportModuleSettings(exportModule, toDate, fromDate); + this._totals.TotalModuleSettings += + this.ExportModuleSettings(exportModule, toDate, fromDate); - _totals.TotalModulePermissions += - ExportModulePermissions(exportModule, toDate, fromDate); + this._totals.TotalModulePermissions += + this.ExportModulePermissions(exportModule, toDate, fromDate); - if (_exportDto.IncludeContent) + if (this._exportDto.IncludeContent) { - _totals.TotalContents += - ExportPortableContent(exportPage, exportModule, toDate, fromDate); + this._totals.TotalContents += + this.ExportPortableContent(exportPage, exportModule, toDate, fromDate); } - _totals.TotalPackages += - ExportModulePackage(exportModule); + this._totals.TotalPackages += + this.ExportModulePackage(exportModule); } } @@ -1635,9 +1635,9 @@ private int ExportTabModulesAndRelatedItems(ExportTab exportPage, DateTime toDat private int ExportModulePackage(ExportModule exportModule) { - if (!_exportedModuleDefinitions.Contains(exportModule.ModuleDefID) && _exportDto.IncludeExtensions) + if (!this._exportedModuleDefinitions.Contains(exportModule.ModuleDefID) && this._exportDto.IncludeExtensions) { - var packageZipFile = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{_exportImportJob.Directory.TrimEnd('\\', '/')}\\{Constants.ExportZipPackages}"; + var packageZipFile = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{this._exportImportJob.Directory.TrimEnd('\\', '/')}\\{Constants.ExportZipPackages}"; var moduleDefinition = ModuleDefinitionController.GetModuleDefinitionByID(exportModule.ModuleDefID); var desktopModuleId = moduleDefinition.DesktopModuleID; var desktopModule = DesktopModuleController.GetDesktopModule(desktopModuleId, Null.NullInteger); @@ -1651,7 +1651,7 @@ private int ExportModulePackage(ExportModule exportModule) var offset = Path.GetDirectoryName(filePath)?.Length + 1; CompressionUtil.AddFileToArchive(filePath, packageZipFile, offset.GetValueOrDefault(0)); - Repository.CreateItem(new ExportPackage + this.Repository.CreateItem(new ExportPackage { PackageName = package.Name, Version = package.Version, @@ -1659,7 +1659,7 @@ private int ExportModulePackage(ExportModule exportModule) PackageFileName = InstallerUtil.GetPackageBackupName(package) }, null); - _exportedModuleDefinitions.Add(exportModule.ModuleDefID); + this._exportedModuleDefinitions.Add(exportModule.ModuleDefID); return 1; } catch (Exception ex) @@ -1677,7 +1677,7 @@ private int ExportModuleSettings(ExportModule exportModule, DateTime toDate, Dat { var moduleSettings = EntitiesController.Instance.GetModuleSettings(exportModule.ModuleID, toDate, fromDate); if (moduleSettings.Count > 0) - Repository.CreateItems(moduleSettings, exportModule.Id); + this.Repository.CreateItems(moduleSettings, exportModule.Id); return moduleSettings.Count; } @@ -1685,7 +1685,7 @@ private int ExportModulePermissions(ExportModule exportModule, DateTime toDate, { var modulePermission = EntitiesController.Instance.GetModulePermissions(exportModule.ModuleID, toDate, fromDate); if (modulePermission.Count > 0) - Repository.CreateItems(modulePermission, exportModule.Id); + this.Repository.CreateItems(modulePermission, exportModule.Id); return modulePermission.Count; } @@ -1695,16 +1695,16 @@ private int ExportPortableContent(ExportTab exportPage, ExportModule exportModul // ReSharper enable UnusedParameter.Local { // check if module's contnt was exported before - var existingItems = Repository.FindItems(m => m.ModuleID == exportModule.ModuleID); + var existingItems = this.Repository.FindItems(m => m.ModuleID == exportModule.ModuleID); if (!existingItems.Any()) { var moduleDef = ModuleDefinitionController.GetModuleDefinitionByID(exportModule.ModuleDefID); - var desktopModuleInfo = DesktopModuleController.GetDesktopModule(moduleDef.DesktopModuleID, _exportDto.PortalId); + var desktopModuleInfo = DesktopModuleController.GetDesktopModule(moduleDef.DesktopModuleID, this._exportDto.PortalId); if (!string.IsNullOrEmpty(desktopModuleInfo?.BusinessControllerClass)) { try { - var module = _moduleController.GetModule(exportModule.ModuleID, exportPage.TabId, true); + var module = this._moduleController.GetModule(exportModule.ModuleID, exportPage.TabId, true); if (!string.IsNullOrEmpty(module.DesktopModule.BusinessControllerClass) && module.DesktopModule.IsPortable) { try @@ -1722,19 +1722,19 @@ private int ExportPortableContent(ExportTab exportPage, ExportModule exportModul XmlContent = content, }; - Repository.CreateItem(record, exportModule.Id); + this.Repository.CreateItem(record, exportModule.Id); return 1; } } catch (Exception e) { - Result.AddLogEntry("Error exporting module data, Module ID=" + exportModule.ModuleID, e.Message, ReportLevel.Error); + this.Result.AddLogEntry("Error exporting module data, Module ID=" + exportModule.ModuleID, e.Message, ReportLevel.Error); } } } catch (Exception ex) { - Result.AddLogEntry("Error cerating business class type", desktopModuleInfo.BusinessControllerClass, ReportLevel.Error); + this.Result.AddLogEntry("Error cerating business class type", desktopModuleInfo.BusinessControllerClass, ReportLevel.Error); Logger.Error("Error cerating business class type. " + ex); } } @@ -1785,8 +1785,8 @@ private ExportTab SaveExportPage(TabInfo tab) IsSystem = tab.IsSystem, StateID = tab.StateID }; - Repository.CreateItem(exportPage, null); - Result.AddLogEntry("Exported page", tab.TabName + " (" + tab.TabPath + ")"); + this.Repository.CreateItem(exportPage, null); + this.Result.AddLogEntry("Exported page", tab.TabName + " (" + tab.TabPath + ")"); return exportPage; } @@ -1844,45 +1844,45 @@ public static void ResetContentsFlag(ExportImportRepository repository) private void ReportExportTotals() { - ReportTotals("Exported"); + this.ReportTotals("Exported"); } private void ReportImportTotals() { - ReportTotals("Imported"); + this.ReportTotals("Imported"); } private void ReportTotals(string prefix) { - Result.AddSummary(prefix + " Tabs", _totals.TotalTabs.ToString()); - Result.AddLogEntry(prefix + " Tab Settings", _totals.TotalTabSettings.ToString()); - Result.AddLogEntry(prefix + " Tab Permissions", _totals.TotalTabPermissions.ToString()); - Result.AddLogEntry(prefix + " Tab Urls", _totals.TotalTabUrls.ToString()); - Result.AddLogEntry(prefix + " Modules", _totals.TotalModules.ToString()); - Result.AddLogEntry(prefix + " Module Settings", _totals.TotalModuleSettings.ToString()); - Result.AddLogEntry(prefix + " Module Permissions", _totals.TotalModulePermissions.ToString()); - Result.AddLogEntry(prefix + " Tab Modules", _totals.TotalTabModules.ToString()); - Result.AddLogEntry(prefix + " Tab Module Settings", _totals.TotalTabModuleSettings.ToString()); - Result.AddLogEntry(prefix + " Module Packages", _totals.TotalPackages.ToString()); + this.Result.AddSummary(prefix + " Tabs", this._totals.TotalTabs.ToString()); + this.Result.AddLogEntry(prefix + " Tab Settings", this._totals.TotalTabSettings.ToString()); + this.Result.AddLogEntry(prefix + " Tab Permissions", this._totals.TotalTabPermissions.ToString()); + this.Result.AddLogEntry(prefix + " Tab Urls", this._totals.TotalTabUrls.ToString()); + this.Result.AddLogEntry(prefix + " Modules", this._totals.TotalModules.ToString()); + this.Result.AddLogEntry(prefix + " Module Settings", this._totals.TotalModuleSettings.ToString()); + this.Result.AddLogEntry(prefix + " Module Permissions", this._totals.TotalModulePermissions.ToString()); + this.Result.AddLogEntry(prefix + " Tab Modules", this._totals.TotalTabModules.ToString()); + this.Result.AddLogEntry(prefix + " Tab Module Settings", this._totals.TotalTabModuleSettings.ToString()); + this.Result.AddLogEntry(prefix + " Module Packages", this._totals.TotalPackages.ToString()); } private void UpdateTotalProcessedPackages() { //HACK: get skin packages checkpoint and add "_totals.TotalPackages" to it - var packagesCheckpoint = EntitiesController.Instance.GetJobChekpoints(_exportImportJob.JobId).FirstOrDefault( + var packagesCheckpoint = EntitiesController.Instance.GetJobChekpoints(this._exportImportJob.JobId).FirstOrDefault( cp => cp.Category == Constants.Category_Packages); if (packagesCheckpoint != null) { //Note: if restart of job occurs, these will report wrong values - packagesCheckpoint.TotalItems += _totals.TotalPackages; - packagesCheckpoint.ProcessedItems += _totals.TotalPackages; + packagesCheckpoint.TotalItems += this._totals.TotalPackages; + packagesCheckpoint.ProcessedItems += this._totals.TotalPackages; EntitiesController.Instance.UpdateJobChekpoint(packagesCheckpoint); } } private int GetLocalStateId(int exportedStateId) { - var exportWorkflowState = Repository.GetItem(item => item.StateID == exportedStateId); + var exportWorkflowState = this.Repository.GetItem(item => item.StateID == exportedStateId); var stateId = exportWorkflowState?.LocalId ?? Null.NullInteger; if (stateId <= 0) return stateId; var state = WorkflowStateManager.Instance.GetWorkflowState(stateId); @@ -1914,7 +1914,7 @@ private bool IsParentTabPresentInExport(ExportTab exportedTab, IList { if (parentId != -1) { - if (IsParentAlreadyCheck(parentId)) + if (this.IsParentAlreadyCheck(parentId)) { return true; } @@ -1926,8 +1926,8 @@ private bool IsParentTabPresentInExport(ExportTab exportedTab, IList var parentFound = exportedTabs.FirstOrDefault(t => t.TabId == parentId); if (parentFound != null) { - AddToParentSearched(parentFound.TabId, true); - isParentPresent = IsParentTabPresentInExport(parentFound, exportedTabs, localTabs); + this.AddToParentSearched(parentFound.TabId, true); + isParentPresent = this.IsParentTabPresentInExport(parentFound, exportedTabs, localTabs); return isParentPresent; } else @@ -1943,7 +1943,7 @@ private bool IsParentTabPresentInExport(ExportTab exportedTab, IList if (isTabUrlParsed) { - if (IsParentAlreadyCheck(parentIdUrl)) + if (this.IsParentAlreadyCheck(parentIdUrl)) { return true; } @@ -1955,8 +1955,8 @@ private bool IsParentTabPresentInExport(ExportTab exportedTab, IList var parentFound = exportedTabs.FirstOrDefault(t => t.TabId == parentIdUrl); if (parentFound != null) { - AddToParentSearched(parentFound.TabId, false); - isParentPresent = IsParentTabPresentInExport(parentFound, exportedTabs, localTabs); + this.AddToParentSearched(parentFound.TabId, false); + isParentPresent = this.IsParentTabPresentInExport(parentFound, exportedTabs, localTabs); } else { @@ -1970,27 +1970,27 @@ private bool IsParentTabPresentInExport(ExportTab exportedTab, IList private bool IsParentAlreadyCheck(int parentId) { - return _searchedParentTabs.ContainsKey(parentId); + return this._searchedParentTabs.ContainsKey(parentId); } private void AddToParentSearched(int tabId, bool isParentId) { - if (!_searchedParentTabs.ContainsKey(tabId)) + if (!this._searchedParentTabs.ContainsKey(tabId)) { - _searchedParentTabs.Add(tabId, isParentId); + this._searchedParentTabs.Add(tabId, isParentId); } } private void UpdateParentInPartialImportTabs(TabInfo localTab, ExportTab parentExportedTab, int portalId, IList exportTabs, IList localTabs) { - if (!_searchedParentTabs.ContainsKey(parentExportedTab.TabId)) + if (!this._searchedParentTabs.ContainsKey(parentExportedTab.TabId)) { return; } var parentId = parentExportedTab.TabId; - var tabsToUpdateGuids = _partialImportedTabs.Where(t => t.Value == parentId).ToList(); + var tabsToUpdateGuids = this._partialImportedTabs.Where(t => t.Value == parentId).ToList(); foreach (var tabGuid in tabsToUpdateGuids) { @@ -1998,11 +1998,11 @@ private void UpdateParentInPartialImportTabs(TabInfo localTab, ExportTab parentE if (localTabToUpdate != null) { - var tabWithoutParentId = _tabController.GetTab(localTabToUpdate.TabID, portalId); + var tabWithoutParentId = this._tabController.GetTab(localTabToUpdate.TabID, portalId); if (tabWithoutParentId != null) { - if (_searchedParentTabs[parentExportedTab.TabId]) + if (this._searchedParentTabs[parentExportedTab.TabId]) { tabWithoutParentId.ParentId = localTab.TabID; @@ -2017,8 +2017,8 @@ private void UpdateParentInPartialImportTabs(TabInfo localTab, ExportTab parentE tabWithoutParentId.Url = localTab.TabID.ToString(); } - _tabController.UpdateTab(tabWithoutParentId); - _partialImportedTabs.Remove(tabGuid.Key); + this._tabController.UpdateTab(tabWithoutParentId); + this._partialImportedTabs.Remove(tabGuid.Key); } } } @@ -2026,7 +2026,7 @@ private void UpdateParentInPartialImportTabs(TabInfo localTab, ExportTab parentE private void SetPartialImportSettings(ExportTab exportedTab, TabInfo localTab) { - if (exportedTab.LocalId != null && _partialImportedTabs.ContainsKey(exportedTab.LocalId.GetValueOrDefault(Null.NullInteger)) && (exportedTab.ParentId.GetValueOrDefault(Null.NullInteger) != -1)) + if (exportedTab.LocalId != null && this._partialImportedTabs.ContainsKey(exportedTab.LocalId.GetValueOrDefault(Null.NullInteger)) && (exportedTab.ParentId.GetValueOrDefault(Null.NullInteger) != -1)) { localTab.ParentId = -1; localTab.IsVisible = false; @@ -2041,20 +2041,20 @@ private void CheckForPartialImportedTabs(ExportTab tabToExport) { if (int.TryParse(tabToExport.Url, out exportTabParentId)) { - AddToPartialImportedTabs(tabToExport.LocalId.GetValueOrDefault(Null.NullInteger), exportTabParentId); + this.AddToPartialImportedTabs(tabToExport.LocalId.GetValueOrDefault(Null.NullInteger), exportTabParentId); } } else { - AddToPartialImportedTabs(tabToExport.LocalId.GetValueOrDefault(Null.NullInteger), exportTabParentId); + this.AddToPartialImportedTabs(tabToExport.LocalId.GetValueOrDefault(Null.NullInteger), exportTabParentId); } } private void AddToPartialImportedTabs(int localTabId, int exportTabParentId) { - if (!_partialImportedTabs.ContainsKey(localTabId) && exportTabParentId != -1) + if (!this._partialImportedTabs.ContainsKey(localTabId) && exportTabParentId != -1) { - _partialImportedTabs.Add(localTabId, exportTabParentId); + this._partialImportedTabs.Add(localTabId, exportTabParentId); } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/PortalExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/PortalExportService.cs index cb3a7762d9a..e59c7365e72 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/PortalExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/PortalExportService.cs @@ -32,10 +32,10 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); - if (CheckPoint.Stage > 1) return; - if (CheckCancelled(exportJob)) return; + if (this.CheckPoint.Stage > 1) return; + if (this.CheckCancelled(exportJob)) return; List portalLanguages = null; - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { var portalSettings = new List(); var settingToMigrate = @@ -50,70 +50,70 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) portalSettings.Where(x => settingToMigrate.Any(setting => setting.Trim().Equals(x.SettingName, StringComparison.InvariantCultureIgnoreCase))).ToList(); //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? portalSettings.Count : CheckPoint.TotalItems; - if (CheckPoint.TotalItems == portalSettings.Count) + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? portalSettings.Count : this.CheckPoint.TotalItems; + if (this.CheckPoint.TotalItems == portalSettings.Count) { portalLanguages = CBO.FillCollection( DataProvider.Instance().GetPortalLanguages(exportJob.PortalId, toDate, fromDate)); - CheckPoint.TotalItems += portalLanguages.Count; + this.CheckPoint.TotalItems += portalLanguages.Count; } - CheckPointStageCallback(this); + this.CheckPointStageCallback(this); - Repository.CreateItems(portalSettings); + this.Repository.CreateItems(portalSettings); } - Result.AddSummary("Exported Portal Settings", portalSettings.Count.ToString()); + this.Result.AddSummary("Exported Portal Settings", portalSettings.Count.ToString()); - CheckPoint.Progress = 50; - CheckPoint.ProcessedItems = portalSettings.Count; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.Progress = 50; + this.CheckPoint.ProcessedItems = portalSettings.Count; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; } - if (CheckPoint.Stage == 1) + if (this.CheckPoint.Stage == 1) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; if (portalLanguages == null) portalLanguages = CBO.FillCollection(DataProvider.Instance() .GetPortalLanguages(exportJob.PortalId, toDate, fromDate)); - Repository.CreateItems(portalLanguages); - Result.AddSummary("Exported Portal Languages", portalLanguages.Count.ToString()); - CheckPoint.Progress = 100; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPoint.ProcessedItems += portalLanguages.Count; - CheckPointStageCallback(this); + this.Repository.CreateItems(portalLanguages); + this.Result.AddSummary("Exported Portal Languages", portalLanguages.Count.ToString()); + this.CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.ProcessedItems += portalLanguages.Count; + this.CheckPointStageCallback(this); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? GetImportTotal() : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; - if (CheckPoint.Stage > 1) return; - if (CheckPoint.Stage == 0) + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? this.GetImportTotal() : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; + if (this.CheckPoint.Stage > 1) return; + if (this.CheckPoint.Stage == 0) { - var portalSettings = Repository.GetAllItems().ToList(); - ProcessPortalSettings(importJob, importDto, portalSettings); - CheckPoint.TotalItems = GetImportTotal(); - Result.AddSummary("Imported Portal Settings", portalSettings.Count.ToString()); - CheckPoint.Progress += 50; - CheckPoint.Stage++; - CheckPoint.ProcessedItems = portalSettings.Count; - if (CheckPointStageCallback(this)) return; + var portalSettings = this.Repository.GetAllItems().ToList(); + this.ProcessPortalSettings(importJob, importDto, portalSettings); + this.CheckPoint.TotalItems = this.GetImportTotal(); + this.Result.AddSummary("Imported Portal Settings", portalSettings.Count.ToString()); + this.CheckPoint.Progress += 50; + this.CheckPoint.Stage++; + this.CheckPoint.ProcessedItems = portalSettings.Count; + if (this.CheckPointStageCallback(this)) return; } - if (CheckPoint.Stage == 1) + if (this.CheckPoint.Stage == 1) { - var portalLanguages = Repository.GetAllItems().ToList(); - ProcessPortalLanguages(importJob, importDto, portalLanguages); - Result.AddSummary("Imported Portal Languages", portalLanguages.Count.ToString()); - CheckPoint.Progress += 50; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPoint.ProcessedItems += portalLanguages.Count; - CheckPointStageCallback(this); + var portalLanguages = this.Repository.GetAllItems().ToList(); + this.ProcessPortalLanguages(importJob, importDto, portalLanguages); + this.Result.AddSummary("Imported Portal Languages", portalLanguages.Count.ToString()); + this.CheckPoint.Progress += 50; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.ProcessedItems += portalLanguages.Count; + this.CheckPointStageCallback(this); } /* ProgressPercentage = 0; @@ -126,7 +126,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) public override int GetImportTotal() { - return Repository.GetCount() + Repository.GetCount(); + return this.Repository.GetCount() + this.Repository.GetCount(); } private void ProcessPortalSettings(ExportImportJob importJob, ImportDto importDto, @@ -137,7 +137,7 @@ private void ProcessPortalSettings(ExportImportJob importJob, ImportDto importDt CBO.FillCollection(DataProvider.Instance().GetPortalSettings(portalId, DateUtils.GetDatabaseUtcTime().AddYears(1), null)); foreach (var exportPortalSetting in portalSettings) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var existingPortalSetting = localPortalSettings.FirstOrDefault( @@ -155,7 +155,7 @@ private void ProcessPortalSettings(ExportImportJob importJob, ImportDto importDt isUpdate = true; break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored portal settings", exportPortalSetting.SettingName); + this.Result.AddLogEntry("Ignored portal settings", exportPortalSetting.SettingName); continue; default: throw new ArgumentOutOfRangeException(importDto.CollisionResolution.ToString()); @@ -170,7 +170,7 @@ private void ProcessPortalSettings(ExportImportJob importJob, ImportDto importDt DotNetNuke.Data.DataProvider.Instance() .UpdatePortalSetting(importJob.PortalId, exportPortalSetting.SettingName, exportPortalSetting.SettingValue, modifiedBy, exportPortalSetting.CultureCode, exportPortalSetting.IsSecure); - Result.AddLogEntry("Updated portal settings", exportPortalSetting.SettingName); + this.Result.AddLogEntry("Updated portal settings", exportPortalSetting.SettingName); } else { @@ -180,7 +180,7 @@ private void ProcessPortalSettings(ExportImportJob importJob, ImportDto importDt .UpdatePortalSetting(importJob.PortalId, exportPortalSetting.SettingName, exportPortalSetting.SettingValue, createdBy, exportPortalSetting.CultureCode, exportPortalSetting.IsSecure); - Result.AddLogEntry("Added portal settings", exportPortalSetting.SettingName); + this.Result.AddLogEntry("Added portal settings", exportPortalSetting.SettingName); } } } @@ -194,7 +194,7 @@ private void ProcessPortalLanguages(ExportImportJob importJob, ImportDto importD var localLanguages = CBO.FillCollection(DotNetNuke.Data.DataProvider.Instance().GetLanguages()); foreach (var exportPortalLanguage in portalLanguages) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var createdBy = Util.GetUserIdByName(importJob, exportPortalLanguage.CreatedByUserId, exportPortalLanguage.CreatedByUserName); var modifiedBy = Util.GetUserIdByName(importJob, exportPortalLanguage.LastModifiedByUserId, exportPortalLanguage.LastModifiedByUserName); @@ -225,7 +225,7 @@ private void ProcessPortalLanguages(ExportImportJob importJob, ImportDto importD isUpdate = true; break; case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored portal language", exportPortalLanguage.CultureCode); + this.Result.AddLogEntry("Ignored portal language", exportPortalLanguage.CultureCode); continue; default: throw new ArgumentOutOfRangeException(importDto.CollisionResolution.ToString()); @@ -237,14 +237,14 @@ private void ProcessPortalLanguages(ExportImportJob importJob, ImportDto importD .UpdatePortalLanguage(importJob.PortalId, localLanguageId.GetValueOrDefault(exportPortalLanguage.LanguageId), exportPortalLanguage.IsPublished, modifiedBy); - Result.AddLogEntry("Updated portal language", exportPortalLanguage.CultureCode); + this.Result.AddLogEntry("Updated portal language", exportPortalLanguage.CultureCode); } else { exportPortalLanguage.PortalLanguageId = DotNetNuke.Data.DataProvider.Instance() .AddPortalLanguage(importJob.PortalId, localLanguageId.GetValueOrDefault(exportPortalLanguage.LanguageId), exportPortalLanguage.IsPublished, createdBy); - Result.AddLogEntry("Added portal language", exportPortalLanguage.CultureCode); + this.Result.AddLogEntry("Added portal language", exportPortalLanguage.CultureCode); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/ProfilePropertiesService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/ProfilePropertiesService.cs index 76316b321ad..d4c465a3470 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/ProfilePropertiesService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/ProfilePropertiesService.cs @@ -25,41 +25,41 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); - if (CheckCancelled(exportJob)) return; - if (CheckPoint.Stage > 0) return; - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; + if (this.CheckPoint.Stage > 0) return; + if (this.CheckCancelled(exportJob)) return; var profileProperties = CBO.FillCollection( DataProvider.Instance() .GetPropertyDefinitionsByPortal(exportJob.PortalId, exportDto.IncludeDeletions, toDate, fromDate)).ToList(); - CheckPoint.Progress = 50; + this.CheckPoint.Progress = 50; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? profileProperties.Count : CheckPoint.TotalItems; - CheckPointStageCallback(this); + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? profileProperties.Count : this.CheckPoint.TotalItems; + this.CheckPointStageCallback(this); - if (CheckCancelled(exportJob)) return; - Repository.CreateItems(profileProperties); - Result.AddSummary("Exported Profile Properties", profileProperties.Count.ToString()); - CheckPoint.Progress = 100; - CheckPoint.ProcessedItems = profileProperties.Count; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPointStageCallback(this); + if (this.CheckCancelled(exportJob)) return; + this.Repository.CreateItems(profileProperties); + this.Result.AddSummary("Exported Profile Properties", profileProperties.Count.ToString()); + this.CheckPoint.Progress = 100; + this.CheckPoint.ProcessedItems = profileProperties.Count; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPointStageCallback(this); } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckPoint.Stage > 0) return; - var profileProperties = Repository.GetAllItems().ToList(); + if (this.CheckPoint.Stage > 0) return; + var profileProperties = this.Repository.GetAllItems().ToList(); //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? profileProperties.Count : CheckPoint.TotalItems; - CheckPointStageCallback(this); + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? profileProperties.Count : this.CheckPoint.TotalItems; + this.CheckPointStageCallback(this); foreach (var profileProperty in profileProperties) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var existingProfileProperty = CBO.FillObject(DotNetNuke.Data.DataProvider.Instance() .GetPropertyDefinitionByName(importJob.PortalId, profileProperty.PropertyName)); @@ -87,17 +87,17 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) } } - Result.AddSummary("Imported Profile Properties", profileProperties.Count.ToString()); - CheckPoint.ProcessedItems = profileProperties.Count; - CheckPoint.Completed = true; - CheckPoint.Progress = 100; - CheckPoint.Stage++; - CheckPointStageCallback(this); + this.Result.AddSummary("Imported Profile Properties", profileProperties.Count.ToString()); + this.CheckPoint.ProcessedItems = profileProperties.Count; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; + this.CheckPoint.Stage++; + this.CheckPointStageCallback(this); } public override int GetImportTotal() { - return Repository.GetCount(); + return this.Repository.GetCount(); } private static void ProcessCreateProfileProperty(ExportImportJob importJob, diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/RolesExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/RolesExportService.cs index 028e51d474a..15d8be0dc1b 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/RolesExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/RolesExportService.cs @@ -27,119 +27,119 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); - if (CheckPoint.Stage > 2) return; + if (this.CheckPoint.Stage > 2) return; List roles = null; List roleSettings = null; - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; var roleGroups = CBO.FillCollection( DataProvider.Instance().GetAllRoleGroups(exportJob.PortalId, toDate, fromDate)); //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? roleGroups.Count : CheckPoint.TotalItems; - if (CheckPoint.TotalItems == roleGroups.Count) + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? roleGroups.Count : this.CheckPoint.TotalItems; + if (this.CheckPoint.TotalItems == roleGroups.Count) { roles = CBO.FillCollection( DataProvider.Instance().GetAllRoles(exportJob.PortalId, toDate, fromDate)); roleSettings = CBO.FillCollection( DataProvider.Instance().GetAllRoleSettings(exportJob.PortalId, toDate, fromDate)); - CheckPoint.TotalItems += roles.Count + roleSettings.Count; + this.CheckPoint.TotalItems += roles.Count + roleSettings.Count; } - CheckPointStageCallback(this); - - Repository.CreateItems(roleGroups); - Result.AddSummary("Exported Role Groups", roleGroups.Count.ToString()); - CheckPoint.ProcessedItems = roleGroups.Count; - CheckPoint.Progress = 30; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.CheckPointStageCallback(this); + + this.Repository.CreateItems(roleGroups); + this.Result.AddSummary("Exported Role Groups", roleGroups.Count.ToString()); + this.CheckPoint.ProcessedItems = roleGroups.Count; + this.CheckPoint.Progress = 30; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; } - if (CheckPoint.Stage == 1) + if (this.CheckPoint.Stage == 1) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; if (roles == null) roles = CBO.FillCollection( DataProvider.Instance().GetAllRoles(exportJob.PortalId, toDate, fromDate)); - Repository.CreateItems(roles); - Result.AddSummary("Exported Roles", roles.Count.ToString()); - CheckPoint.Progress = 80; - CheckPoint.ProcessedItems += roles.Count; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.Repository.CreateItems(roles); + this.Result.AddSummary("Exported Roles", roles.Count.ToString()); + this.CheckPoint.Progress = 80; + this.CheckPoint.ProcessedItems += roles.Count; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; } - if (CheckPoint.Stage == 2) + if (this.CheckPoint.Stage == 2) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; if (roleSettings == null) roleSettings = CBO.FillCollection( DataProvider.Instance().GetAllRoleSettings(exportJob.PortalId, toDate, fromDate)); - Repository.CreateItems(roleSettings); - Result.AddSummary("Exported Role Settings", roleSettings.Count.ToString()); - CheckPoint.Progress = 100; - CheckPoint.ProcessedItems += roleSettings.Count; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPointStageCallback(this); + this.Repository.CreateItems(roleSettings); + this.Result.AddSummary("Exported Role Settings", roleSettings.Count.ToString()); + this.CheckPoint.Progress = 100; + this.CheckPoint.ProcessedItems += roleSettings.Count; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPointStageCallback(this); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckPoint.Stage > 2) return; + if (this.CheckPoint.Stage > 2) return; - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? GetImportTotal() : CheckPoint.TotalItems; - CheckPointStageCallback(this); + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? this.GetImportTotal() : this.CheckPoint.TotalItems; + this.CheckPointStageCallback(this); - var otherRoleGroups = Repository.GetAllItems().ToList(); - if (CheckPoint.Stage == 0) + var otherRoleGroups = this.Repository.GetAllItems().ToList(); + if (this.CheckPoint.Stage == 0) { - ProcessRoleGroups(importJob, importDto, otherRoleGroups); - Repository.UpdateItems(otherRoleGroups); - Result.AddSummary("Imported Role Groups", otherRoleGroups.Count.ToString()); - CheckPoint.Progress = 40; - CheckPoint.ProcessedItems = otherRoleGroups.Count; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.ProcessRoleGroups(importJob, importDto, otherRoleGroups); + this.Repository.UpdateItems(otherRoleGroups); + this.Result.AddSummary("Imported Role Groups", otherRoleGroups.Count.ToString()); + this.CheckPoint.Progress = 40; + this.CheckPoint.ProcessedItems = otherRoleGroups.Count; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; } - if (CheckCancelled(importJob)) return; - var otherRoles = Repository.GetAllItems().ToList(); - if (CheckPoint.Stage == 1) + if (this.CheckCancelled(importJob)) return; + var otherRoles = this.Repository.GetAllItems().ToList(); + if (this.CheckPoint.Stage == 1) { - Result.AddSummary("Imported Roles", otherRoles.Count.ToString()); - ProcessRoles(importJob, importDto, otherRoleGroups, otherRoles); - Repository.UpdateItems(otherRoles); - CheckPoint.Progress = 50; - CheckPoint.ProcessedItems += otherRoles.Count; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.Result.AddSummary("Imported Roles", otherRoles.Count.ToString()); + this.ProcessRoles(importJob, importDto, otherRoleGroups, otherRoles); + this.Repository.UpdateItems(otherRoles); + this.CheckPoint.Progress = 50; + this.CheckPoint.ProcessedItems += otherRoles.Count; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; } - if (CheckPoint.Stage == 2) + if (this.CheckPoint.Stage == 2) { - if (CheckCancelled(importJob)) return; - var otherRoleSettings = Repository.GetAllItems().ToList(); - ProcessRoleSettings(importJob, importDto, otherRoles, otherRoleSettings); - Repository.UpdateItems(otherRoleSettings); - Result.AddSummary("Imported Role Settings", otherRoleSettings.Count.ToString()); - CheckPoint.Progress = 100; - CheckPoint.ProcessedItems += otherRoleSettings.Count; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPointStageCallback(this); + if (this.CheckCancelled(importJob)) return; + var otherRoleSettings = this.Repository.GetAllItems().ToList(); + this.ProcessRoleSettings(importJob, importDto, otherRoles, otherRoleSettings); + this.Repository.UpdateItems(otherRoleSettings); + this.Result.AddSummary("Imported Role Settings", otherRoleSettings.Count.ToString()); + this.CheckPoint.Progress = 100; + this.CheckPoint.ProcessedItems += otherRoleSettings.Count; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPointStageCallback(this); } } public override int GetImportTotal() { - return Repository.GetCount() + Repository.GetCount() + - Repository.GetCount(); + return this.Repository.GetCount() + this.Repository.GetCount() + + this.Repository.GetCount(); } private void ProcessRoleGroups(ExportImportJob importJob, ImportDto importDto, @@ -150,7 +150,7 @@ private void ProcessRoleGroups(ExportImportJob importJob, ImportDto importDto, var localRoleGroups = CBO.FillCollection(DataProvider.Instance().GetAllRoleGroups(portalId, DateUtils.GetDatabaseUtcTime().AddYears(1), null)); foreach (var other in otherRoleGroups) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var createdBy = Util.GetUserIdByName(importJob, other.CreatedByUserID, other.CreatedByUserName); var modifiedBy = Util.GetUserIdByName(importJob, other.LastModifiedByUserID, other.LastModifiedByUserName); var local = localRoleGroups.FirstOrDefault(t => t.RoleGroupName == other.RoleGroupName); @@ -161,7 +161,7 @@ private void ProcessRoleGroups(ExportImportJob importJob, ImportDto importDto, switch (importDto.CollisionResolution) { case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored role group", other.RoleGroupName); + this.Result.AddLogEntry("Ignored role group", other.RoleGroupName); break; case CollisionResolution.Overwrite: var roleGroup = new RoleGroupInfo(local.RoleGroupID, portalId, false) @@ -172,7 +172,7 @@ private void ProcessRoleGroups(ExportImportJob importJob, ImportDto importDto, RoleController.UpdateRoleGroup(roleGroup, false); changedGroups.Add(new RoleGroupItem(roleGroup.RoleGroupID, createdBy, modifiedBy)); DataCache.ClearCache(string.Format(DataCache.RoleGroupsCacheKey, local.RoleGroupID)); - Result.AddLogEntry("Updated role group", other.RoleGroupName); + this.Result.AddLogEntry("Updated role group", other.RoleGroupName); break; default: throw new ArgumentOutOfRangeException(importDto.CollisionResolution.ToString()); @@ -188,7 +188,7 @@ private void ProcessRoleGroups(ExportImportJob importJob, ImportDto importDto, }; other.LocalId = RoleController.AddRoleGroup(roleGroup); changedGroups.Add(new RoleGroupItem(roleGroup.RoleGroupID, createdBy, modifiedBy)); - Result.AddLogEntry("Added role group", other.RoleGroupName); + this.Result.AddLogEntry("Added role group", other.RoleGroupName); } } if (changedGroups.Count > 0) @@ -202,7 +202,7 @@ private void ProcessRoles(ExportImportJob importJob, ImportDto importDto, var portalId = importJob.PortalId; foreach (var other in otherRoles) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var createdBy = Util.GetUserIdByName(importJob, other.CreatedByUserID, other.CreatedByUserName); var modifiedBy = Util.GetUserIdByName(importJob, other.LastModifiedByUserID, other.LastModifiedByUserName); var localRoleInfo = RoleController.Instance.GetRoleByName(portalId, other.RoleName); @@ -212,7 +212,7 @@ private void ProcessRoles(ExportImportJob importJob, ImportDto importDto, switch (importDto.CollisionResolution) { case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored role", other.RoleName); + this.Result.AddLogEntry("Ignored role", other.RoleName); break; case CollisionResolution.Overwrite: var group = other.RoleGroupID.HasValue @@ -244,7 +244,7 @@ private void ProcessRoles(ExportImportJob importJob, ImportDto importDto, DataProvider.Instance().SetRoleAutoAssign(localRoleInfo.RoleID); RoleController.Instance.ClearRoleCache(localRoleInfo.RoleID); - Result.AddLogEntry("Updated role", other.RoleName); + this.Result.AddLogEntry("Updated role", other.RoleName); break; default: throw new ArgumentOutOfRangeException(importDto.CollisionResolution.ToString()); @@ -281,7 +281,7 @@ private void ProcessRoles(ExportImportJob importJob, ImportDto importDto, other.LocalId = RoleController.Instance.AddRole(roleInfo, false); roleItems.Add(new RoleItem(roleInfo.RoleID, createdBy, modifiedBy)); RoleController.Instance.ClearRoleCache(roleInfo.RoleID); - Result.AddLogEntry("Added role", other.RoleName); + this.Result.AddLogEntry("Added role", other.RoleName); } } @@ -297,7 +297,7 @@ private void ProcessRoleSettings(ExportImportJob importJob, ImportDto importDto, var portalId = importJob.PortalId; foreach (var other in otherRoleSettings) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var createdBy = Util.GetUserIdByName(importJob, other.CreatedByUserID, other.CreatedByUserName); var modifiedBy = Util.GetUserIdByName(importJob, other.LastModifiedByUserID, other.LastModifiedByUserName); var otherRole = otherRoles.FirstOrDefault(r => r.RoleID == other.RoleID); @@ -308,7 +308,7 @@ private void ProcessRoleSettings(ExportImportJob importJob, ImportDto importDto, switch (importDto.CollisionResolution) { case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored role setting", other.SettingName); + this.Result.AddLogEntry("Ignored role setting", other.SettingName); break; case CollisionResolution.Overwrite: string settingValue; @@ -318,12 +318,12 @@ private void ProcessRoleSettings(ExportImportJob importJob, ImportDto importDto, changedSettings.Add(new SettingItem(localRoleInfo.RoleID, other.SettingName, createdBy, modifiedBy)); localRoleInfo.Settings[other.SettingName] = other.SettingValue; RoleController.Instance.UpdateRoleSettings(localRoleInfo, false); - Result.AddLogEntry("Updated role setting", other.SettingName); + this.Result.AddLogEntry("Updated role setting", other.SettingName); //No need to clear cache as the caller will do it one time at end } else { - Result.AddLogEntry("Ignored role setting", other.SettingName); + this.Result.AddLogEntry("Ignored role setting", other.SettingName); } break; default: @@ -376,9 +376,9 @@ private struct RoleGroupItem public RoleGroupItem(int roleGroupId, int createdBy, int modifiedBy) { - RoleGroupId = roleGroupId; - CreatedBy = createdBy; - ModifiedBy = modifiedBy; + this.RoleGroupId = roleGroupId; + this.CreatedBy = createdBy; + this.ModifiedBy = modifiedBy; } } @@ -390,9 +390,9 @@ private struct RoleItem public RoleItem(int roleId, int createdBy, int modifiedBy) { - RoleId = roleId; - CreatedBy = createdBy; - ModifiedBy = modifiedBy; + this.RoleId = roleId; + this.CreatedBy = createdBy; + this.ModifiedBy = modifiedBy; } } @@ -405,10 +405,10 @@ private struct SettingItem public SettingItem(int roleId, string settingName, int createdBy, int modifiedBy) { - RoleId = roleId; - Name = settingName; - CreatedBy = createdBy; - ModifiedBy = modifiedBy; + this.RoleId = roleId; + this.Name = settingName; + this.CreatedBy = createdBy; + this.ModifiedBy = modifiedBy; } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/ThemesExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/ThemesExportService.cs index 4b4031d7558..b19d6077903 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/ThemesExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/ThemesExportService.cs @@ -34,13 +34,13 @@ public class ThemesExportService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; //Skip the export if all the folders have been processed already. - if (CheckPoint.Stage >= 1) + if (this.CheckPoint.Stage >= 1) return; - _exportImportJob = exportJob; - _portalSettings = new PortalSettings(exportJob.PortalId); + this._exportImportJob = exportJob; + this._portalSettings = new PortalSettings(exportJob.PortalId); //Create Zip File to hold files var currentIndex = 0; @@ -50,21 +50,21 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) var packagesZipFileFormat = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{{0}}\\{Constants.ExportZipThemes}"; var packagesZipFile = string.Format(packagesZipFileFormat, exportJob.Directory.TrimEnd('\\').TrimEnd('/')); - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { //export skin packages. - var exportThemes = GetExportThemes(); + var exportThemes = this.GetExportThemes(); var totalThemes = exportThemes.Count; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalThemes : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalThemes : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; using (var archive = CompressionUtil.OpenCreate(packagesZipFile)) { foreach (var theme in exportThemes) { - var filePath = SkinController.FormatSkinSrc(theme, _portalSettings); + var filePath = SkinController.FormatSkinSrc(theme, this._portalSettings); var physicalPath = Path.Combine(Globals.ApplicationMapPath, filePath.TrimStart('/')); if (Directory.Exists(physicalPath)) { @@ -76,48 +76,48 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) totalThemesExported += 1; } - CheckPoint.ProcessedItems++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalThemes; + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalThemes; currentIndex++; //After every 10 items, call the checkpoint stage. This is to avoid too many frequent updates to DB. - if (currentIndex % 10 == 0 && CheckPointStageCallback(this)) return; + if (currentIndex % 10 == 0 && this.CheckPointStageCallback(this)) return; } } - CheckPoint.Stage++; - CheckPoint.Completed = true; - CheckPoint.Progress = 100; + this.CheckPoint.Stage++; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; } } finally { - CheckPointStageCallback(this); - Result.AddSummary("Exported Themes", totalThemesExported.ToString()); + this.CheckPointStageCallback(this); + this.Result.AddSummary("Exported Themes", totalThemesExported.ToString()); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; //Skip the export if all the templates have been processed already. - if (CheckPoint.Stage >= 1 || CheckPoint.Completed) + if (this.CheckPoint.Stage >= 1 || this.CheckPoint.Completed) return; - _exportImportJob = importJob; + this._exportImportJob = importJob; - var packageZipFile = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{_exportImportJob.Directory.TrimEnd('\\', '/')}\\{Constants.ExportZipThemes}"; + var packageZipFile = $"{Globals.ApplicationMapPath}{Constants.ExportFolder}{this._exportImportJob.Directory.TrimEnd('\\', '/')}\\{Constants.ExportZipThemes}"; var tempFolder = $"{Path.GetDirectoryName(packageZipFile)}\\{DateTime.Now.Ticks}"; if (File.Exists(packageZipFile)) { CompressionUtil.UnZipArchive(packageZipFile, tempFolder); var exporeFiles = Directory.Exists(tempFolder) ? Directory.GetFiles(tempFolder, "*.*", SearchOption.AllDirectories) : new string[0]; var portalSettings = new PortalSettings(importDto.PortalId); - _importCount = exporeFiles.Length; + this._importCount = exporeFiles.Length; - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? exporeFiles.Length : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? exporeFiles.Length : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { try { @@ -155,38 +155,38 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) File.Copy(file, targetPath, true); } - Result.AddLogEntry("Import Theme File completed", targetPath); - CheckPoint.ProcessedItems++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / exporeFiles.Length; - CheckPointStageCallback(this); // just to update the counts without exit logic + this.Result.AddLogEntry("Import Theme File completed", targetPath); + this.CheckPoint.ProcessedItems++; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / exporeFiles.Length; + this.CheckPointStageCallback(this); // just to update the counts without exit logic } catch (Exception ex) { - Result.AddLogEntry("Import Theme error", file); + this.Result.AddLogEntry("Import Theme error", file); Logger.Error(ex); } } - CheckPoint.Stage++; - CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.Completed = true; } finally { - CheckPointStageCallback(this); + this.CheckPointStageCallback(this); FileSystemUtils.DeleteFolderRecursive(tempFolder); } } } else { - CheckPoint.Completed = true; - CheckPointStageCallback(this); - Result.AddLogEntry("ThemesFileNotFound", "Themes file not found. Skipping themes import", ReportLevel.Warn); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); + this.Result.AddLogEntry("ThemesFileNotFound", "Themes file not found. Skipping themes import", ReportLevel.Warn); } } public override int GetImportTotal() { - return _importCount; + return this._importCount; } private IList GetExportThemes() @@ -194,21 +194,21 @@ private IList GetExportThemes() var exportThemes = new List(); //get site level themes - exportThemes.Add(_portalSettings.DefaultPortalSkin); - exportThemes.Add(_portalSettings.DefaultPortalContainer); + exportThemes.Add(this._portalSettings.DefaultPortalSkin); + exportThemes.Add(this._portalSettings.DefaultPortalContainer); - if (!exportThemes.Contains(_portalSettings.DefaultAdminSkin)) + if (!exportThemes.Contains(this._portalSettings.DefaultAdminSkin)) { - exportThemes.Add(_portalSettings.DefaultAdminSkin); + exportThemes.Add(this._portalSettings.DefaultAdminSkin); } - if (!exportThemes.Contains(_portalSettings.DefaultAdminContainer)) + if (!exportThemes.Contains(this._portalSettings.DefaultAdminContainer)) { - exportThemes.Add(_portalSettings.DefaultAdminContainer); + exportThemes.Add(this._portalSettings.DefaultAdminContainer); } - exportThemes.AddRange(LoadExportThemesForPages()); - exportThemes.AddRange(LoadExportContainersForModules()); + exportThemes.AddRange(this.LoadExportThemesForPages()); + exportThemes.AddRange(this.LoadExportContainersForModules()); //get the theme packages var themePackages = new List(); @@ -228,7 +228,7 @@ private IList LoadExportThemesForPages() { var exportThemes = new List(); - foreach (var exportTab in Repository.GetAllItems()) + foreach (var exportTab in this.Repository.GetAllItems()) { if (!string.IsNullOrEmpty(exportTab.SkinSrc) && !exportThemes.Contains(exportTab.SkinSrc)) { @@ -248,7 +248,7 @@ private IList LoadExportContainersForModules() { var exportThemes = new List(); - foreach (var module in Repository.GetAllItems()) + foreach (var module in this.Repository.GetAllItems()) { if (!string.IsNullOrEmpty(module.ContainerSrc) && !exportThemes.Contains(module.ContainerSrc)) { diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/UsersDataExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/UsersDataExportService.cs index 4246b660d1d..fa17cb0f098 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/UsersDataExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/UsersDataExportService.cs @@ -31,48 +31,48 @@ public class UsersDataExportService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - CheckPoint.Progress += 100; - CheckPoint.Completed = true; - CheckPoint.TotalItems = 0; - CheckPoint.ProcessedItems = 0; - CheckPointStageCallback(this); + this.CheckPoint.Progress += 100; + this.CheckPoint.Completed = true; + this.CheckPoint.TotalItems = 0; + this.CheckPoint.ProcessedItems = 0; + this.CheckPointStageCallback(this); //No implementation required in export users child as everything is exported in parent service. } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var pageIndex = 0; const int pageSize = Constants.DefaultPageSize; var totalUserRolesImported = 0; var totalProfilesImported = 0; var totalProcessed = 0; - var totalUsers = Repository.GetCount(); + var totalUsers = this.Repository.GetCount(); if (totalUsers == 0) { - CheckPoint.Completed = true; - CheckPointStageCallback(this); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); return; } var totalPages = Util.CalculateTotalPages(totalUsers, pageSize); //Skip the import if all the users has been processed already. - if (CheckPoint.Stage >= totalPages) + if (this.CheckPoint.Stage >= totalPages) return; - pageIndex = CheckPoint.Stage; + pageIndex = this.CheckPoint.Stage; var totalUsersToBeProcessed = totalUsers - pageIndex * pageSize; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalUsers : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalUsers : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; var includeProfile = importDto.ExportDto.IncludeProperfileProperties; try { - Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); if (includeProfile) - Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); var portalId = importJob.PortalId; using (var tableUserProfile = new DataTable("UserProfile")) using (var tableUserRoles = new DataTable("UserRoles")) @@ -83,20 +83,20 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) var dataProvider = DotNetNuke.Data.DataProvider.Instance(); while (totalProcessed < totalUsersToBeProcessed) { - if (CheckCancelled(importJob)) return; - var users = Repository.GetAllItems(null, true, pageIndex * pageSize, pageSize).ToList(); + if (this.CheckCancelled(importJob)) return; + var users = this.Repository.GetAllItems(null, true, pageIndex * pageSize, pageSize).ToList(); var tempUserRolesCount = 0; var tempUserProfileCount = 0; try { foreach (var user in users) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; //Find the correct userId from the system which was added/updated by UserExportService. var userId = UserController.GetUserByName(user.Username)?.UserID; if (userId != null) { - var userRoles = Repository.GetRelatedItems(user.Id).ToList(); + var userRoles = this.Repository.GetRelatedItems(user.Id).ToList(); foreach (var userRole in userRoles) { var roleId = Util.GetRoleIdByName(importJob.PortalId, userRole.RoleId, userRole.RoleName); @@ -120,14 +120,14 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) if (includeProfile) { var userProfiles = - Repository.GetRelatedItems(user.Id).ToList(); + this.Repository.GetRelatedItems(user.Id).ToList(); foreach (var userProfile in userProfiles) { var profileDefinitionId = Util.GetProfilePropertyId(importJob.PortalId, userProfile.PropertyDefinitionId, userProfile.PropertyName); if (profileDefinitionId == null || profileDefinitionId == -1) continue; var value = userProfile.PropertyValue; - if (userProfile.PropertyName.Equals("photo", StringComparison.InvariantCultureIgnoreCase) && (value = GetUserPhotoId(portalId, value, user)) == null) + if (userProfile.PropertyName.Equals("photo", StringComparison.InvariantCultureIgnoreCase) && (value = this.GetUserPhotoId(portalId, value, user)) == null) { continue; } @@ -161,34 +161,34 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) totalProfilesImported += tempUserProfileCount; } - CheckPoint.ProcessedItems += users.Count; + this.CheckPoint.ProcessedItems += users.Count; totalProcessed += users.Count; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalUsers; - CheckPoint.StageData = null; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalUsers; + this.CheckPoint.StageData = null; } catch (Exception ex) { - Result.AddLogEntry($"Importing Users Data from {pageIndex * pageSize} to {pageIndex * pageSize + pageSize} exception", ex.Message, ReportLevel.Error); + this.Result.AddLogEntry($"Importing Users Data from {pageIndex * pageSize} to {pageIndex * pageSize + pageSize} exception", ex.Message, ReportLevel.Error); } tableUserRoles.Rows.Clear(); tableUserProfile.Rows.Clear(); pageIndex++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalUsers; - CheckPoint.Stage++; - CheckPoint.StageData = null; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalUsers; + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + if (this.CheckPointStageCallback(this)) return; } } - CheckPoint.Completed = true; - CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; } finally { - CheckPointStageCallback(this); - Result.AddSummary("Imported User Roles", totalUserRolesImported.ToString()); + this.CheckPointStageCallback(this); + this.Result.AddSummary("Imported User Roles", totalUserRolesImported.ToString()); if (includeProfile) { - Result.AddSummary("Imported User Profiles", totalProfilesImported.ToString()); + this.Result.AddSummary("Imported User Profiles", totalProfilesImported.ToString()); } } } @@ -205,11 +205,11 @@ private string GetUserPhotoId(int portalId, string importFileId, ExportUser user .ToList(); if (!files.Any()) return null; var importUserFolder = - Repository.GetItem(x => x.UserId == user.UserId); + this.Repository.GetItem(x => x.UserId == user.UserId); if (importUserFolder == null) return null; { var profilePicture = - Repository.GetRelatedItems(importUserFolder.Id) + this.Repository.GetRelatedItems(importUserFolder.Id) .FirstOrDefault(x => x.FileId == profilePictureId); if (profilePicture != null && files.Any(x => x.FileName == profilePicture.FileName)) @@ -225,7 +225,7 @@ private string GetUserPhotoId(int portalId, string importFileId, ExportUser user public override int GetImportTotal() { - return Repository.GetCount(); + return this.Repository.GetCount(); } private static readonly Tuple[] UserRolesDatasetColumns = diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/UsersExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/UsersExportService.cs index 471aba6801b..9974ee721a2 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/UsersExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/UsersExportService.cs @@ -29,7 +29,7 @@ public class UsersExportService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; var fromDateUtc = exportDto.FromDateUtc; var toDateUtc = exportDto.ToDateUtc; @@ -46,31 +46,31 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) var totalUsers = DataProvider.Instance().GetUsersCount(portalId, exportDto.IncludeDeletions, toDateUtc, fromDateUtc); if (totalUsers == 0) { - CheckPoint.Completed = true; - CheckPointStageCallback(this); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); return; } var totalPages = Util.CalculateTotalPages(totalUsers, pageSize); //Skip the export if all the users has been processed already. - if (CheckPoint.Stage >= totalPages) + if (this.CheckPoint.Stage >= totalPages) return; //Check if there is any pending stage or partially processed data. - if (CheckPoint.Stage > 0) + if (this.CheckPoint.Stage > 0) { - pageIndex = CheckPoint.Stage; + pageIndex = this.CheckPoint.Stage; } //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalUsers : CheckPoint.TotalItems; - CheckPoint.ProcessedItems = CheckPoint.Stage * pageSize; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalUsers : this.CheckPoint.TotalItems; + this.CheckPoint.ProcessedItems = this.CheckPoint.Stage * pageSize; + if (this.CheckPointStageCallback(this)) return; var includeProfile = exportDto.IncludeProperfileProperties; try { while (pageIndex < totalPages) { - if (CheckCancelled(exportJob)) return; + if (this.CheckCancelled(exportJob)) return; var exportUsersList = new List(); var exportAspnetUserList = new List(); var exportAspnetMembershipList = new List(); @@ -107,7 +107,7 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) CBO.FillCollection(reader, exportAspnetMembershipList, true); } - Repository.CreateItems(exportUsersList, null); + this.Repository.CreateItems(exportUsersList, null); totalUsersExported += exportUsersList.Count; exportUserAuthenticationList.ForEach( @@ -115,7 +115,7 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { x.ReferenceId = exportUsersList.FirstOrDefault(user => user.UserId == x.UserId)?.Id; }); - Repository.CreateItems(exportUserAuthenticationList, null); + this.Repository.CreateItems(exportUserAuthenticationList, null); totalAuthenticationExported += exportUserAuthenticationList.Count; exportUserRoleList.ForEach( @@ -123,7 +123,7 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { x.ReferenceId = exportUsersList.FirstOrDefault(user => user.UserId == x.UserId)?.Id; }); - Repository.CreateItems(exportUserRoleList, null); + this.Repository.CreateItems(exportUserRoleList, null); totalUserRolesExported += exportUserRoleList.Count; if (includeProfile) { @@ -132,7 +132,7 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { x.ReferenceId = exportUsersList.FirstOrDefault(user => user.UserId == x.UserId)?.Id; }); - Repository.CreateItems(exportUserProfileList, null); + this.Repository.CreateItems(exportUserProfileList, null); totalProfilesExported += exportUserProfileList.Count; } exportUserPortalList.ForEach( @@ -140,7 +140,7 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { x.ReferenceId = exportUsersList.FirstOrDefault(user => user.UserId == x.UserId)?.Id; }); - Repository.CreateItems(exportUserPortalList, null); + this.Repository.CreateItems(exportUserPortalList, null); totalPortalsExported += exportUserPortalList.Count; exportAspnetUserList.ForEach( @@ -148,7 +148,7 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { x.ReferenceId = exportUsersList.FirstOrDefault(user => user.Username == x.UserName)?.Id; }); - Repository.CreateItems(exportAspnetUserList, null); + this.Repository.CreateItems(exportAspnetUserList, null); totalAspnetUserExported += exportAspnetUserList.Count; exportAspnetMembershipList.ForEach( @@ -156,51 +156,51 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { x.ReferenceId = exportAspnetUserList.FirstOrDefault(user => user.UserId == x.UserId)?.Id; }); - Repository.CreateItems(exportAspnetMembershipList, null); + this.Repository.CreateItems(exportAspnetMembershipList, null); totalAspnetMembershipExported += exportAspnetMembershipList.Count; - CheckPoint.ProcessedItems += exportUsersList.Count; + this.CheckPoint.ProcessedItems += exportUsersList.Count; } catch (Exception ex) { - Result.AddLogEntry($"Exporting Users from {pageIndex * pageSize} to {pageIndex * pageSize + pageSize} exception", ex.Message, ReportLevel.Error); + this.Result.AddLogEntry($"Exporting Users from {pageIndex * pageSize} to {pageIndex * pageSize + pageSize} exception", ex.Message, ReportLevel.Error); } - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalUsers; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalUsers; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; //Rebuild the indexes in the exported database. - Repository.RebuildIndex(x => x.Id, true); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.Id, true); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); if (includeProfile) - Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); pageIndex++; } - CheckPoint.Completed = true; - CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; } finally { - CheckPointStageCallback(this); - Result.AddSummary("Exported Users", totalUsersExported.ToString()); - Result.AddSummary("Exported User Portals", totalPortalsExported.ToString()); - Result.AddSummary("Exported User Roles", totalUserRolesExported.ToString()); + this.CheckPointStageCallback(this); + this.Result.AddSummary("Exported Users", totalUsersExported.ToString()); + this.Result.AddSummary("Exported User Portals", totalPortalsExported.ToString()); + this.Result.AddSummary("Exported User Roles", totalUserRolesExported.ToString()); if (includeProfile) { - Result.AddSummary("Exported User Profiles", totalProfilesExported.ToString()); + this.Result.AddSummary("Exported User Profiles", totalProfilesExported.ToString()); } - Result.AddSummary("Exported User Authentication", totalAuthenticationExported.ToString()); - Result.AddSummary("Exported Aspnet User", totalAspnetUserExported.ToString()); - Result.AddSummary("Exported Aspnet Membership", totalAspnetMembershipExported.ToString()); + this.Result.AddSummary("Exported User Authentication", totalAuthenticationExported.ToString()); + this.Result.AddSummary("Exported Aspnet User", totalAspnetUserExported.ToString()); + this.Result.AddSummary("Exported Aspnet Membership", totalAspnetMembershipExported.ToString()); } } public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; const int pageSize = Constants.DefaultPageSize; var totalUsersImported = 0; @@ -208,31 +208,31 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) var totalAspnetUserImported = 0; var totalAspnetMembershipImported = 0; var totalUserAuthenticationCount = 0; - var totalUsers = Repository.GetCount(); + var totalUsers = this.Repository.GetCount(); if (totalUsers == 0) { - CheckPoint.Completed = true; - CheckPointStageCallback(this); + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); return; } var totalPages = Util.CalculateTotalPages(totalUsers, pageSize); //Skip the import if all the users has been processed already. - if (CheckPoint.Stage >= totalPages) + if (this.CheckPoint.Stage >= totalPages) return; - var pageIndex = CheckPoint.Stage; + var pageIndex = this.CheckPoint.Stage; var totalUsersToBeProcessed = totalUsers - pageIndex * pageSize; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? totalUsers : CheckPoint.TotalItems; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? totalUsers : this.CheckPoint.TotalItems; + if (this.CheckPointStageCallback(this)) return; try { - Repository.RebuildIndex(x => x.Id, true); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); - Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.Id, true); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); + this.Repository.RebuildIndex(x => x.ReferenceId); var portalId = importJob.PortalId; var dataProvider = DotNetNuke.Data.DataProvider.Instance(); using (var table = new DataTable("Users")) @@ -242,9 +242,9 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) UsersDatasetColumns.Select(column => new DataColumn(column.Item1, column.Item2)).ToArray()); while (totalUsersImported < totalUsersToBeProcessed) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var users = - Repository.GetAllItems(null, true, pageIndex * pageSize, pageSize).ToList(); + this.Repository.GetAllItems(null, true, pageIndex * pageSize, pageSize).ToList(); var tempAspUserCount = 0; var tempAspMembershipCount = 0; var tempUserPortalCount = 0; @@ -253,15 +253,15 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) { foreach (var user in users) { - if (CheckCancelled(importJob)) return; + if (this.CheckCancelled(importJob)) return; var row = table.NewRow(); - var userPortal = Repository.GetRelatedItems(user.Id).FirstOrDefault(); - var userAuthentication = Repository.GetRelatedItems(user.Id).FirstOrDefault(); + var userPortal = this.Repository.GetRelatedItems(user.Id).FirstOrDefault(); + var userAuthentication = this.Repository.GetRelatedItems(user.Id).FirstOrDefault(); //Aspnet Users and Membership - var aspNetUser = Repository.GetRelatedItems(user.Id).FirstOrDefault(); + var aspNetUser = this.Repository.GetRelatedItems(user.Id).FirstOrDefault(); var aspnetMembership = aspNetUser != null - ? Repository.GetRelatedItems(aspNetUser.Id).FirstOrDefault() + ? this.Repository.GetRelatedItems(aspNetUser.Id).FirstOrDefault() : null; row["PortalId"] = portalId; @@ -309,7 +309,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) if (aspNetUser != null) { tempAspUserCount += 1; - row["ApplicationId"] = GetApplicationId(); + row["ApplicationId"] = this.GetApplicationId(); row["AspUserId"] = aspNetUser.UserId; row["MobileAlias"] = aspNetUser.MobileAlias; row["IsAnonymous"] = aspNetUser.IsAnonymous; @@ -359,37 +359,37 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) totalAspnetMembershipImported += tempAspMembershipCount; totalPortalsImported += tempUserPortalCount; totalUserAuthenticationCount += tempUserAuthenticationCount; - CheckPoint.ProcessedItems += users.Count; + this.CheckPoint.ProcessedItems += users.Count; } catch (Exception ex) { - Result.AddLogEntry($"Importing Users from {pageIndex * pageSize} to {pageIndex * pageSize + pageSize} exception", ex.Message, ReportLevel.Error); + this.Result.AddLogEntry($"Importing Users from {pageIndex * pageSize} to {pageIndex * pageSize + pageSize} exception", ex.Message, ReportLevel.Error); } table.Rows.Clear(); pageIndex++; - CheckPoint.Progress = CheckPoint.ProcessedItems * 100.0 / totalUsers; - CheckPoint.Stage++; - CheckPoint.StageData = null; - if (CheckPointStageCallback(this)) return; + this.CheckPoint.Progress = this.CheckPoint.ProcessedItems * 100.0 / totalUsers; + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + if (this.CheckPointStageCallback(this)) return; } } - CheckPoint.Completed = true; - CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Progress = 100; } finally { - CheckPointStageCallback(this); - Result.AddSummary("Imported Users", totalUsersImported.ToString()); - Result.AddSummary("Imported User Portals", totalPortalsImported.ToString()); - Result.AddSummary("Import User Authentications", totalUserAuthenticationCount.ToString()); - Result.AddSummary("Imported Aspnet Users", totalAspnetUserImported.ToString()); - Result.AddSummary("Imported Aspnet Memberships", totalAspnetMembershipImported.ToString()); + this.CheckPointStageCallback(this); + this.Result.AddSummary("Imported Users", totalUsersImported.ToString()); + this.Result.AddSummary("Imported User Portals", totalPortalsImported.ToString()); + this.Result.AddSummary("Import User Authentications", totalUserAuthenticationCount.ToString()); + this.Result.AddSummary("Imported Aspnet Users", totalAspnetUserImported.ToString()); + this.Result.AddSummary("Imported Aspnet Memberships", totalAspnetMembershipImported.ToString()); } } public override int GetImportTotal() { - return Repository.GetCount(); + return this.Repository.GetCount(); } private Guid GetApplicationId() diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/VocabularyService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/VocabularyService.cs index 1dccf522666..6de283a706b 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/VocabularyService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/VocabularyService.cs @@ -26,14 +26,14 @@ public class VocabularyService : BasePortableService public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckPoint.Stage > 0) return; - if (CheckCancelled(exportJob)) return; + if (this.CheckPoint.Stage > 0) return; + if (this.CheckCancelled(exportJob)) return; var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); List vocabularyTypes = null; - if (CheckPoint.Stage == 0) + if (this.CheckPoint.Stage == 0) { var taxonomyTerms = GetTaxonomyTerms(exportDto.PortalId, toDate, fromDate); var taxonomyVocabularies = GetTaxonomyVocabularies(exportDto.PortalId, toDate, fromDate); @@ -41,47 +41,47 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { var scopeTypes = CBO.FillCollection(DataProvider.Instance().GetAllScopeTypes()); //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? scopeTypes.Count : CheckPoint.TotalItems; - if (CheckPoint.TotalItems == scopeTypes.Count) + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? scopeTypes.Count : this.CheckPoint.TotalItems; + if (this.CheckPoint.TotalItems == scopeTypes.Count) { vocabularyTypes = CBO.FillCollection(DataProvider.Instance().GetAllVocabularyTypes()); taxonomyTerms = GetTaxonomyTerms(exportDto.PortalId, toDate, fromDate); taxonomyVocabularies = GetTaxonomyVocabularies(exportDto.PortalId, toDate, fromDate); - CheckPoint.TotalItems += taxonomyTerms.Count + taxonomyVocabularies.Count; + this.CheckPoint.TotalItems += taxonomyTerms.Count + taxonomyVocabularies.Count; } - CheckPointStageCallback(this); + this.CheckPointStageCallback(this); - Repository.CreateItems(scopeTypes); + this.Repository.CreateItems(scopeTypes); //Result.AddSummary("Exported Taxonomy Scopes", scopeTypes.Count.ToString()); -- not imported so don't show //CheckPoint.ProcessedItems += scopeTypes.Count; } - CheckPoint.Progress = 25; + this.CheckPoint.Progress = 25; if (taxonomyVocabularies == null) taxonomyVocabularies = GetTaxonomyVocabularies(exportDto.PortalId, toDate, fromDate); if (taxonomyTerms.Count > 0 || taxonomyVocabularies.Count > 0) { if (vocabularyTypes == null) vocabularyTypes = CBO.FillCollection(DataProvider.Instance().GetAllVocabularyTypes()); - Repository.CreateItems(vocabularyTypes); + this.Repository.CreateItems(vocabularyTypes); //Result.AddSummary("Exported Vocabulary Types", vocabularyTypes.Count.ToString()); -- not imported so don't show //CheckPoint.ProcessedItems += vocabularyTypes.Count; } - Repository.CreateItems(taxonomyTerms); - Result.AddSummary("Exported Vocabularies", taxonomyTerms.Count.ToString()); - CheckPoint.Progress = 75; - CheckPoint.ProcessedItems += taxonomyTerms.Count; - CheckPoint.Stage++; - if (CheckPointStageCallback(this)) return; + this.Repository.CreateItems(taxonomyTerms); + this.Result.AddSummary("Exported Vocabularies", taxonomyTerms.Count.ToString()); + this.CheckPoint.Progress = 75; + this.CheckPoint.ProcessedItems += taxonomyTerms.Count; + this.CheckPoint.Stage++; + if (this.CheckPointStageCallback(this)) return; if (taxonomyVocabularies == null) taxonomyVocabularies = GetTaxonomyVocabularies(exportDto.PortalId, toDate, fromDate); - Repository.CreateItems(taxonomyVocabularies); - Result.AddSummary("Exported Terms", taxonomyVocabularies.Count.ToString()); - CheckPoint.Progress = 100; - CheckPoint.ProcessedItems += taxonomyVocabularies.Count; - CheckPoint.Stage++; - CheckPoint.Completed = true; - CheckPointStageCallback(this); + this.Repository.CreateItems(taxonomyVocabularies); + this.Result.AddSummary("Exported Terms", taxonomyVocabularies.Count.ToString()); + this.CheckPoint.Progress = 100; + this.CheckPoint.ProcessedItems += taxonomyVocabularies.Count; + this.CheckPoint.Stage++; + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); } } @@ -97,43 +97,43 @@ private static List GetTaxonomyVocabularies(int portalId, Da public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckPoint.Stage > 0) return; - if (CheckCancelled(importJob)) return; + if (this.CheckPoint.Stage > 0) return; + if (this.CheckCancelled(importJob)) return; //Update the total items count in the check points. This should be updated only once. - CheckPoint.TotalItems = CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? GetImportTotal() : CheckPoint.TotalItems; - if (CheckPoint.Stage == 0) + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? this.GetImportTotal() : this.CheckPoint.TotalItems; + if (this.CheckPoint.Stage == 0) { - var otherScopeTypes = Repository.GetAllItems().ToList(); + var otherScopeTypes = this.Repository.GetAllItems().ToList(); //the table Taxonomy_ScopeTypes is used for lookup only and never changed/updated in the database //CheckPoint.Progress = 10; //var otherVocabularyTypes = Repository.GetAllItems().ToList(); //the table Taxonomy_VocabularyTypes is used for lookup only and never changed/updated in the database - CheckPoint.Progress = 20; + this.CheckPoint.Progress = 20; - var otherVocabularies = Repository.GetAllItems().ToList(); - ProcessVocabularies(importJob, importDto, otherScopeTypes, otherVocabularies); - Repository.UpdateItems(otherVocabularies); - Result.AddSummary("Imported Vocabularies", otherVocabularies.Count.ToString()); - CheckPoint.Progress = 60; - CheckPoint.ProcessedItems += otherVocabularies.Count; + var otherVocabularies = this.Repository.GetAllItems().ToList(); + this.ProcessVocabularies(importJob, importDto, otherScopeTypes, otherVocabularies); + this.Repository.UpdateItems(otherVocabularies); + this.Result.AddSummary("Imported Vocabularies", otherVocabularies.Count.ToString()); + this.CheckPoint.Progress = 60; + this.CheckPoint.ProcessedItems += otherVocabularies.Count; - var otherTaxonomyTerms = Repository.GetAllItems().ToList(); - ProcessTaxonomyTerms(importJob, importDto, otherVocabularies, otherTaxonomyTerms); - Repository.UpdateItems(otherTaxonomyTerms); - Result.AddSummary("Imported Terms", otherTaxonomyTerms.Count.ToString()); - CheckPoint.Progress = 100; - CheckPoint.ProcessedItems += otherTaxonomyTerms.Count; - CheckPoint.Stage++; - CheckPoint.Completed = true; - CheckPointStageCallback(this); + var otherTaxonomyTerms = this.Repository.GetAllItems().ToList(); + this.ProcessTaxonomyTerms(importJob, importDto, otherVocabularies, otherTaxonomyTerms); + this.Repository.UpdateItems(otherTaxonomyTerms); + this.Result.AddSummary("Imported Terms", otherTaxonomyTerms.Count.ToString()); + this.CheckPoint.Progress = 100; + this.CheckPoint.ProcessedItems += otherTaxonomyTerms.Count; + this.CheckPoint.Stage++; + this.CheckPoint.Completed = true; + this.CheckPointStageCallback(this); } } public override int GetImportTotal() { - return Repository.GetCount() + Repository.GetCount(); + return this.Repository.GetCount() + this.Repository.GetCount(); } private void ProcessVocabularies(ExportImportJob importJob, ImportDto importDto, @@ -165,7 +165,7 @@ private void ProcessVocabularies(ExportImportJob importJob, ImportDto importDto, switch (importDto.CollisionResolution) { case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored vocabulary", other.Name); + this.Result.AddLogEntry("Ignored vocabulary", other.Name); break; case CollisionResolution.Overwrite: var vocabulary = new Vocabulary(other.Name, other.Description) @@ -176,7 +176,7 @@ private void ProcessVocabularies(ExportImportJob importJob, ImportDto importDto, ScopeTypeId = scope?.LocalId ?? other.ScopeTypeID, }; dataService.UpdateVocabulary(vocabulary, modifiedBy); - Result.AddLogEntry("Updated vocabulary", other.Name); + this.Result.AddLogEntry("Updated vocabulary", other.Name); changed = true; break; default: @@ -193,7 +193,7 @@ private void ProcessVocabularies(ExportImportJob importJob, ImportDto importDto, ScopeTypeId = scope?.LocalId ?? other.ScopeTypeID, }; other.LocalId = dataService.AddVocabulary(vocabulary, createdBy); - Result.AddLogEntry("Added vocabulary", other.Name); + this.Result.AddLogEntry("Added vocabulary", other.Name); changed = true; } } @@ -223,7 +223,7 @@ private void ProcessTaxonomyTerms(ExportImportJob importJob, ImportDto importDto switch (importDto.CollisionResolution) { case CollisionResolution.Ignore: - Result.AddLogEntry("Ignored taxonomy", other.Name); + this.Result.AddLogEntry("Ignored taxonomy", other.Name); break; case CollisionResolution.Overwrite: var parent = other.ParentTermID.HasValue @@ -245,7 +245,7 @@ private void ProcessTaxonomyTerms(ExportImportJob importJob, ImportDto importDto dataService.UpdateSimpleTerm(term, modifiedBy); } DataCache.ClearCache(string.Format(DataCache.TermCacheKey, term.TermId)); - Result.AddLogEntry("Updated taxonomy", other.Name); + this.Result.AddLogEntry("Updated taxonomy", other.Name); break; default: throw new ArgumentOutOfRangeException(importDto.CollisionResolution.ToString()); @@ -266,7 +266,7 @@ private void ProcessTaxonomyTerms(ExportImportJob importJob, ImportDto importDto other.LocalId = isHierarchical ? dataService.AddHeirarchicalTerm(term, createdBy) : dataService.AddSimpleTerm(term, createdBy); - Result.AddLogEntry("Added taxonomy", other.Name); + this.Result.AddLogEntry("Added taxonomy", other.Name); } } } diff --git a/DNN Platform/Modules/DnnExportImport/Components/Services/WorkflowsExportService.cs b/DNN Platform/Modules/DnnExportImport/Components/Services/WorkflowsExportService.cs index 98bdb135a26..f128920d75e 100644 --- a/DNN Platform/Modules/DnnExportImport/Components/Services/WorkflowsExportService.cs +++ b/DNN Platform/Modules/DnnExportImport/Components/Services/WorkflowsExportService.cs @@ -30,15 +30,15 @@ public class WorkflowsExportService : BasePortableService public override int GetImportTotal() { - return Repository.GetCount() + Repository.GetCount(); + return this.Repository.GetCount() + this.Repository.GetCount(); } #region Exporting public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) { - if (CheckPoint.Stage > 0) return; - if (CheckCancelled(exportJob)) return; + if (this.CheckPoint.Stage > 0) return; + if (this.CheckCancelled(exportJob)) return; var fromDate = (exportDto.FromDateUtc ?? Constants.MinDbTime).ToLocalTime(); var toDate = exportDto.ToDateUtc.ToLocalTime(); @@ -53,28 +53,28 @@ public override void ExportData(ExportImportJob exportJob, ExportDto exportDto) defaultWorkflow.IsDefault = true; } - CheckPoint.TotalItems = contentWorkflows.Count; - Repository.CreateItems(contentWorkflows); - Result.AddLogEntry("Exported ContentWorkflows", contentWorkflows.Count.ToString()); + this.CheckPoint.TotalItems = contentWorkflows.Count; + this.Repository.CreateItems(contentWorkflows); + this.Result.AddLogEntry("Exported ContentWorkflows", contentWorkflows.Count.ToString()); foreach (var workflow in contentWorkflows) { var contentWorkflowStates = GetWorkflowStates(workflow.WorkflowID); - Repository.CreateItems(contentWorkflowStates, workflow.Id); + this.Repository.CreateItems(contentWorkflowStates, workflow.Id); foreach (var workflowState in contentWorkflowStates) { var contentWorkflowStatePermissions = GetWorkflowStatePermissions(workflowState.StateID, toDate, fromDate); - Repository.CreateItems(contentWorkflowStatePermissions, workflowState.Id); + this.Repository.CreateItems(contentWorkflowStatePermissions, workflowState.Id); } } } - CheckPoint.Progress = 100; - CheckPoint.Completed = true; - CheckPoint.Stage++; - CheckPoint.StageData = null; - CheckPointStageCallback(this); + this.CheckPoint.Progress = 100; + this.CheckPoint.Completed = true; + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + this.CheckPointStageCallback(this); } private static List GetWorkflows(int portalId, bool includeDeletions) @@ -102,7 +102,7 @@ private static List GetWorkflowStatePermissions( public override void ImportData(ExportImportJob importJob, ImportDto importDto) { - if (CheckCancelled(importJob) || CheckPoint.Stage >= 1 || CheckPoint.Completed || CheckPointStageCallback(this)) + if (this.CheckCancelled(importJob) || this.CheckPoint.Stage >= 1 || this.CheckPoint.Completed || this.CheckPointStageCallback(this)) { return; } @@ -110,10 +110,10 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) var workflowManager = WorkflowManager.Instance; var workflowStateManager = WorkflowStateManager.Instance; var portalId = importJob.PortalId; - var importWorkflows = Repository.GetAllItems().ToList(); + var importWorkflows = this.Repository.GetAllItems().ToList(); var existWorkflows = workflowManager.GetWorkflows(portalId).ToList(); var defaultTabWorkflowId = importWorkflows.FirstOrDefault(w => w.IsDefault)?.WorkflowID ?? 1; - CheckPoint.TotalItems = CheckPoint.TotalItems <= 0 ? importWorkflows.Count : CheckPoint.TotalItems; + this.CheckPoint.TotalItems = this.CheckPoint.TotalItems <= 0 ? importWorkflows.Count : this.CheckPoint.TotalItems; #region importing workflows @@ -130,7 +130,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) workflow.Description = importWorkflow.Description; workflow.WorkflowKey = importWorkflow.WorkflowKey; workflowManager.UpdateWorkflow(workflow); - Result.AddLogEntry("Updated workflow", workflow.WorkflowName); + this.Result.AddLogEntry("Updated workflow", workflow.WorkflowName); } } } @@ -145,7 +145,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) }; workflowManager.AddWorkflow(workflow); - Result.AddLogEntry("Added workflow", workflow.WorkflowName); + this.Result.AddLogEntry("Added workflow", workflow.WorkflowName); if (importWorkflow.WorkflowID == defaultTabWorkflowId) { @@ -157,7 +157,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) #region importing workflow states - var importStates = Repository.GetRelatedItems(importWorkflow.Id).ToList(); + var importStates = this.Repository.GetRelatedItems(importWorkflow.Id).ToList(); foreach (var importState in importStates) { var workflowState = workflow.States.FirstOrDefault(s => s.StateName == importState.StateName); @@ -170,7 +170,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) workflowState.SendNotification = importState.SendNotification; workflowState.SendNotificationToAdministrators = importState.SendNotificationToAdministrators; workflowStateManager.UpdateWorkflowState(workflowState); - Result.AddLogEntry("Updated workflow state", workflowState.StateID.ToString()); + this.Result.AddLogEntry("Updated workflow state", workflowState.StateID.ToString()); } } else @@ -185,7 +185,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) SendNotificationToAdministrators = importState.SendNotificationToAdministrators }; WorkflowStateManager.Instance.AddWorkflowState(workflowState); - Result.AddLogEntry("Added workflow state", workflowState.StateID.ToString()); + this.Result.AddLogEntry("Added workflow state", workflowState.StateID.ToString()); } importState.LocalId = workflowState.StateID; @@ -193,7 +193,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) if (!workflowState.IsSystem) { - var importPermissions = Repository.GetRelatedItems(importState.Id).ToList(); + var importPermissions = this.Repository.GetRelatedItems(importState.Id).ToList(); foreach (var importPermission in importPermissions) { var permissionId = DataProvider.Instance().GetPermissionId( @@ -218,7 +218,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) { if (userId == null) { - Result.AddLogEntry("Couldn't add tab permission; User is undefined!", + this.Result.AddLogEntry("Couldn't add tab permission; User is undefined!", $"{importPermission.PermissionKey} - {importPermission.PermissionID}", ReportLevel.Warn); continue; } @@ -229,7 +229,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) { if (roleId == null) { - Result.AddLogEntry("Couldn't add tab permission; Role is undefined!", + this.Result.AddLogEntry("Couldn't add tab permission; Role is undefined!", $"{importPermission.PermissionKey} - {importPermission.PermissionID}", ReportLevel.Warn); continue; } @@ -249,7 +249,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) { workflowStateManager.AddWorkflowStatePermission(permission, -1); importPermission.LocalId = permission.WorkflowStatePermissionID; - Result.AddLogEntry("Added workflow state permission", + this.Result.AddLogEntry("Added workflow state permission", permission.WorkflowStatePermissionID.ToString()); } else @@ -259,7 +259,7 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) } catch (Exception ex) { - Result.AddLogEntry("Exception adding workflow state permission", ex.Message, ReportLevel.Error); + this.Result.AddLogEntry("Exception adding workflow state permission", ex.Message, ReportLevel.Error); } } } @@ -270,22 +270,22 @@ public override void ImportData(ExportImportJob importJob, ImportDto importDto) #endregion - Repository.UpdateItems(importStates); - Result.AddSummary("Imported Workflow", importWorkflows.Count.ToString()); - CheckPoint.ProcessedItems++; - CheckPointStageCallback(this); // no need to return; very small amount of data processed + this.Repository.UpdateItems(importStates); + this.Result.AddSummary("Imported Workflow", importWorkflows.Count.ToString()); + this.CheckPoint.ProcessedItems++; + this.CheckPointStageCallback(this); // no need to return; very small amount of data processed } #endregion - Repository.UpdateItems(importWorkflows); + this.Repository.UpdateItems(importWorkflows); - CheckPoint.Stage++; - CheckPoint.StageData = null; - CheckPoint.Progress = 100; - CheckPoint.TotalItems = importWorkflows.Count; - CheckPoint.ProcessedItems = importWorkflows.Count; - CheckPointStageCallback(this); + this.CheckPoint.Stage++; + this.CheckPoint.StageData = null; + this.CheckPoint.Progress = 100; + this.CheckPoint.TotalItems = importWorkflows.Count; + this.CheckPoint.ProcessedItems = importWorkflows.Count; + this.CheckPointStageCallback(this); } #endregion diff --git a/DNN Platform/Modules/DnnExportImport/DnnExportImport.csproj b/DNN Platform/Modules/DnnExportImport/DnnExportImport.csproj index 534c39145d8..529932b5161 100644 --- a/DNN Platform/Modules/DnnExportImport/DnnExportImport.csproj +++ b/DNN Platform/Modules/DnnExportImport/DnnExportImport.csproj @@ -1,178 +1,184 @@ - - - - - Debug - AnyCPU - {E29D5AAB-B4AE-4DE0-8443-EBF40865030A} - Library - Properties - Dnn.ExportImport - DotNetNuke.SiteExportImport - v4.7.2 - 512 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\DotNetNuke.SiteExportImport.xml - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\DotNetNuke.SiteExportImport.xml - 1591 - 7 - - - - ..\..\..\packages\LiteDB.3.1.0\lib\net35\LiteDB.dll - True - - - - False - ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - - - ..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - ..\..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True - - - - - - - Properties\SolutionInfo.cs - - - True - True - ExportImport.resx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {2c624453-4ed2-4bcb-9d71-664ac7d5955c} - DnnExportImportLibrary - - - - - - - - - - - - - ResXFileCodeGenerator - ExportImport.Designer.cs - - - - - + + + + + Debug + AnyCPU + {E29D5AAB-B4AE-4DE0-8443-EBF40865030A} + Library + Properties + Dnn.ExportImport + DotNetNuke.SiteExportImport + v4.7.2 + 512 + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + bin\DotNetNuke.SiteExportImport.xml + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\DotNetNuke.SiteExportImport.xml + 1591 + 7 + + + + ..\..\..\packages\LiteDB.3.1.0\lib\net35\LiteDB.dll + True + + + + False + ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + ..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + ..\..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + True + + + + + + + Properties\SolutionInfo.cs + + + True + True + ExportImport.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {2c624453-4ed2-4bcb-9d71-664ac7d5955c} + DnnExportImportLibrary + + + + + stylecop.json + + + + + + + + + + + ResXFileCodeGenerator + ExportImport.Designer.cs + + + + + + + + + --> \ No newline at end of file diff --git a/DNN Platform/Modules/DnnExportImport/Services/ExportImportController.cs b/DNN Platform/Modules/DnnExportImport/Services/ExportImportController.cs index d4e67b0d735..c137a89c04a 100644 --- a/DNN Platform/Modules/DnnExportImport/Services/ExportImportController.cs +++ b/DNN Platform/Modules/DnnExportImport/Services/ExportImportController.cs @@ -22,9 +22,9 @@ public class ExportImportController : DnnApiController public HttpResponseMessage Export(ExportDto exportDto) { var controller = new ExportController(); - var jobId = controller.QueueOperation(PortalSettings.UserId, exportDto); + var jobId = controller.QueueOperation(this.PortalSettings.UserId, exportDto); - return Request.CreateResponse(HttpStatusCode.OK, new { jobId }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { jobId }); } [HttpPost] @@ -35,10 +35,10 @@ public HttpResponseMessage Import(ImportDto importDto) string message; if (controller.VerifyImportPackage(importDto.PackageId, null, out message)) { - var jobId = controller.QueueOperation(PortalSettings.UserId, importDto); - return Request.CreateResponse(HttpStatusCode.OK, new { jobId }); + var jobId = controller.QueueOperation(this.PortalSettings.UserId, importDto); + return this.Request.CreateResponse(HttpStatusCode.OK, new { jobId }); } - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, message); + return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, message); } [HttpGet] @@ -48,10 +48,10 @@ public HttpResponseMessage VerifyImportPackage(string packageId) string message; var summary = new ImportExportSummary(); var isValid = controller.VerifyImportPackage(packageId, summary, out message); - summary.ConvertToLocal(UserInfo); + summary.ConvertToLocal(this.UserInfo); return isValid - ? Request.CreateResponse(HttpStatusCode.OK, summary) - : Request.CreateErrorResponse(HttpStatusCode.BadRequest, message); + ? this.Request.CreateResponse(HttpStatusCode.OK, summary) + : this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, message); } /// @@ -69,8 +69,8 @@ public HttpResponseMessage GetImportPackages(string keyword = "", string order = var controller = new ImportController(); int total; var packages = controller.GetImportPackages(out total, keyword, order, pageIndex, pageSize).ToList(); - packages.ForEach(package => package.ConvertToLocal(UserInfo)); - return Request.CreateResponse(HttpStatusCode.OK, new { packages, total }); + packages.ForEach(package => package.ConvertToLocal(this.UserInfo)); + return this.Request.CreateResponse(HttpStatusCode.OK, new { packages, total }); } // this is POST so users can't cancel using a simple browser link @@ -79,8 +79,8 @@ public HttpResponseMessage GetImportPackages(string keyword = "", string order = public HttpResponseMessage CancelProcess([FromUri] int jobId) { var controller = new BaseController(); - var cancelStatus = controller.CancelJob(UserInfo.IsSuperUser ? -1 : PortalSettings.PortalId, jobId); - return Request.CreateResponse( + var cancelStatus = controller.CancelJob(this.UserInfo.IsSuperUser ? -1 : this.PortalSettings.PortalId, jobId); + return this.Request.CreateResponse( cancelStatus ? HttpStatusCode.OK : HttpStatusCode.BadRequest, new { success = cancelStatus }); } @@ -90,27 +90,27 @@ public HttpResponseMessage CancelProcess([FromUri] int jobId) public HttpResponseMessage RemoveJob([FromUri] int jobId) { var controller = new BaseController(); - var cancelStatus = controller.RemoveJob(UserInfo.IsSuperUser ? -1 : PortalSettings.PortalId, jobId); - return Request.CreateResponse( + var cancelStatus = controller.RemoveJob(this.UserInfo.IsSuperUser ? -1 : this.PortalSettings.PortalId, jobId); + return this.Request.CreateResponse( cancelStatus ? HttpStatusCode.OK : HttpStatusCode.BadRequest, new { success = cancelStatus }); } [HttpGet] public HttpResponseMessage LastJobTime(int portal, JobType jobType) { - if (!UserInfo.IsSuperUser && portal != PortalSettings.PortalId) + if (!this.UserInfo.IsSuperUser && portal != this.PortalSettings.PortalId) { var error = Localization.GetString("NotPortalAdmin", Constants.SharedResources); - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, error); + return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, error); } if (portal < 0) - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, + return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, Localization.GetString("InvalidPortal", Constants.SharedResources)); var controller = new BaseController(); var lastTime = controller.GetLastJobTime(portal, jobType); - return Request.CreateResponse(HttpStatusCode.OK, + return this.Request.CreateResponse(HttpStatusCode.OK, new { lastTime = Util.GetDateTimeString(lastTime) }); } @@ -118,26 +118,26 @@ public HttpResponseMessage LastJobTime(int portal, JobType jobType) public HttpResponseMessage AllJobs(int portal, int? pageSize = 10, int? pageIndex = 0, int? jobType = null, string keywords = null) { - if (!UserInfo.IsSuperUser && portal != PortalSettings.PortalId) + if (!this.UserInfo.IsSuperUser && portal != this.PortalSettings.PortalId) { var error = Localization.GetString("NotPortalAdmin", Constants.SharedResources); - return Request.CreateErrorResponse(HttpStatusCode.BadRequest, error); + return this.Request.CreateErrorResponse(HttpStatusCode.BadRequest, error); } var controller = new BaseController(); - var jobs = controller.GetAllJobs(portal, PortalSettings.PortalId, pageSize, pageIndex, jobType, keywords); - jobs?.ConvertToLocal(UserInfo); - return Request.CreateResponse(HttpStatusCode.OK, jobs); + var jobs = controller.GetAllJobs(portal, this.PortalSettings.PortalId, pageSize, pageIndex, jobType, keywords); + jobs?.ConvertToLocal(this.UserInfo); + return this.Request.CreateResponse(HttpStatusCode.OK, jobs); } [HttpGet] public HttpResponseMessage JobDetails(int jobId) { var controller = new BaseController(); - var job = controller.GetJobDetails(UserInfo.IsSuperUser ? -1 : PortalSettings.PortalId, jobId); - job?.ConvertToLocal(UserInfo); + var job = controller.GetJobDetails(this.UserInfo.IsSuperUser ? -1 : this.PortalSettings.PortalId, jobId); + job?.ConvertToLocal(this.UserInfo); return job != null - ? Request.CreateResponse(HttpStatusCode.OK, job) - : Request.CreateResponse(HttpStatusCode.BadRequest, + ? this.Request.CreateResponse(HttpStatusCode.OK, job) + : this.Request.CreateResponse(HttpStatusCode.BadRequest, new { message = Localization.GetString("JobNotExist", Constants.SharedResources) }); } } diff --git a/DNN Platform/Modules/DnnExportImport/packages.config b/DNN Platform/Modules/DnnExportImport/packages.config index 0dcaa4416b2..9bdd5552f1e 100644 --- a/DNN Platform/Modules/DnnExportImport/packages.config +++ b/DNN Platform/Modules/DnnExportImport/packages.config @@ -1,7 +1,8 @@ - - - - - - + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/DnnExportImportLibrary/DnnExportImportLibrary.csproj b/DNN Platform/Modules/DnnExportImportLibrary/DnnExportImportLibrary.csproj index 013aa681945..bcea679154e 100644 --- a/DNN Platform/Modules/DnnExportImportLibrary/DnnExportImportLibrary.csproj +++ b/DNN Platform/Modules/DnnExportImportLibrary/DnnExportImportLibrary.csproj @@ -1,101 +1,108 @@ - - - - - Debug - AnyCPU - {2C624453-4ED2-4BCB-9D71-664AC7D5955C} - Library - Properties - Dnn.ExportImport - DotNetNuke.SiteExportImport.Library - v4.7.2 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 1591 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 1591 - 7 - - - - ..\..\..\packages\LiteDB.3.1.0\lib\net35\LiteDB.dll - True - - - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + AnyCPU + {2C624453-4ED2-4BCB-9D71-664AC7D5955C} + Library + Properties + Dnn.ExportImport + DotNetNuke.SiteExportImport.Library + v4.7.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 1591 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + 1591 + 7 + + + + ..\..\..\packages\LiteDB.3.1.0\lib\net35\LiteDB.dll + True + + + + + + + Properties\SolutionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + + + + + + + --> \ No newline at end of file diff --git a/DNN Platform/Modules/DnnExportImportLibrary/Repository/ExportImportRepository.cs b/DNN Platform/Modules/DnnExportImportLibrary/Repository/ExportImportRepository.cs index a50f7e45e29..6fd6f9bd6e5 100644 --- a/DNN Platform/Modules/DnnExportImportLibrary/Repository/ExportImportRepository.cs +++ b/DNN Platform/Modules/DnnExportImportLibrary/Repository/ExportImportRepository.cs @@ -19,24 +19,24 @@ public class ExportImportRepository : IExportImportRepository public ExportImportRepository(string dbFileName) { - _liteDb = new LiteDatabase(dbFileName); - _liteDb.Mapper.EmptyStringToNull = false; - _liteDb.Mapper.TrimWhitespace = false; + this._liteDb = new LiteDatabase(dbFileName); + this._liteDb.Mapper.EmptyStringToNull = false; + this._liteDb.Mapper.TrimWhitespace = false; } ~ExportImportRepository() { - Dispose(false); + this.Dispose(false); } public void Dispose() { - Dispose(true); + this.Dispose(true); } private void Dispose(bool isDisposing) { - var temp = Interlocked.Exchange(ref _liteDb, null); + var temp = Interlocked.Exchange(ref this._liteDb, null); temp?.Dispose(); if (isDisposing) GC.SuppressFinalize(this); @@ -44,21 +44,21 @@ private void Dispose(bool isDisposing) public T AddSingleItem(T item) where T : class { - var collection = DbCollection(); + var collection = this.DbCollection(); collection.Insert(item); return item; } public T UpdateSingleItem(T item) where T : class { - var collection = DbCollection(); + var collection = this.DbCollection(); collection.Update(item); return item; } public T GetSingleItem() where T : class { - var collection = DbCollection(); + var collection = this.DbCollection(); var first = collection.Min(); return collection.FindById(first); } @@ -66,7 +66,7 @@ public T GetSingleItem() where T : class public T CreateItem(T item, int? referenceId) where T : BasicExportImportDto { if (item == null) return null; - var collection = DbCollection(); + var collection = this.DbCollection(); if (referenceId != null) { item.ReferenceId = referenceId; @@ -81,7 +81,7 @@ public void CreateItems(IEnumerable items, int? referenceId = null) where var allItems = items as List ?? items.ToList(); if (allItems.Count == 0) return; - var collection = DbCollection(); + var collection = this.DbCollection(); if (referenceId != null) { allItems.ForEach(x => { x.ReferenceId = referenceId; }); @@ -91,30 +91,30 @@ public void CreateItems(IEnumerable items, int? referenceId = null) where public T GetItem(Expression> predicate) where T : BasicExportImportDto { - return InternalGetItems(predicate).FirstOrDefault(); + return this.InternalGetItems(predicate).FirstOrDefault(); } public IEnumerable GetItems(Expression> predicate, Func orderKeySelector = null, bool asc = true, int? skip = null, int? max = null) where T : BasicExportImportDto { - return InternalGetItems(predicate, orderKeySelector, asc, skip, max); + return this.InternalGetItems(predicate, orderKeySelector, asc, skip, max); } public int GetCount() where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); return collection?.Count() ?? 0; } public int GetCount(Expression> predicate) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); return collection?.Count(predicate) ?? 0; } public void RebuildIndex(Expression> predicate, bool unique = false) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); collection.EnsureIndex(predicate, unique); } @@ -122,14 +122,14 @@ public IEnumerable GetAllItems( Func orderKeySelector = null, bool asc = true, int? skip = null, int? max = null) where T : BasicExportImportDto { - return InternalGetItems(null, orderKeySelector, asc, skip, max); + return this.InternalGetItems(null, orderKeySelector, asc, skip, max); } private IEnumerable InternalGetItems(Expression> predicate, Func orderKeySelector = null, bool asc = true, int? skip = null, int? max = null) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); var result = predicate != null ? collection.Find(predicate, skip ?? 0, max ?? int.MaxValue) @@ -143,7 +143,7 @@ private IEnumerable InternalGetItems(Expression> predicate, public T GetItem(int id) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); return collection.FindById(id); } @@ -151,26 +151,26 @@ public IEnumerable GetItems(IEnumerable idList) where T : BasicExportImportDto { Expression> predicate = p => idList.Contains(p.Id); - return InternalGetItems(predicate); + return this.InternalGetItems(predicate); } public IEnumerable GetRelatedItems(int referenceId) where T : BasicExportImportDto { Expression> predicate = p => p.ReferenceId == referenceId; - return InternalGetItems(predicate); + return this.InternalGetItems(predicate); } public IEnumerable FindItems(Expression> predicate) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); return collection.Find(predicate); } public void UpdateItem(T item) where T : BasicExportImportDto { if (item == null) return; - var collection = DbCollection(); + var collection = this.DbCollection(); if (collection.FindById(item.Id) == null) throw new KeyNotFoundException(); collection.Update(item); } @@ -180,13 +180,13 @@ public void UpdateItems(IEnumerable items) where T : BasicExportImportDto var allItems = items as T[] ?? items.ToArray(); if (allItems.Length == 0) return; - var collection = DbCollection(); + var collection = this.DbCollection(); collection.Update(allItems); } public bool DeleteItem(int id) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); var item = collection.FindById(id); if (item == null) throw new KeyNotFoundException(); return collection.Delete(id); @@ -194,15 +194,15 @@ public bool DeleteItem(int id) where T : BasicExportImportDto public void DeleteItems(Expression> deleteExpression) where T : BasicExportImportDto { - var collection = DbCollection(); + var collection = this.DbCollection(); if (deleteExpression != null) collection.Delete(deleteExpression); } public void CleanUpLocal(string collectionName) { - if (!_liteDb.CollectionExists(collectionName)) return; - var collection = _liteDb.GetCollection(collectionName); + if (!this._liteDb.CollectionExists(collectionName)) return; + var collection = this._liteDb.GetCollection(collectionName); var documentsToUpdate = collection.Find(Query.All()).ToList(); documentsToUpdate.ForEach(x => { @@ -213,7 +213,7 @@ public void CleanUpLocal(string collectionName) private LiteCollection DbCollection() { - return _liteDb.GetCollection(typeof(T).Name); + return this._liteDb.GetCollection(typeof(T).Name); } } } diff --git a/DNN Platform/Modules/DnnExportImportLibrary/packages.config b/DNN Platform/Modules/DnnExportImportLibrary/packages.config index 3b060073ba5..7f196becf5f 100644 --- a/DNN Platform/Modules/DnnExportImportLibrary/packages.config +++ b/DNN Platform/Modules/DnnExportImportLibrary/packages.config @@ -1,4 +1,5 @@ - - - + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/Groups/Components/GroupInfo.cs b/DNN Platform/Modules/Groups/Components/GroupInfo.cs index 6e4e38ba242..2330900786c 100644 --- a/DNN Platform/Modules/Groups/Components/GroupInfo.cs +++ b/DNN Platform/Modules/Groups/Components/GroupInfo.cs @@ -23,13 +23,13 @@ public GroupInfo() { } public GroupInfo(RoleInfo roleInfo) { - RoleID = roleInfo.RoleID; - RoleName = roleInfo.RoleName; - Description = roleInfo.Description; - PortalID = roleInfo.PortalID; - SecurityMode = roleInfo.SecurityMode; - ServiceFee = roleInfo.ServiceFee; - RSVPCode = roleInfo.RSVPCode; + this.RoleID = roleInfo.RoleID; + this.RoleName = roleInfo.RoleName; + this.Description = roleInfo.Description; + this.PortalID = roleInfo.PortalID; + this.SecurityMode = roleInfo.SecurityMode; + this.ServiceFee = roleInfo.ServiceFee; + this.RSVPCode = roleInfo.RSVPCode; @@ -55,64 +55,64 @@ public GroupInfo(RoleInfo roleInfo) { public string Street { get { - return GetString("Street", string.Empty); + return this.GetString("Street", string.Empty); } set { - SetString("Street",value); + this.SetString("Street",value); } } public string City { get { - return GetString("City", string.Empty); + return this.GetString("City", string.Empty); } set { - SetString("City", value); + this.SetString("City", value); } } public string Region { get { - return GetString("Region", string.Empty); + return this.GetString("Region", string.Empty); } set { - SetString("Region",value); + this.SetString("Region",value); } } public string Country { get { - return GetString("Country", string.Empty); + return this.GetString("Country", string.Empty); } set { - SetString("Country",value); + this.SetString("Country",value); } } public string PostalCode { get { - return GetString("PostalCode", string.Empty); + return this.GetString("PostalCode", string.Empty); } set { - SetString("PostalCode",value); + this.SetString("PostalCode",value); } } public string Website { get { - return GetString("Website", string.Empty); + return this.GetString("Website", string.Empty); } set { - SetString("Website",value); + this.SetString("Website",value); } } public bool Featured { get { - return Convert.ToBoolean(GetString("Featured","false")); + return Convert.ToBoolean(this.GetString("Featured","false")); } set { - SetString("Featured", value.ToString()); + this.SetString("Featured", value.ToString()); } } @@ -120,20 +120,20 @@ public bool Featured { private string GetString(string keyName, string defaultValue) { - if (Settings == null) { + if (this.Settings == null) { return defaultValue; } - if (Settings.ContainsKey(keyName)) { - return Settings[keyName]; + if (this.Settings.ContainsKey(keyName)) { + return this.Settings[keyName]; } else { return defaultValue; } } private void SetString(string keyName, string value) { - if (Settings.ContainsKey(keyName)) { - Settings[keyName] = value; + if (this.Settings.ContainsKey(keyName)) { + this.Settings[keyName] = value; } else { - Settings.Add(keyName, value); + this.Settings.Add(keyName, value); } } diff --git a/DNN Platform/Modules/Groups/Components/GroupItemPropertyAccess.cs b/DNN Platform/Modules/Groups/Components/GroupItemPropertyAccess.cs index 56711962e36..d4f82e2fca0 100644 --- a/DNN Platform/Modules/Groups/Components/GroupItemPropertyAccess.cs +++ b/DNN Platform/Modules/Groups/Components/GroupItemPropertyAccess.cs @@ -16,7 +16,7 @@ namespace DotNetNuke.Modules.Groups.Components { public class GroupItemTokenReplace : Services.Tokens.BaseCustomTokenReplace { public GroupItemTokenReplace(RoleInfo groupInfo) { - PropertySource["groupitem"] = groupInfo; + this.PropertySource["groupitem"] = groupInfo; } public string ReplaceGroupItemTokens(string source) { return base.ReplaceTokens(source); diff --git a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs index cb2e7da1a43..d6351b68bad 100644 --- a/DNN Platform/Modules/Groups/Components/GroupViewParser.cs +++ b/DNN Platform/Modules/Groups/Components/GroupViewParser.cs @@ -28,12 +28,12 @@ public class GroupViewParser public GroupViewParser(PortalSettings portalSettings, RoleInfo roleInfo, UserInfo currentUser, string template, int groupViewTabId) { - PortalSettings = portalSettings; - RoleInfo = roleInfo; - CurrentUser = currentUser; - Template = template; - GroupViewTabId = groupViewTabId; - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.PortalSettings = portalSettings; + this.RoleInfo = roleInfo; + this.CurrentUser = currentUser; + this.Template = template; + this.GroupViewTabId = groupViewTabId; + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public string ParseView() @@ -43,7 +43,7 @@ public string ParseView() if (HttpContext.Current.Request.IsAuthenticated) { - var userRoleInfo = CurrentUser.Social.Roles.FirstOrDefault(r => r.RoleID == RoleInfo.RoleID); + var userRoleInfo = this.CurrentUser.Social.Roles.FirstOrDefault(r => r.RoleID == this.RoleInfo.RoleID); if (userRoleInfo != null) { @@ -53,7 +53,7 @@ public string ParseView() membershipPending = true; } } - if (RoleInfo.CreatedByUserID == CurrentUser.UserID || CurrentUser.IsSuperUser) + if (this.RoleInfo.CreatedByUserID == this.CurrentUser.UserID || this.CurrentUser.IsSuperUser) { isOwner = true; } @@ -64,43 +64,43 @@ public string ParseView() if (isOwner) { - Template = Template.Replace("[GROUPEDITBUTTON]", String.Format(editUrl, GroupEditUrl)); - Template = Utilities.ParseTokenWrapper(Template, "IsNotOwner", false); - Template = Utilities.ParseTokenWrapper(Template, "IsOwner", true); + this.Template = this.Template.Replace("[GROUPEDITBUTTON]", String.Format(editUrl, this.GroupEditUrl)); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsNotOwner", false); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsOwner", true); } - else if (CurrentUser.IsInRole(RoleInfo.RoleName)) + else if (this.CurrentUser.IsInRole(this.RoleInfo.RoleName)) { - Template = Utilities.ParseTokenWrapper(Template, "IsNotOwner", true); - Template = Utilities.ParseTokenWrapper(Template, "IsOwner", false); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsNotOwner", true); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsOwner", false); } - Template = Utilities.ParseTokenWrapper(Template, "IsNotOwner", false); - Template = Utilities.ParseTokenWrapper(Template, "IsOwner", false); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsNotOwner", false); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsOwner", false); - if (CurrentUser.IsInRole(RoleInfo.RoleName) || !HttpContext.Current.Request.IsAuthenticated || membershipPending) - Template = Utilities.ParseTokenWrapper(Template, "IsNotMember", false); + if (this.CurrentUser.IsInRole(this.RoleInfo.RoleName) || !HttpContext.Current.Request.IsAuthenticated || membershipPending) + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsNotMember", false); else - Template = Utilities.ParseTokenWrapper(Template, "IsNotMember", true); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsNotMember", true); - if (CurrentUser.IsInRole(RoleInfo.RoleName)) + if (this.CurrentUser.IsInRole(this.RoleInfo.RoleName)) { - Template = Utilities.ParseTokenWrapper(Template, "IsMember", true); - Template = Utilities.ParseTokenWrapper(Template, "IsPendingMember", false); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsMember", true); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsPendingMember", false); } else - Template = Utilities.ParseTokenWrapper(Template, "IsMember", false); + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsMember", false); - Template = Utilities.ParseTokenWrapper(Template, "AllowJoin", RoleInfo.IsPublic); + this.Template = Utilities.ParseTokenWrapper(this.Template, "AllowJoin", this.RoleInfo.IsPublic); - Template = Template.Replace("[GROUPEDITBUTTON]", String.Empty); + this.Template = this.Template.Replace("[GROUPEDITBUTTON]", String.Empty); - var url = NavigationManager.NavigateURL(GroupViewTabId, "", new String[] { "groupid=" + RoleInfo.RoleID.ToString() }); + var url = this.NavigationManager.NavigateURL(this.GroupViewTabId, "", new String[] { "groupid=" + this.RoleInfo.RoleID.ToString() }); - Template = Utilities.ParseTokenWrapper(Template, "IsPendingMember", membershipPending); - Template = Template.Replace("[groupviewurl]", url); - Components.GroupItemTokenReplace tokenReplace = new Components.GroupItemTokenReplace(RoleInfo); - Template = tokenReplace.ReplaceGroupItemTokens(Template); - return Template; + this.Template = Utilities.ParseTokenWrapper(this.Template, "IsPendingMember", membershipPending); + this.Template = this.Template.Replace("[groupviewurl]", url); + Components.GroupItemTokenReplace tokenReplace = new Components.GroupItemTokenReplace(this.RoleInfo); + this.Template = tokenReplace.ReplaceGroupItemTokens(this.Template); + return this.Template; } } } diff --git a/DNN Platform/Modules/Groups/Components/GroupsBusinessController.cs b/DNN Platform/Modules/Groups/Components/GroupsBusinessController.cs index 9987d7705e8..db7cb9141fc 100644 --- a/DNN Platform/Modules/Groups/Components/GroupsBusinessController.cs +++ b/DNN Platform/Modules/Groups/Components/GroupsBusinessController.cs @@ -16,10 +16,10 @@ public string UpgradeModule(string version) switch (version) { case "06.02.00": - AddNotificationTypes(); + this.AddNotificationTypes(); break; case "06.02.04": - RemoveRejectActionForCreatedNotification(); + this.RemoveRejectActionForCreatedNotification(); break; case "07.00.00": ConvertNotificationTypeActionsFor700(); diff --git a/DNN Platform/Modules/Groups/Components/Notifications.cs b/DNN Platform/Modules/Groups/Components/Notifications.cs index 29836c8049b..c47473aefdf 100644 --- a/DNN Platform/Modules/Groups/Components/Notifications.cs +++ b/DNN Platform/Modules/Groups/Components/Notifications.cs @@ -15,11 +15,11 @@ namespace DotNetNuke.Modules.Groups.Components { public class Notifications { internal virtual Notification AddGroupNotification(string notificationTypeName, int tabId, int moduleId, RoleInfo group, UserInfo initiatingUser, IList moderators) { - return AddGroupNotification(notificationTypeName, tabId, moduleId, group, initiatingUser, moderators, null as UserInfo); + return this.AddGroupNotification(notificationTypeName, tabId, moduleId, group, initiatingUser, moderators, null as UserInfo); } internal virtual Notification AddGroupNotification(string notificationTypeName, int tabId, int moduleId, RoleInfo group, UserInfo initiatingUser, IList moderators, UserInfo recipient) { - return AddGroupNotification(notificationTypeName, tabId, moduleId, group, initiatingUser, moderators, recipient == null ? null : new List { recipient }); + return this.AddGroupNotification(notificationTypeName, tabId, moduleId, group, initiatingUser, moderators, recipient == null ? null : new List { recipient }); } internal virtual Notification AddGroupNotification(string notificationTypeName, int tabId, int moduleId, RoleInfo group, UserInfo initiatingUser, IList moderators, IList recipients) { var notificationType = NotificationsController.Instance.GetNotificationType(notificationTypeName); diff --git a/DNN Platform/Modules/Groups/Create.ascx.cs b/DNN Platform/Modules/Groups/Create.ascx.cs index 4cf12143c73..a6cb723badd 100644 --- a/DNN Platform/Modules/Groups/Create.ascx.cs +++ b/DNN Platform/Modules/Groups/Create.ascx.cs @@ -25,19 +25,19 @@ public partial class Create : GroupsModuleBase private readonly INavigationManager _navigationManager; public Create() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } protected override void OnInit(EventArgs e) { - InitializeComponent(); + this.InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { - Load += Page_Load; - btnCreate.Click += Create_Click; - btnCancel.Click += Cancel_Click; + this.Load += this.Page_Load; + this.btnCreate.Click += this.Create_Click; + this.btnCancel.Click += this.Cancel_Click; } @@ -48,51 +48,51 @@ protected void Page_Load(object sender, EventArgs e) private void Cancel_Click(object sender, EventArgs e) { - Response.Redirect(ModuleContext.NavigateUrl(TabId, string.Empty, false, null)); + this.Response.Redirect(this.ModuleContext.NavigateUrl(this.TabId, string.Empty, false, null)); } private void Create_Click(object sender, EventArgs e) { var ps = Security.PortalSecurity.Instance; - txtGroupName.Text = ps.InputFilter(txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoScripting); - txtGroupName.Text = ps.InputFilter(txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoMarkup); + this.txtGroupName.Text = ps.InputFilter(this.txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoScripting); + this.txtGroupName.Text = ps.InputFilter(this.txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoMarkup); - txtDescription.Text = ps.InputFilter(txtDescription.Text, Security.PortalSecurity.FilterFlag.NoScripting); - txtDescription.Text = ps.InputFilter(txtDescription.Text, Security.PortalSecurity.FilterFlag.NoMarkup); - if (RoleController.Instance.GetRoleByName(PortalId, txtGroupName.Text) != null) + this.txtDescription.Text = ps.InputFilter(this.txtDescription.Text, Security.PortalSecurity.FilterFlag.NoScripting); + this.txtDescription.Text = ps.InputFilter(this.txtDescription.Text, Security.PortalSecurity.FilterFlag.NoMarkup); + if (RoleController.Instance.GetRoleByName(this.PortalId, this.txtGroupName.Text) != null) { - lblInvalidGroupName.Visible = true; + this.lblInvalidGroupName.Visible = true; return; } var modRoles = new List(); var modUsers = new List(); - foreach (ModulePermissionInfo modulePermissionInfo in ModulePermissionController.GetModulePermissions(ModuleId, TabId)) + foreach (ModulePermissionInfo modulePermissionInfo in ModulePermissionController.GetModulePermissions(this.ModuleId, this.TabId)) { if (modulePermissionInfo.PermissionKey == "MODGROUP" && modulePermissionInfo.AllowAccess) { if (modulePermissionInfo.RoleID > int.Parse(Globals.glbRoleNothing)) { - modRoles.Add(RoleController.Instance.GetRoleById(PortalId, modulePermissionInfo.RoleID)); + modRoles.Add(RoleController.Instance.GetRoleById(this.PortalId, modulePermissionInfo.RoleID)); } else if (modulePermissionInfo.UserID > Null.NullInteger) { - modUsers.Add(UserController.GetUserById(PortalId, modulePermissionInfo.UserID)); + modUsers.Add(UserController.GetUserById(this.PortalId, modulePermissionInfo.UserID)); } } } var roleInfo = new RoleInfo() { - PortalID = PortalId, - RoleName = txtGroupName.Text, - Description = txtDescription.Text, + PortalID = this.PortalId, + RoleName = this.txtGroupName.Text, + Description = this.txtDescription.Text, SecurityMode = SecurityMode.SocialGroup, Status = RoleStatus.Approved, - IsPublic = rdAccessTypePublic.Checked + IsPublic = this.rdAccessTypePublic.Checked }; var userRoleStatus = RoleStatus.Pending; - if (GroupModerationEnabled) + if (this.GroupModerationEnabled) { roleInfo.Status = RoleStatus.Pending; userRoleStatus = RoleStatus.Pending; @@ -102,14 +102,14 @@ private void Create_Click(object sender, EventArgs e) userRoleStatus = RoleStatus.Approved; } - var objModulePermissions = new ModulePermissionCollection(CBO.FillCollection(DataProvider.Instance().GetModulePermissionsByModuleID(ModuleId, -1), typeof(ModulePermissionInfo))); + var objModulePermissions = new ModulePermissionCollection(CBO.FillCollection(DataProvider.Instance().GetModulePermissionsByModuleID(this.ModuleId, -1), typeof(ModulePermissionInfo))); if (ModulePermissionController.HasModulePermission(objModulePermissions, "MODGROUP")) { roleInfo.Status = RoleStatus.Approved; userRoleStatus = RoleStatus.Approved; } - var roleGroupId = DefaultRoleGroupId; + var roleGroupId = this.DefaultRoleGroupId; if (roleGroupId < Null.NullInteger) { roleGroupId = Null.NullInteger; @@ -117,9 +117,9 @@ private void Create_Click(object sender, EventArgs e) roleInfo.RoleGroupID = roleGroupId; roleInfo.RoleID = RoleController.Instance.AddRole(roleInfo); - roleInfo = RoleController.Instance.GetRoleById(PortalId, roleInfo.RoleID); + roleInfo = RoleController.Instance.GetRoleById(this.PortalId, roleInfo.RoleID); - var groupUrl = _navigationManager.NavigateURL(GroupViewTabId, "", new String[] {"groupid=" + roleInfo.RoleID.ToString()}); + var groupUrl = this._navigationManager.NavigateURL(this.GroupViewTabId, "", new String[] {"groupid=" + roleInfo.RoleID.ToString()}); if (groupUrl.StartsWith("http://") || groupUrl.StartsWith("https://")) { const int startIndex = 8; // length of https:// @@ -127,25 +127,25 @@ private void Create_Click(object sender, EventArgs e) } roleInfo.Settings.Add("URL", groupUrl); - roleInfo.Settings.Add("GroupCreatorName", UserInfo.DisplayName); - roleInfo.Settings.Add("ReviewMembers", chkMemberApproved.Checked.ToString()); + roleInfo.Settings.Add("GroupCreatorName", this.UserInfo.DisplayName); + roleInfo.Settings.Add("ReviewMembers", this.chkMemberApproved.Checked.ToString()); RoleController.Instance.UpdateRoleSettings(roleInfo, true); - if (inpFile.PostedFile != null && inpFile.PostedFile.ContentLength > 0) + if (this.inpFile.PostedFile != null && this.inpFile.PostedFile.ContentLength > 0) { IFileManager _fileManager = FileManager.Instance; IFolderManager _folderManager = FolderManager.Instance; - var rootFolderPath = PathUtils.Instance.FormatFolderPath(PortalSettings.HomeDirectory); + var rootFolderPath = PathUtils.Instance.FormatFolderPath(this.PortalSettings.HomeDirectory); - IFolderInfo groupFolder = _folderManager.GetFolder(PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); + IFolderInfo groupFolder = _folderManager.GetFolder(this.PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); if (groupFolder == null) { - groupFolder = _folderManager.AddFolder(PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); + groupFolder = _folderManager.AddFolder(this.PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); } if (groupFolder != null) { - var fileName = Path.GetFileName(inpFile.PostedFile.FileName); - var fileInfo = _fileManager.AddFile(groupFolder, fileName, inpFile.PostedFile.InputStream, true); + var fileName = Path.GetFileName(this.inpFile.PostedFile.FileName); + var fileInfo = _fileManager.AddFile(groupFolder, fileName, this.inpFile.PostedFile.InputStream, true); roleInfo.IconFile = "FileID=" + fileInfo.FileId; RoleController.Instance.UpdateRole(roleInfo); } @@ -154,22 +154,22 @@ private void Create_Click(object sender, EventArgs e) var notifications = new Notifications(); - RoleController.Instance.AddUserRole(PortalId, UserId, roleInfo.RoleID, userRoleStatus, true, Null.NullDate, Null.NullDate); + RoleController.Instance.AddUserRole(this.PortalId, this.UserId, roleInfo.RoleID, userRoleStatus, true, Null.NullDate, Null.NullDate); if (roleInfo.Status == RoleStatus.Pending) { //Send notification to Group Moderators to approve/reject group. - notifications.AddGroupNotification(Constants.GroupPendingNotification, GroupViewTabId, ModuleId, roleInfo, UserInfo, modRoles, modUsers); + notifications.AddGroupNotification(Constants.GroupPendingNotification, this.GroupViewTabId, this.ModuleId, roleInfo, this.UserInfo, modRoles, modUsers); } else { //Send notification to Group Moderators informing of new group. - notifications.AddGroupNotification(Constants.GroupCreatedNotification, GroupViewTabId, ModuleId, roleInfo, UserInfo, modRoles, modUsers); + notifications.AddGroupNotification(Constants.GroupCreatedNotification, this.GroupViewTabId, this.ModuleId, roleInfo, this.UserInfo, modRoles, modUsers); //Add entry to journal. - GroupUtilities.CreateJournalEntry(roleInfo, UserInfo); + GroupUtilities.CreateJournalEntry(roleInfo, this.UserInfo); } - Response.Redirect(ModuleContext.NavigateUrl(TabId, string.Empty, false, null)); + this.Response.Redirect(this.ModuleContext.NavigateUrl(this.TabId, string.Empty, false, null)); } } } diff --git a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj index 3a9179c47d5..e173507eaa9 100644 --- a/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj +++ b/DNN Platform/Modules/Groups/DotNetNuke.Modules.Groups.csproj @@ -202,6 +202,9 @@ + + stylecop.json + Designer @@ -255,7 +258,10 @@ Designer - + + + + diff --git a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs index fc132981300..25da1e06af4 100644 --- a/DNN Platform/Modules/Groups/GroupEdit.ascx.cs +++ b/DNN Platform/Modules/Groups/GroupEdit.ascx.cs @@ -19,20 +19,20 @@ public partial class GroupEdit : GroupsModuleBase private readonly INavigationManager _navigationManager; public GroupEdit() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } protected override void OnInit(EventArgs e) { - InitializeComponent(); + this.InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { - Load += Page_Load; - btnSave.Click += Save_Click; - btnCancel.Click += Cancel_Click; + this.Load += this.Page_Load; + this.btnSave.Click += this.Save_Click; + this.btnCancel.Click += this.Cancel_Click; } @@ -40,73 +40,73 @@ protected void Page_Load(object sender, EventArgs e) { JavaScript.RequestRegistration(CommonJs.DnnPlugins); - imgGroup.Src = Page.ResolveUrl("~/DesktopModules/SocialGroups/Images/") + "sample-group-profile.jpg"; - if (!Page.IsPostBack && GroupId > 0) + this.imgGroup.Src = this.Page.ResolveUrl("~/DesktopModules/SocialGroups/Images/") + "sample-group-profile.jpg"; + if (!this.Page.IsPostBack && this.GroupId > 0) { - var roleInfo = RoleController.Instance.GetRoleById(PortalId, GroupId); + var roleInfo = RoleController.Instance.GetRoleById(this.PortalId, this.GroupId); if (roleInfo != null) { - if (!UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) + if (!this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) { - if (roleInfo.CreatedByUserID != UserInfo.UserID) + if (roleInfo.CreatedByUserID != this.UserInfo.UserID) { - Response.Redirect(ModuleContext.NavigateUrl(TabId, "", false, new String[] { "groupid=" + GroupId.ToString() })); + this.Response.Redirect(this.ModuleContext.NavigateUrl(this.TabId, "", false, new String[] { "groupid=" + this.GroupId.ToString() })); } } - txtGroupName.Visible = !roleInfo.IsSystemRole; - reqGroupName.Enabled = !roleInfo.IsSystemRole; + this.txtGroupName.Visible = !roleInfo.IsSystemRole; + this.reqGroupName.Enabled = !roleInfo.IsSystemRole; if(!roleInfo.IsSystemRole) - txtGroupName.Text = roleInfo.RoleName; + this.txtGroupName.Text = roleInfo.RoleName; else - litGroupName.Text = roleInfo.RoleName; + this.litGroupName.Text = roleInfo.RoleName; - txtDescription.Text = roleInfo.Description; - rdAccessTypePrivate.Checked = !roleInfo.IsPublic; - rdAccessTypePublic.Checked = roleInfo.IsPublic; + this.txtDescription.Text = roleInfo.Description; + this.rdAccessTypePrivate.Checked = !roleInfo.IsPublic; + this.rdAccessTypePublic.Checked = roleInfo.IsPublic; if (roleInfo.Settings.ContainsKey("ReviewMembers")) { - chkMemberApproved.Checked = Convert.ToBoolean(roleInfo.Settings["ReviewMembers"].ToString()); + this.chkMemberApproved.Checked = Convert.ToBoolean(roleInfo.Settings["ReviewMembers"].ToString()); } - imgGroup.Src = roleInfo.PhotoURL; + this.imgGroup.Src = roleInfo.PhotoURL; } else { - Response.Redirect(ModuleContext.NavigateUrl(TabId, "", false)); + this.Response.Redirect(this.ModuleContext.NavigateUrl(this.TabId, "", false)); } } } private void Cancel_Click(object sender, EventArgs e) { - Response.Redirect(ModuleContext.NavigateUrl(TabId, "", false, new String[] { "groupid=" + GroupId.ToString() })); + this.Response.Redirect(this.ModuleContext.NavigateUrl(this.TabId, "", false, new String[] { "groupid=" + this.GroupId.ToString() })); } private void Save_Click(object sender, EventArgs e) { - if (GroupId > 0) + if (this.GroupId > 0) { Security.PortalSecurity ps = Security.PortalSecurity.Instance; - txtGroupName.Text = ps.InputFilter(txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoScripting); - txtGroupName.Text = ps.InputFilter(txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoMarkup); - txtDescription.Text = ps.InputFilter(txtDescription.Text, Security.PortalSecurity.FilterFlag.NoScripting); - txtDescription.Text = ps.InputFilter(txtDescription.Text, Security.PortalSecurity.FilterFlag.NoMarkup); + this.txtGroupName.Text = ps.InputFilter(this.txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoScripting); + this.txtGroupName.Text = ps.InputFilter(this.txtGroupName.Text, Security.PortalSecurity.FilterFlag.NoMarkup); + this.txtDescription.Text = ps.InputFilter(this.txtDescription.Text, Security.PortalSecurity.FilterFlag.NoScripting); + this.txtDescription.Text = ps.InputFilter(this.txtDescription.Text, Security.PortalSecurity.FilterFlag.NoMarkup); - var roleInfo = RoleController.Instance.GetRoleById(PortalId, GroupId); + var roleInfo = RoleController.Instance.GetRoleById(this.PortalId, this.GroupId); if (roleInfo != null) { - if (txtGroupName.Visible) //if this is visible assume that we're editing the groupname + if (this.txtGroupName.Visible) //if this is visible assume that we're editing the groupname { - if (txtGroupName.Text != roleInfo.RoleName) + if (this.txtGroupName.Text != roleInfo.RoleName) { - if (RoleController.Instance.GetRoleByName(PortalId, txtGroupName.Text) != null) + if (RoleController.Instance.GetRoleByName(this.PortalId, this.txtGroupName.Text) != null) { - lblInvalidGroupName.Visible = true; + this.lblInvalidGroupName.Visible = true; return; } } @@ -114,35 +114,35 @@ private void Save_Click(object sender, EventArgs e) if(!roleInfo.IsSystemRole) { - roleInfo.RoleName = txtGroupName.Text; + roleInfo.RoleName = this.txtGroupName.Text; } - roleInfo.Description = txtDescription.Text; - roleInfo.IsPublic = rdAccessTypePublic.Checked; + roleInfo.Description = this.txtDescription.Text; + roleInfo.IsPublic = this.rdAccessTypePublic.Checked; if (roleInfo.Settings.ContainsKey("ReviewMembers")) - roleInfo.Settings["ReviewMembers"] = chkMemberApproved.Checked.ToString(); + roleInfo.Settings["ReviewMembers"] = this.chkMemberApproved.Checked.ToString(); else - roleInfo.Settings.Add("ReviewMembers", chkMemberApproved.Checked.ToString()); + roleInfo.Settings.Add("ReviewMembers", this.chkMemberApproved.Checked.ToString()); RoleController.Instance.UpdateRoleSettings(roleInfo, true); RoleController.Instance.UpdateRole(roleInfo); - if (inpFile.PostedFile.ContentLength > 0) + if (this.inpFile.PostedFile.ContentLength > 0) { IFileManager _fileManager = FileManager.Instance; IFolderManager _folderManager = FolderManager.Instance; - var rootFolderPath = PathUtils.Instance.FormatFolderPath(PortalSettings.HomeDirectory); + var rootFolderPath = PathUtils.Instance.FormatFolderPath(this.PortalSettings.HomeDirectory); - IFolderInfo groupFolder = _folderManager.GetFolder(PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); + IFolderInfo groupFolder = _folderManager.GetFolder(this.PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); if (groupFolder == null) { - groupFolder = _folderManager.AddFolder(PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); + groupFolder = _folderManager.AddFolder(this.PortalSettings.PortalId, "Groups/" + roleInfo.RoleID); } if (groupFolder != null) { - var fileName = Path.GetFileName(inpFile.PostedFile.FileName); - var fileInfo = _fileManager.AddFile(groupFolder, fileName, inpFile.PostedFile.InputStream, true); + var fileName = Path.GetFileName(this.inpFile.PostedFile.FileName); + var fileInfo = _fileManager.AddFile(groupFolder, fileName, this.inpFile.PostedFile.InputStream, true); roleInfo.IconFile = "FileID=" + fileInfo.FileId; RoleController.Instance.UpdateRole(roleInfo); } @@ -153,7 +153,7 @@ private void Save_Click(object sender, EventArgs e) } - Response.Redirect(_navigationManager.NavigateURL(TabId, "", new String[] { "groupid=" + GroupId.ToString() })); + this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId, "", new String[] { "groupid=" + this.GroupId.ToString() })); } } } diff --git a/DNN Platform/Modules/Groups/GroupListControl.cs b/DNN Platform/Modules/Groups/GroupListControl.cs index d86da8f661f..ad0aa285046 100644 --- a/DNN Platform/Modules/Groups/GroupListControl.cs +++ b/DNN Platform/Modules/Groups/GroupListControl.cs @@ -82,7 +82,7 @@ public PortalSettings PortalSettings protected override void OnInit(EventArgs e) { base.OnInit(e); - currentUser = UserController.Instance.GetCurrentUserInfo(); + this.currentUser = UserController.Instance.GetCurrentUserInfo(); } @@ -104,43 +104,43 @@ protected override void Render(HtmlTextWriter output) grp => grp.SecurityMode != SecurityMode.SecurityRole && grp.Status == RoleStatus.Approved }; - if (RoleGroupId >= -1) + if (this.RoleGroupId >= -1) { - whereCls.Add(grp => grp.RoleGroupID == RoleGroupId); + whereCls.Add(grp => grp.RoleGroupID == this.RoleGroupId); } - if (DisplayCurrentUserGroups) - whereCls.Add(grp => currentUser.IsInRole(grp.RoleName)); + if (this.DisplayCurrentUserGroups) + whereCls.Add(grp => this.currentUser.IsInRole(grp.RoleName)); else - whereCls.Add(grp => grp.IsPublic || currentUser.IsInRole(grp.RoleName) || currentUser.IsInRole(PortalSettings.AdministratorRoleName)); + whereCls.Add(grp => grp.IsPublic || this.currentUser.IsInRole(grp.RoleName) || this.currentUser.IsInRole(this.PortalSettings.AdministratorRoleName)); - if (!string.IsNullOrEmpty(SearchFilter)) + if (!string.IsNullOrEmpty(this.SearchFilter)) { - whereCls.Add(grp => grp.RoleName.ToLowerInvariant().Contains(SearchFilter.ToLowerInvariant()) || grp.Description.ToLowerInvariant().Contains(SearchFilter.ToLowerInvariant())); + whereCls.Add(grp => grp.RoleName.ToLowerInvariant().Contains(this.SearchFilter.ToLowerInvariant()) || grp.Description.ToLowerInvariant().Contains(this.SearchFilter.ToLowerInvariant())); } - var roles = RoleController.Instance.GetRoles(PortalSettings.PortalId, grp => TestPredicateGroup(whereCls, grp)); + var roles = RoleController.Instance.GetRoles(this.PortalSettings.PortalId, grp => TestPredicateGroup(whereCls, grp)); - if (SortDirection.ToLowerInvariant() == "asc") - roles = roles.OrderBy(info => GetOrderByProperty(info, SortField)).ToList(); + if (this.SortDirection.ToLowerInvariant() == "asc") + roles = roles.OrderBy(info => GetOrderByProperty(info, this.SortField)).ToList(); else - roles = roles.OrderByDescending(info => GetOrderByProperty(info, SortField)).ToList(); + roles = roles.OrderByDescending(info => GetOrderByProperty(info, this.SortField)).ToList(); - decimal pages = (decimal)roles.Count / (decimal)PageSize; + decimal pages = (decimal)roles.Count / (decimal)this.PageSize; - output.Write(HeaderTemplate); + output.Write(this.HeaderTemplate); - ItemTemplate = ItemTemplate.Replace("{resx:posts}", Localization.GetString("posts", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("{resx:members}", Localization.GetString("members", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("{resx:photos}", Localization.GetString("photos", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("{resx:documents}", Localization.GetString("documents", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:posts}", Localization.GetString("posts", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:members}", Localization.GetString("members", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:photos}", Localization.GetString("photos", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:documents}", Localization.GetString("documents", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("{resx:Join}", Localization.GetString("Join", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("{resx:Pending}", Localization.GetString("Pending", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("{resx:LeaveGroup}", Localization.GetString("LeaveGroup", Constants.SharedResourcesPath)); - ItemTemplate = ItemTemplate.Replace("[GroupViewTabId]", GroupViewTabId.ToString()); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:Join}", Localization.GetString("Join", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:Pending}", Localization.GetString("Pending", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("{resx:LeaveGroup}", Localization.GetString("LeaveGroup", Constants.SharedResourcesPath)); + this.ItemTemplate = this.ItemTemplate.Replace("[GroupViewTabId]", this.GroupViewTabId.ToString()); if (roles.Count == 0) output.Write(String.Format("
    {0}
    ", Localization.GetString("NoGroupsFound", Constants.SharedResourcesPath))); @@ -148,46 +148,46 @@ protected override void Render(HtmlTextWriter output) if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["page"])) { - CurrentIndex = Convert.ToInt32(HttpContext.Current.Request.QueryString["page"].ToString()); - CurrentIndex = CurrentIndex - 1; + this.CurrentIndex = Convert.ToInt32(HttpContext.Current.Request.QueryString["page"].ToString()); + this.CurrentIndex = this.CurrentIndex - 1; } int rowItem = 0; - int recordStart = (CurrentIndex * PageSize); + int recordStart = (this.CurrentIndex * this.PageSize); - if (CurrentIndex == 0) + if (this.CurrentIndex == 0) recordStart = 0; - for (int x = recordStart; x < (recordStart + PageSize); x++) + for (int x = recordStart; x < (recordStart + this.PageSize); x++) { if (x > roles.Count - 1) break; var role = roles[x]; - string rowTemplate = ItemTemplate; + string rowTemplate = this.ItemTemplate; if (rowItem == 0) - output.Write(RowHeaderTemplate); + output.Write(this.RowHeaderTemplate); - var groupParser = new GroupViewParser(PortalSettings, role, currentUser, rowTemplate, GroupViewTabId); + var groupParser = new GroupViewParser(this.PortalSettings, role, this.currentUser, rowTemplate, this.GroupViewTabId); output.Write(groupParser.ParseView()); rowItem += 1; - if (rowItem == ItemsPerRow) + if (rowItem == this.ItemsPerRow) { - output.Write(RowFooterTemplate); + output.Write(this.RowFooterTemplate); rowItem = 0; } } if (rowItem > 0) - output.Write(RowFooterTemplate); + output.Write(this.RowFooterTemplate); - output.Write(FooterTemplate); + output.Write(this.FooterTemplate); int TotalPages = Convert.ToInt32(System.Math.Ceiling(pages)); @@ -219,11 +219,11 @@ protected override void Render(HtmlTextWriter output) @params = new string[] { "page=" + x.ToString() }; } - string sUrl = Utilities.NavigateUrl(TabId, @params); + string sUrl = Utilities.NavigateUrl(this.TabId, @params); string cssClass = "pagerItem"; - if (x - 1 == CurrentIndex) + if (x - 1 == this.CurrentIndex) cssClass = "pagerItemSelected"; diff --git a/DNN Platform/Modules/Groups/GroupView.ascx.cs b/DNN Platform/Modules/Groups/GroupView.ascx.cs index 67001485e3f..dcc8bd4fe8c 100644 --- a/DNN Platform/Modules/Groups/GroupView.ascx.cs +++ b/DNN Platform/Modules/Groups/GroupView.ascx.cs @@ -25,28 +25,28 @@ public partial class GroupView : GroupsModuleBase protected void Page_Load(object sender, EventArgs e) { - RoleInfo role = RoleController.Instance.GetRole(PortalId, r => r.SecurityMode != SecurityMode.SecurityRole && r.RoleID == GroupId); - if (role == null && GroupId > 0) + RoleInfo role = RoleController.Instance.GetRole(this.PortalId, r => r.SecurityMode != SecurityMode.SecurityRole && r.RoleID == this.GroupId); + if (role == null && this.GroupId > 0) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("GroupIdNotFound", Constants.SharedResourcesPath), ModuleMessage.ModuleMessageType.YellowWarning); } - if (role == null && (UserInfo.IsInRole(PortalSettings.AdministratorRoleName) || UserInfo.IsSuperUser)) + if (role == null && (this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName) || this.UserInfo.IsSuperUser)) { role = new RoleInfo(); role.RoleID = -1; - role.RoleName = Localization.GetString("Sample_RoleName", LocalResourceFile); - role.Description = Localization.GetString("Sample_RoleDescription", LocalResourceFile); + role.RoleName = Localization.GetString("Sample_RoleName", this.LocalResourceFile); + role.Description = Localization.GetString("Sample_RoleDescription", this.LocalResourceFile); } if (role == null) - litOutput.Text = string.Empty; + this.litOutput.Text = string.Empty; else { var resxPath = Constants.SharedResourcesPath; - var template = GroupViewTemplate; + var template = this.GroupViewTemplate; template = template.Replace("{resx:posts}", Localization.GetString("posts", resxPath)); template = template.Replace("{resx:members}", Localization.GetString("members", resxPath)); template = template.Replace("{resx:photos}", Localization.GetString("photos", resxPath)); @@ -57,13 +57,13 @@ protected void Page_Load(object sender, EventArgs e) template = template.Replace("{resx:Pending}", Localization.GetString("Pending", resxPath)); template = template.Replace("{resx:LeaveGroup}", Localization.GetString("LeaveGroup", resxPath)); template = template.Replace("{resx:EditGroup}", Localization.GetString("EditGroup", resxPath)); - template = template.Replace("[GroupViewTabId]", GroupViewTabId.ToString()); + template = template.Replace("[GroupViewTabId]", this.GroupViewTabId.ToString()); - var groupParser = new GroupViewParser(PortalSettings, role, UserInfo, template, TabId); - groupParser.GroupEditUrl = GetEditUrl(); + var groupParser = new GroupViewParser(this.PortalSettings, role, this.UserInfo, template, this.TabId); + groupParser.GroupEditUrl = this.GetEditUrl(); - litOutput.Text = groupParser.ParseView(); + this.litOutput.Text = groupParser.ParseView(); } diff --git a/DNN Platform/Modules/Groups/GroupsModuleBase.cs b/DNN Platform/Modules/Groups/GroupsModuleBase.cs index dd4baf9dc23..a9a2f294c83 100644 --- a/DNN Platform/Modules/Groups/GroupsModuleBase.cs +++ b/DNN Platform/Modules/Groups/GroupsModuleBase.cs @@ -22,7 +22,7 @@ public class GroupsModuleBase : PortalModuleBase protected INavigationManager NavigationManager { get; } public GroupsModuleBase() { - NavigationManager = DependencyProvider.GetRequiredService(); + this.NavigationManager = this.DependencyProvider.GetRequiredService(); } public enum GroupMode @@ -38,9 +38,9 @@ public GroupMode LoadView get { var mode = GroupMode.Setup; - if (Settings.ContainsKey(Constants.GroupLoadView)) + if (this.Settings.ContainsKey(Constants.GroupLoadView)) { - switch (Settings[Constants.GroupLoadView].ToString()) + switch (this.Settings[Constants.GroupLoadView].ToString()) { case "List": mode = GroupMode.List; @@ -58,11 +58,11 @@ public int GroupId get { int groupId = -1; - if (string.IsNullOrEmpty(Request.QueryString["GroupId"])) + if (string.IsNullOrEmpty(this.Request.QueryString["GroupId"])) { return groupId; } - if (int.TryParse(Request.QueryString["GroupId"], out groupId)) + if (int.TryParse(this.Request.QueryString["GroupId"], out groupId)) { return groupId; } @@ -74,10 +74,10 @@ public int DefaultRoleGroupId get { var roleGroupId = Null.NullInteger; - if (Settings.ContainsKey(Constants.DefaultRoleGroupSetting)) + if (this.Settings.ContainsKey(Constants.DefaultRoleGroupSetting)) { int id; - if (int.TryParse(Settings[Constants.DefaultRoleGroupSetting].ToString(), out id)) + if (int.TryParse(this.Settings[Constants.DefaultRoleGroupSetting].ToString(), out id)) roleGroupId = id; } @@ -88,34 +88,34 @@ public int GroupListTabId { get { - if (Settings.ContainsKey(Constants.GroupListPage)) + if (this.Settings.ContainsKey(Constants.GroupListPage)) { - return Convert.ToInt32(Settings[Constants.GroupListPage].ToString()); + return Convert.ToInt32(this.Settings[Constants.GroupListPage].ToString()); } - return TabId; + return this.TabId; } } public int GroupViewTabId { get { - if (Settings.ContainsKey(Constants.GroupViewPage)) + if (this.Settings.ContainsKey(Constants.GroupViewPage)) { - return Convert.ToInt32(Settings[Constants.GroupViewPage].ToString()); + return Convert.ToInt32(this.Settings[Constants.GroupViewPage].ToString()); } - return TabId; + return this.TabId; } } public string GroupViewTemplate { get { - string template = LocalizeString("GroupViewTemplate.Text"); - if (Settings.ContainsKey(Constants.GroupViewTemplate)) + string template = this.LocalizeString("GroupViewTemplate.Text"); + if (this.Settings.ContainsKey(Constants.GroupViewTemplate)) { - if (!string.IsNullOrEmpty(Settings[Constants.GroupViewTemplate].ToString())) + if (!string.IsNullOrEmpty(this.Settings[Constants.GroupViewTemplate].ToString())) { - template = Settings[Constants.GroupViewTemplate].ToString(); + template = this.Settings[Constants.GroupViewTemplate].ToString(); } } return template; @@ -125,12 +125,12 @@ public string GroupListTemplate { get { - string template = LocalizeString("GroupListTemplate.Text"); - if (Settings.ContainsKey(Constants.GroupListTemplate)) + string template = this.LocalizeString("GroupListTemplate.Text"); + if (this.Settings.ContainsKey(Constants.GroupListTemplate)) { - if (!string.IsNullOrEmpty(Settings[Constants.GroupListTemplate].ToString())) + if (!string.IsNullOrEmpty(this.Settings[Constants.GroupListTemplate].ToString())) { - template = Settings[Constants.GroupListTemplate].ToString(); + template = this.Settings[Constants.GroupListTemplate].ToString(); } } return template; @@ -140,9 +140,9 @@ public string DefaultGroupMode { get { - if (Settings.ContainsKey(Constants.DefautlGroupViewMode)) + if (this.Settings.ContainsKey(Constants.DefautlGroupViewMode)) { - return Settings[Constants.DefautlGroupViewMode].ToString(); + return this.Settings[Constants.DefautlGroupViewMode].ToString(); } return ""; } @@ -151,9 +151,9 @@ public bool GroupModerationEnabled { get { - if (Settings.ContainsKey(Constants.GroupModerationEnabled)) + if (this.Settings.ContainsKey(Constants.GroupModerationEnabled)) { - return Convert.ToBoolean(Settings[Constants.GroupModerationEnabled].ToString()); + return Convert.ToBoolean(this.Settings[Constants.GroupModerationEnabled].ToString()); } return false; } @@ -162,13 +162,13 @@ public bool CanCreate { get { - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - if (UserInfo.IsSuperUser) + if (this.UserInfo.IsSuperUser) { return true; } - return ModulePermissionController.HasModulePermission(ModuleConfiguration.ModulePermissions, "CREATEGROUP"); + return ModulePermissionController.HasModulePermission(this.ModuleConfiguration.ModulePermissions, "CREATEGROUP"); } return false; } @@ -178,7 +178,7 @@ public string GroupListFilter { get { - return Request.QueryString["Filter"]; + return this.Request.QueryString["Filter"]; } } @@ -186,11 +186,11 @@ public int GroupListPageSize { get { - if (Settings.ContainsKey(Constants.GroupListPageSize)) + if (this.Settings.ContainsKey(Constants.GroupListPageSize)) { - if (!string.IsNullOrEmpty(Settings[Constants.GroupListPageSize].ToString())) + if (!string.IsNullOrEmpty(this.Settings[Constants.GroupListPageSize].ToString())) { - return Convert.ToInt32(Settings[Constants.GroupListPageSize].ToString()); + return Convert.ToInt32(this.Settings[Constants.GroupListPageSize].ToString()); } } return 20; @@ -202,11 +202,11 @@ public bool GroupListSearchEnabled { var enableSearch = false; - if (Settings.ContainsKey(Constants.GroupListSearchEnabled)) + if (this.Settings.ContainsKey(Constants.GroupListSearchEnabled)) { - if (!string.IsNullOrEmpty(Settings[Constants.GroupListSearchEnabled].ToString())) + if (!string.IsNullOrEmpty(this.Settings[Constants.GroupListSearchEnabled].ToString())) { - bool.TryParse(Settings[Constants.GroupListSearchEnabled].ToString(), out enableSearch); + bool.TryParse(this.Settings[Constants.GroupListSearchEnabled].ToString(), out enableSearch); } } @@ -217,14 +217,14 @@ public string GroupListSortField { get { - return Settings.ContainsKey(Constants.GroupListSortField) ? Settings[Constants.GroupListSortField].ToString() : ""; + return this.Settings.ContainsKey(Constants.GroupListSortField) ? this.Settings[Constants.GroupListSortField].ToString() : ""; } } public string GroupListSortDirection { get { - return Settings.ContainsKey(Constants.GroupListSortDirection) ? Settings[Constants.GroupListSortDirection].ToString() : ""; + return this.Settings.ContainsKey(Constants.GroupListSortDirection) ? this.Settings[Constants.GroupListSortDirection].ToString() : ""; } } public bool GroupListUserGroupsOnly @@ -233,11 +233,11 @@ public bool GroupListUserGroupsOnly { var userGroupsOnly = false; - if (Settings.ContainsKey(Constants.GroupListUserGroupsOnly)) + if (this.Settings.ContainsKey(Constants.GroupListUserGroupsOnly)) { - if (!string.IsNullOrEmpty(Settings[Constants.GroupListUserGroupsOnly].ToString())) + if (!string.IsNullOrEmpty(this.Settings[Constants.GroupListUserGroupsOnly].ToString())) { - bool.TryParse(Settings[Constants.GroupListUserGroupsOnly].ToString(), out userGroupsOnly); + bool.TryParse(this.Settings[Constants.GroupListUserGroupsOnly].ToString(), out userGroupsOnly); } } @@ -251,17 +251,17 @@ public bool GroupListUserGroupsOnly #region Public Methods public string GetCreateUrl() { - return ModuleContext.EditUrl("Create"); //.NavigateUrl(GroupCreateTabId,"",true,null); + return this.ModuleContext.EditUrl("Create"); //.NavigateUrl(GroupCreateTabId,"",true,null); } public string GetClearFilterUrl() { - return NavigationManager.NavigateURL(TabId, ""); + return this.NavigationManager.NavigateURL(this.TabId, ""); } public string GetEditUrl() { - return ModuleContext.EditUrl("GroupId", GroupId.ToString("D"), "Edit"); + return this.ModuleContext.EditUrl("GroupId", this.GroupId.ToString("D"), "Edit"); } #endregion } diff --git a/DNN Platform/Modules/Groups/List.ascx.cs b/DNN Platform/Modules/Groups/List.ascx.cs index bb74380d034..fe2bc2f7d14 100644 --- a/DNN Platform/Modules/Groups/List.ascx.cs +++ b/DNN Platform/Modules/Groups/List.ascx.cs @@ -15,51 +15,51 @@ public partial class List : GroupsModuleBase public INavigationManager _navigationManager { get; } public List() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } protected void Page_Load(object sender, EventArgs e) { ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - panelSearch.Visible = GroupListSearchEnabled; + this.panelSearch.Visible = this.GroupListSearchEnabled; - ctlGroupList.TabId = TabId; - ctlGroupList.GroupViewTabId = GroupViewTabId; - ctlGroupList.RoleGroupId = DefaultRoleGroupId; - ctlGroupList.PageSize = GroupListPageSize; - ctlGroupList.DisplayCurrentUserGroups = GroupListUserGroupsOnly; - ctlGroupList.SearchFilter = GroupListFilter; - ctlGroupList.SortField = GroupListSortField; - ctlGroupList.SortDirection = GroupListSortDirection; + this.ctlGroupList.TabId = this.TabId; + this.ctlGroupList.GroupViewTabId = this.GroupViewTabId; + this.ctlGroupList.RoleGroupId = this.DefaultRoleGroupId; + this.ctlGroupList.PageSize = this.GroupListPageSize; + this.ctlGroupList.DisplayCurrentUserGroups = this.GroupListUserGroupsOnly; + this.ctlGroupList.SearchFilter = this.GroupListFilter; + this.ctlGroupList.SortField = this.GroupListSortField; + this.ctlGroupList.SortDirection = this.GroupListSortDirection; - if (!string.IsNullOrEmpty(GroupListSortField)) + if (!string.IsNullOrEmpty(this.GroupListSortField)) { - ctlGroupList.SortField = GroupListSortField; + this.ctlGroupList.SortField = this.GroupListSortField; } - if (!string.IsNullOrEmpty(GroupListSortDirection)) + if (!string.IsNullOrEmpty(this.GroupListSortDirection)) { - ctlGroupList.SortDirection = GroupListSortDirection; + this.ctlGroupList.SortDirection = this.GroupListSortDirection; } - if (!String.IsNullOrEmpty(GroupListTemplate)) + if (!String.IsNullOrEmpty(this.GroupListTemplate)) { - ctlGroupList.ItemTemplate = GroupListTemplate; + this.ctlGroupList.ItemTemplate = this.GroupListTemplate; } - if (!string.IsNullOrEmpty(GroupListFilter)) + if (!string.IsNullOrEmpty(this.GroupListFilter)) { - txtFilter.Text = GroupListFilter; + this.txtFilter.Text = this.GroupListFilter; } } protected void btnSearch_Click(object sender, EventArgs e) { - if(!Page.IsValid) return; + if(!this.Page.IsValid) return; - Response.Redirect(_navigationManager.NavigateURL(TabId, "", "filter=" + txtFilter.Text.Trim())); + this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId, "", "filter=" + this.txtFilter.Text.Trim())); } } } diff --git a/DNN Platform/Modules/Groups/ListSettings.ascx.cs b/DNN Platform/Modules/Groups/ListSettings.ascx.cs index be44f2b4aec..8f77d46f3c9 100644 --- a/DNN Platform/Modules/Groups/ListSettings.ascx.cs +++ b/DNN Platform/Modules/Groups/ListSettings.ascx.cs @@ -40,60 +40,60 @@ public override void LoadSettings() { try { - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - BindGroups(); - BindPages(); + this.BindGroups(); + this.BindPages(); - if (Settings.ContainsKey(Constants.DefaultRoleGroupSetting)) { - drpRoleGroup.SelectedIndex = drpRoleGroup.Items.IndexOf(drpRoleGroup.Items.FindByValue(Settings[Constants.DefaultRoleGroupSetting].ToString())); + if (this.Settings.ContainsKey(Constants.DefaultRoleGroupSetting)) { + this.drpRoleGroup.SelectedIndex = this.drpRoleGroup.Items.IndexOf(this.drpRoleGroup.Items.FindByValue(this.Settings[Constants.DefaultRoleGroupSetting].ToString())); } - if (Settings.ContainsKey(Constants.GroupViewPage)) { - drpGroupViewPage.SelectedIndex = drpGroupViewPage.Items.IndexOf(drpGroupViewPage.Items.FindByValue(Settings[Constants.GroupViewPage].ToString())); + if (this.Settings.ContainsKey(Constants.GroupViewPage)) { + this.drpGroupViewPage.SelectedIndex = this.drpGroupViewPage.Items.IndexOf(this.drpGroupViewPage.Items.FindByValue(this.Settings[Constants.GroupViewPage].ToString())); } - if (Settings.ContainsKey(Constants.GroupListTemplate)) { - txtListTemplate.Text = Settings[Constants.GroupListTemplate].ToString(); + if (this.Settings.ContainsKey(Constants.GroupListTemplate)) { + this.txtListTemplate.Text = this.Settings[Constants.GroupListTemplate].ToString(); } - if (Settings.ContainsKey(Constants.GroupViewTemplate)) + if (this.Settings.ContainsKey(Constants.GroupViewTemplate)) { - txtViewTemplate.Text = Settings[Constants.GroupViewTemplate].ToString(); + this.txtViewTemplate.Text = this.Settings[Constants.GroupViewTemplate].ToString(); } - if (Settings.ContainsKey(Constants.GroupModerationEnabled)) + if (this.Settings.ContainsKey(Constants.GroupModerationEnabled)) { - chkGroupModeration.Checked = Convert.ToBoolean(Settings[Constants.GroupModerationEnabled].ToString()); + this.chkGroupModeration.Checked = Convert.ToBoolean(this.Settings[Constants.GroupModerationEnabled].ToString()); } - if (Settings.ContainsKey(Constants.GroupLoadView)) { - drpViewMode.SelectedIndex = drpViewMode.Items.IndexOf(drpViewMode.Items.FindByValue(Settings[Constants.GroupLoadView].ToString())); + if (this.Settings.ContainsKey(Constants.GroupLoadView)) { + this.drpViewMode.SelectedIndex = this.drpViewMode.Items.IndexOf(this.drpViewMode.Items.FindByValue(this.Settings[Constants.GroupLoadView].ToString())); } - if (Settings.ContainsKey(Constants.GroupListPageSize)) + if (this.Settings.ContainsKey(Constants.GroupListPageSize)) { - txtPageSize.Text = Settings[Constants.GroupListPageSize].ToString(); + this.txtPageSize.Text = this.Settings[Constants.GroupListPageSize].ToString(); } - if (Settings.ContainsKey(Constants.GroupListUserGroupsOnly)) + if (this.Settings.ContainsKey(Constants.GroupListUserGroupsOnly)) { - chkUserGroups.Checked = Convert.ToBoolean(Settings[Constants.GroupListUserGroupsOnly].ToString()); + this.chkUserGroups.Checked = Convert.ToBoolean(this.Settings[Constants.GroupListUserGroupsOnly].ToString()); } - if (Settings.ContainsKey(Constants.GroupListSearchEnabled)) + if (this.Settings.ContainsKey(Constants.GroupListSearchEnabled)) { - chkEnableSearch.Checked = Convert.ToBoolean(Settings[Constants.GroupListSearchEnabled].ToString()); + this.chkEnableSearch.Checked = Convert.ToBoolean(this.Settings[Constants.GroupListSearchEnabled].ToString()); } - if (Settings.ContainsKey(Constants.GroupListSortField)) + if (this.Settings.ContainsKey(Constants.GroupListSortField)) { - lstSortField.SelectedIndex = lstSortField.Items.IndexOf(lstSortField.Items.FindByValue(Settings[Constants.GroupListSortField].ToString())); + this.lstSortField.SelectedIndex = this.lstSortField.Items.IndexOf(this.lstSortField.Items.FindByValue(this.Settings[Constants.GroupListSortField].ToString())); } - if (Settings.ContainsKey(Constants.GroupListSortDirection)) + if (this.Settings.ContainsKey(Constants.GroupListSortDirection)) { - radSortDirection.SelectedIndex = radSortDirection.Items.IndexOf(radSortDirection.Items.FindByValue(Settings[Constants.GroupListSortDirection].ToString())); + this.radSortDirection.SelectedIndex = this.radSortDirection.Items.IndexOf(this.radSortDirection.Items.FindByValue(this.Settings[Constants.GroupListSortDirection].ToString())); } } } @@ -112,17 +112,17 @@ public override void UpdateSettings() { try { - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.DefaultRoleGroupSetting, drpRoleGroup.SelectedItem.Value); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewPage, drpGroupViewPage.SelectedItem.Value); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListTemplate, txtListTemplate.Text); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewTemplate, txtViewTemplate.Text); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupModerationEnabled, chkGroupModeration.Checked.ToString()); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupLoadView, drpViewMode.SelectedItem.Value); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListPageSize, txtPageSize.Text); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSearchEnabled, chkEnableSearch.Checked.ToString()); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSortField, lstSortField.SelectedItem.Value); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSortDirection, radSortDirection.SelectedItem.Value); - ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListUserGroupsOnly, chkUserGroups.Checked.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.DefaultRoleGroupSetting, this.drpRoleGroup.SelectedItem.Value); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewPage, this.drpGroupViewPage.SelectedItem.Value); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListTemplate, this.txtListTemplate.Text); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewTemplate, this.txtViewTemplate.Text); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupModerationEnabled, this.chkGroupModeration.Checked.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupLoadView, this.drpViewMode.SelectedItem.Value); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListPageSize, this.txtPageSize.Text); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSearchEnabled, this.chkEnableSearch.Checked.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSortField, this.lstSortField.SelectedItem.Value); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListSortDirection, this.radSortDirection.SelectedItem.Value); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupListUserGroupsOnly, this.chkUserGroups.Checked.ToString()); } catch (Exception exc) //Module failed to load { @@ -132,20 +132,20 @@ public override void UpdateSettings() #endregion private void BindGroups() { - var arrGroups = RoleController.GetRoleGroups(PortalId); - drpRoleGroup.Items.Add(new ListItem(Localization.GetString("AllRoles"), "-2")); - drpRoleGroup.Items.Add(new ListItem(Localization.GetString("GlobalRoles"), "-1")); + var arrGroups = RoleController.GetRoleGroups(this.PortalId); + this.drpRoleGroup.Items.Add(new ListItem(Localization.GetString("AllRoles"), "-2")); + this.drpRoleGroup.Items.Add(new ListItem(Localization.GetString("GlobalRoles"), "-1")); foreach (RoleGroupInfo roleGroup in arrGroups) { - drpRoleGroup.Items.Add(new ListItem(roleGroup.RoleGroupName, roleGroup.RoleGroupID.ToString())); + this.drpRoleGroup.Items.Add(new ListItem(roleGroup.RoleGroupName, roleGroup.RoleGroupID.ToString())); } } private void BindPages() { - foreach (ModuleInfo moduleInfo in ModuleController.Instance.GetModules(PortalId)) + foreach (ModuleInfo moduleInfo in ModuleController.Instance.GetModules(this.PortalId)) { if (moduleInfo.DesktopModule.ModuleName.Contains("Social Groups") && moduleInfo.IsDeleted == false) { - TabInfo tabInfo = TabController.Instance.GetTab(moduleInfo.TabID, PortalId, false); + TabInfo tabInfo = TabController.Instance.GetTab(moduleInfo.TabID, this.PortalId, false); if (tabInfo != null) { if (tabInfo.IsDeleted == false) @@ -154,9 +154,9 @@ private void BindPages() { { if (moduleInfo.ModuleDefinition.FriendlyName == def.Key) { - if (drpGroupViewPage.Items.FindByValue(tabInfo.TabID.ToString()) == null) + if (this.drpGroupViewPage.Items.FindByValue(tabInfo.TabID.ToString()) == null) { - drpGroupViewPage.Items.Add(new ListItem(tabInfo.TabName + " - " + def.Key, tabInfo.TabID.ToString())); + this.drpGroupViewPage.Items.Add(new ListItem(tabInfo.TabName + " - " + def.Key, tabInfo.TabID.ToString())); } } diff --git a/DNN Platform/Modules/Groups/Loader.ascx.cs b/DNN Platform/Modules/Groups/Loader.ascx.cs index 3baa471542a..9ba9064c05d 100644 --- a/DNN Platform/Modules/Groups/Loader.ascx.cs +++ b/DNN Platform/Modules/Groups/Loader.ascx.cs @@ -14,7 +14,7 @@ namespace DotNetNuke.Modules.Groups { public partial class Loader : GroupsModuleBase { protected void Page_Load(object sender, EventArgs e) { string path = Constants.ModulePath; - switch (LoadView) { + switch (this.LoadView) { case GroupMode.Setup: path += "Setup.ascx"; break; @@ -26,9 +26,9 @@ protected void Page_Load(object sender, EventArgs e) { break; } GroupsModuleBase ctl = new GroupsModuleBase(); - ctl = (GroupsModuleBase)LoadControl(path); + ctl = (GroupsModuleBase)this.LoadControl(path); ctl.ModuleConfiguration = this.ModuleConfiguration; - plhContent.Controls.Add(ctl); + this.plhContent.Controls.Add(ctl); } } } diff --git a/DNN Platform/Modules/Groups/ModerationServiceController.cs b/DNN Platform/Modules/Groups/ModerationServiceController.cs index ef688641325..80a1e198fd6 100644 --- a/DNN Platform/Modules/Groups/ModerationServiceController.cs +++ b/DNN Platform/Modules/Groups/ModerationServiceController.cs @@ -37,7 +37,7 @@ public class ModerationServiceController : DnnApiController public ModerationServiceController(INavigationManager navigationManager) { - NavigationManager = navigationManager; + this.NavigationManager = navigationManager; } public class NotificationDTO @@ -51,37 +51,37 @@ public HttpResponseMessage ApproveGroup(NotificationDTO postData) { try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); - if (recipient == null) return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); + if (recipient == null) return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); var notification = NotificationsController.Instance.GetNotification(postData.NotificationId); - ParseKey(notification.Context); - if (_roleInfo == null) + this.ParseKey(notification.Context); + if (this._roleInfo == null) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate role"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate role"); } - if (!IsMod()) + if (!this.IsMod()) { - return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Not Authorized!"); + return this.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Not Authorized!"); } - _roleInfo.Status = RoleStatus.Approved; - RoleController.Instance.UpdateRole(_roleInfo); - var roleCreator = UserController.GetUserById(PortalSettings.PortalId, _roleInfo.CreatedByUserID); + this._roleInfo.Status = RoleStatus.Approved; + RoleController.Instance.UpdateRole(this._roleInfo); + var roleCreator = UserController.GetUserById(this.PortalSettings.PortalId, this._roleInfo.CreatedByUserID); //Update the original creator's role - RoleController.Instance.UpdateUserRole(PortalSettings.PortalId, roleCreator.UserID, _roleInfo.RoleID, RoleStatus.Approved, true, false); - GroupUtilities.CreateJournalEntry(_roleInfo, roleCreator); + RoleController.Instance.UpdateUserRole(this.PortalSettings.PortalId, roleCreator.UserID, this._roleInfo.RoleID, RoleStatus.Approved, true, false); + GroupUtilities.CreateJournalEntry(this._roleInfo, roleCreator); var notifications = new Notifications(); - var siteAdmin = UserController.GetUserById(PortalSettings.PortalId, PortalSettings.AdministratorId); - notifications.AddGroupNotification(Constants.GroupApprovedNotification, _tabId, _moduleId, _roleInfo, siteAdmin, new List { _roleInfo }); + var siteAdmin = UserController.GetUserById(this.PortalSettings.PortalId, this.PortalSettings.AdministratorId); + notifications.AddGroupNotification(Constants.GroupApprovedNotification, this._tabId, this._moduleId, this._roleInfo, siteAdmin, new List { this._roleInfo }); NotificationsController.Instance.DeleteAllNotificationRecipients(postData.NotificationId); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -91,33 +91,33 @@ public HttpResponseMessage RejectGroup(NotificationDTO postData) { try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); - if (recipient == null) return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); + if (recipient == null) return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); var notification = NotificationsController.Instance.GetNotification(postData.NotificationId); - ParseKey(notification.Context); - if (_roleInfo == null) + this.ParseKey(notification.Context); + if (this._roleInfo == null) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate role"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate role"); } - if (!IsMod()) + if (!this.IsMod()) { - return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Not Authorized!"); + return this.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Not Authorized!"); } var notifications = new Notifications(); - var roleCreator = UserController.GetUserById(PortalSettings.PortalId, _roleInfo.CreatedByUserID); - var siteAdmin = UserController.GetUserById(PortalSettings.PortalId, PortalSettings.AdministratorId); - notifications.AddGroupNotification(Constants.GroupRejectedNotification, _tabId, _moduleId, _roleInfo, siteAdmin, new List { _roleInfo }, roleCreator); + var roleCreator = UserController.GetUserById(this.PortalSettings.PortalId, this._roleInfo.CreatedByUserID); + var siteAdmin = UserController.GetUserById(this.PortalSettings.PortalId, this.PortalSettings.AdministratorId); + notifications.AddGroupNotification(Constants.GroupRejectedNotification, this._tabId, this._moduleId, this._roleInfo, siteAdmin, new List { this._roleInfo }, roleCreator); - var role = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == _roleId); + var role = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == this._roleId); RoleController.Instance.DeleteRole(role); NotificationsController.Instance.DeleteAllNotificationRecipients(postData.NotificationId); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -129,33 +129,33 @@ public HttpResponseMessage JoinGroup(RoleDTO postData) { try { - if (UserInfo.UserID >= 0 && postData.RoleId > -1) + if (this.UserInfo.UserID >= 0 && postData.RoleId > -1) { - _roleInfo = RoleController.Instance.GetRoleById(PortalSettings.PortalId, postData.RoleId); - if (_roleInfo != null) + this._roleInfo = RoleController.Instance.GetRoleById(this.PortalSettings.PortalId, postData.RoleId); + if (this._roleInfo != null) { var requireApproval = false; - if(_roleInfo.Settings.ContainsKey("ReviewMembers")) - requireApproval = Convert.ToBoolean(_roleInfo.Settings["ReviewMembers"]); + if(this._roleInfo.Settings.ContainsKey("ReviewMembers")) + requireApproval = Convert.ToBoolean(this._roleInfo.Settings["ReviewMembers"]); - if ((_roleInfo.IsPublic || UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) && !requireApproval) + if ((this._roleInfo.IsPublic || this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) && !requireApproval) { - RoleController.Instance.AddUserRole(PortalSettings.PortalId, UserInfo.UserID, _roleInfo.RoleID, RoleStatus.Approved, false, Null.NullDate, Null.NullDate); - RoleController.Instance.UpdateRole(_roleInfo); + RoleController.Instance.AddUserRole(this.PortalSettings.PortalId, this.UserInfo.UserID, this._roleInfo.RoleID, RoleStatus.Approved, false, Null.NullDate, Null.NullDate); + RoleController.Instance.UpdateRole(this._roleInfo); - var url = NavigationManager.NavigateURL(postData.GroupViewTabId, "", new[] { "groupid=" + _roleInfo.RoleID }); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", URL = url }); + var url = this.NavigationManager.NavigateURL(postData.GroupViewTabId, "", new[] { "groupid=" + this._roleInfo.RoleID }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", URL = url }); } - if (_roleInfo.IsPublic && requireApproval) + if (this._roleInfo.IsPublic && requireApproval) { - RoleController.Instance.AddUserRole(PortalSettings.PortalId, UserInfo.UserID, _roleInfo.RoleID, RoleStatus.Pending, false, Null.NullDate, Null.NullDate); + RoleController.Instance.AddUserRole(this.PortalSettings.PortalId, this.UserInfo.UserID, this._roleInfo.RoleID, RoleStatus.Pending, false, Null.NullDate, Null.NullDate); var notifications = new Notifications(); - notifications.AddGroupOwnerNotification(Constants.MemberPendingNotification, _tabId, _moduleId, _roleInfo, UserInfo); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", URL = string.Empty }); + notifications.AddGroupOwnerNotification(Constants.MemberPendingNotification, this._tabId, this._moduleId, this._roleInfo, this.UserInfo); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", URL = string.Empty }); } } } @@ -163,10 +163,10 @@ public HttpResponseMessage JoinGroup(RoleDTO postData) catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); } public class RoleDTO @@ -185,15 +185,15 @@ public HttpResponseMessage LeaveGroup(RoleDTO postData) try { - if (UserInfo.UserID >= 0 && postData.RoleId > 0) + if (this.UserInfo.UserID >= 0 && postData.RoleId > 0) { - _roleInfo = RoleController.Instance.GetRoleById(PortalSettings.PortalId, postData.RoleId); + this._roleInfo = RoleController.Instance.GetRoleById(this.PortalSettings.PortalId, postData.RoleId); - if (_roleInfo != null) + if (this._roleInfo != null) { - if (UserInfo.IsInRole(_roleInfo.RoleName)) + if (this.UserInfo.IsInRole(this._roleInfo.RoleName)) { - RoleController.DeleteUserRole(UserInfo, _roleInfo, PortalSettings, false); + RoleController.DeleteUserRole(this.UserInfo, this._roleInfo, this.PortalSettings, false); } success = true; } @@ -202,15 +202,15 @@ public HttpResponseMessage LeaveGroup(RoleDTO postData) catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } if(success) { - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); } [HttpPost] @@ -219,43 +219,43 @@ public HttpResponseMessage ApproveMember(NotificationDTO postData) { try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); - if (recipient == null) return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); + if (recipient == null) return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); var notification = NotificationsController.Instance.GetNotification(postData.NotificationId); - ParseKey(notification.Context); - if (_memberId <= 0) + this.ParseKey(notification.Context); + if (this._memberId <= 0) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Member"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Member"); } - if (_roleInfo == null) + if (this._roleInfo == null) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Role"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Role"); } - var member = UserController.GetUserById(PortalSettings.PortalId, _memberId); + var member = UserController.GetUserById(this.PortalSettings.PortalId, this._memberId); if (member != null) { - var memberRoleInfo = RoleController.Instance.GetUserRole(PortalSettings.PortalId, _memberId, _roleInfo.RoleID); + var memberRoleInfo = RoleController.Instance.GetUserRole(this.PortalSettings.PortalId, this._memberId, this._roleInfo.RoleID); memberRoleInfo.Status = RoleStatus.Approved; - RoleController.Instance.UpdateUserRole(PortalSettings.PortalId, _memberId, _roleInfo.RoleID, RoleStatus.Approved, false, false); + RoleController.Instance.UpdateUserRole(this.PortalSettings.PortalId, this._memberId, this._roleInfo.RoleID, RoleStatus.Approved, false, false); var notifications = new Notifications(); - var groupOwner = UserController.GetUserById(PortalSettings.PortalId, _roleInfo.CreatedByUserID); - notifications.AddMemberNotification(Constants.MemberApprovedNotification, _tabId, _moduleId, _roleInfo, groupOwner, member); + var groupOwner = UserController.GetUserById(this.PortalSettings.PortalId, this._roleInfo.CreatedByUserID); + notifications.AddMemberNotification(Constants.MemberApprovedNotification, this._tabId, this._moduleId, this._roleInfo, groupOwner, member); NotificationsController.Instance.DeleteAllNotificationRecipients(postData.NotificationId); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); } [HttpPost] [ValidateAntiForgeryToken] @@ -263,70 +263,70 @@ public HttpResponseMessage RejectMember(NotificationDTO postData) { try { - var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, UserInfo.UserID); - if (recipient == null) return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); + var recipient = InternalMessagingController.Instance.GetMessageRecipient(postData.NotificationId, this.UserInfo.UserID); + if (recipient == null) return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate recipient"); var notification = NotificationsController.Instance.GetNotification(postData.NotificationId); - ParseKey(notification.Context); - if (_memberId <= 0) + this.ParseKey(notification.Context); + if (this._memberId <= 0) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Member"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Member"); } - if (_roleInfo == null) + if (this._roleInfo == null) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Role"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unable to locate Role"); } - var member = UserController.GetUserById(PortalSettings.PortalId, _memberId); + var member = UserController.GetUserById(this.PortalSettings.PortalId, this._memberId); if (member != null) { - RoleController.DeleteUserRole(member, _roleInfo, PortalSettings, false) ; + RoleController.DeleteUserRole(member, this._roleInfo, this.PortalSettings, false) ; var notifications = new Notifications(); - var groupOwner = UserController.GetUserById(PortalSettings.PortalId, _roleInfo.CreatedByUserID); - notifications.AddMemberNotification(Constants.MemberRejectedNotification, _tabId, _moduleId, _roleInfo, groupOwner, member); + var groupOwner = UserController.GetUserById(this.PortalSettings.PortalId, this._roleInfo.CreatedByUserID); + notifications.AddMemberNotification(Constants.MemberRejectedNotification, this._tabId, this._moduleId, this._roleInfo, groupOwner, member); NotificationsController.Instance.DeleteAllNotificationRecipients(postData.NotificationId); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Unknown Error"); } private void ParseKey(string key) { - _tabId = -1; - _moduleId = -1; - _roleId = -1; - _memberId = -1; - _roleInfo = null; + this._tabId = -1; + this._moduleId = -1; + this._roleId = -1; + this._memberId = -1; + this._roleInfo = null; if (!String.IsNullOrEmpty(key)) { string[] keys = key.Split(':'); - _tabId = Convert.ToInt32(keys[0]); - _moduleId = Convert.ToInt32(keys[1]); - _roleId = Convert.ToInt32(keys[2]); + this._tabId = Convert.ToInt32(keys[0]); + this._moduleId = Convert.ToInt32(keys[1]); + this._roleId = Convert.ToInt32(keys[2]); if (keys.Length > 3) { - _memberId = Convert.ToInt32(keys[3]); + this._memberId = Convert.ToInt32(keys[3]); } } - if (_roleId > 0) + if (this._roleId > 0) { - _roleInfo = RoleController.Instance.GetRoleById(PortalSettings.PortalId, _roleId); + this._roleInfo = RoleController.Instance.GetRoleById(this.PortalSettings.PortalId, this._roleId); } } private bool IsMod() { - var objModulePermissions = new ModulePermissionCollection(CBO.FillCollection(DataProvider.Instance().GetModulePermissionsByModuleID(_moduleId, -1), typeof(ModulePermissionInfo))); + var objModulePermissions = new ModulePermissionCollection(CBO.FillCollection(DataProvider.Instance().GetModulePermissionsByModuleID(this._moduleId, -1), typeof(ModulePermissionInfo))); return ModulePermissionController.HasModulePermission(objModulePermissions, "MODGROUP"); } } diff --git a/DNN Platform/Modules/Groups/Setup.ascx.cs b/DNN Platform/Modules/Groups/Setup.ascx.cs index 2d7f52cd7f7..248fa0b4e3b 100644 --- a/DNN Platform/Modules/Groups/Setup.ascx.cs +++ b/DNN Platform/Modules/Groups/Setup.ascx.cs @@ -30,36 +30,36 @@ public partial class Setup : GroupsModuleBase { protected void Page_Load(object sender, EventArgs e) { - btnGo.Visible = Request.IsAuthenticated; - btnGo.Enabled = Request.IsAuthenticated; - btnGo.Click += btGo_Click; + this.btnGo.Visible = this.Request.IsAuthenticated; + this.btnGo.Enabled = this.Request.IsAuthenticated; + this.btnGo.Click += this.btGo_Click; } public void btGo_Click(object sender, EventArgs e) { //Setup Child Page - Main View/Activity - TabInfo tab = CreatePage(PortalSettings.ActiveTab, PortalId, TabId, "Group Activity", false); + TabInfo tab = this.CreatePage(this.PortalSettings.ActiveTab, this.PortalId, this.TabId, "Group Activity", false); //Add Module to Child Page - int groupViewModuleId = AddModule(tab, PortalId, "Social Groups", "ContentPane"); - int journalModuleId = AddModule(tab, PortalId, "Journal", "ContentPane"); - int consoleId = AddModule(tab, PortalId, "Console", "RightPane"); + int groupViewModuleId = this.AddModule(tab, this.PortalId, "Social Groups", "ContentPane"); + int journalModuleId = this.AddModule(tab, this.PortalId, "Journal", "ContentPane"); + int consoleId = this.AddModule(tab, this.PortalId, "Console", "RightPane"); ModuleInfo groupConsoleModule = ModuleController.Instance.GetModule(consoleId, tab.TabID, false); - TabInfo memberTab = CreatePage(PortalSettings.ActiveTab, PortalId, tab.TabID, "Members", true); + TabInfo memberTab = this.CreatePage(this.PortalSettings.ActiveTab, this.PortalId, tab.TabID, "Members", true); ModuleController.Instance.CopyModule(groupConsoleModule, memberTab, "RightPane", true); ModuleInfo groupViewModule = ModuleController.Instance.GetModule(groupViewModuleId, tab.TabID, false); ModuleController.Instance.CopyModule(groupViewModule, memberTab, "ContentPane", true); - AddModule(memberTab, PortalId, "DotNetNuke.Modules.MemberDirectory", "ContentPane"); + this.AddModule(memberTab, this.PortalId, "DotNetNuke.Modules.MemberDirectory", "ContentPane"); //List Settings - ModuleController.Instance.UpdateTabModuleSetting(TabModuleId, Constants.GroupLoadView, GroupMode.List.ToString()); - ModuleController.Instance.UpdateTabModuleSetting(TabModuleId, Constants.GroupViewPage, tab.TabID.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupLoadView, GroupMode.List.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.GroupViewPage, tab.TabID.ToString(CultureInfo.InvariantCulture)); //Default Social Groups - var defaultGroup = RoleController.GetRoleGroupByName(PortalId, Constants.DefaultGroupName); + var defaultGroup = RoleController.GetRoleGroupByName(this.PortalId, Constants.DefaultGroupName); var groupId = -2; if (defaultGroup != null) { @@ -68,14 +68,14 @@ public void btGo_Click(object sender, EventArgs e) else { var groupInfo = new RoleGroupInfo(); - groupInfo.PortalID = PortalId; + groupInfo.PortalID = this.PortalId; groupInfo.RoleGroupName = Constants.DefaultGroupName; groupInfo.Description = Constants.DefaultGroupName; groupId = RoleController.AddRoleGroup(groupInfo); } - ModuleController.Instance.UpdateTabModuleSetting(TabModuleId, Constants.DefaultRoleGroupSetting, groupId.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, Constants.DefaultRoleGroupSetting, groupId.ToString()); - Response.Redirect(Request.RawUrl); + this.Response.Redirect(this.Request.RawUrl); } private TabInfo CreatePage(TabInfo tab, int portalId, int parentTabId, string tabName, bool includeInMenu) @@ -115,7 +115,7 @@ private TabInfo CreatePage(TabInfo tab, int portalId, int parentTabId, string ta newTab.TabName = tabName; newTab.Title = tabName; newTab.IsVisible = includeInMenu; - newTab.SkinSrc = GetSkin(); + newTab.SkinSrc = this.GetSkin(); id = TabController.Instance.AddTab(newTab); newTab = TabController.Instance.GetTab(id, portalId, true); @@ -126,9 +126,9 @@ private TabInfo CreatePage(TabInfo tab, int portalId, int parentTabId, string ta private string GetSkin() { //attempt to find and load a skin from the assigned skinned source - var skinSource = PortalSettings.DefaultPortalSkin; + var skinSource = this.PortalSettings.DefaultPortalSkin; - var tab = TabController.Instance.GetTab(TabId, PortalId, false); + var tab = TabController.Instance.GetTab(this.TabId, this.PortalId, false); if (!string.IsNullOrEmpty(tab.SkinSrc)) { @@ -137,7 +137,7 @@ private string GetSkin() else { skinSource = SkinController.FormatSkinPath(skinSource) + "groups.ascx"; - var physicalSkinFile = SkinController.FormatSkinSrc(skinSource, PortalSettings); + var physicalSkinFile = SkinController.FormatSkinSrc(skinSource, this.PortalSettings); if (!File.Exists(HttpContext.Current.Server.MapPath(physicalSkinFile))) { @@ -153,13 +153,13 @@ private int AddModule(TabInfo tab, int portalId, string moduleName, string pane) int id = -1; if (module == null) { - int desktopModuleId = GetDesktopModuleId(portalId, moduleName); + int desktopModuleId = this.GetDesktopModuleId(portalId, moduleName); int moduleId = -1; if (desktopModuleId > -1) { if (moduleId <= 0) { - moduleId = AddNewModule(tab, string.Empty, desktopModuleId, pane, 0, string.Empty); + moduleId = this.AddNewModule(tab, string.Empty, desktopModuleId, pane, 0, string.Empty); } id = moduleId; ModuleInfo mi = ModuleController.Instance.GetModule(moduleId, tab.TabID, false); @@ -253,7 +253,7 @@ private int AddNewModule(TabInfo tab, string title, int desktopModuleId, string continue; } - ModulePermissionInfo objModulePermission = AddModulePermission(objModule, + ModulePermissionInfo objModulePermission = this.AddModulePermission(objModule, objSystemModulePermission, objTabPermission.RoleID, objTabPermission.UserID, @@ -262,7 +262,7 @@ private int AddNewModule(TabInfo tab, string title, int desktopModuleId, string // ensure that every EDIT permission which allows access also provides VIEW permission if (objModulePermission.PermissionKey == "EDIT" & objModulePermission.AllowAccess) { - ModulePermissionInfo objModuleViewperm = AddModulePermission(objModule, + ModulePermissionInfo objModuleViewperm = this.AddModulePermission(objModule, (PermissionInfo) arrSystemModuleViewPermissions[0], objModulePermission.RoleID, objModulePermission.UserID, diff --git a/DNN Platform/Modules/Groups/View.ascx.cs b/DNN Platform/Modules/Groups/View.ascx.cs index 52d25c848c3..2906d26c57a 100644 --- a/DNN Platform/Modules/Groups/View.ascx.cs +++ b/DNN Platform/Modules/Groups/View.ascx.cs @@ -32,20 +32,20 @@ public partial class View : GroupsModuleBase private readonly INavigationManager _navigationManager; public View() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Event Handlers protected override void OnInit(EventArgs e) { - InitializeComponent(); + this.InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { - Load += Page_Load; + this.Load += this.Page_Load; } @@ -59,15 +59,15 @@ private void Page_Load(object sender, EventArgs e) try { JavaScript.RequestRegistration(CommonJs.DnnPlugins); - if (GroupId < 0) { - if (TabId != GroupListTabId && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) { - Response.Redirect(_navigationManager.NavigateURL(GroupListTabId)); + if (this.GroupId < 0) { + if (this.TabId != this.GroupListTabId && !this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) { + this.Response.Redirect(this._navigationManager.NavigateURL(this.GroupListTabId)); } } - GroupsModuleBase ctl = (GroupsModuleBase)LoadControl(ControlPath); + GroupsModuleBase ctl = (GroupsModuleBase)this.LoadControl(this.ControlPath); ctl.ModuleConfiguration = this.ModuleConfiguration; - plhContent.Controls.Clear(); - plhContent.Controls.Add(ctl); + this.plhContent.Controls.Clear(); + this.plhContent.Controls.Add(ctl); } catch (Exception exc) //Module failed to load diff --git a/DNN Platform/Modules/Groups/packages.config b/DNN Platform/Modules/Groups/packages.config index 4073d3c4617..78db8377d2d 100644 --- a/DNN Platform/Modules/Groups/packages.config +++ b/DNN Platform/Modules/Groups/packages.config @@ -1,10 +1,11 @@ - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/Components/HtmlModuleBase.cs b/DNN Platform/Modules/HTML/Components/HtmlModuleBase.cs index dbae114610e..36373145f03 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlModuleBase.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlModuleBase.cs @@ -17,14 +17,14 @@ public class HtmlModuleBase : PortalModuleBase { get { - if (_settings == null) + if (this._settings == null) { var repo = new HtmlModuleSettingsRepository(); - _settings = repo.GetSettings(this.ModuleConfiguration); + this._settings = repo.GetSettings(this.ModuleConfiguration); } - return _settings; + return this._settings; } - set { _settings = value; } + set { this._settings = value; } } } } diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs index 269e405d355..3b1ef99aa0b 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextController.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextController.cs @@ -50,7 +50,7 @@ public class HtmlTextController : ModuleSearchBase, IPortable, IUpgradeable protected INavigationManager NavigationManager { get; } public HtmlTextController() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Private Methods @@ -90,7 +90,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) _htmlTextUserController.DeleteHtmlTextUsers(); // ensure we have latest htmltext object loaded - objHtmlText = GetHtmlText(objHtmlText.ModuleID, objHtmlText.ItemID); + objHtmlText = this.GetHtmlText(objHtmlText.ModuleID, objHtmlText.ItemID); // build collection of users to notify var objWorkflow = new WorkflowStateController(); @@ -152,7 +152,7 @@ private void CreateUserNotifications(HtmlTextInfo objHtmlText) Localization.LocalSharedResourceFile); string strSubject = Localization.GetString("NotificationSubject", strResourceFile); string strBody = Localization.GetString("NotificationBody", strResourceFile); - strBody = strBody.Replace("[URL]", NavigationManager.NavigateURL(objModule.TabID)); + strBody = strBody.Replace("[URL]", this.NavigationManager.NavigateURL(objModule.TabID)); strBody = strBody.Replace("[STATE]", objHtmlText.StateName); // process user notification collection @@ -238,7 +238,7 @@ private string TokeniseLinks(string content, int portalId) (?(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+))? (?" + portalRoot + "))"; - var matchEvaluator = new MatchEvaluator(ReplaceWithRootToken); + var matchEvaluator = new MatchEvaluator(this.ReplaceWithRootToken); var exp = RegexUtils.GetCachedRegex(regex, RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); return exp.Replace(content, matchEvaluator); } @@ -375,7 +375,7 @@ public HtmlTextInfo GetTopHtmlText(int moduleId, bool isPublished, int workflowI ? workflowStateController.GetLastWorkflowStateID(workflowId) : workflowStateController.GetFirstWorkflowStateID(workflowId); // update object - UpdateHtmlText(htmlText, GetMaximumVersionHistory(htmlText.PortalID)); + this.UpdateHtmlText(htmlText, this.GetMaximumVersionHistory(htmlText.PortalID)); // get object again htmlText = CBO.FillObject(DataProvider.Instance().GetTopHtmlText(moduleId, false)); @@ -545,7 +545,7 @@ public void UpdateHtmlText(HtmlTextInfo htmlContent, int MaximumVersionHistory) { if (htmlContent.WorkflowName != "[REPAIR_WORKFLOW]") { - HtmlTextInfo objContent = GetTopHtmlText(htmlContent.ModuleID, false, htmlContent.WorkflowID); + HtmlTextInfo objContent = this.GetTopHtmlText(htmlContent.ModuleID, false, htmlContent.WorkflowID); if (objContent != null) { if (objContent.StateID == _workflowStateController.GetLastWorkflowStateID(htmlContent.WorkflowID)) @@ -597,7 +597,7 @@ public void UpdateHtmlText(HtmlTextInfo htmlContent, int MaximumVersionHistory) objLogs.AddHtmlTextLog(logInfo); // create user notifications - CreateUserNotifications(htmlContent); + this.CreateUserNotifications(htmlContent); // refresh output cache ModuleController.SynchronizeModule(htmlContent.ModuleID); @@ -627,7 +627,7 @@ public void UpdateWorkflow(int ObjectID, string WorkFlowType, int WorkflowID, bo //Get All Modules on the current Tab foreach (var kvp in ModuleController.Instance.GetTabModules(ObjectID)) { - ClearModuleSettings(kvp.Value); + this.ClearModuleSettings(kvp.Value); } } break; @@ -643,7 +643,7 @@ public void UpdateWorkflow(int ObjectID, string WorkFlowType, int WorkflowID, bo //Get All Modules in the current Site foreach (ModuleInfo objModule in ModuleController.Instance.GetModules(ObjectID)) { - ClearModuleSettings(objModule); + this.ClearModuleSettings(objModule); } } break; @@ -718,13 +718,13 @@ public string ExportModule(int moduleId) string xml = ""; ModuleInfo module = ModuleController.Instance.GetModule(moduleId, Null.NullInteger, true); - int workflowID = GetWorkflow(moduleId, module.TabID, module.PortalID).Value; + int workflowID = this.GetWorkflow(moduleId, module.TabID, module.PortalID).Value; - HtmlTextInfo content = GetTopHtmlText(moduleId, true, workflowID); + HtmlTextInfo content = this.GetTopHtmlText(moduleId, true, workflowID); if ((content != null)) { xml += ""; - xml += "" + XmlUtils.XMLEncode(TokeniseLinks(content.Content, module.PortalID)) + ""; + xml += "" + XmlUtils.XMLEncode(this.TokeniseLinks(content.Content, module.PortalID)) + ""; xml += ""; } @@ -745,7 +745,7 @@ public void ImportModule(int ModuleID, string Content, string Version, int UserI { ModuleInfo module = ModuleController.Instance.GetModule(ModuleID, Null.NullInteger, true); var workflowStateController = new WorkflowStateController(); - int workflowID = GetWorkflow(ModuleID, module.TabID, module.PortalID).Value; + int workflowID = this.GetWorkflow(ModuleID, module.TabID, module.PortalID).Value; XmlNode xml = Globals.GetContent(Content, "htmltext"); var htmlContent = new HtmlTextInfo(); @@ -755,17 +755,17 @@ public void ImportModule(int ModuleID, string Content, string Version, int UserI if (objVersion >= new Version(5, 1, 0)) { // current module content - htmlContent.Content = DeTokeniseLinks(xml.SelectSingleNode("content").InnerText, module.PortalID); + htmlContent.Content = this.DeTokeniseLinks(xml.SelectSingleNode("content").InnerText, module.PortalID); } else { // legacy module content - htmlContent.Content = DeTokeniseLinks(xml.SelectSingleNode("desktophtml").InnerText, module.PortalID); + htmlContent.Content = this.DeTokeniseLinks(xml.SelectSingleNode("desktophtml").InnerText, module.PortalID); } htmlContent.WorkflowID = workflowID; htmlContent.StateID = workflowStateController.GetFirstWorkflowStateID(workflowID); // import - UpdateHtmlText(htmlContent, GetMaximumVersionHistory(module.PortalID)); + this.UpdateHtmlText(htmlContent, this.GetMaximumVersionHistory(module.PortalID)); } #endregion @@ -774,9 +774,9 @@ public void ImportModule(int ModuleID, string Content, string Version, int UserI public override IList GetModifiedSearchDocuments(ModuleInfo modInfo, DateTime beginDateUtc) { - var workflowId = GetWorkflow(modInfo.ModuleID, modInfo.TabID, modInfo.PortalID).Value; + var workflowId = this.GetWorkflow(modInfo.ModuleID, modInfo.TabID, modInfo.PortalID).Value; var searchDocuments = new List(); - var htmlTextInfo = GetTopHtmlText(modInfo.ModuleID, true, workflowId); + var htmlTextInfo = this.GetTopHtmlText(modInfo.ModuleID, true, workflowId); var repo = new HtmlModuleSettingsRepository(); var settings = repo.GetSettings(modInfo); @@ -853,7 +853,7 @@ public string UpgradeModule(string Version) break; case "06.02.00": - AddNotificationTypes(); + this.AddNotificationTypes(); break; } diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextInfo.cs b/DNN Platform/Modules/HTML/Components/HtmlTextInfo.cs index aa256397ad6..1b90f95be46 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextInfo.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextInfo.cs @@ -33,11 +33,11 @@ public int ItemID { get { - return _ItemID; + return this._ItemID; } set { - _ItemID = value; + this._ItemID = value; } } @@ -65,11 +65,11 @@ public bool IsActive { get { - return _IsActive; + return this._IsActive; } set { - _IsActive = value; + this._IsActive = value; } } @@ -77,11 +77,11 @@ public string Comment { get { - return _Comment; + return this._Comment; } set { - _Comment = value; + this._Comment = value; } } @@ -89,11 +89,11 @@ public bool Approved { get { - return _Approved; + return this._Approved; } set { - _Approved = value; + this._Approved = value; } } diff --git a/DNN Platform/Modules/HTML/Components/HtmlTextUserInfo.cs b/DNN Platform/Modules/HTML/Components/HtmlTextUserInfo.cs index 7bbc88ec2c7..abfb14893bd 100644 --- a/DNN Platform/Modules/HTML/Components/HtmlTextUserInfo.cs +++ b/DNN Platform/Modules/HTML/Components/HtmlTextUserInfo.cs @@ -43,9 +43,9 @@ public string ModuleTitle get { string _ModuleTitle = Null.NullString; - if (Module != null) + if (this.Module != null) { - _ModuleTitle = Module.ModuleTitle; + _ModuleTitle = this.Module.ModuleTitle; } return _ModuleTitle; } @@ -55,11 +55,11 @@ public ModuleInfo Module { get { - if (_Module == null) + if (this._Module == null) { - _Module = ModuleController.Instance.GetModule(ModuleID, TabID, false); + this._Module = ModuleController.Instance.GetModule(this.ModuleID, this.TabID, false); } - return _Module; + return this._Module; } } diff --git a/DNN Platform/Modules/HTML/Components/WorkflowStateController.cs b/DNN Platform/Modules/HTML/Components/WorkflowStateController.cs index fcd8e4e7ad9..844c932f8d5 100644 --- a/DNN Platform/Modules/HTML/Components/WorkflowStateController.cs +++ b/DNN Platform/Modules/HTML/Components/WorkflowStateController.cs @@ -55,7 +55,7 @@ public ArrayList GetWorkflows(int PortalID) public ArrayList GetWorkflowStates(int WorkflowID) { string cacheKey = string.Format(WORKFLOW_CACHE_KEY, WorkflowID); - return CBO.GetCachedObject(new CacheItemArgs(cacheKey, WORKFLOW_CACHE_TIMEOUT, WORKFLOW_CACHE_PRIORITY, WorkflowID), GetWorkflowStatesCallBack); + return CBO.GetCachedObject(new CacheItemArgs(cacheKey, WORKFLOW_CACHE_TIMEOUT, WORKFLOW_CACHE_PRIORITY, WorkflowID), this.GetWorkflowStatesCallBack); } /// ----------------------------------------------------------------------------- @@ -83,7 +83,7 @@ public object GetWorkflowStatesCallBack(CacheItemArgs cacheItemArgs) public int GetFirstWorkflowStateID(int WorkflowID) { int intStateID = -1; - ArrayList arrWorkflowStates = GetWorkflowStates(WorkflowID); + ArrayList arrWorkflowStates = this.GetWorkflowStates(WorkflowID); if (arrWorkflowStates.Count > 0) { intStateID = ((WorkflowStateInfo) (arrWorkflowStates[0])).StateID; @@ -103,7 +103,7 @@ public int GetFirstWorkflowStateID(int WorkflowID) public int GetPreviousWorkflowStateID(int WorkflowID, int StateID) { int intPreviousStateID = -1; - ArrayList arrWorkflowStates = GetWorkflowStates(WorkflowID); + ArrayList arrWorkflowStates = this.GetWorkflowStates(WorkflowID); int intItem = 0; // locate the current state @@ -134,7 +134,7 @@ public int GetPreviousWorkflowStateID(int WorkflowID, int StateID) // if none found then reset to first state if (intPreviousStateID == -1) { - intPreviousStateID = GetFirstWorkflowStateID(WorkflowID); + intPreviousStateID = this.GetFirstWorkflowStateID(WorkflowID); } return intPreviousStateID; @@ -152,7 +152,7 @@ public int GetPreviousWorkflowStateID(int WorkflowID, int StateID) public int GetNextWorkflowStateID(int WorkflowID, int StateID) { int intNextStateID = -1; - ArrayList arrWorkflowStates = GetWorkflowStates(WorkflowID); + ArrayList arrWorkflowStates = this.GetWorkflowStates(WorkflowID); int intItem = 0; // locate the current state @@ -183,7 +183,7 @@ public int GetNextWorkflowStateID(int WorkflowID, int StateID) // if none found then reset to first state if (intNextStateID == -1) { - intNextStateID = GetFirstWorkflowStateID(WorkflowID); + intNextStateID = this.GetFirstWorkflowStateID(WorkflowID); } return intNextStateID; @@ -200,7 +200,7 @@ public int GetNextWorkflowStateID(int WorkflowID, int StateID) public int GetLastWorkflowStateID(int WorkflowID) { int intStateID = -1; - ArrayList arrWorkflowStates = GetWorkflowStates(WorkflowID); + ArrayList arrWorkflowStates = this.GetWorkflowStates(WorkflowID); if (arrWorkflowStates.Count > 0) { intStateID = ((WorkflowStateInfo) (arrWorkflowStates[arrWorkflowStates.Count - 1])).StateID; diff --git a/DNN Platform/Modules/HTML/Components/WorkflowStateInfo.cs b/DNN Platform/Modules/HTML/Components/WorkflowStateInfo.cs index 30930b911ef..6f999724827 100644 --- a/DNN Platform/Modules/HTML/Components/WorkflowStateInfo.cs +++ b/DNN Platform/Modules/HTML/Components/WorkflowStateInfo.cs @@ -47,11 +47,11 @@ public bool IsActive { get { - return _IsActive; + return this._IsActive; } set { - _IsActive = value; + this._IsActive = value; } } } diff --git a/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionCollection.cs b/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionCollection.cs index 103b8b15649..1b0c42f1cad 100644 --- a/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionCollection.cs +++ b/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionCollection.cs @@ -31,12 +31,12 @@ public WorkflowStatePermissionCollection() public WorkflowStatePermissionCollection(ArrayList WorkflowStatePermissions) { - AddRange(WorkflowStatePermissions); + this.AddRange(WorkflowStatePermissions); } public WorkflowStatePermissionCollection(WorkflowStatePermissionCollection WorkflowStatePermissions) { - AddRange(WorkflowStatePermissions); + this.AddRange(WorkflowStatePermissions); } public WorkflowStatePermissionCollection(ArrayList WorkflowStatePermissions, int WorkflowStatePermissionID) @@ -45,7 +45,7 @@ public WorkflowStatePermissionCollection(ArrayList WorkflowStatePermissions, int { if (permission.WorkflowStatePermissionID == WorkflowStatePermissionID) { - Add(permission); + this.Add(permission); } } } @@ -58,11 +58,11 @@ public WorkflowStatePermissionInfo this[int index] { get { - return (WorkflowStatePermissionInfo) (List[index]); + return (WorkflowStatePermissionInfo) (this.List[index]); } set { - List[index] = value; + this.List[index] = value; } } @@ -72,7 +72,7 @@ public WorkflowStatePermissionInfo this[int index] public int Add(WorkflowStatePermissionInfo value) { - return List.Add(value); + return this.List.Add(value); } public int Add(WorkflowStatePermissionInfo value, bool checkForDuplicates) @@ -80,12 +80,12 @@ public int Add(WorkflowStatePermissionInfo value, bool checkForDuplicates) int id = Null.NullInteger; if (!checkForDuplicates) { - id = Add(value); + id = this.Add(value); } else { bool isMatch = false; - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == value.PermissionID && permission.UserID == value.UserID && permission.RoleID == value.RoleID) { @@ -95,7 +95,7 @@ public int Add(WorkflowStatePermissionInfo value, bool checkForDuplicates) } if (!isMatch) { - id = Add(value); + id = this.Add(value); } } return id; @@ -105,7 +105,7 @@ public void AddRange(ArrayList WorkflowStatePermissions) { foreach (WorkflowStatePermissionInfo permission in WorkflowStatePermissions) { - Add(permission); + this.Add(permission); } } @@ -113,20 +113,20 @@ public void AddRange(WorkflowStatePermissionCollection WorkflowStatePermissions) { foreach (WorkflowStatePermissionInfo permission in WorkflowStatePermissions) { - Add(permission); + this.Add(permission); } } public bool CompareTo(WorkflowStatePermissionCollection objWorkflowStatePermissionCollection) { - if (objWorkflowStatePermissionCollection.Count != Count) + if (objWorkflowStatePermissionCollection.Count != this.Count) { return false; } - InnerList.Sort(new CompareWorkflowStatePermissions()); + this.InnerList.Sort(new CompareWorkflowStatePermissions()); objWorkflowStatePermissionCollection.InnerList.Sort(new CompareWorkflowStatePermissions()); - for (int i = 0; i < Count; i++) + for (int i = 0; i < this.Count; i++) { if (objWorkflowStatePermissionCollection[i].WorkflowStatePermissionID != this[i].WorkflowStatePermissionID || objWorkflowStatePermissionCollection[i].AllowAccess != this[i].AllowAccess) { @@ -139,31 +139,31 @@ public bool CompareTo(WorkflowStatePermissionCollection objWorkflowStatePermissi public bool Contains(WorkflowStatePermissionInfo value) { - return List.Contains(value); + return this.List.Contains(value); } public int IndexOf(WorkflowStatePermissionInfo value) { - return List.IndexOf(value); + return this.List.IndexOf(value); } public void Insert(int index, WorkflowStatePermissionInfo value) { - List.Insert(index, value); + this.List.Insert(index, value); } public void Remove(WorkflowStatePermissionInfo value) { - List.Remove(value); + this.List.Remove(value); } public void Remove(int permissionID, int roleID, int userID) { - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { if (permission.PermissionID == permissionID && permission.UserID == userID && permission.RoleID == roleID) { - List.Remove(permission); + this.List.Remove(permission); break; } } @@ -173,7 +173,7 @@ public List ToList() { var list = new List(); - foreach (PermissionInfoBase permission in List) + foreach (PermissionInfoBase permission in this.List) { list.Add(permission); } @@ -182,7 +182,7 @@ public List ToList() public string ToString(string key) { - return PermissionController.BuildPermissions(List, key); + return PermissionController.BuildPermissions(this.List, key); } #endregion diff --git a/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionInfo.cs b/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionInfo.cs index 2482bfb7daa..69deb62f067 100644 --- a/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionInfo.cs +++ b/DNN Platform/Modules/HTML/Components/WorkflowStatePermissionInfo.cs @@ -38,8 +38,8 @@ public class WorkflowStatePermissionInfo : PermissionInfoBase, IHydratable /// ----------------------------------------------------------------------------- public WorkflowStatePermissionInfo() { - _WorkflowStatePermissionID = Null.NullInteger; - _StateID = Null.NullInteger; + this._WorkflowStatePermissionID = Null.NullInteger; + this._StateID = Null.NullInteger; } //New @@ -52,11 +52,11 @@ public WorkflowStatePermissionInfo() /// ----------------------------------------------------------------------------- public WorkflowStatePermissionInfo(PermissionInfo permission) : this() { - ModuleDefID = permission.ModuleDefID; - PermissionCode = permission.PermissionCode; - PermissionID = permission.PermissionID; - PermissionKey = permission.PermissionKey; - PermissionName = permission.PermissionName; + this.ModuleDefID = permission.ModuleDefID; + this.PermissionCode = permission.PermissionCode; + this.PermissionID = permission.PermissionID; + this.PermissionKey = permission.PermissionKey; + this.PermissionName = permission.PermissionName; } #endregion @@ -73,11 +73,11 @@ public int WorkflowStatePermissionID { get { - return _WorkflowStatePermissionID; + return this._WorkflowStatePermissionID; } set { - _WorkflowStatePermissionID = value; + this._WorkflowStatePermissionID = value; } } @@ -91,11 +91,11 @@ public int StateID { get { - return _StateID; + return this._StateID; } set { - _StateID = value; + this._StateID = value; } } @@ -131,7 +131,7 @@ public override bool Equals(object obj) { return false; } - return Equals((WorkflowStatePermissionInfo)obj); + return this.Equals((WorkflowStatePermissionInfo)obj); } public bool Equals(WorkflowStatePermissionInfo other) @@ -144,14 +144,14 @@ public bool Equals(WorkflowStatePermissionInfo other) { return true; } - return (AllowAccess == other.AllowAccess) && (StateID == other.StateID) && (RoleID == other.RoleID) && (PermissionID == other.PermissionID); + return (this.AllowAccess == other.AllowAccess) && (this.StateID == other.StateID) && (this.RoleID == other.RoleID) && (this.PermissionID == other.PermissionID); } public override int GetHashCode() { unchecked { - return (_StateID*397) ^ _WorkflowStatePermissionID; + return (this._StateID*397) ^ this._WorkflowStatePermissionID; } } @@ -170,8 +170,8 @@ public void Fill(IDataReader dr) //Call the base classes fill method to populate base class proeprties base.FillInternal(dr); - WorkflowStatePermissionID = Null.SetNullInteger(dr["WorkflowStatePermissionID"]); - StateID = Null.SetNullInteger(dr["StateID"]); + this.WorkflowStatePermissionID = Null.SetNullInteger(dr["WorkflowStatePermissionID"]); + this.StateID = Null.SetNullInteger(dr["StateID"]); } /// ----------------------------------------------------------------------------- @@ -184,11 +184,11 @@ public int KeyID { get { - return WorkflowStatePermissionID; + return this.WorkflowStatePermissionID; } set { - WorkflowStatePermissionID = value; + this.WorkflowStatePermissionID = value; } } diff --git a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj index 241991b2144..4a4f40e4791 100644 --- a/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj +++ b/DNN Platform/Modules/HTML/DotNetNuke.Modules.Html.csproj @@ -28,6 +28,7 @@ + true @@ -187,6 +188,9 @@ + + stylecop.json + @@ -252,5 +256,9 @@ + + + +
    \ No newline at end of file diff --git a/DNN Platform/Modules/HTML/EditHtml.ascx.cs b/DNN Platform/Modules/HTML/EditHtml.ascx.cs index 8440531009f..2f9f54c8372 100644 --- a/DNN Platform/Modules/HTML/EditHtml.ascx.cs +++ b/DNN Platform/Modules/HTML/EditHtml.ascx.cs @@ -40,7 +40,7 @@ public partial class EditHtml : HtmlModuleBase private readonly INavigationManager _navigationManager; public EditHtml() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -69,14 +69,14 @@ private int WorkflowID { int workflowID; - if (ViewState["WorkflowID"] == null) + if (this.ViewState["WorkflowID"] == null) { - workflowID = _htmlTextController.GetWorkflow(ModuleId, TabId, PortalId).Value; - ViewState.Add("WorkflowID", workflowID); + workflowID = this._htmlTextController.GetWorkflow(this.ModuleId, this.TabId, this.PortalId).Value; + this.ViewState.Add("WorkflowID", workflowID); } else { - workflowID = int.Parse(ViewState["WorkflowID"].ToString()); + workflowID = int.Parse(this.ViewState["WorkflowID"].ToString()); } return workflowID; @@ -88,15 +88,15 @@ private string TempContent get { var content = ""; - if ((ViewState["TempContent"] != null)) + if ((this.ViewState["TempContent"] != null)) { - content = ViewState["TempContent"].ToString(); + content = this.ViewState["TempContent"].ToString(); } return content; } set { - ViewState["TempContent"] = value; + this.ViewState["TempContent"] = value; } } @@ -105,16 +105,16 @@ private WorkflowType CurrentWorkflowType get { var currentWorkflowType = default(WorkflowType); - if (ViewState["_currentWorkflowType"] != null) + if (this.ViewState["_currentWorkflowType"] != null) { - currentWorkflowType = (WorkflowType) Enum.Parse(typeof (WorkflowType), ViewState["_currentWorkflowType"].ToString()); + currentWorkflowType = (WorkflowType) Enum.Parse(typeof (WorkflowType), this.ViewState["_currentWorkflowType"].ToString()); } return currentWorkflowType; } set { - ViewState["_currentWorkflowType"] = value; + this.ViewState["_currentWorkflowType"] = value; } } @@ -122,11 +122,11 @@ protected string CurrentView { get { - if (phEdit.Visible) + if (this.phEdit.Visible) return "EditView"; - else if (phPreview.Visible) + else if (this.phPreview.Visible) return "PreviewView"; - if (phHistory.Visible) + if (this.phHistory.Visible) return "HistoryView"; else return ""; @@ -143,19 +143,19 @@ protected string CurrentView /// Content of the HTML. private void DisplayHistory(HtmlTextInfo htmlContent) { - dnnSitePanelEditHTMLHistory.Visible = CurrentWorkflowType != WorkflowType.DirectPublish; - fsEditHtmlHistory.Visible = CurrentWorkflowType != WorkflowType.DirectPublish; + this.dnnSitePanelEditHTMLHistory.Visible = this.CurrentWorkflowType != WorkflowType.DirectPublish; + this.fsEditHtmlHistory.Visible = this.CurrentWorkflowType != WorkflowType.DirectPublish; - if (((CurrentWorkflowType == WorkflowType.DirectPublish))) + if (((this.CurrentWorkflowType == WorkflowType.DirectPublish))) { return; } - var htmlLogging = _htmlTextLogController.GetHtmlTextLog(htmlContent.ItemID); - dgHistory.DataSource = htmlLogging; - dgHistory.DataBind(); + var htmlLogging = this._htmlTextLogController.GetHtmlTextLog(htmlContent.ItemID); + this.dgHistory.DataSource = htmlLogging; + this.dgHistory.DataBind(); - dnnSitePanelEditHTMLHistory.Visible = htmlLogging.Count != 0; - fsEditHtmlHistory.Visible = htmlLogging.Count != 0; + this.dnnSitePanelEditHTMLHistory.Visible = htmlLogging.Count != 0; + this.fsEditHtmlHistory.Visible = htmlLogging.Count != 0; } /// @@ -163,23 +163,23 @@ private void DisplayHistory(HtmlTextInfo htmlContent) /// private void DisplayVersions() { - var versions = _htmlTextController.GetAllHtmlText(ModuleId); + var versions = this._htmlTextController.GetAllHtmlText(this.ModuleId); foreach (var item in versions) { - item.StateName = GetLocalizedString(item.StateName); + item.StateName = this.GetLocalizedString(item.StateName); } - dgVersions.DataSource = versions; - dgVersions.DataBind(); + this.dgVersions.DataSource = versions; + this.dgVersions.DataBind(); - phEdit.Visible = false; - phPreview.Visible = false; - phHistory.Visible = true; - cmdEdit.Enabled = true; - cmdPreview.Enabled = true; - cmdHistory.Enabled = false; - cmdMasterContent.Visible = false; - ddlRender.Visible = false; + this.phEdit.Visible = false; + this.phPreview.Visible = false; + this.phHistory.Visible = true; + this.cmdEdit.Enabled = true; + this.cmdPreview.Enabled = true; + this.cmdHistory.Enabled = false; + this.cmdMasterContent.Visible = false; + this.ddlRender.Visible = false; } /// @@ -188,13 +188,13 @@ private void DisplayVersions() private void DisplayMasterLanguageContent() { //Get master language - var objModule = ModuleController.Instance.GetModule(ModuleId, TabId, false); + var objModule = ModuleController.Instance.GetModule(this.ModuleId, this.TabId, false); if (objModule.DefaultLanguageModule != null) { - var masterContent = _htmlTextController.GetTopHtmlText(objModule.DefaultLanguageModule.ModuleID, false, WorkflowID); + var masterContent = this._htmlTextController.GetTopHtmlText(objModule.DefaultLanguageModule.ModuleID, false, this.WorkflowID); if (masterContent != null) { - placeMasterContent.Controls.Add(new LiteralControl(HtmlTextController.FormatHtmlText(objModule.DefaultLanguageModule.ModuleID, FormatContent(masterContent.Content), Settings, PortalSettings, Page))); + this.placeMasterContent.Controls.Add(new LiteralControl(HtmlTextController.FormatHtmlText(objModule.DefaultLanguageModule.ModuleID, this.FormatContent(masterContent.Content), this.Settings, this.PortalSettings, this.Page))); } } } @@ -205,32 +205,32 @@ private void DisplayMasterLanguageContent() /// Content of the HTML. private void DisplayContent(HtmlTextInfo htmlContent) { - lblCurrentWorkflowInUse.Text = GetLocalizedString(htmlContent.WorkflowName); - lblCurrentWorkflowState.Text = GetLocalizedString(htmlContent.StateName); - lblCurrentVersion.Text = htmlContent.Version.ToString(); - txtContent.Text = FormatContent(htmlContent.Content); - phEdit.Visible = true; - phPreview.Visible = false; - phHistory.Visible = false; - cmdEdit.Enabled = false; - cmdPreview.Enabled = true; - cmdHistory.Enabled = true; + this.lblCurrentWorkflowInUse.Text = this.GetLocalizedString(htmlContent.WorkflowName); + this.lblCurrentWorkflowState.Text = this.GetLocalizedString(htmlContent.StateName); + this.lblCurrentVersion.Text = htmlContent.Version.ToString(); + this.txtContent.Text = this.FormatContent(htmlContent.Content); + this.phEdit.Visible = true; + this.phPreview.Visible = false; + this.phHistory.Visible = false; + this.cmdEdit.Enabled = false; + this.cmdPreview.Enabled = true; + this.cmdHistory.Enabled = true; //DisplayMasterLanguageContent(); - DisplayMasterContentButton(); - ddlRender.Visible = true; + this.DisplayMasterContentButton(); + this.ddlRender.Visible = true; } private void DisplayMasterContentButton() { - var objModule = ModuleController.Instance.GetModule(ModuleId, TabId, false); + var objModule = ModuleController.Instance.GetModule(this.ModuleId, this.TabId, false); if (objModule.DefaultLanguageModule != null) { - cmdMasterContent.Visible = true; - cmdMasterContent.Text = Localization.GetString("cmdShowMasterContent", LocalResourceFile); + this.cmdMasterContent.Visible = true; + this.cmdMasterContent.Text = Localization.GetString("cmdShowMasterContent", this.LocalResourceFile); - cmdMasterContent.Text = phMasterContent.Visible ? - Localization.GetString("cmdHideMasterContent", LocalResourceFile) : - Localization.GetString("cmdShowMasterContent", LocalResourceFile); + this.cmdMasterContent.Text = this.phMasterContent.Visible ? + Localization.GetString("cmdHideMasterContent", this.LocalResourceFile) : + Localization.GetString("cmdShowMasterContent", this.LocalResourceFile); } } @@ -241,19 +241,19 @@ private void DisplayMasterContentButton() /// Content of the HTML. private void DisplayPreview(HtmlTextInfo htmlContent) { - lblPreviewVersion.Text = htmlContent.Version.ToString(); - lblPreviewWorkflowInUse.Text = GetLocalizedString(htmlContent.WorkflowName); - lblPreviewWorkflowState.Text = GetLocalizedString(htmlContent.StateName); - litPreview.Text = HtmlTextController.FormatHtmlText(ModuleId, htmlContent.Content, Settings, PortalSettings, Page); - phEdit.Visible = false; - phPreview.Visible = true; - phHistory.Visible = false; - cmdEdit.Enabled = true; - cmdPreview.Enabled = false; - cmdHistory.Enabled = true; - DisplayHistory(htmlContent); - cmdMasterContent.Visible = false; - ddlRender.Visible = false; + this.lblPreviewVersion.Text = htmlContent.Version.ToString(); + this.lblPreviewWorkflowInUse.Text = this.GetLocalizedString(htmlContent.WorkflowName); + this.lblPreviewWorkflowState.Text = this.GetLocalizedString(htmlContent.StateName); + this.litPreview.Text = HtmlTextController.FormatHtmlText(this.ModuleId, htmlContent.Content, this.Settings, this.PortalSettings, this.Page); + this.phEdit.Visible = false; + this.phPreview.Visible = true; + this.phHistory.Visible = false; + this.cmdEdit.Enabled = true; + this.cmdPreview.Enabled = false; + this.cmdHistory.Enabled = true; + this.DisplayHistory(htmlContent); + this.cmdMasterContent.Visible = false; + this.ddlRender.Visible = false; } /// @@ -262,34 +262,34 @@ private void DisplayPreview(HtmlTextInfo htmlContent) /// Content of the HTML. private void DisplayPreview(string htmlContent) { - litPreview.Text = HtmlTextController.FormatHtmlText(ModuleId, htmlContent, Settings, PortalSettings, Page); - divPreviewVersion.Visible = false; - divPreviewWorlflow.Visible = false; + this.litPreview.Text = HtmlTextController.FormatHtmlText(this.ModuleId, htmlContent, this.Settings, this.PortalSettings, this.Page); + this.divPreviewVersion.Visible = false; + this.divPreviewWorlflow.Visible = false; - divPreviewWorkflowState.Visible = true; - lblPreviewWorkflowState.Text = GetLocalizedString("EditPreviewState"); + this.divPreviewWorkflowState.Visible = true; + this.lblPreviewWorkflowState.Text = this.GetLocalizedString("EditPreviewState"); - phEdit.Visible = false; - phPreview.Visible = true; - phHistory.Visible = false; - cmdEdit.Enabled = true; - cmdPreview.Enabled = false; - cmdHistory.Enabled = true; - cmdMasterContent.Visible = false; - ddlRender.Visible = false; + this.phEdit.Visible = false; + this.phPreview.Visible = true; + this.phHistory.Visible = false; + this.cmdEdit.Enabled = true; + this.cmdPreview.Enabled = false; + this.cmdHistory.Enabled = true; + this.cmdMasterContent.Visible = false; + this.ddlRender.Visible = false; } private void DisplayEdit(string htmlContent) { - txtContent.Text = htmlContent; - phEdit.Visible = true; - phPreview.Visible = false; - phHistory.Visible = false; - cmdEdit.Enabled = false; - cmdPreview.Enabled = true; - cmdHistory.Enabled = true; - DisplayMasterContentButton(); - ddlRender.Visible = true; + this.txtContent.Text = htmlContent; + this.phEdit.Visible = true; + this.phPreview.Visible = false; + this.phHistory.Visible = false; + this.cmdEdit.Enabled = false; + this.cmdPreview.Enabled = true; + this.cmdHistory.Enabled = true; + this.DisplayMasterContentButton(); + this.ddlRender.Visible = true; } @@ -300,30 +300,30 @@ private void DisplayEdit(string htmlContent) /// Last content of the published. private void DisplayLockedContent(HtmlTextInfo htmlContent, HtmlTextInfo lastPublishedContent) { - txtContent.Visible = false; - cmdSave.Visible = false; + this.txtContent.Visible = false; + this.cmdSave.Visible = false; //cmdPreview.Enabled = false; - divPublish.Visible = false; + this.divPublish.Visible = false; - divSubmittedContent.Visible = true; + this.divSubmittedContent.Visible = true; - lblCurrentWorkflowInUse.Text = GetLocalizedString(htmlContent.WorkflowName); - lblCurrentWorkflowState.Text = GetLocalizedString(htmlContent.StateName); + this.lblCurrentWorkflowInUse.Text = this.GetLocalizedString(htmlContent.WorkflowName); + this.lblCurrentWorkflowState.Text = this.GetLocalizedString(htmlContent.StateName); - litCurrentContentPreview.Text = HtmlTextController.FormatHtmlText(ModuleId, htmlContent.Content, Settings, PortalSettings, Page); - lblCurrentVersion.Text = htmlContent.Version.ToString(); - DisplayVersions(); + this.litCurrentContentPreview.Text = HtmlTextController.FormatHtmlText(this.ModuleId, htmlContent.Content, this.Settings, this.PortalSettings, this.Page); + this.lblCurrentVersion.Text = htmlContent.Version.ToString(); + this.DisplayVersions(); if ((lastPublishedContent != null)) { - DisplayPreview(lastPublishedContent); + this.DisplayPreview(lastPublishedContent); //DisplayHistory(lastPublishedContent); } else { - dnnSitePanelEditHTMLHistory.Visible = false; - fsEditHtmlHistory.Visible = false; - DisplayPreview(htmlContent.Content); + this.dnnSitePanelEditHTMLHistory.Visible = false; + this.fsEditHtmlHistory.Visible = false; + this.DisplayPreview(htmlContent.Content); } } @@ -333,22 +333,22 @@ private void DisplayLockedContent(HtmlTextInfo htmlContent, HtmlTextInfo lastPub /// The first state. private void DisplayInitialContent(WorkflowStateInfo firstState) { - cmdHistory.Enabled = false; + this.cmdHistory.Enabled = false; - txtContent.Text = GetLocalizedString("AddContent"); - litPreview.Text = GetLocalizedString("AddContent"); - lblCurrentWorkflowInUse.Text = firstState.WorkflowName; - lblPreviewWorkflowInUse.Text = firstState.WorkflowName; - divPreviewVersion.Visible = false; + this.txtContent.Text = this.GetLocalizedString("AddContent"); + this.litPreview.Text = this.GetLocalizedString("AddContent"); + this.lblCurrentWorkflowInUse.Text = firstState.WorkflowName; + this.lblPreviewWorkflowInUse.Text = firstState.WorkflowName; + this.divPreviewVersion.Visible = false; - dnnSitePanelEditHTMLHistory.Visible = false; - fsEditHtmlHistory.Visible = false; + this.dnnSitePanelEditHTMLHistory.Visible = false; + this.fsEditHtmlHistory.Visible = false; - divCurrentWorkflowState.Visible = false; - phCurrentVersion.Visible = false; - divPreviewWorkflowState.Visible = false; + this.divCurrentWorkflowState.Visible = false; + this.phCurrentVersion.Visible = false; + this.divPreviewWorkflowState.Visible = false; - lblPreviewWorkflowState.Text = firstState.StateName; + this.lblPreviewWorkflowState.Text = firstState.StateName; } #endregion @@ -363,8 +363,8 @@ private void DisplayInitialContent(WorkflowStateInfo firstState) private string FormatContent(string htmlContent) { var strContent = HttpUtility.HtmlDecode(htmlContent); - strContent = HtmlTextController.ManageRelativePaths(strContent, PortalSettings.HomeDirectory, "src", PortalId); - strContent = HtmlTextController.ManageRelativePaths(strContent, PortalSettings.HomeDirectory, "background", PortalId); + strContent = HtmlTextController.ManageRelativePaths(strContent, this.PortalSettings.HomeDirectory, "src", this.PortalId); + strContent = HtmlTextController.ManageRelativePaths(strContent, this.PortalSettings.HomeDirectory, "background", this.PortalId); return HttpUtility.HtmlEncode(strContent); } @@ -375,7 +375,7 @@ private string FormatContent(string htmlContent) /// private string GetLocalizedString(string str) { - var localizedString = Localization.GetString(str, LocalResourceFile); + var localizedString = Localization.GetString(str, this.LocalResourceFile); return (string.IsNullOrEmpty(localizedString) ? str : localizedString); } @@ -385,14 +385,14 @@ private string GetLocalizedString(string str) /// private HtmlTextInfo GetLatestHTMLContent() { - var htmlContent = _htmlTextController.GetTopHtmlText(ModuleId, false, WorkflowID); + var htmlContent = this._htmlTextController.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); if (htmlContent == null) { htmlContent = new HtmlTextInfo(); htmlContent.ItemID = -1; - htmlContent.StateID = _workflowStateController.GetFirstWorkflowStateID(WorkflowID); - htmlContent.WorkflowID = WorkflowID; - htmlContent.ModuleID = ModuleId; + htmlContent.StateID = this._workflowStateController.GetFirstWorkflowStateID(this.WorkflowID); + htmlContent.WorkflowID = this.WorkflowID; + htmlContent.ModuleID = this.ModuleId; } return htmlContent; @@ -415,7 +415,7 @@ private bool UserCanReview(HtmlTextInfo htmlContent) /// private HtmlTextInfo GetLastPublishedVersion(int publishedStateID) { - return (from version in _htmlTextController.GetAllHtmlText(ModuleId) where version.StateID == publishedStateID orderby version.Version descending select version).ToList()[0]; + return (from version in this._htmlTextController.GetAllHtmlText(this.ModuleId) where version.StateID == publishedStateID orderby version.Version descending select version).ToList()[0]; } #endregion @@ -426,23 +426,23 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - hlCancel.NavigateUrl = _navigationManager.NavigateURL(); + this.hlCancel.NavigateUrl = this._navigationManager.NavigateURL(); - cmdEdit.Click += OnEditClick; - cmdPreview.Click += OnPreviewClick; - cmdHistory.Click += OnHistoryClick; - cmdMasterContent.Click += OnMasterContentClick; - ddlRender.SelectedIndexChanged += OnRenderSelectedIndexChanged; - cmdSave.Click += OnSaveClick; - dgHistory.RowDataBound += OnHistoryGridItemDataBound; - dgVersions.RowCommand += OnVersionsGridItemCommand; - dgVersions.RowDataBound += OnVersionsGridItemDataBound; - dgVersions.PageIndexChanged += OnVersionsGridPageIndexChanged; + this.cmdEdit.Click += this.OnEditClick; + this.cmdPreview.Click += this.OnPreviewClick; + this.cmdHistory.Click += this.OnHistoryClick; + this.cmdMasterContent.Click += this.OnMasterContentClick; + this.ddlRender.SelectedIndexChanged += this.OnRenderSelectedIndexChanged; + this.cmdSave.Click += this.OnSaveClick; + this.dgHistory.RowDataBound += this.OnHistoryGridItemDataBound; + this.dgVersions.RowCommand += this.OnVersionsGridItemCommand; + this.dgVersions.RowDataBound += this.OnVersionsGridItemDataBound; + this.dgVersions.PageIndexChanged += this.OnVersionsGridPageIndexChanged; } private void OnRenderSelectedIndexChanged(object sender, EventArgs e) { - txtContent.ChangeMode(ddlRender.SelectedValue); + this.txtContent.ChangeMode(this.ddlRender.SelectedValue); } protected override void OnLoad(EventArgs e) { @@ -451,50 +451,50 @@ protected override void OnLoad(EventArgs e) try { var htmlContentItemID = -1; - var htmlContent = _htmlTextController.GetTopHtmlText(ModuleId, false, WorkflowID); + var htmlContent = this._htmlTextController.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); if ((htmlContent != null)) { htmlContentItemID = htmlContent.ItemID; } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - var workflowStates = _workflowStateController.GetWorkflowStates(WorkflowID); - var maxVersions = _htmlTextController.GetMaximumVersionHistory(PortalId); - var userCanEdit = UserInfo.IsSuperUser || PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); + var workflowStates = this._workflowStateController.GetWorkflowStates(this.WorkflowID); + var maxVersions = this._htmlTextController.GetMaximumVersionHistory(this.PortalId); + var userCanEdit = this.UserInfo.IsSuperUser || PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); - lblMaxVersions.Text = maxVersions.ToString(); - dgVersions.PageSize = Math.Min(Math.Max(maxVersions, 5), 10); //min 5, max 10 + this.lblMaxVersions.Text = maxVersions.ToString(); + this.dgVersions.PageSize = Math.Min(Math.Max(maxVersions, 5), 10); //min 5, max 10 switch (workflowStates.Count) { case 1: - CurrentWorkflowType = WorkflowType.DirectPublish; + this.CurrentWorkflowType = WorkflowType.DirectPublish; break; case 2: - CurrentWorkflowType = WorkflowType.ContentStaging; + this.CurrentWorkflowType = WorkflowType.ContentStaging; break; } if (htmlContentItemID != -1) { - DisplayContent(htmlContent); + this.DisplayContent(htmlContent); //DisplayPreview(htmlContent); - DisplayHistory(htmlContent); + this.DisplayHistory(htmlContent); } else { - DisplayInitialContent(workflowStates[0] as WorkflowStateInfo); + this.DisplayInitialContent(workflowStates[0] as WorkflowStateInfo); } - divPublish.Visible = CurrentWorkflowType != WorkflowType.DirectPublish; - phCurrentVersion.Visible = CurrentWorkflowType != WorkflowType.DirectPublish; - phPreviewVersion.Visible = CurrentWorkflowType != WorkflowType.DirectPublish; + this.divPublish.Visible = this.CurrentWorkflowType != WorkflowType.DirectPublish; + this.phCurrentVersion.Visible = this.CurrentWorkflowType != WorkflowType.DirectPublish; + this.phPreviewVersion.Visible = this.CurrentWorkflowType != WorkflowType.DirectPublish; //DisplayVersions(); - BindRenderItems(); - ddlRender.SelectedValue = txtContent.Mode; + this.BindRenderItems(); + this.ddlRender.SelectedValue = this.txtContent.Mode; } } @@ -511,34 +511,34 @@ protected void OnSaveClick(object sender, EventArgs e) try { // get content - var htmlContent = GetLatestHTMLContent(); + var htmlContent = this.GetLatestHTMLContent(); - var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.PortalId) + var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(this.PortalSettings.PortalId) select pa.HTTPAlias; string content; - if (phEdit.Visible) - content = txtContent.Text; + if (this.phEdit.Visible) + content = this.txtContent.Text; else - content = hfEditor.Value; + content = this.hfEditor.Value; - if (Request.QueryString["nuru"] == null) + if (this.Request.QueryString["nuru"] == null) { content = HtmlUtils.AbsoluteToRelativeUrls(content, aliases); } htmlContent.Content = content; - var draftStateID = _workflowStateController.GetFirstWorkflowStateID(WorkflowID); - var publishedStateID = _workflowStateController.GetLastWorkflowStateID(WorkflowID); + var draftStateID = this._workflowStateController.GetFirstWorkflowStateID(this.WorkflowID); + var publishedStateID = this._workflowStateController.GetLastWorkflowStateID(this.WorkflowID); - switch (CurrentWorkflowType) + switch (this.CurrentWorkflowType) { case WorkflowType.DirectPublish: - _htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId)); + this._htmlTextController.UpdateHtmlText(htmlContent, this._htmlTextController.GetMaximumVersionHistory(this.PortalId)); break; case WorkflowType.ContentStaging: - if (chkPublish.Checked) + if (this.chkPublish.Checked) { //if it's already published set it to draft if (htmlContent.StateID == publishedStateID) @@ -560,31 +560,31 @@ protected void OnSaveClick(object sender, EventArgs e) } } - _htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId)); + this._htmlTextController.UpdateHtmlText(htmlContent, this._htmlTextController.GetMaximumVersionHistory(this.PortalId)); break; } } catch (Exception exc) { Exceptions.LogException(exc); - UI.Skins.Skin.AddModuleMessage(Page, "Error occurred: ", exc.Message, ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this.Page, "Error occurred: ", exc.Message, ModuleMessage.ModuleMessageType.RedError); return; } // redirect back to portal if (redirect) { - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } protected void OnEditClick(object sender, EventArgs e) { try { - DisplayEdit(hfEditor.Value); + this.DisplayEdit(this.hfEditor.Value); - if (phMasterContent.Visible) - DisplayMasterLanguageContent(); + if (this.phMasterContent.Visible) + this.DisplayMasterLanguageContent(); } catch (Exception exc) { @@ -595,9 +595,9 @@ protected void OnPreviewClick(object sender, EventArgs e) { try { - if (phEdit.Visible) - hfEditor.Value = txtContent.Text; - DisplayPreview(phEdit.Visible ? txtContent.Text : hfEditor.Value); + if (this.phEdit.Visible) + this.hfEditor.Value = this.txtContent.Text; + this.DisplayPreview(this.phEdit.Visible ? this.txtContent.Text : this.hfEditor.Value); } catch (Exception exc) { @@ -608,9 +608,9 @@ private void OnHistoryClick(object sender, EventArgs e) { try { - if (phEdit.Visible) - hfEditor.Value = txtContent.Text; - DisplayVersions(); + if (this.phEdit.Visible) + this.hfEditor.Value = this.txtContent.Text; + this.DisplayVersions(); } catch (Exception exc) { @@ -623,13 +623,13 @@ private void OnMasterContentClick(object sender, EventArgs e) { try { - phMasterContent.Visible = !phMasterContent.Visible; - cmdMasterContent.Text = phMasterContent.Visible ? - Localization.GetString("cmdHideMasterContent", LocalResourceFile) : - Localization.GetString("cmdShowMasterContent", LocalResourceFile); + this.phMasterContent.Visible = !this.phMasterContent.Visible; + this.cmdMasterContent.Text = this.phMasterContent.Visible ? + Localization.GetString("cmdHideMasterContent", this.LocalResourceFile) : + Localization.GetString("cmdShowMasterContent", this.LocalResourceFile); - if (phMasterContent.Visible) - DisplayMasterLanguageContent(); + if (this.phMasterContent.Visible) + this.DisplayMasterLanguageContent(); } catch (Exception exc) { @@ -644,8 +644,8 @@ protected void OnHistoryGridItemDataBound(object sender, GridViewRowEventArgs e) if (item.RowType == DataControlRowType.DataRow) { //Localize columns - item.Cells[2].Text = Localization.GetString(item.Cells[2].Text, LocalResourceFile); - item.Cells[3].Text = Localization.GetString(item.Cells[3].Text, LocalResourceFile); + item.Cells[2].Text = Localization.GetString(item.Cells[2].Text, this.LocalResourceFile); + item.Cells[3].Text = Localization.GetString(item.Cells[3].Text, this.LocalResourceFile); } } @@ -659,33 +659,33 @@ protected void OnVersionsGridItemCommand(object source, GridViewCommandEventArgs switch (e.CommandName.ToLowerInvariant()) { case "remove": - htmlContent = GetHTMLContent(e); - _htmlTextController.DeleteHtmlText(ModuleId, htmlContent.ItemID); + htmlContent = this.GetHTMLContent(e); + this._htmlTextController.DeleteHtmlText(this.ModuleId, htmlContent.ItemID); break; case "rollback": - htmlContent = GetHTMLContent(e); + htmlContent = this.GetHTMLContent(e); htmlContent.ItemID = -1; - htmlContent.ModuleID = ModuleId; - htmlContent.WorkflowID = WorkflowID; - htmlContent.StateID = _workflowStateController.GetFirstWorkflowStateID(WorkflowID); - _htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId)); + htmlContent.ModuleID = this.ModuleId; + htmlContent.WorkflowID = this.WorkflowID; + htmlContent.StateID = this._workflowStateController.GetFirstWorkflowStateID(this.WorkflowID); + this._htmlTextController.UpdateHtmlText(htmlContent, this._htmlTextController.GetMaximumVersionHistory(this.PortalId)); break; case "preview": - htmlContent = GetHTMLContent(e); - DisplayPreview(htmlContent); + htmlContent = this.GetHTMLContent(e); + this.DisplayPreview(htmlContent); break; } if ((e.CommandName.ToLowerInvariant() != "preview")) { - var latestContent = _htmlTextController.GetTopHtmlText(ModuleId, false, WorkflowID); + var latestContent = this._htmlTextController.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); if (latestContent == null) { - DisplayInitialContent(_workflowStateController.GetWorkflowStates(WorkflowID)[0] as WorkflowStateInfo); + this.DisplayInitialContent(this._workflowStateController.GetWorkflowStates(this.WorkflowID)[0] as WorkflowStateInfo); } else { - DisplayContent(latestContent); + this.DisplayContent(latestContent); //DisplayPreview(latestContent); //DisplayVersions(); } @@ -701,7 +701,7 @@ protected void OnVersionsGridItemCommand(object source, GridViewCommandEventArgs private HtmlTextInfo GetHTMLContent(GridViewCommandEventArgs e) { - return _htmlTextController.GetHtmlText(ModuleId, int.Parse(e.CommandArgument.ToString())); + return this._htmlTextController.GetHtmlText(this.ModuleId, int.Parse(e.CommandArgument.ToString())); } protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e) @@ -713,7 +713,7 @@ protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e if ((htmlContent.CreatedByUserID != -1)) { - var createdByByUser = UserController.GetUserById(PortalId, htmlContent.CreatedByUserID); + var createdByByUser = UserController.GetUserById(this.PortalId, htmlContent.CreatedByUserID); if (createdByByUser != null) { createdBy = createdByByUser.DisplayName; @@ -732,7 +732,7 @@ protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e { case "rollback": //hide rollback for the first item - if (dgVersions.CurrentPageIndex == 0) + if (this.dgVersions.CurrentPageIndex == 0) { if ((e.Row.RowIndex == 0)) { @@ -745,13 +745,13 @@ protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e break; case "remove": - var msg = GetLocalizedString("DeleteVersion.Confirm"); + var msg = this.GetLocalizedString("DeleteVersion.Confirm"); msg = msg.Replace("[VERSION]", htmlContent.Version.ToString()).Replace("[STATE]", htmlContent.StateName).Replace("[DATECREATED]", htmlContent.CreatedOnDate.ToString()) .Replace("[USERNAME]", createdBy); imageButton.OnClientClick = "return confirm(\"" + msg + "\");"; //hide the delete button - var showDelete = UserInfo.IsSuperUser || PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); + var showDelete = this.UserInfo.IsSuperUser || PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); if (!showDelete) { @@ -769,17 +769,17 @@ protected void OnVersionsGridItemDataBound(object sender, GridViewRowEventArgs e protected void OnVersionsGridPageIndexChanged(object source, EventArgs e) { - DisplayVersions(); + this.DisplayVersions(); } private void BindRenderItems() { - if (txtContent.IsRichEditorAvailable) + if (this.txtContent.IsRichEditorAvailable) { - ddlRender.Items.Add(new ListItem(LocalizeString("liRichText"), "RICH")); + this.ddlRender.Items.Add(new ListItem(this.LocalizeString("liRichText"), "RICH")); } - ddlRender.Items.Add(new ListItem(LocalizeString("liBasicText"), "BASIC")); + this.ddlRender.Items.Add(new ListItem(this.LocalizeString("liBasicText"), "BASIC")); } #endregion diff --git a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs index d5125d6df0f..47290b96f0c 100644 --- a/DNN Platform/Modules/HTML/HtmlModule.ascx.cs +++ b/DNN Platform/Modules/HTML/HtmlModule.ascx.cs @@ -41,7 +41,7 @@ public partial class HtmlModule : HtmlModuleBase, IActionable private readonly INavigationManager _navigationManager; public HtmlModule() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region "Private Methods" @@ -60,14 +60,14 @@ public HtmlModule() protected override void OnInit(EventArgs e) { base.OnInit(e); - lblContent.UpdateLabel += lblContent_UpdateLabel; - EditorEnabled = PortalSettings.InlineEditorEnabled; + this.lblContent.UpdateLabel += this.lblContent_UpdateLabel; + this.EditorEnabled = this.PortalSettings.InlineEditorEnabled; try { - WorkflowID = new HtmlTextController().GetWorkflow(ModuleId, TabId, PortalId).Value; + this.WorkflowID = new HtmlTextController().GetWorkflow(this.ModuleId, this.TabId, this.PortalId).Value; //Add an Action Event Handler to the Skin - AddActionHandler(ModuleAction_Click); + this.AddActionHandler(this.ModuleAction_Click); } catch (Exception exc) { @@ -90,20 +90,20 @@ protected override void OnLoad(EventArgs e) var objHTML = new HtmlTextController(); // edit in place - if (EditorEnabled && IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) + if (this.EditorEnabled && this.IsEditable && this.PortalSettings.UserMode == PortalSettings.Mode.Edit) { - EditorEnabled = true; + this.EditorEnabled = true; } else { - EditorEnabled = false; + this.EditorEnabled = false; } // get content HtmlTextInfo htmlTextInfo = null; string contentString = ""; - htmlTextInfo = objHTML.GetTopHtmlText(ModuleId, !IsEditable, WorkflowID); + htmlTextInfo = objHTML.GetTopHtmlText(this.ModuleId, !this.IsEditable, this.WorkflowID); if ((htmlTextInfo != null)) { @@ -113,61 +113,61 @@ protected override void OnLoad(EventArgs e) else { // get default content from resource file - if (PortalSettings.UserMode == PortalSettings.Mode.Edit) + if (this.PortalSettings.UserMode == PortalSettings.Mode.Edit) { - if (EditorEnabled) + if (this.EditorEnabled) { - contentString = Localization.GetString("AddContentFromToolBar.Text", LocalResourceFile); + contentString = Localization.GetString("AddContentFromToolBar.Text", this.LocalResourceFile); } else { - contentString = Localization.GetString("AddContentFromActionMenu.Text", LocalResourceFile); + contentString = Localization.GetString("AddContentFromActionMenu.Text", this.LocalResourceFile); } } else { // hide the module if no content and in view mode - ContainerControl.Visible = false; + this.ContainerControl.Visible = false; } } // token replace - EditorEnabled = EditorEnabled && !Settings.ReplaceTokens; + this.EditorEnabled = this.EditorEnabled && !this.Settings.ReplaceTokens; // localize toolbar - if (EditorEnabled) + if (this.EditorEnabled) { - foreach (DNNToolBarButton button in editorDnnToobar.Buttons) + foreach (DNNToolBarButton button in this.editorDnnToobar.Buttons) { - button.ToolTip = Localization.GetString(button.ToolTip + ".ToolTip", LocalResourceFile); + button.ToolTip = Localization.GetString(button.ToolTip + ".ToolTip", this.LocalResourceFile); } } else { - editorDnnToobar.Visible = false; + this.editorDnnToobar.Visible = false; } - lblContent.EditEnabled = EditorEnabled; + this.lblContent.EditEnabled = this.EditorEnabled; // add content to module - lblContent.Controls.Add(new LiteralControl(HtmlTextController.FormatHtmlText(ModuleId, contentString, Settings, PortalSettings, Page))); + this.lblContent.Controls.Add(new LiteralControl(HtmlTextController.FormatHtmlText(this.ModuleId, contentString, this.Settings, this.PortalSettings, this.Page))); //set normalCheckBox on the content wrapper to prevent form decoration if its disabled. - if (!Settings.UseDecorate) + if (!this.Settings.UseDecorate) { - lblContent.CssClass = string.Format("{0} normalCheckBox", lblContent.CssClass); + this.lblContent.CssClass = string.Format("{0} normalCheckBox", this.lblContent.CssClass); } - if (IsPostBack && AJAX.IsEnabled() && AJAX.GetScriptManager(Page).IsInAsyncPostBack) + if (this.IsPostBack && AJAX.IsEnabled() && AJAX.GetScriptManager(this.Page).IsInAsyncPostBack) { var resetScript = $@" if(typeof dnn !== 'undefined' && typeof dnn.controls !== 'undefined' && typeof dnn.controls.controls !== 'undefined'){{ - var control = dnn.controls.controls['{lblContent.ClientID}']; - if(control && control.container !== $get('{lblContent.ClientID}')){{ - dnn.controls.controls['{lblContent.ClientID}'] = null; + var control = dnn.controls.controls['{this.lblContent.ClientID}']; + if(control && control.container !== $get('{this.lblContent.ClientID}')){{ + dnn.controls.controls['{this.lblContent.ClientID}'] = null; }} }};"; - ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), $"ResetHtmlModule{ClientID}", resetScript, true); + ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), $"ResetHtmlModule{this.ClientID}", resetScript, true); } } catch (Exception exc) @@ -192,12 +192,12 @@ private void lblContent_UpdateLabel(object source, DNNLabelEditEventArgs e) { throw new SecurityException(); } - else if (EditorEnabled && IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) + else if (this.EditorEnabled && this.IsEditable && this.PortalSettings.UserMode == PortalSettings.Mode.Edit) { // get content var objHTML = new HtmlTextController(); var objWorkflow = new WorkflowStateController(); - HtmlTextInfo objContent = objHTML.GetTopHtmlText(ModuleId, false, WorkflowID); + HtmlTextInfo objContent = objHTML.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); if (objContent == null) { objContent = new HtmlTextInfo(); @@ -205,13 +205,13 @@ private void lblContent_UpdateLabel(object source, DNNLabelEditEventArgs e) } // set content attributes - objContent.ModuleID = ModuleId; - objContent.Content = Server.HtmlEncode(e.Text); - objContent.WorkflowID = WorkflowID; - objContent.StateID = objWorkflow.GetFirstWorkflowStateID(WorkflowID); + objContent.ModuleID = this.ModuleId; + objContent.Content = this.Server.HtmlEncode(e.Text); + objContent.WorkflowID = this.WorkflowID; + objContent.StateID = objWorkflow.GetFirstWorkflowStateID(this.WorkflowID); // save the content - objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(PortalId)); + objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(this.PortalId)); } else { @@ -238,23 +238,23 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) if (e.Action.CommandArgument == "publish") { // verify security - if (IsEditable && PortalSettings.UserMode == PortalSettings.Mode.Edit) + if (this.IsEditable && this.PortalSettings.UserMode == PortalSettings.Mode.Edit) { // get content var objHTML = new HtmlTextController(); - HtmlTextInfo objContent = objHTML.GetTopHtmlText(ModuleId, false, WorkflowID); + HtmlTextInfo objContent = objHTML.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); var objWorkflow = new WorkflowStateController(); - if (objContent.StateID == objWorkflow.GetFirstWorkflowStateID(WorkflowID)) + if (objContent.StateID == objWorkflow.GetFirstWorkflowStateID(this.WorkflowID)) { // publish content objContent.StateID = objWorkflow.GetNextWorkflowStateID(objContent.WorkflowID, objContent.StateID); // save the content - objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(PortalId)); + objHTML.UpdateHtmlText(objContent, objHTML.GetMaximumVersionHistory(this.PortalId)); // refresh page - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } } @@ -282,12 +282,12 @@ public ModuleActionCollection ModuleActions { // add the Edit Text action var Actions = new ModuleActionCollection(); - Actions.Add(GetNextActionID(), - Localization.GetString(ModuleActionType.AddContent, LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "", - EditUrl(), + this.EditUrl(), false, SecurityAccessLevel.Edit, true, @@ -296,20 +296,20 @@ public ModuleActionCollection ModuleActions // get the content var objHTML = new HtmlTextController(); var objWorkflow = new WorkflowStateController(); - WorkflowID = objHTML.GetWorkflow(ModuleId, TabId, PortalId).Value; + this.WorkflowID = objHTML.GetWorkflow(this.ModuleId, this.TabId, this.PortalId).Value; - HtmlTextInfo objContent = objHTML.GetTopHtmlText(ModuleId, false, WorkflowID); + HtmlTextInfo objContent = objHTML.GetTopHtmlText(this.ModuleId, false, this.WorkflowID); if ((objContent != null)) { // if content is in the first state - if (objContent.StateID == objWorkflow.GetFirstWorkflowStateID(WorkflowID)) + if (objContent.StateID == objWorkflow.GetFirstWorkflowStateID(this.WorkflowID)) { // if not direct publish workflow - if (objWorkflow.GetWorkflowStates(WorkflowID).Count > 1) + if (objWorkflow.GetWorkflowStates(this.WorkflowID).Count > 1) { // add publish action - Actions.Add(GetNextActionID(), - Localization.GetString("PublishContent.Action", LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString("PublishContent.Action", this.LocalResourceFile), ModuleActionType.AddContent, "publish", "grant.gif", @@ -323,28 +323,28 @@ public ModuleActionCollection ModuleActions else { // if the content is not in the last state of the workflow then review is required - if (objContent.StateID != objWorkflow.GetLastWorkflowStateID(WorkflowID)) + if (objContent.StateID != objWorkflow.GetLastWorkflowStateID(this.WorkflowID)) { // if the user has permissions to review the content if (WorkflowStatePermissionController.HasWorkflowStatePermission(WorkflowStatePermissionController.GetWorkflowStatePermissions(objContent.StateID), "REVIEW")) { // add approve and reject actions - Actions.Add(GetNextActionID(), - Localization.GetString("ApproveContent.Action", LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString("ApproveContent.Action", this.LocalResourceFile), ModuleActionType.AddContent, "", "grant.gif", - EditUrl("action", "approve", "Review"), + this.EditUrl("action", "approve", "Review"), false, SecurityAccessLevel.Edit, true, false); - Actions.Add(GetNextActionID(), - Localization.GetString("RejectContent.Action", LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString("RejectContent.Action", this.LocalResourceFile), ModuleActionType.AddContent, "", "deny.gif", - EditUrl("action", "reject", "Review"), + this.EditUrl("action", "reject", "Review"), false, SecurityAccessLevel.Edit, true, @@ -355,12 +355,12 @@ public ModuleActionCollection ModuleActions } // add mywork to action menu - Actions.Add(GetNextActionID(), - Localization.GetString("MyWork.Action", LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString("MyWork.Action", this.LocalResourceFile), "MyWork.Action", "", "view.gif", - EditUrl("MyWork"), + this.EditUrl("MyWork"), false, SecurityAccessLevel.Edit, true, diff --git a/DNN Platform/Modules/HTML/MyWork.ascx.cs b/DNN Platform/Modules/HTML/MyWork.ascx.cs index 33cdc6140d6..0212c5d3e99 100644 --- a/DNN Platform/Modules/HTML/MyWork.ascx.cs +++ b/DNN Platform/Modules/HTML/MyWork.ascx.cs @@ -26,7 +26,7 @@ public partial class MyWork : PortalModuleBase private readonly INavigationManager _navigationManager; public MyWork() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Protected Methods @@ -34,7 +34,7 @@ public MyWork() public string FormatURL(object dataItem) { var objHtmlTextUser = (HtmlTextUserInfo) dataItem; - return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; + return "" + objHtmlTextUser.ModuleTitle + " ( " + objHtmlTextUser.StateName + " )"; } #endregion @@ -49,15 +49,15 @@ public string FormatURL(object dataItem) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - hlCancel.NavigateUrl = _navigationManager.NavigateURL(); + this.hlCancel.NavigateUrl = this._navigationManager.NavigateURL(); try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { var objHtmlTextUsers = new HtmlTextUserController(); - dgTabs.DataSource = objHtmlTextUsers.GetHtmlTextUser(UserInfo.UserID); - dgTabs.DataBind(); + this.dgTabs.DataSource = objHtmlTextUsers.GetHtmlTextUser(this.UserInfo.UserID); + this.dgTabs.DataBind(); } } catch (Exception exc) diff --git a/DNN Platform/Modules/HTML/Settings.ascx.cs b/DNN Platform/Modules/HTML/Settings.ascx.cs index ff5f5751fe7..5db4620578b 100644 --- a/DNN Platform/Modules/HTML/Settings.ascx.cs +++ b/DNN Platform/Modules/HTML/Settings.ascx.cs @@ -29,7 +29,7 @@ public partial class Settings : ModuleSettingsBase { get { - return _moduleSettings ?? (_moduleSettings = new HtmlModuleSettingsRepository().GetSettings(this.ModuleConfiguration)); + return this._moduleSettings ?? (this._moduleSettings = new HtmlModuleSettingsRepository().GetSettings(this.ModuleConfiguration)); } } @@ -39,12 +39,12 @@ public partial class Settings : ModuleSettingsBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cboWorkflow.SelectedIndexChanged += OnWorkflowSelectedIndexChanged; + this.cboWorkflow.SelectedIndexChanged += this.OnWorkflowSelectedIndexChanged; } protected void OnWorkflowSelectedIndexChanged(object sender, EventArgs e) { - DisplayWorkflowDetails(); + this.DisplayWorkflowDetails(); } #endregion @@ -53,11 +53,11 @@ protected void OnWorkflowSelectedIndexChanged(object sender, EventArgs e) private void DisplayWorkflowDetails() { - if ((cboWorkflow.SelectedValue != null)) + if ((this.cboWorkflow.SelectedValue != null)) { var objWorkflow = new WorkflowStateController(); var strDescription = ""; - var arrStates = objWorkflow.GetWorkflowStates(int.Parse(cboWorkflow.SelectedValue)); + var arrStates = objWorkflow.GetWorkflowStates(int.Parse(this.cboWorkflow.SelectedValue)); if (arrStates.Count > 0) { foreach (WorkflowStateInfo objState in arrStates) @@ -66,7 +66,7 @@ private void DisplayWorkflowDetails() } strDescription = strDescription + "
    " + ((WorkflowStateInfo)arrStates[0]).Description; } - lblDescription.Text = strDescription; + this.lblDescription.Text = strDescription; } } @@ -83,39 +83,39 @@ public override void LoadSettings() { try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { var htmlTextController = new HtmlTextController(); var workflowStateController = new WorkflowStateController(); - chkReplaceTokens.Checked = ModuleSettings.ReplaceTokens; - cbDecorate.Checked = ModuleSettings.UseDecorate; + this.chkReplaceTokens.Checked = this.ModuleSettings.ReplaceTokens; + this.cbDecorate.Checked = this.ModuleSettings.UseDecorate; // get workflow/version settings var workflows = new ArrayList(); - foreach (WorkflowStateInfo state in workflowStateController.GetWorkflows(PortalId)) + foreach (WorkflowStateInfo state in workflowStateController.GetWorkflows(this.PortalId)) { if (!state.IsDeleted) { workflows.Add(state); } } - cboWorkflow.DataSource = workflows; - cboWorkflow.DataBind(); - var workflow = htmlTextController.GetWorkflow(ModuleId, TabId, PortalId); - if ((cboWorkflow.FindItemByValue(workflow.Value.ToString()) != null)) + this.cboWorkflow.DataSource = workflows; + this.cboWorkflow.DataBind(); + var workflow = htmlTextController.GetWorkflow(this.ModuleId, this.TabId, this.PortalId); + if ((this.cboWorkflow.FindItemByValue(workflow.Value.ToString()) != null)) { - cboWorkflow.FindItemByValue(workflow.Value.ToString()).Selected = true; + this.cboWorkflow.FindItemByValue(workflow.Value.ToString()).Selected = true; } - DisplayWorkflowDetails(); + this.DisplayWorkflowDetails(); - if (rblApplyTo.Items.FindByValue(workflow.Key) != null) + if (this.rblApplyTo.Items.FindByValue(workflow.Key) != null) { - rblApplyTo.Items.FindByValue(workflow.Key).Selected = true; + this.rblApplyTo.Items.FindByValue(workflow.Key).Selected = true; } - txtSearchDescLength.Text = ModuleSettings.SearchDescLength.ToString(); + this.txtSearchDescLength.Text = this.ModuleSettings.SearchDescLength.ToString(); } //Module failed to load } @@ -135,16 +135,16 @@ public override void UpdateSettings() var htmlTextController = new HtmlTextController(); // update replace token setting - ModuleSettings.ReplaceTokens = chkReplaceTokens.Checked; - ModuleSettings.UseDecorate = cbDecorate.Checked; - ModuleSettings.SearchDescLength = int.Parse(txtSearchDescLength.Text); + this.ModuleSettings.ReplaceTokens = this.chkReplaceTokens.Checked; + this.ModuleSettings.UseDecorate = this.cbDecorate.Checked; + this.ModuleSettings.SearchDescLength = int.Parse(this.txtSearchDescLength.Text); var repo = new HtmlModuleSettingsRepository(); - repo.SaveSettings(this.ModuleConfiguration, ModuleSettings); + repo.SaveSettings(this.ModuleConfiguration, this.ModuleSettings); // disable module caching if token replace is enabled - if (chkReplaceTokens.Checked) + if (this.chkReplaceTokens.Checked) { - ModuleInfo module = ModuleController.Instance.GetModule(ModuleId, TabId, false); + ModuleInfo module = ModuleController.Instance.GetModule(this.ModuleId, this.TabId, false); if (module.CacheTime > 0) { module.CacheTime = 0; @@ -153,16 +153,16 @@ public override void UpdateSettings() } // update workflow/version settings - switch (rblApplyTo.SelectedValue) + switch (this.rblApplyTo.SelectedValue) { case "Module": - htmlTextController.UpdateWorkflow(ModuleId, rblApplyTo.SelectedValue, Int32.Parse(cboWorkflow.SelectedValue), chkReplace.Checked); + htmlTextController.UpdateWorkflow(this.ModuleId, this.rblApplyTo.SelectedValue, Int32.Parse(this.cboWorkflow.SelectedValue), this.chkReplace.Checked); break; case "Page": - htmlTextController.UpdateWorkflow(TabId, rblApplyTo.SelectedValue, Int32.Parse(cboWorkflow.SelectedValue), chkReplace.Checked); + htmlTextController.UpdateWorkflow(this.TabId, this.rblApplyTo.SelectedValue, Int32.Parse(this.cboWorkflow.SelectedValue), this.chkReplace.Checked); break; case "Site": - htmlTextController.UpdateWorkflow(PortalId, rblApplyTo.SelectedValue, Int32.Parse(cboWorkflow.SelectedValue), chkReplace.Checked); + htmlTextController.UpdateWorkflow(this.PortalId, this.rblApplyTo.SelectedValue, Int32.Parse(this.cboWorkflow.SelectedValue), this.chkReplace.Checked); break; } diff --git a/DNN Platform/Modules/HTML/packages.config b/DNN Platform/Modules/HTML/packages.config index 015e7e36813..4fca05e5f8c 100644 --- a/DNN Platform/Modules/HTML/packages.config +++ b/DNN Platform/Modules/HTML/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/HtmlEditorManager/Components/UpgradeController.cs b/DNN Platform/Modules/HtmlEditorManager/Components/UpgradeController.cs index 04957939569..af3b56aea8f 100644 --- a/DNN Platform/Modules/HtmlEditorManager/Components/UpgradeController.cs +++ b/DNN Platform/Modules/HtmlEditorManager/Components/UpgradeController.cs @@ -67,23 +67,23 @@ public string UpgradeModule(string version) break; case "09.01.01": - if (RadEditorProviderInstalled()) + if (this.RadEditorProviderInstalled()) { UpdateRadCfgFiles(); } - if (TelerikAssemblyExists()) + if (this.TelerikAssemblyExists()) { UpdateWebConfigFile(); } break; case "09.02.00": - if (TelerikAssemblyExists()) + if (this.TelerikAssemblyExists()) { UpdateTelerikEncryptionKey("Telerik.Web.UI.DialogParametersEncryptionKey"); } break; case "09.02.01": - if (TelerikAssemblyExists()) + if (this.TelerikAssemblyExists()) { UpdateTelerikEncryptionKey("Telerik.Upload.ConfigurationHashKey"); } diff --git a/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj b/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj index 6a7d173c7d4..a0f7fe74f8f 100644 --- a/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj +++ b/DNN Platform/Modules/HtmlEditorManager/DotNetNuke.Modules.HtmlEditorManager.csproj @@ -27,6 +27,7 @@ ..\..\..\..\Evoq.Content\ true + true @@ -116,6 +117,9 @@ + + stylecop.json + Designer @@ -159,6 +163,10 @@ InvalidConfiguration.ascx.cs + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Modules/HtmlEditorManager/Presenters/ProviderConfigurationPresenter.cs b/DNN Platform/Modules/HtmlEditorManager/Presenters/ProviderConfigurationPresenter.cs index 75bd440259c..af628407c14 100644 --- a/DNN Platform/Modules/HtmlEditorManager/Presenters/ProviderConfigurationPresenter.cs +++ b/DNN Platform/Modules/HtmlEditorManager/Presenters/ProviderConfigurationPresenter.cs @@ -74,7 +74,7 @@ private void View_Initialize(object sender, EventArgs e) // hack: force DNN to load the Telerik Combobox skin. Needed for the RadEditor provider //TODO: Remove as the included file path isn't distributed with installs - ClientResourceManager.RegisterStyleSheet(View.Editor.Page, "~/Portals/_default/Skins/_default/WebControlSkin/Default/ComboBox.Default.css"); + ClientResourceManager.RegisterStyleSheet(this.View.Editor.Page, "~/Portals/_default/Skins/_default/WebControlSkin/Default/ComboBox.Default.css"); } /// Loads the current editor. diff --git a/DNN Platform/Modules/HtmlEditorManager/Views/ProviderConfiguration.ascx.cs b/DNN Platform/Modules/HtmlEditorManager/Views/ProviderConfiguration.ascx.cs index 927206df652..da157d70385 100644 --- a/DNN Platform/Modules/HtmlEditorManager/Views/ProviderConfiguration.ascx.cs +++ b/DNN Platform/Modules/HtmlEditorManager/Views/ProviderConfiguration.ascx.cs @@ -58,7 +58,7 @@ protected void ProvidersDropDownList_SelectedIndexChanged(object sender, EventAr public void Refresh() { - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } protected override void OnInit(EventArgs e) @@ -66,8 +66,8 @@ protected override void OnInit(EventArgs e) var currentUser = UserController.Instance.GetCurrentUserInfo(); if (currentUser == null || !currentUser.IsSuperUser) { - LocalResourceFile = "/DesktopModules/Admin/HtmlEditorManager/App_LocalResources/ProviderConfiguration.ascx.resx"; - Globals.Redirect(Globals.AccessDeniedURL(LocalizeString("CannotManageHTMLEditorProviders")), true); + this.LocalResourceFile = "/DesktopModules/Admin/HtmlEditorManager/App_LocalResources/ProviderConfiguration.ascx.resx"; + Globals.Redirect(Globals.AccessDeniedURL(this.LocalizeString("CannotManageHTMLEditorProviders")), true); } base.OnInit(e); } diff --git a/DNN Platform/Modules/HtmlEditorManager/packages.config b/DNN Platform/Modules/HtmlEditorManager/packages.config index db1132d353b..316a1122697 100644 --- a/DNN Platform/Modules/HtmlEditorManager/packages.config +++ b/DNN Platform/Modules/HtmlEditorManager/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/DNN Platform/Modules/Journal/Components/FeatureController.cs b/DNN Platform/Modules/Journal/Components/FeatureController.cs index 0c775956b86..02b491ff07e 100644 --- a/DNN Platform/Modules/Journal/Components/FeatureController.cs +++ b/DNN Platform/Modules/Journal/Components/FeatureController.cs @@ -47,7 +47,7 @@ public class FeatureController : ModuleSearchBase, IModuleSearchResultController protected INavigationManager NavigationManager { get; } public FeatureController() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Optional Interfaces @@ -190,7 +190,7 @@ public override IList GetModifiedSearchDocuments(ModuleInfo modu } //index comments for this journal - AddCommentItems(journalIds, searchDocuments); + this.AddCommentItems(journalIds, searchDocuments); } } } @@ -279,15 +279,15 @@ public string GetDocUrl(SearchResult searchResult) if (groupId > 0 && tabId > 0) { - url = NavigationManager.NavigateURL(tabId, string.Empty, "GroupId=" + groupId, "jid=" + journalId); + url = this.NavigationManager.NavigateURL(tabId, string.Empty, "GroupId=" + groupId, "jid=" + journalId); } else if (tabId == portalSettings.UserTabId) { - url = NavigationManager.NavigateURL(portalSettings.UserTabId, string.Empty, string.Format("userId={0}", profileId), "jid=" + journalId); + url = this.NavigationManager.NavigateURL(portalSettings.UserTabId, string.Empty, string.Format("userId={0}", profileId), "jid=" + journalId); } else { - url = NavigationManager.NavigateURL(tabId, string.Empty, "jid=" + journalId); + url = this.NavigationManager.NavigateURL(tabId, string.Empty, "jid=" + journalId); } return url; diff --git a/DNN Platform/Modules/Journal/Components/JournalControl.cs b/DNN Platform/Modules/Journal/Components/JournalControl.cs index 8a0e6783ee7..27768bae578 100644 --- a/DNN Platform/Modules/Journal/Components/JournalControl.cs +++ b/DNN Platform/Modules/Journal/Components/JournalControl.cs @@ -29,15 +29,15 @@ public string GetProperty(string propertyName, string format, System.Globalizati propertyName = propertyName.ToLowerInvariant(); switch (propertyName) { case "commentlink": - return CommentLink; + return this.CommentLink; case "likelink": - return LikeLink; + return this.LikeLink; case "likelist": - return LikeList; + return this.LikeList; case "commentarea": - return CommentArea; + return this.CommentArea; case "authornamelink": - return AuthorNameLink; + return this.AuthorNameLink; } propertyNotFound = true; diff --git a/DNN Platform/Modules/Journal/Components/JournalItemPropertyAccess.cs b/DNN Platform/Modules/Journal/Components/JournalItemPropertyAccess.cs index 6bca1b642b3..7a5503b58b9 100644 --- a/DNN Platform/Modules/Journal/Components/JournalItemPropertyAccess.cs +++ b/DNN Platform/Modules/Journal/Components/JournalItemPropertyAccess.cs @@ -7,19 +7,19 @@ namespace DotNetNuke.Modules.Journal.Components { public class JournalItemTokenReplace : Services.Tokens.BaseCustomTokenReplace { public JournalItemTokenReplace(JournalItem journalItem, JournalControl journalControl) { - PropertySource["journalitem"] = journalItem; - PropertySource["journalcontrol"] = journalControl; + this.PropertySource["journalitem"] = journalItem; + this.PropertySource["journalcontrol"] = journalControl; if (journalItem.ItemData != null) { - PropertySource["journaldata"] = journalItem.ItemData; + this.PropertySource["journaldata"] = journalItem.ItemData; } if (journalItem.JournalAuthor != null) { - PropertySource["journalauthor"] = journalItem.JournalAuthor; - PropertySource["journalprofile"] = new ProfilePicPropertyAccess(journalItem.JournalAuthor.Id); + this.PropertySource["journalauthor"] = journalItem.JournalAuthor; + this.PropertySource["journalprofile"] = new ProfilePicPropertyAccess(journalItem.JournalAuthor.Id); } } public string ReplaceJournalItemTokens(string source) { - return ReplaceTokens(source); + return this.ReplaceTokens(source); } } } diff --git a/DNN Platform/Modules/Journal/Components/JournalParser.cs b/DNN Platform/Modules/Journal/Components/JournalParser.cs index 2824707c823..6d3c9506bc4 100644 --- a/DNN Platform/Modules/Journal/Components/JournalParser.cs +++ b/DNN Platform/Modules/Journal/Components/JournalParser.cs @@ -45,37 +45,37 @@ public class JournalParser public JournalParser(PortalSettings portalSettings, int moduleId, int profileId, int socialGroupId, UserInfo userInfo) { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - PortalSettings = portalSettings; - ModuleId = moduleId; - ProfileId = profileId; - SocialGroupId = socialGroupId; - CurrentUser = userInfo; - url = PortalSettings.DefaultPortalAlias; - OwnerPortalId = portalSettings.PortalId; - ModuleInfo moduleInfo = ModuleController.Instance.GetModule(moduleId, PortalSettings.ActiveTab.TabID, false); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.PortalSettings = portalSettings; + this.ModuleId = moduleId; + this.ProfileId = profileId; + this.SocialGroupId = socialGroupId; + this.CurrentUser = userInfo; + this.url = this.PortalSettings.DefaultPortalAlias; + this.OwnerPortalId = portalSettings.PortalId; + ModuleInfo moduleInfo = ModuleController.Instance.GetModule(moduleId, this.PortalSettings.ActiveTab.TabID, false); if (moduleInfo.OwnerPortalID != portalSettings.PortalId) { - OwnerPortalId = moduleInfo.OwnerPortalID; + this.OwnerPortalId = moduleInfo.OwnerPortalID; } - if (string.IsNullOrEmpty(url)) { - url = HttpContext.Current.Request.Url.Host; + if (string.IsNullOrEmpty(this.url)) { + this.url = HttpContext.Current.Request.Url.Host; } - url = string.Format("{0}://{1}{2}", + this.url = string.Format("{0}://{1}{2}", UrlUtils.IsSecureConnectionOrSslOffload(HttpContext.Current.Request) ? "https" : "http", - url, - !HttpContext.Current.Request.Url.IsDefaultPort && !url.Contains(":") ? ":" + HttpContext.Current.Request.Url.Port : string.Empty); + this.url, + !HttpContext.Current.Request.Url.IsDefaultPort && !this.url.Contains(":") ? ":" + HttpContext.Current.Request.Url.Port : string.Empty); } private static readonly Regex BaseUrlRegex = new Regex("\\[BaseUrl\\]", RegexOptions.Compiled | RegexOptions.IgnoreCase); public string GetList(int currentIndex, int rows) { - if (CurrentUser.UserID > 0) { - isAdmin = CurrentUser.IsInRole(PortalSettings.AdministratorRoleName); + if (this.CurrentUser.UserID > 0) { + this.isAdmin = this.CurrentUser.IsInRole(this.PortalSettings.AdministratorRoleName); } - isUnverifiedUser = !CurrentUser.IsSuperUser && CurrentUser.IsInRole("Unverified Users"); + this.isUnverifiedUser = !this.CurrentUser.IsSuperUser && this.CurrentUser.IsInRole("Unverified Users"); var journalControllerInternal = InternalJournalController.Instance; var sb = new StringBuilder(); @@ -85,42 +85,42 @@ public string GetList(int currentIndex, int rows) string photoTemplate = Localization.GetString("journal_photo", ResxPath); string fileTemplate = Localization.GetString("journal_file", ResxPath); - statusTemplate = BaseUrlRegex.Replace(statusTemplate, url); - linkTemplate = BaseUrlRegex.Replace(linkTemplate, url); - photoTemplate = BaseUrlRegex.Replace(photoTemplate, url); - fileTemplate = BaseUrlRegex.Replace(fileTemplate, url); + statusTemplate = BaseUrlRegex.Replace(statusTemplate, this.url); + linkTemplate = BaseUrlRegex.Replace(linkTemplate, this.url); + photoTemplate = BaseUrlRegex.Replace(photoTemplate, this.url); + fileTemplate = BaseUrlRegex.Replace(fileTemplate, this.url); string comment = Localization.GetString("comment", ResxPath); IList journalList; - if (JournalId > 0) + if (this.JournalId > 0) { - var journal = JournalController.Instance.GetJournalItem(PortalSettings.PortalId, CurrentUser.UserID, - JournalId, false, false, true); + var journal = JournalController.Instance.GetJournalItem(this.PortalSettings.PortalId, this.CurrentUser.UserID, + this.JournalId, false, false, true); journalList = new List(); if (journal != null) { journalList.Add(journal); } } - else if (ProfileId > 0) + else if (this.ProfileId > 0) { - journalList = journalControllerInternal.GetJournalItemsByProfile(OwnerPortalId, ModuleId, CurrentUser.UserID, ProfileId, currentIndex, rows); + journalList = journalControllerInternal.GetJournalItemsByProfile(this.OwnerPortalId, this.ModuleId, this.CurrentUser.UserID, this.ProfileId, currentIndex, rows); } - else if (SocialGroupId > 0) + else if (this.SocialGroupId > 0) { - journalList = journalControllerInternal.GetJournalItemsByGroup(OwnerPortalId, ModuleId, CurrentUser.UserID, SocialGroupId, currentIndex, rows); + journalList = journalControllerInternal.GetJournalItemsByGroup(this.OwnerPortalId, this.ModuleId, this.CurrentUser.UserID, this.SocialGroupId, currentIndex, rows); } else { - journalList = journalControllerInternal.GetJournalItems(OwnerPortalId, ModuleId, CurrentUser.UserID, currentIndex, rows); + journalList = journalControllerInternal.GetJournalItems(this.OwnerPortalId, this.ModuleId, this.CurrentUser.UserID, currentIndex, rows); } var journalIds = journalList.Select(ji => ji.JournalId).ToList(); IList comments = JournalController.Instance.GetCommentsByJournalIds(journalIds); foreach (JournalItem ji in journalList) { - string replacement = GetStringReplacement(ji); + string replacement = this.GetStringReplacement(ji); string rowTemplate; if (ji.JournalType == "status") { @@ -136,18 +136,18 @@ public string GetList(int currentIndex, int rows) rowTemplate = fileTemplate; rowTemplate = TemplateRegex.Replace(rowTemplate, replacement); } else { - rowTemplate = GetJournalTemplate(ji.JournalType, ji); + rowTemplate = this.GetJournalTemplate(ji.JournalType, ji); } var ctl = new JournalControl(); bool isLiked = false; - ctl.LikeList = GetLikeListHTML(ji, ref isLiked); + ctl.LikeList = this.GetLikeListHTML(ji, ref isLiked); ctl.LikeLink = String.Empty; ctl.CommentLink = String.Empty; - ctl.AuthorNameLink = "" + ji.JournalAuthor.Name + ""; - if (CurrentUser.UserID > 0 && !isUnverifiedUser) + ctl.AuthorNameLink = "" + ji.JournalAuthor.Name + ""; + if (this.CurrentUser.UserID > 0 && !this.isUnverifiedUser) { if (!ji.CommentsDisabled) { @@ -164,9 +164,9 @@ public string GetList(int currentIndex, int rows) } } - ctl.CommentArea = GetCommentAreaHTML(ji, comments); + ctl.CommentArea = this.GetCommentAreaHTML(ji, comments); ji.TimeFrame = DateUtils.CalculateDateForDisplay(ji.DateCreated); - ji.DateCreated = CurrentUser.LocalTime(ji.DateCreated); + ji.DateCreated = this.CurrentUser.LocalTime(ji.DateCreated); if (ji.Summary != null) { @@ -182,7 +182,7 @@ public string GetList(int currentIndex, int rows) string tmp = tokenReplace.ReplaceJournalItemTokens(rowTemplate); tmp = tmp.Replace("
    ", "
    "); sb.Append("
    "); - if (isAdmin || CurrentUser.UserID == ji.UserId || (ProfileId > Null.NullInteger && CurrentUser.UserID == ProfileId)) { + if (this.isAdmin || this.CurrentUser.UserID == ji.UserId || (this.ProfileId > Null.NullInteger && this.CurrentUser.UserID == this.ProfileId)) { sb.Append("
    "); } sb.Append(tmp); @@ -200,10 +200,10 @@ internal string GetJournalTemplate(string journalType, JournalItem ji) template = Localization.GetString("journal_generic", ResxPath); } - template = BaseUrlRegex.Replace(template, url); + template = BaseUrlRegex.Replace(template, this.url); template = template.Replace("[journalitem:action]", Localization.GetString(journalType + ".Action", ResxPath)); - var replacement = GetStringReplacement(ji); + var replacement = this.GetStringReplacement(ji); return TemplateRegex.Replace(template, replacement); } @@ -219,7 +219,7 @@ internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) return string.Empty; } foreach(XmlNode xLike in xLikes) { - if (Convert.ToInt32(xLike.Attributes["uid"].Value) == CurrentUser.UserID){ + if (Convert.ToInt32(xLike.Attributes["uid"].Value) == this.CurrentUser.UserID){ ji.CurrentUserLikes = true; isLiked = true; break; @@ -238,7 +238,7 @@ internal string GetLikeListHTML(JournalItem ji, ref bool isLiked) foreach (XmlNode l in xLikes) { int userId = Convert.ToInt32(l.Attributes["uid"].Value); string name = l.Attributes["un"].Value; - if (userId != CurrentUser.UserID) { + if (userId != this.CurrentUser.UserID) { if (xc < xLikes.Count - 1 && xc > 0 && xc < 3) { sb.Append(", "); } else if (xc > 0 & xc < xLikes.Count & xc < 3) { @@ -297,10 +297,10 @@ internal string GetCommentAreaHTML(JournalItem journal, IList comme foreach(CommentInfo ci in comments) { if (ci.JournalId == journal.JournalId) { - sb.Append(GetCommentRow(journal, ci)); + sb.Append(this.GetCommentRow(journal, ci)); } } - if (CurrentUser.UserID > 0 && !journal.CommentsDisabled) + if (this.CurrentUser.UserID > 0 && !journal.CommentsDisabled) { sb.AppendFormat("
  • ", journal.JournalId); sb.AppendFormat("", journal.JournalId); @@ -317,12 +317,12 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { var sb = new StringBuilder(); string pic = UserController.Instance.GetUserProfilePictureUrl(comment.UserId, 32, 32); sb.AppendFormat("
  • ", comment.CommentId); - if (comment.UserId == CurrentUser.UserID || journal.UserId == CurrentUser.UserID || isAdmin) { + if (comment.UserId == this.CurrentUser.UserID || journal.UserId == this.CurrentUser.UserID || this.isAdmin) { sb.Append("
    "); } sb.AppendFormat("", pic); sb.Append("

    "); - string userUrl = NavigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] { "userId=" + comment.UserId }); + string userUrl = this.NavigationManager.NavigateURL(this.PortalSettings.UserTabId, string.Empty, new[] { "userId=" + comment.UserId }); sb.AppendFormat("{0}", comment.DisplayName, userUrl); if (comment.CommentXML != null && comment.CommentXML.SelectSingleNode("/root/comment") != null) @@ -345,7 +345,7 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { } var timeFrame = DateUtils.CalculateDateForDisplay(comment.DateCreated); - comment.DateCreated = CurrentUser.LocalTime(comment.DateCreated); + comment.DateCreated = this.CurrentUser.LocalTime(comment.DateCreated); sb.AppendFormat("{1}", comment.DateCreated, timeFrame); sb.Append("

    "); @@ -357,13 +357,13 @@ internal string GetCommentRow(JournalItem journal, CommentInfo comment) { private string GetStringReplacement(JournalItem journalItem) { string replacement = string.Empty; - if (CurrentUser.UserID > 0 && SocialGroupId <= 0 && !isUnverifiedUser) + if (this.CurrentUser.UserID > 0 && this.SocialGroupId <= 0 && !this.isUnverifiedUser) { replacement = "$1"; } - if (CurrentUser.UserID > 0 && journalItem.SocialGroupId > 0 && !isUnverifiedUser) + if (this.CurrentUser.UserID > 0 && journalItem.SocialGroupId > 0 && !this.isUnverifiedUser) { - replacement = CurrentUser.IsInRole(journalItem.JournalOwner.Name) ? "$1" : string.Empty; + replacement = this.CurrentUser.IsInRole(journalItem.JournalOwner.Name) ? "$1" : string.Empty; } return replacement; } diff --git a/DNN Platform/Modules/Journal/Components/ProfilePicPropertyAccess.cs b/DNN Platform/Modules/Journal/Components/ProfilePicPropertyAccess.cs index 172e28c7b59..d881009026d 100644 --- a/DNN Platform/Modules/Journal/Components/ProfilePicPropertyAccess.cs +++ b/DNN Platform/Modules/Journal/Components/ProfilePicPropertyAccess.cs @@ -17,7 +17,7 @@ public class ProfilePicPropertyAccess: IPropertyAccess public ProfilePicPropertyAccess(int userId) { - _userId = userId; + this._userId = userId; } public CacheLevel Cacheability => CacheLevel.notCacheable; @@ -29,9 +29,9 @@ public string GetProperty(string propertyName, string format, CultureInfo format { int size; if (int.TryParse(format, out size)) { - Size = size; + this.Size = size; } - return UserController.Instance.GetUserProfilePictureUrl(_userId, Size, Size); + return UserController.Instance.GetUserProfilePictureUrl(this._userId, this.Size, this.Size); } propertyNotFound = true; return string.Empty; diff --git a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj index 3922bdfe195..160720431cc 100644 --- a/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj +++ b/DNN Platform/Modules/Journal/DotNetNuke.Modules.Journal.csproj @@ -26,6 +26,7 @@ ..\..\..\..\Evoq.Content\ true + true @@ -189,6 +190,9 @@ + + stylecop.json + Designer @@ -248,6 +252,10 @@ Designer + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Modules/Journal/Edit.ascx.cs b/DNN Platform/Modules/Journal/Edit.ascx.cs index 88c3e3e2126..0f4bbf04a48 100644 --- a/DNN Platform/Modules/Journal/Edit.ascx.cs +++ b/DNN Platform/Modules/Journal/Edit.ascx.cs @@ -29,7 +29,7 @@ public partial class Edit : JournalModuleBase { #region Event Handlers override protected void OnInit(EventArgs e) { - InitializeComponent(); + this.InitializeComponent(); base.OnInit(e); } diff --git a/DNN Platform/Modules/Journal/FileUploadController.cs b/DNN Platform/Modules/Journal/FileUploadController.cs index 6d05cb035e2..13635ddbf95 100644 --- a/DNN Platform/Modules/Journal/FileUploadController.cs +++ b/DNN Platform/Modules/Journal/FileUploadController.cs @@ -31,14 +31,14 @@ public HttpResponseMessage UploadFile() try { //todo can we eliminate the HttpContext here - UploadWholeFile(HttpContextSource.Current, statuses); + this.UploadWholeFile(HttpContextSource.Current, statuses); } catch (Exception exc) { Logger.Error(exc); } - return IframeSafeJson(statuses); + return this.IframeSafeJson(statuses); } private HttpResponseMessage IframeSafeJson(List statuses) @@ -74,7 +74,7 @@ private void UploadWholeFile(HttpContextBase context, ICollection s try { - var fileInfo = JournalController.Instance.SaveJourmalFile(ActiveModule, UserInfo, fileName, file.InputStream); + var fileInfo = JournalController.Instance.SaveJourmalFile(this.ActiveModule, this.UserInfo, fileName, file.InputStream); var fileIcon = Entities.Icons.IconController.IconURL("Ext" + fileInfo.Extension, "32x32"); if (!File.Exists(context.Server.MapPath(fileIcon))) { diff --git a/DNN Platform/Modules/Journal/JournalListControl.cs b/DNN Platform/Modules/Journal/JournalListControl.cs index 92b3343133d..1aa3c60dad1 100644 --- a/DNN Platform/Modules/Journal/JournalListControl.cs +++ b/DNN Platform/Modules/Journal/JournalListControl.cs @@ -64,12 +64,12 @@ public int JournalId protected override void Render(HtmlTextWriter output) { - if (Enabled) { - if (CurrentIndex < 0) { - CurrentIndex = 0; + if (this.Enabled) { + if (this.CurrentIndex < 0) { + this.CurrentIndex = 0; } - JournalParser jp = new JournalParser(portalSettings, ModuleId, ProfileId, SocialGroupId, userInfo){JournalId = JournalId}; - output.Write(jp.GetList(CurrentIndex, PageSize)); + JournalParser jp = new JournalParser(this.portalSettings, this.ModuleId, this.ProfileId, this.SocialGroupId, this.userInfo){JournalId = this.JournalId}; + output.Write(jp.GetList(this.CurrentIndex, this.PageSize)); } } diff --git a/DNN Platform/Modules/Journal/JournalModuleBase.cs b/DNN Platform/Modules/Journal/JournalModuleBase.cs index 91bc6eacf38..092b6e18247 100644 --- a/DNN Platform/Modules/Journal/JournalModuleBase.cs +++ b/DNN Platform/Modules/Journal/JournalModuleBase.cs @@ -26,13 +26,13 @@ public enum JournalMode { } public JournalMode FilterMode { get { - if (!Settings.ContainsKey(Constants.JournalFilterMode)) { + if (!this.Settings.ContainsKey(Constants.JournalFilterMode)) { return JournalMode.Auto; } else { - if (String.IsNullOrEmpty(Settings[Constants.JournalFilterMode].ToString())) { + if (String.IsNullOrEmpty(this.Settings[Constants.JournalFilterMode].ToString())) { return JournalMode.Auto; } else { - return (JournalMode)Convert.ToInt16(Settings[Constants.JournalFilterMode].ToString()); + return (JournalMode)Convert.ToInt16(this.Settings[Constants.JournalFilterMode].ToString()); } } @@ -41,8 +41,8 @@ public JournalMode FilterMode { public int GroupId { get { int groupId = -1; - if (!String.IsNullOrEmpty(Request.QueryString["groupid"])) { - if (Int32.TryParse(Request.QueryString["groupid"], out groupId)) { + if (!String.IsNullOrEmpty(this.Request.QueryString["groupid"])) { + if (Int32.TryParse(this.Request.QueryString["groupid"], out groupId)) { return groupId; } else { return -1; @@ -56,17 +56,17 @@ public bool EditorEnabled { get { - if (!Settings.ContainsKey(Constants.JournalEditorEnabled)) + if (!this.Settings.ContainsKey(Constants.JournalEditorEnabled)) { return true; } else { - if (String.IsNullOrEmpty(Settings[Constants.JournalEditorEnabled].ToString())) + if (String.IsNullOrEmpty(this.Settings[Constants.JournalEditorEnabled].ToString())) { return true; } else { - return (bool)Convert.ToBoolean(Settings[Constants.JournalEditorEnabled].ToString()); + return (bool)Convert.ToBoolean(this.Settings[Constants.JournalEditorEnabled].ToString()); } } } diff --git a/DNN Platform/Modules/Journal/MyFiles.ascx.cs b/DNN Platform/Modules/Journal/MyFiles.ascx.cs index b78b62e6c27..de02a542627 100644 --- a/DNN Platform/Modules/Journal/MyFiles.ascx.cs +++ b/DNN Platform/Modules/Journal/MyFiles.ascx.cs @@ -13,40 +13,40 @@ namespace DotNetNuke.Modules.Journal { public partial class MyFiles : PortalModuleBase { override protected void OnInit(EventArgs e) { - InitializeComponent(); + this.InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); - btnUp.Click += new System.EventHandler(this.btnUp_Upload); + this.btnUp.Click += new System.EventHandler(this.btnUp_Upload); } protected void Page_Load(object sender, EventArgs e) { } protected void btnUp_Upload(object sender, EventArgs e) { var folderManager = FolderManager.Instance; - var userFolder = folderManager.GetUserFolder(UserInfo); + var userFolder = folderManager.GetUserFolder(this.UserInfo); string message = string.Empty; IFileInfo fi = null; try { - fi = FileManager.Instance.AddFile(userFolder, fileUp.PostedFile.FileName, fileUp.PostedFile.InputStream, true); + fi = FileManager.Instance.AddFile(userFolder, this.fileUp.PostedFile.FileName, this.fileUp.PostedFile.InputStream, true); } catch (PermissionsNotMetException) { message = string.Format(Localization.GetString("InsufficientFolderPermission"), userFolder.FolderPath); } catch (NoSpaceAvailableException) { - message = string.Format(Localization.GetString("DiskSpaceExceeded"), fileUp.PostedFile.FileName); + message = string.Format(Localization.GetString("DiskSpaceExceeded"), this.fileUp.PostedFile.FileName); } catch (InvalidFileExtensionException) { - message = string.Format(Localization.GetString("RestrictedFileType"), fileUp.PostedFile.FileName, Host.AllowedExtensionWhitelist.ToDisplayString()); + message = string.Format(Localization.GetString("RestrictedFileType"), this.fileUp.PostedFile.FileName, Host.AllowedExtensionWhitelist.ToDisplayString()); } catch { - message = string.Format(Localization.GetString("SaveFileError"), fileUp.PostedFile.FileName); + message = string.Format(Localization.GetString("SaveFileError"), this.fileUp.PostedFile.FileName); } if (String.IsNullOrEmpty(message) && fi != null) { - litOut.Text = ""; + this.litOut.Text = ""; } else { - litOut.Text = message; + this.litOut.Text = message; } } } diff --git a/DNN Platform/Modules/Journal/NotificationServicesController.cs b/DNN Platform/Modules/Journal/NotificationServicesController.cs index 0312e83e92f..7f5ffef3a9b 100644 --- a/DNN Platform/Modules/Journal/NotificationServicesController.cs +++ b/DNN Platform/Modules/Journal/NotificationServicesController.cs @@ -40,18 +40,18 @@ public HttpResponseMessage ViewJournal(NotificationDTO postData) if(notification != null && notification.Context != null && notification.Context.Contains("_")) { //Dismiss the notification - NotificationsController.Instance.DeleteNotificationRecipient(postData.NotificationId, UserInfo.UserID); + NotificationsController.Instance.DeleteNotificationRecipient(postData.NotificationId, this.UserInfo.UserID); var context = notification.Context.Split('_'); var userId = Convert.ToInt32(context[0]); var journalId = Convert.ToInt32(context[1]); - var ji = JournalController.Instance.GetJournalItem(PortalSettings.PortalId, userId, journalId); + var ji = JournalController.Instance.GetJournalItem(this.PortalSettings.PortalId, userId, journalId); if (ji.ProfileId != Null.NullInteger) { - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Link = Globals.UserProfileURL(ji.ProfileId) }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Link = Globals.UserProfileURL(ji.ProfileId) }); } - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Link = Globals.UserProfileURL(userId) }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success", Link = Globals.UserProfileURL(userId) }); } } catch (Exception exc) @@ -59,7 +59,7 @@ public HttpResponseMessage ViewJournal(NotificationDTO postData) Logger.Error(exc); } - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "unable to process notification"); } } diff --git a/DNN Platform/Modules/Journal/ServicesController.cs b/DNN Platform/Modules/Journal/ServicesController.cs index 1faef058aa6..7b78f85e8e1 100644 --- a/DNN Platform/Modules/Journal/ServicesController.cs +++ b/DNN Platform/Modules/Journal/ServicesController.cs @@ -89,7 +89,7 @@ public HttpResponseMessage Create(CreateDTO postData) { try { - int userId = UserInfo.UserID; + int userId = this.UserInfo.UserID; IDictionary mentionedUsers = new Dictionary(); if (postData.ProfileId == -1) @@ -97,23 +97,23 @@ public HttpResponseMessage Create(CreateDTO postData) postData.ProfileId = userId; } - checkProfileAccess(postData.ProfileId, UserInfo); + this.checkProfileAccess(postData.ProfileId, this.UserInfo); - checkGroupAccess(postData); + this.checkGroupAccess(postData); - var journalItem = prepareJournalItem(postData, mentionedUsers); + var journalItem = this.prepareJournalItem(postData, mentionedUsers); - JournalController.Instance.SaveJournalItem(journalItem, ActiveModule); + JournalController.Instance.SaveJournalItem(journalItem, this.ActiveModule); var originalSummary = journalItem.Summary; - SendMentionNotifications(mentionedUsers, journalItem, originalSummary); + this.SendMentionNotifications(mentionedUsers, journalItem, originalSummary); - return Request.CreateResponse(HttpStatusCode.OK, journalItem); + return this.Request.CreateResponse(HttpStatusCode.OK, journalItem); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -122,8 +122,8 @@ private void checkProfileAccess(int profileId, UserInfo currentUser) { if (profileId != currentUser.UserID) { - var profileUser = UserController.Instance.GetUser(PortalSettings.PortalId, profileId); - if (profileUser == null || (!UserInfo.IsInRole(PortalSettings.AdministratorRoleName) && !Utilities.AreFriends(profileUser, currentUser))) + var profileUser = UserController.Instance.GetUser(this.PortalSettings.PortalId, profileId); + if (profileUser == null || (!this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName) && !Utilities.AreFriends(profileUser, currentUser))) { throw new ArgumentException("you have no permission to post journal on current profile page."); } @@ -136,10 +136,10 @@ private void checkGroupAccess(CreateDTO postData) { postData.ProfileId = -1; - RoleInfo roleInfo = RoleController.Instance.GetRoleById(ActiveModule.OwnerPortalID, postData.GroupId); + RoleInfo roleInfo = RoleController.Instance.GetRoleById(this.ActiveModule.OwnerPortalID, postData.GroupId); if (roleInfo != null) { - if (!UserInfo.IsInRole(PortalSettings.AdministratorRoleName) && !UserInfo.IsInRole(roleInfo.RoleName)) + if (!this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName) && !this.UserInfo.IsInRole(roleInfo.RoleName)) { throw new ArgumentException("you have no permission to post journal on current group."); } @@ -172,8 +172,8 @@ private JournalItem prepareJournalItem(CreateDTO postData, IDictionary 2000) { @@ -224,7 +224,7 @@ private JournalItem prepareJournalItem(CreateDTO postData, IDictionary mentionedUsers = new Dictionary(); var originalComment = comment; - comment = ParseMentions(comment, postData.Mentions, ref mentionedUsers); + comment = this.ParseMentions(comment, postData.Mentions, ref mentionedUsers); var ci = new CommentInfo { JournalId = postData.JournalId, Comment = comment }; - ci.UserId = UserInfo.UserID; - ci.DisplayName = UserInfo.DisplayName; + ci.UserId = this.UserInfo.UserID; + ci.DisplayName = this.UserInfo.DisplayName; JournalController.Instance.SaveComment(ci); - var ji = JournalController.Instance.GetJournalItem(ActiveModule.OwnerPortalID, UserInfo.UserID, postData.JournalId); - var jp = new JournalParser(PortalSettings, ActiveModule.ModuleID, ji.ProfileId, -1, UserInfo); + var ji = JournalController.Instance.GetJournalItem(this.ActiveModule.OwnerPortalID, this.UserInfo.UserID, postData.JournalId); + var jp = new JournalParser(this.PortalSettings, this.ActiveModule.ModuleID, ji.ProfileId, -1, this.UserInfo); - SendMentionNotifications(mentionedUsers, ji, originalComment, "Comment"); + this.SendMentionNotifications(mentionedUsers, ji, originalComment, "Comment"); - return Request.CreateResponse(HttpStatusCode.OK, jp.GetCommentRow(ji, ci), "text/html"); + return this.Request.CreateResponse(HttpStatusCode.OK, jp.GetCommentRow(ji, ci), "text/html"); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -433,28 +433,28 @@ public HttpResponseMessage CommentDelete(CommentDeleteDTO postData) var ci = JournalController.Instance.GetComment(postData.CommentId); if (ci == null) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "delete failed"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "delete failed"); } - var ji = JournalController.Instance.GetJournalItem(ActiveModule.OwnerPortalID, UserInfo.UserID, postData.JournalId); + var ji = JournalController.Instance.GetJournalItem(this.ActiveModule.OwnerPortalID, this.UserInfo.UserID, postData.JournalId); if (ji == null) { - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "invalid request"); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "invalid request"); } - if (ci.UserId == UserInfo.UserID || ji.UserId == UserInfo.UserID || UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) + if (ci.UserId == this.UserInfo.UserID || ji.UserId == this.UserInfo.UserID || this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) { JournalController.Instance.DeleteComment(postData.JournalId, postData.CommentId); - return Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); + return this.Request.CreateResponse(HttpStatusCode.OK, new { Result = "success" }); } - return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "access denied"); + return this.Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "access denied"); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -473,14 +473,14 @@ public HttpResponseMessage GetSuggestions(string keyword) try { var findedUsers = new List(); - var relations = RelationshipController.Instance.GetUserRelationships(UserInfo); + var relations = RelationshipController.Instance.GetUserRelationships(this.UserInfo); foreach (var ur in relations) { - var targetUserId = ur.UserId == UserInfo.UserID ? ur.RelatedUserId : ur.UserId; - var targetUser = UserController.GetUserById(PortalSettings.PortalId, targetUserId); + var targetUserId = ur.UserId == this.UserInfo.UserID ? ur.RelatedUserId : ur.UserId; + var targetUser = UserController.GetUserById(this.PortalSettings.PortalId, targetUserId); var relationship = RelationshipController.Instance.GetRelationship(ur.RelationshipId); if (ur.Status == RelationshipStatus.Accepted && targetUser != null - && ((relationship.RelationshipTypeId == (int)DefaultRelationshipTypes.Followers && ur.RelatedUserId == UserInfo.UserID) + && ((relationship.RelationshipTypeId == (int)DefaultRelationshipTypes.Followers && ur.RelatedUserId == this.UserInfo.UserID) || relationship.RelationshipTypeId == (int)DefaultRelationshipTypes.Friends ) && (targetUser.DisplayName.ToLowerInvariant().Contains(keyword.ToLowerInvariant()) @@ -499,12 +499,12 @@ public HttpResponseMessage GetSuggestions(string keyword) } } - return Request.CreateResponse(HttpStatusCode.OK, findedUsers.Cast().Take(5)); + return this.Request.CreateResponse(HttpStatusCode.OK, findedUsers.Cast().Take(5)); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -520,12 +520,12 @@ private string ParseMentions(string content, IList mentions, ref IDi foreach (var mention in mentions) { - var user = UserController.GetUserById(PortalSettings.PortalId, mention.UserId); + var user = UserController.GetUserById(this.PortalSettings.PortalId, mention.UserId); if (user != null) { - var relationship = RelationshipController.Instance.GetFollowingRelationship(UserInfo, user) ?? - RelationshipController.Instance.GetFriendRelationship(UserInfo, user); + var relationship = RelationshipController.Instance.GetFollowingRelationship(this.UserInfo, user) ?? + RelationshipController.Instance.GetFriendRelationship(this.UserInfo, user); if (relationship != null && relationship.Status == RelationshipStatus.Accepted) { var userLink = string.Format("{1}", @@ -558,15 +558,15 @@ private void SendMentionNotifications(IDictionary mentionedUse } var notification = new Notification { - Subject = string.Format(subjectTemplate, UserInfo.DisplayName, mentionType), + Subject = string.Format(subjectTemplate, this.UserInfo.DisplayName, mentionType), Body = string.Format(bodyTemplate, mentionText), NotificationTypeID = notificationType.NotificationTypeId, - SenderUserID = UserInfo.UserID, + SenderUserID = this.UserInfo.UserID, IncludeDismissAction = true, - Context = string.Format("{0}_{1}", UserInfo.UserID, item.JournalId) + Context = string.Format("{0}_{1}", this.UserInfo.UserID, item.JournalId) }; - Services.Social.Notifications.NotificationsController.Instance.SendNotification(notification, PortalSettings.PortalId, null, new List { mentionUser }); + Services.Social.Notifications.NotificationsController.Instance.SendNotification(notification, this.PortalSettings.PortalId, null, new List { mentionUser }); } } @@ -577,7 +577,7 @@ private bool IsCurrentUserFile(IFileInfo file) return false; } - var userFolders = GetUserFolders(); + var userFolders = this.GetUserFolders(); return userFolders.Any(f => file.FolderId == f.FolderID); } @@ -586,9 +586,9 @@ private IList GetUserFolders() { var folders = new List(); - var userFolder = FolderManager.Instance.GetUserFolder(UserInfo); + var userFolder = FolderManager.Instance.GetUserFolder(this.UserInfo); folders.Add(userFolder); - folders.AddRange(GetSubFolders(userFolder)); + folders.AddRange(this.GetSubFolders(userFolder)); return folders; } @@ -599,7 +599,7 @@ private IList GetSubFolders(IFolderInfo parentFolder) foreach (var folder in FolderManager.Instance.GetFolders(parentFolder)) { folders.Add(folder); - folders.AddRange(GetSubFolders(folder)); + folders.AddRange(this.GetSubFolders(folder)); } return folders; diff --git a/DNN Platform/Modules/Journal/Settings.ascx.cs b/DNN Platform/Modules/Journal/Settings.ascx.cs index 8a51f83f47c..3103c3bba51 100644 --- a/DNN Platform/Modules/Journal/Settings.ascx.cs +++ b/DNN Platform/Modules/Journal/Settings.ascx.cs @@ -43,70 +43,70 @@ public partial class Settings : JournalSettingsBase { /// ----------------------------------------------------------------------------- public override void LoadSettings() { try { - if (Page.IsPostBack == false) { - BindJournalTypes(); + if (this.Page.IsPostBack == false) { + this.BindJournalTypes(); //Check for existing settings and use those on this page - if (Settings.ContainsKey(Constants.DefaultPageSize)) { - drpDefaultPageSize.SelectedIndex = drpDefaultPageSize.Items.IndexOf(drpDefaultPageSize.Items.FindByValue(Settings[Constants.DefaultPageSize].ToString())); + if (this.Settings.ContainsKey(Constants.DefaultPageSize)) { + this.drpDefaultPageSize.SelectedIndex = this.drpDefaultPageSize.Items.IndexOf(this.drpDefaultPageSize.Items.FindByValue(this.Settings[Constants.DefaultPageSize].ToString())); } else { - drpDefaultPageSize.SelectedIndex = drpDefaultPageSize.Items.IndexOf(drpDefaultPageSize.Items.FindByValue("20")); + this.drpDefaultPageSize.SelectedIndex = this.drpDefaultPageSize.Items.IndexOf(this.drpDefaultPageSize.Items.FindByValue("20")); } - if (Settings.ContainsKey(Constants.MaxCharacters)) { - drpMaxMessageLength.SelectedIndex = drpMaxMessageLength.Items.IndexOf(drpMaxMessageLength.Items.FindByValue(Settings[Constants.MaxCharacters].ToString())); + if (this.Settings.ContainsKey(Constants.MaxCharacters)) { + this.drpMaxMessageLength.SelectedIndex = this.drpMaxMessageLength.Items.IndexOf(this.drpMaxMessageLength.Items.FindByValue(this.Settings[Constants.MaxCharacters].ToString())); } else { - drpMaxMessageLength.SelectedIndex = drpMaxMessageLength.Items.IndexOf(drpMaxMessageLength.Items.FindByValue("250")); + this.drpMaxMessageLength.SelectedIndex = this.drpMaxMessageLength.Items.IndexOf(this.drpMaxMessageLength.Items.FindByValue("250")); } - if (Settings.ContainsKey(Constants.AllowFiles)) { - chkAllowFiles.Checked = Convert.ToBoolean(Settings[Constants.AllowFiles].ToString()); + if (this.Settings.ContainsKey(Constants.AllowFiles)) { + this.chkAllowFiles.Checked = Convert.ToBoolean(this.Settings[Constants.AllowFiles].ToString()); } else { - chkAllowFiles.Checked = true; + this.chkAllowFiles.Checked = true; } - if (Settings.ContainsKey(Constants.AllowPhotos)) { - chkAllowPhotos.Checked = Convert.ToBoolean(Settings[Constants.AllowPhotos].ToString()); + if (this.Settings.ContainsKey(Constants.AllowPhotos)) { + this.chkAllowPhotos.Checked = Convert.ToBoolean(this.Settings[Constants.AllowPhotos].ToString()); } else { - chkAllowPhotos.Checked = true; + this.chkAllowPhotos.Checked = true; } - if (Settings.ContainsKey(Constants.AllowResizePhotos)) + if (this.Settings.ContainsKey(Constants.AllowResizePhotos)) { - chkAllowResize.Checked = Convert.ToBoolean(Settings[Constants.AllowResizePhotos].ToString()); + this.chkAllowResize.Checked = Convert.ToBoolean(this.Settings[Constants.AllowResizePhotos].ToString()); } else { - chkAllowResize.Checked = false; + this.chkAllowResize.Checked = false; } - if (Settings.ContainsKey(Constants.JournalEditorEnabled)) + if (this.Settings.ContainsKey(Constants.JournalEditorEnabled)) { - chkEnableEditor.Checked = Convert.ToBoolean(Settings[Constants.JournalEditorEnabled].ToString()); + this.chkEnableEditor.Checked = Convert.ToBoolean(this.Settings[Constants.JournalEditorEnabled].ToString()); } else { - chkEnableEditor.Checked = true; + this.chkEnableEditor.Checked = true; } - if (!chkEnableEditor.Checked) + if (!this.chkEnableEditor.Checked) { - chkAllowFiles.Enabled = false; - chkAllowPhotos.Enabled = false; + this.chkAllowFiles.Enabled = false; + this.chkAllowPhotos.Enabled = false; } - chkAllowResize.Enabled = chkEnableEditor.Checked && chkAllowPhotos.Checked; + this.chkAllowResize.Enabled = this.chkEnableEditor.Checked && this.chkAllowPhotos.Checked; - foreach (ListItem li in chkJournalFilters.Items) { + foreach (ListItem li in this.chkJournalFilters.Items) { li.Selected = true; } - if (Settings.ContainsKey(Constants.JournalFilters)) { - if (String.IsNullOrEmpty(Settings[Constants.JournalFilters].ToString())) { - foreach (ListItem li in chkJournalFilters.Items) { + if (this.Settings.ContainsKey(Constants.JournalFilters)) { + if (String.IsNullOrEmpty(this.Settings[Constants.JournalFilters].ToString())) { + foreach (ListItem li in this.chkJournalFilters.Items) { li.Selected = true; } } else { - foreach (ListItem li in chkJournalFilters.Items) { + foreach (ListItem li in this.chkJournalFilters.Items) { li.Selected = false; } - foreach (string s in Settings[Constants.JournalFilters].ToString().Split(';')) { - foreach (ListItem li in chkJournalFilters.Items) { + foreach (string s in this.Settings[Constants.JournalFilters].ToString().Split(';')) { + foreach (ListItem li in this.chkJournalFilters.Items) { if (li.Value == s) { li.Selected = true; } @@ -129,26 +129,26 @@ public override void LoadSettings() { /// ----------------------------------------------------------------------------- public override void UpdateSettings() { try { - ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.DefaultPageSize, drpDefaultPageSize.SelectedItem.Value); - ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.AllowFiles, chkAllowFiles.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.AllowPhotos, chkAllowPhotos.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.AllowResizePhotos, chkAllowResize.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.JournalEditorEnabled, chkEnableEditor.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.MaxCharacters, drpMaxMessageLength.SelectedItem.Value); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.DefaultPageSize, this.drpDefaultPageSize.SelectedItem.Value); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.AllowFiles, this.chkAllowFiles.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.AllowPhotos, this.chkAllowPhotos.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.AllowResizePhotos, this.chkAllowResize.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.JournalEditorEnabled, this.chkEnableEditor.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, Constants.MaxCharacters, this.drpMaxMessageLength.SelectedItem.Value); string journalTypes = ""; bool allTypes = true; - foreach (ListItem li in chkJournalFilters.Items) { + foreach (ListItem li in this.chkJournalFilters.Items) { if (!li.Selected) { allTypes = false; } } var jc = InternalJournalController.Instance; - jc.DeleteFilters(PortalId, ModuleId); + jc.DeleteFilters(this.PortalId, this.ModuleId); - foreach (ListItem li in chkJournalFilters.Items) { + foreach (ListItem li in this.chkJournalFilters.Items) { if (li.Selected) { if (!allTypes) { - jc.SaveFilters(PortalId, ModuleId, Convert.ToInt32(li.Value)); + jc.SaveFilters(this.PortalId, this.ModuleId, Convert.ToInt32(li.Value)); journalTypes += li.Value + ";"; } @@ -165,9 +165,9 @@ public override void UpdateSettings() { #endregion #region Private Methods private void BindJournalTypes() { - foreach (JournalTypeInfo journalTypeInfo in JournalController.Instance.GetJournalTypes(PortalId)) + foreach (JournalTypeInfo journalTypeInfo in JournalController.Instance.GetJournalTypes(this.PortalId)) { - chkJournalFilters.Items.Add(new ListItem(Localization.GetString(journalTypeInfo.JournalType, "~/desktopmodules/journal/app_localresources/sharedresources.resx"), journalTypeInfo.JournalTypeId.ToString())); + this.chkJournalFilters.Items.Add(new ListItem(Localization.GetString(journalTypeInfo.JournalType, "~/desktopmodules/journal/app_localresources/sharedresources.resx"), journalTypeInfo.JournalTypeId.ToString())); } } #endregion diff --git a/DNN Platform/Modules/Journal/UserFolderHelper.cs b/DNN Platform/Modules/Journal/UserFolderHelper.cs index 083393e96a2..cc3af3dc419 100644 --- a/DNN Platform/Modules/Journal/UserFolderHelper.cs +++ b/DNN Platform/Modules/Journal/UserFolderHelper.cs @@ -13,7 +13,7 @@ public class UserFolderHelper { public UserFolderHelper(PortalSettings portalSettings) { - UserFolder = FolderManager.Instance.GetUserFolder(portalSettings.UserInfo); + this.UserFolder = FolderManager.Instance.GetUserFolder(portalSettings.UserInfo); } public IFolderInfo UserFolder { get; set; } @@ -22,7 +22,7 @@ public string UserFolderPhysicalPath { get { - return UserFolder.PhysicalPath; + return this.UserFolder.PhysicalPath; } } @@ -30,7 +30,7 @@ public string UserFolderPath { get { - return UserFolder.FolderPath; + return this.UserFolder.FolderPath; } } } diff --git a/DNN Platform/Modules/Journal/View.ascx.cs b/DNN Platform/Modules/Journal/View.ascx.cs index 1b994b2e047..972e39284f2 100644 --- a/DNN Platform/Modules/Journal/View.ascx.cs +++ b/DNN Platform/Modules/Journal/View.ascx.cs @@ -56,7 +56,7 @@ public partial class View : JournalModuleBase { public View() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Event Handlers @@ -68,116 +68,116 @@ override protected void OnInit(EventArgs e) ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); JavaScript.RequestRegistration(CommonJs.Knockout); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/journal.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/journalcomments.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Journal/Scripts/mentionsInput.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/Scripts/json2.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Journal/Scripts/journal.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Journal/Scripts/journalcomments.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Journal/Scripts/mentionsInput.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Scripts/json2.js"); - var isAdmin = UserInfo.IsInRole(RoleController.Instance.GetRoleById(PortalId, PortalSettings.AdministratorRoleId).RoleName); - if (!Request.IsAuthenticated || (!UserInfo.IsSuperUser && !isAdmin && UserInfo.IsInRole("Unverified Users"))) + var isAdmin = this.UserInfo.IsInRole(RoleController.Instance.GetRoleById(this.PortalId, this.PortalSettings.AdministratorRoleId).RoleName); + if (!this.Request.IsAuthenticated || (!this.UserInfo.IsSuperUser && !isAdmin && this.UserInfo.IsInRole("Unverified Users"))) { - ShowEditor = false; + this.ShowEditor = false; } else { - ShowEditor = EditorEnabled; + this.ShowEditor = this.EditorEnabled; } - if (Settings.ContainsKey(Constants.DefaultPageSize)) + if (this.Settings.ContainsKey(Constants.DefaultPageSize)) { - PageSize = Convert.ToInt16(Settings[Constants.DefaultPageSize]); + this.PageSize = Convert.ToInt16(this.Settings[Constants.DefaultPageSize]); } - if (Settings.ContainsKey(Constants.MaxCharacters)) + if (this.Settings.ContainsKey(Constants.MaxCharacters)) { - MaxMessageLength = Convert.ToInt16(Settings[Constants.MaxCharacters]); + this.MaxMessageLength = Convert.ToInt16(this.Settings[Constants.MaxCharacters]); } - if (Settings.ContainsKey(Constants.AllowPhotos)) + if (this.Settings.ContainsKey(Constants.AllowPhotos)) { - AllowPhotos = Convert.ToBoolean(Settings[Constants.AllowPhotos]); + this.AllowPhotos = Convert.ToBoolean(this.Settings[Constants.AllowPhotos]); } - if (Settings.ContainsKey(Constants.AllowFiles)) + if (this.Settings.ContainsKey(Constants.AllowFiles)) { - AllowFiles = Convert.ToBoolean(Settings[Constants.AllowFiles]); + this.AllowFiles = Convert.ToBoolean(this.Settings[Constants.AllowFiles]); } - ctlJournalList.Enabled = true; - ctlJournalList.ProfileId = -1; - ctlJournalList.PageSize = PageSize; - ctlJournalList.ModuleId = ModuleId; + this.ctlJournalList.Enabled = true; + this.ctlJournalList.ProfileId = -1; + this.ctlJournalList.PageSize = this.PageSize; + this.ctlJournalList.ModuleId = this.ModuleId; - ModuleInfo moduleInfo = ModuleContext.Configuration; + ModuleInfo moduleInfo = this.ModuleContext.Configuration; - foreach (var module in ModuleController.Instance.GetTabModules(TabId).Values) + foreach (var module in ModuleController.Instance.GetTabModules(this.TabId).Values) { if (module.ModuleDefinition.FriendlyName == "Social Groups") { - if (GroupId == -1 && FilterMode == JournalMode.Auto) + if (this.GroupId == -1 && this.FilterMode == JournalMode.Auto) { - ShowEditor = false; - ctlJournalList.Enabled = false; + this.ShowEditor = false; + this.ctlJournalList.Enabled = false; } - if (GroupId > 0) + if (this.GroupId > 0) { - RoleInfo roleInfo = RoleController.Instance.GetRoleById(moduleInfo.OwnerPortalID, GroupId); + RoleInfo roleInfo = RoleController.Instance.GetRoleById(moduleInfo.OwnerPortalID, this.GroupId); if (roleInfo != null) { - if (UserInfo.IsInRole(roleInfo.RoleName)) + if (this.UserInfo.IsInRole(roleInfo.RoleName)) { - ShowEditor = true; - CanComment = true; - IsGroup = true; + this.ShowEditor = true; + this.CanComment = true; + this.IsGroup = true; } else { - ShowEditor = false; - CanComment = false; + this.ShowEditor = false; + this.CanComment = false; } - if (!roleInfo.IsPublic && !ShowEditor) + if (!roleInfo.IsPublic && !this.ShowEditor) { - ctlJournalList.Enabled = false; + this.ctlJournalList.Enabled = false; } - if (roleInfo.IsPublic && !ShowEditor) + if (roleInfo.IsPublic && !this.ShowEditor) { - ctlJournalList.Enabled = true; + this.ctlJournalList.Enabled = true; } - if (roleInfo.IsPublic && ShowEditor) + if (roleInfo.IsPublic && this.ShowEditor) { - ctlJournalList.Enabled = true; + this.ctlJournalList.Enabled = true; } if (roleInfo.IsPublic) { - IsPublicGroup = true; + this.IsPublicGroup = true; } } else { - ShowEditor = false; - ctlJournalList.Enabled = false; + this.ShowEditor = false; + this.ctlJournalList.Enabled = false; } } } } - if (!String.IsNullOrEmpty(Request.QueryString["userId"])) + if (!String.IsNullOrEmpty(this.Request.QueryString["userId"])) { - ctlJournalList.ProfileId = Convert.ToInt32(Request.QueryString["userId"]); - if (!UserInfo.IsSuperUser && !isAdmin && ctlJournalList.ProfileId != UserId) + this.ctlJournalList.ProfileId = Convert.ToInt32(this.Request.QueryString["userId"]); + if (!this.UserInfo.IsSuperUser && !isAdmin && this.ctlJournalList.ProfileId != this.UserId) { - ShowEditor = ShowEditor && Utilities.AreFriends(UserController.GetUserById(PortalId, ctlJournalList.ProfileId), UserInfo); + this.ShowEditor = this.ShowEditor && Utilities.AreFriends(UserController.GetUserById(this.PortalId, this.ctlJournalList.ProfileId), this.UserInfo); } } - else if (GroupId > 0) + else if (this.GroupId > 0) { - ctlJournalList.SocialGroupId = Convert.ToInt32(Request.QueryString["groupId"]); + this.ctlJournalList.SocialGroupId = Convert.ToInt32(this.Request.QueryString["groupId"]); } - InitializeComponent(); + this.InitializeComponent(); base.OnInit(e); } private void InitializeComponent() { - Load += Page_Load; + this.Load += this.Page_Load; } /// ----------------------------------------------------------------------------- @@ -188,23 +188,23 @@ private void InitializeComponent() { private void Page_Load(object sender, EventArgs e) { try { - BaseUrl = Globals.ApplicationPath; - BaseUrl = BaseUrl.EndsWith("/") ? BaseUrl : BaseUrl + "/"; - BaseUrl += "DesktopModules/Journal/"; + this.BaseUrl = Globals.ApplicationPath; + this.BaseUrl = this.BaseUrl.EndsWith("/") ? this.BaseUrl : this.BaseUrl + "/"; + this.BaseUrl += "DesktopModules/Journal/"; - ProfilePage = _navigationManager.NavigateURL(PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); + this.ProfilePage = this._navigationManager.NavigateURL(this.PortalSettings.UserTabId, string.Empty, new[] {"userId=xxx"}); - if (!String.IsNullOrEmpty(Request.QueryString["userId"])) + if (!String.IsNullOrEmpty(this.Request.QueryString["userId"])) { - Pid = Convert.ToInt32(Request.QueryString["userId"]); - ctlJournalList.ProfileId = Pid; + this.Pid = Convert.ToInt32(this.Request.QueryString["userId"]); + this.ctlJournalList.ProfileId = this.Pid; } - else if (GroupId > 0) + else if (this.GroupId > 0) { - Gid = GroupId; - ctlJournalList.SocialGroupId = GroupId; + this.Gid = this.GroupId; + this.ctlJournalList.SocialGroupId = this.GroupId; } - ctlJournalList.PageSize = PageSize; + this.ctlJournalList.PageSize = this.PageSize; } catch (Exception exc) //Module failed to load { diff --git a/DNN Platform/Modules/Journal/packages.config b/DNN Platform/Modules/Journal/packages.config index 4073d3c4617..78db8377d2d 100644 --- a/DNN Platform/Modules/Journal/packages.config +++ b/DNN Platform/Modules/Journal/packages.config @@ -1,10 +1,11 @@ - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/MemberDirectory/Components/UpgradeController.cs b/DNN Platform/Modules/MemberDirectory/Components/UpgradeController.cs index 1e43f565765..e70f1ac4f3d 100644 --- a/DNN Platform/Modules/MemberDirectory/Components/UpgradeController.cs +++ b/DNN Platform/Modules/MemberDirectory/Components/UpgradeController.cs @@ -30,7 +30,7 @@ public string UpgradeModule(string Version) switch (Version) { case "07.00.06": - UpdateDisplaySearchSettings(); + this.UpdateDisplaySearchSettings(); break; } } diff --git a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj index 3af02580ee1..6f69ebaf27a 100644 --- a/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj +++ b/DNN Platform/Modules/MemberDirectory/DotNetNuke.Modules.MemberDirectory.csproj @@ -27,6 +27,7 @@ ..\..\..\..\Evoq.Content\ true + true @@ -125,6 +126,9 @@ + + stylecop.json + Designer @@ -181,6 +185,10 @@ False + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Modules/MemberDirectory/Presenters/ModuleSettingsPresenter.cs b/DNN Platform/Modules/MemberDirectory/Presenters/ModuleSettingsPresenter.cs index fc8ce1d5404..62d26cd0e91 100644 --- a/DNN Platform/Modules/MemberDirectory/Presenters/ModuleSettingsPresenter.cs +++ b/DNN Platform/Modules/MemberDirectory/Presenters/ModuleSettingsPresenter.cs @@ -31,11 +31,11 @@ protected override void OnLoad() { base.OnLoad(); - View.Model.Groups = RoleController.Instance.GetRoles(PortalId, r => r.Status == RoleStatus.Approved); - View.Model.Relationships = RelationshipController.Instance.GetRelationshipsByPortalId(PortalId); + this.View.Model.Groups = RoleController.Instance.GetRoles(this.PortalId, r => r.Status == RoleStatus.Approved); + this.View.Model.Relationships = RelationshipController.Instance.GetRelationshipsByPortalId(this.PortalId); - View.Model.ProfileProperties = new List(); - foreach (ProfilePropertyDefinition definition in ProfileController.GetPropertyDefinitionsByPortal(PortalId)) + this.View.Model.ProfileProperties = new List(); + foreach (ProfilePropertyDefinition definition in ProfileController.GetPropertyDefinitionsByPortal(this.PortalId)) { var controller = new ListController(); ListEntryInfo textType = controller.GetListEntryInfo("DataType", "Text"); @@ -43,7 +43,7 @@ protected override void OnLoad() ListEntryInfo countryType = controller.GetListEntryInfo("DataType", "Country"); if (definition.DataType == textType.EntryID || definition.DataType == regionType.EntryID || definition.DataType == countryType.EntryID) { - View.Model.ProfileProperties.Add(definition); + this.View.Model.ProfileProperties.Add(definition); } } } diff --git a/DNN Platform/Modules/MemberDirectory/Services/Member.cs b/DNN Platform/Modules/MemberDirectory/Services/Member.cs index 95826559db4..a6af8c90884 100644 --- a/DNN Platform/Modules/MemberDirectory/Services/Member.cs +++ b/DNN Platform/Modules/MemberDirectory/Services/Member.cs @@ -24,74 +24,74 @@ public class Member public Member(UserInfo user, PortalSettings settings) { - _user = user; - _settings = settings; - _viewer = settings.UserInfo; + this._user = user; + this._settings = settings; + this._viewer = settings.UserInfo; } public int MemberId { - get { return _user.UserID; } + get { return this._user.UserID; } } public string City { - get { return GetProfileProperty("City"); } + get { return this.GetProfileProperty("City"); } } public string Country { - get { return GetProfileProperty("Country"); } + get { return this.GetProfileProperty("Country"); } } public string DisplayName { - get { return _user.DisplayName; } + get { return this._user.DisplayName; } } public string Email { - get { return (_viewer.IsInRole(_settings.AdministratorRoleName)) ? _user.Email : String.Empty; } + get { return (this._viewer.IsInRole(this._settings.AdministratorRoleName)) ? this._user.Email : String.Empty; } } public string FirstName { - get { return GetProfileProperty("FirstName"); } + get { return this.GetProfileProperty("FirstName"); } } public int FollowerStatus { - get { return (_user.Social.Follower == null) ? 0 : (int)_user.Social.Follower.Status; } + get { return (this._user.Social.Follower == null) ? 0 : (int)this._user.Social.Follower.Status; } } public int FollowingStatus { - get { return (_user.Social.Following == null) ? 0 : (int)_user.Social.Following.Status; } + get { return (this._user.Social.Following == null) ? 0 : (int)this._user.Social.Following.Status; } } public int FriendId { - get { return (_user.Social.Friend == null) ? -1 : (int)_user.Social.Friend.RelatedUserId; } + get { return (this._user.Social.Friend == null) ? -1 : (int)this._user.Social.Friend.RelatedUserId; } } public int FriendStatus { - get { return (_user.Social.Friend == null) ? 0 : (int)_user.Social.Friend.Status; } + get { return (this._user.Social.Friend == null) ? 0 : (int)this._user.Social.Friend.Status; } } public string LastName { - get { return GetProfileProperty("LastName"); } + get { return this.GetProfileProperty("LastName"); } } public string Phone { - get { return GetProfileProperty("Telephone"); } + get { return this.GetProfileProperty("Telephone"); } } public string PhotoURL { - get { return _user.Profile.PhotoURL; } + get { return this._user.Profile.PhotoURL; } } public Dictionary ProfileProperties @@ -100,13 +100,13 @@ public Dictionary ProfileProperties { var properties = new Dictionary(); bool propertyNotFound = false; - var propertyAccess = new ProfilePropertyAccess(_user); - foreach(ProfilePropertyDefinition property in _user.Profile.ProfileProperties) + var propertyAccess = new ProfilePropertyAccess(this._user); + foreach(ProfilePropertyDefinition property in this._user.Profile.ProfileProperties) { string value = propertyAccess.GetProperty(property.PropertyName, String.Empty, Thread.CurrentThread.CurrentUICulture, - _viewer, + this._viewer, Scope.DefaultSettings, ref propertyNotFound); @@ -118,22 +118,22 @@ public Dictionary ProfileProperties public string Title { - get { return _user.Profile.Title; } + get { return this._user.Profile.Title; } } public string UserName { - get { return (_viewer.IsInRole(_settings.AdministratorRoleName)) ? _user.Username : String.Empty; } + get { return (this._viewer.IsInRole(this._settings.AdministratorRoleName)) ? this._user.Username : String.Empty; } } public string Website { - get { return GetProfileProperty("Website"); } + get { return this.GetProfileProperty("Website"); } } public string ProfileUrl { - get { return Globals.UserProfileURL(MemberId); } + get { return Globals.UserProfileURL(this.MemberId); } } /// @@ -143,7 +143,7 @@ public string ProfileUrl /// property value private string GetProfileProperty(string propertyName) { - var profileProperties = ProfileProperties; + var profileProperties = this.ProfileProperties; string value; return profileProperties.TryGetValue(propertyName, out value) ? value : string.Empty; diff --git a/DNN Platform/Modules/MemberDirectory/Services/MemberDirectoryController.cs b/DNN Platform/Modules/MemberDirectory/Services/MemberDirectoryController.cs index 4aa8cbef519..8b9b26a50d4 100644 --- a/DNN Platform/Modules/MemberDirectory/Services/MemberDirectoryController.cs +++ b/DNN Platform/Modules/MemberDirectory/Services/MemberDirectoryController.cs @@ -63,20 +63,20 @@ private bool CanViewGroupMembers(int portalId, int groupId) } var canView = (group.SecurityMode == SecurityMode.SecurityRole) - ? (PortalSettings.UserInfo.IsInRole(PortalSettings.AdministratorRoleName)) - : (PortalSettings.UserInfo.IsInRole(group.RoleName)); + ? (this.PortalSettings.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName)) + : (this.PortalSettings.UserInfo.IsInRole(group.RoleName)); //if current user can view the group page and group is public, then should be able to view members. if (!canView) { - canView = ModulePermissionController.CanViewModule(ActiveModule) && group.IsPublic; + canView = ModulePermissionController.CanViewModule(this.ActiveModule) && group.IsPublic; } return canView; } private IList GetMembers(IEnumerable users) { - return users.Select(user => new Member(user, PortalSettings)).ToList(); + return users.Select(user => new Member(user, this.PortalSettings)).ToList(); } private static string GetSetting(IDictionary settings, string key, string defaultValue) @@ -91,18 +91,18 @@ private static string GetSetting(IDictionary settings, string key, string defaul private IEnumerable GetUsers(int userId, int groupId, string searchTerm, int pageIndex, int pageSize, string propertyNames, string propertyValues) { - var portalId = PortalSettings.PortalId; - var isAdmin = PortalSettings.UserInfo.IsInRole(PortalSettings.AdministratorRoleName); + var portalId = this.PortalSettings.PortalId; + var isAdmin = this.PortalSettings.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName); - var filterBy = GetSetting(ActiveModule.ModuleSettings, "FilterBy", String.Empty); - var filterValue = GetSetting(ActiveModule.ModuleSettings, "FilterValue", String.Empty); + var filterBy = GetSetting(this.ActiveModule.ModuleSettings, "FilterBy", String.Empty); + var filterValue = GetSetting(this.ActiveModule.ModuleSettings, "FilterValue", String.Empty); if (filterBy == "Group" && filterValue == "-1" && groupId > 0) { filterValue = groupId.ToString(); } - var sortField = GetSetting(ActiveModule.TabModuleSettings, "SortField", "DisplayName"); + var sortField = GetSetting(this.ActiveModule.TabModuleSettings, "SortField", "DisplayName"); // QuickFix DNN-6096. See: https://dnntracker.atlassian.net/browse/DNN-6096 // Instead of changing the available SortFields, we'll use "UserId" as SortField if the TabModuleSetting SortField was CreatedOnDate. @@ -113,9 +113,9 @@ private IEnumerable GetUsers(int userId, int groupId, string searchTer sortField = "UserId"; } - var sortOrder = GetSetting(ActiveModule.TabModuleSettings, "SortOrder", "ASC"); + var sortOrder = GetSetting(this.ActiveModule.TabModuleSettings, "SortOrder", "ASC"); - var excludeHostUsers = Boolean.Parse(GetSetting(ActiveModule.TabModuleSettings, "ExcludeHostUsers", "false")); + var excludeHostUsers = Boolean.Parse(GetSetting(this.ActiveModule.TabModuleSettings, "ExcludeHostUsers", "false")); var isBasicSearch = false; if (String.IsNullOrEmpty(propertyNames)) { @@ -134,9 +134,9 @@ private IEnumerable GetUsers(int userId, int groupId, string searchTer { groupId = Int32.Parse(filterValue); } - if (CanViewGroupMembers(portalId, groupId)) + if (this.CanViewGroupMembers(portalId, groupId)) { - users = UserController.Instance.GetUsersAdvancedSearch(portalId, PortalSettings.UserId, userId, + users = UserController.Instance.GetUsersAdvancedSearch(portalId, this.PortalSettings.UserId, userId, groupId, -1, isAdmin, pageIndex, pageSize, sortField, (sortOrder == "ASC"), @@ -148,26 +148,26 @@ private IEnumerable GetUsers(int userId, int groupId, string searchTer } break; case "Relationship": - users = UserController.Instance.GetUsersAdvancedSearch(portalId, PortalSettings.UserId, userId, -1, + users = UserController.Instance.GetUsersAdvancedSearch(portalId, this.PortalSettings.UserId, userId, -1, Int32.Parse(filterValue), isAdmin, pageIndex, pageSize, sortField, (sortOrder == "ASC"), propertyNames, propertyValues); break; case "ProfileProperty": - var propertyValue = GetSetting(ActiveModule.ModuleSettings, "FilterPropertyValue", String.Empty); + var propertyValue = GetSetting(this.ActiveModule.ModuleSettings, "FilterPropertyValue", String.Empty); AddSearchTerm(ref propertyNames, ref propertyValues, filterValue, propertyValue); - users = UserController.Instance.GetUsersAdvancedSearch(portalId, PortalSettings.UserId, userId, -1, + users = UserController.Instance.GetUsersAdvancedSearch(portalId, this.PortalSettings.UserId, userId, -1, -1, isAdmin, pageIndex, pageSize, sortField, (sortOrder == "ASC"), propertyNames, propertyValues); break; default: - users = isBasicSearch ? UserController.Instance.GetUsersBasicSearch(PortalSettings.PortalId, pageIndex, pageSize, + users = isBasicSearch ? UserController.Instance.GetUsersBasicSearch(this.PortalSettings.PortalId, pageIndex, pageSize, sortField, (sortOrder == "ASC"), "DisplayName", searchTerm) : - UserController.Instance.GetUsersAdvancedSearch(portalId, PortalSettings.UserId, userId, -1, + UserController.Instance.GetUsersAdvancedSearch(portalId, this.PortalSettings.UserId, userId, -1, -1, isAdmin, pageIndex, pageSize, sortField, (sortOrder == "ASC"), propertyNames, propertyValues); @@ -175,7 +175,7 @@ private IEnumerable GetUsers(int userId, int groupId, string searchTer } if (excludeHostUsers) { - return FilterExcludedUsers(users); + return this.FilterExcludedUsers(users); } return users; } @@ -194,12 +194,12 @@ public HttpResponseMessage AdvancedSearch(int userId, int groupId, int pageIndex { try { - if (userId < 0) userId = PortalSettings.UserId; + if (userId < 0) userId = this.PortalSettings.UserId; - var searchField1 = GetSetting(ActiveModule.TabModuleSettings, "SearchField1", "DisplayName"); - var searchField2 = GetSetting(ActiveModule.TabModuleSettings, "SearchField2", "Email"); - var searchField3 = GetSetting(ActiveModule.TabModuleSettings, "SearchField3", "City"); - var searchField4 = GetSetting(ActiveModule.TabModuleSettings, "SearchField4", "Country"); + var searchField1 = GetSetting(this.ActiveModule.TabModuleSettings, "SearchField1", "DisplayName"); + var searchField2 = GetSetting(this.ActiveModule.TabModuleSettings, "SearchField2", "Email"); + var searchField3 = GetSetting(this.ActiveModule.TabModuleSettings, "SearchField3", "City"); + var searchField4 = GetSetting(this.ActiveModule.TabModuleSettings, "SearchField4", "Country"); var propertyNames = ""; var propertyValues = ""; @@ -208,13 +208,13 @@ public HttpResponseMessage AdvancedSearch(int userId, int groupId, int pageIndex AddSearchTerm(ref propertyNames, ref propertyValues, searchField3, searchTerm3); AddSearchTerm(ref propertyNames, ref propertyValues, searchField4, searchTerm4); - var members = GetUsers(userId, groupId, searchTerm1, pageIndex, pageSize, propertyNames, propertyValues); - return Request.CreateResponse(HttpStatusCode.OK, GetMembers(members)); + var members = this.GetUsers(userId, groupId, searchTerm1, pageIndex, pageSize, propertyNames, propertyValues); + return this.Request.CreateResponse(HttpStatusCode.OK, this.GetMembers(members)); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -223,13 +223,13 @@ public HttpResponseMessage BasicSearch(int groupId, string searchTerm, int pageI { try { - var users = GetUsers(-1, groupId, string.IsNullOrEmpty(searchTerm) ? string.Empty : searchTerm.Trim(), pageIndex, pageSize, "", ""); - return Request.CreateResponse(HttpStatusCode.OK, GetMembers(users)); + var users = this.GetUsers(-1, groupId, string.IsNullOrEmpty(searchTerm) ? string.Empty : searchTerm.Trim(), pageIndex, pageSize, "", ""); + return this.Request.CreateResponse(HttpStatusCode.OK, this.GetMembers(users)); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -239,15 +239,15 @@ public HttpResponseMessage GetMember(int userId) try { var users = new List(); - var user = UserController.GetUserById(PortalSettings.PortalId, userId); + var user = UserController.GetUserById(this.PortalSettings.PortalId, userId); users.Add(user); - return Request.CreateResponse(HttpStatusCode.OK, GetMembers(users)); + return this.Request.CreateResponse(HttpStatusCode.OK, this.GetMembers(users)); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -256,16 +256,16 @@ public HttpResponseMessage GetSuggestions(int groupId, string displayName) { try { - var names = (from UserInfo user in GetUsers(-1, groupId, displayName.Trim(), 0, 10, "", "") + var names = (from UserInfo user in this.GetUsers(-1, groupId, displayName.Trim(), 0, 10, "", "") select new { label = user.DisplayName, value = user.DisplayName, userId = user.UserID }) .ToList(); - return Request.CreateResponse(HttpStatusCode.OK, names); + return this.Request.CreateResponse(HttpStatusCode.OK, names); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -275,14 +275,14 @@ public HttpResponseMessage AcceptFriend(FriendDTO postData) { try { - var friend = UserController.GetUserById(PortalSettings.PortalId, postData.FriendId); + var friend = UserController.GetUserById(this.PortalSettings.PortalId, postData.FriendId); FriendsController.Instance.AcceptFriend(friend); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -292,14 +292,14 @@ public HttpResponseMessage AddFriend(FriendDTO postData) { try { - var friend = UserController.GetUserById(PortalSettings.PortalId, postData.FriendId); + var friend = UserController.GetUserById(this.PortalSettings.PortalId, postData.FriendId); FriendsController.Instance.AddFriend(friend); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -309,14 +309,14 @@ public HttpResponseMessage Follow(FollowDTO postData) { try { - var follow = UserController.GetUserById(PortalSettings.PortalId, postData.FollowId); + var follow = UserController.GetUserById(this.PortalSettings.PortalId, postData.FollowId); FollowersController.Instance.FollowUser(follow); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -326,14 +326,14 @@ public HttpResponseMessage RemoveFriend(FriendDTO postData) { try { - var friend = UserController.GetUserById(PortalSettings.PortalId, postData.FriendId); + var friend = UserController.GetUserById(this.PortalSettings.PortalId, postData.FriendId); FriendsController.Instance.DeleteFriend(friend); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } @@ -343,14 +343,14 @@ public HttpResponseMessage UnFollow(FollowDTO postData) { try { - var follow = UserController.GetUserById(PortalSettings.PortalId, postData.FollowId); + var follow = UserController.GetUserById(this.PortalSettings.PortalId, postData.FollowId); FollowersController.Instance.UnFollowUser(follow); - return Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); + return this.Request.CreateResponse(HttpStatusCode.OK, new {Result = "success"}); } catch (Exception exc) { Logger.Error(exc); - return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); + return this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc); } } diff --git a/DNN Platform/Modules/MemberDirectory/Settings.ascx.cs b/DNN Platform/Modules/MemberDirectory/Settings.ascx.cs index 28bb16b3c68..98618d61d98 100644 --- a/DNN Platform/Modules/MemberDirectory/Settings.ascx.cs +++ b/DNN Platform/Modules/MemberDirectory/Settings.ascx.cs @@ -96,93 +96,93 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - AutoDataBind = false; + this.AutoDataBind = false; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if(!IsPostBack) + if(!this.IsPostBack) { - if (Model.Groups.Count > 0) + if (this.Model.Groups.Count > 0) { - groupList.DataSource = Model.Groups; - groupList.DataBind(); - groupList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), Null.NullInteger.ToString())); + this.groupList.DataSource = this.Model.Groups; + this.groupList.DataBind(); + this.groupList.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), Null.NullInteger.ToString())); } else { - filterBySelector.Items.FindByValue("Group").Enabled = false; + this.filterBySelector.Items.FindByValue("Group").Enabled = false; } - foreach (var rel in Model.Relationships) + foreach (var rel in this.Model.Relationships) { - relationShipList.AddItem(Localization.GetString(rel.Name,Localization.SharedResourceFile),rel.RelationshipId.ToString()); + this.relationShipList.AddItem(Localization.GetString(rel.Name,Localization.SharedResourceFile),rel.RelationshipId.ToString()); } var profileResourceFile = "~/DesktopModules/Admin/Security/App_LocalResources/Profile.ascx"; - System.Web.UI.WebControls.ListItemCollection propertiesCollection = GetPropertiesCollection(profileResourceFile); + System.Web.UI.WebControls.ListItemCollection propertiesCollection = this.GetPropertiesCollection(profileResourceFile); //Bind the ListItemCollection to the list - propertyList.DataSource = propertiesCollection; - propertyList.DataBind(); + this.propertyList.DataSource = propertiesCollection; + this.propertyList.DataBind(); //Insert custom properties to the Search field lists - propertiesCollection.Insert(0,new ListItem(Localization.GetString("Username",LocalResourceFile),"Username")); - propertiesCollection.Insert(1, new ListItem(Localization.GetString("DisplayName", LocalResourceFile), "DisplayName")); - propertiesCollection.Insert(2, new ListItem(Localization.GetString("Email", LocalResourceFile), "Email")); + propertiesCollection.Insert(0,new ListItem(Localization.GetString("Username",this.LocalResourceFile),"Username")); + propertiesCollection.Insert(1, new ListItem(Localization.GetString("DisplayName", this.LocalResourceFile), "DisplayName")); + propertiesCollection.Insert(2, new ListItem(Localization.GetString("Email", this.LocalResourceFile), "Email")); //Bind the properties collection in the Search Field Lists - searchField1List.DataSource = propertiesCollection; - searchField1List.DataBind(); + this.searchField1List.DataSource = propertiesCollection; + this.searchField1List.DataBind(); - searchField2List.DataSource = propertiesCollection; - searchField2List.DataBind(); + this.searchField2List.DataSource = propertiesCollection; + this.searchField2List.DataBind(); - searchField3List.DataSource = propertiesCollection; - searchField3List.DataBind(); + this.searchField3List.DataSource = propertiesCollection; + this.searchField3List.DataBind(); - searchField4List.DataSource = propertiesCollection; - searchField4List.DataBind(); + this.searchField4List.DataSource = propertiesCollection; + this.searchField4List.DataBind(); - filterBySelector.Select(_filterBy, false, 0); + this.filterBySelector.Select(this._filterBy, false, 0); - switch (_filterBy) + switch (this._filterBy) { case "Group": - groupList.Select(_filterValue, false, 0); + this.groupList.Select(this._filterValue, false, 0); break; case "Relationship": - relationShipList.Select(_filterValue, false, 0); + this.relationShipList.Select(this._filterValue, false, 0); break; case "ProfileProperty": - propertyList.Select(_filterValue, false, 0); + this.propertyList.Select(this._filterValue, false, 0); break; case "User": break; } - searchField1List.Select(GetTabModuleSetting("SearchField1", _defaultSearchField1)); - searchField2List.Select(GetTabModuleSetting("SearchField2", _defaultSearchField2)); - searchField3List.Select(GetTabModuleSetting("SearchField3", _defaultSearchField3)); - searchField4List.Select(GetTabModuleSetting("SearchField4", _defaultSearchField4)); + this.searchField1List.Select(this.GetTabModuleSetting("SearchField1", this._defaultSearchField1)); + this.searchField2List.Select(this.GetTabModuleSetting("SearchField2", this._defaultSearchField2)); + this.searchField3List.Select(this.GetTabModuleSetting("SearchField3", this._defaultSearchField3)); + this.searchField4List.Select(this.GetTabModuleSetting("SearchField4", this._defaultSearchField4)); - ExcludeHostUsersCheckBox.Checked = Boolean.Parse(GetTabModuleSetting("ExcludeHostUsers", "false")); + this.ExcludeHostUsersCheckBox.Checked = Boolean.Parse(this.GetTabModuleSetting("ExcludeHostUsers", "false")); } } private ListItemCollection GetPropertiesCollection(string profileResourceFile) { var result = new ListItemCollection(); - foreach (var property in Model.ProfileProperties) + foreach (var property in this.Model.ProfileProperties) { - result.Add(new ListItem(GetLocalizeName(property.PropertyName,profileResourceFile),property.PropertyName)); + result.Add(new ListItem(this.GetLocalizeName(property.PropertyName,profileResourceFile),property.PropertyName)); } return result; @@ -192,66 +192,66 @@ protected override void OnSettingsLoaded() { base.OnSettingsLoaded(); - if(!IsPostBack) + if(!this.IsPostBack) { - BindSortList(); + this.BindSortList(); - itemTemplate.Text = GetTabModuleSetting("ItemTemplate", DefaultItemTemplate); - alternateItemTemplate.Text = GetTabModuleSetting("AlternateItemTemplate", DefaultAlternateItemTemplate); - popUpTemplate.Text = GetTabModuleSetting("PopUpTemplate", DefaultPopUpTemplate); - displaySearchList.Select(GetTabModuleSetting("DisplaySearch", _defaultDisplaySearch)); - enablePopUp.Checked = Boolean.Parse(GetTabModuleSetting("EnablePopUp", _defaultEnablePopUp)); + this.itemTemplate.Text = this.GetTabModuleSetting("ItemTemplate", DefaultItemTemplate); + this.alternateItemTemplate.Text = this.GetTabModuleSetting("AlternateItemTemplate", DefaultAlternateItemTemplate); + this.popUpTemplate.Text = this.GetTabModuleSetting("PopUpTemplate", DefaultPopUpTemplate); + this.displaySearchList.Select(this.GetTabModuleSetting("DisplaySearch", this._defaultDisplaySearch)); + this.enablePopUp.Checked = Boolean.Parse(this.GetTabModuleSetting("EnablePopUp", this._defaultEnablePopUp)); - _filterBy = GetModuleSetting("FilterBy", _defaultFilterBy); - _filterValue = GetModuleSetting("FilterValue", _defaultFilterValue); - propertyValue.Text = GetModuleSetting("FilterPropertyValue", String.Empty); + this._filterBy = this.GetModuleSetting("FilterBy", this._defaultFilterBy); + this._filterValue = this.GetModuleSetting("FilterValue", this._defaultFilterValue); + this.propertyValue.Text = this.GetModuleSetting("FilterPropertyValue", String.Empty); - sortFieldList.Select(GetTabModuleSetting("SortField", _defaultSortField)); - sortOrderList.Select(GetTabModuleSetting("SortOrder", _defaultSortOrder)); + this.sortFieldList.Select(this.GetTabModuleSetting("SortField", this._defaultSortField)); + this.sortOrderList.Select(this.GetTabModuleSetting("SortOrder", this._defaultSortOrder)); - pageSize.Text = GetTabModuleSetting("PageSize", DefaultPageSize.ToString(CultureInfo.InvariantCulture)); - disablePager.Checked = Boolean.Parse(GetTabModuleSetting("DisablePaging", "False")); + this.pageSize.Text = this.GetTabModuleSetting("PageSize", DefaultPageSize.ToString(CultureInfo.InvariantCulture)); + this.disablePager.Checked = Boolean.Parse(this.GetTabModuleSetting("DisablePaging", "False")); } } protected override void OnSavingSettings() { - Model.TabModuleSettings["ItemTemplate"] = itemTemplate.Text; - Model.TabModuleSettings["AlternateItemTemplate"] = alternateItemTemplate.Text; - Model.TabModuleSettings["PopUpTemplate"] = popUpTemplate.Text; - Model.TabModuleSettings["EnablePopUp"] = enablePopUp.Checked.ToString(CultureInfo.InvariantCulture); + this.Model.TabModuleSettings["ItemTemplate"] = this.itemTemplate.Text; + this.Model.TabModuleSettings["AlternateItemTemplate"] = this.alternateItemTemplate.Text; + this.Model.TabModuleSettings["PopUpTemplate"] = this.popUpTemplate.Text; + this.Model.TabModuleSettings["EnablePopUp"] = this.enablePopUp.Checked.ToString(CultureInfo.InvariantCulture); - _filterBy = filterBySelector.SelectedValue; - Model.ModuleSettings["FilterBy"] = _filterBy; + this._filterBy = this.filterBySelector.SelectedValue; + this.Model.ModuleSettings["FilterBy"] = this._filterBy; - switch (_filterBy) + switch (this._filterBy) { case "Group": - Model.ModuleSettings["FilterValue"] = groupList.SelectedValue; + this.Model.ModuleSettings["FilterValue"] = this.groupList.SelectedValue; break; case "Relationship": - Model.ModuleSettings["FilterValue"] = relationShipList.SelectedValue; + this.Model.ModuleSettings["FilterValue"] = this.relationShipList.SelectedValue; break; case "ProfileProperty": - Model.ModuleSettings["FilterValue"] = propertyList.SelectedValue; + this.Model.ModuleSettings["FilterValue"] = this.propertyList.SelectedValue; break; } - Model.ModuleSettings["FilterPropertyValue"] = propertyValue.Text; + this.Model.ModuleSettings["FilterPropertyValue"] = this.propertyValue.Text; - Model.TabModuleSettings["SortField"] = sortFieldList.SelectedValue; - Model.TabModuleSettings["SortOrder"] = sortOrderList.SelectedValue; + this.Model.TabModuleSettings["SortField"] = this.sortFieldList.SelectedValue; + this.Model.TabModuleSettings["SortOrder"] = this.sortOrderList.SelectedValue; - Model.TabModuleSettings["SearchField1"] = searchField1List.SelectedValue; - Model.TabModuleSettings["SearchField2"] = searchField2List.SelectedValue; - Model.TabModuleSettings["SearchField3"] = searchField3List.SelectedValue; - Model.TabModuleSettings["SearchField4"] = searchField4List.SelectedValue; - Model.TabModuleSettings["DisplaySearch"] = displaySearchList.SelectedValue; + this.Model.TabModuleSettings["SearchField1"] = this.searchField1List.SelectedValue; + this.Model.TabModuleSettings["SearchField2"] = this.searchField2List.SelectedValue; + this.Model.TabModuleSettings["SearchField3"] = this.searchField3List.SelectedValue; + this.Model.TabModuleSettings["SearchField4"] = this.searchField4List.SelectedValue; + this.Model.TabModuleSettings["DisplaySearch"] = this.displaySearchList.SelectedValue; - Model.TabModuleSettings["DisablePaging"] = disablePager.Checked.ToString(CultureInfo.InvariantCulture); - Model.TabModuleSettings["PageSize"] = pageSize.Text; + this.Model.TabModuleSettings["DisablePaging"] = this.disablePager.Checked.ToString(CultureInfo.InvariantCulture); + this.Model.TabModuleSettings["PageSize"] = this.pageSize.Text; - Model.TabModuleSettings["ExcludeHostUsers"] = ExcludeHostUsersCheckBox.Checked.ToString(CultureInfo.InvariantCulture); + this.Model.TabModuleSettings["ExcludeHostUsers"] = this.ExcludeHostUsersCheckBox.Checked.ToString(CultureInfo.InvariantCulture); base.OnSavingSettings(); } @@ -264,29 +264,29 @@ private string GetLocalizeName(string propertyName, string resourceFile) private void BindSortList() { - sortFieldList.Items.Add(AddSearchItem("UserId")); - sortFieldList.Items.Add(AddSearchItem("LastName")); - sortFieldList.Items.Add(AddSearchItem("DisplayName")); - sortFieldList.Items.Add(AddSearchItem("CreatedOnDate", "DateCreated")); + this.sortFieldList.Items.Add(this.AddSearchItem("UserId")); + this.sortFieldList.Items.Add(this.AddSearchItem("LastName")); + this.sortFieldList.Items.Add(this.AddSearchItem("DisplayName")); + this.sortFieldList.Items.Add(this.AddSearchItem("CreatedOnDate", "DateCreated")); var controller = new ListController(); var imageDataType = controller.GetListEntryInfo("DataType", "Image"); - foreach (ProfilePropertyDefinition definition in Model.ProfileProperties) + foreach (ProfilePropertyDefinition definition in this.Model.ProfileProperties) { if (imageDataType != null && definition.DataType != imageDataType.EntryID) { - sortFieldList.Items.Add(AddSearchItem(definition.PropertyName)); + this.sortFieldList.Items.Add(this.AddSearchItem(definition.PropertyName)); } } } private ListItem AddSearchItem(string name) { - return AddSearchItem(name, name); + return this.AddSearchItem(name, name); } private ListItem AddSearchItem(string name, string resourceKey) { - var text = Localization.GetString(resourceKey, LocalResourceFile); + var text = Localization.GetString(resourceKey, this.LocalResourceFile); if (String.IsNullOrEmpty(text)) { text = resourceKey; diff --git a/DNN Platform/Modules/MemberDirectory/View.ascx.cs b/DNN Platform/Modules/MemberDirectory/View.ascx.cs index f6c53d46e9f..2f201e97400 100644 --- a/DNN Platform/Modules/MemberDirectory/View.ascx.cs +++ b/DNN Platform/Modules/MemberDirectory/View.ascx.cs @@ -32,40 +32,40 @@ protected override void OnInit(EventArgs e) JavaScript.RequestRegistration(CommonJs.jQueryFileUpload); JavaScript.RequestRegistration(CommonJs.Knockout); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/MemberDirectory/Scripts/MemberDirectory.js"); - AddIe7StyleSheet(); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/MemberDirectory/Scripts/MemberDirectory.js"); + this.AddIe7StyleSheet(); - searchBar.Visible = DisplaySearch != "None"; - advancedSearchBar.Visible = DisplaySearch == "Both"; - popUpPanel.Visible = EnablePopUp; - loadMore.Visible = !DisablePaging; + this.searchBar.Visible = this.DisplaySearch != "None"; + this.advancedSearchBar.Visible = this.DisplaySearch == "Both"; + this.popUpPanel.Visible = this.EnablePopUp; + this.loadMore.Visible = !this.DisablePaging; base.OnInit(e); } protected string AlternateItemTemplate { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "AlternateItemTemplate", Settings.DefaultAlternateItemTemplate); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "AlternateItemTemplate", Settings.DefaultAlternateItemTemplate); } } protected bool DisablePaging { - get { return bool.Parse(GetSetting(ModuleContext.Configuration.TabModuleSettings, "DisablePaging", "false")); } + get { return bool.Parse(this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "DisablePaging", "false")); } } protected string DisplaySearch { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "DisplaySearch", "Both"); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "DisplaySearch", "Both"); } } protected bool EnablePopUp { - get { return bool.Parse(GetSetting(ModuleContext.Configuration.TabModuleSettings, "EnablePopUp", "false")); } + get { return bool.Parse(this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "EnablePopUp", "false")); } } protected string FilterBy { - get { return GetSetting(ModuleContext.Configuration.ModuleSettings, "FilterBy", "None"); } + get { return this.GetSetting(this.ModuleContext.Configuration.ModuleSettings, "FilterBy", "None"); } } protected int GroupId @@ -73,9 +73,9 @@ protected int GroupId get { int groupId = Null.NullInteger; - if (!string.IsNullOrEmpty(Request.Params["GroupId"])) + if (!string.IsNullOrEmpty(this.Request.Params["GroupId"])) { - groupId = Int32.Parse(Request.Params["GroupId"]); + groupId = Int32.Parse(this.Request.Params["GroupId"]); } return groupId; } @@ -83,27 +83,27 @@ protected int GroupId protected string ItemTemplate { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "ItemTemplate", Settings.DefaultItemTemplate); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "ItemTemplate", Settings.DefaultItemTemplate); } } protected int PageSize { get { - return GetSettingAsInt32(ModuleContext.Configuration.TabModuleSettings, "PageSize", Settings.DefaultPageSize); + return this.GetSettingAsInt32(this.ModuleContext.Configuration.TabModuleSettings, "PageSize", Settings.DefaultPageSize); } } protected string PopUpTemplate { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "PopUpTemplate", Settings.DefaultPopUpTemplate); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "PopUpTemplate", Settings.DefaultPopUpTemplate); } } public override bool DisplayModule { get { - return !(ProfileUserId == ModuleContext.PortalSettings.UserId && FilterBy == "User") && ModuleContext.PortalSettings.UserId > -1; + return !(this.ProfileUserId == this.ModuleContext.PortalSettings.UserId && this.FilterBy == "User") && this.ModuleContext.PortalSettings.UserId > -1; } } @@ -122,29 +122,29 @@ protected string ProfileUrlUserToken protected string SearchField1 { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "SearchField1", "DisplayName"); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "SearchField1", "DisplayName"); } } protected string SearchField2 { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "SearchField2", "Email"); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "SearchField2", "Email"); } } protected string SearchField3 { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "SearchField3", "City"); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "SearchField3", "City"); } } protected string SearchField4 { - get { return GetSetting(ModuleContext.Configuration.TabModuleSettings, "SearchField4", "Country"); } + get { return this.GetSetting(this.ModuleContext.Configuration.TabModuleSettings, "SearchField4", "Country"); } } protected string ViewProfileUrl { get { - return NavigationManager.NavigateURL(ModuleContext.PortalSettings.UserTabId, "", "userId=PROFILEUSER"); + return this.NavigationManager.NavigateURL(this.ModuleContext.PortalSettings.UserTabId, "", "userId=PROFILEUSER"); } } @@ -152,8 +152,8 @@ protected bool DisablePrivateMessage { get { - return PortalSettings.DisablePrivateMessage && !UserInfo.IsSuperUser - && !UserInfo.IsInRole(PortalSettings.AdministratorRoleName); + return this.PortalSettings.DisablePrivateMessage && !this.UserInfo.IsSuperUser + && !this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName); } } @@ -172,11 +172,11 @@ protected UserInfo UserInfo private void AddIe7StyleSheet() { - var browser = Request.Browser; + var browser = this.Request.Browser; if (browser.Type == "IE" || browser.MajorVersion < 8) { const string cssLink = @""; - Page.Header.Controls.Add(new LiteralControl(cssLink)); + this.Page.Header.Controls.Add(new LiteralControl(cssLink)); } } diff --git a/DNN Platform/Modules/MemberDirectory/packages.config b/DNN Platform/Modules/MemberDirectory/packages.config index e94ef92b0b5..2e66578e1e2 100644 --- a/DNN Platform/Modules/MemberDirectory/packages.config +++ b/DNN Platform/Modules/MemberDirectory/packages.config @@ -1,9 +1,10 @@ - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs index 398645a8fb7..f2d39f56690 100644 --- a/DNN Platform/Modules/RazorHost/AddScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/AddScript.ascx.cs @@ -26,12 +26,12 @@ public partial class AddScript : ModuleUserControlBase public AddScript() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } private void DisplayExtension() { - fileExtension.Text = "." + scriptFileType.SelectedValue.ToLowerInvariant(); + this.fileExtension.Text = "." + this.scriptFileType.SelectedValue.ToLowerInvariant(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -39,9 +39,9 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - cmdCancel.Click += cmdCancel_Click; - cmdAdd.Click += cmdAdd_Click; - scriptFileType.SelectedIndexChanged += scriptFileType_SelectedIndexChanged; + this.cmdCancel.Click += this.cmdCancel_Click; + this.cmdAdd.Click += this.cmdAdd_Click; + this.scriptFileType.SelectedIndexChanged += this.scriptFileType_SelectedIndexChanged; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -49,7 +49,7 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - DisplayExtension(); + this.DisplayExtension(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -57,7 +57,7 @@ protected void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(ModuleContext.EditUrl("Edit"), true); + this.Response.Redirect(this.ModuleContext.EditUrl("Edit"), true); } catch (Exception exc) //Module failed to load { @@ -70,24 +70,24 @@ protected void cmdAdd_Click(object sender, EventArgs e) { try { - if (!ModuleContext.PortalSettings.UserInfo.IsSuperUser) + if (!this.ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } - if (Page.IsValid) + if (this.Page.IsValid) { - string scriptFileName = "_" + Path.GetFileNameWithoutExtension(fileName.Text) + "." + scriptFileType.SelectedValue.ToLowerInvariant(); + string scriptFileName = "_" + Path.GetFileNameWithoutExtension(this.fileName.Text) + "." + this.scriptFileType.SelectedValue.ToLowerInvariant(); - string srcFile = Server.MapPath(string.Format(razorScriptFileFormatString, scriptFileName)); + string srcFile = this.Server.MapPath(string.Format(this.razorScriptFileFormatString, scriptFileName)); // write file StreamWriter objStream = null; objStream = File.CreateText(srcFile); - objStream.WriteLine(Localization.GetString("NewScript", LocalResourceFile)); + objStream.WriteLine(Localization.GetString("NewScript", this.LocalResourceFile)); objStream.Close(); - Response.Redirect(ModuleContext.EditUrl("Edit"), true); + this.Response.Redirect(this.ModuleContext.EditUrl("Edit"), true); } } catch (Exception exc) //Module failed to load @@ -98,7 +98,7 @@ protected void cmdAdd_Click(object sender, EventArgs e) private void scriptFileType_SelectedIndexChanged(object sender, EventArgs e) { - DisplayExtension(); + this.DisplayExtension(); } } } diff --git a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs index b3958f412ae..44c6baa5a72 100644 --- a/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs +++ b/DNN Platform/Modules/RazorHost/CreateModule.ascx.cs @@ -39,7 +39,7 @@ public partial class CreateModule : ModuleUserControlBase public CreateModule() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -47,7 +47,7 @@ protected string ModuleControl { get { - return Path.GetFileNameWithoutExtension(scriptList.SelectedValue).TrimStart('_') + ".ascx"; + return Path.GetFileNameWithoutExtension(this.scriptList.SelectedValue).TrimStart('_') + ".ascx"; } } @@ -57,10 +57,10 @@ protected string RazorScriptFile get { string m_RazorScriptFile = Null.NullString; - var scriptFileSetting = ModuleContext.Settings["ScriptFile"] as string; + var scriptFileSetting = this.ModuleContext.Settings["ScriptFile"] as string; if (! (string.IsNullOrEmpty(scriptFileSetting))) { - m_RazorScriptFile = string.Format(razorScriptFileFormatString, scriptFileSetting); + m_RazorScriptFile = string.Format(this.razorScriptFileFormatString, scriptFileSetting); } return m_RazorScriptFile; } @@ -69,10 +69,10 @@ protected string RazorScriptFile private void Create() { //Create new Folder - string folderMapPath = Server.MapPath(string.Format("~/DesktopModules/RazorModules/{0}", txtFolder.Text)); + string folderMapPath = this.Server.MapPath(string.Format("~/DesktopModules/RazorModules/{0}", this.txtFolder.Text)); if (Directory.Exists(folderMapPath)) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("FolderExists", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("FolderExists", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } else @@ -82,25 +82,25 @@ private void Create() } //Create new Module Control - string moduleControlMapPath = folderMapPath + "/" + ModuleControl; + string moduleControlMapPath = folderMapPath + "/" + this.ModuleControl; try { using (var moduleControlWriter = new StreamWriter(moduleControlMapPath)) { - moduleControlWriter.Write(Localization.GetString("ModuleControlText.Text", LocalResourceFile)); + moduleControlWriter.Write(Localization.GetString("ModuleControlText.Text", this.LocalResourceFile)); moduleControlWriter.Flush(); } } catch (Exception ex) { Exceptions.LogException(ex); - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ModuleControlCreationError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ModuleControlCreationError", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } //Copy Script to new Folder - string scriptSourceFile = Server.MapPath(string.Format(razorScriptFileFormatString, scriptList.SelectedValue)); - string scriptTargetFile = folderMapPath + "/" + scriptList.SelectedValue; + string scriptSourceFile = this.Server.MapPath(string.Format(this.razorScriptFileFormatString, this.scriptList.SelectedValue)); + string scriptTargetFile = folderMapPath + "/" + this.scriptList.SelectedValue; try { File.Copy(scriptSourceFile, scriptTargetFile); @@ -108,18 +108,18 @@ private void Create() catch (Exception ex) { Exceptions.LogException(ex); - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ScriptCopyError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ScriptCopyError", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } //Create new Manifest in target folder - string manifestMapPath = folderMapPath + "/" + ModuleControl.Replace(".ascx", ".dnn"); + string manifestMapPath = folderMapPath + "/" + this.ModuleControl.Replace(".ascx", ".dnn"); try { using (var manifestWriter = new StreamWriter(manifestMapPath)) { - string manifestTemplate = Localization.GetString("ManifestText.Text", LocalResourceFile); - string manifest = string.Format(manifestTemplate, txtName.Text, txtDescription.Text, txtFolder.Text, ModuleControl, scriptList.SelectedValue); + string manifestTemplate = Localization.GetString("ManifestText.Text", this.LocalResourceFile); + string manifest = string.Format(manifestTemplate, this.txtName.Text, this.txtDescription.Text, this.txtFolder.Text, this.ModuleControl, this.scriptList.SelectedValue); manifestWriter.Write(manifest); manifestWriter.Flush(); } @@ -127,12 +127,12 @@ private void Create() catch (Exception ex) { Exceptions.LogException(ex); - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ManifestCreationError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ManifestCreationError", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } //Register Module - ModuleDefinitionInfo moduleDefinition = ImportManifest(manifestMapPath); + ModuleDefinitionInfo moduleDefinition = this.ImportManifest(manifestMapPath); //remove the manifest file try @@ -146,26 +146,26 @@ private void Create() //Optionally goto new Page - if (chkAddPage.Checked) + if (this.chkAddPage.Checked) { - string tabName = "Test " + txtName.Text + " Page"; + string tabName = "Test " + this.txtName.Text + " Page"; string tabPath = Globals.GenerateTabPath(Null.NullInteger, tabName); - int tabID = TabController.GetTabByTabPath(ModuleContext.PortalId, tabPath, ModuleContext.PortalSettings.CultureCode); + int tabID = TabController.GetTabByTabPath(this.ModuleContext.PortalId, tabPath, this.ModuleContext.PortalSettings.CultureCode); if (tabID == Null.NullInteger) { //Create a new page var newTab = new TabInfo(); - newTab.TabName = "Test " + txtName.Text + " Page"; + newTab.TabName = "Test " + this.txtName.Text + " Page"; newTab.ParentId = Null.NullInteger; - newTab.PortalID = ModuleContext.PortalId; + newTab.PortalID = this.ModuleContext.PortalId; newTab.IsVisible = true; - newTab.TabID = TabController.Instance.AddTabBefore(newTab, ModuleContext.PortalSettings.AdminTabId); + newTab.TabID = TabController.Instance.AddTabBefore(newTab, this.ModuleContext.PortalSettings.AdminTabId); var objModule = new ModuleInfo(); - objModule.Initialize(ModuleContext.PortalId); + objModule.Initialize(this.ModuleContext.PortalId); - objModule.PortalID = ModuleContext.PortalId; + objModule.PortalID = this.ModuleContext.PortalId; objModule.TabID = newTab.TabID; objModule.ModuleOrder = Null.NullInteger; objModule.ModuleTitle = moduleDefinition.FriendlyName; @@ -175,17 +175,17 @@ private void Create() objModule.AllTabs = false; ModuleController.Instance.AddModule(objModule); - Response.Redirect(_navigationManager.NavigateURL(newTab.TabID), true); + this.Response.Redirect(this._navigationManager.NavigateURL(newTab.TabID), true); } else { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TabExists", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TabExists", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } } else { //Redirect to main extensions page - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } @@ -194,7 +194,7 @@ private ModuleDefinitionInfo ImportManifest(string manifest) ModuleDefinitionInfo moduleDefinition = null; try { - var _Installer = new Installer(manifest, Request.MapPath("."), true); + var _Installer = new Installer(manifest, this.Request.MapPath("."), true); if (_Installer.IsValid) { @@ -218,20 +218,20 @@ private ModuleDefinitionInfo ImportManifest(string manifest) } else { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InstallError.Text", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); - phInstallLogs.Controls.Add(_Installer.InstallerInfo.Log.GetLogsTable()); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InstallError.Text", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + this.phInstallLogs.Controls.Add(_Installer.InstallerInfo.Log.GetLogsTable()); } } else { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InstallError.Text", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); - phInstallLogs.Controls.Add(_Installer.InstallerInfo.Log.GetLogsTable()); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InstallError.Text", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + this.phInstallLogs.Controls.Add(_Installer.InstallerInfo.Log.GetLogsTable()); } } catch (Exception exc) { Exceptions.LogException(exc); - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ImportControl.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ImportControl.ErrorMessage", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } return moduleDefinition; @@ -239,10 +239,10 @@ private ModuleDefinitionInfo ImportManifest(string manifest) private void LoadScripts() { - string basePath = Server.MapPath(razorScriptFolder); - var scriptFileSetting = ModuleContext.Settings["ScriptFile"] as string; + string basePath = this.Server.MapPath(this.razorScriptFolder); + var scriptFileSetting = this.ModuleContext.Settings["ScriptFile"] as string; - foreach (string script in Directory.GetFiles(Server.MapPath(razorScriptFolder), "*.??html")) + foreach (string script in Directory.GetFiles(this.Server.MapPath(this.razorScriptFolder), "*.??html")) { string scriptPath = script.Replace(basePath, ""); var item = new ListItem(scriptPath, scriptPath); @@ -250,16 +250,16 @@ private void LoadScripts() { item.Selected = true; } - scriptList.Items.Add(item); + this.scriptList.Items.Add(item); } } private void DisplayFile() { - string scriptFile = string.Format(razorScriptFileFormatString, scriptList.SelectedValue); + string scriptFile = string.Format(this.razorScriptFileFormatString, this.scriptList.SelectedValue); - lblSourceFile.Text = string.Format(Localization.GetString("SourceFile", LocalResourceFile), scriptFile); - lblModuleControl.Text = string.Format(Localization.GetString("SourceControl", LocalResourceFile), ModuleControl); + this.lblSourceFile.Text = string.Format(Localization.GetString("SourceFile", this.LocalResourceFile), scriptFile); + this.lblModuleControl.Text = string.Format(Localization.GetString("SourceControl", this.LocalResourceFile), this.ModuleControl); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -267,9 +267,9 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - cmdCancel.Click += cmdCancel_Click; - cmdCreate.Click += cmdCreate_Click; - scriptList.SelectedIndexChanged += scriptList_SelectedIndexChanged; + this.cmdCancel.Click += this.cmdCancel_Click; + this.cmdCreate.Click += this.cmdCreate_Click; + this.scriptList.SelectedIndexChanged += this.scriptList_SelectedIndexChanged; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -277,15 +277,15 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (! ModuleContext.PortalSettings.UserInfo.IsSuperUser) + if (! this.ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } - if (! Page.IsPostBack) + if (! this.Page.IsPostBack) { - LoadScripts(); - DisplayFile(); + this.LoadScripts(); + this.DisplayFile(); } } @@ -293,7 +293,7 @@ private void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -305,14 +305,14 @@ private void cmdCreate_Click(object sender, EventArgs e) { try { - if (! ModuleContext.PortalSettings.UserInfo.IsSuperUser) + if (! this.ModuleContext.PortalSettings.UserInfo.IsSuperUser) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } - if (Page.IsValid) + if (this.Page.IsValid) { - Create(); + this.Create(); } } catch (Exception exc) //Module failed to load @@ -323,7 +323,7 @@ private void cmdCreate_Click(object sender, EventArgs e) private void scriptList_SelectedIndexChanged(object sender, EventArgs e) { - DisplayFile(); + this.DisplayFile(); } } } diff --git a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj index 7f61d63974f..cb460f99ef3 100644 --- a/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj +++ b/DNN Platform/Modules/RazorHost/DotNetNuke.Modules.RazorHost.csproj @@ -1,248 +1,256 @@ - - - - - Debug - AnyCPU - - - - - {94C9A90C-C0E9-41D0-AC33-FA5B35CB9C7D} - {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - - - DotNetNuke.Modules.RazorHost - v4.7.2 - Custom - false - - - 4.0 - - - - - - - - - true - full - DEBUG;TRACE - bin\ - bin\DotNetNuke.Modules.RazorHost.XML - 4 - 1591 - 7 - - - pdbonly - TRACE - true - bin\ - bin\DotNetNuke.Modules.RazorHost.XML - 1591 - 7 - - - - - - - - - On - - - - False - ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - - - - - - - - ..\..\Components\Telerik\bin\Telerik.Web.UI.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SolutionInfo.cs - - - - AddScript.ascx - - - AddScript.ascx - aspxcodebehind - - - CreateModule.ascx - - - CreateModule.ascx - aspxcodebehind - - - EditScript.ascx - - - EditScript.ascx - aspxcodebehind - - - RazorHost.ascx - - - RazorHost.ascx - ASPXCodeBehind - - - - Settings.ascx - - - Settings.ascx - aspxcodebehind - - - - - - - - - - - - - - - Designer - - - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - {6928a9b1-f88a-4581-a132-d3eb38669bb0} - DotNetNuke.Abstractions - - - {9806c125-8ca9-48cc-940a-ccd0442c5993} - DotNetNuke.Web.Razor - - - {B1699614-39D4-468A-AB1D-A2FBA97CADDF} - DotNetNuke.Web - False - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 60155 - / - - - False - True - http://localhost/DNN_Platform - False - - - - - + + + + + Debug + AnyCPU + + + + + {94C9A90C-C0E9-41D0-AC33-FA5B35CB9C7D} + {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + + + DotNetNuke.Modules.RazorHost + v4.7.2 + Custom + false + + + 4.0 + + + + + + + + + + true + full + DEBUG;TRACE + bin\ + bin\DotNetNuke.Modules.RazorHost.XML + 4 + 1591 + 7 + + + pdbonly + TRACE + true + bin\ + bin\DotNetNuke.Modules.RazorHost.XML + 1591 + 7 + + + + + + + + + On + + + + False + ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + + + + + + + + ..\..\Components\Telerik\bin\Telerik.Web.UI.dll + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SolutionInfo.cs + + + + AddScript.ascx + + + AddScript.ascx + aspxcodebehind + + + CreateModule.ascx + + + CreateModule.ascx + aspxcodebehind + + + EditScript.ascx + + + EditScript.ascx + aspxcodebehind + + + RazorHost.ascx + + + RazorHost.ascx + ASPXCodeBehind + + + + Settings.ascx + + + Settings.ascx + aspxcodebehind + + + + + + + + + + + + + + + stylecop.json + + + Designer + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + {6928a9b1-f88a-4581-a132-d3eb38669bb0} + DotNetNuke.Abstractions + + + {9806c125-8ca9-48cc-940a-ccd0442c5993} + DotNetNuke.Web.Razor + + + {B1699614-39D4-468A-AB1D-A2FBA97CADDF} + DotNetNuke.Web + False + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + + + + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 60155 + / + + + False + True + http://localhost/DNN_Platform + False + + + + + \ No newline at end of file diff --git a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs index 431a8e4b31f..19ff8dd5880 100644 --- a/DNN Platform/Modules/RazorHost/EditScript.ascx.cs +++ b/DNN Platform/Modules/RazorHost/EditScript.ascx.cs @@ -30,7 +30,7 @@ public partial class EditScript : ModuleUserControlBase public EditScript() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -39,10 +39,10 @@ protected string RazorScriptFile get { string m_RazorScriptFile = Null.NullString; - var scriptFileSetting = ModuleContext.Settings["ScriptFile"] as string; + var scriptFileSetting = this.ModuleContext.Settings["ScriptFile"] as string; if (!(string.IsNullOrEmpty(scriptFileSetting))) { - m_RazorScriptFile = string.Format(razorScriptFileFormatString, scriptFileSetting); + m_RazorScriptFile = string.Format(this.razorScriptFileFormatString, scriptFileSetting); } return m_RazorScriptFile; } @@ -50,10 +50,10 @@ protected string RazorScriptFile private void LoadScripts() { - string basePath = Server.MapPath(razorScriptFolder); - var scriptFileSetting = ModuleContext.Settings["ScriptFile"] as string; + string basePath = this.Server.MapPath(this.razorScriptFolder); + var scriptFileSetting = this.ModuleContext.Settings["ScriptFile"] as string; - foreach (string script in Directory.GetFiles(Server.MapPath(razorScriptFolder), "*.??html")) + foreach (string script in Directory.GetFiles(this.Server.MapPath(this.razorScriptFolder), "*.??html")) { string scriptPath = script.Replace(basePath, ""); var item = new ListItem(scriptPath, scriptPath); @@ -61,43 +61,43 @@ private void LoadScripts() { item.Selected = true; } - scriptList.Items.Add(item); + this.scriptList.Items.Add(item); } } private void DisplayFile() { - var scriptFileSetting = ModuleContext.Settings["ScriptFile"] as string; - string scriptFile = string.Format(razorScriptFileFormatString, scriptList.SelectedValue); - string srcFile = Server.MapPath(scriptFile); + var scriptFileSetting = this.ModuleContext.Settings["ScriptFile"] as string; + string scriptFile = string.Format(this.razorScriptFileFormatString, this.scriptList.SelectedValue); + string srcFile = this.Server.MapPath(scriptFile); - lblSourceFile.Text = string.Format(Localization.GetString("SourceFile", LocalResourceFile), scriptFile); + this.lblSourceFile.Text = string.Format(Localization.GetString("SourceFile", this.LocalResourceFile), scriptFile); StreamReader objStreamReader = null; objStreamReader = File.OpenText(srcFile); - txtSource.Text = objStreamReader.ReadToEnd(); + this.txtSource.Text = objStreamReader.ReadToEnd(); objStreamReader.Close(); if (!(string.IsNullOrEmpty(scriptFileSetting))) { - isCurrentScript.Checked = (scriptList.SelectedValue.ToLowerInvariant() == scriptFileSetting.ToLowerInvariant()); + this.isCurrentScript.Checked = (this.scriptList.SelectedValue.ToLowerInvariant() == scriptFileSetting.ToLowerInvariant()); } } private void SaveScript() { - string srcFile = Server.MapPath(string.Format(razorScriptFileFormatString, scriptList.SelectedValue)); + string srcFile = this.Server.MapPath(string.Format(this.razorScriptFileFormatString, this.scriptList.SelectedValue)); // write file StreamWriter objStream = null; objStream = File.CreateText(srcFile); - objStream.WriteLine(txtSource.Text); + objStream.WriteLine(this.txtSource.Text); objStream.Close(); - if (isCurrentScript.Checked) + if (this.isCurrentScript.Checked) { //Update setting - ModuleController.Instance.UpdateModuleSetting(ModuleContext.ModuleId, "ScriptFile", scriptList.SelectedValue); + ModuleController.Instance.UpdateModuleSetting(this.ModuleContext.ModuleId, "ScriptFile", this.scriptList.SelectedValue); } } @@ -106,11 +106,11 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - cmdCancel.Click += cmdCancel_Click; - cmdSave.Click += cmdSave_Click; - cmdSaveClose.Click += cmdSaveClose_Click; - cmdAdd.Click += cmdAdd_Click; - scriptList.SelectedIndexChanged += scriptList_SelectedIndexChanged; + this.cmdCancel.Click += this.cmdCancel_Click; + this.cmdSave.Click += this.cmdSave_Click; + this.cmdSaveClose.Click += this.cmdSaveClose_Click; + this.cmdAdd.Click += this.cmdAdd_Click; + this.scriptList.SelectedIndexChanged += this.scriptList_SelectedIndexChanged; } [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] @@ -118,10 +118,10 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - LoadScripts(); - DisplayFile(); + this.LoadScripts(); + this.DisplayFile(); } } @@ -129,7 +129,7 @@ private void cmdCancel_Click(object sender, EventArgs e) { try { - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -141,7 +141,7 @@ private void cmdSave_Click(object sender, EventArgs e) { try { - SaveScript(); + this.SaveScript(); } catch (Exception exc) //Module failed to load { @@ -153,8 +153,8 @@ private void cmdSaveClose_Click(object sender, EventArgs e) { try { - SaveScript(); - Response.Redirect(_navigationManager.NavigateURL(), true); + this.SaveScript(); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } catch (Exception exc) //Module failed to load { @@ -166,7 +166,7 @@ private void cmdAdd_Click(object sender, EventArgs e) { try { - Response.Redirect(ModuleContext.EditUrl("Add"), true); + this.Response.Redirect(this.ModuleContext.EditUrl("Add"), true); } catch (Exception exc) //Module failed to load { @@ -176,7 +176,7 @@ private void cmdAdd_Click(object sender, EventArgs e) private void scriptList_SelectedIndexChanged(object sender, EventArgs e) { - DisplayFile(); + this.DisplayFile(); } diff --git a/DNN Platform/Modules/RazorHost/RazorHost.ascx.cs b/DNN Platform/Modules/RazorHost/RazorHost.ascx.cs index f0e331c9835..33041feb46a 100644 --- a/DNN Platform/Modules/RazorHost/RazorHost.ascx.cs +++ b/DNN Platform/Modules/RazorHost/RazorHost.ascx.cs @@ -26,10 +26,10 @@ protected override string RazorScriptFile get { string m_RazorScriptFile = base.RazorScriptFile; - var scriptFileSetting = ModuleContext.Settings["ScriptFile"] as string; + var scriptFileSetting = this.ModuleContext.Settings["ScriptFile"] as string; if (! (string.IsNullOrEmpty(scriptFileSetting))) { - m_RazorScriptFile = string.Format(razorScriptFileFormatString, scriptFileSetting); + m_RazorScriptFile = string.Format(this.razorScriptFileFormatString, scriptFileSetting); } return m_RazorScriptFile; } @@ -43,22 +43,22 @@ public ModuleActionCollection ModuleActions get { var Actions = new ModuleActionCollection(); - Actions.Add(ModuleContext.GetNextActionID(), - Localization.GetString(ModuleActionType.EditContent, LocalResourceFile), + Actions.Add(this.ModuleContext.GetNextActionID(), + Localization.GetString(ModuleActionType.EditContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "edit.gif", - ModuleContext.EditUrl(), + this.ModuleContext.EditUrl(), false, SecurityAccessLevel.Host, true, false); - Actions.Add(ModuleContext.GetNextActionID(), - Localization.GetString("CreateModule.Action", LocalResourceFile), + Actions.Add(this.ModuleContext.GetNextActionID(), + Localization.GetString("CreateModule.Action", this.LocalResourceFile), ModuleActionType.AddContent, "", "edit.gif", - ModuleContext.EditUrl("CreateModule"), + this.ModuleContext.EditUrl("CreateModule"), false, SecurityAccessLevel.Host, true, diff --git a/DNN Platform/Modules/RazorHost/Settings.ascx.cs b/DNN Platform/Modules/RazorHost/Settings.ascx.cs index 5eb3370189a..8a58f988435 100644 --- a/DNN Platform/Modules/RazorHost/Settings.ascx.cs +++ b/DNN Platform/Modules/RazorHost/Settings.ascx.cs @@ -22,10 +22,10 @@ public partial class Settings : ModuleSettingsBase [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public override void LoadSettings() { - string basePath = Server.MapPath(razorScriptFolder); - var scriptFileSetting = Settings["ScriptFile"] as string; + string basePath = this.Server.MapPath(this.razorScriptFolder); + var scriptFileSetting = this.Settings["ScriptFile"] as string; - foreach (string script in Directory.GetFiles(Server.MapPath(razorScriptFolder), "*.??html")) + foreach (string script in Directory.GetFiles(this.Server.MapPath(this.razorScriptFolder), "*.??html")) { string scriptPath = script.Replace(basePath, ""); var item = new ListItem(scriptPath, scriptPath); @@ -33,7 +33,7 @@ public override void LoadSettings() { item.Selected = true; } - scriptList.Items.Add(item); + this.scriptList.Items.Add(item); } base.LoadSettings(); @@ -42,7 +42,7 @@ public override void LoadSettings() [Obsolete("Deprecated in 9.3.2, will be removed in 11.0.0, use Razor Pages instead")] public override void UpdateSettings() { - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ScriptFile", scriptList.SelectedValue); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ScriptFile", this.scriptList.SelectedValue); } } } diff --git a/DNN Platform/Modules/RazorHost/packages.config b/DNN Platform/Modules/RazorHost/packages.config index 015e7e36813..4fca05e5f8c 100644 --- a/DNN Platform/Modules/RazorHost/packages.config +++ b/DNN Platform/Modules/RazorHost/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookClient.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookClient.cs index 4488d432d81..b44449bc498 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookClient.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookClient.cs @@ -21,18 +21,18 @@ public class FacebookClient : OAuthClientBase public FacebookClient(int portalId, AuthMode mode) : base(portalId, mode, "Facebook") { - TokenEndpoint = new Uri("https://graph.facebook.com/oauth/access_token"); - TokenMethod = HttpMethod.GET; - AuthorizationEndpoint = new Uri("https://graph.facebook.com/oauth/authorize"); - MeGraphEndpoint = new Uri("https://graph.facebook.com/me?fields=id,name,email,first_name,last_name,link,birthday,gender,locale,timezone,updated_time"); + this.TokenEndpoint = new Uri("https://graph.facebook.com/oauth/access_token"); + this.TokenMethod = HttpMethod.GET; + this.AuthorizationEndpoint = new Uri("https://graph.facebook.com/oauth/authorize"); + this.MeGraphEndpoint = new Uri("https://graph.facebook.com/me?fields=id,name,email,first_name,last_name,link,birthday,gender,locale,timezone,updated_time"); - Scope = "email"; + this.Scope = "email"; - AuthTokenName = "FacebookUserToken"; + this.AuthTokenName = "FacebookUserToken"; - OAuthVersion = "2.0"; + this.OAuthVersion = "2.0"; - LoadTokenCookie(String.Empty); + this.LoadTokenCookie(String.Empty); } #endregion diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookUserData.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookUserData.cs index 1f215d70af0..f855accb5b1 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookUserData.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Components/FacebookUserData.cs @@ -20,13 +20,13 @@ public class FacebookUserData : UserData public override string FirstName { - get { return FacebookFirstName; } + get { return this.FacebookFirstName; } set { } } public override string LastName { - get { return FacebookLastName; } + get { return this.FacebookLastName; } set { } } diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/DotNetNuke.Authentication.Facebook.csproj b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/DotNetNuke.Authentication.Facebook.csproj index 8c315f13e55..6bace8d1ad3 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/DotNetNuke.Authentication.Facebook.csproj +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/DotNetNuke.Authentication.Facebook.csproj @@ -25,6 +25,7 @@ + true @@ -99,8 +100,12 @@ + + stylecop.json + + @@ -119,6 +124,10 @@ False + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Login.ascx.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Login.ascx.cs index c3fc3af2e5c..9b706edc9c6 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Login.ascx.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/Login.ascx.cs @@ -30,27 +30,27 @@ public override bool SupportsRegistration protected override UserData GetCurrentUser() { - return OAuthClient.GetCurrentUser(); + return this.OAuthClient.GetCurrentUser(); } protected override void OnInit(EventArgs e) { base.OnInit(e); - loginButton.Click += loginButton_Click; - registerButton.Click += loginButton_Click; + this.loginButton.Click += this.loginButton_Click; + this.registerButton.Click += this.loginButton_Click; - OAuthClient = new FacebookClient(PortalId, Mode); + this.OAuthClient = new FacebookClient(this.PortalId, this.Mode); - loginItem.Visible = (Mode == AuthMode.Login); - registerItem.Visible = (Mode == AuthMode.Register); + this.loginItem.Visible = (this.Mode == AuthMode.Login); + this.registerItem.Visible = (this.Mode == AuthMode.Register); } protected override void AddCustomProperties(NameValueCollection properties) { base.AddCustomProperties(properties); - var facebookUserData = OAuthClient.GetCurrentUser(); + var facebookUserData = this.OAuthClient.GetCurrentUser(); if (facebookUserData.Link != null) { properties.Add("Facebook", facebookUserData.Link.ToString()); } @@ -58,7 +58,7 @@ protected override void AddCustomProperties(NameValueCollection properties) private void loginButton_Click(object sender, EventArgs e) { - AuthorisationResult result = OAuthClient.Authorize(); + AuthorisationResult result = this.OAuthClient.Authorize(); if (result == AuthorisationResult.Denied) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PrivateConfirmationMessage", Localization.SharedResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/packages.config b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Facebook/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleClient.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleClient.cs index 25ea0dbecee..3d47bfcd122 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleClient.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleClient.cs @@ -23,18 +23,18 @@ public class GoogleClient : OAuthClientBase public GoogleClient(int portalId, AuthMode mode) : base(portalId, mode, "Google") { - TokenEndpoint = new Uri("https://accounts.google.com/o/oauth2/token"); - TokenMethod = HttpMethod.POST; - AuthorizationEndpoint = new Uri("https://accounts.google.com/o/oauth2/auth"); - MeGraphEndpoint = new Uri("https://www.googleapis.com/oauth2/v1/userinfo"); + this.TokenEndpoint = new Uri("https://accounts.google.com/o/oauth2/token"); + this.TokenMethod = HttpMethod.POST; + this.AuthorizationEndpoint = new Uri("https://accounts.google.com/o/oauth2/auth"); + this.MeGraphEndpoint = new Uri("https://www.googleapis.com/oauth2/v1/userinfo"); - Scope = HttpUtility.UrlEncode("https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"); + this.Scope = HttpUtility.UrlEncode("https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email"); - AuthTokenName = "GoogleUserToken"; + this.AuthTokenName = "GoogleUserToken"; - OAuthVersion = "2.0"; + this.OAuthVersion = "2.0"; - LoadTokenCookie(String.Empty); + this.LoadTokenCookie(String.Empty); } #endregion diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleUserData.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleUserData.cs index 68f8073c942..015ed1c6fa5 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleUserData.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Components/GoogleUserData.cs @@ -19,19 +19,19 @@ public class GoogleUserData : UserData public override string FirstName { - get { return GivenName; } + get { return this.GivenName; } set { } } public override string LastName { - get { return FamilyName; } + get { return this.FamilyName; } set { } } public override string ProfileImage { - get { return Picture; } + get { return this.Picture; } set { } } diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/DotNetNuke.Authentication.Google.csproj b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/DotNetNuke.Authentication.Google.csproj index 92348724b98..1d30862b058 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/DotNetNuke.Authentication.Google.csproj +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/DotNetNuke.Authentication.Google.csproj @@ -1,143 +1,152 @@ - - - - - Debug - AnyCPU - - - 2.0 - {0304B44C-EA08-434E-A368-65F619FC67A5} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - DotNetNuke.Authentication.Google - DotNetNuke.Authentication.Google - v4.7.2 - false - - - - 4.0 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\DotNetNuke.Authentication.Google.XML - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\DotNetNuke.Authentication.Google.XML - 1591 - 7 - - - - - - - - - - - - - - - - - - - - SolutionInfo.cs - - - - - Login.ascx - ASPXCodeBehind - - - Login.ascx - - - - Settings.ascx - ASPXCodeBehind - - - Settings.ascx - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - False - - - - - Designer - - - - - - - - - - - Designer - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 26658 - / - - - False - True - http://localhost/DNN_Platform - False - - - - - + + + + + Debug + AnyCPU + + + 2.0 + {0304B44C-EA08-434E-A368-65F619FC67A5} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + DotNetNuke.Authentication.Google + DotNetNuke.Authentication.Google + v4.7.2 + false + + + + 4.0 + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + bin\DotNetNuke.Authentication.Google.XML + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\DotNetNuke.Authentication.Google.XML + 1591 + 7 + + + + + + + + + + + + + + + + + + + + SolutionInfo.cs + + + + + Login.ascx + ASPXCodeBehind + + + Login.ascx + + + + Settings.ascx + ASPXCodeBehind + + + Settings.ascx + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + False + + + + + Designer + + + + + + + + + + + Designer + + + + + stylecop.json + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 26658 + / + + + False + True + http://localhost/DNN_Platform + False + + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Login.ascx.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Login.ascx.cs index 61c96223dec..bcdf7af75be 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Login.ascx.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/Login.ascx.cs @@ -30,25 +30,25 @@ public override bool SupportsRegistration protected override UserData GetCurrentUser() { - return OAuthClient.GetCurrentUser(); + return this.OAuthClient.GetCurrentUser(); } protected override void OnInit(EventArgs e) { base.OnInit(e); - loginButton.Click += loginButton_Click; - registerButton.Click += loginButton_Click; + this.loginButton.Click += this.loginButton_Click; + this.registerButton.Click += this.loginButton_Click; - OAuthClient = new GoogleClient(PortalId, Mode); + this.OAuthClient = new GoogleClient(this.PortalId, this.Mode); - loginItem.Visible = (Mode == AuthMode.Login); - registerItem.Visible = (Mode == AuthMode.Register); + this.loginItem.Visible = (this.Mode == AuthMode.Login); + this.registerItem.Visible = (this.Mode == AuthMode.Register); } private void loginButton_Click(object sender, EventArgs e) { - AuthorisationResult result = OAuthClient.Authorize(); + AuthorisationResult result = this.OAuthClient.Authorize(); if (result == AuthorisationResult.Denied) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PrivateConfirmationMessage", Localization.SharedResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/packages.config b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Google/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveClient.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveClient.cs index df48d7202c7..709210aa866 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveClient.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveClient.cs @@ -24,18 +24,18 @@ public LiveClient(int portalId, AuthMode mode) : base(portalId, mode, "Live") { //DNN-6464 Correct TokenEndpoint and AuthorizationEndpoint Urls // Add TokenMethod of Post to conform to other OAuth extensions - TokenMethod = HttpMethod.POST; - TokenEndpoint = new Uri("https://login.live.com/oauth20_token.srf"); - AuthorizationEndpoint = new Uri("https://login.live.com/oauth20_authorize.srf"); - MeGraphEndpoint = new Uri("https://apis.live.net/v5.0/me"); + this.TokenMethod = HttpMethod.POST; + this.TokenEndpoint = new Uri("https://login.live.com/oauth20_token.srf"); + this.AuthorizationEndpoint = new Uri("https://login.live.com/oauth20_authorize.srf"); + this.MeGraphEndpoint = new Uri("https://apis.live.net/v5.0/me"); - Scope = HttpContext.Current.Server.UrlEncode("wl.signin wl.basic wl.emails"); + this.Scope = HttpContext.Current.Server.UrlEncode("wl.signin wl.basic wl.emails"); - AuthTokenName = "LiveUserToken"; + this.AuthTokenName = "LiveUserToken"; - OAuthVersion = "2.0"; + this.OAuthVersion = "2.0"; - LoadTokenCookie(String.Empty); + this.LoadTokenCookie(String.Empty); } #endregion diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveUserData.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveUserData.cs index 9d31873140b..3ce0d676bcd 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveUserData.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Components/LiveUserData.cs @@ -21,13 +21,13 @@ public class LiveUserData : UserData public override string FirstName { - get { return LiveFirstName; } + get { return this.LiveFirstName; } set { } } public override string LastName { - get { return LiveLastName; } + get { return this.LiveLastName; } set { } } diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/DotNetNuke.Authentication.LiveConnect.csproj b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/DotNetNuke.Authentication.LiveConnect.csproj index 1559e6ddb18..e81c69ab859 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/DotNetNuke.Authentication.LiveConnect.csproj +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/DotNetNuke.Authentication.LiveConnect.csproj @@ -1,141 +1,150 @@ - - - - - Debug - AnyCPU - - - 2.0 - {46924A38-CAB7-485D-9301-191E35F6255F} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - DotNetNuke.Authentication.LiveConnect - DotNetNuke.Authentication.LiveConnect - v4.7.2 - false - - - - 4.0 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - 1591 - bin\DotNetNuke.Authentication.LiveConnect.XML - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - 1591 - bin\DotNetNuke.Authentication.LiveConnect.XML - 7 - - - - - - - - - - - - - - - - - - SolutionInfo.cs - - - - - Login.ascx - ASPXCodeBehind - - - Login.ascx - - - - Settings.ascx - ASPXCodeBehind - - - Settings.ascx - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - False - - - - - Designer - - - - - - - - - - - Designer - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 28864 - / - - - False - True - http://localhost/DNN_Platform - False - - - - - + + + + + Debug + AnyCPU + + + 2.0 + {46924A38-CAB7-485D-9301-191E35F6255F} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + DotNetNuke.Authentication.LiveConnect + DotNetNuke.Authentication.LiveConnect + v4.7.2 + false + + + + 4.0 + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + 1591 + bin\DotNetNuke.Authentication.LiveConnect.XML + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + 1591 + bin\DotNetNuke.Authentication.LiveConnect.XML + 7 + + + + + + + + + + + + + + + + + + SolutionInfo.cs + + + + + Login.ascx + ASPXCodeBehind + + + Login.ascx + + + + Settings.ascx + ASPXCodeBehind + + + Settings.ascx + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + False + + + + + Designer + + + + + + + + + + + Designer + + + + + stylecop.json + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 28864 + / + + + False + True + http://localhost/DNN_Platform + False + + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Login.ascx.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Login.ascx.cs index 2b1103df6ce..7a61cd9a106 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Login.ascx.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/Login.ascx.cs @@ -30,25 +30,25 @@ public override bool SupportsRegistration protected override UserData GetCurrentUser() { - return OAuthClient.GetCurrentUser(); + return this.OAuthClient.GetCurrentUser(); } protected override void OnInit(EventArgs e) { base.OnInit(e); - loginButton.Click += loginButton_Click; - registerButton.Click += loginButton_Click; + this.loginButton.Click += this.loginButton_Click; + this.registerButton.Click += this.loginButton_Click; - OAuthClient = new LiveClient(PortalId, Mode); + this.OAuthClient = new LiveClient(this.PortalId, this.Mode); - loginItem.Visible = (Mode == AuthMode.Login); - registerItem.Visible = (Mode == AuthMode.Register); + this.loginItem.Visible = (this.Mode == AuthMode.Login); + this.registerItem.Visible = (this.Mode == AuthMode.Register); } private void loginButton_Click(object sender, EventArgs e) { - AuthorisationResult result = OAuthClient.Authorize(); + AuthorisationResult result = this.OAuthClient.Authorize(); if (result == AuthorisationResult.Denied) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PrivateConfirmationMessage", Localization.SharedResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/packages.config b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.LiveConnect/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterClient.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterClient.cs index 0c62dfde70a..dd5a34cd3d8 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterClient.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterClient.cs @@ -18,17 +18,17 @@ public class TwitterClient : OAuthClientBase public TwitterClient(int portalId, AuthMode mode) : base(portalId, mode, "Twitter") { - AuthorizationEndpoint = new Uri("https://api.twitter.com/oauth/authorize"); - RequestTokenEndpoint = new Uri("https://api.twitter.com/oauth/request_token"); - RequestTokenMethod = HttpMethod.POST; - TokenEndpoint = new Uri("https://api.twitter.com/oauth/access_token"); - MeGraphEndpoint = new Uri("https://api.twitter.com/1.1/account/verify_credentials.json"); + this.AuthorizationEndpoint = new Uri("https://api.twitter.com/oauth/authorize"); + this.RequestTokenEndpoint = new Uri("https://api.twitter.com/oauth/request_token"); + this.RequestTokenMethod = HttpMethod.POST; + this.TokenEndpoint = new Uri("https://api.twitter.com/oauth/access_token"); + this.MeGraphEndpoint = new Uri("https://api.twitter.com/1.1/account/verify_credentials.json"); - AuthTokenName = "TwitterUserToken"; + this.AuthTokenName = "TwitterUserToken"; - OAuthVersion = "1.0"; + this.OAuthVersion = "1.0"; - LoadTokenCookie(String.Empty); + this.LoadTokenCookie(String.Empty); } } } diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterUserData.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterUserData.cs index 1746398a53f..93e68111b12 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterUserData.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Components/TwitterUserData.cs @@ -19,25 +19,25 @@ public class TwitterUserData : UserData public override string DisplayName { - get { return ScreenName; } + get { return this.ScreenName; } set { } } public override string Locale { - get { return LanguageCode; } + get { return this.LanguageCode; } set { } } public override string ProfileImage { - get { return ProfileImageUrl; } + get { return this.ProfileImageUrl; } set { } } public override string Website { - get { return Url; } + get { return this.Url; } set { } } diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/DotNetNuke.Authentication.Twitter.csproj b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/DotNetNuke.Authentication.Twitter.csproj index fe16fc2d30e..0aaed56b295 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/DotNetNuke.Authentication.Twitter.csproj +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/DotNetNuke.Authentication.Twitter.csproj @@ -1,144 +1,153 @@ - - - - - Debug - AnyCPU - - - 2.0 - {1C882AA9-2198-41EF-B325-605340FDEFE5} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - DotNetNuke.Authentication.Twitter - DotNetNuke.Authentication.Twitter - v4.7.2 - false - - - - 4.0 - - - - - - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - bin\DotNetNuke.Authentication.Twitter.XML - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - 1591 - bin\DotNetNuke.Authentication.Twitter.XML - 7 - - - - - - - - - - - - - - - - - - - SolutionInfo.cs - - - - Login.ascx - ASPXCodeBehind - - - Login.ascx - - - - - Settings.ascx - ASPXCodeBehind - - - Settings.ascx - - - - - - - - - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - False - - - - - - - - - Designer - - - - - Designer - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 26668 - / - - - False - True - http://localhost/DNN_Platform - False - - - - - + + + + + Debug + AnyCPU + + + 2.0 + {1C882AA9-2198-41EF-B325-605340FDEFE5} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + DotNetNuke.Authentication.Twitter + DotNetNuke.Authentication.Twitter + v4.7.2 + false + + + + 4.0 + + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + bin\DotNetNuke.Authentication.Twitter.XML + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + 1591 + bin\DotNetNuke.Authentication.Twitter.XML + 7 + + + + + + + + + + + + + + + + + + + SolutionInfo.cs + + + + Login.ascx + ASPXCodeBehind + + + Login.ascx + + + + + Settings.ascx + ASPXCodeBehind + + + Settings.ascx + + + + + + + + + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + False + + + + + + stylecop.json + + + + + + + Designer + + + + + Designer + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 26668 + / + + + False + True + http://localhost/DNN_Platform + False + + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Login.ascx.cs b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Login.ascx.cs index 0de6da3030b..e9fbf420728 100644 --- a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Login.ascx.cs +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/Login.ascx.cs @@ -30,33 +30,33 @@ public override bool SupportsRegistration protected override UserData GetCurrentUser() { - return OAuthClient.GetCurrentUser(); + return this.OAuthClient.GetCurrentUser(); } protected override void AddCustomProperties(System.Collections.Specialized.NameValueCollection properties) { base.AddCustomProperties(properties); - properties.Add("Twitter", string.Format("http://twitter.com/{0}", OAuthClient.GetCurrentUser().ScreenName)); + properties.Add("Twitter", string.Format("http://twitter.com/{0}", this.OAuthClient.GetCurrentUser().ScreenName)); } protected override void OnInit(EventArgs e) { base.OnInit(e); - loginButton.Click += loginButton_Click; - registerButton.Click += loginButton_Click; + this.loginButton.Click += this.loginButton_Click; + this.registerButton.Click += this.loginButton_Click; - OAuthClient = new TwitterClient(PortalId, Mode); + this.OAuthClient = new TwitterClient(this.PortalId, this.Mode); - loginItem.Visible = (Mode == AuthMode.Login); - registerItem.Visible = (Mode == AuthMode.Register); + this.loginItem.Visible = (this.Mode == AuthMode.Login); + this.registerItem.Visible = (this.Mode == AuthMode.Register); } private void loginButton_Click(object sender, EventArgs e) { - OAuthClient.CallbackUri = new Uri(OAuthClient.CallbackUri + "?state=Twitter"); - AuthorisationResult result = OAuthClient.Authorize(); + this.OAuthClient.CallbackUri = new Uri(this.OAuthClient.CallbackUri + "?state=Twitter"); + AuthorisationResult result = this.OAuthClient.Authorize(); if (result == AuthorisationResult.Denied) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PrivateConfirmationMessage", Localization.SharedResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); diff --git a/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/packages.config b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/AuthenticationProviders/DotNetNuke.Authentication.Twitter/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.csproj b/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.csproj index 6040eba8cef..53a175a79f8 100644 --- a/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.csproj +++ b/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.csproj @@ -1,76 +1,84 @@ - - - - Debug - AnyCPU - {2C25580C-A971-4F0B-9F70-436A35C2473E} - Library - Properties - DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider - DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider - v4.7.2 - 512 - true - - - true - full - false - bin\Providers - DEBUG;TRACE - prompt - 4 - bin\Providers\DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.xml - 1591,0618 - 7 - - - pdbonly - true - bin\Providers - TRACE - prompt - 4 - bin\Providers\DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.xml - 1591,0618 - 7 - - - - - - - - - - - - - - - - - - - - Properties\SolutionInfo.cs - - - - - - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - + + + + Debug + AnyCPU + {2C25580C-A971-4F0B-9F70-436A35C2473E} + Library + Properties + DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider + DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider + v4.7.2 + 512 + true + + + true + full + false + bin\Providers + DEBUG;TRACE + prompt + 4 + bin\Providers\DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.xml + 1591,0618 + 7 + + + pdbonly + true + bin\Providers + TRACE + prompt + 4 + bin\Providers\DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider.xml + 1591,0618 + 7 + + + + + + + + + + + + + + + + + + + + Properties\SolutionInfo.cs + + + stylecop.json + + + + + + + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/SimpleWebFarmCachingProvider.cs b/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/SimpleWebFarmCachingProvider.cs index 96cb2824236..0767788192f 100644 --- a/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/SimpleWebFarmCachingProvider.cs +++ b/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/SimpleWebFarmCachingProvider.cs @@ -63,11 +63,11 @@ private void NotifyOtherServers(string command, string detail) notificationRequest.UseDefaultCredentials = true; // Start the asynchronous request - var result = (notificationRequest.BeginGetResponse(OnServerNotificationCompleteCallback, notificationRequest)); + var result = (notificationRequest.BeginGetResponse(this.OnServerNotificationCompleteCallback, notificationRequest)); //Register timeout // TODO: Review possible use of async/await C# 7 implementation - ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle, HandleNotificationTimeout, notificationRequest, executionTimeout, true); + ThreadPool.RegisterWaitForSingleObject(result.AsyncWaitHandle, HandleNotificationTimeout, notificationRequest, this.executionTimeout, true); } } @@ -126,7 +126,7 @@ internal void ProcessSynchronizationRequest(string command, string detail) //Handle basic removal if (command.StartsWith("remove", StringComparison.OrdinalIgnoreCase)) { - RemoveInternal(detail); + this.RemoveInternal(detail); return; } @@ -134,7 +134,7 @@ internal void ProcessSynchronizationRequest(string command, string detail) if (command.StartsWith("clear~", StringComparison.InvariantCultureIgnoreCase)) { var commandParts = command.Split('~'); - ClearCacheInternal(commandParts[1], detail, true); + this.ClearCacheInternal(commandParts[1], detail, true); } } #endregion @@ -144,27 +144,27 @@ internal void ProcessSynchronizationRequest(string command, string detail) public override void Clear(string type, string data) { //Clear the local cache - ClearCacheInternal(type, data, true); + this.ClearCacheInternal(type, data, true); //Per API implementation standards only notify others if expiration has not been desabled if (CacheExpirationDisable) return; //Notify other servers - NotifyOtherServers("Clear~" + type, data); + this.NotifyOtherServers("Clear~" + type, data); } public override void Remove(string key) { //Remove from local cache - RemoveInternal(key); + this.RemoveInternal(key); //Per API implementation standards only notify others if expiration has not been disabled if (CacheExpirationDisable) return; //Notify Other Servers - NotifyOtherServers("Remove", key); + this.NotifyOtherServers("Remove", key); } #endregion diff --git a/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/packages.config b/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/CachingProviders/DotNetNuke.Providers.Caching.SimpleWebFarmCachingProvider/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/AspNetClientCapability.cs b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/AspNetClientCapability.cs index fbde78982fa..e03b06ecb2c 100644 --- a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/AspNetClientCapability.cs +++ b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/AspNetClientCapability.cs @@ -26,12 +26,12 @@ public override string this[string name] { get { - if (_properties != null && _properties.ContainsKey(name)) + if (this._properties != null && this._properties.ContainsKey(name)) { - return _properties[name]; + return this._properties[name]; } - return (Capabilities != null && Capabilities.ContainsKey(name)) ? Capabilities[name] : string.Empty; + return (this.Capabilities != null && this.Capabilities.ContainsKey(name)) ? this.Capabilities[name] : string.Empty; } } @@ -42,39 +42,39 @@ public override string this[string name] /// public AspNetClientCapability(string userAgent, HttpCapabilitiesBase browserCaps) { - UserAgent = userAgent; + this.UserAgent = userAgent; if (browserCaps != null) { - ID = browserCaps.Id; - ScreenResolutionWidthInPixels = browserCaps.ScreenPixelsWidth; - ScreenResolutionHeightInPixels = browserCaps.ScreenPixelsHeight; - IsTouchScreen = false; - BrowserName = browserCaps.Browser; + this.ID = browserCaps.Id; + this.ScreenResolutionWidthInPixels = browserCaps.ScreenPixelsWidth; + this.ScreenResolutionHeightInPixels = browserCaps.ScreenPixelsHeight; + this.IsTouchScreen = false; + this.BrowserName = browserCaps.Browser; if(browserCaps.Capabilities != null) { - Capabilities = browserCaps.Capabilities.Cast() + this.Capabilities = browserCaps.Capabilities.Cast() .ToDictionary(kvp => Convert.ToString(kvp.Key), kvp => Convert.ToString(kvp.Value)); } else { - Capabilities = new Dictionary(); + this.Capabilities = new Dictionary(); } - SupportsFlash = false; - HtmlPreferedDTD = null; + this.SupportsFlash = false; + this.HtmlPreferedDTD = null; - if (UserAgent.Length < 4) + if (this.UserAgent.Length < 4) { return; } - var lowerAgent = UserAgent.ToLowerInvariant(); - IsMobile = browserCaps.IsMobileDevice || GetIfMobile(lowerAgent); - IsTablet = GetIfTablet(lowerAgent); + var lowerAgent = this.UserAgent.ToLowerInvariant(); + this.IsMobile = browserCaps.IsMobileDevice || GetIfMobile(lowerAgent); + this.IsTablet = GetIfTablet(lowerAgent); try { - DetectOperatingSystem(lowerAgent, Capabilities); + DetectOperatingSystem(lowerAgent, this.Capabilities); } catch (Exception ex) { @@ -96,27 +96,27 @@ public AspNetClientCapability(HttpRequest request) : this(request.UserAgent ?? " /// public AspNetClientCapability(IDictionary properties) { - _properties = properties; + this._properties = properties; - if (_properties != null) + if (this._properties != null) { // Set Lite properties - ID = GetStringValue(_properties, "Id"); - IsMobile = GetBoolValue(_properties, "IsMobile"); - ScreenResolutionWidthInPixels = GetIntValue(_properties, "ScreenPixelsWidth"); - ScreenResolutionHeightInPixels = GetIntValue(_properties, "ScreenPixelsHeight"); + this.ID = GetStringValue(this._properties, "Id"); + this.IsMobile = GetBoolValue(this._properties, "IsMobile"); + this.ScreenResolutionWidthInPixels = GetIntValue(this._properties, "ScreenPixelsWidth"); + this.ScreenResolutionHeightInPixels = GetIntValue(this._properties, "ScreenPixelsHeight"); // Set Premium properties - IsTablet = GetBoolValue(_properties, "IsTablet"); - IsTouchScreen = GetBoolValue(_properties, "HasTouchScreen"); - BrowserName = GetStringValue(_properties, "BrowserName"); - Capabilities = GetCapabilities(_properties); + this.IsTablet = GetBoolValue(this._properties, "IsTablet"); + this.IsTouchScreen = GetBoolValue(this._properties, "HasTouchScreen"); + this.BrowserName = GetStringValue(this._properties, "BrowserName"); + this.Capabilities = GetCapabilities(this._properties); - SupportsFlash = false; - HtmlPreferedDTD = null; + this.SupportsFlash = false; + this.HtmlPreferedDTD = null; //set IsMobile to false when IsTablet is true. - if (IsTablet) - IsMobile = false; + if (this.IsTablet) + this.IsMobile = false; } } diff --git a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/Components/FeatureController.cs b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/Components/FeatureController.cs index 7dc11e406af..f6b45bed9d8 100644 --- a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/Components/FeatureController.cs +++ b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/Components/FeatureController.cs @@ -55,7 +55,7 @@ public string UpgradeModule(string version) if (moduleTabs.Count > 0) return string.Empty; - RemoveWurflProvider(); + this.RemoveWurflProvider(); break; } @@ -71,7 +71,7 @@ private void RemoveWurflProvider() installer.UnInstall(true); } - UpdateRules(); + this.UpdateRules(); } private void UpdateRules() diff --git a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/DotNetNuke.Providers.AspNetCCP.csproj b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/DotNetNuke.Providers.AspNetCCP.csproj index e13a9cc5093..f4dd6a0c49d 100644 --- a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/DotNetNuke.Providers.AspNetCCP.csproj +++ b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/DotNetNuke.Providers.AspNetCCP.csproj @@ -1,133 +1,141 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A3B3F1E8-6C1A-4E35-A5B4-51ECC5A43AF7} - Library - DotNetNuke.Providers.AspNetClientCapabilityProvider - DotNetNuke.Providers.AspNetClientCapabilityProvider - v4.7.2 - - - - true - full - TRACE;DEBUG - bin\Providers\ - 4 - bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml - 1591,0618 - 7 - - - pdbonly - TRACE - true - bin\Providers\ - bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml - prompt - 1591,0618 - 7 - - - true - full - DEBUG;TRACE;CLOUD;CLOUD_DEBUG - bin\Providers\ - 4 - bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml - 1591,0618 - 7 - - - pdbonly - TRACE;CLOUD;CLOUD_RELEASE - true - bin\Providers\ - bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml - prompt - 1591,0618 - 7 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - Designer - - - - - - - - - - - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {A3B3F1E8-6C1A-4E35-A5B4-51ECC5A43AF7} + Library + DotNetNuke.Providers.AspNetClientCapabilityProvider + DotNetNuke.Providers.AspNetClientCapabilityProvider + v4.7.2 + + + + true + full + TRACE;DEBUG + bin\Providers\ + 4 + bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml + 1591,0618 + 7 + + + pdbonly + TRACE + true + bin\Providers\ + bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml + prompt + 1591,0618 + 7 + + + true + full + DEBUG;TRACE;CLOUD;CLOUD_DEBUG + bin\Providers\ + 4 + bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml + 1591,0618 + 7 + + + pdbonly + TRACE;CLOUD;CLOUD_RELEASE + true + bin\Providers\ + bin\Providers\DotNetNuke.Providers.AspNetClientCapabilityProvider.xml + prompt + 1591,0618 + 7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Properties\SolutionInfo.cs + + + + + + + + + + + stylecop.json + + + Designer + + + + + + + + + + + + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/packages.config b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/ClientCapabilityProviders/Provider.AspNetCCP/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureBlob.cs b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureBlob.cs index 617e291cb7c..29e69911ccc 100644 --- a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureBlob.cs +++ b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureBlob.cs @@ -22,18 +22,18 @@ public AzureBlob(CloudBlob blob) return; } - _relativePath = blob.RelativePath(); - _lastModifiedUtc = blob.Properties.LastModified.GetValueOrDefault(DateTimeOffset.MinValue).UtcDateTime; - _length = blob.Properties.Length; - _etag = blob.Properties.ETag; + this._relativePath = blob.RelativePath(); + this._lastModifiedUtc = blob.Properties.LastModified.GetValueOrDefault(DateTimeOffset.MinValue).UtcDateTime; + this._length = blob.Properties.Length; + this._etag = blob.Properties.ETag; } - public string RelativePath => _relativePath; + public string RelativePath => this._relativePath; - public DateTime LastModifiedUtc => _lastModifiedUtc; + public DateTime LastModifiedUtc => this._lastModifiedUtc; - public long Length => _length; + public long Length => this._length; - public string ETag => _etag; + public string ETag => this._etag; } } diff --git a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureFolderProvider.cs b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureFolderProvider.cs index 1ab7b0c7224..66a65782fa3 100644 --- a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureFolderProvider.cs +++ b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureFolderProvider.cs @@ -70,8 +70,8 @@ private CloudBlobContainer GetContainer(FolderMappingInfo folderMapping) CheckSettings(folderMapping); - var accountName = GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountName); - var accountKey = GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountKey); + var accountName = this.GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountName); + var accountKey = this.GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountKey); var container = GetSetting(folderMapping, Constants.Container); var useHttps = GetBooleanSetting(folderMapping, Constants.UseHttps); @@ -85,34 +85,34 @@ private CloudBlobContainer GetContainer(FolderMappingInfo folderMapping) protected override void CopyFileInternal(FolderMappingInfo folderMapping, string sourceUri, string newUri) { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var sourceBlob = container.GetBlobReference(sourceUri); var newBlob = container.GetBlobReference(newUri); newBlob.StartCopy(sourceBlob.Uri); - ClearCache(folderMapping.FolderMappingID); + this.ClearCache(folderMapping.FolderMappingID); } protected override void DeleteFileInternal(FolderMappingInfo folderMapping, string uri) { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var blob = container.GetBlobReference(uri); blob.DeleteIfExists(); - ClearCache(folderMapping.FolderMappingID); + this.ClearCache(folderMapping.FolderMappingID); } protected override void DeleteFolderInternal(FolderMappingInfo folderMapping, IFolderInfo folder) { - DeleteFileInternal(folderMapping, folder.MappedPath + Constants.PlaceHolderFileName); + this.DeleteFileInternal(folderMapping, folder.MappedPath + Constants.PlaceHolderFileName); } protected override Stream GetFileStreamInternal(FolderMappingInfo folderMapping, string uri) { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var blob = container.GetBlockBlobReference(uri); var memoryStream = new MemoryStream(); @@ -124,15 +124,15 @@ protected override Stream GetFileStreamInternal(FolderMappingInfo folderMapping, protected override IList GetObjectList(FolderMappingInfo folderMapping) { - var cacheKey = string.Format(ListObjectsCacheKey, folderMapping.FolderMappingID); + var cacheKey = string.Format(this.ListObjectsCacheKey, folderMapping.FolderMappingID); return CBO.GetCachedObject>(new CacheItemArgs(cacheKey, - ListObjectsCacheTimeout, + this.ListObjectsCacheTimeout, CacheItemPriority.Default, folderMapping.FolderMappingID), c => { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var synchBatchSize = GetIntegerSetting(folderMapping, Constants.SyncBatchSize, Constants.DefaultSyncBatchSize); BlobContinuationToken continuationToken = null; @@ -161,7 +161,7 @@ protected override IList GetObjectList(FolderMappingInfo fol protected override void MoveFileInternal(FolderMappingInfo folderMapping, string sourceUri, string newUri) { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var sourceBlob = container.GetBlobReference(sourceUri); var newBlob = container.GetBlobReference(newUri); @@ -169,12 +169,12 @@ protected override void MoveFileInternal(FolderMappingInfo folderMapping, string newBlob.StartCopy(sourceBlob.Uri); sourceBlob.Delete(); - ClearCache(folderMapping.FolderMappingID); + this.ClearCache(folderMapping.FolderMappingID); } protected override void MoveFolderInternal(FolderMappingInfo folderMapping, string sourceUri, string newUri) { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var directory = container.GetDirectoryReference(sourceUri); var blobs = directory.ListBlobs(true); @@ -186,12 +186,12 @@ protected override void MoveFolderInternal(FolderMappingInfo folderMapping, stri blob.Delete(); } - ClearCache(folderMapping.FolderMappingID); + this.ClearCache(folderMapping.FolderMappingID); } protected override void UpdateFileInternal(Stream stream, FolderMappingInfo folderMapping, string uri) { - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var blob = container.GetBlockBlobReference(uri); stream.Seek(0, SeekOrigin.Begin); @@ -201,7 +201,7 @@ protected override void UpdateFileInternal(Stream stream, FolderMappingInfo fold blob.Properties.ContentType = FileContentTypeManager.Instance.GetContentType(Path.GetExtension(uri)); blob.SetProperties(); - ClearCache(folderMapping.FolderMappingID); + this.ClearCache(folderMapping.FolderMappingID); } #region FolderProvider Methods @@ -215,7 +215,7 @@ public override void AddFolder(string folderPath, FolderMappingInfo folderMappin Requires.NotNull("folderPath", folderPath); Requires.NotNull("folderMapping", folderMapping); - UpdateFileInternal(new MemoryStream(), folderMapping, mappedPath + Constants.PlaceHolderFileName); + this.UpdateFileInternal(new MemoryStream(), folderMapping, mappedPath + Constants.PlaceHolderFileName); } /// @@ -233,10 +233,10 @@ public override string GetFileUrl(IFileInfo file) var folder = FolderManager.Instance.GetFolder(file.FolderId); var uri = folder.MappedPath + file.FileName; - var container = GetContainer(folderMapping); + var container = this.GetContainer(folderMapping); var blob = container.GetBlobReference(uri); var absuri = blob.Uri.AbsoluteUri; - var customDomain = GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.CustomDomain); + var customDomain = this.GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.CustomDomain); if (!string.IsNullOrEmpty(customDomain)) { @@ -305,8 +305,8 @@ public override string GetFolderProviderIconPath() public List GetAllContainers(FolderMappingInfo folderMapping) { List containers = new List(); - var accountName = GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountName); - var accountKey = GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountKey); + var accountName = this.GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountName); + var accountKey = this.GetEncryptedSetting(folderMapping.FolderMappingSettings, Constants.AccountKey); var useHttps = GetBooleanSetting(folderMapping, Constants.UseHttps); var sc = new StorageCredentials(accountName, accountKey); diff --git a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureRemoteStorageItem.cs b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureRemoteStorageItem.cs index b1cef23f93e..013db3afd33 100644 --- a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureRemoteStorageItem.cs +++ b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/AzureRemoteStorageItem.cs @@ -17,15 +17,15 @@ public string Key { get { - var path = Blob.RelativePath.Replace("+", "%2b"); + var path = this.Blob.RelativePath.Replace("+", "%2b"); return HttpUtility.UrlDecode(path); } } - public DateTime LastModified => Blob.LastModifiedUtc; + public DateTime LastModified => this.Blob.LastModifiedUtc; - public long Size => Blob.Length; + public long Size => this.Blob.Length; - public string HashCode => Blob.ETag; + public string HashCode => this.Blob.ETag; } } diff --git a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/Settings.ascx.cs b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/Settings.ascx.cs index e9e70041847..5e1dd3b2e04 100644 --- a/DNN Platform/Providers/FolderProviders/AzureFolderProvider/Settings.ascx.cs +++ b/DNN Platform/Providers/FolderProviders/AzureFolderProvider/Settings.ascx.cs @@ -33,15 +33,15 @@ public override void LoadSettings(Hashtable folderMappingSettings) var folderProvider = FolderProvider.Instance(Constants.FolderProviderType); if (folderMappingSettings.ContainsKey(Constants.AccountName)) { - tbAccountName.Text = folderProvider.GetEncryptedSetting(folderMappingSettings, Constants.AccountName); + this.tbAccountName.Text = folderProvider.GetEncryptedSetting(folderMappingSettings, Constants.AccountName); } if (folderMappingSettings.ContainsKey(Constants.AccountKey)) { - tbAccountKey.Text = folderProvider.GetEncryptedSetting(folderMappingSettings, Constants.AccountKey); + this.tbAccountKey.Text = folderProvider.GetEncryptedSetting(folderMappingSettings, Constants.AccountKey); } - if (tbAccountName.Text.Length > 0 && tbAccountKey.Text.Length > 0) + if (this.tbAccountName.Text.Length > 0 && this.tbAccountKey.Text.Length > 0) { var bucketName = ""; @@ -50,35 +50,35 @@ public override void LoadSettings(Hashtable folderMappingSettings) bucketName = folderMappingSettings[Constants.Container].ToString(); } - LoadContainers(); + this.LoadContainers(); - var bucket = ddlContainers.Items.FindByText(bucketName); + var bucket = this.ddlContainers.Items.FindByText(bucketName); if (bucket != null) { - ddlContainers.SelectedIndex = ddlContainers.Items.IndexOf(bucket); + this.ddlContainers.SelectedIndex = this.ddlContainers.Items.IndexOf(bucket); } } if (folderMappingSettings.ContainsKey(Constants.UseHttps)) { - chkUseHttps.Checked = bool.Parse(folderMappingSettings[Constants.UseHttps].ToString()); + this.chkUseHttps.Checked = bool.Parse(folderMappingSettings[Constants.UseHttps].ToString()); } - chkDirectLink.Checked = !folderMappingSettings.ContainsKey(Constants.DirectLink) || folderMappingSettings[Constants.DirectLink].ToString().ToLowerInvariant() == "true"; + this.chkDirectLink.Checked = !folderMappingSettings.ContainsKey(Constants.DirectLink) || folderMappingSettings[Constants.DirectLink].ToString().ToLowerInvariant() == "true"; if (folderMappingSettings.ContainsKey(Constants.CustomDomain)) { - tbCustomDomain.Text = folderProvider.GetEncryptedSetting(folderMappingSettings, Constants.CustomDomain); + this.tbCustomDomain.Text = folderProvider.GetEncryptedSetting(folderMappingSettings, Constants.CustomDomain); } if (folderMappingSettings.ContainsKey(Constants.SyncBatchSize) && folderMappingSettings[Constants.SyncBatchSize] != null) { - tbSyncBatchSize.Text = folderMappingSettings[Constants.SyncBatchSize].ToString(); + this.tbSyncBatchSize.Text = folderMappingSettings[Constants.SyncBatchSize].ToString(); } else { - tbSyncBatchSize.Text = Constants.DefaultSyncBatchSize.ToString(); + this.tbSyncBatchSize.Text = Constants.DefaultSyncBatchSize.ToString(); } } @@ -88,9 +88,9 @@ public override void LoadSettings(Hashtable folderMappingSettings) /// The folder mapping identifier. public override void UpdateSettings(int folderMappingID) { - Page.Validate(); + this.Page.Validate(); - if (!Page.IsValid) + if (!this.Page.IsValid) { throw new Exception(); } @@ -98,17 +98,17 @@ public override void UpdateSettings(int folderMappingID) var folderMappingController = FolderMappingController.Instance; var folderMapping = folderMappingController.GetFolderMapping(folderMappingID); - var accountName = GetAccountName(); - var accountKey = GetAccountKey(); - var container = GetContainer(); - var useHttps = GetUseHttps(); - var customDomain = GetCustomDomain(); - var synchBatchSize = GetSynchBatchSize(); + var accountName = this.GetAccountName(); + var accountKey = this.GetAccountKey(); + var container = this.GetContainer(); + var useHttps = this.GetUseHttps(); + var customDomain = this.GetCustomDomain(); + var synchBatchSize = this.GetSynchBatchSize(); if (AreThereFolderMappingsWithSameSettings(folderMapping, accountName, container)) { - valContainerName.ErrorMessage = Localization.GetString("MultipleFolderMappingsWithSameSettings.ErrorMessage", LocalResourceFile); - valContainerName.IsValid = false; + this.valContainerName.ErrorMessage = Localization.GetString("MultipleFolderMappingsWithSameSettings.ErrorMessage", this.LocalResourceFile); + this.valContainerName.IsValid = false; throw new Exception(); } @@ -117,7 +117,7 @@ public override void UpdateSettings(int folderMappingID) folderMapping.FolderMappingSettings[Constants.AccountKey] = accountKey; folderMapping.FolderMappingSettings[Constants.Container] = container; folderMapping.FolderMappingSettings[Constants.UseHttps] = useHttps; - folderMapping.FolderMappingSettings[Constants.DirectLink] = chkDirectLink.Checked; + folderMapping.FolderMappingSettings[Constants.DirectLink] = this.chkDirectLink.Checked; folderMapping.FolderMappingSettings[Constants.CustomDomain] = customDomain; folderMapping.FolderMappingSettings[Constants.SyncBatchSize] = synchBatchSize; @@ -141,21 +141,21 @@ private static bool AreThereFolderMappingsWithSameSettings(FolderMappingInfo fol private string GetUseHttps() { - return chkUseHttps.Checked.ToString(); + return this.chkUseHttps.Checked.ToString(); } private string GetContainer() { string container; - if (SelectContainerPanel.Visible) + if (this.SelectContainerPanel.Visible) { - container = ddlContainers.SelectedValue; + container = this.ddlContainers.SelectedValue; } else { - container = tbContainerName.Text.Trim().ToLowerInvariant(); - if (!CreateContainer(container)) throw new Exception(); + container = this.tbContainerName.Text.Trim().ToLowerInvariant(); + if (!this.CreateContainer(container)) throw new Exception(); } return container; @@ -163,9 +163,9 @@ private string GetContainer() private bool CreateContainer(string containerName) { - var accountName = tbAccountName.Text.Trim(); - var accountKey = tbAccountKey.Text.Trim(); - var useHttps = chkUseHttps.Checked; + var accountName = this.tbAccountName.Text.Trim(); + var accountKey = this.tbAccountKey.Text.Trim(); + var useHttps = this.chkUseHttps.Checked; StorageCredentials sc; @@ -177,8 +177,8 @@ private bool CreateContainer(string containerName) { Logger.Error(ex); - valContainerName.ErrorMessage = Localization.GetString("AuthenticationFailure.ErrorMessage", LocalResourceFile); - valContainerName.IsValid = false; + this.valContainerName.ErrorMessage = Localization.GetString("AuthenticationFailure.ErrorMessage", this.LocalResourceFile); + this.valContainerName.IsValid = false; return false; } @@ -205,66 +205,66 @@ private bool CreateContainer(string containerName) switch (ex.RequestInformation.ExtendedErrorInformation.ErrorCode) { case "AccountNotFound": - valContainerName.ErrorMessage = Localization.GetString("AccountNotFound.ErrorMessage", - LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("AccountNotFound.ErrorMessage", + this.LocalResourceFile); break; case "AuthenticationFailure": - valContainerName.ErrorMessage = Localization.GetString( - "AuthenticationFailure.ErrorMessage", LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString( + "AuthenticationFailure.ErrorMessage", this.LocalResourceFile); break; case "AccessDenied": - valContainerName.ErrorMessage = Localization.GetString("AccessDenied.ErrorMessage", - LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("AccessDenied.ErrorMessage", + this.LocalResourceFile); break; case "ContainerAlreadyExists": return true; default: Logger.Error(ex); - valContainerName.ErrorMessage = Localization.GetString("NewContainer.ErrorMessage", - LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("NewContainer.ErrorMessage", + this.LocalResourceFile); break; } } else { - valContainerName.ErrorMessage = ex.RequestInformation.HttpStatusMessage ?? ex.Message; + this.valContainerName.ErrorMessage = ex.RequestInformation.HttpStatusMessage ?? ex.Message; } } catch (Exception ex) { Logger.Error(ex); - valContainerName.ErrorMessage = Localization.GetString("NewContainer.ErrorMessage", LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("NewContainer.ErrorMessage", this.LocalResourceFile); } - valContainerName.IsValid = false; + this.valContainerName.IsValid = false; return false; } private string GetAccountKey() { - return FolderProvider.Instance(Constants.FolderProviderType).EncryptValue(tbAccountKey.Text); + return FolderProvider.Instance(Constants.FolderProviderType).EncryptValue(this.tbAccountKey.Text); } private string GetAccountName() { - return FolderProvider.Instance(Constants.FolderProviderType).EncryptValue(tbAccountName.Text); + return FolderProvider.Instance(Constants.FolderProviderType).EncryptValue(this.tbAccountName.Text); } private string GetCustomDomain() { - return FolderProvider.Instance(Constants.FolderProviderType).EncryptValue(tbCustomDomain.Text); + return FolderProvider.Instance(Constants.FolderProviderType).EncryptValue(this.tbCustomDomain.Text); } private string GetSynchBatchSize() { - return tbSyncBatchSize.Text; + return this.tbSyncBatchSize.Text; } private void LoadContainers() { - var accountName = tbAccountName.Text.Trim(); - var accountKey = tbAccountKey.Text.Trim(); - var useHttps = chkUseHttps.Checked; + var accountName = this.tbAccountName.Text.Trim(); + var accountKey = this.tbAccountKey.Text.Trim(); + var useHttps = this.chkUseHttps.Checked; StorageCredentials sc; @@ -276,8 +276,8 @@ private void LoadContainers() { Logger.Error(ex); - valContainerName.ErrorMessage = Localization.GetString("AuthenticationFailure.ErrorMessage", LocalResourceFile); - valContainerName.IsValid = false; + this.valContainerName.ErrorMessage = Localization.GetString("AuthenticationFailure.ErrorMessage", this.LocalResourceFile); + this.valContainerName.IsValid = false; return; } @@ -289,7 +289,7 @@ private void LoadContainers() { foreach (var container in blobClient.ListContainers()) { - ddlContainers.Items.Add(container.Name); + this.ddlContainers.Items.Add(container.Name); } } catch (StorageException ex) @@ -299,26 +299,26 @@ private void LoadContainers() switch (ex.RequestInformation.ExtendedErrorInformation.ErrorCode) { case "AuthenticationFailure": - valContainerName.ErrorMessage = Localization.GetString("AuthenticationFailure.ErrorMessage", LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("AuthenticationFailure.ErrorMessage", this.LocalResourceFile); break; default: Logger.Error(ex); - valContainerName.ErrorMessage = Localization.GetString("ListContainers.ErrorMessage", LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("ListContainers.ErrorMessage", this.LocalResourceFile); break; } } else { - valContainerName.ErrorMessage = ex.RequestInformation.HttpStatusMessage ?? ex.Message; + this.valContainerName.ErrorMessage = ex.RequestInformation.HttpStatusMessage ?? ex.Message; } - valContainerName.IsValid = false; + this.valContainerName.IsValid = false; } catch (Exception ex) { Logger.Error(ex); - valContainerName.ErrorMessage = Localization.GetString("ListContainers.ErrorMessage", LocalResourceFile); - valContainerName.IsValid = false; + this.valContainerName.ErrorMessage = Localization.GetString("ListContainers.ErrorMessage", this.LocalResourceFile); + this.valContainerName.IsValid = false; } } @@ -330,27 +330,27 @@ private void LoadContainers() /// protected void ddlContainers_SelectedIndexChanged(object sender, EventArgs e) { - if (ddlContainers.SelectedIndex != 1) return; + if (this.ddlContainers.SelectedIndex != 1) return; - if (tbAccountName.Text.Trim().Length > 0 && tbAccountKey.Text.Trim().Length > 0) + if (this.tbAccountName.Text.Trim().Length > 0 && this.tbAccountKey.Text.Trim().Length > 0) { - ddlContainers.Items.Clear(); + this.ddlContainers.Items.Clear(); - ddlContainers.Items.Add(Localization.GetString("SelectContainer", LocalResourceFile)); - ddlContainers.Items.Add(Localization.GetString("RefreshContainerList", LocalResourceFile)); + this.ddlContainers.Items.Add(Localization.GetString("SelectContainer", this.LocalResourceFile)); + this.ddlContainers.Items.Add(Localization.GetString("RefreshContainerList", this.LocalResourceFile)); - LoadContainers(); + this.LoadContainers(); - if (ddlContainers.Items.Count == 3) + if (this.ddlContainers.Items.Count == 3) { // If there is only one container, then select it - ddlContainers.SelectedValue = ddlContainers.Items[2].Value; + this.ddlContainers.SelectedValue = this.ddlContainers.Items[2].Value; } } else { - valContainerName.ErrorMessage = Localization.GetString("CredentialsRequired.ErrorMessage", LocalResourceFile); - valContainerName.IsValid = false; + this.valContainerName.ErrorMessage = Localization.GetString("CredentialsRequired.ErrorMessage", this.LocalResourceFile); + this.valContainerName.IsValid = false; } } @@ -358,25 +358,25 @@ protected void ddlContainers_SelectedIndexChanged(object sender, EventArgs e) /// protected void btnNewContainer_Click(object sender, EventArgs e) { - SelectContainerPanel.Visible = false; - CreateContainerPanel.Visible = true; + this.SelectContainerPanel.Visible = false; + this.CreateContainerPanel.Visible = true; } /// /// protected void btnSelectExistingContainer_Click(object sender, EventArgs e) { - SelectContainerPanel.Visible = true; - CreateContainerPanel.Visible = false; + this.SelectContainerPanel.Visible = true; + this.CreateContainerPanel.Visible = false; } /// /// protected void valContainerName_ServerValidate(object source, ServerValidateEventArgs args) { - if (SelectContainerPanel.Visible) + if (this.SelectContainerPanel.Visible) { - if (ddlContainers.SelectedIndex > 1) + if (this.ddlContainers.SelectedIndex > 1) { args.IsValid = true; return; @@ -384,14 +384,14 @@ protected void valContainerName_ServerValidate(object source, ServerValidateEven } else { - if (tbContainerName.Text.Trim().Length > 0) + if (this.tbContainerName.Text.Trim().Length > 0) { args.IsValid = true; return; } } - valContainerName.ErrorMessage = Localization.GetString("valContainerName.ErrorMessage", LocalResourceFile); + this.valContainerName.ErrorMessage = Localization.GetString("valContainerName.ErrorMessage", this.LocalResourceFile); args.IsValid = false; } diff --git a/DNN Platform/Providers/FolderProviders/Components/BaseRemoteStorageProvider.cs b/DNN Platform/Providers/FolderProviders/Components/BaseRemoteStorageProvider.cs index 2b77bed3506..aa67b2d8f76 100644 --- a/DNN Platform/Providers/FolderProviders/Components/BaseRemoteStorageProvider.cs +++ b/DNN Platform/Providers/FolderProviders/Components/BaseRemoteStorageProvider.cs @@ -29,15 +29,15 @@ public abstract class BaseRemoteStorageProvider : FolderProvider private IRemoteStorageItem GetStorageItemInternal(FolderMappingInfo folderMapping, string key) { - var cacheKey = string.Format(ObjectCacheKey, folderMapping.FolderMappingID, key); + var cacheKey = string.Format(this.ObjectCacheKey, folderMapping.FolderMappingID, key); return CBO.GetCachedObject(new CacheItemArgs(cacheKey, - ObjectCacheTimeout, + this.ObjectCacheTimeout, CacheItemPriority.Default, folderMapping.FolderMappingID), c => { - var list = GetObjectList(folderMapping, key); + var list = this.GetObjectList(folderMapping, key); //return list.FirstOrDefault(i => i.Key == key); return list.FirstOrDefault(i => i.Key.Equals(key, StringComparison.InvariantCultureIgnoreCase)); @@ -120,7 +120,7 @@ protected static int GetIntegerSetting(FolderMappingInfo folderMapping, string s protected virtual IList GetObjectList(FolderMappingInfo folderMapping, string path) { - return GetObjectList(folderMapping); + return this.GetObjectList(folderMapping); } protected static string GetSetting(FolderMappingInfo folderMapping, string settingName) @@ -139,7 +139,7 @@ protected static string GetSetting(FolderMappingInfo folderMapping, string setti protected virtual IRemoteStorageItem GetStorageItem(FolderMappingInfo folderMapping, string key) { - return GetStorageItemInternal(folderMapping, key); + return this.GetStorageItemInternal(folderMapping, key); } #endregion @@ -148,7 +148,7 @@ protected virtual IRemoteStorageItem GetStorageItem(FolderMappingInfo folderMapp /// public override void AddFolder(string folderPath, FolderMappingInfo folderMapping) { - AddFolder(folderPath, folderMapping, folderPath); + this.AddFolder(folderPath, folderMapping, folderPath); } /// @@ -160,15 +160,15 @@ public override void AddFile(IFolderInfo folder, string fileName, Stream content Requires.NotNullOrEmpty("fileName", fileName); Requires.NotNull("content", content); - UpdateFile(folder, fileName, content); + this.UpdateFile(folder, fileName, content); } public virtual void ClearCache(int folderMappingId) { - var cacheKey = String.Format(ListObjectsCacheKey, folderMappingId); + var cacheKey = String.Format(this.ListObjectsCacheKey, folderMappingId); DataCache.RemoveCache(cacheKey); //Clear cached objects - DataCache.ClearCache(String.Format(ObjectCacheKey, folderMappingId, String.Empty)); + DataCache.ClearCache(String.Format(this.ObjectCacheKey, folderMappingId, String.Empty)); } /// @@ -183,7 +183,7 @@ public override void CopyFile(string folderPath, string fileName, string newFold if (folderPath == newFolderPath) return; - CopyFileInternal(folderMapping, folderPath + fileName, newFolderPath + fileName); + this.CopyFileInternal(folderMapping, folderPath + fileName, newFolderPath + fileName); } /// @@ -197,7 +197,7 @@ public override void DeleteFile(IFileInfo file) var folder = FolderManager.Instance.GetFolder(file.FolderId); - DeleteFileInternal(folderMapping, folder.MappedPath + file.FileName); + this.DeleteFileInternal(folderMapping, folder.MappedPath + file.FileName); } /// @@ -209,7 +209,7 @@ public override void DeleteFolder(IFolderInfo folder) var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); - DeleteFolderInternal(folderMapping, folder); + this.DeleteFolderInternal(folderMapping, folder); } /// @@ -221,7 +221,7 @@ public override bool FileExists(IFolderInfo folder, string fileName) Requires.NotNullOrEmpty("fileName", fileName); var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); - var item = GetStorageItem(folderMapping, folder.MappedPath + fileName); + var item = this.GetStorageItem(folderMapping, folder.MappedPath + fileName); return (item != null); } @@ -239,7 +239,7 @@ public override bool FolderExists(string folderPath, FolderMappingInfo folderMap return true; } - var list = GetObjectList(folderMapping, folderPath); + var list = this.GetObjectList(folderMapping, folderPath); return list.Any(o => o.Key.StartsWith(folderPath, StringComparison.InvariantCultureIgnoreCase)); } @@ -260,7 +260,7 @@ public override string[] GetFiles(IFolderInfo folder) Requires.NotNull("folder", folder); var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); - var list = GetObjectList(folderMapping, folder.MappedPath); + var list = this.GetObjectList(folderMapping, folder.MappedPath); var mappedPath = folder.MappedPath; //return (from i in list @@ -288,10 +288,10 @@ public override long GetFileSize(IFileInfo file) var folderMapping = FolderMappingController.Instance.GetFolderMapping(file.PortalId, file.FolderMappingID); var folder = FolderManager.Instance.GetFolder(file.FolderId); - var item = GetStorageItem(folderMapping, folder.MappedPath + file.FileName); + var item = this.GetStorageItem(folderMapping, folder.MappedPath + file.FileName); if (item == null) { - throw new FileNotFoundException(FileNotFoundMessage, file.RelativePath); + throw new FileNotFoundException(this.FileNotFoundMessage, file.RelativePath); } return item.Size; @@ -308,7 +308,7 @@ public override Stream GetFileStream(IFileInfo file) var folder = FolderManager.Instance.GetFolder(file.FolderId); - return GetFileStreamInternal(folderMapping, folder.MappedPath + file.FileName); + return this.GetFileStreamInternal(folderMapping, folder.MappedPath + file.FileName); } /// @@ -321,7 +321,7 @@ public override Stream GetFileStream(IFolderInfo folder, string fileName) var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); - return GetFileStreamInternal(folderMapping, folder.MappedPath + fileName); + return this.GetFileStreamInternal(folderMapping, folder.MappedPath + fileName); } /// @@ -334,10 +334,10 @@ public override DateTime GetLastModificationTime(IFileInfo file) var folderMapping = FolderMappingController.Instance.GetFolderMapping(file.PortalId, file.FolderMappingID); var folder = FolderManager.Instance.GetFolder(file.FolderId); - var item = GetStorageItem(folderMapping, folder.MappedPath+file.FileName); + var item = this.GetStorageItem(folderMapping, folder.MappedPath+file.FileName); if (item == null) { - throw new FileNotFoundException(FileNotFoundMessage, file.RelativePath); + throw new FileNotFoundException(this.FileNotFoundMessage, file.RelativePath); } return item.LastModified; } @@ -350,7 +350,7 @@ public override IEnumerable GetSubFolders(string folderPath, FolderMappi Requires.NotNull("folderPath", folderPath); Requires.NotNull("folderMapping", folderMapping); - var list = GetObjectList(folderMapping, folderPath); + var list = this.GetObjectList(folderMapping, folderPath); var pattern = "^" + Regex.Escape(folderPath); @@ -385,7 +385,7 @@ where f.StartsWith(folderPath, StringComparison.InvariantCultureIgnoreCase) /// public override bool IsInSync(IFileInfo file) { - return Convert.ToInt32((file.LastModificationTime - GetLastModificationTime(file)).TotalSeconds) == 0; + return Convert.ToInt32((file.LastModificationTime - this.GetLastModificationTime(file)).TotalSeconds) == 0; } /// @@ -397,7 +397,7 @@ public override void MoveFolder(string folderPath, string newFolderPath, FolderM Requires.NotNullOrEmpty("newFolderPath", newFolderPath); Requires.NotNull("folderMapping", folderMapping); - MoveFolderInternal(folderMapping, folderPath, newFolderPath); + this.MoveFolderInternal(folderMapping, folderPath, newFolderPath); } /// @@ -412,7 +412,7 @@ public override void RenameFile(IFileInfo file, string newFileName) var folder = FolderManager.Instance.GetFolder(file.FolderId); - MoveFileInternal(folderMapping, folder.MappedPath + file.FileName, folder.MappedPath + newFileName); + this.MoveFileInternal(folderMapping, folder.MappedPath + file.FileName, folder.MappedPath + newFileName); } /// @@ -432,7 +432,7 @@ public override void RenameFolder(IFolderInfo folder, string newFolderName) mappedPath.Substring(0, mappedPath.LastIndexOf(folder.FolderName, StringComparison.Ordinal)) + newFolderName); - MoveFolderInternal(folderMapping, mappedPath, newMappedPath); + this.MoveFolderInternal(folderMapping, mappedPath, newMappedPath); } } @@ -463,7 +463,7 @@ public override void UpdateFile(IFileInfo file, Stream content) var folder = FolderManager.Instance.GetFolder(file.FolderId); - UpdateFileInternal(content, folderMapping, folder.MappedPath + file.FileName); + this.UpdateFileInternal(content, folderMapping, folder.MappedPath + file.FileName); } /// @@ -477,7 +477,7 @@ public override void UpdateFile(IFolderInfo folder, string fileName, Stream cont var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); - UpdateFileInternal(content, folderMapping, folder.MappedPath + fileName); + this.UpdateFileInternal(content, folderMapping, folder.MappedPath + fileName); } public override string GetHashCode(IFileInfo file) @@ -486,19 +486,19 @@ public override string GetHashCode(IFileInfo file) var folder = FolderManager.Instance.GetFolder(file.FolderId); var folderMapping = FolderMappingController.Instance.GetFolderMapping(folder.PortalID, folder.FolderMappingID); - var item = GetStorageItem(folderMapping, folder.MappedPath + file.FileName); + var item = this.GetStorageItem(folderMapping, folder.MappedPath + file.FileName); if (item == null) { - throw new FileNotFoundException(FileNotFoundMessage, file.RelativePath); + throw new FileNotFoundException(this.FileNotFoundMessage, file.RelativePath); } return (item.Size == file.Size) ? item.HashCode : String.Empty; } public override string GetHashCode(IFileInfo file, Stream fileContent) { - if (FileExists(FolderManager.Instance.GetFolder(file.FolderId), file.FileName)) + if (this.FileExists(FolderManager.Instance.GetFolder(file.FolderId), file.FileName)) { - return GetHashCode(file); + return this.GetHashCode(file); } return String.Empty; } diff --git a/DNN Platform/Providers/FolderProviders/DotNetNuke.Providers.FolderProviders.csproj b/DNN Platform/Providers/FolderProviders/DotNetNuke.Providers.FolderProviders.csproj index 3a2fb2c34ed..28f401c29e4 100644 --- a/DNN Platform/Providers/FolderProviders/DotNetNuke.Providers.FolderProviders.csproj +++ b/DNN Platform/Providers/FolderProviders/DotNetNuke.Providers.FolderProviders.csproj @@ -1,140 +1,148 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {B267CE88-DFFC-4BD8-9962-319E79C52526} - Library - Properties - DotNetNuke.Providers.FolderProviders - DotNetNuke.Providers.FolderProviders - v4.7.2 - 512 - - ..\..\..\ - true - - - true - full - false - bin\Providers - DEBUG;TRACE - prompt - 4 - bin\Providers\DotNetNuke.Providers.FolderProviders.XML - 7 - 1591 - - - pdbonly - true - bin\Providers - TRACE - prompt - 4 - bin\Providers\DotNetNuke.Providers.FolderProviders.XML - 1591 - 7 - - - true - full - false - bin\Providers - DEBUG;TRACE;CLOUD;CLOUD_DEBUG - prompt - 4 - bin\Providers\DotNetNuke.Providers.FolderProviders.XML - 7 - 1591 - - - pdbonly - true - bin\Providers - TRACE;CLOUD;CLOUD_RELEASE - prompt - 4 - bin\Providers\DotNetNuke.Providers.FolderProviders.XML - 1591 - 7 - - - - - False - ..\..\Components\WindowsAzure\Microsoft.WindowsAzure.Storage.dll - - - - - - - - - - - - - SolutionInfo.cs - - - - - - - - Settings.ascx - ASPXCodeBehind - - - Settings.ascx.cs - - - - - - - - - - - - - Designer - - - ASPXCodeBehind - - - - - Designer - - - - - - - - {3cd5f6b8-8360-4862-80b6-f402892db7dd} - DotNetNuke.Instrumentation - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {B267CE88-DFFC-4BD8-9962-319E79C52526} + Library + Properties + DotNetNuke.Providers.FolderProviders + DotNetNuke.Providers.FolderProviders + v4.7.2 + 512 + + ..\..\..\ + true + + + true + full + false + bin\Providers + DEBUG;TRACE + prompt + 4 + bin\Providers\DotNetNuke.Providers.FolderProviders.XML + 7 + 1591 + + + pdbonly + true + bin\Providers + TRACE + prompt + 4 + bin\Providers\DotNetNuke.Providers.FolderProviders.XML + 1591 + 7 + + + true + full + false + bin\Providers + DEBUG;TRACE;CLOUD;CLOUD_DEBUG + prompt + 4 + bin\Providers\DotNetNuke.Providers.FolderProviders.XML + 7 + 1591 + + + pdbonly + true + bin\Providers + TRACE;CLOUD;CLOUD_RELEASE + prompt + 4 + bin\Providers\DotNetNuke.Providers.FolderProviders.XML + 1591 + 7 + + + + + False + ..\..\Components\WindowsAzure\Microsoft.WindowsAzure.Storage.dll + + + + + + + + + + + + + SolutionInfo.cs + + + + + + + + Settings.ascx + ASPXCodeBehind + + + Settings.ascx.cs + + + + + + + + + + + + stylecop.json + + + + Designer + + + ASPXCodeBehind + + + + + Designer + + + + + + + + + {3cd5f6b8-8360-4862-80b6-f402892db7dd} + DotNetNuke.Instrumentation + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/DNN Platform/Providers/FolderProviders/packages.config b/DNN Platform/Providers/FolderProviders/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Providers/FolderProviders/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Skins/Xcillion/DotNetNuke.Skins.Xcillion.csproj b/DNN Platform/Skins/Xcillion/DotNetNuke.Skins.Xcillion.csproj index 4101a5f0c78..e464fe92ab7 100644 --- a/DNN Platform/Skins/Xcillion/DotNetNuke.Skins.Xcillion.csproj +++ b/DNN Platform/Skins/Xcillion/DotNetNuke.Skins.Xcillion.csproj @@ -1,226 +1,239 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {104C9117-430C-4389-B67D-B1EFCF8146CB} - {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - Properties - DotNetNuke.Skins.Xcillion - DotNetNuke.Skins.Xcillion - v4.7.2 - 512 - - true - - - 4.0 - - - - - - ..\..\..\ - true - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 1 - bin\DotNetNuke.Skins.Xcillion.XML - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - bin\DotNetNuke.Skins.Xcillion.XML - 1591 - 7 - - - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - - - - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 9081 - / - - - False - True - http://localhost/DNN_Platform - False - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {104C9117-430C-4389-B67D-B1EFCF8146CB} + {349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + DotNetNuke.Skins.Xcillion + DotNetNuke.Skins.Xcillion + v4.7.2 + 512 + + true + + + 4.0 + + + + + + ..\..\..\ + true + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 1 + bin\DotNetNuke.Skins.Xcillion.XML + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + bin\DotNetNuke.Skins.Xcillion.XML + 1591 + 7 + + + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + + + + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + False + True + 9081 + / + + + False + True + http://localhost/DNN_Platform + False + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + \ No newline at end of file diff --git a/DNN Platform/Skins/Xcillion/packages.config b/DNN Platform/Skins/Xcillion/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Skins/Xcillion/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Syndication/DotNetNuke.Syndication.csproj b/DNN Platform/Syndication/DotNetNuke.Syndication.csproj index c8f0bf39a11..094b0dc7459 100644 --- a/DNN Platform/Syndication/DotNetNuke.Syndication.csproj +++ b/DNN Platform/Syndication/DotNetNuke.Syndication.csproj @@ -1,107 +1,119 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9F2F4076-D434-448F-9CBB-7BF7A9766AB1} - Library - Properties - DotNetNuke.Services.Syndication - DotNetNuke.Services.Syndication - v4.7.2 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - bin\DotNetNuke.Services.Syndication.xml - 1591 - 7 - - - pdbonly - bin\ - TRACE - prompt - 4 - true - AllRules.ruleset - 1591 - bin\DotNetNuke.Services.Syndication.xml - true - 7 - - - - False - ..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll - - - - - - - - - - SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - $(MSBuildProjectDirectory)\..\.. - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9F2F4076-D434-448F-9CBB-7BF7A9766AB1} + Library + Properties + DotNetNuke.Services.Syndication + DotNetNuke.Services.Syndication + v4.7.2 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + + true + full + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + bin\DotNetNuke.Services.Syndication.xml + 1591 + 7 + + + pdbonly + bin\ + TRACE + prompt + 4 + true + AllRules.ruleset + 1591 + bin\DotNetNuke.Services.Syndication.xml + true + 7 + + + + False + ..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + + + + + + + + + + SolutionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + + + + + + + + + + $(MSBuildProjectDirectory)\..\.. + + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Syndication/OPML/Opml.cs b/DNN Platform/Syndication/OPML/Opml.cs index d6bce232554..039b4b23fac 100644 --- a/DNN Platform/Syndication/OPML/Opml.cs +++ b/DNN Platform/Syndication/OPML/Opml.cs @@ -38,18 +38,18 @@ public class Opml public Opml() { - _outlines = new OpmlOutlines(); + this._outlines = new OpmlOutlines(); } public DateTime UtcExpiry { get { - return _utcExpiry; + return this._utcExpiry; } set { - _utcExpiry = value; + this._utcExpiry = value; } } @@ -57,11 +57,11 @@ public string Title { get { - return _title; + return this._title; } set { - _title = value; + this._title = value; } } @@ -69,11 +69,11 @@ public DateTime DateCreated { get { - return _dateCreated; + return this._dateCreated; } set { - _dateCreated = value; + this._dateCreated = value; } } @@ -81,11 +81,11 @@ public DateTime DateModified { get { - return _dateModified; + return this._dateModified; } set { - _dateModified = value; + this._dateModified = value; } } @@ -93,11 +93,11 @@ public string OwnerName { get { - return _ownerName; + return this._ownerName; } set { - _ownerName = value; + this._ownerName = value; } } @@ -105,11 +105,11 @@ public string OwnerEmail { get { - return _ownerEmail; + return this._ownerEmail; } set { - _ownerEmail = value; + this._ownerEmail = value; } } @@ -117,11 +117,11 @@ public string OwnerId { get { - return _ownerId; + return this._ownerId; } set { - _ownerId = value; + this._ownerId = value; } } @@ -129,11 +129,11 @@ public string Docs { get { - return _docs; + return this._docs; } set { - _docs = value; + this._docs = value; } } @@ -141,11 +141,11 @@ public string ExpansionState { get { - return _expansionState; + return this._expansionState; } set { - _expansionState = value; + this._expansionState = value; } } @@ -153,11 +153,11 @@ public string VertScrollState { get { - return _vertScrollState; + return this._vertScrollState; } set { - _vertScrollState = value; + this._vertScrollState = value; } } @@ -165,11 +165,11 @@ public string WindowTop { get { - return _windowTop; + return this._windowTop; } set { - _windowTop = value; + this._windowTop = value; } } @@ -177,11 +177,11 @@ public string WindowLeft { get { - return _windowLeft; + return this._windowLeft; } set { - _windowLeft = value; + this._windowLeft = value; } } @@ -189,11 +189,11 @@ public string WindowBottom { get { - return _windowBottom; + return this._windowBottom; } set { - _windowBottom = value; + this._windowBottom = value; } } @@ -201,11 +201,11 @@ public string WindowRight { get { - return _windowRight; + return this._windowRight; } set { - _windowRight = value; + this._windowRight = value; } } @@ -213,22 +213,22 @@ public OpmlOutlines Outlines { get { - return _outlines; + return this._outlines; } set { - _outlines = value; + this._outlines = value; } } public void AddOutline(OpmlOutline item) { - _outlines.Add(item); + this._outlines.Add(item); } public void AddOutline(string text, string type, Uri xmlUrl, string category) { - AddOutline(text, type, xmlUrl, category, null); + this.AddOutline(text, type, xmlUrl, category, null); } public void AddOutline(string text, string type, Uri xmlUrl, string category, OpmlOutlines outlines) @@ -239,100 +239,100 @@ public void AddOutline(string text, string type, Uri xmlUrl, string category, Op item.XmlUrl = xmlUrl; item.Category = category; item.Outlines = outlines; - _outlines.Add(item); + this._outlines.Add(item); } public string GetXml() { - return opmlDoc.OuterXml; + return this.opmlDoc.OuterXml; } public void Save(string fileName) { - opmlDoc = new XmlDocument { XmlResolver = null }; - XmlElement opml = opmlDoc.CreateElement("opml"); + this.opmlDoc = new XmlDocument { XmlResolver = null }; + XmlElement opml = this.opmlDoc.CreateElement("opml"); opml.SetAttribute("version", "2.0"); - opmlDoc.AppendChild(opml); + this.opmlDoc.AppendChild(opml); // create head - XmlElement head = opmlDoc.CreateElement("head"); + XmlElement head = this.opmlDoc.CreateElement("head"); opml.AppendChild(head); // set Title - XmlElement title = opmlDoc.CreateElement("title"); - title.InnerText = Title; + XmlElement title = this.opmlDoc.CreateElement("title"); + title.InnerText = this.Title; head.AppendChild(title); // set date created - XmlElement dateCreated = opmlDoc.CreateElement("dateCreated"); - dateCreated.InnerText = DateCreated != DateTime.MinValue ? DateCreated.ToString("r", null) : DateTime.Now.ToString("r", null); + XmlElement dateCreated = this.opmlDoc.CreateElement("dateCreated"); + dateCreated.InnerText = this.DateCreated != DateTime.MinValue ? this.DateCreated.ToString("r", null) : DateTime.Now.ToString("r", null); head.AppendChild(dateCreated); // set date modified - XmlElement dateModified = opmlDoc.CreateElement("dateModified"); - dateCreated.InnerText = DateModified != DateTime.MinValue ? DateModified.ToString("r", null) : DateTime.Now.ToString("r", null); + XmlElement dateModified = this.opmlDoc.CreateElement("dateModified"); + dateCreated.InnerText = this.DateModified != DateTime.MinValue ? this.DateModified.ToString("r", null) : DateTime.Now.ToString("r", null); head.AppendChild(dateModified); // set owner email - XmlElement ownerEmail = opmlDoc.CreateElement("ownerEmail"); - ownerEmail.InnerText = OwnerEmail; + XmlElement ownerEmail = this.opmlDoc.CreateElement("ownerEmail"); + ownerEmail.InnerText = this.OwnerEmail; head.AppendChild(ownerEmail); // set owner name - XmlElement ownerName = opmlDoc.CreateElement("ownerName"); - ownerName.InnerText = OwnerName; + XmlElement ownerName = this.opmlDoc.CreateElement("ownerName"); + ownerName.InnerText = this.OwnerName; head.AppendChild(ownerName); // set owner id - XmlElement ownerId = opmlDoc.CreateElement("ownerId"); - ownerId.InnerText = OwnerId; + XmlElement ownerId = this.opmlDoc.CreateElement("ownerId"); + ownerId.InnerText = this.OwnerId; head.AppendChild(ownerId); // set docs - XmlElement docs = opmlDoc.CreateElement("docs"); - docs.InnerText = Docs; + XmlElement docs = this.opmlDoc.CreateElement("docs"); + docs.InnerText = this.Docs; head.AppendChild(docs); // set expansionState - XmlElement expansionState = opmlDoc.CreateElement("expansionState"); - expansionState.InnerText = ExpansionState; + XmlElement expansionState = this.opmlDoc.CreateElement("expansionState"); + expansionState.InnerText = this.ExpansionState; head.AppendChild(expansionState); // set vertScrollState - XmlElement vertScrollState = opmlDoc.CreateElement("vertScrollState"); - vertScrollState.InnerText = VertScrollState; + XmlElement vertScrollState = this.opmlDoc.CreateElement("vertScrollState"); + vertScrollState.InnerText = this.VertScrollState; head.AppendChild(vertScrollState); // set windowTop - XmlElement windowTop = opmlDoc.CreateElement("windowTop"); - windowTop.InnerText = WindowTop; + XmlElement windowTop = this.opmlDoc.CreateElement("windowTop"); + windowTop.InnerText = this.WindowTop; head.AppendChild(windowTop); // set windowLeft - XmlElement windowLeft = opmlDoc.CreateElement("windowLeft"); - windowLeft.InnerText = WindowLeft; + XmlElement windowLeft = this.opmlDoc.CreateElement("windowLeft"); + windowLeft.InnerText = this.WindowLeft; head.AppendChild(windowLeft); // set windowBottom - XmlElement windowBottom = opmlDoc.CreateElement("windowBottom"); - windowBottom.InnerText = WindowBottom; + XmlElement windowBottom = this.opmlDoc.CreateElement("windowBottom"); + windowBottom.InnerText = this.WindowBottom; head.AppendChild(windowBottom); // set windowRight - XmlElement windowRight = opmlDoc.CreateElement("windowRight"); - windowRight.InnerText = WindowRight; + XmlElement windowRight = this.opmlDoc.CreateElement("windowRight"); + windowRight.InnerText = this.WindowRight; head.AppendChild(windowRight); // create body - XmlElement opmlBody = opmlDoc.CreateElement("body"); + XmlElement opmlBody = this.opmlDoc.CreateElement("body"); opml.AppendChild(opmlBody); - foreach (OpmlOutline outline in _outlines) + foreach (OpmlOutline outline in this._outlines) { opmlBody.AppendChild(outline.ToXml); } - opmlDoc.Save(fileName); + this.opmlDoc.Save(fileName); } public static Opml LoadFromUrl(Uri uri) diff --git a/DNN Platform/Syndication/OPML/OpmlDownloadManager.cs b/DNN Platform/Syndication/OPML/OpmlDownloadManager.cs index 744c4a04076..00b9262d5b7 100644 --- a/DNN Platform/Syndication/OPML/OpmlDownloadManager.cs +++ b/DNN Platform/Syndication/OPML/OpmlDownloadManager.cs @@ -33,12 +33,12 @@ internal class OpmlDownloadManager private OpmlDownloadManager() { // create in-memory cache - _cache = new Dictionary(); + this._cache = new Dictionary(); - _defaultTtlMinutes = 60; + this._defaultTtlMinutes = 60; // prepare disk directory - _directoryOnDisk = PrepareTempDir(); + this._directoryOnDisk = PrepareTempDir(); } public static Opml GetOpmlFeed(Uri uri) @@ -50,13 +50,13 @@ internal Opml GetFeed(Uri uri) { Opml opmlFeed = null; - lock (_cache) + lock (this._cache) { - if (_cache.TryGetValue(uri.AbsoluteUri, out opmlFeed)) + if (this._cache.TryGetValue(uri.AbsoluteUri, out opmlFeed)) { if (DateTime.UtcNow > opmlFeed.UtcExpiry) { - _cache.Remove(uri.AbsoluteUri); + this._cache.Remove(uri.AbsoluteUri); opmlFeed = null; } } @@ -64,11 +64,11 @@ internal Opml GetFeed(Uri uri) if (opmlFeed == null) { - opmlFeed = DownloadOpmlFeed(uri); + opmlFeed = this.DownloadOpmlFeed(uri); - lock (_cache) + lock (this._cache) { - _cache[uri.AbsoluteUri] = opmlFeed; + this._cache[uri.AbsoluteUri] = opmlFeed; } } @@ -78,7 +78,7 @@ internal Opml GetFeed(Uri uri) private Opml DownloadOpmlFeed(Uri uri) { // look for disk cache first - Opml opmlFeed = TryLoadFromDisk(uri); + Opml opmlFeed = this.TryLoadFromDisk(uri); if (opmlFeed != null) { @@ -94,10 +94,10 @@ private Opml DownloadOpmlFeed(Uri uri) opmlDoc.Load(new MemoryStream(feed)); opmlFeed = Opml.LoadFromXml(opmlDoc); - opmlFeed.UtcExpiry = DateTime.UtcNow.AddMinutes(_defaultTtlMinutes); + opmlFeed.UtcExpiry = DateTime.UtcNow.AddMinutes(this._defaultTtlMinutes); // save to disk - TrySaveToDisk(opmlDoc, uri, opmlFeed.UtcExpiry); + this.TrySaveToDisk(opmlDoc, uri, opmlFeed.UtcExpiry); } catch { @@ -109,7 +109,7 @@ private Opml DownloadOpmlFeed(Uri uri) private Opml TryLoadFromDisk(Uri uri) { - if (_directoryOnDisk == null) + if (this._directoryOnDisk == null) { return (null); // no place to cache } @@ -118,7 +118,7 @@ private Opml TryLoadFromDisk(Uri uri) // looking for the one matching url that is not expired // removing expired (or invalid) ones string pattern = GetTempFileNamePrefixFromUrl(uri) + "_*.opml.resources"; - string[] files = Directory.GetFiles(_directoryOnDisk, pattern, SearchOption.TopDirectoryOnly); + string[] files = Directory.GetFiles(this._directoryOnDisk, pattern, SearchOption.TopDirectoryOnly); foreach (string opmlFilename in files) { @@ -187,7 +187,7 @@ private Opml TryLoadFromDisk(Uri uri) private void TrySaveToDisk(XmlDocument doc, Uri uri, DateTime utcExpiry) { - if (_directoryOnDisk == null) + if (this._directoryOnDisk == null) { return; } @@ -198,7 +198,7 @@ private void TrySaveToDisk(XmlDocument doc, Uri uri, DateTime utcExpiry) try { - doc.Save(Path.Combine(_directoryOnDisk, fileName)); + doc.Save(Path.Combine(this._directoryOnDisk, fileName)); } catch { diff --git a/DNN Platform/Syndication/OPML/OpmlOutline.cs b/DNN Platform/Syndication/OPML/OpmlOutline.cs index 3be8e8d88a0..0937a69f54f 100644 --- a/DNN Platform/Syndication/OPML/OpmlOutline.cs +++ b/DNN Platform/Syndication/OPML/OpmlOutline.cs @@ -27,18 +27,18 @@ public class OpmlOutline public OpmlOutline() { - Outlines = new OpmlOutlines(); + this.Outlines = new OpmlOutlines(); } public string Description { get { - return _description; + return this._description; } set { - _description = value; + this._description = value; } } @@ -46,11 +46,11 @@ public string Title { get { - return _title; + return this._title; } set { - _title = value; + this._title = value; } } @@ -58,11 +58,11 @@ public string Type { get { - return _type; + return this._type; } set { - _type = value; + this._type = value; } } @@ -70,11 +70,11 @@ public string Text { get { - return _text; + return this._text; } set { - _text = value; + this._text = value; } } @@ -88,11 +88,11 @@ public DateTime Created { get { - return _created; + return this._created; } set { - _created = value; + this._created = value; } } @@ -104,11 +104,11 @@ public string Category { get { - return _category; + return this._category; } set { - _category = value; + this._category = value; } } @@ -116,11 +116,11 @@ public string Language { get { - return _language; + return this._language; } set { - _language = value; + this._language = value; } } @@ -142,60 +142,60 @@ public XmlElement ToXml var opmlDoc = new XmlDocument { XmlResolver = null }; XmlElement outlineNode = opmlDoc.CreateElement("outline"); - if (!String.IsNullOrEmpty(Title)) + if (!String.IsNullOrEmpty(this.Title)) { - outlineNode.SetAttribute("title", Title); + outlineNode.SetAttribute("title", this.Title); } - if (!String.IsNullOrEmpty(Description)) + if (!String.IsNullOrEmpty(this.Description)) { - outlineNode.SetAttribute("description", Description); + outlineNode.SetAttribute("description", this.Description); } - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - outlineNode.SetAttribute("text", Text); + outlineNode.SetAttribute("text", this.Text); } - if (!String.IsNullOrEmpty(Type)) + if (!String.IsNullOrEmpty(this.Type)) { - outlineNode.SetAttribute("type", Type); + outlineNode.SetAttribute("type", this.Type); } - if (!String.IsNullOrEmpty(Language)) + if (!String.IsNullOrEmpty(this.Language)) { - outlineNode.SetAttribute("language", Language); + outlineNode.SetAttribute("language", this.Language); } - if (!String.IsNullOrEmpty(Category)) + if (!String.IsNullOrEmpty(this.Category)) { - outlineNode.SetAttribute("category", Category); + outlineNode.SetAttribute("category", this.Category); } - if (Created > DateTime.MinValue) + if (this.Created > DateTime.MinValue) { - outlineNode.SetAttribute("created", Created.ToString("r", null)); + outlineNode.SetAttribute("created", this.Created.ToString("r", null)); } - if (HtmlUrl != null) + if (this.HtmlUrl != null) { - outlineNode.SetAttribute("htmlUrl", HtmlUrl.ToString()); + outlineNode.SetAttribute("htmlUrl", this.HtmlUrl.ToString()); } - if (XmlUrl != null) + if (this.XmlUrl != null) { - outlineNode.SetAttribute("xmlUrl", XmlUrl.ToString()); + outlineNode.SetAttribute("xmlUrl", this.XmlUrl.ToString()); } - if (Url != null) + if (this.Url != null) { - outlineNode.SetAttribute("url", Url.ToString()); + outlineNode.SetAttribute("url", this.Url.ToString()); } - outlineNode.SetAttribute("isComment", (IsComment ? "true" : "false")); - outlineNode.SetAttribute("isBreakpoint", (IsBreakpoint ? "true" : "false")); + outlineNode.SetAttribute("isComment", (this.IsComment ? "true" : "false")); + outlineNode.SetAttribute("isBreakpoint", (this.IsBreakpoint ? "true" : "false")); - foreach (OpmlOutline childOutline in Outlines) + foreach (OpmlOutline childOutline in this.Outlines) { outlineNode.AppendChild(childOutline.ToXml); } diff --git a/DNN Platform/Syndication/RSS/GenericRssChannel.cs b/DNN Platform/Syndication/RSS/GenericRssChannel.cs index d6915e2eb3e..2b8dfc81858 100644 --- a/DNN Platform/Syndication/RSS/GenericRssChannel.cs +++ b/DNN Platform/Syndication/RSS/GenericRssChannel.cs @@ -29,11 +29,11 @@ public string this[string attributeName] { get { - return GetAttributeValue(attributeName); + return this.GetAttributeValue(attributeName); } set { - Attributes[attributeName] = value; + this.Attributes[attributeName] = value; } } @@ -41,7 +41,7 @@ public GenericRssElement Image { get { - return GetImage(); + return this.GetImage(); } } @@ -62,14 +62,14 @@ public static GenericRssChannel LoadChannel(XmlDocument doc) // Select method for programmatic databinding public IEnumerable SelectItems() { - return SelectItems(-1); + return this.SelectItems(-1); } public IEnumerable SelectItems(int maxItems) { var data = new ArrayList(); - foreach (GenericRssElement element in Items) + foreach (GenericRssElement element in this.Items) { if (maxItems > 0 && data.Count >= maxItems) { diff --git a/DNN Platform/Syndication/RSS/GenericRssElement.cs b/DNN Platform/Syndication/RSS/GenericRssElement.cs index b00ffc686a9..0c7651f3243 100644 --- a/DNN Platform/Syndication/RSS/GenericRssElement.cs +++ b/DNN Platform/Syndication/RSS/GenericRssElement.cs @@ -27,11 +27,11 @@ public string this[string attributeName] { get { - return GetAttributeValue(attributeName); + return this.GetAttributeValue(attributeName); } set { - Attributes[attributeName] = value; + this.Attributes[attributeName] = value; } } } diff --git a/DNN Platform/Syndication/RSS/RssChannelBase.cs b/DNN Platform/Syndication/RSS/RssChannelBase.cs index 818bc4e8caa..a4fc4c89861 100644 --- a/DNN Platform/Syndication/RSS/RssChannelBase.cs +++ b/DNN Platform/Syndication/RSS/RssChannelBase.cs @@ -26,7 +26,7 @@ public List Items { get { - return _items; + return this._items; } } @@ -34,7 +34,7 @@ internal string Url { get { - return _url; + return this._url; } } @@ -44,10 +44,10 @@ protected void LoadFromUrl(string url) RssChannelDom dom = RssDownloadManager.GetChannel(url); // create the channel - LoadFromDom(dom); + this.LoadFromDom(dom); // remember the url - _url = url; + this._url = url; } protected void LoadFromXml(XmlDocument doc) @@ -56,20 +56,20 @@ protected void LoadFromXml(XmlDocument doc) RssChannelDom dom = RssXmlHelper.ParseChannelXml(doc); // create the channel - LoadFromDom(dom); + this.LoadFromDom(dom); } internal void LoadFromDom(RssChannelDom dom) { // channel attributes - SetAttributes(dom.Channel); + this.SetAttributes(dom.Channel); // image attributes if (dom.Image != null) { var image = new RssImageType(); image.SetAttributes(dom.Image); - _image = image; + this._image = image; } // items @@ -77,13 +77,13 @@ internal void LoadFromDom(RssChannelDom dom) { var item = new RssItemType(); item.SetAttributes(i); - _items.Add(item); + this._items.Add(item); } } public XmlDocument SaveAsXml() { - return SaveAsXml(RssXmlHelper.CreateEmptyRssXml()); + return this.SaveAsXml(RssXmlHelper.CreateEmptyRssXml()); } public XmlDocument SaveAsXml(XmlDocument EmptyRssXml) @@ -91,12 +91,12 @@ public XmlDocument SaveAsXml(XmlDocument EmptyRssXml) XmlDocument doc = EmptyRssXml; XmlNode channelNode = RssXmlHelper.SaveRssElementAsXml(doc.DocumentElement, this, "channel"); - if (_image != null) + if (this._image != null) { - RssXmlHelper.SaveRssElementAsXml(channelNode, _image, "image"); + RssXmlHelper.SaveRssElementAsXml(channelNode, this._image, "image"); } - foreach (RssItemType item in _items) + foreach (RssItemType item in this._items) { RssXmlHelper.SaveRssElementAsXml(channelNode, item, "item"); } @@ -106,12 +106,12 @@ public XmlDocument SaveAsXml(XmlDocument EmptyRssXml) protected RssImageType GetImage() { - if (_image == null) + if (this._image == null) { - _image = new RssImageType(); + this._image = new RssImageType(); } - return _image; + return this._image; } } } diff --git a/DNN Platform/Syndication/RSS/RssChannelDom.cs b/DNN Platform/Syndication/RSS/RssChannelDom.cs index 770c18e5c01..06556812e1c 100644 --- a/DNN Platform/Syndication/RSS/RssChannelDom.cs +++ b/DNN Platform/Syndication/RSS/RssChannelDom.cs @@ -23,17 +23,17 @@ internal class RssChannelDom internal RssChannelDom(Dictionary channel, Dictionary image, List> items) { - _channel = channel; - _image = image; - _items = items; - _utcExpiry = DateTime.MaxValue; + this._channel = channel; + this._image = image; + this._items = items; + this._utcExpiry = DateTime.MaxValue; } internal Dictionary Channel { get { - return _channel; + return this._channel; } } @@ -41,7 +41,7 @@ internal Dictionary Image { get { - return _image; + return this._image; } } @@ -49,7 +49,7 @@ internal List> Items { get { - return _items; + return this._items; } } @@ -57,13 +57,13 @@ internal DateTime UtcExpiry { get { - return _utcExpiry; + return this._utcExpiry; } } internal void SetExpiry(DateTime utcExpiry) { - _utcExpiry = utcExpiry; + this._utcExpiry = utcExpiry; } } } diff --git a/DNN Platform/Syndication/RSS/RssDataSource.cs b/DNN Platform/Syndication/RSS/RssDataSource.cs index 8d6526253fe..121432fa5c0 100644 --- a/DNN Platform/Syndication/RSS/RssDataSource.cs +++ b/DNN Platform/Syndication/RSS/RssDataSource.cs @@ -26,19 +26,19 @@ public GenericRssChannel Channel { get { - if (_channel == null) + if (this._channel == null) { - if (string.IsNullOrEmpty(_url)) + if (string.IsNullOrEmpty(this._url)) { - _channel = new GenericRssChannel(); + this._channel = new GenericRssChannel(); } else { - _channel = GenericRssChannel.LoadChannel(_url); + this._channel = GenericRssChannel.LoadChannel(this._url); } } - return _channel; + return this._channel; } } @@ -48,24 +48,24 @@ public string Url { get { - return _url; + return this._url; } set { - _channel = null; - _url = value; + this._channel = null; + this._url = value; } } protected override DataSourceView GetView(string viewName) { - if (_itemsView == null) + if (this._itemsView == null) { - _itemsView = new RssDataSourceView(this, viewName); + this._itemsView = new RssDataSourceView(this, viewName); } - return _itemsView; + return this._itemsView; } } @@ -75,17 +75,17 @@ public class RssDataSourceView : DataSourceView internal RssDataSourceView(RssDataSource owner, string viewName) : base(owner, viewName) { - _owner = owner; + this._owner = owner; } public override void Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) { - callback(ExecuteSelect(arguments)); + callback(this.ExecuteSelect(arguments)); } protected override IEnumerable ExecuteSelect(DataSourceSelectArguments arguments) { - return _owner.Channel.SelectItems(_owner.MaxItems); + return this._owner.Channel.SelectItems(this._owner.MaxItems); } } } diff --git a/DNN Platform/Syndication/RSS/RssDownloadManager.cs b/DNN Platform/Syndication/RSS/RssDownloadManager.cs index d36b7f0de16..51b121614b8 100644 --- a/DNN Platform/Syndication/RSS/RssDownloadManager.cs +++ b/DNN Platform/Syndication/RSS/RssDownloadManager.cs @@ -33,18 +33,18 @@ internal class RssDownloadManager private RssDownloadManager() { // create in-memory cache - _cache = new Dictionary(); + this._cache = new Dictionary(); - _defaultTtlMinutes = 2; + this._defaultTtlMinutes = 2; // prepare disk directory - _directoryOnDisk = PrepareTempDir(); + this._directoryOnDisk = PrepareTempDir(); } private RssChannelDom DownloadChannelDom(string url) { // look for disk cache first - RssChannelDom dom = TryLoadFromDisk(url); + RssChannelDom dom = this.TryLoadFromDisk(url); if (dom != null) { @@ -64,19 +64,19 @@ private RssChannelDom DownloadChannelDom(string url) // set expiry string ttlString = null; dom.Channel.TryGetValue("ttl", out ttlString); - int ttlMinutes = GetTtlFromString(ttlString, _defaultTtlMinutes); + int ttlMinutes = GetTtlFromString(ttlString, this._defaultTtlMinutes); DateTime utcExpiry = DateTime.UtcNow.AddMinutes(ttlMinutes); dom.SetExpiry(utcExpiry); // save to disk - TrySaveToDisk(doc, url, utcExpiry); + this.TrySaveToDisk(doc, url, utcExpiry); return dom; } private RssChannelDom TryLoadFromDisk(string url) { - if (_directoryOnDisk == null) + if (this._directoryOnDisk == null) { return null; // no place to cache } @@ -85,7 +85,7 @@ private RssChannelDom TryLoadFromDisk(string url) // looking for the one matching url that is not expired // removing expired (or invalid) ones string pattern = GetTempFileNamePrefixFromUrl(url) + "_*.rss.resources"; - string[] files = Directory.GetFiles(_directoryOnDisk, pattern, SearchOption.TopDirectoryOnly); + string[] files = Directory.GetFiles(this._directoryOnDisk, pattern, SearchOption.TopDirectoryOnly); foreach (string rssFilename in files) { @@ -154,7 +154,7 @@ private RssChannelDom TryLoadFromDisk(string url) private void TrySaveToDisk(XmlDocument doc, string url, DateTime utcExpiry) { - if (_directoryOnDisk == null) + if (this._directoryOnDisk == null) { return; } @@ -165,7 +165,7 @@ private void TrySaveToDisk(XmlDocument doc, string url, DateTime utcExpiry) try { - doc.Save(Path.Combine(_directoryOnDisk, fileName)); + doc.Save(Path.Combine(this._directoryOnDisk, fileName)); } catch { @@ -177,13 +177,13 @@ private RssChannelDom GetChannelDom(string url) { RssChannelDom dom = null; - lock (_cache) + lock (this._cache) { - if (_cache.TryGetValue(url, out dom)) + if (this._cache.TryGetValue(url, out dom)) { if (DateTime.UtcNow > dom.UtcExpiry) { - _cache.Remove(url); + this._cache.Remove(url); dom = null; } } @@ -191,11 +191,11 @@ private RssChannelDom GetChannelDom(string url) if (dom == null) { - dom = DownloadChannelDom(url); + dom = this.DownloadChannelDom(url); - lock (_cache) + lock (this._cache) { - _cache[url] = dom; + this._cache[url] = dom; } } diff --git a/DNN Platform/Syndication/RSS/RssElementBase.cs b/DNN Platform/Syndication/RSS/RssElementBase.cs index aaa98b12ed6..5a4dd25ce7e 100644 --- a/DNN Platform/Syndication/RSS/RssElementBase.cs +++ b/DNN Platform/Syndication/RSS/RssElementBase.cs @@ -23,7 +23,7 @@ protected internal Dictionary Attributes { get { - return _attributes; + return this._attributes; } } @@ -33,14 +33,14 @@ public virtual void SetDefaults() internal void SetAttributes(Dictionary attributes) { - _attributes = attributes; + this._attributes = attributes; } protected string GetAttributeValue(string attributeName) { string attributeValue; - if (!_attributes.TryGetValue(attributeName, out attributeValue)) + if (!this._attributes.TryGetValue(attributeName, out attributeValue)) { attributeValue = string.Empty; } @@ -50,7 +50,7 @@ protected string GetAttributeValue(string attributeName) protected void SetAttributeValue(string attributeName, string attributeValue) { - _attributes[attributeName] = attributeValue; + this._attributes[attributeName] = attributeValue; } } } diff --git a/DNN Platform/Syndication/RSS/RssElementCustomTypeDescriptor.cs b/DNN Platform/Syndication/RSS/RssElementCustomTypeDescriptor.cs index 2be773f1071..f1d9ee39fe4 100644 --- a/DNN Platform/Syndication/RSS/RssElementCustomTypeDescriptor.cs +++ b/DNN Platform/Syndication/RSS/RssElementCustomTypeDescriptor.cs @@ -21,7 +21,7 @@ internal class RssElementCustomTypeDescriptor : ICustomTypeDescriptor public RssElementCustomTypeDescriptor(Dictionary attributes) { - _attributes = attributes; + this._attributes = attributes; } #region ICustomTypeDescriptor Members @@ -33,7 +33,7 @@ AttributeCollection ICustomTypeDescriptor.GetAttributes() string ICustomTypeDescriptor.GetClassName() { - return GetType().Name; + return this.GetType().Name; } string ICustomTypeDescriptor.GetComponentName() @@ -73,12 +73,12 @@ EventDescriptorCollection ICustomTypeDescriptor.GetEvents() PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties(Attribute[] attributes) { - return GetPropertyDescriptors(); + return this.GetPropertyDescriptors(); } PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties() { - return GetPropertyDescriptors(); + return this.GetPropertyDescriptors(); } object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) @@ -90,10 +90,10 @@ object ICustomTypeDescriptor.GetPropertyOwner(PropertyDescriptor pd) private PropertyDescriptorCollection GetPropertyDescriptors() { - var propertyDescriptors = new PropertyDescriptor[_attributes.Count]; + var propertyDescriptors = new PropertyDescriptor[this._attributes.Count]; int i = 0; - foreach (KeyValuePair a in _attributes) + foreach (KeyValuePair a in this._attributes) { propertyDescriptors[i++] = new RssElementCustomPropertyDescriptor(a.Key); } @@ -159,7 +159,7 @@ public override object GetValue(object o) { string propertyValue; - if (element._attributes.TryGetValue(Name, out propertyValue)) + if (element._attributes.TryGetValue(this.Name, out propertyValue)) { return propertyValue; } diff --git a/DNN Platform/Syndication/RSS/RssHttpHandlerBase.cs b/DNN Platform/Syndication/RSS/RssHttpHandlerBase.cs index f9c6e1747c3..8bca8c79407 100644 --- a/DNN Platform/Syndication/RSS/RssHttpHandlerBase.cs +++ b/DNN Platform/Syndication/RSS/RssHttpHandlerBase.cs @@ -33,7 +33,7 @@ protected RssChannelType Channel { get { - return _channel; + return this._channel; } } @@ -41,7 +41,7 @@ protected HttpContext Context { get { - return _context; + return this._context; } } @@ -49,10 +49,10 @@ protected HttpContext Context void IHttpHandler.ProcessRequest(HttpContext context) { - InternalInit(context); + this.InternalInit(context); // let inherited handlers setup any special handling - OnInit(EventArgs.Empty); + this.OnInit(EventArgs.Empty); // parse the channel name and the user name from the query string string userName; @@ -60,11 +60,11 @@ void IHttpHandler.ProcessRequest(HttpContext context) RssHttpHandlerHelper.ParseChannelQueryString(context.Request, out channelName, out userName); // populate items (call the derived class) - PopulateChannel(channelName, userName); + this.PopulateChannel(channelName, userName); - OnPreRender(EventArgs.Empty); + this.OnPreRender(EventArgs.Empty); - Render(new XmlTextWriter(Context.Response.OutputStream, null)); + this.Render(new XmlTextWriter(this.Context.Response.OutputStream, null)); } bool IHttpHandler.IsReusable @@ -85,9 +85,9 @@ bool IHttpHandler.IsReusable /// protected virtual void OnInit(EventArgs ea) { - if (Init != null) + if (this.Init != null) { - Init(this, ea); + this.Init(this, ea); } } @@ -96,21 +96,21 @@ protected virtual void OnInit(EventArgs ea) /// protected virtual void OnPreRender(EventArgs ea) { - if (PreRender != null) + if (this.PreRender != null) { - PreRender(this, ea); + this.PreRender(this, ea); } } private void InternalInit(HttpContext context) { - _context = context; + this._context = context; // create the channel - _channel = new RssChannelType(); - _channel.SetDefaults(); + this._channel = new RssChannelType(); + this._channel.SetDefaults(); - Context.Response.ContentType = "text/xml"; + this.Context.Response.ContentType = "text/xml"; } protected virtual void PopulateChannel(string channelName, string userName) @@ -119,7 +119,7 @@ protected virtual void PopulateChannel(string channelName, string userName) protected virtual void Render(XmlTextWriter writer) { - XmlDocument doc = _channel.SaveAsXml(); + XmlDocument doc = this._channel.SaveAsXml(); doc.Save(writer); } } diff --git a/DNN Platform/Syndication/RSS/RssHyperLink.cs b/DNN Platform/Syndication/RSS/RssHyperLink.cs index 6510c85b6ee..d758cb33d05 100644 --- a/DNN Platform/Syndication/RSS/RssHyperLink.cs +++ b/DNN Platform/Syndication/RSS/RssHyperLink.cs @@ -22,7 +22,7 @@ public class RssHyperLink : HyperLink public RssHyperLink() { - Text = "RSS"; + this.Text = "RSS"; } // passed to RssHttpHandler @@ -30,11 +30,11 @@ public string ChannelName { get { - return _channelName; + return this._channelName; } set { - _channelName = value; + this._channelName = value; } } @@ -43,27 +43,27 @@ public bool IncludeUserName { get { - return _includeUserName; + return this._includeUserName; } set { - _includeUserName = value; + this._includeUserName = value; } } protected override void OnPreRender(EventArgs e) { // modify the NavigateUrl to include optional user name and channel name - string channel = _channelName != null ? _channelName : string.Empty; - string user = _includeUserName ? Context.User.Identity.Name : string.Empty; - NavigateUrl = RssHttpHandlerHelper.GenerateChannelLink(NavigateUrl, channel, user); + string channel = this._channelName != null ? this._channelName : string.Empty; + string user = this._includeUserName ? this.Context.User.Identity.Name : string.Empty; + this.NavigateUrl = RssHttpHandlerHelper.GenerateChannelLink(this.NavigateUrl, channel, user); // add to tag (if is present) - if (Page.Header != null) + if (this.Page.Header != null) { - string title = string.IsNullOrEmpty(channel) ? Text : channel; + string title = string.IsNullOrEmpty(channel) ? this.Text : channel; - Page.Header.Controls.Add(new LiteralControl(string.Format("\r\n", title, NavigateUrl))); + this.Page.Header.Controls.Add(new LiteralControl(string.Format("\r\n", title, this.NavigateUrl))); } base.OnPreRender(e); diff --git a/DNN Platform/Syndication/packages.config b/DNN Platform/Syndication/packages.config new file mode 100644 index 00000000000..e619441b462 --- /dev/null +++ b/DNN Platform/Syndication/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/CachedWebPage.cs b/DNN Platform/Tests/DNN.Integration.Test.Framework/CachedWebPage.cs index 283b358c4c4..609b50c1581 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/CachedWebPage.cs +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/CachedWebPage.cs @@ -12,9 +12,9 @@ internal class CachedWebPage public CachedWebPage(string token, string[] fields) { - FetchDateTime = DateTime.Now; - VerificationToken = token; - InputFields = fields; + this.FetchDateTime = DateTime.Now; + this.VerificationToken = token; + this.InputFields = fields; } public DateTime FetchDateTime { get; private set; } // when was this loaded @@ -22,8 +22,8 @@ public CachedWebPage(string token, string[] fields) public string[] InputFields { - get { return _inputFields.Clone() as string[]; } - private set { _inputFields = value; } + get { return this._inputFields.Clone() as string[]; } + private set { this._inputFields = value; } } } } diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/Controllers/SchedulerController.cs b/DNN Platform/Tests/DNN.Integration.Test.Framework/Controllers/SchedulerController.cs index fee34960fb1..d22634efb35 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/Controllers/SchedulerController.cs +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/Controllers/SchedulerController.cs @@ -246,11 +246,11 @@ public ScheduleHistoryInfo(IDictionary queryResult) { try { - ScheduleId = Convert.ToInt32(queryResult["ScheduleId"]); - ScheduleHistoryId = Convert.ToInt32(queryResult["ScheduleHistoryId"]); - EndDate = Convert.ToDateTime(queryResult["EndDate"]); - Succeeded = Convert.ToBoolean(queryResult["Succeeded"]); - LogNotes = queryResult["LogNotes"].ToString(); + this.ScheduleId = Convert.ToInt32(queryResult["ScheduleId"]); + this.ScheduleHistoryId = Convert.ToInt32(queryResult["ScheduleHistoryId"]); + this.EndDate = Convert.ToDateTime(queryResult["EndDate"]); + this.Succeeded = Convert.ToBoolean(queryResult["Succeeded"]); + this.LogNotes = queryResult["LogNotes"].ToString(); } catch (Exception e) { @@ -262,21 +262,21 @@ public ScheduleHistoryInfo(IDictionary queryResult) internal ScheduleHistoryInfo(int scheduleId, int scheduleHistoryID, DateTime endDate, bool succeeded) { - ScheduleId = scheduleId; - ScheduleHistoryId = scheduleHistoryID; - EndDate = endDate; - Succeeded = succeeded; - LogNotes = string.Empty; + this.ScheduleId = scheduleId; + this.ScheduleHistoryId = scheduleHistoryID; + this.EndDate = endDate; + this.Succeeded = succeeded; + this.LogNotes = string.Empty; } // clones another info with success as false internal ScheduleHistoryInfo(ScheduleHistoryInfo lastRunInfo) { - ScheduleId = lastRunInfo.ScheduleId; - ScheduleHistoryId = lastRunInfo.ScheduleHistoryId; - EndDate = lastRunInfo.EndDate; - Succeeded = false; - LogNotes = lastRunInfo.LogNotes; + this.ScheduleId = lastRunInfo.ScheduleId; + this.ScheduleHistoryId = lastRunInfo.ScheduleHistoryId; + this.EndDate = lastRunInfo.EndDate; + this.Succeeded = false; + this.LogNotes = lastRunInfo.LogNotes; } } } diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/DNN.Integration.Test.Framework.csproj b/DNN Platform/Tests/DNN.Integration.Test.Framework/DNN.Integration.Test.Framework.csproj index abc261942e8..4030f417ae1 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/DNN.Integration.Test.Framework.csproj +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/DNN.Integration.Test.Framework.csproj @@ -1,117 +1,124 @@ - - - - - Debug - AnyCPU - {8F727796-7C6C-4F42-B385-67B06ECD358E} - Library - Properties - DNN.Integration.Test.Framework - DNN.Integration.Test.Framework - v4.7.2 - 512 - - - - AnyCPU - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - 1591, 618 - 7 - - - AnyCPU - pdbonly - true - bin\ - TRACE - prompt - 4 - 1591, 618 - 7 - - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - True - - - ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - True - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - ..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True - - - - - - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - + + + + + Debug + AnyCPU + {8F727796-7C6C-4F42-B385-67B06ECD358E} + Library + Properties + DNN.Integration.Test.Framework + DNN.Integration.Test.Framework + v4.7.2 + 512 + + + + AnyCPU + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + 1591, 618 + 7 + + + AnyCPU + pdbonly + true + bin\ + TRACE + prompt + 4 + 1591, 618 + 7 + + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + True + + + ..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + True + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + ..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + True + + + + + + + + + + Properties\SolutionInfo.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + stylecop.json + + + + + + + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/FileParameter.cs b/DNN Platform/Tests/DNN.Integration.Test.Framework/FileParameter.cs index f2ec3c2d235..18f34bd25a3 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/FileParameter.cs +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/FileParameter.cs @@ -13,9 +13,9 @@ public FileParameter(byte[] file) : this(file, null) { } public FileParameter(byte[] file, string filename) : this(file, filename, null) { } public FileParameter(byte[] file, string filename, string contenttype) { - File = file; - FileName = filename; - ContentType = contenttype; + this.File = file; + this.FileName = filename; + this.ContentType = contenttype; } } } diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiConnector.cs b/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiConnector.cs index a84b69c84fe..0be51f2ad81 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiConnector.cs +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiConnector.cs @@ -45,8 +45,8 @@ public static WebApiConnector GetWebConnector(string siteUrl, string userName) public string UserAgentValue { - get { return _userAgentValue ?? (_userAgentValue = ConfigurationManager.AppSettings["HttpUserAgent"] ?? DefaultUserAgent); } - set { _userAgentValue = value; } + get { return this._userAgentValue ?? (this._userAgentValue = ConfigurationManager.AppSettings["HttpUserAgent"] ?? DefaultUserAgent); } + set { this._userAgentValue = value; } } private const string LoginPath = "/Login"; @@ -64,7 +64,7 @@ public string UserAgentValue void ResetUserId() { - _userId = -1; + this._userId = -1; } /// @@ -75,12 +75,12 @@ public int UserId { get { - if (_userId <= 0 && IsLoggedIn) + if (this._userId <= 0 && this.IsLoggedIn) { - _userId = UserController.GetUserId(UserName); + this._userId = UserController.GetUserId(this.UserName); } - return _userId; + return this._userId; } } @@ -99,23 +99,23 @@ public int UserId private WebApiConnector(string siteUrl) { - Timeout = TimeSpan.FromMinutes(1); - Domain = new Uri(siteUrl); - IsLoggedIn = false; - ResetUserId(); - _sessionCookiesContainer = new CookieContainer(); - _cookieVerificationToken = new Cookie(RqVerifTokenName, string.Empty, "/", Domain.Host); - AvoidCaching = false; + this.Timeout = TimeSpan.FromMinutes(1); + this.Domain = new Uri(siteUrl); + this.IsLoggedIn = false; + this.ResetUserId(); + this._sessionCookiesContainer = new CookieContainer(); + this._cookieVerificationToken = new Cookie(RqVerifTokenName, string.Empty, "/", this.Domain.Host); + this.AvoidCaching = false; } public void Dispose() { - Logout(); + this.Logout(); } private void EnsureLoggedIn() { - if (!IsLoggedIn) + if (!this.IsLoggedIn) { Console.WriteLine(@"User not logged in yet"); throw new WebApiException(new HttpRequestException("User not logged in yet."), @@ -127,8 +127,8 @@ public CookieContainer SessionCookies { get { - EnsureLoggedIn(); - return _sessionCookiesContainer; + this.EnsureLoggedIn(); + return this._sessionCookiesContainer; } } @@ -136,20 +136,20 @@ public CookieContainer SessionCookies public void Logout() { - if (IsLoggedIn) + if (this.IsLoggedIn) { - LoggedInAtTime = DateTime.MinValue; - IsLoggedIn = false; - ResetUserId(); + this.LoggedInAtTime = DateTime.MinValue; + this.IsLoggedIn = false; + this.ResetUserId(); try { - var requestUriString = CombineUrlPath(Domain, LogoffPath); + var requestUriString = CombineUrlPath(this.Domain, LogoffPath); var httpWebRequest1 = (HttpWebRequest) WebRequest.Create(requestUriString); httpWebRequest1.Method = "GET"; httpWebRequest1.KeepAlive = false; - httpWebRequest1.CookieContainer = _sessionCookiesContainer; + httpWebRequest1.CookieContainer = this._sessionCookiesContainer; httpWebRequest1.ReadWriteTimeout = 90; - httpWebRequest1.UserAgent = UserAgentValue; + httpWebRequest1.UserAgent = this.UserAgentValue; using (httpWebRequest1.GetResponse()) { // no need to read the response stream after we logoff @@ -157,25 +157,25 @@ public void Logout() } finally { - _cookieVerificationToken = null; - _sessionCookiesContainer = new CookieContainer(); + this._cookieVerificationToken = null; + this._sessionCookiesContainer = new CookieContainer(); - var url = CombineUrlPath(Domain, "/"); + var url = CombineUrlPath(this.Domain, "/"); CachedWebPage cachedPage; - if (!AvoidCaching && CachedPages.TryGetValue(url, out cachedPage) && + if (!this.AvoidCaching && CachedPages.TryGetValue(url, out cachedPage) && cachedPage.FetchDateTime < DateTime.Now.AddMinutes(-19.5)) { - _inputFieldVerificationToken = cachedPage.VerificationToken; + this._inputFieldVerificationToken = cachedPage.VerificationToken; } else - _inputFieldVerificationToken = null; + this._inputFieldVerificationToken = null; } } } public bool Login(string password) { - if (IsLoggedIn) return true; + if (this.IsLoggedIn) return true; // This method uses multi-part parameters in the post body // the response is similar to this: @@ -184,7 +184,7 @@ public bool Login(string password) const string fieldsPrefix = "dnn$ctr$Login$Login_DNN"; var postData = new Dictionary { - {fieldsPrefix + "$txtUsername", UserName}, + {fieldsPrefix + "$txtUsername", this.UserName}, {fieldsPrefix + "$txtPassword", password}, {"__EVENTTARGET", fieldsPrefix + "$cmdLogin"}, // most important field; button action {"__EVENTARGUMENT", ""} @@ -193,23 +193,23 @@ public bool Login(string password) var excludedInputPrefixes = new List(); //CombineUrlPath(_domain, LoginPath); - using (var httpResponse2 = PostUserForm(LoginPath, postData, excludedInputPrefixes, false)) + using (var httpResponse2 = this.PostUserForm(LoginPath, postData, excludedInputPrefixes, false)) { if (httpResponse2 != null && httpResponse2.StatusCode < HttpStatusCode.BadRequest) // < 400 { using (httpResponse2) { - VerifyLogInCookie(httpResponse2); + this.VerifyLogInCookie(httpResponse2); } } } - if (IsLoggedIn) + if (this.IsLoggedIn) { - LoggedInAtTime = DateTime.Now; + this.LoggedInAtTime = DateTime.Now; } - return IsLoggedIn; + return this.IsLoggedIn; } private void VerifyLogInCookie(HttpWebResponse httpResponse) @@ -218,8 +218,8 @@ private void VerifyLogInCookie(HttpWebResponse httpResponse) var loginCookie = httpResponse.Cookies[cookie]; if (loginCookie != null) { - IsLoggedIn = true; - ExtractVerificationCookie(httpResponse.Headers["Set-Cookie"] ?? string.Empty); + this.IsLoggedIn = true; + this.ExtractVerificationCookie(httpResponse.Headers["Set-Cookie"] ?? string.Empty); using (var rs = httpResponse.GetResponseStream()) { if (rs != null && httpResponse.StatusCode == HttpStatusCode.OK) @@ -228,7 +228,7 @@ private void VerifyLogInCookie(HttpWebResponse httpResponse) var data = sr.ReadToEnd(); var token = GetVerificationToken(data); if (!string.IsNullOrEmpty(token)) - _inputFieldVerificationToken = token; + this._inputFieldVerificationToken = token; } } } @@ -246,15 +246,15 @@ private void ExtractVerificationCookie(string cookiesString) { if (part2.Contains(RqVerifTokenName)) { - _cookieVerificationToken.Value = part2.Split('=')[1]; + this._cookieVerificationToken.Value = part2.Split('=')[1]; } else if (part2.Contains("path")) { - _cookieVerificationToken.Path = part2.Split('=')[1]; + this._cookieVerificationToken.Path = part2.Split('=')[1]; } else if (part2.Contains("HttpOnly")) { - _cookieVerificationToken.HttpOnly = true; + this._cookieVerificationToken.HttpOnly = true; } } break; @@ -296,7 +296,7 @@ private static string GetCurrentTabId(string pageData) public HttpResponseMessage UploadUserFile(string fileName, bool waitHttpResponse = true, int userId = -1) { - EnsureLoggedIn(); + this.EnsureLoggedIn(); var folder = "Users"; if (userId > Null.NullInteger) @@ -306,41 +306,41 @@ public HttpResponseMessage UploadUserFile(string fileName, bool waitHttpResponse folder = $"Users/{rootFolder}/{subFolder}/{userId}/"; } - return UploadFile(fileName, folder, waitHttpResponse); + return this.UploadFile(fileName, folder, waitHttpResponse); } public HttpResponseMessage ActivityStreamUploadUserFile(IDictionary headers, string fileName) { - EnsureLoggedIn(); - return ActivityStreamUploadFile(headers, fileName); + this.EnsureLoggedIn(); + return this.ActivityStreamUploadFile(headers, fileName); } public bool UploadCmsFile(string fileName, string portalFolder) { - EnsureLoggedIn(); - var result = UploadFile(fileName, portalFolder); + this.EnsureLoggedIn(); + var result = this.UploadFile(fileName, portalFolder); return result.IsSuccessStatusCode; } private HttpResponseMessage UploadFile(string fileName, string portalFolder, bool waitHttpResponse = true) { - using (var client = CreateHttpClient("/", true)) + using (var client = this.CreateHttpClient("/", true)) { var headers = client.DefaultRequestHeaders; headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html", 0.8)); - headers.UserAgent.ParseAdd(UserAgentValue); + headers.UserAgent.ParseAdd(this.UserAgentValue); - if (string.IsNullOrEmpty(_inputFieldVerificationToken)) + if (string.IsNullOrEmpty(this._inputFieldVerificationToken)) { var resultGet = client.GetAsync("/").Result; var data = resultGet.Content.ReadAsStringAsync().Result; - _inputFieldVerificationToken = GetVerificationToken(data); + this._inputFieldVerificationToken = GetVerificationToken(data); - if (!string.IsNullOrEmpty(_inputFieldVerificationToken)) + if (!string.IsNullOrEmpty(this._inputFieldVerificationToken)) { - client.DefaultRequestHeaders.Add(RqVerifTokenNameNoUndescrores, _inputFieldVerificationToken); + client.DefaultRequestHeaders.Add(RqVerifTokenNameNoUndescrores, this._inputFieldVerificationToken); } else { @@ -371,7 +371,7 @@ private HttpResponseMessage UploadFile(string fileName, string portalFolder, boo content.Add(fileContent); - client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgentValue); + client.DefaultRequestHeaders.UserAgent.ParseAdd(this.UserAgentValue); var result = client.PostAsync(UploadFileRequestPath, content).Result; return !waitHttpResponse ? result @@ -388,15 +388,15 @@ private HttpResponseMessage ActivityStreamUploadFile( }) using (var client = new HttpClient(clientHandler)) { - clientHandler.CookieContainer = _sessionCookiesContainer; - client.BaseAddress = Domain; - client.Timeout = Timeout; + clientHandler.CookieContainer = this._sessionCookiesContainer; + client.BaseAddress = this.Domain; + client.Timeout = this.Timeout; var rqHeaders = client.DefaultRequestHeaders; rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html", 0.8)); rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("image/png")); - rqHeaders.UserAgent.ParseAdd(UserAgentValue); + rqHeaders.UserAgent.ParseAdd(this.UserAgentValue); var resultGet = client.GetAsync("/").Result; var data = resultGet.Content.ReadAsStringAsync().Result; @@ -439,16 +439,16 @@ public HttpResponseMessage PostJson(string relativeUrl, object content, IDictionary contentHeaders = null, bool waitHttpResponse = true, bool ignoreLoggedIn = false) { if(!ignoreLoggedIn) - EnsureLoggedIn(); + this.EnsureLoggedIn(); - using (var client = CreateHttpClient("/", true)) + using (var client = this.CreateHttpClient("/", true)) { var rqHeaders = client.DefaultRequestHeaders; rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html", 0.5d)); rqHeaders.Add("X-Requested-With", "XMLHttpRequest"); rqHeaders.UserAgent.Clear(); - rqHeaders.UserAgent.ParseAdd(UserAgentValue); + rqHeaders.UserAgent.ParseAdd(this.UserAgentValue); if (contentHeaders != null) { @@ -463,7 +463,7 @@ public HttpResponseMessage PostJson(string relativeUrl, } } - var requestUriString = CombineUrlPath(Domain, relativeUrl); + var requestUriString = CombineUrlPath(this.Domain, relativeUrl); var result = client.PostAsJsonAsync(requestUriString, content).Result; return !waitHttpResponse ? result @@ -475,16 +475,16 @@ public HttpResponseMessage PutJson(string relativeUrl, object content, IDictionary contentHeaders = null, bool waitHttpResponse = true, bool ignoreLoggedIn = false) { if (!ignoreLoggedIn) - EnsureLoggedIn(); + this.EnsureLoggedIn(); - using (var client = CreateHttpClient("/", true)) + using (var client = this.CreateHttpClient("/", true)) { var rqHeaders = client.DefaultRequestHeaders; rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html", 0.5d)); rqHeaders.Add("X-Requested-With", "XMLHttpRequest"); rqHeaders.UserAgent.Clear(); - rqHeaders.UserAgent.ParseAdd(UserAgentValue); + rqHeaders.UserAgent.ParseAdd(this.UserAgentValue); if (contentHeaders != null) { @@ -499,7 +499,7 @@ public HttpResponseMessage PutJson(string relativeUrl, } } - var requestUriString = CombineUrlPath(Domain, relativeUrl); + var requestUriString = CombineUrlPath(this.Domain, relativeUrl); var result = client.PutAsJsonAsync(requestUriString, content).Result; return !waitHttpResponse ? result @@ -512,31 +512,31 @@ private HttpClient CreateHttpClient(string path, bool autoRedirect) var clientHandler = new HttpClientHandler { AllowAutoRedirect = autoRedirect, - CookieContainer = _sessionCookiesContainer, + CookieContainer = this._sessionCookiesContainer, }; - var url = CombineUrlPath(Domain, path); + var url = CombineUrlPath(this.Domain, path); var client = new HttpClient(clientHandler) { - BaseAddress = Domain, - Timeout = Timeout + BaseAddress = this.Domain, + Timeout = this.Timeout }; - if (string.IsNullOrEmpty(_inputFieldVerificationToken)) + if (string.IsNullOrEmpty(this._inputFieldVerificationToken)) { - client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgentValue); + client.DefaultRequestHeaders.UserAgent.ParseAdd(this.UserAgentValue); var resultGet = client.GetAsync(url).Result; var data = resultGet.Content.ReadAsStringAsync().Result; - _inputFieldVerificationToken = GetVerificationToken(data); - client.DefaultRequestHeaders.Add(RqVerifTokenNameNoUndescrores, _inputFieldVerificationToken); + this._inputFieldVerificationToken = GetVerificationToken(data); + client.DefaultRequestHeaders.Add(RqVerifTokenNameNoUndescrores, this._inputFieldVerificationToken); - _currentTabId = GetCurrentTabId(data); - client.DefaultRequestHeaders.Add("TabId", _currentTabId); + this._currentTabId = GetCurrentTabId(data); + client.DefaultRequestHeaders.Add("TabId", this._currentTabId); } else { - client.DefaultRequestHeaders.Add("TabId", _currentTabId); - client.DefaultRequestHeaders.Add(RqVerifTokenNameNoUndescrores, _inputFieldVerificationToken); + client.DefaultRequestHeaders.Add("TabId", this._currentTabId); + client.DefaultRequestHeaders.Add(RqVerifTokenNameNoUndescrores, this._inputFieldVerificationToken); } return client; @@ -545,15 +545,15 @@ private HttpClient CreateHttpClient(string path, bool autoRedirect) private string[] GetPageInputFields(HttpClient client, string path) { CachedWebPage cachedPage = null; - var url = CombineUrlPath(Domain, path); - if (!IsLoggedIn || AvoidCaching || + var url = CombineUrlPath(this.Domain, path); + if (!this.IsLoggedIn || this.AvoidCaching || (!CachedPages.TryGetValue(url, out cachedPage) || cachedPage.FetchDateTime < DateTime.Now.AddMinutes(-19.5))) { try { var requestVerificationToken = string.Empty; - client.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgentValue); + client.DefaultRequestHeaders.UserAgent.ParseAdd(this.UserAgentValue); var resultGet = client.GetAsync(url).Result; var data = resultGet.Content.ReadAsStringAsync().Result; const string str1 = " excludedInputPrefixes, bool checkUserLoggedIn = true, bool followRedirect = false) { if (checkUserLoggedIn) - EnsureLoggedIn(); + this.EnsureLoggedIn(); var clientHandler = new HttpClientHandler { - CookieContainer = _sessionCookiesContainer, + CookieContainer = this._sessionCookiesContainer, }; var postParameters = new Dictionary(); string[] inputFields; using (var client = new HttpClient(clientHandler) { - BaseAddress = Domain, - Timeout = Timeout + BaseAddress = this.Domain, + Timeout = this.Timeout }) { - inputFields = GetPageInputFields(client, relativeUrl); + inputFields = this.GetPageInputFields(client, relativeUrl); } var firstField = formFields.First().Key; @@ -623,7 +623,7 @@ public HttpWebResponse PostUserForm(string relativeUrl, IDictionary 0) { - var url = CombineUrlPath(Domain, relativeUrl); - return MultipartFormDataPost(url, UserAgentValue, postParameters, null, followRedirect); + var url = CombineUrlPath(this.Domain, relativeUrl); + return this.MultipartFormDataPost(url, this.UserAgentValue, postParameters, null, followRedirect); } return null; @@ -719,8 +719,8 @@ where key.StartsWith(prefix) public HttpWebResponse MultipartFormDataPost(string relativeUrl, IDictionary postParameters, IDictionary headers = null, bool followRedirect = false) { - var url = CombineUrlPath(Domain, relativeUrl); - return MultipartFormDataPost(url, UserAgentValue, postParameters, headers, followRedirect); + var url = CombineUrlPath(this.Domain, relativeUrl); + return this.MultipartFormDataPost(url, this.UserAgentValue, postParameters, headers, followRedirect); } private HttpWebResponse MultipartFormDataPost( @@ -729,7 +729,7 @@ private HttpWebResponse MultipartFormDataPost( var formDataBoundary = string.Format("----WebKitFormBoundary{0:X16}", DateTime.Now.Ticks); var contentType = "multipart/form-data; boundary=" + formDataBoundary; var formData = GetMultipartFormData(postParameters, formDataBoundary); - return PostForm(postUrl, userAgent, contentType, headers, formData, followRedirect); + return this.PostForm(postUrl, userAgent, contentType, headers, formData, followRedirect); } private HttpWebResponse PostForm(string postUrl, string userAgent, string contentType, IDictionary headers, byte[] formData, bool followRedirect) @@ -745,9 +745,9 @@ private HttpWebResponse PostForm(string postUrl, string userAgent, string conten request.Method = "POST"; request.ContentType = contentType; request.UserAgent = userAgent; - request.CookieContainer = _sessionCookiesContainer; + request.CookieContainer = this._sessionCookiesContainer; request.ContentLength = formData.Length; - request.Headers.Add(RqVerifTokenNameNoUndescrores, _inputFieldVerificationToken); + request.Headers.Add(RqVerifTokenNameNoUndescrores, this._inputFieldVerificationToken); if (headers != null) { foreach (var h in headers) @@ -869,19 +869,19 @@ public HttpResponseMessage GetContent( bool waitHttpResponse = true, bool autoRedirect = true) { var url = relativeUrl + "?" + QueryStringFromObject(parameters); - return GetContent(url, contentHeaders, waitHttpResponse, autoRedirect); + return this.GetContent(url, contentHeaders, waitHttpResponse, autoRedirect); } public HttpResponseMessage GetContent( string relativeUrl, Dictionary contentHeaders = null, bool waitHttpResponse = true, bool autoRedirect = true) { - using (var client = CreateHttpClient("/", autoRedirect)) + using (var client = this.CreateHttpClient("/", autoRedirect)) { var rqHeaders = client.DefaultRequestHeaders; rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); rqHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html", 0.5d)); rqHeaders.Add("X-Requested-With", "XMLHttpRequest"); - rqHeaders.UserAgent.ParseAdd(UserAgentValue); + rqHeaders.UserAgent.ParseAdd(this.UserAgentValue); if (contentHeaders != null) { @@ -891,7 +891,7 @@ public HttpResponseMessage GetContent( } } - var requestUriString = CombineUrlPath(Domain, relativeUrl); + var requestUriString = CombineUrlPath(this.Domain, relativeUrl); var uri = new Uri(requestUriString); var result = client.GetAsync(uri.AbsoluteUri).Result; return !waitHttpResponse diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiException.cs b/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiException.cs index 1f8035330fd..03eee598eea 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiException.cs +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/WebApiException.cs @@ -23,13 +23,13 @@ public class WebApiException : Exception public WebApiException(Exception innerException, HttpResponseMessage result) : base(innerException.Message, innerException) { - Result = result; + this.Result = result; } public WebApiException(Exception innerException, HttpResponseMessage result, string body) : this(innerException, result) { - Body = body; + this.Body = body; } /// @@ -44,7 +44,7 @@ public WebApiException(Exception innerException, HttpResponseMessage result, str public dynamic BodyAsJson() { - return JsonConvert.DeserializeObject(Body); + return JsonConvert.DeserializeObject(this.Body); } } } diff --git a/DNN Platform/Tests/DNN.Integration.Test.Framework/packages.config b/DNN Platform/Tests/DNN.Integration.Test.Framework/packages.config index 8cb9d3edd76..80bdfba0190 100644 --- a/DNN Platform/Tests/DNN.Integration.Test.Framework/packages.config +++ b/DNN Platform/Tests/DNN.Integration.Test.Framework/packages.config @@ -1,8 +1,9 @@ - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityProviderTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityProviderTest.cs index b3351185dd6..446bbc93b83 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityProviderTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityProviderTest.cs @@ -34,7 +34,7 @@ public class AspNetClientCapabilityProviderTest [SetUp] public void Setup() { - _clientCapabilityProvider = new Providers.AspNetClientCapabilityProvider.AspNetClientCapabilityProvider(); + this._clientCapabilityProvider = new Providers.AspNetClientCapabilityProvider.AspNetClientCapabilityProvider(); ComponentFactory.Container = new SimpleContainer(); var dataProvider = MockComponentProvider.CreateDataProvider(); @@ -66,7 +66,7 @@ public void AspNetClientCapabilityProvider_GetClientCapabilityById_ThrowsExcepti { //Act string nullClientCapabilityId = String.Empty; - var clientCapabilitiesByNullId = _clientCapabilityProvider.GetClientCapabilityById(nullClientCapabilityId); + var clientCapabilitiesByNullId = this._clientCapabilityProvider.GetClientCapabilityById(nullClientCapabilityId); } [Test] @@ -75,7 +75,7 @@ public void AspNetClientCapabilityProvider_GetClientCapabilityById_ThrowsExcepti { //Act string nullClientCapabilityId = null; - var clientCapabilitiesByEmptyId = _clientCapabilityProvider.GetClientCapabilityById(nullClientCapabilityId); + var clientCapabilitiesByEmptyId = this._clientCapabilityProvider.GetClientCapabilityById(nullClientCapabilityId); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityTest.cs index bae2c108262..42df2e4d574 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/AspNetClientCapabilityTest.cs @@ -50,7 +50,7 @@ public class AspNetClientCapabilityTest [SetUp] public void Setup() { - _clientCapabilityProvider = new Providers.AspNetClientCapabilityProvider.AspNetClientCapabilityProvider(); + this._clientCapabilityProvider = new Providers.AspNetClientCapabilityProvider.AspNetClientCapabilityProvider(); ComponentFactory.Container = new SimpleContainer(); var dataProvider = MockComponentProvider.CreateDataProvider(); @@ -73,7 +73,7 @@ public void TearDown() public void AspNetClientCapability_IsMobile_Returns_True_For_BlackBerry9105V1() { //Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(blackBerry9105V1); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(blackBerry9105V1); // Act var bIsMobile = clientCapability.IsMobile; @@ -87,7 +87,7 @@ public void AspNetClientCapability_IsMobile_Returns_True_For_BlackBerry9105V1() public void AspNetClientCapability_IsMobile_Returns_True_For_IPhone() { // Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(iphoneUserAgent); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(iphoneUserAgent); // Act var bIsMobile = clientCapability.IsMobile; @@ -100,7 +100,7 @@ public void AspNetClientCapability_IsMobile_Returns_True_For_IPhone() public void AspNetClientCapability_IsMobile_Returns_True_For_WP7() { //Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(wp7UserAgent); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(wp7UserAgent); // Act var bIsMobile = clientCapability.IsMobile; @@ -113,7 +113,7 @@ public void AspNetClientCapability_IsMobile_Returns_True_For_WP7() public void AspNetClientCapability_IsMobile_Returns_True_For_IPad() { //Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(iPadTabletUserAgent); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(iPadTabletUserAgent); // Act var bIsMobile = clientCapability.IsMobile; @@ -131,7 +131,7 @@ public void AspNetClientCapability_IsMobile_Returns_True_For_SamsungGalaxyGTP100 //var capabilities = new HttpCapabilitiesDefaultProvider().GetBrowserCapabilities(HttpContext.Current.Request); //Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(samsungGalaxyTablet); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(samsungGalaxyTablet); // Act var isMobile = clientCapability.IsMobile; @@ -144,7 +144,7 @@ public void AspNetClientCapability_IsMobile_Returns_True_For_SamsungGalaxyGTP100 public void AspNetClientCapability_IsMobile_Returns_False_For_EmptyUserAgent() { //Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(String.Empty); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(String.Empty); // Act var bIsMmobile = clientCapability.IsMobile; @@ -158,7 +158,7 @@ public void AspNetClientCapability_IsMobile_Returns_False_For_NullUserAgent() { //Arrange String agent = null; - var AspNetClientCapability = _clientCapabilityProvider.GetClientCapability(agent); + var AspNetClientCapability = this._clientCapabilityProvider.GetClientCapability(agent); // Act var bIsMobile = AspNetClientCapability.IsMobile; @@ -171,7 +171,7 @@ public void AspNetClientCapability_IsMobile_Returns_False_For_NullUserAgent() public void AspNetClientCapability_IsMobile_Returns_True_For_HTCDesireVer1Sub22() { // Arrange - var AspNetClientCapability = _clientCapabilityProvider.GetClientCapability(htcDesireVer1Sub22UserAgent); + var AspNetClientCapability = this._clientCapabilityProvider.GetClientCapability(htcDesireVer1Sub22UserAgent); // Act var bIsMobile = AspNetClientCapability.IsMobile; @@ -188,7 +188,7 @@ public void AspNetClientCapability_IsMobile_Returns_True_For_HTCDesireVer1Sub22( public void AspNetClientCapability_IsMobile_Returns_False_For_InternetExplorer8() { //Arrange - var AspNetClientCapability = _clientCapabilityProvider.GetClientCapability(msIE8UserAgent); + var AspNetClientCapability = this._clientCapabilityProvider.GetClientCapability(msIE8UserAgent); // Act var bIsMobile = AspNetClientCapability.IsMobile; @@ -201,7 +201,7 @@ public void AspNetClientCapability_IsMobile_Returns_False_For_InternetExplorer8( public void AspNetClientCapability_IsMobile_Returns_False_For_InternetExplorer9() { //Arrange - var AspNetClientCapability = _clientCapabilityProvider.GetClientCapability(msIE9UserAgent); + var AspNetClientCapability = this._clientCapabilityProvider.GetClientCapability(msIE9UserAgent); // Act var bIsMobile = AspNetClientCapability.IsMobile; @@ -214,7 +214,7 @@ public void AspNetClientCapability_IsMobile_Returns_False_For_InternetExplorer9( public void AspNetClientCapability_IsMobile_Returns_False_For_InternetExplorer10() { //Arrange - var AspNetClientCapability = _clientCapabilityProvider.GetClientCapability(msIE10UserAgent); + var AspNetClientCapability = this._clientCapabilityProvider.GetClientCapability(msIE10UserAgent); // Act var bIsMobile = AspNetClientCapability.IsMobile; @@ -227,7 +227,7 @@ public void AspNetClientCapability_IsMobile_Returns_False_For_InternetExplorer10 public void AspNetClientCapability_IsMobile_Returns_False_For_FireFox() { //Arrange - var AspNetClientCapability = _clientCapabilityProvider.GetClientCapability(fireFox5NT61UserAgent); + var AspNetClientCapability = this._clientCapabilityProvider.GetClientCapability(fireFox5NT61UserAgent); // Act var bIsMobile = AspNetClientCapability.IsMobile; @@ -243,7 +243,7 @@ public void AspNetClientCapability_IsMobile_Returns_False_For_FireFox() public void AspNetClientCapability_IsTablet_Returns_False_For_IPhone() { // Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(iphoneUserAgent); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(iphoneUserAgent); // Act var bIsTablet = clientCapability.IsTablet; @@ -256,7 +256,7 @@ public void AspNetClientCapability_IsTablet_Returns_False_For_IPhone() public void AspNetClientCapability_IsTablet_Returns_True_For_PCTablet() { // Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(winTabletPC); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(winTabletPC); // Act var bIsTablet = clientCapability.IsTablet; @@ -273,7 +273,7 @@ public void AspNetClientCapability_IsTablet_Returns_True_For_PCTablet() public void AspNetClientCapability_SupportsFlash_Returns_True_For_HTCDesireVer1Sub22() { // Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(htcDesireVer1Sub22UserAgent); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(htcDesireVer1Sub22UserAgent); // Act var bSupportsFlash = clientCapability.SupportsFlash; @@ -290,7 +290,7 @@ public void AspNetClientCapability_SupportsFlash_Returns_True_For_HTCDesireVer1S public void AspNetClientCapability_SupportsFlash_Returns_False_For_WindowsPhone7() { // Arrange - var clientCapability = _clientCapabilityProvider.GetClientCapability(wp7UserAgent); + var clientCapability = this._clientCapabilityProvider.GetClientCapability(wp7UserAgent); // Act var bIsTablet = clientCapability.IsTablet; diff --git a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/DotNetNuke.Tests.AspNetCCP.csproj b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/DotNetNuke.Tests.AspNetCCP.csproj index cf1a2d094ac..823e768a1e7 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/DotNetNuke.Tests.AspNetCCP.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/DotNetNuke.Tests.AspNetCCP.csproj @@ -1,107 +1,114 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {64BA74E9-411E-4DC1-91CB-DEF7F22468AD} - Library - Properties - DotNetNuke.Tests.AspNetClientCapabilityProviderTest - DotNetNuke.Tests.AspNetClientCapabilityProviderTest - v4.7.2 - 512 - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 7 - - - - ..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - True - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - - - - - - - - - - - - - - - {DDF18E36-41A0-4CA7-A098-78CA6E6F41C1} - DotNetNuke.Instrumentation - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {a3b3f1e8-6c1a-4e35-a5b4-51ecc5a43af7} - DotNetNuke.Providers.AspNetCCP - - - {5AECE021-E449-4A7F-BF82-2FA7B236ED3E} - DotNetNuke.Tests.Utilities - - - - - Designer - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {64BA74E9-411E-4DC1-91CB-DEF7F22468AD} + Library + Properties + DotNetNuke.Tests.AspNetClientCapabilityProviderTest + DotNetNuke.Tests.AspNetClientCapabilityProviderTest + v4.7.2 + 512 + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + 7 + + + + ..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + True + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + + + + + + + + + + + + + + + {DDF18E36-41A0-4CA7-A098-78CA6E6F41C1} + DotNetNuke.Instrumentation + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {a3b3f1e8-6c1a-4e35-a5b4-51ecc5a43af7} + DotNetNuke.Providers.AspNetCCP + + + {5AECE021-E449-4A7F-BF82-2FA7B236ED3E} + DotNetNuke.Tests.Utilities + + + + + stylecop.json + + + Designer + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/packages.config index 74848f88682..295260c892e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.AspNetCCP/packages.config @@ -1,7 +1,8 @@ - - - - - - + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Authentication/DotNetNuke.Tests.Authentication.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Authentication/DotNetNuke.Tests.Authentication.csproj index df083b21e1a..e40072ea892 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Authentication/DotNetNuke.Tests.Authentication.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Authentication/DotNetNuke.Tests.Authentication.csproj @@ -1,132 +1,139 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0E8502FD-DE8B-46A5-AB96-B1BE39777917} - Library - Properties - DotNetNuke.Tests.Authentication - DotNetNuke.Tests.Authentication - v4.7.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - - 4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - - - - - - ..\..\Components\Telerik\bin\Telerik.Web.UI.dll - - - - - - - - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {07e655de-0dd2-4874-bb0c-e818d24c9b59} - DotNetNuke.Authentication.Facebook - - - {0304b44c-ea08-434e-a368-65f619fc67a5} - DotNetNuke.Authentication.Google - - - {46924a38-cab7-485d-9301-191e35f6255f} - DotNetNuke.Authentication.LiveConnect - - - {1c882aa9-2198-41ef-b325-605340fdefe5} - DotNetNuke.Authentication.Twitter - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {0E8502FD-DE8B-46A5-AB96-B1BE39777917} + Library + Properties + DotNetNuke.Tests.Authentication + DotNetNuke.Tests.Authentication + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + + + 4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + + + + + + ..\..\Components\Telerik\bin\Telerik.Web.UI.dll + + + + + + + + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {07e655de-0dd2-4874-bb0c-e818d24c9b59} + DotNetNuke.Authentication.Facebook + + + {0304b44c-ea08-434e-a368-65f619fc67a5} + DotNetNuke.Authentication.Google + + + {46924a38-cab7-485d-9301-191e35f6255f} + DotNetNuke.Authentication.LiveConnect + + + {1c882aa9-2198-41ef-b325-605340fdefe5} + DotNetNuke.Authentication.Twitter + + + + + + + + stylecop.json + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Authentication/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Authentication/packages.config index 53b44f9d8fe..97fd3abee1b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Authentication/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Authentication/packages.config @@ -1,6 +1,7 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/AttachmentControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Content/AttachmentControllerTests.cs index b2dd6ceedb5..4f9069ef09c 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/AttachmentControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/AttachmentControllerTests.cs @@ -34,7 +34,7 @@ public class AttachmentControllerTests public void SetUp() { //Register MockCachingProvider - mockCache = MockComponentProvider.CreateNew(); + this.mockCache = MockComponentProvider.CreateNew(); MockComponentProvider.CreateDataProvider().Setup(c => c.GetProviderPath()).Returns(string.Empty); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentControllerTests.cs index 70c09d2fc5a..3a0652ee784 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentControllerTests.cs @@ -39,13 +39,13 @@ public class ContentControllerTests [SetUp] public void SetUp() { - _mockCache = MockComponentProvider.CreateNew(); - _mockDataProvider = MockComponentProvider.CreateDataProvider(); - _mockSearchHelper = new Mock(); + this._mockCache = MockComponentProvider.CreateNew(); + this._mockDataProvider = MockComponentProvider.CreateDataProvider(); + this._mockSearchHelper = new Mock(); - Services.Search.Internals.SearchHelper.SetTestableInstance(_mockSearchHelper.Object); + Services.Search.Internals.SearchHelper.SetTestableInstance(this._mockSearchHelper.Object); - _mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns( + this._mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns( (string searchTypeName) => new SearchType { SearchTypeName = searchTypeName, SearchTypeId = ModuleSearchTypeId }); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentTypeControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentTypeControllerTests.cs index e6c607b5c97..b09bd67283b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentTypeControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/ContentTypeControllerTests.cs @@ -33,7 +33,7 @@ public class ContentTypeControllerTests public void SetUp() { //Register MockCachingProvider - mockCache = MockComponentProvider.CreateNew(); + this.mockCache = MockComponentProvider.CreateNew(); MockComponentProvider.CreateDataProvider().Setup(c => c.GetProviderPath()).Returns(String.Empty); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/DotNetNuke.Tests.Content.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Content/DotNetNuke.Tests.Content.csproj index 2c6d589a7a4..702d7839a45 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/DotNetNuke.Tests.Content.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/DotNetNuke.Tests.Content.csproj @@ -1,146 +1,153 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {22A67B3F-D9B6-4447-A3F7-E387075AF969} - Library - Properties - DotNetNuke.Tests.Content - DotNetNuke.Tests.Content - v4.7.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - - 4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - - False - ..\..\DotNetNuke.Log4net\bin\dotnetnuke.log4net.dll - - - ..\..\..\Packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - False - ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - - - - - - ..\..\Components\Telerik\bin\Telerik.Web.UI.dll - - - - - - - - - Code - - - - - - - - {04f77171-0634-46e0-a95e-d7477c88712e} - DotNetNuke.Log4Net - - - {B1699614-39D4-468A-AB1D-A2FBA97CADDF} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {2595aade-d3e0-4205-b8af-109cb23f4223} - DotNetNuke.Tests.Data - - - {68368906-57dd-40d1-ac10-35211a17d617} - DotNetNuke.Tests.Utilities - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {22A67B3F-D9B6-4447-A3F7-E387075AF969} + Library + Properties + DotNetNuke.Tests.Content + DotNetNuke.Tests.Content + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + + + 4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + + False + ..\..\DotNetNuke.Log4net\bin\dotnetnuke.log4net.dll + + + ..\..\..\Packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + False + ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + + + + + + ..\..\Components\Telerik\bin\Telerik.Web.UI.dll + + + + + + + + + Code + + + + + + + + {04f77171-0634-46e0-a95e-d7477c88712e} + DotNetNuke.Log4Net + + + {B1699614-39D4-468A-AB1D-A2FBA97CADDF} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {2595aade-d3e0-4205-b8af-109cb23f4223} + DotNetNuke.Tests.Data + + + {68368906-57dd-40d1-ac10-35211a17d617} + DotNetNuke.Tests.Utilities + + + + + + + + stylecop.json + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/ScopeTypeControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Content/ScopeTypeControllerTests.cs index b6fffb5e267..b0933fd1783 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/ScopeTypeControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/ScopeTypeControllerTests.cs @@ -33,7 +33,7 @@ public class ScopeTypeControllerTests public void SetUp() { //Register MockCachingProvider - mockCache = MockComponentProvider.CreateNew(); + this.mockCache = MockComponentProvider.CreateNew(); MockComponentProvider.CreateDataProvider().Setup(c => c.GetProviderPath()).Returns(String.Empty); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/TermControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Content/TermControllerTests.cs index 53c4ef372de..2540e20aaa0 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/TermControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/TermControllerTests.cs @@ -37,7 +37,7 @@ public void SetUp() Mock vocabularyController = MockHelper.CreateMockVocabularyController(); MockComponentProvider.CreateDataProvider().Setup(c => c.GetProviderPath()).Returns(String.Empty); //Register MockCachingProvider - mockCache = MockComponentProvider.CreateNew(); + this.mockCache = MockComponentProvider.CreateNew(); } [TearDown] @@ -201,7 +201,7 @@ public void TermController_AddTerm_Clears_Term_Cache_On_Valid_Term() termController.AddTerm(term); //Assert - mockCache.Verify(cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId))); + this.mockCache.Verify(cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId))); } #endregion @@ -327,7 +327,7 @@ public void TermController_DeleteTerm_Clears_Term_Cache_On_Valid_Term() termController.DeleteTerm(term); //Assert - mockCache.Verify(cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId))); + this.mockCache.Verify(cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId))); } #endregion @@ -641,7 +641,7 @@ public void TermController_UpdateTerm_Clears_Term_Cache_On_Valid_Term() termController.UpdateTerm(term); //Assert - mockCache.Verify(cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId))); + this.mockCache.Verify(cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId))); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/VocabularyControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Content/VocabularyControllerTests.cs index 9b77fa5d5eb..c2f24045224 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/VocabularyControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/VocabularyControllerTests.cs @@ -33,7 +33,7 @@ public class VocabularyControllerTests public void SetUp() { //Register MockCachingProvider - mockCache = MockComponentProvider.CreateNew(); + this.mockCache = MockComponentProvider.CreateNew(); MockComponentProvider.CreateDataProvider().Setup(c => c.GetProviderPath()).Returns(String.Empty); } @@ -149,7 +149,7 @@ public void VocabularyController_AddVocabulary_Clears_Vocabulary_Cache_On_Valid_ vocabularyController.AddVocabulary(vocabulary); //Assert - mockCache.Verify(cache => cache.Remove(Constants.VOCABULARY_CacheKey)); + this.mockCache.Verify(cache => cache.Remove(Constants.VOCABULARY_CacheKey)); } #endregion @@ -212,7 +212,7 @@ public void VocabularyController_DeleteVocabulary_Clears_Vocabulary_Cache_On_Val vocabularyController.DeleteVocabulary(vocabulary); //Assert - mockCache.Verify(cache => cache.Remove(Constants.VOCABULARY_CacheKey)); + this.mockCache.Verify(cache => cache.Remove(Constants.VOCABULARY_CacheKey)); } #endregion @@ -337,7 +337,7 @@ public void VocabularyController__UpdateVocabulary_Clears_Vocabulary_Cache_On_Va vocabularyController.UpdateVocabulary(vocabulary); //Assert - mockCache.Verify(cache => cache.Remove(Constants.VOCABULARY_CacheKey)); + this.mockCache.Verify(cache => cache.Remove(Constants.VOCABULARY_CacheKey)); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Content/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Content/packages.config index 7641c2a4248..4506cb7ef82 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Content/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Content/packages.config @@ -1,7 +1,8 @@ - - - - - - + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/CollectionExtensionTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/CollectionExtensionTests.cs index 5e27abcbcd5..5835ea74617 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/CollectionExtensionTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/CollectionExtensionTests.cs @@ -27,7 +27,7 @@ public void get_null_string_from_hashtable_for_missing_value() var value = table.GetValueOrDefault("cat id"); - Expect(value, Is.Null); + this.Expect(value, Is.Null); } [Test] @@ -37,7 +37,7 @@ public void can_get_string_from_hashtable() var value = table.GetValueOrDefault("app id"); - Expect(value, Is.EqualTo("abc123")); + this.Expect(value, Is.EqualTo("abc123")); } [Test] @@ -47,7 +47,7 @@ public void get_string_from_hashtable_when_default_is_provided() var value = table.GetValueOrDefault("app id", "abracadabra"); - Expect(value, Is.EqualTo("abc123")); + this.Expect(value, Is.EqualTo("abc123")); } [Test] @@ -57,7 +57,7 @@ public void can_get_default_string_from_hashtable() var value = table.GetValueOrDefault("cat id", "Frank"); - Expect(value, Is.EqualTo("Frank")); + this.Expect(value, Is.EqualTo("Frank")); } [Test] @@ -67,7 +67,7 @@ public void can_get_bool_from_hashtable() var value = table.GetValueOrDefault("app id"); - Expect(value, Is.True); + this.Expect(value, Is.True); } [Test] @@ -77,7 +77,7 @@ public void get_bool_from_hashtable_when_default_is_provided() var value = table.GetValueOrDefault("app id", false); - Expect(value, Is.True); + this.Expect(value, Is.True); } [Test] @@ -88,7 +88,7 @@ public void can_get_default_bool_from_hashtable() value = table.GetValueOrDefault("Allow Windows Live Writer", value); - Expect(value, Is.True); + this.Expect(value, Is.True); } [Test] @@ -98,7 +98,7 @@ public void get_false_from_hashtable_for_missing_value() var value = table.GetValueOrDefault("Allow Windows Live Writer"); - Expect(value, Is.False); + this.Expect(value, Is.False); } [Test] @@ -119,7 +119,7 @@ public void get_bool_with_custom_converter_from_hashtable() return allowed; }); - Expect(value, Is.True); + this.Expect(value, Is.True); } [Test] @@ -129,7 +129,7 @@ public void get_int() var value = collection.GetValueOrDefault("appId"); - Expect(value, Is.EqualTo(123)); + this.Expect(value, Is.EqualTo(123)); } [Test] @@ -139,7 +139,7 @@ public void get_decimal() var value = collection.GetValueOrDefault("appId"); - Expect(value, Is.EqualTo(1.23m)); + this.Expect(value, Is.EqualTo(1.23m)); } [Test] @@ -150,7 +150,7 @@ public void get_decimal_from_other_culture() var value = collection.GetValueOrDefault("appId"); - Expect(value, Is.EqualTo(1.23m)); + this.Expect(value, Is.EqualTo(1.23m)); } [Test] @@ -160,7 +160,7 @@ public void get_datetime() var value = collection.GetValueOrDefault("startDate"); - Expect(value, Is.EqualTo(new DateTime(2012, 5, 4))); + this.Expect(value, Is.EqualTo(new DateTime(2012, 5, 4))); } [Test] @@ -170,7 +170,7 @@ public void get_null_string_without_default() var value = collection.GetValue("app id"); - Expect(value, Is.Null); + this.Expect(value, Is.Null); } [Test] @@ -180,7 +180,7 @@ public void get_null_string_with_default() var value = collection.GetValueOrDefault("app id", "a default value"); - Expect(value, Is.Null); + this.Expect(value, Is.Null); } [Test] @@ -190,7 +190,7 @@ public void get_nullable_datetime() var value = collection.GetValue("startDate"); - Expect(value, Is.Null); + this.Expect(value, Is.Null); } [Test] @@ -201,7 +201,7 @@ public void get_datetime_from_other_culture() var value = collection.GetValueOrDefault("startDate"); - Expect(value, Is.EqualTo(new DateTime(2012, 5, 4))); + this.Expect(value, Is.EqualTo(new DateTime(2012, 5, 4))); } [Test] @@ -211,7 +211,7 @@ public void get_from_statebag() var value = collection.GetValueOrDefault("appId"); - Expect(value, Is.EqualTo("123")); + this.Expect(value, Is.EqualTo("123")); } [Test] @@ -223,7 +223,7 @@ public void get_from_xnode() var value = node.GetValueOrDefault("id"); - Expect(value, Is.EqualTo(14)); + this.Expect(value, Is.EqualTo(14)); } [Test] @@ -237,7 +237,7 @@ public void get_from_xmlnode() var value = doc.DocumentElement.GetValueOrDefault("id"); - Expect(value, Is.EqualTo(13)); + this.Expect(value, Is.EqualTo(13)); } [Test] @@ -247,7 +247,7 @@ public void can_get_timespan_with_custom_converter() var value = collection.GetValueOrDefault("length", TimeSpan.Parse); - Expect(value, Is.EqualTo(TimeSpan.FromSeconds(4210))); + this.Expect(value, Is.EqualTo(TimeSpan.FromSeconds(4210))); } [Test] @@ -257,7 +257,7 @@ public void can_get_empty_boolean_from_form() var value = collection.GetValueOrDefault("radio", CollectionExtensions.GetFlexibleBooleanParsingFunction()); - Expect(value, Is.False); + this.Expect(value, Is.False); } [Test] @@ -267,7 +267,7 @@ public void can_get_boolean_from_form() var value = collection.GetValueOrDefault("radio", CollectionExtensions.GetFlexibleBooleanParsingFunction()); - Expect(value, Is.True); + this.Expect(value, Is.True); } [Test] @@ -277,7 +277,7 @@ public void flexible_boolean_parsing_is_case_insensitive() var value = collection.GetValueOrDefault("question", CollectionExtensions.GetFlexibleBooleanParsingFunction("yes")); - Expect(value, Is.True); + this.Expect(value, Is.True); } [Test] @@ -287,7 +287,7 @@ public void can_convert_namevaluecollection_to_lookup() var lookup = collection.ToLookup(); - Expect(lookup["question"], Is.EquivalentTo(new[] { "YES" })); + this.Expect(lookup["question"], Is.EquivalentTo(new[] { "YES" })); } [Test] @@ -297,7 +297,7 @@ public void can_convert_namevaluecollection_with_multiple_values_to_lookup() var lookup = collection.ToLookup(); - Expect(lookup["question"], Is.EquivalentTo(new[] { "A", "B", "C", })); + this.Expect(lookup["question"], Is.EquivalentTo(new[] { "A", "B", "C", })); } [Test] @@ -307,7 +307,7 @@ public void can_get_null_value_rather_than_default() var value = dictionary.GetValueOrDefault("question", "yes"); - Expect(value, Is.Null); + this.Expect(value, Is.Null); } [Test] @@ -317,7 +317,7 @@ public void can_get_empty_string_rather_than_default() var value = dictionary.GetValueOrDefault("question", "yes"); - Expect(value, Is.Empty); + this.Expect(value, Is.Empty); } [Test] @@ -327,7 +327,7 @@ public void can_get_value_without_default() var value = dictionary.GetValue("question"); - Expect(value, Is.EqualTo("what is it")); + this.Expect(value, Is.EqualTo("what is it")); } [Test] @@ -337,7 +337,7 @@ public void can_get_value_without_default_with_custom_converter() var value = dictionary.GetValue("question", (object v) => v is string ? 10 : 20); - Expect(value, Is.EqualTo(10)); + this.Expect(value, Is.EqualTo(10)); } [Test] @@ -347,7 +347,7 @@ public void can_get_value_without_default_from_namevaluecollection() var value = collection.GetValue("question"); - Expect(value, Is.EqualTo("what is it")); + this.Expect(value, Is.EqualTo("what is it")); } [Test] @@ -357,7 +357,7 @@ public void can_get_value_containing_comma_from_namevaluecollection() var value = collection.GetValue("question"); - Expect(value, Is.EqualTo("what, is it?")); + this.Expect(value, Is.EqualTo("what, is it?")); } [Test] @@ -367,7 +367,7 @@ public void can_get_multiple_values_from_namevaluecollection() var value = collection.GetValues("state"); - Expect(value, Is.EquivalentTo(new[] { "CA", "BC", })); + this.Expect(value, Is.EquivalentTo(new[] { "CA", "BC", })); } [Test] @@ -377,7 +377,7 @@ public void can_get_sequence_with_single_value_from_namevaluecollection() var value = collection.GetValues("state"); - Expect(value, Is.EquivalentTo(new[] { "CA" })); + this.Expect(value, Is.EquivalentTo(new[] { "CA" })); } [Test] @@ -387,7 +387,7 @@ public void can_get_sequence_with_no_value_from_namevaluecollection() var value = collection.GetValues("cat"); - Expect(value, Is.Empty); + this.Expect(value, Is.Empty); } [Test] @@ -397,7 +397,7 @@ public void can_get_multiple_values_from_namevaluecollection_with_custom_convert var value = collection.GetValues("state", v => int.Parse(v, CultureInfo.InvariantCulture) + 10); - Expect(value, Is.EquivalentTo(new[] { 22, 11 })); + this.Expect(value, Is.EquivalentTo(new[] { 22, 11 })); } [Test] @@ -407,7 +407,7 @@ public void can_get_value_without_default_from_statebag() var value = dictionary.GetValue("question"); - Expect(value, Is.EqualTo("what is it")); + this.Expect(value, Is.EqualTo("what is it")); } [Test] @@ -419,7 +419,7 @@ public void can_get_value_without_default_from_xnode() var value = node.GetValue("id"); - Expect(value, Is.EqualTo(21)); + this.Expect(value, Is.EqualTo(21)); } [Test] @@ -433,7 +433,7 @@ public void can_get_value_without_default_from_xmlnode() var value = doc.DocumentElement.GetValue("id"); - Expect(value, Is.EqualTo(123)); + this.Expect(value, Is.EqualTo(123)); } [Test] @@ -441,7 +441,7 @@ public void getvalue_throws_argumentexception_when_value_is_not_present() { var dictionary = new Hashtable { { "question", "what is it" } }; - Expect(() => dictionary.GetValue("answer"), Throws.ArgumentException.With.Property("ParamName").EqualTo("key")); + this.Expect(() => dictionary.GetValue("answer"), Throws.ArgumentException.With.Property("ParamName").EqualTo("key")); } [Test] @@ -449,7 +449,7 @@ public void throws_invalidoperationexception_when_lookup_has_multiple_values() { var collection = new NameValueCollection { { "state", "CA" }, { "state", "BC" } }; - Expect(() => collection.GetValueOrDefault("state"), Throws.InvalidOperationException); + this.Expect(() => collection.GetValueOrDefault("state"), Throws.InvalidOperationException); } [Test] @@ -457,7 +457,7 @@ public void throws_argumentnullexception_when_dictionary_is_null() { IDictionary dictionary = null; - Expect(() => dictionary.GetValueOrDefault("value ID"), Throws.TypeOf().With.Property("ParamName").EqualTo("dictionary")); + this.Expect(() => dictionary.GetValueOrDefault("value ID"), Throws.TypeOf().With.Property("ParamName").EqualTo("dictionary")); } [Test] @@ -465,7 +465,7 @@ public void throws_argumentnullexception_when_xelement_is_null() { XElement node = null; - Expect(() => node.GetValueOrDefault("value ID"), Throws.TypeOf().With.Property("ParamName").EqualTo("node")); + this.Expect(() => node.GetValueOrDefault("value ID"), Throws.TypeOf().With.Property("ParamName").EqualTo("node")); } [Test] @@ -473,7 +473,7 @@ public void throws_argumentnullexception_when_xmlnode_is_null() { XmlNode node = null; - Expect(() => node.GetValueOrDefault("value ID"), Throws.TypeOf().With.Property("ParamName").EqualTo("node")); + this.Expect(() => node.GetValueOrDefault("value ID"), Throws.TypeOf().With.Property("ParamName").EqualTo("node")); } [Test] @@ -483,7 +483,7 @@ public void does_not_throw_invalidcastexception_when_value_is_null_for_reference var value = dictionary.GetValueOrDefault("length"); - Expect(value, Is.Null); + this.Expect(value, Is.Null); } [Test] @@ -491,7 +491,7 @@ public void tolookup_throws_argumentnullexception_when_namevaluecollection_is_nu { NameValueCollection col = null; - Expect(() => col.ToLookup(), Throws.TypeOf().With.Property("ParamName").EqualTo("collection")); + this.Expect(() => col.ToLookup(), Throws.TypeOf().With.Property("ParamName").EqualTo("collection")); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/LockStrategyTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/LockStrategyTests.cs index da72c111a4b..e74e630e5bf 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/LockStrategyTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/LockStrategyTests.cs @@ -19,7 +19,7 @@ public abstract class LockStrategyTests [Test] public void DoubleDisposeAllowed() { - var strategy = GetLockStrategy(); + var strategy = this.GetLockStrategy(); strategy.Dispose(); strategy.Dispose(); @@ -29,7 +29,7 @@ public void DoubleDisposeAllowed() [Test, ExpectedException(typeof (LockRecursionException))] public virtual void DoubleReadLockThrows() { - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { using (var readLock1 = strategy.GetReadLock()) { @@ -44,7 +44,7 @@ public virtual void DoubleReadLockThrows() [Test, ExpectedException(typeof (LockRecursionException))] public void ReadAndWriteLockOnSameThreadThrows() { - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { using (var readLock1 = strategy.GetReadLock()) { @@ -59,7 +59,7 @@ public void ReadAndWriteLockOnSameThreadThrows() [Test, ExpectedException(typeof (LockRecursionException))] public void WriteAndReadLockOnSameThreadThrows() { - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { using (var readLock1 = strategy.GetWriteLock()) { @@ -74,7 +74,7 @@ public void WriteAndReadLockOnSameThreadThrows() [Test] public void DoubleReadLockOnDifferentThreads() { - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { if (strategy.SupportsConcurrentReads) { @@ -97,7 +97,7 @@ public void DoubleReadLockOnDifferentThreads() [Test] public void DoubleWriteLockOnDifferentThreadsWaits() { - using (ILockStrategy strategy = GetLockStrategy()) + using (ILockStrategy strategy = this.GetLockStrategy()) { Thread t; using (var writeLock1 = strategy.GetWriteLock()) @@ -122,7 +122,7 @@ public void DoubleWriteLockOnDifferentThreadsWaits() [Test, ExpectedException(typeof (LockRecursionException))] public virtual void DoubleWriteLockThrows() { - using (ILockStrategy strategy = GetLockStrategy()) + using (ILockStrategy strategy = this.GetLockStrategy()) { using (var writeLock1 = strategy.GetWriteLock()) { @@ -138,7 +138,7 @@ public virtual void DoubleWriteLockThrows() [TestCaseSource("GetObjectDisposedExceptionMethods")] public void MethodsThrowAfterDisposed(Action methodCall) { - var strategy = GetLockStrategy(); + var strategy = this.GetLockStrategy(); strategy.Dispose(); methodCall.Invoke(strategy); @@ -149,7 +149,7 @@ public void ReadLockPreventsWriteLock() { Thread t = null; - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { using (var readLock = strategy.GetReadLock()) { @@ -176,7 +176,7 @@ public void OnlyOneWriteLockAllowed() { Thread t = null; - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { using (var writeLock = strategy.GetWriteLock()) { @@ -201,7 +201,7 @@ public void MultipleReadLocksAllowed() { Thread t = null; - using (var strategy = GetLockStrategy()) + using (var strategy = this.GetLockStrategy()) { if (strategy.SupportsConcurrentReads) { diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/PageSelectorTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/PageSelectorTests.cs index 2b5df0cce1a..e6d025b152e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/PageSelectorTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/PageSelectorTests.cs @@ -24,7 +24,7 @@ public class PageSelectorTests [SetUp] public void SetUp() { - list = Util.CreateIntegerList(Constants.PAGE_TotalCount); + this.list = Util.CreateIntegerList(Constants.PAGE_TotalCount); } #endregion @@ -38,7 +38,7 @@ public void SetUp() public void PageSelector_Returns_CorrectPage_When_Given_Valid_Index(int index) { //Arrange - var selector = new PageSelector(list, Constants.PAGE_RecordCount); + var selector = new PageSelector(this.list, Constants.PAGE_RecordCount); //Act IPagedList pagedList = selector.GetPage(index); @@ -53,7 +53,7 @@ public void PageSelector_Returns_CorrectPage_When_Given_Valid_Index(int index) public void PageSelector_Returns_Correct_RecordCount_When_Given_Valid_Index(int pageSize) { //Arrange - var selector = new PageSelector(list, pageSize); + var selector = new PageSelector(this.list, pageSize); //Act IPagedList pagedList = selector.GetPage(Constants.PAGE_First); @@ -70,7 +70,7 @@ public void PageSelector_Returns_Correct_RecordCount_When_Given_Valid_Index(int public void PageSelector_Returns_Correct_Values_When_Given_Valid_Index_And_PageSize(int index, int pageSize) { //Arrange - var selector = new PageSelector(list, pageSize); + var selector = new PageSelector(this.list, pageSize); //Act IPagedList pagedList = selector.GetPage(index); @@ -86,7 +86,7 @@ public void PageSelector_Returns_Correct_Values_When_Given_Valid_Index_And_PageS public void PageSelector_Throws_When_Given_InValid_Index() { //Arrange - var selector = new PageSelector(list, Constants.PAGE_RecordCount); + var selector = new PageSelector(this.list, Constants.PAGE_RecordCount); //Assert Assert.Throws(() => selector.GetPage(Constants.PAGE_OutOfRange)); @@ -96,7 +96,7 @@ public void PageSelector_Throws_When_Given_InValid_Index() public void PageSelector_Throws_When_Given_Negative_Index() { //Arrange - var selector = new PageSelector(list, Constants.PAGE_RecordCount); + var selector = new PageSelector(this.list, Constants.PAGE_RecordCount); //Assert Assert.Throws(() => selector.GetPage(Constants.PAGE_NegativeIndex)); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedDictionaryTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedDictionaryTests.cs index 6d839d427aa..571688e5ba1 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedDictionaryTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedDictionaryTests.cs @@ -23,7 +23,7 @@ public void TryAdd() const string KEY = "key"; const string VALUE = "value"; - var sharedDictionary = new SharedDictionary(LockingStrategy); + var sharedDictionary = new SharedDictionary(this.LockingStrategy); bool doInsert = false; using (ISharedCollectionLock l = sharedDictionary.GetReadLock()) @@ -51,19 +51,19 @@ public void TryAdd() [Test, ExpectedException(typeof (WriteLockRequiredException)), TestCaseSource("GetWriteMethods")] public void WriteRequiresLock(Action> writeAction) { - writeAction.Invoke(InitSharedDictionary("key", "value")); + writeAction.Invoke(this.InitSharedDictionary("key", "value")); } [Test, ExpectedException(typeof (ReadLockRequiredException)), TestCaseSource("GetReadMethods")] public void ReadRequiresLock(Action> readAction) { - readAction.Invoke(InitSharedDictionary("key", "value")); + readAction.Invoke(this.InitSharedDictionary("key", "value")); } [Test, ExpectedException(typeof (ReadLockRequiredException))] public void DisposedReadLockDeniesRead() { - var d = new SharedDictionary(LockingStrategy); + var d = new SharedDictionary(this.LockingStrategy); ISharedCollectionLock l = d.GetReadLock(); l.Dispose(); @@ -74,7 +74,7 @@ public void DisposedReadLockDeniesRead() [Test, ExpectedException(typeof (ReadLockRequiredException))] public void DisposedWriteLockDeniesRead() { - var d = new SharedDictionary(LockingStrategy); + var d = new SharedDictionary(this.LockingStrategy); ISharedCollectionLock l = d.GetWriteLock(); l.Dispose(); @@ -85,7 +85,7 @@ public void DisposedWriteLockDeniesRead() [Test, ExpectedException(typeof (WriteLockRequiredException))] public void DisposedWriteLockDeniesWrite() { - var d = new SharedDictionary(LockingStrategy); + var d = new SharedDictionary(this.LockingStrategy); ISharedCollectionLock l = d.GetWriteLock(); l.Dispose(); @@ -96,7 +96,7 @@ public void DisposedWriteLockDeniesWrite() [Test] public void WriteLockEnablesRead() { - var d = InitSharedDictionary("key", "value"); + var d = this.InitSharedDictionary("key", "value"); string actualValue = null; using (ISharedCollectionLock l = d.GetWriteLock()) @@ -110,7 +110,7 @@ public void WriteLockEnablesRead() [Test] public void CanGetAnotherLockAfterDisposingLock() { - var d = new SharedDictionary(LockingStrategy); + var d = new SharedDictionary(this.LockingStrategy); ISharedCollectionLock l = d.GetReadLock(); l.Dispose(); @@ -121,7 +121,7 @@ public void CanGetAnotherLockAfterDisposingLock() [Test] public void DoubleDispose() { - var d = new SharedDictionary(LockingStrategy); + var d = new SharedDictionary(this.LockingStrategy); d.Dispose(); d.Dispose(); @@ -131,7 +131,7 @@ public void DoubleDispose() [TestCaseSource("GetObjectDisposedExceptionMethods")] public void MethodsThrowAfterDisposed(Action> methodCall) { - var d = new SharedDictionary(LockingStrategy); + var d = new SharedDictionary(this.LockingStrategy); d.Dispose(); methodCall.Invoke(d); @@ -157,8 +157,8 @@ protected IEnumerable>> GetObjectDispose { var l = new List>> {(SharedDictionary d) => d.GetReadLock(), (SharedDictionary d) => d.GetWriteLock()}; - l.AddRange(GetReadMethods()); - l.AddRange(GetWriteMethods()); + l.AddRange(this.GetReadMethods()); + l.AddRange(this.GetWriteMethods()); return l; } @@ -208,7 +208,7 @@ protected IEnumerable>> GetWriteMethods( private SharedDictionary InitSharedDictionary(TKey key, TValue value) { - var sharedDict = new SharedDictionary(LockingStrategy); + var sharedDict = new SharedDictionary(this.LockingStrategy); sharedDict.BackingDictionary.Add(key, value); return sharedDict; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedListTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedListTests.cs index dcd1c6f6c66..be5838a35f2 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedListTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Collections/SharedListTests.cs @@ -21,7 +21,7 @@ public void TryAdd() { const string value = "value"; - var sharedList = new SharedList(LockingStrategy); + var sharedList = new SharedList(this.LockingStrategy); bool doInsert = false; using (ISharedCollectionLock l = sharedList.GetReadLock()) @@ -49,19 +49,19 @@ public void TryAdd() [Test, ExpectedException(typeof (WriteLockRequiredException)), TestCaseSource("GetWriteMethods")] public void WriteRequiresLock(Action> writeAction) { - writeAction.Invoke(InitSharedList("value")); + writeAction.Invoke(this.InitSharedList("value")); } [Test, ExpectedException(typeof (ReadLockRequiredException)), TestCaseSource("GetReadMethods")] public void ReadRequiresLock(Action> readAction) { - readAction.Invoke(InitSharedList("value")); + readAction.Invoke(this.InitSharedList("value")); } [Test, ExpectedException(typeof (ReadLockRequiredException))] public void DisposedReadLockDeniesRead() { - var d = new SharedList(LockingStrategy); + var d = new SharedList(this.LockingStrategy); ISharedCollectionLock l = d.GetReadLock(); l.Dispose(); @@ -72,7 +72,7 @@ public void DisposedReadLockDeniesRead() [Test, ExpectedException(typeof (ReadLockRequiredException))] public void DisposedWriteLockDeniesRead() { - var d = new SharedList(LockingStrategy); + var d = new SharedList(this.LockingStrategy); ISharedCollectionLock l = d.GetWriteLock(); l.Dispose(); @@ -83,7 +83,7 @@ public void DisposedWriteLockDeniesRead() [Test, ExpectedException(typeof (WriteLockRequiredException))] public void DisposedWriteLockDeniesWrite() { - var sharedList = new SharedList(LockingStrategy); + var sharedList = new SharedList(this.LockingStrategy); ISharedCollectionLock l = sharedList.GetWriteLock(); l.Dispose(); @@ -94,7 +94,7 @@ public void DisposedWriteLockDeniesWrite() [Test] public void WriteLockEnablesRead() { - var sharedList = InitSharedList("value"); + var sharedList = this.InitSharedList("value"); string actualValue = null; using (ISharedCollectionLock l = sharedList.GetWriteLock()) @@ -108,7 +108,7 @@ public void WriteLockEnablesRead() [Test] public void CanGetAnotherLockAfterDisposingLock() { - var d = new SharedList(LockingStrategy); + var d = new SharedList(this.LockingStrategy); ISharedCollectionLock l = d.GetReadLock(); l.Dispose(); @@ -119,7 +119,7 @@ public void CanGetAnotherLockAfterDisposingLock() [Test] public void DoubleDispose() { - var d = new SharedList(LockingStrategy); + var d = new SharedList(this.LockingStrategy); d.Dispose(); d.Dispose(); @@ -129,7 +129,7 @@ public void DoubleDispose() [TestCaseSource("GetObjectDisposedExceptionMethods")] public void MethodsThrowAfterDisposed(Action> methodCall) { - var d = new SharedList(LockingStrategy); + var d = new SharedList(this.LockingStrategy); d.Dispose(); methodCall.Invoke(d); @@ -155,8 +155,8 @@ protected IEnumerable>> GetObjectDisposedExceptionMeth { var list = new List>> {(SharedList l) => l.GetReadLock(), (SharedList l) => l.GetWriteLock()}; - list.AddRange(GetReadMethods()); - list.AddRange(GetWriteMethods()); + list.AddRange(this.GetReadMethods()); + list.AddRange(this.GetWriteMethods()); return list; } @@ -190,7 +190,7 @@ protected IEnumerable>> GetWriteMethods() private SharedList InitSharedList(T value) { - var list = new SharedList(LockingStrategy); + var list = new SharedList(this.LockingStrategy); list.BackingList.Add(value); return list; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs index 85dd40a6267..b2bf8d14fcc 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Common/NavigationManagerTests.cs @@ -31,7 +31,7 @@ public class NavigationManagerTests public void Setup() { - _navigationManager = new NavigationManager(PortalControllerMock()); + this._navigationManager = new NavigationManager(PortalControllerMock()); TabController.SetTestableInstance(TabControllerMock()); LocaleController.SetTestableInstance(LocaleControllerMock()); @@ -94,7 +94,7 @@ ILocaleController LocaleControllerMock() [TestFixtureTearDown] public void TearDown() { - _navigationManager = null; + this._navigationManager = null; TabController.ClearInstance(); LocaleController.ClearInstance(); } @@ -103,7 +103,7 @@ public void TearDown() public void NavigateUrlTest() { var expected = string.Format(DefaultURLPattern, TabID); - var actual = _navigationManager.NavigateURL(); + var actual = this._navigationManager.NavigateURL(); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -123,7 +123,7 @@ public void NavigateUrlTest() public void NavigateUrl_CustomTabID(int tabId) { var expected = string.Format(DefaultURLPattern, tabId); - var actual = _navigationManager.NavigateURL(tabId); + var actual = this._navigationManager.NavigateURL(tabId); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -134,7 +134,7 @@ public void NavigateUrl_CustomTab_NotSuperTab() { var customTabId = 55; var expected = string.Format(DefaultURLPattern, customTabId); - var actual = _navigationManager.NavigateURL(customTabId, false); + var actual = this._navigationManager.NavigateURL(customTabId, false); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -154,7 +154,7 @@ public void NavigateUrl_CustomTab_NotSuperTab() public void NavigateUrl_CustomTab_IsSuperTab(int tabId) { var expected = string.Format(DefaultURLPattern, tabId) + string.Format(DefaultSuperTabPattern, PortalID); - var actual = _navigationManager.NavigateURL(tabId, true); + var actual = this._navigationManager.NavigateURL(tabId, true); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -168,7 +168,7 @@ public void NavigateUrl_ControlKey_AccessDenied() // Globals.AccessDeniedURL to an interface in the abstraction // project. The dependencies go very deep and make it very // difficult to properly test just the NavigationManager logic. - var actual = _navigationManager.NavigateURL("Access Denied"); + var actual = this._navigationManager.NavigateURL("Access Denied"); } [Test] @@ -176,7 +176,7 @@ public void NavigateUrl_ControlKey() { var controlKey = "My-Control-Key"; var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(controlKey); + var actual = this._navigationManager.NavigateURL(controlKey); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -187,7 +187,7 @@ public void NavigateUrl_ControlKey_EmptyAdditionalParameter() { var controlKey = "My-Control-Key"; var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(controlKey, new string[0]); + var actual = this._navigationManager.NavigateURL(controlKey, new string[0]); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -201,7 +201,7 @@ public void NavigateUrl_ControlKey_SingleAdditionalParameter() var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey) + $"&{parameters[0]}"; - var actual = _navigationManager.NavigateURL(controlKey, parameters); + var actual = this._navigationManager.NavigateURL(controlKey, parameters); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -226,7 +226,7 @@ public void NavigateUrl_ControlKey_MultipleAdditionalParameter(int count) var expected = string.Format(DefaultURLPattern, TabID) + string.Format(ControlKeyPattern, controlKey) + parameters.Select(s => $"&{s}").Aggregate((x, y) => $"{x}{y}"); - var actual = _navigationManager.NavigateURL(controlKey, parameters); + var actual = this._navigationManager.NavigateURL(controlKey, parameters); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -247,7 +247,7 @@ public void NavigateUrl_TabID_ControlKey(int tabId) { var controlKey = "My-Control-Key"; var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(tabId, controlKey); + var actual = this._navigationManager.NavigateURL(tabId, controlKey); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -267,7 +267,7 @@ public void NavigateUrl_TabID_ControlKey(int tabId) public void NavigateUrl_TabID_EmptyControlKey(int tabId) { var expected = string.Format(DefaultURLPattern, tabId); - var actual = _navigationManager.NavigateURL(tabId, string.Empty); + var actual = this._navigationManager.NavigateURL(tabId, string.Empty); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -287,7 +287,7 @@ public void NavigateUrl_TabID_EmptyControlKey(int tabId) public void NavigateUrl_TabID_NullControlKey(int tabId) { var expected = string.Format(DefaultURLPattern, tabId); - var actual = _navigationManager.NavigateURL(tabId, string.Empty); + var actual = this._navigationManager.NavigateURL(tabId, string.Empty); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -317,7 +317,7 @@ public void NavigateUrl_TabID_ControlKey_Parameter(int count, string controlKey) if (parameters.Length > 0) expected += parameters.Select(s => $"&{s}").Aggregate((x, y) => $"{x}{y}"); - var actual = _navigationManager.NavigateURL(customTabId, controlKey, parameters); + var actual = this._navigationManager.NavigateURL(customTabId, controlKey, parameters); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -339,7 +339,7 @@ public void NavigateUrl_TabID_ControlKey_NullParameter(int tabId, string control var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(tabId, controlKey, null); + var actual = this._navigationManager.NavigateURL(tabId, controlKey, null); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -361,7 +361,7 @@ public void NavigateUrl_TabId_NullSettings_ControlKey(int tabId, string controlK var expected = string.Format(DefaultURLPattern, tabId) + string.Format(ControlKeyPattern, controlKey); - var actual = _navigationManager.NavigateURL(tabId, default(IPortalSettings), controlKey, null); + var actual = this._navigationManager.NavigateURL(tabId, default(IPortalSettings), controlKey, null); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); @@ -389,7 +389,7 @@ public void NavigateUrl_TabId_Settings_ControlKey(int tabId, string controlKey) string.Format(ControlKeyPattern, controlKey) + string.Format(LanguagePattern, "en-US"); - var actual = _navigationManager.NavigateURL(tabId, mockSettings.Object, controlKey, null); + var actual = this._navigationManager.NavigateURL(tabId, mockSettings.Object, controlKey, null); Assert.IsNotNull(actual); Assert.AreEqual(expected, actual); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/Service2Impl.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/Service2Impl.cs index 7a44047b019..e6077dc52ab 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/Service2Impl.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/Service2Impl.cs @@ -10,14 +10,14 @@ public class Service2Impl : IService2 public Service2Impl(IService service) { - _service = service; + this._service = service; } #region IService2 Members public IService Service { - get { return _service; } + get { return this._service; } } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/ServiceImpl.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/ServiceImpl.cs index 1611f555aa8..ab356a68920 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/ServiceImpl.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/ComponentModel/Helpers/ServiceImpl.cs @@ -13,7 +13,7 @@ public class ServiceImpl : IService public int Id { - get { return id; } + get { return this.id; } } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Host/HostControllerTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Host/HostControllerTest.cs index fa774a7bc3c..b681fd4dd1f 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Host/HostControllerTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Host/HostControllerTest.cs @@ -31,33 +31,33 @@ public class HostControllerTest [SetUp] public void SetUp() { - _mockCache = MockComponentProvider.CreateDataCacheProvider(); + this._mockCache = MockComponentProvider.CreateDataCacheProvider(); MockComponentProvider.CreateEventLogController(); - _hostSettingsTable = new DataTable("HostSettings"); + this._hostSettingsTable = new DataTable("HostSettings"); - var nameCol = _hostSettingsTable.Columns.Add("SettingName"); - _hostSettingsTable.Columns.Add("SettingValue"); - _hostSettingsTable.Columns.Add("SettingIsSecure"); - _hostSettingsTable.PrimaryKey = new[] {nameCol}; + var nameCol = this._hostSettingsTable.Columns.Add("SettingName"); + this._hostSettingsTable.Columns.Add("SettingValue"); + this._hostSettingsTable.Columns.Add("SettingIsSecure"); + this._hostSettingsTable.PrimaryKey = new[] {nameCol}; - _hostSettingsTable.Rows.Add("String_1_S", "String_1_S", true); - _hostSettingsTable.Rows.Add("String_2_S", "String_1_S", true); - _hostSettingsTable.Rows.Add("String_3_U", "Value_3_U", false); - _hostSettingsTable.Rows.Add("String_4_U", "Value_4_U", false); - _hostSettingsTable.Rows.Add("Int_5_U", "5", false); - _hostSettingsTable.Rows.Add("Int_6_S", "6", true); - _hostSettingsTable.Rows.Add("Double_7_S", "7", true); - _hostSettingsTable.Rows.Add("Double_8_U", "8", false); - _hostSettingsTable.Rows.Add("Bool_9_U", false, false); - _hostSettingsTable.Rows.Add("Bool_10_S", false, true); + this._hostSettingsTable.Rows.Add("String_1_S", "String_1_S", true); + this._hostSettingsTable.Rows.Add("String_2_S", "String_1_S", true); + this._hostSettingsTable.Rows.Add("String_3_U", "Value_3_U", false); + this._hostSettingsTable.Rows.Add("String_4_U", "Value_4_U", false); + this._hostSettingsTable.Rows.Add("Int_5_U", "5", false); + this._hostSettingsTable.Rows.Add("Int_6_S", "6", true); + this._hostSettingsTable.Rows.Add("Double_7_S", "7", true); + this._hostSettingsTable.Rows.Add("Double_8_U", "8", false); + this._hostSettingsTable.Rows.Add("Bool_9_U", false, false); + this._hostSettingsTable.Rows.Add("Bool_10_S", false, true); - _mockData = MockComponentProvider.CreateDataProvider(); - _mockData.Setup(c => c.GetHostSettings()).Returns(_hostSettingsTable.CreateDataReader()); - _mockData.Setup(c => c.GetProviderPath()).Returns(String.Empty); + this._mockData = MockComponentProvider.CreateDataProvider(); + this._mockData.Setup(c => c.GetHostSettings()).Returns(this._hostSettingsTable.CreateDataReader()); + this._mockData.Setup(c => c.GetProviderPath()).Returns(String.Empty); DataCache.ClearCache(); @@ -71,7 +71,7 @@ public void TearDown() private string GetValue(string key) { - return _hostSettingsTable.Rows.Find(key)["SettingValue"].ToString(); + return this._hostSettingsTable.Rows.Find(key)["SettingValue"].ToString(); } #region Get Dictionaries @@ -82,7 +82,7 @@ public void HostController_GetSettings_GetList() //Arrange var expectedDic = new Dictionary(); - foreach (DataRow row in _hostSettingsTable.Rows) + foreach (DataRow row in this._hostSettingsTable.Rows) { var conf = new ConfigurationSetting(); conf.Key = row["SettingName"].ToString(); @@ -110,7 +110,7 @@ public void HostController_GetSettingsDictionary_GetList() { //Arrange //Convert table to Dictionary - var expectedDic = _hostSettingsTable.Rows.Cast().ToDictionary(row => row["SettingName"].ToString(), row => row["SettingValue"].ToString()); + var expectedDic = this._hostSettingsTable.Rows.Cast().ToDictionary(row => row["SettingName"].ToString(), row => row["SettingValue"].ToString()); //Act var settingsDic = HostController.Instance.GetSettingsDictionary(); @@ -130,14 +130,14 @@ public void HostController_Update_ExistingValue() //Arrange const string key = "String_1_S"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); + this._mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); //Act HostController.Instance.Update(key, value); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny()), Times.Exactly(1)); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Exactly(1)); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny()), Times.Exactly(1)); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Exactly(1)); } [Test] @@ -146,14 +146,14 @@ public void HostController_Update_ExistingValue_ResetCache() //Arrange const string key = "String_1_S"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); + this._mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); //Act HostController.Instance.Update(key, value); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny()), Times.Exactly(1)); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Exactly(1)); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny()), Times.Exactly(1)); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Exactly(1)); } [Test] @@ -162,14 +162,14 @@ public void HostController_Update_ExistingValue_ResetCache_With_Overload() //Arrange const string key = "String_1_S"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); + this._mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); //Act HostController.Instance.Update(key, value, true); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny()), Times.Exactly(1)); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Exactly(1)); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny()), Times.Exactly(1)); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Exactly(1)); } [Test] @@ -178,15 +178,15 @@ public void HostController_Update_ExistingValue_Dont_Reset_Cache() //Arrange const string key = "String_1_S"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); + this._mockData.Setup(c => c.GetHostSetting(key).Read()).Returns(true); //Act HostController.Instance.Update(key, value, false); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); //Clear was not called a second time - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Never); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Never); } [Test] @@ -202,8 +202,8 @@ public void HostController_Update_Dictionary() HostController.Instance.Update(settings); //Assert - _mockData.Verify(c => c.UpdateHostSetting("String_1_S", "MyValue", false, It.IsAny()), Times.Exactly(1)); - _mockCache.Verify(c => c.Clear("Host", ""), Times.Exactly(1)); + this._mockData.Verify(c => c.UpdateHostSetting("String_1_S", "MyValue", false, It.IsAny()), Times.Exactly(1)); + this._mockCache.Verify(c => c.Clear("Host", ""), Times.Exactly(1)); } #endregion @@ -216,14 +216,14 @@ public void HostController_Update_NewValue() //Arrange const string key = "MyKey"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); + this._mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); //Act HostController.Instance.Update(key, value); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Once); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Once); } [Test] @@ -232,14 +232,14 @@ public void HostController_Update_NewValue_ResetCache_With_Overload() //Arrange const string key = "MyKey"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); + this._mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); //Act HostController.Instance.Update(key, value, true); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Once); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Once); } [Test] @@ -248,14 +248,14 @@ public void HostController_Update_NewValue_ResetCache() //Arrange const string key = "MyKey"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); + this._mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); //Act HostController.Instance.Update(key, value); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Once); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Once); } [Test] @@ -264,14 +264,14 @@ public void HostController_Update_NewValue_Dont_Reset_Cache() //Arrange const string key = "MyKey"; const string value = "MyValue"; - _mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); + this._mockData.Setup(c => c.GetHostSetting(It.IsAny()).Read()).Returns(false); //Act HostController.Instance.Update(key, value, false); //Assert - _mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); - _mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Never); + this._mockData.Verify(c => c.UpdateHostSetting(key, value, false, It.IsAny())); + this._mockCache.Verify(c => c.Remove("DNN_HostSettings"), Times.Never); } #endregion @@ -285,8 +285,8 @@ public void HostController_Update_NewValue_Dont_Reset_Cache() [TestCase("String_4_U")] public void HostController_GetString_If_Key_Exists(string key) { - Assert.AreEqual(HostController.Instance.GetString(key), GetValue(key)); - Assert.AreEqual(HostController.Instance.GetString(key, "Hello Default"), GetValue(key)); + Assert.AreEqual(HostController.Instance.GetString(key), this.GetValue(key)); + Assert.AreEqual(HostController.Instance.GetString(key, "Hello Default"), this.GetValue(key)); } @@ -325,8 +325,8 @@ public void HostController_GetString_NullEmpty(string key) public void HostController_GetInteger_If_Key_Exists(string key) { int s = HostController.Instance.GetInteger(key); - Assert.AreEqual(s.ToString(), GetValue(key)); - Assert.AreEqual(HostController.Instance.GetInteger(key, 12).ToString(), GetValue(key)); + Assert.AreEqual(s.ToString(), this.GetValue(key)); + Assert.AreEqual(HostController.Instance.GetInteger(key, 12).ToString(), this.GetValue(key)); } [Test] @@ -363,9 +363,9 @@ public void HostController_GetInteger_NullEmpty(string key) [TestCase("Bool_10_S")] public void HostController_GetBoolean_If_Key_Exists(string key) { - Assert.AreEqual(HostController.Instance.GetBoolean(key).ToString(), GetValue(key)); - Assert.AreEqual(HostController.Instance.GetBoolean(key, false).ToString(), GetValue(key)); - Assert.AreEqual(HostController.Instance.GetBoolean(key, true).ToString(), GetValue(key)); + Assert.AreEqual(HostController.Instance.GetBoolean(key).ToString(), this.GetValue(key)); + Assert.AreEqual(HostController.Instance.GetBoolean(key, false).ToString(), this.GetValue(key)); + Assert.AreEqual(HostController.Instance.GetBoolean(key, true).ToString(), this.GetValue(key)); } @@ -406,8 +406,8 @@ public void HostController_GetBoolean_NullEmpty(string key) public void HostController_GetDouble_If_Key_Exists(string key) { Double s = HostController.Instance.GetDouble(key); - Assert.AreEqual(s.ToString(), GetValue(key)); - Assert.AreEqual(HostController.Instance.GetDouble(key, 54.54).ToString(), GetValue(key)); + Assert.AreEqual(s.ToString(), this.GetValue(key)); + Assert.AreEqual(HostController.Instance.GetDouble(key, 54.54).ToString(), this.GetValue(key)); } [Test] diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionBuilder.cs index 94bd79d1b2f..af0c979a954 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionBuilder.cs @@ -23,15 +23,15 @@ public class SubscriptionBuilder internal SubscriptionBuilder() { - subscriptionId = 1; - userId = Constants.USER_InValidId; - subscriptionTypeId = 1; - portalId = Constants.PORTAL_ValidPortalId; - moduleId = Null.NullInteger; - tabId = Null.NullInteger; - objectKey = "content"; - description = "my content description"; - objectData = ""; + this.subscriptionId = 1; + this.userId = Constants.USER_InValidId; + this.subscriptionTypeId = 1; + this.portalId = Constants.PORTAL_ValidPortalId; + this.moduleId = Null.NullInteger; + this.tabId = Null.NullInteger; + this.objectKey = "content"; + this.description = "my content description"; + this.objectData = ""; } internal SubscriptionBuilder WithSubscriptionId(int subscriptionId) @@ -86,16 +86,16 @@ internal Subscription Build() { return new Subscription { - SubscriptionTypeId = subscriptionTypeId, - SubscriptionId = subscriptionId, + SubscriptionTypeId = this.subscriptionTypeId, + SubscriptionId = this.subscriptionId, CreatedOnDate = DateTime.UtcNow, - ModuleId = moduleId, - ObjectKey = objectKey, - Description = description, - PortalId = portalId, - TabId = tabId, - UserId = userId, - ObjectData = objectData + ModuleId = this.moduleId, + ObjectKey = this.objectKey, + Description = this.description, + PortalId = this.portalId, + TabId = this.tabId, + UserId = this.userId, + ObjectData = this.objectData }; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionTypeBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionTypeBuilder.cs index dc45da2e140..0d26cb55369 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionTypeBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/SubscriptionTypeBuilder.cs @@ -16,10 +16,10 @@ class SubscriptionTypeBuilder internal SubscriptionTypeBuilder() { - subscriptionTypeId = 1; - subscriptionName = "MySubscriptionType"; - friendlyName = "My Subscription Type"; - desktopModuleId = Null.NullInteger; + this.subscriptionTypeId = 1; + this.subscriptionName = "MySubscriptionType"; + this.friendlyName = "My Subscription Type"; + this.desktopModuleId = Null.NullInteger; } internal SubscriptionTypeBuilder WithSubscriptionTypeId(int subscriptionTypeId) @@ -38,10 +38,10 @@ internal SubscriptionType Build() { return new SubscriptionType { - SubscriptionTypeId = subscriptionTypeId, - SubscriptionName = subscriptionName, - DesktopModuleId = desktopModuleId, - FriendlyName = friendlyName + SubscriptionTypeId = this.subscriptionTypeId, + SubscriptionName = this.subscriptionName, + DesktopModuleId = this.desktopModuleId, + FriendlyName = this.friendlyName }; } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/UserPreferenceBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/UserPreferenceBuilder.cs index 739b1e8b60f..a18c9bfc840 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/UserPreferenceBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/Builders/UserPreferenceBuilder.cs @@ -16,20 +16,20 @@ internal class UserPreferenceBuilder internal UserPreferenceBuilder() { - userId = Constants.USER_InValidId; - portalId = Constants.PORTAL_ValidPortalId; - messagesEmailFrequency = Frequency.Instant; - notificationsEmailFrequency = Frequency.Hourly; + this.userId = Constants.USER_InValidId; + this.portalId = Constants.PORTAL_ValidPortalId; + this.messagesEmailFrequency = Frequency.Instant; + this.notificationsEmailFrequency = Frequency.Hourly; } internal UserPreference Build() { return new UserPreference { - UserId = userId, - PortalId = portalId, - MessagesEmailFrequency = messagesEmailFrequency, - NotificationsEmailFrequency = notificationsEmailFrequency + UserId = this.userId, + PortalId = this.portalId, + MessagesEmailFrequency = this.messagesEmailFrequency, + NotificationsEmailFrequency = this.notificationsEmailFrequency }; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/MessagingControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/MessagingControllerTests.cs index 9529fc19ade..c48685a26db 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/MessagingControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/MessagingControllerTests.cs @@ -76,43 +76,43 @@ public void SetUp() { ComponentFactory.Container = new SimpleContainer(); - _mockDataService = new Mock(); - _dataProvider = MockComponentProvider.CreateDataProvider(); - _mockRoleProvider = MockComponentProvider.CreateRoleProvider(); - _mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); + this._mockDataService = new Mock(); + this._dataProvider = MockComponentProvider.CreateDataProvider(); + this._mockRoleProvider = MockComponentProvider.CreateRoleProvider(); + this._mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); MockComponentProvider.CreateEventLogController(); - _mockLocalizationProvider = MockComponentProvider.CreateLocalizationProvider(); - _mockLocalizationProvider.Setup(l => l.GetString(It.IsAny(), It.IsAny())).Returns("{0}_{1}"); + this._mockLocalizationProvider = MockComponentProvider.CreateLocalizationProvider(); + this._mockLocalizationProvider.Setup(l => l.GetString(It.IsAny(), It.IsAny())).Returns("{0}_{1}"); - _messagingController = new MessagingController(_mockDataService.Object); - _internalMessagingController = new InternalMessagingControllerImpl(_mockDataService.Object); - _mockMessagingController = new Mock { CallBase = true }; - _mockInternalMessagingController = new Mock { CallBase = true }; + this._messagingController = new MessagingController(this._mockDataService.Object); + this._internalMessagingController = new InternalMessagingControllerImpl(this._mockDataService.Object); + this._mockMessagingController = new Mock { CallBase = true }; + this._mockInternalMessagingController = new Mock { CallBase = true }; - _portalController = new Mock(); - _portalController.Setup(c => c.GetPortalSettings(It.IsAny())).Returns(new Dictionary()); - PortalController.SetTestableInstance(_portalController.Object); + this._portalController = new Mock(); + this._portalController.Setup(c => c.GetPortalSettings(It.IsAny())).Returns(new Dictionary()); + PortalController.SetTestableInstance(this._portalController.Object); - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _folderManager = new Mock(); - _fileManager = new Mock(); - _folderPermissionController = new Mock(); + this._folderManager = new Mock(); + this._fileManager = new Mock(); + this._folderPermissionController = new Mock(); - FolderManager.RegisterInstance(_folderManager.Object); - FileManager.RegisterInstance(_fileManager.Object); - FolderPermissionController.SetTestableInstance(_folderPermissionController.Object); + FolderManager.RegisterInstance(this._folderManager.Object); + FileManager.RegisterInstance(this._fileManager.Object); + FolderPermissionController.SetTestableInstance(this._folderPermissionController.Object); - SetupDataProvider(); - SetupRoleProvider(); - SetupDataTables(); - SetupUsers(); - SetupPortalSettings(); - SetupCachingProvider(); - SetupFileControllers(); + this.SetupDataProvider(); + this.SetupRoleProvider(); + this.SetupDataTables(); + this.SetupUsers(); + this.SetupPortalSettings(); + this.SetupCachingProvider(); + this.SetupFileControllers(); - _mockInternalMessagingController.Setup(m => m.GetLastSentMessage(It.IsAny())).Returns((Message)null); + this._mockInternalMessagingController.Setup(m => m.GetLastSentMessage(It.IsAny())).Returns((Message)null); } [TearDown] @@ -125,7 +125,7 @@ public void TearDown() private void SetupDataProvider() { //Standard DataProvider Path for Logging - _dataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._dataProvider.Setup(d => d.GetProviderPath()).Returns(""); var dataTable = new DataTable("Languages"); var pkId = dataTable.Columns.Add("LanguageID", typeof(int)); @@ -139,15 +139,15 @@ private void SetupDataProvider() dataTable.PrimaryKey = new[] { pkId }; dataTable.Rows.Add(1, "en-US", "English (United States)", null, -1, "2011-05-04 09:42:11.530", -1, "2011-05-04 09:42:11.530"); - _dataProvider.Setup(x => x.GetLanguages()).Returns(dataTable.CreateDataReader()); + this._dataProvider.Setup(x => x.GetLanguages()).Returns(dataTable.CreateDataReader()); } private void SetupUsers() { - _adminUserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_Admin, UserID = Constants.UserID_Admin, Roles = new[] { Constants.RoleName_Administrators } }; - _hostUserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_Host, UserID = Constants.UserID_Host, IsSuperUser = true }; - _user12UserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_User12, UserID = Constants.UserID_User12 }; - _groupOwnerUserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_FirstSocialGroupOwner, UserID = Constants.UserID_FirstSocialGroupOwner }; + this._adminUserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_Admin, UserID = Constants.UserID_Admin, Roles = new[] { Constants.RoleName_Administrators } }; + this._hostUserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_Host, UserID = Constants.UserID_Host, IsSuperUser = true }; + this._user12UserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_User12, UserID = Constants.UserID_User12 }; + this._groupOwnerUserInfo = new UserInfo { DisplayName = Constants.UserDisplayName_FirstSocialGroupOwner, UserID = Constants.UserID_FirstSocialGroupOwner }; } private void SetupPortalSettings() @@ -157,12 +157,12 @@ private void SetupPortalSettings() AdministratorRoleName = Constants.RoleName_Administrators }; - _portalController.Setup(pc => pc.GetCurrentPortalSettings()).Returns(portalSettings); + this._portalController.Setup(pc => pc.GetCurrentPortalSettings()).Returns(portalSettings); } private void SetupCachingProvider() { - _mockCacheProvider.Setup(c => c.GetItem(It.IsAny())).Returns((key => + this._mockCacheProvider.Setup(c => c.GetItem(It.IsAny())).Returns((key => { if (key.Contains("Portal-1_")) { @@ -187,16 +187,16 @@ private void SetupRoleProvider() var user12RoleInfoforRegisteredUsers = new UserRoleInfo { RoleName = Constants.RoleName_RegisteredUsers, RoleID = Constants.RoleID_RegisteredUsers, UserID = Constants.UserID_User12 }; var userFirstSocialGroupOwner = new UserRoleInfo { RoleName = Constants.RoleName_FirstSocialGroup, RoleID = Constants.RoleID_FirstSocialGroup, UserID = Constants.UserID_FirstSocialGroupOwner, IsOwner = true }; - _mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == Constants.UserID_Admin), It.IsAny())).Returns(new List { adminRoleInfoForAdministrators, adminRoleInfoforRegisteredUsers }); - _mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == Constants.UserID_User12), It.IsAny())).Returns(new List { user12RoleInfoforRegisteredUsers }); - _mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == Constants.UserID_FirstSocialGroupOwner), It.IsAny())).Returns(new List { userFirstSocialGroupOwner }); + this._mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == Constants.UserID_Admin), It.IsAny())).Returns(new List { adminRoleInfoForAdministrators, adminRoleInfoforRegisteredUsers }); + this._mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == Constants.UserID_User12), It.IsAny())).Returns(new List { user12RoleInfoforRegisteredUsers }); + this._mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == Constants.UserID_FirstSocialGroupOwner), It.IsAny())).Returns(new List { userFirstSocialGroupOwner }); } private void SetupFileControllers() { - _folderManager.Setup(f => f.GetFolder(It.IsAny())).Returns(new FolderInfo()); - _fileManager.Setup(f => f.GetFile(It.IsAny())).Returns(new FileInfo()); - _folderPermissionController.Setup(f => f.CanViewFolder(It.IsAny())).Returns(true); + this._folderManager.Setup(f => f.GetFolder(It.IsAny())).Returns(new FolderInfo()); + this._fileManager.Setup(f => f.GetFile(It.IsAny())).Returns(new FileInfo()); + this._folderPermissionController.Setup(f => f.CanViewFolder(It.IsAny())).Returns(true); } #endregion @@ -221,24 +221,24 @@ public void MessagingController_Constructor_Throws_On_Null_DataService() [Test] public void AttachmentsAllowed_Returns_True_When_MessagingAllowAttachments_Setting_Is_YES() { - _mockMessagingController.Setup(mc => mc.GetPortalSetting("MessagingAllowAttachments", Constants.CONTENT_ValidPortalId, "YES")).Returns("YES"); - var result = _mockInternalMessagingController.Object.AttachmentsAllowed(Constants.CONTENT_ValidPortalId); + this._mockMessagingController.Setup(mc => mc.GetPortalSetting("MessagingAllowAttachments", Constants.CONTENT_ValidPortalId, "YES")).Returns("YES"); + var result = this._mockInternalMessagingController.Object.AttachmentsAllowed(Constants.CONTENT_ValidPortalId); Assert.IsTrue(result); } [Test] public void IncludeAttachments_Returns_True_When_MessagingIncludeAttachments_Setting_Is_YES() { - _mockMessagingController.Setup(mc => mc.GetPortalSetting("MessagingAllowAttachments", Constants.CONTENT_ValidPortalId, "YES")).Returns("YES"); - var result = _mockInternalMessagingController.Object.IncludeAttachments(Constants.CONTENT_ValidPortalId); + this._mockMessagingController.Setup(mc => mc.GetPortalSetting("MessagingAllowAttachments", Constants.CONTENT_ValidPortalId, "YES")).Returns("YES"); + var result = this._mockInternalMessagingController.Object.IncludeAttachments(Constants.CONTENT_ValidPortalId); Assert.IsTrue(result); } [Test] public void AttachmentsAllowed_Returns_False_When_MessagingAllowAttachments_Setting_Is_Not_YES() { - _mockInternalMessagingController.Setup(mc => mc.GetPortalSetting("MessagingAllowAttachments", Constants.CONTENT_ValidPortalId, "YES")).Returns("NO"); - var result = _mockInternalMessagingController.Object.AttachmentsAllowed(Constants.CONTENT_ValidPortalId); + this._mockInternalMessagingController.Setup(mc => mc.GetPortalSetting("MessagingAllowAttachments", Constants.CONTENT_ValidPortalId, "YES")).Returns("NO"); + var result = this._mockInternalMessagingController.Object.AttachmentsAllowed(Constants.CONTENT_ValidPortalId); Assert.IsFalse(result); } @@ -249,15 +249,15 @@ public void AttachmentsAllowed_Returns_False_When_MessagingAllowAttachments_Sett [Test] public void GetArchivedMessages_Calls_DataService_GetArchiveBoxView_With_Default_Values() { - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _user12UserInfo.PortalID = Constants.PORTAL_Zero; + this._user12UserInfo.PortalID = Constants.PORTAL_Zero; - _mockInternalMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(_user12UserInfo); + this._mockInternalMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(this._user12UserInfo); - _dtMessageConversationView.Clear(); + this._dtMessageConversationView.Clear(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetArchiveBoxView( Constants.UserID_User12, Constants.PORTAL_Zero, @@ -265,12 +265,12 @@ public void GetArchivedMessages_Calls_DataService_GetArchiveBoxView_With_Default It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(_dtMessageConversationView.CreateDataReader()) + .Returns(this._dtMessageConversationView.CreateDataReader()) .Verifiable(); - _mockInternalMessagingController.Object.GetArchivedMessages(Constants.UserID_User12, 0, 0); + this._mockInternalMessagingController.Object.GetArchivedMessages(Constants.UserID_User12, 0, 0); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } #endregion @@ -282,26 +282,26 @@ public void GetMessageThread_Calls_DataService_GetMessageThread() { var totalRecords = 0; - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _dtMessageThreadsView.Clear(); + this._dtMessageThreadsView.Clear(); - _mockDataService.Setup(ds => ds.GetMessageThread(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), ref totalRecords)).Returns(_dtMessageThreadsView.CreateDataReader()).Verifiable(); - _mockInternalMessagingController.Object.GetMessageThread(0, 0, 0, 0, "", false, ref totalRecords); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.GetMessageThread(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), ref totalRecords)).Returns(this._dtMessageThreadsView.CreateDataReader()).Verifiable(); + this._mockInternalMessagingController.Object.GetMessageThread(0, 0, 0, 0, "", false, ref totalRecords); + this._mockDataService.Verify(); } [Test] public void GetMessageThread_Calls_Overload_With_Default_Values() { int[] totalRecords = { 0 }; - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetMessageThread(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), MessagingController.ConstSortColumnDate, !MessagingController.ConstAscending, ref totalRecords[0])) .Verifiable(); - _mockInternalMessagingController.Object.GetMessageThread(0, 0, 0, 0, ref totalRecords[0]); + this._mockInternalMessagingController.Object.GetMessageThread(0, 0, 0, 0, ref totalRecords[0]); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } #endregion @@ -311,25 +311,25 @@ public void GetMessageThread_Calls_Overload_With_Default_Values() [Test] public void GetRecentSentbox_Calls_Overload_With_Default_Values() { - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetRecentSentbox(Constants.UserID_User12, MessagingController.ConstDefaultPageIndex, MessagingController.ConstDefaultPageSize)) .Verifiable(); - _mockInternalMessagingController.Object.GetRecentSentbox(Constants.UserID_User12); + this._mockInternalMessagingController.Object.GetRecentSentbox(Constants.UserID_User12); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } [Test] public void GetRecentSentbox_Calls_GetSentbox_With_Default_Values() { - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetSentbox(Constants.UserID_User12, It.IsAny(), It.IsAny(), MessagingController.ConstSortColumnDate, !MessagingController.ConstAscending)) .Verifiable(); - _mockInternalMessagingController.Object.GetRecentSentbox(Constants.UserID_User12); + this._mockInternalMessagingController.Object.GetRecentSentbox(Constants.UserID_User12); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } #endregion @@ -339,15 +339,15 @@ public void GetRecentSentbox_Calls_GetSentbox_With_Default_Values() [Test] public void GetSentbox_Calls_DataService_GetSentBoxView_With_Default_Values() { - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _user12UserInfo.PortalID = Constants.PORTAL_Zero; + this._user12UserInfo.PortalID = Constants.PORTAL_Zero; - _mockInternalMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(_user12UserInfo); + this._mockInternalMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(this._user12UserInfo); - _dtMessageConversationView.Clear(); + this._dtMessageConversationView.Clear(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetSentBoxView( Constants.UserID_User12, Constants.PORTAL_Zero, @@ -355,10 +355,10 @@ public void GetSentbox_Calls_DataService_GetSentBoxView_With_Default_Values() It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(_dtMessageConversationView.CreateDataReader()) + .Returns(this._dtMessageConversationView.CreateDataReader()) .Verifiable(); - _mockInternalMessagingController.Object.GetSentbox( + this._mockInternalMessagingController.Object.GetSentbox( Constants.UserID_User12, 0, 0, @@ -367,19 +367,19 @@ public void GetSentbox_Calls_DataService_GetSentBoxView_With_Default_Values() MessageReadStatus.Any, MessageArchivedStatus.Any); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] public void GetSentbox_Calls_Overload_With_Default_Values() { - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetSentbox(Constants.UserID_User12, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), MessageReadStatus.Any, MessageArchivedStatus.UnArchived)) .Verifiable(); - _mockInternalMessagingController.Object.GetSentbox(Constants.UserID_User12, 0, 0, "", false); + this._mockInternalMessagingController.Object.GetSentbox(Constants.UserID_User12, 0, 0, "", false); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } #endregion @@ -390,11 +390,11 @@ public void GetSentbox_Calls_Overload_With_Default_Values() public void RecipientLimit_Returns_MessagingRecipientLimit_Setting() { const int expected = 10; - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetPortalSettingAsInteger("MessagingRecipientLimit", Constants.CONTENT_ValidPortalId, It.IsAny())) .Returns(expected); - var actual = _mockInternalMessagingController.Object.RecipientLimit(Constants.CONTENT_ValidPortalId); + var actual = this._mockInternalMessagingController.Object.RecipientLimit(Constants.CONTENT_ValidPortalId); Assert.AreEqual(expected, actual); } @@ -408,7 +408,7 @@ public void RecipientLimit_Returns_MessagingRecipientLimit_Setting() public void MessagingController_CreateMessage_Throws_On_Null_Message() { //Act, Assert - _messagingController.SendMessage(null, new List(), new List(), new List(), _user12UserInfo); + this._messagingController.SendMessage(null, new List(), new List(), new List(), this._user12UserInfo); } [Test] @@ -416,7 +416,7 @@ public void MessagingController_CreateMessage_Throws_On_Null_Message() public void MessagingController_CreateMessage_Throws_On_Null_Body_And_Subject() { //Act, Assert - _messagingController.SendMessage(new Message(), new List(), new List(), new List(), _user12UserInfo); + this._messagingController.SendMessage(new Message(), new List(), new List(), new List(), this._user12UserInfo); } [Test] @@ -427,7 +427,7 @@ public void MessagingController_CreateMessage_Throws_On_Null_Roles_And_Users() var message = new Message { Subject = "subject", Body = "body" }; //Act, Assert - _messagingController.SendMessage(message, null, null, null, _user12UserInfo); + this._messagingController.SendMessage(message, null, null, null, this._user12UserInfo); } [Test] @@ -438,7 +438,7 @@ public void MessagingController_CreateMessage_Throws_On_Empty_Roles_And_Users_Li var message = new Message { Subject = "subject", Body = "body" }; //Act, Assert - _messagingController.SendMessage(message, new List(), new List(), null, _user12UserInfo); + this._messagingController.SendMessage(message, new List(), new List(), null, this._user12UserInfo); } [Test] @@ -449,7 +449,7 @@ public void MessagingController_CreateMessage_Throws_On_Roles_And_Users_With_No_ var message = new Message { Subject = "subject", Body = "body" }; //Act, Assert - _messagingController.SendMessage(message, new List { new RoleInfo() }, new List { new UserInfo() }, null, _user12UserInfo); + this._messagingController.SendMessage(message, new List { new RoleInfo() }, new List { new UserInfo() }, null, this._user12UserInfo); } [Test] @@ -467,7 +467,7 @@ public void MessagingController_CreateMessage_Throws_On_Large_Subject() var message = new Message { Subject = subject.ToString(), Body = "body" }; //Act, Assert - _messagingController.SendMessage(message, new List { new RoleInfo() }, new List { new UserInfo() }, null, _user12UserInfo); + this._messagingController.SendMessage(message, new List { new RoleInfo() }, new List { new UserInfo() }, null, this._user12UserInfo); } [Test] @@ -486,7 +486,7 @@ public void MessagingController_CreateMessage_Throws_On_Large_To() } //Act, Assert - _messagingController.SendMessage(message, roles, users, null, _user12UserInfo); + this._messagingController.SendMessage(message, roles, users, null, this._user12UserInfo); } [Test] @@ -499,7 +499,7 @@ public void MessagingController_CreateMessage_Throws_On_Null_Sender() var role = new RoleInfo { RoleName = "role1" }; //Act - _messagingController.SendMessage(message, new List { role }, new List { user }, null, null); + this._messagingController.SendMessage(message, new List { role }, new List { user }, null, null); } [Test] @@ -513,7 +513,7 @@ public void MessagingController_CreateMessage_Throws_On_Negative_SenderID() var sender = new UserInfo { DisplayName = "user11" }; //Act - _messagingController.SendMessage(message, new List { role }, new List { user }, null, sender); + this._messagingController.SendMessage(message, new List { role }, new List { user }, null, sender); } [Test] @@ -528,11 +528,11 @@ public void MessagingController_CreateMessage_Throws_On_SendingToRole_ByNonAdmin var mockDataService = new Mock(); var messagingController = new MessagingController(mockDataService.Object); - _dtMessageRecipients.Clear(); - mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(_dtMessageRecipients.CreateDataReader()); + this._dtMessageRecipients.Clear(); + mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(this._dtMessageRecipients.CreateDataReader()); //Act - messagingController.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, _user12UserInfo); + messagingController.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, this._user12UserInfo); } //[Test] @@ -547,17 +547,17 @@ public void MessagingController_CreateMessage_Throws_On_Passing_Attachments_When var messagingController = new MessagingController(mockDataService.Object); //disable caching - _mockCacheProvider.Setup(mc => mc.GetItem(It.IsAny())).Returns(null); + this._mockCacheProvider.Setup(mc => mc.GetItem(It.IsAny())).Returns(null); - _dtPortalSettings.Clear(); - _dtPortalSettings.Rows.Add(Constants.PORTALSETTING_MessagingAllowAttachments_Name, Constants.PORTALSETTING_MessagingAllowAttachments_Value_NO, Constants.CULTURE_EN_US); - _dataProvider.Setup(d => d.GetPortalSettings(It.IsAny(), It.IsAny())).Returns(_dtPortalSettings.CreateDataReader()); + this._dtPortalSettings.Clear(); + this._dtPortalSettings.Rows.Add(Constants.PORTALSETTING_MessagingAllowAttachments_Name, Constants.PORTALSETTING_MessagingAllowAttachments_Value_NO, Constants.CULTURE_EN_US); + this._dataProvider.Setup(d => d.GetPortalSettings(It.IsAny(), It.IsAny())).Returns(this._dtPortalSettings.CreateDataReader()); - _dtMessageRecipients.Clear(); - mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(_dtMessageRecipients.CreateDataReader()); + this._dtMessageRecipients.Clear(); + mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(this._dtMessageRecipients.CreateDataReader()); //Act - messagingController.SendMessage(message, null, new List { user }, new List { Constants.FOLDER_ValidFileId }, _user12UserInfo); + messagingController.SendMessage(message, null, new List { user }, new List { Constants.FOLDER_ValidFileId }, this._user12UserInfo); } [Test] @@ -568,27 +568,27 @@ public void MessagingController_CreateMessage_Calls_DataService_SaveSocialMessag var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, this._adminUserInfo); //Assert - _mockDataService.Verify(ds => ds.SaveMessage(It.Is(v => v.PortalID == Constants.PORTAL_Zero && v.Subject == "subject" + this._mockDataService.Verify(ds => ds.SaveMessage(It.Is(v => v.PortalID == Constants.PORTAL_Zero && v.Subject == "subject" && v.Body == "body" && v.To == "role1,user1" - && v.SenderUserID == _adminUserInfo.UserID) + && v.SenderUserID == this._adminUserInfo.UserID) , It.IsAny() , It.IsAny())); } @@ -601,23 +601,23 @@ public void MessagingController_Filters_Input_When_ProfanityFilter_Is_Enabled() var role = new RoleInfo { RoleName = "role1" }; var message = new Message { Subject = "subject", Body = "body" }; - _dtMessageRecipients.Clear(); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(_dtMessageRecipients.CreateDataReader()); + this._dtMessageRecipients.Clear(); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController + this._mockMessagingController .Setup(mc => mc.GetPortalSetting("MessagingProfanityFilters", It.IsAny(), It.IsAny())) .Returns("YES"); - _mockMessagingController.Setup(mc => mc.InputFilter("subject")).Returns("subject_filtered"); - _mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); - _mockInternalMessagingController.Setup(mc => mc.GetMessageRecipient(It.IsAny(), It.IsAny())); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.InputFilter("subject")).Returns("subject_filtered"); + this._mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); + this._mockInternalMessagingController.Setup(mc => mc.GetMessageRecipient(It.IsAny(), It.IsAny())); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, this._adminUserInfo); //Assert Assert.AreEqual("subject_filtered", message.Subject); @@ -632,28 +632,28 @@ public void MessagingController_CreateMessage_For_CommonUser_Calls_DataService_S var role = new RoleInfo { RoleName = "role1" }; var message = new Message { Subject = "subject", Body = "body" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); //this pattern is based on: http://dpwhelan.com/blog/software-development/moq-sequences/ var callingSequence = 0; //Arrange for Assert - _mockDataService.Setup(ds => ds.CreateMessageRecipientsForRole(It.IsAny(), It.IsAny(), It.IsAny())).Callback(() => Assert.That(callingSequence++, Is.EqualTo(0))); - _mockDataService.Setup(ds => ds.SaveMessageRecipient(It.IsAny(), It.IsAny())).Callback(() => Assert.That(callingSequence++, Is.GreaterThan(0))); + this._mockDataService.Setup(ds => ds.CreateMessageRecipientsForRole(It.IsAny(), It.IsAny(), It.IsAny())).Callback(() => Assert.That(callingSequence++, Is.EqualTo(0))); + this._mockDataService.Setup(ds => ds.SaveMessageRecipient(It.IsAny(), It.IsAny())).Callback(() => Assert.That(callingSequence++, Is.GreaterThan(0))); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, this._adminUserInfo); //SaveMessageRecipient is called twice, one for sent message and second for receive } @@ -668,18 +668,18 @@ public void MessagingController_CreateMessage_Trims_Comma_For_One_User() var mockDataService = new Mock(); var messagingController = new MessagingController(mockDataService.Object); - _mockInternalMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), _user12UserInfo.PortalID, It.IsAny())).Returns(0); + this._mockInternalMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), this._user12UserInfo.PortalID, It.IsAny())).Returns(0); mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_ElevenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act messagingController.SendMessage(message, new List(), new List { user }, null, sender); @@ -699,18 +699,18 @@ public void MessagingController_CreateMessage_Trims_Comma_For_Two_Users() var mockDataService = new Mock(); var messagingController = new MessagingController(mockDataService.Object); - _mockInternalMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), _user12UserInfo.PortalID, It.IsAny())).Returns(0); + this._mockInternalMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), this._user12UserInfo.PortalID, It.IsAny())).Returns(0); - _dtMessageRecipients.Clear(); + this._dtMessageRecipients.Clear(); var recipientId = 0; //_dtMessageRecipients.Rows.Add(Constants.Messaging_RecipientId_2, Constants.USER_Null, Constants.Messaging_UnReadMessage, Constants.Messaging_UnArchivedMessage); mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())) - .Callback(() => _dtMessageRecipients.Rows.Add(recipientId++, Constants.USER_Null, Constants.Messaging_UnReadMessage, Constants.Messaging_UnArchivedMessage)) - .Returns(() => _dtMessageRecipients.CreateDataReader()); + .Callback(() => this._dtMessageRecipients.Rows.Add(recipientId++, Constants.USER_Null, Constants.Messaging_UnReadMessage, Constants.Messaging_UnArchivedMessage)) + .Returns(() => this._dtMessageRecipients.CreateDataReader()); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act messagingController.SendMessage(message, new List(), new List { user10, user11 }, null, sender); @@ -726,13 +726,13 @@ public void MessagingController_CreateMessage_Trims_Comma_For_One_Role() var message = new Message { Subject = "subject", Body = "body" }; var role = new RoleInfo { RoleName = Constants.RoleName_Administrators }; - _dtMessageRecipients.Clear(); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(_dtMessageRecipients.CreateDataReader()); + this._dtMessageRecipients.Clear(); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List(), null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List(), null, this._adminUserInfo); //Assert Assert.AreEqual(message.To, Constants.RoleName_Administrators); @@ -746,13 +746,13 @@ public void MessagingController_CreateMessage_Trims_Comma_For_Two_Roles() var role1 = new RoleInfo { RoleName = Constants.RoleName_Administrators }; var role2 = new RoleInfo { RoleName = Constants.RoleName_Subscribers }; - _dtMessageRecipients.Clear(); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(_dtMessageRecipients.CreateDataReader()); + this._dtMessageRecipients.Clear(); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), It.IsAny())).Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); //Act - _mockMessagingController.Object.SendMessage(message, new List { role1, role2 }, new List(), null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role1, role2 }, new List(), null, this._adminUserInfo); //Assert Assert.AreEqual(message.To, Constants.RoleName_Administrators + "," + Constants.RoleName_Subscribers); @@ -766,50 +766,50 @@ public void MessagingController_CreateMessage_Calls_DataService_SaveSocialMessag var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, this._adminUserInfo); //Assert - _mockDataService.Verify(ds => ds.SaveMessageAttachment(It.Is(v => v.MessageID == message.MessageID), It.IsAny())); + this._mockDataService.Verify(ds => ds.SaveMessageAttachment(It.Is(v => v.MessageID == message.MessageID), It.IsAny())); } [Test] public void MessagingController_CreateMessage_Calls_DataService_CreateSocialMessageRecipientsForRole_On_Passing_Role_ByAdmin() { - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); //Arrange var message = new Message { Subject = "subject", Body = "body" }; var role = new RoleInfo { RoleName = Constants.RoleName_RegisteredUsers, RoleID = Constants.RoleID_RegisteredUsers }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _user12UserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._user12UserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { _user12UserInfo }, new List { Constants.FOLDER_ValidFileId }, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { this._user12UserInfo }, new List { Constants.FOLDER_ValidFileId }, this._adminUserInfo); //Assert - _mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(message.MessageID, Constants.RoleID_RegisteredUsers.ToString(), It.IsAny())); + this._mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(message.MessageID, Constants.RoleID_RegisteredUsers.ToString(), It.IsAny())); } [Test] @@ -822,19 +822,19 @@ public void MessagingController_CreateMessage_Calls_DataService_CreateSocialMess var mockDataService = new Mock(); var messagingController = new MessagingController(mockDataService.Object); - mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _user12UserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._user12UserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _hostUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._hostUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - messagingController.SendMessage(message, new List { role }, new List { _user12UserInfo }, new List { Constants.FOLDER_ValidFileId }, _hostUserInfo); + messagingController.SendMessage(message, new List { role }, new List { this._user12UserInfo }, new List { Constants.FOLDER_ValidFileId }, this._hostUserInfo); //Assert mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(message.MessageID, Constants.RoleID_RegisteredUsers.ToString(), It.IsAny())); @@ -849,24 +849,24 @@ public void MessagingController_CreateMessage_Calls_DataService_CreateSocialMess var role1 = new RoleInfo { RoleName = "role1", RoleID = Constants.RoleID_RegisteredUsers }; var role2 = new RoleInfo { RoleName = "role2", RoleID = Constants.RoleID_Administrators }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role1, role2 }, new List { user }, new List { Constants.FOLDER_ValidFileId }, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role1, role2 }, new List { user }, new List { Constants.FOLDER_ValidFileId }, this._adminUserInfo); //Assert - _mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(message.MessageID, Constants.RoleID_RegisteredUsers + "," + Constants.RoleID_Administrators, It.IsAny())); + this._mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(message.MessageID, Constants.RoleID_RegisteredUsers + "," + Constants.RoleID_Administrators, It.IsAny())); } [Test] @@ -877,24 +877,24 @@ public void MessagingController_CreateMessage_Calls_DataService_CreateSocialMess var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = Constants.RoleName_FirstSocialGroup, RoleID = Constants.RoleID_FirstSocialGroup }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockInternalMessagingController.Setup(mc => mc.GetMessageRecipient(It.IsAny(), It.IsAny())); + this._mockInternalMessagingController.Setup(mc => mc.GetMessageRecipient(It.IsAny(), It.IsAny())); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, _groupOwnerUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, this._groupOwnerUserInfo); //Assert - _mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(It.IsAny(), It.IsAny(), It.IsAny())); + this._mockDataService.Verify(ds => ds.CreateMessageRecipientsForRole(It.IsAny(), It.IsAny(), It.IsAny())); } [Test] @@ -905,24 +905,24 @@ public void MessagingController_CreateMessage_Calls_DataService_SaveSocialMessag var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, this._adminUserInfo); //Assert - _mockDataService.Verify(ds => ds.SaveMessageRecipient(It.Is(v => v.MessageID == message.MessageID && v.UserID == user.UserID), It.IsAny())); + this._mockDataService.Verify(ds => ds.SaveMessageRecipient(It.Is(v => v.MessageID == message.MessageID && v.UserID == user.UserID), It.IsAny())); } [Test] @@ -933,21 +933,21 @@ public void MessagingController_CreateMessage_Sets_ReplyAll_To_False_On_Passing_ var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1", RoleID = Constants.RoleID_RegisteredUsers }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, new List { Constants.FOLDER_ValidFileId }, this._adminUserInfo); //Assert Assert.AreEqual(message.ReplyAllAllowed, false); @@ -963,18 +963,18 @@ public void MessagingController_CreateMessage_Sets_ReplyAll_To_True_On_Passing_U var messagingController = new MessagingController(mockDataService.Object); mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - messagingController.SendMessage(message, new List(), new List { user }, new List { Constants.FOLDER_ValidFileId }, _adminUserInfo); + messagingController.SendMessage(message, new List(), new List { user }, new List { Constants.FOLDER_ValidFileId }, this._adminUserInfo); //Assert Assert.AreEqual(message.ReplyAllAllowed, true); @@ -988,24 +988,24 @@ public void MessagingController_CreateMessage_Adds_Sender_As_Recipient_When_Not_ var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, this._adminUserInfo); //Assert - _mockDataService.Verify(ds => ds.SaveMessageRecipient(It.Is(v => v.MessageID == message.MessageID && v.UserID == _adminUserInfo.UserID), It.IsAny())); + this._mockDataService.Verify(ds => ds.SaveMessageRecipient(It.Is(v => v.MessageID == message.MessageID && v.UserID == this._adminUserInfo.UserID), It.IsAny())); } [Test] @@ -1016,26 +1016,26 @@ public void MessagingController_CreateMessage_Marks_Message_As_Dispatched_For_Se var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); - _mockDataService.Setup(ds => ds.SaveMessageRecipient(It.Is(mr => mr.UserID == _adminUserInfo.UserID), It.IsAny())).Returns(Constants.Messaging_RecipientId_1); + this._mockDataService.Setup(ds => ds.SaveMessageRecipient(It.Is(mr => mr.UserID == this._adminUserInfo.UserID), It.IsAny())).Returns(Constants.Messaging_RecipientId_1); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user }, null, this._adminUserInfo); //Assert - _mockInternalMessagingController.Verify(imc => imc.MarkMessageAsDispatched(It.IsAny(), Constants.Messaging_RecipientId_1)); + this._mockInternalMessagingController.Verify(imc => imc.MarkMessageAsDispatched(It.IsAny(), Constants.Messaging_RecipientId_1)); } [Test] @@ -1046,26 +1046,26 @@ public void MessagingController_CreateMessage_Does_Not_Mark_Message_As_Dispatche var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; var role = new RoleInfo { RoleName = "role1" }; - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), Constants.USER_TenId)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), _adminUserInfo.UserID)) - .Callback(SetupDataTables) - .Returns(_dtMessageRecipients.CreateDataReader()); + this._mockDataService.Setup(md => md.GetMessageRecipientByMessageAndUser(It.IsAny(), this._adminUserInfo.UserID)) + .Callback(this.SetupDataTables) + .Returns(this._dtMessageRecipients.CreateDataReader()); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(ims => ims.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns((MessageRecipient)null); - _mockDataService.Setup(ds => ds.SaveMessageRecipient(It.Is(mr => mr.UserID == _adminUserInfo.UserID), It.IsAny())).Returns(Constants.Messaging_RecipientId_1); + this._mockDataService.Setup(ds => ds.SaveMessageRecipient(It.Is(mr => mr.UserID == this._adminUserInfo.UserID), It.IsAny())).Returns(Constants.Messaging_RecipientId_1); //Act - _mockMessagingController.Object.SendMessage(message, new List { role }, new List { user, _adminUserInfo }, null, _adminUserInfo); + this._mockMessagingController.Object.SendMessage(message, new List { role }, new List { user, this._adminUserInfo }, null, this._adminUserInfo); //Assert - _mockInternalMessagingController.Verify(imc => imc.MarkMessageAsDispatched(It.IsAny(), Constants.Messaging_RecipientId_1), Times.Never()); + this._mockInternalMessagingController.Verify(imc => imc.MarkMessageAsDispatched(It.IsAny(), Constants.Messaging_RecipientId_1), Times.Never()); } #endregion @@ -1079,7 +1079,7 @@ public void MessagingController_ReplyMessage_Throws_On_Null_Sender() //Arrange //Act - _internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "body", null, null); + this._internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "body", null, null); } [Test] @@ -1090,7 +1090,7 @@ public void MessagingController_ReplyMessage_Throws_On_Negative_SenderID() var sender = new UserInfo { DisplayName = "user11" }; //Act - _internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "body", null, sender); + this._internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "body", null, sender); } [Test] @@ -1101,7 +1101,7 @@ public void MessagingController_ReplyMessage_Throws_On_Null_Subject() var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId }; //Act, Assert - _internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, null, null, sender); + this._internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, null, null, sender); } [Test] @@ -1112,7 +1112,7 @@ public void MessagingController_ReplyMessage_Throws_On_Empty_Subject() var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId }; //Act, Assert - _internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "", null, sender); + this._internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "", null, sender); } [Test] @@ -1122,11 +1122,11 @@ public void MessagingController_ReplyMessage_Throws_On_Passing_Attachments_When_ //Arrange var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId, PortalID = Constants.PORTAL_Zero }; - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); - _mockInternalMessagingController.Setup(imc => imc.AttachmentsAllowed(Constants.PORTAL_Zero)).Returns(false); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); + this._mockInternalMessagingController.Setup(imc => imc.AttachmentsAllowed(Constants.PORTAL_Zero)).Returns(false); //Act, Assert - _internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "body", new List { Constants.FOLDER_ValidFileId }, sender); + this._internalMessagingController.ReplyMessage(Constants.Messaging_MessageId_1, "body", new List { Constants.FOLDER_ValidFileId }, sender); } [Test] @@ -1135,20 +1135,20 @@ public void MessagingController_ReplyMessage_Filters_Input_When_ProfanityFilter_ //Arrange var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId, PortalID = Constants.PORTAL_Zero }; - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); - _mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); + this._mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); + this._mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); - _mockMessagingController + this._mockMessagingController .Setup(mc => mc.GetPortalSetting("MessagingProfanityFilters", It.IsAny(), It.IsAny())) .Returns("YES"); - _mockInternalMessagingController.Setup(imc => imc.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns(new MessageRecipient()); + this._mockInternalMessagingController.Setup(imc => imc.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns(new MessageRecipient()); - _mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); + this._mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); - _mockDataService.Verify(ds => ds.CreateMessageReply(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); + this._mockDataService.Verify(ds => ds.CreateMessageReply(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())); } [Test] @@ -1158,18 +1158,18 @@ public void MessagingController_ReplyMessage_Throws_When_Message_Or_Recipient_Ar //Arrange var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId, PortalID = Constants.PORTAL_Zero }; - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); - _mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); + this._mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); + this._mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); - _mockMessagingController + this._mockMessagingController .Setup(mc => mc.GetPortalSetting("MessagingProfanityFilters", It.IsAny(), It.IsAny())) .Returns("NO"); - _mockDataService.Setup(ds => ds.CreateMessageReply(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(-1); + this._mockDataService.Setup(ds => ds.CreateMessageReply(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(-1); - _mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); + this._mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); } [Test] @@ -1178,20 +1178,20 @@ public void MessagingController_ReplyMessage_Marks_Message_As_Read_By_Sender() //Arrange var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId, PortalID = Constants.PORTAL_Zero }; - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); - _mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); + this._mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); + this._mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); - _mockMessagingController + this._mockMessagingController .Setup(mc => mc.GetPortalSetting("MessagingProfanityFilters", It.IsAny(), It.IsAny())) .Returns("NO"); - _mockInternalMessagingController.Setup(imc => imc.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns(new MessageRecipient()); + this._mockInternalMessagingController.Setup(imc => imc.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns(new MessageRecipient()); - _mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); + this._mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); - _mockInternalMessagingController.Verify(imc => imc.MarkRead(It.IsAny(), sender.UserID)); + this._mockInternalMessagingController.Verify(imc => imc.MarkRead(It.IsAny(), sender.UserID)); } [Test] @@ -1200,20 +1200,20 @@ public void MessagingController_ReplyMessage_Marks_Message_As_Dispatched_For_Sen //Arrange var sender = new UserInfo { DisplayName = "user11", UserID = Constants.USER_TenId, PortalID = Constants.PORTAL_Zero }; - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); - _mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); + this._mockMessagingController.Setup(mc => mc.InputFilter("body")).Returns("body_filtered"); + this._mockMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(new UserInfo()); - _mockMessagingController + this._mockMessagingController .Setup(mc => mc.GetPortalSetting("MessagingProfanityFilters", It.IsAny(), It.IsAny())) .Returns("NO"); - _mockInternalMessagingController.Setup(imc => imc.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns(new MessageRecipient { RecipientID = Constants.Messaging_RecipientId_1 }); + this._mockInternalMessagingController.Setup(imc => imc.GetMessageRecipient(It.IsAny(), It.IsAny())).Returns(new MessageRecipient { RecipientID = Constants.Messaging_RecipientId_1 }); - _mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); + this._mockInternalMessagingController.Object.ReplyMessage(0, "body", null, sender); - _mockInternalMessagingController.Verify(imc => imc.MarkMessageAsDispatched(It.IsAny(), Constants.Messaging_RecipientId_1)); + this._mockInternalMessagingController.Verify(imc => imc.MarkMessageAsDispatched(It.IsAny(), Constants.Messaging_RecipientId_1)); } #endregion @@ -1228,10 +1228,10 @@ public void MessagingController_SetReadMessage_Calls_DataService_UpdateSocialMes var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; //Act - _internalMessagingController.MarkRead(messageInstance.ConversationId, user.UserID); + this._internalMessagingController.MarkRead(messageInstance.ConversationId, user.UserID); //Assert - _mockDataService.Verify(ds => ds.UpdateMessageReadStatus(messageInstance.ConversationId, user.UserID, true)); + this._mockDataService.Verify(ds => ds.UpdateMessageReadStatus(messageInstance.ConversationId, user.UserID, true)); } [Test] @@ -1242,10 +1242,10 @@ public void MessagingController_SetUnReadMessage_Calls_DataService_UpdateSocialM var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; //Act - _internalMessagingController.MarkUnRead(messageInstance.ConversationId, user.UserID); + this._internalMessagingController.MarkUnRead(messageInstance.ConversationId, user.UserID); //Assert - _mockDataService.Verify(ds => ds.UpdateMessageReadStatus(messageInstance.ConversationId, user.UserID, false)); + this._mockDataService.Verify(ds => ds.UpdateMessageReadStatus(messageInstance.ConversationId, user.UserID, false)); } [Test] @@ -1256,10 +1256,10 @@ public void MessagingController_SetArchivedMessage_Calls_DataService_UpdateSocia var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; //Act - _internalMessagingController.MarkArchived(messageInstance.ConversationId, user.UserID); + this._internalMessagingController.MarkArchived(messageInstance.ConversationId, user.UserID); //Assert - _mockDataService.Verify(ds => ds.UpdateMessageArchivedStatus(messageInstance.ConversationId, user.UserID, true)); + this._mockDataService.Verify(ds => ds.UpdateMessageArchivedStatus(messageInstance.ConversationId, user.UserID, true)); } [Test] @@ -1270,10 +1270,10 @@ public void MessagingController_SetUnArchivedMessage_Calls_DataService_UpdateSoc var user = new UserInfo { DisplayName = "user1", UserID = Constants.USER_TenId }; //Act - _internalMessagingController.MarkUnArchived(messageInstance.ConversationId, user.UserID); + this._internalMessagingController.MarkUnArchived(messageInstance.ConversationId, user.UserID); //Assert - _mockDataService.Verify(ds => ds.UpdateMessageArchivedStatus(messageInstance.ConversationId, user.UserID, false)); + this._mockDataService.Verify(ds => ds.UpdateMessageArchivedStatus(messageInstance.ConversationId, user.UserID, false)); } #endregion @@ -1283,15 +1283,15 @@ public void MessagingController_SetUnArchivedMessage_Calls_DataService_UpdateSoc [Test] public void GetSocialMessageRecipient_Calls_DataService_GetSocialMessageRecipientByMessageAndUser() { - _dtMessageRecipients.Clear(); - _mockDataService + this._dtMessageRecipients.Clear(); + this._mockDataService .Setup(ds => ds.GetMessageRecipientByMessageAndUser(Constants.Messaging_MessageId_1, Constants.UserID_User12)) - .Returns(_dtMessageRecipients.CreateDataReader()) + .Returns(this._dtMessageRecipients.CreateDataReader()) .Verifiable(); - _internalMessagingController.GetMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); + this._internalMessagingController.GetMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); - _mockDataService.Verify(); + this._mockDataService.Verify(); } #endregion @@ -1302,16 +1302,16 @@ public void GetSocialMessageRecipient_Calls_DataService_GetSocialMessageRecipien [ExpectedException(typeof(ArgumentNullException))] public void WaitTimeForNextMessage_Throws_On_Null_Sender() { - _internalMessagingController.WaitTimeForNextMessage(null); + this._internalMessagingController.WaitTimeForNextMessage(null); } [Test] public void WaitTimeForNextMessage_Returns_Zero_When_MessagingThrottlingInterval_Is_Zero() { - _user12UserInfo.PortalID = Constants.CONTENT_ValidPortalId; - _mockMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), _user12UserInfo.PortalID, 0.5)).Returns(0.5); + this._user12UserInfo.PortalID = Constants.CONTENT_ValidPortalId; + this._mockMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), this._user12UserInfo.PortalID, 0.5)).Returns(0.5); - var result = _mockInternalMessagingController.Object.WaitTimeForNextMessage(_user12UserInfo); + var result = this._mockInternalMessagingController.Object.WaitTimeForNextMessage(this._user12UserInfo); Assert.AreEqual(0, result); } @@ -1319,12 +1319,12 @@ public void WaitTimeForNextMessage_Returns_Zero_When_MessagingThrottlingInterval [Test] public void WaitTimeForNextMessage_Returns_Zero_When_Sender_Is_Admin_Or_Host() { - _adminUserInfo.PortalID = Constants.CONTENT_ValidPortalId; + this._adminUserInfo.PortalID = Constants.CONTENT_ValidPortalId; - _mockMessagingController.Setup(mc => mc.GetPortalSettingAsInteger(It.IsAny(), _adminUserInfo.PortalID, Null.NullInteger)).Returns(1); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(true); + this._mockMessagingController.Setup(mc => mc.GetPortalSettingAsInteger(It.IsAny(), this._adminUserInfo.PortalID, Null.NullInteger)).Returns(1); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(true); - var result = _mockInternalMessagingController.Object.WaitTimeForNextMessage(_adminUserInfo); + var result = this._mockInternalMessagingController.Object.WaitTimeForNextMessage(this._adminUserInfo); Assert.AreEqual(0, result); } @@ -1332,14 +1332,14 @@ public void WaitTimeForNextMessage_Returns_Zero_When_Sender_Is_Admin_Or_Host() [Test] public void WaitTimeForNextMessage_Returns_Zero_When_The_User_Has_No_Previous_Conversations() { - _user12UserInfo.PortalID = Constants.CONTENT_ValidPortalId; + this._user12UserInfo.PortalID = Constants.CONTENT_ValidPortalId; - _mockMessagingController.Setup(mc => mc.GetPortalSettingAsInteger(It.IsAny(), _user12UserInfo.PortalID, Null.NullInteger)).Returns(1); - _mockMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(false); + this._mockMessagingController.Setup(mc => mc.GetPortalSettingAsInteger(It.IsAny(), this._user12UserInfo.PortalID, Null.NullInteger)).Returns(1); + this._mockMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(false); - _mockInternalMessagingController.Setup(mc => mc.GetLastSentMessage(_user12UserInfo)).Returns((Message) null); + this._mockInternalMessagingController.Setup(mc => mc.GetLastSentMessage(this._user12UserInfo)).Returns((Message) null); - var result = _mockInternalMessagingController.Object.WaitTimeForNextMessage(_user12UserInfo); + var result = this._mockInternalMessagingController.Object.WaitTimeForNextMessage(this._user12UserInfo); Assert.AreEqual(0, result); } @@ -1353,16 +1353,16 @@ public void WaitTimeForNextMessage_Returns_The_Number_Of_Seconds_Since_Last_Mess var culture = CultureInfo.GetCultureInfo("en-US"); var actualDate = DateTime.Parse(actualDateString, culture); var lastMessageDate = DateTime.Parse(lastMessageDateString, culture); - _user12UserInfo.PortalID = Constants.CONTENT_ValidPortalId; - _mockInternalMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), _user12UserInfo.PortalID, It.IsAny())).Returns(throttlingInterval); - _mockInternalMessagingController.Setup(mc => mc.IsAdminOrHost(_adminUserInfo)).Returns(false); - _dtMessages.Clear(); - _dtMessages.Rows.Add(-1, 1, 1, "", "", "", "", -1, -1, -1, -1, lastMessageDate, -1, Null.NullDate); - var dr = _dtMessages.CreateDataReader(); + this._user12UserInfo.PortalID = Constants.CONTENT_ValidPortalId; + this._mockInternalMessagingController.Setup(mc => mc.GetPortalSettingAsDouble(It.IsAny(), this._user12UserInfo.PortalID, It.IsAny())).Returns(throttlingInterval); + this._mockInternalMessagingController.Setup(mc => mc.IsAdminOrHost(this._adminUserInfo)).Returns(false); + this._dtMessages.Clear(); + this._dtMessages.Rows.Add(-1, 1, 1, "", "", "", "", -1, -1, -1, -1, lastMessageDate, -1, Null.NullDate); + var dr = this._dtMessages.CreateDataReader(); var message = CBO.FillObject(dr); - _mockInternalMessagingController.Setup(mc => mc.GetLastSentMessage(It.IsAny())).Returns(message); - _mockInternalMessagingController.Setup(mc => mc.GetDateTimeNow()).Returns(actualDate); - var result = _mockInternalMessagingController.Object.WaitTimeForNextMessage(_user12UserInfo); + this._mockInternalMessagingController.Setup(mc => mc.GetLastSentMessage(It.IsAny())).Returns(message); + this._mockInternalMessagingController.Setup(mc => mc.GetDateTimeNow()).Returns(actualDate); + var result = this._mockInternalMessagingController.Object.WaitTimeForNextMessage(this._user12UserInfo); Assert.AreEqual(expected, result); } @@ -1374,28 +1374,28 @@ public void WaitTimeForNextMessage_Returns_The_Number_Of_Seconds_Since_Last_Mess [Test] public void GetInbox_Calls_DataService_GetMessageBoxView() { - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); - _dtMessageConversationView.Clear(); + this._dtMessageConversationView.Clear(); - _user12UserInfo.PortalID = Constants.PORTAL_Zero; + this._user12UserInfo.PortalID = Constants.PORTAL_Zero; - _mockInternalMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(_user12UserInfo); - _mockDataService.Setup(ds => ds.GetInBoxView(It.IsAny(), Constants.PORTAL_Zero, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), MessageReadStatus.Any, MessageArchivedStatus.Any, MessageSentStatus.Received)).Returns(_dtMessageConversationView.CreateDataReader()).Verifiable(); - _mockInternalMessagingController.Object.GetInbox(0, 0, 0, "", false, MessageReadStatus.Any, MessageArchivedStatus.Any); - _mockDataService.Verify(); + this._mockInternalMessagingController.Setup(mc => mc.GetCurrentUserInfo()).Returns(this._user12UserInfo); + this._mockDataService.Setup(ds => ds.GetInBoxView(It.IsAny(), Constants.PORTAL_Zero, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), MessageReadStatus.Any, MessageArchivedStatus.Any, MessageSentStatus.Received)).Returns(this._dtMessageConversationView.CreateDataReader()).Verifiable(); + this._mockInternalMessagingController.Object.GetInbox(0, 0, 0, "", false, MessageReadStatus.Any, MessageArchivedStatus.Any); + this._mockDataService.Verify(); } [Test] public void GetInbox_Calls_Overload_With_Default_Values() { - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetInbox(Constants.UserID_User12, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), MessageReadStatus.Any, MessageArchivedStatus.UnArchived)) .Verifiable(); - _mockInternalMessagingController.Object.GetInbox(Constants.UserID_User12, 0, 0, "", false); + this._mockInternalMessagingController.Object.GetInbox(Constants.UserID_User12, 0, 0, "", false); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } #endregion @@ -1405,25 +1405,25 @@ public void GetInbox_Calls_Overload_With_Default_Values() [Test] public void GetRecentInbox_Calls_GetInbox_With_Default_Values() { - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetInbox(Constants.UserID_User12, It.IsAny(), It.IsAny(), MessagingController.ConstSortColumnDate, !MessagingController.ConstAscending)) .Verifiable(); - _mockInternalMessagingController.Object.GetRecentInbox(Constants.UserID_User12, 0, 0); + this._mockInternalMessagingController.Object.GetRecentInbox(Constants.UserID_User12, 0, 0); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } [Test] public void GetRecentInbox_Calls_Overload_With_Default_Values() { - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetRecentInbox(Constants.UserID_User12, MessagingController.ConstDefaultPageIndex, MessagingController.ConstDefaultPageSize)) .Verifiable(); - _mockInternalMessagingController.Object.GetRecentInbox(Constants.UserID_User12); + this._mockInternalMessagingController.Object.GetRecentInbox(Constants.UserID_User12); - _mockInternalMessagingController.Verify(); + this._mockInternalMessagingController.Verify(); } #endregion @@ -1433,9 +1433,9 @@ public void GetRecentInbox_Calls_Overload_With_Default_Values() [Test] public void CountArchivedMessagesByConversation_Calls_DataService_CountArchivedMessagesByConversation() { - _mockDataService.Setup(ds => ds.CountArchivedMessagesByConversation(It.IsAny())).Verifiable(); - _internalMessagingController.CountArchivedMessagesByConversation(1); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountArchivedMessagesByConversation(It.IsAny())).Verifiable(); + this._internalMessagingController.CountArchivedMessagesByConversation(1); + this._mockDataService.Verify(); } #endregion @@ -1445,9 +1445,9 @@ public void CountArchivedMessagesByConversation_Calls_DataService_CountArchivedM [Test] public void CountMessagesByConversation_Calls_DataService_CountMessagesByConversation() { - _mockDataService.Setup(ds => ds.CountMessagesByConversation(It.IsAny())).Verifiable(); - _internalMessagingController.CountMessagesByConversation(1); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountMessagesByConversation(It.IsAny())).Verifiable(); + this._internalMessagingController.CountMessagesByConversation(1); + this._mockDataService.Verify(); } #endregion @@ -1457,9 +1457,9 @@ public void CountMessagesByConversation_Calls_DataService_CountMessagesByConvers [Test] public void CountConversations_Calls_DataService_CountTotalConversations() { - _mockDataService.Setup(ds => ds.CountTotalConversations(It.IsAny(), It.IsAny())).Verifiable(); - _internalMessagingController.CountConversations(Constants.UserID_User12, Constants.PORTAL_Zero); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountTotalConversations(It.IsAny(), It.IsAny())).Verifiable(); + this._internalMessagingController.CountConversations(Constants.UserID_User12, Constants.PORTAL_Zero); + this._mockDataService.Verify(); } #endregion @@ -1469,9 +1469,9 @@ public void CountConversations_Calls_DataService_CountTotalConversations() [Test] public void CountUnreadMessages_Calls_DataService_CountNewThreads() { - _mockDataService.Setup(ds => ds.CountNewThreads(It.IsAny(), It.IsAny())).Verifiable(); - _internalMessagingController.CountUnreadMessages(Constants.UserID_User12, Constants.PORTAL_Zero); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountNewThreads(It.IsAny(), It.IsAny())).Verifiable(); + this._internalMessagingController.CountUnreadMessages(Constants.UserID_User12, Constants.PORTAL_Zero); + this._mockDataService.Verify(); } #endregion @@ -1481,9 +1481,9 @@ public void CountUnreadMessages_Calls_DataService_CountNewThreads() [Test] public void CountSentMessages_Calls_DataService_CountSentMessages() { - _mockDataService.Setup(ds => ds.CountSentMessages(It.IsAny(), It.IsAny())).Verifiable(); - _internalMessagingController.CountSentMessages(Constants.UserID_User12, Constants.PORTAL_Zero); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountSentMessages(It.IsAny(), It.IsAny())).Verifiable(); + this._internalMessagingController.CountSentMessages(Constants.UserID_User12, Constants.PORTAL_Zero); + this._mockDataService.Verify(); } #endregion @@ -1493,9 +1493,9 @@ public void CountSentMessages_Calls_DataService_CountSentMessages() [Test] public void CountArchivedMessages_Calls_DataService_CountArchivedMessages() { - _mockDataService.Setup(ds => ds.CountArchivedMessages(It.IsAny(), It.IsAny())).Verifiable(); - _internalMessagingController.CountArchivedMessages(Constants.UserID_User12, Constants.PORTAL_Zero); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountArchivedMessages(It.IsAny(), It.IsAny())).Verifiable(); + this._internalMessagingController.CountArchivedMessages(Constants.UserID_User12, Constants.PORTAL_Zero); + this._mockDataService.Verify(); } #endregion @@ -1505,9 +1505,9 @@ public void CountArchivedMessages_Calls_DataService_CountArchivedMessages() [Test] public void DeleteMessageRecipient_Calls_DataService_DeleteMessageRecipientByMessageAndUser() { - _mockDataService.Setup(ds => ds.DeleteMessageRecipientByMessageAndUser(Constants.Messaging_MessageId_1, Constants.UserID_User12)).Verifiable(); - _internalMessagingController.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.DeleteMessageRecipientByMessageAndUser(Constants.Messaging_MessageId_1, Constants.UserID_User12)).Verifiable(); + this._internalMessagingController.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); + this._mockDataService.Verify(); } #endregion @@ -1517,14 +1517,14 @@ public void DeleteMessageRecipient_Calls_DataService_DeleteMessageRecipientByMes [Test] public void GetMessageRecipients_Calls_DataService_GetMessageRecipientsByMessage() { - _dtMessageRecipients.Clear(); + this._dtMessageRecipients.Clear(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetMessageRecipientsByMessage(Constants.Messaging_MessageId_1)) - .Returns(_dtMessageRecipients.CreateDataReader()) + .Returns(this._dtMessageRecipients.CreateDataReader()) .Verifiable(); - _internalMessagingController.GetMessageRecipients(Constants.Messaging_MessageId_1); - _mockDataService.Verify(); + this._internalMessagingController.GetMessageRecipients(Constants.Messaging_MessageId_1); + this._mockDataService.Verify(); } #endregion @@ -1551,81 +1551,81 @@ private static Message CreateValidMessage() private void SetupDataTables() { //Messages - _dtMessages = new DataTable("Messages"); - var pkMessagesMessageID = _dtMessages.Columns.Add("MessageID", typeof(int)); - _dtMessages.Columns.Add("PortalId", typeof(int)); - _dtMessages.Columns.Add("NotificationTypeID", typeof(int)); - _dtMessages.Columns.Add("To", typeof(string)); - _dtMessages.Columns.Add("From", typeof(string)); - _dtMessages.Columns.Add("Subject", typeof(string)); - _dtMessages.Columns.Add("Body", typeof(string)); - _dtMessages.Columns.Add("ConversationId", typeof(int)); - _dtMessages.Columns.Add("ReplyAllAllowed", typeof(bool)); - _dtMessages.Columns.Add("SenderUserID", typeof(int)); - _dtMessages.Columns.Add("CreatedByUserID", typeof(int)); - _dtMessages.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtMessages.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtMessages.Columns.Add("LastModifiedOnDate", typeof(DateTime)); - _dtMessages.PrimaryKey = new[] { pkMessagesMessageID }; + this._dtMessages = new DataTable("Messages"); + var pkMessagesMessageID = this._dtMessages.Columns.Add("MessageID", typeof(int)); + this._dtMessages.Columns.Add("PortalId", typeof(int)); + this._dtMessages.Columns.Add("NotificationTypeID", typeof(int)); + this._dtMessages.Columns.Add("To", typeof(string)); + this._dtMessages.Columns.Add("From", typeof(string)); + this._dtMessages.Columns.Add("Subject", typeof(string)); + this._dtMessages.Columns.Add("Body", typeof(string)); + this._dtMessages.Columns.Add("ConversationId", typeof(int)); + this._dtMessages.Columns.Add("ReplyAllAllowed", typeof(bool)); + this._dtMessages.Columns.Add("SenderUserID", typeof(int)); + this._dtMessages.Columns.Add("CreatedByUserID", typeof(int)); + this._dtMessages.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtMessages.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtMessages.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtMessages.PrimaryKey = new[] { pkMessagesMessageID }; //MessageRecipients - _dtMessageRecipients = new DataTable("MessageRecipients"); - var pkMessageRecipientID = _dtMessageRecipients.Columns.Add("RecipientID", typeof(int)); - _dtMessageRecipients.Columns.Add("MessageID", typeof(int)); - _dtMessageRecipients.Columns.Add("UserID", typeof(int)); - _dtMessageRecipients.Columns.Add("Read", typeof(bool)); - _dtMessageRecipients.Columns.Add("Archived", typeof(bool)); - _dtMessageRecipients.Columns.Add("CreatedByUserID", typeof(int)); - _dtMessageRecipients.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtMessageRecipients.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtMessageRecipients.Columns.Add("LastModifiedOnDate", typeof(DateTime)); - _dtMessageRecipients.PrimaryKey = new[] { pkMessageRecipientID }; + this._dtMessageRecipients = new DataTable("MessageRecipients"); + var pkMessageRecipientID = this._dtMessageRecipients.Columns.Add("RecipientID", typeof(int)); + this._dtMessageRecipients.Columns.Add("MessageID", typeof(int)); + this._dtMessageRecipients.Columns.Add("UserID", typeof(int)); + this._dtMessageRecipients.Columns.Add("Read", typeof(bool)); + this._dtMessageRecipients.Columns.Add("Archived", typeof(bool)); + this._dtMessageRecipients.Columns.Add("CreatedByUserID", typeof(int)); + this._dtMessageRecipients.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtMessageRecipients.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtMessageRecipients.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtMessageRecipients.PrimaryKey = new[] { pkMessageRecipientID }; //MessageAttachments - _dtMessageAttachment = new DataTable("MessageAttachments"); - var pkMessageAttachmentID = _dtMessageAttachment.Columns.Add("MessageAttachmentID", typeof(int)); - _dtMessageAttachment.Columns.Add("MessageID", typeof(int)); - _dtMessageAttachment.Columns.Add("FileID", typeof(int)); - _dtMessageAttachment.Columns.Add("CreatedByUserID", typeof(int)); - _dtMessageAttachment.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtMessageAttachment.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtMessageAttachment.Columns.Add("LastModifiedOnDate", typeof(DateTime)); - _dtMessageAttachment.PrimaryKey = new[] { pkMessageAttachmentID }; + this._dtMessageAttachment = new DataTable("MessageAttachments"); + var pkMessageAttachmentID = this._dtMessageAttachment.Columns.Add("MessageAttachmentID", typeof(int)); + this._dtMessageAttachment.Columns.Add("MessageID", typeof(int)); + this._dtMessageAttachment.Columns.Add("FileID", typeof(int)); + this._dtMessageAttachment.Columns.Add("CreatedByUserID", typeof(int)); + this._dtMessageAttachment.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtMessageAttachment.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtMessageAttachment.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtMessageAttachment.PrimaryKey = new[] { pkMessageAttachmentID }; //Portal Settings - _dtPortalSettings = new DataTable("PortalSettings"); - _dtPortalSettings.Columns.Add("SettingName", typeof(string)); - _dtPortalSettings.Columns.Add("SettingValue", typeof(string)); - _dtPortalSettings.Columns.Add("CultureCode", typeof(string)); - _dtPortalSettings.Columns.Add("CreatedByUserID", typeof(int)); - _dtPortalSettings.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtPortalSettings.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtPortalSettings.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtPortalSettings = new DataTable("PortalSettings"); + this._dtPortalSettings.Columns.Add("SettingName", typeof(string)); + this._dtPortalSettings.Columns.Add("SettingValue", typeof(string)); + this._dtPortalSettings.Columns.Add("CultureCode", typeof(string)); + this._dtPortalSettings.Columns.Add("CreatedByUserID", typeof(int)); + this._dtPortalSettings.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtPortalSettings.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtPortalSettings.Columns.Add("LastModifiedOnDate", typeof(DateTime)); //Message Conversation - _dtMessageConversationView = new DataTable(); - _dtMessageConversationView.Columns.Add("RowNumber", typeof(int)); - _dtMessageConversationView.Columns.Add("AttachmentCount", typeof(int)); - _dtMessageConversationView.Columns.Add("NewThreadCount", typeof(int)); - _dtMessageConversationView.Columns.Add("ThreadCount", typeof(int)); - _dtMessageConversationView.Columns.Add("MessageID", typeof(int)); - _dtMessageConversationView.Columns.Add("To", typeof(string)); - _dtMessageConversationView.Columns.Add("From", typeof(string)); - _dtMessageConversationView.Columns.Add("Subject", typeof(string)); - _dtMessageConversationView.Columns.Add("Body", typeof(string)); - _dtMessageConversationView.Columns.Add("ConversationID", typeof(int)); - _dtMessageConversationView.Columns.Add("ReplyAllAllowed", typeof(bool)); - _dtMessageConversationView.Columns.Add("SenderUserID", typeof(int)); - _dtMessageConversationView.Columns.Add("CreatedByUserID", typeof(int)); - _dtMessageConversationView.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtMessageConversationView.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtMessageConversationView.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtMessageConversationView = new DataTable(); + this._dtMessageConversationView.Columns.Add("RowNumber", typeof(int)); + this._dtMessageConversationView.Columns.Add("AttachmentCount", typeof(int)); + this._dtMessageConversationView.Columns.Add("NewThreadCount", typeof(int)); + this._dtMessageConversationView.Columns.Add("ThreadCount", typeof(int)); + this._dtMessageConversationView.Columns.Add("MessageID", typeof(int)); + this._dtMessageConversationView.Columns.Add("To", typeof(string)); + this._dtMessageConversationView.Columns.Add("From", typeof(string)); + this._dtMessageConversationView.Columns.Add("Subject", typeof(string)); + this._dtMessageConversationView.Columns.Add("Body", typeof(string)); + this._dtMessageConversationView.Columns.Add("ConversationID", typeof(int)); + this._dtMessageConversationView.Columns.Add("ReplyAllAllowed", typeof(bool)); + this._dtMessageConversationView.Columns.Add("SenderUserID", typeof(int)); + this._dtMessageConversationView.Columns.Add("CreatedByUserID", typeof(int)); + this._dtMessageConversationView.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtMessageConversationView.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtMessageConversationView.Columns.Add("LastModifiedOnDate", typeof(DateTime)); //Thread View - _dtMessageThreadsView = new DataTable(); - _dtMessageThreadsView.Columns.Add("TotalThreads", typeof(int)); - _dtMessageThreadsView.Columns.Add("TotalNewThreads", typeof(int)); - _dtMessageThreadsView.Columns.Add("TotalArchivedThreads", typeof(int)); + this._dtMessageThreadsView = new DataTable(); + this._dtMessageThreadsView.Columns.Add("TotalThreads", typeof(int)); + this._dtMessageThreadsView.Columns.Add("TotalNewThreads", typeof(int)); + this._dtMessageThreadsView.Columns.Add("TotalArchivedThreads", typeof(int)); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/NotificationsControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/NotificationsControllerTests.cs index 03ca4bdd8b3..461d29dec1c 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/NotificationsControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/NotificationsControllerTests.cs @@ -58,36 +58,36 @@ public void SetUp() { ComponentFactory.Container = new SimpleContainer(); - _mockDataService = new Mock(); - _portalController = new Mock(); - _portalGroupController = new Mock(); + this._mockDataService = new Mock(); + this._portalController = new Mock(); + this._portalGroupController = new Mock(); - _mockMessagingDataService = new Mock(); - _dataProvider = MockComponentProvider.CreateDataProvider(); - _cachingProvider = MockComponentProvider.CreateDataCacheProvider(); + this._mockMessagingDataService = new Mock(); + this._dataProvider = MockComponentProvider.CreateDataProvider(); + this._cachingProvider = MockComponentProvider.CreateDataCacheProvider(); - _notificationsController = new NotificationsController(_mockDataService.Object, _mockMessagingDataService.Object); - _mockNotificationsController = new Mock { CallBase = true }; + this._notificationsController = new NotificationsController(this._mockDataService.Object, this._mockMessagingDataService.Object); + this._mockNotificationsController = new Mock { CallBase = true }; - _mockMessagingController = new Mock(); - MessagingController.SetTestableInstance(_mockMessagingController.Object); - PortalController.SetTestableInstance(_portalController.Object); - PortalGroupController.RegisterInstance(_portalGroupController.Object); + this._mockMessagingController = new Mock(); + MessagingController.SetTestableInstance(this._mockMessagingController.Object); + PortalController.SetTestableInstance(this._portalController.Object); + PortalGroupController.RegisterInstance(this._portalGroupController.Object); - _mockInternalMessagingController = new Mock(); - InternalMessagingController.SetTestableInstance(_mockInternalMessagingController.Object); + this._mockInternalMessagingController = new Mock(); + InternalMessagingController.SetTestableInstance(this._mockInternalMessagingController.Object); - DataService.RegisterInstance(_mockDataService.Object); - DotNetNuke.Services.Social.Messaging.Data.DataService.RegisterInstance(_mockMessagingDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); + DotNetNuke.Services.Social.Messaging.Data.DataService.RegisterInstance(this._mockMessagingDataService.Object); - SetupDataProvider(); - SetupDataTables(); + this.SetupDataProvider(); + this.SetupDataTables(); } private void SetupDataProvider() { //Standard DataProvider Path for Logging - _dataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._dataProvider.Setup(d => d.GetProviderPath()).Returns(""); } [TearDown] @@ -107,7 +107,7 @@ public void TearDown() [ExpectedException(typeof(ArgumentNullException))] public void CreateNotificationType_Throws_On_Null_NotificationType() { - _notificationsController.CreateNotificationType(null); + this._notificationsController.CreateNotificationType(null); } [Test] @@ -119,21 +119,21 @@ public void CreateNotificationType_Throws_On_Null_Or_Empty_Name(string name) var notificationType = CreateNewNotificationType(); notificationType.Name = name; - _notificationsController.CreateNotificationType(notificationType); + this._notificationsController.CreateNotificationType(notificationType); } [Test] public void CreateNotificationType_Calls_DataService_CreateNotificationType() { - _mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); + this._mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); - _mockDataService + this._mockDataService .Setup(ds => ds.CreateNotificationType(Constants.Messaging_NotificationTypeName, It.IsAny(), It.IsAny(), It.IsAny(), Constants.UserID_User12, It.IsAny())) .Verifiable(); - _mockNotificationsController.Object.CreateNotificationType(CreateNewNotificationType()); + this._mockNotificationsController.Object.CreateNotificationType(CreateNewNotificationType()); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] @@ -146,7 +146,7 @@ public void CreateNotificationType_Returns_Object_With_Valid_TimeToLive(int actu var notificationType = CreateNewNotificationType(); notificationType.TimeToLive = actualTimeToLive; - _notificationsController.CreateNotificationType(notificationType); + this._notificationsController.CreateNotificationType(notificationType); Assert.AreEqual(expectedTimeToLiveTotalMinutes, (int)notificationType.TimeToLive.TotalMinutes); } @@ -156,9 +156,9 @@ public void CreateNotificationType_Makes_Valid_Object() { var expectedNotificationType = CreateValidNotificationType(); - _mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); + this._mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); - _mockDataService + this._mockDataService .Setup(ds => ds.CreateNotificationType( expectedNotificationType.Name, expectedNotificationType.Description, @@ -168,7 +168,7 @@ public void CreateNotificationType_Makes_Valid_Object() .Returns(Constants.Messaging_NotificationTypeId); var actualNotificationType = CreateNewNotificationType(); - _mockNotificationsController.Object.CreateNotificationType(actualNotificationType); + this._mockNotificationsController.Object.CreateNotificationType(actualNotificationType); Assert.IsTrue(new NotificationTypeComparer().Equals(expectedNotificationType, actualNotificationType)); } @@ -180,19 +180,19 @@ public void CreateNotificationType_Makes_Valid_Object() [Test] public void DeleteNotificationType_Calls_DataService_DeleteNotificationType() { - _mockDataService.Setup(ds => ds.DeleteNotificationType(Constants.Messaging_NotificationTypeId)).Verifiable(); - _mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeCache()); - _mockNotificationsController.Object.DeleteNotificationType(Constants.Messaging_NotificationTypeId); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.DeleteNotificationType(Constants.Messaging_NotificationTypeId)).Verifiable(); + this._mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeCache()); + this._mockNotificationsController.Object.DeleteNotificationType(Constants.Messaging_NotificationTypeId); + this._mockDataService.Verify(); } [Test] public void DeleteNotificationType_Removes_Cache_Object() { - _mockDataService.Setup(ds => ds.DeleteNotificationType(Constants.Messaging_NotificationTypeId)); - _mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeCache()).Verifiable(); - _mockNotificationsController.Object.DeleteNotificationType(Constants.Messaging_NotificationTypeId); - _mockNotificationsController.Verify(); + this._mockDataService.Setup(ds => ds.DeleteNotificationType(Constants.Messaging_NotificationTypeId)); + this._mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeCache()).Verifiable(); + this._mockNotificationsController.Object.DeleteNotificationType(Constants.Messaging_NotificationTypeId); + this._mockNotificationsController.Verify(); } #endregion @@ -202,50 +202,50 @@ public void DeleteNotificationType_Removes_Cache_Object() [Test] public void GetNotificationType_By_Id_Gets_Object_From_Cache() { - _cachingProvider.Object.PurgeCache(); - _cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); - _notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeId); - _cachingProvider.Verify(); + this._cachingProvider.Object.PurgeCache(); + this._cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); + this._notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeId); + this._cachingProvider.Verify(); } [Test] public void GetNotificationType_By_Id_Calls_DataService_GetNotificationType_When_Object_Is_Not_In_Cache() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); var messageTypeDataTable = new DataTable(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationType(Constants.Messaging_NotificationTypeId)) .Returns(messageTypeDataTable.CreateDataReader()) .Verifiable(); - _notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeId); + this._notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeId); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] public void GetNotificationType_By_Id_Returns_Valid_Object() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); var expectedNotificationType = CreateValidNotificationType(); - _dtNotificationTypes.Rows.Clear(); + this._dtNotificationTypes.Rows.Clear(); - _dtNotificationTypes.Rows.Add( + this._dtNotificationTypes.Rows.Add( expectedNotificationType.NotificationTypeId, expectedNotificationType.Name, expectedNotificationType.Description, (int)expectedNotificationType.TimeToLive.TotalMinutes, expectedNotificationType.DesktopModuleId); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationType(Constants.Messaging_NotificationTypeId)) - .Returns(_dtNotificationTypes.CreateDataReader()); + .Returns(this._dtNotificationTypes.CreateDataReader()); - var actualNotificationType = _notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeId); + var actualNotificationType = this._notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeId); Assert.IsTrue(new NotificationTypeComparer().Equals(expectedNotificationType, actualNotificationType)); } @@ -256,54 +256,54 @@ public void GetNotificationType_By_Id_Returns_Valid_Object() [ExpectedException(typeof(ArgumentException))] public void GetNotificationType_By_Name_Throws_On_Null_Or_Empty_Name(string name) { - _notificationsController.GetNotificationType(name); + this._notificationsController.GetNotificationType(name); } [Test] public void GetNotificationType_By_Name_Gets_Object_From_Cache() { - _cachingProvider.Object.PurgeCache(); - _cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); - _notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeName); - _cachingProvider.Verify(); + this._cachingProvider.Object.PurgeCache(); + this._cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); + this._notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeName); + this._cachingProvider.Verify(); } [Test] public void GetNotificationType_By_Name_Calls_DataService_GetNotificationTypeByName_When_Object_Is_Not_In_Cache() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeByName(Constants.Messaging_NotificationTypeName)) - .Returns(_dtNotificationTypes.CreateDataReader()) + .Returns(this._dtNotificationTypes.CreateDataReader()) .Verifiable(); - _notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeName); + this._notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeName); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] public void GetNotificationType_By_Name_Returns_Valid_Object() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); var expectedNotificationType = CreateValidNotificationType(); - _dtNotificationTypes.Rows.Clear(); + this._dtNotificationTypes.Rows.Clear(); - _dtNotificationTypes.Rows.Add( + this._dtNotificationTypes.Rows.Add( expectedNotificationType.NotificationTypeId, expectedNotificationType.Name, expectedNotificationType.Description, (int)expectedNotificationType.TimeToLive.TotalMinutes, expectedNotificationType.DesktopModuleId); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeByName(Constants.Messaging_NotificationTypeName)) - .Returns(_dtNotificationTypes.CreateDataReader()); + .Returns(this._dtNotificationTypes.CreateDataReader()); - var actualNotificationType = _notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeName); + var actualNotificationType = this._notificationsController.GetNotificationType(Constants.Messaging_NotificationTypeName); Assert.IsTrue(new NotificationTypeComparer().Equals(expectedNotificationType, actualNotificationType)); } @@ -315,14 +315,14 @@ public void GetNotificationType_By_Name_Returns_Valid_Object() [ExpectedException(typeof(ArgumentNullException))] public void SetNotificationTypeActions_Throws_On_Null() { - _notificationsController.SetNotificationTypeActions(null, Constants.Messaging_NotificationTypeId); + this._notificationsController.SetNotificationTypeActions(null, Constants.Messaging_NotificationTypeId); } [Test] [ExpectedException(typeof(ArgumentException))] public void SetNotificationTypeActions_Throws_On_EmptyList() { - _notificationsController.SetNotificationTypeActions(new List(), Constants.Messaging_NotificationTypeId); + this._notificationsController.SetNotificationTypeActions(new List(), Constants.Messaging_NotificationTypeId); } [Test] @@ -333,7 +333,7 @@ public void SetNotificationTypeActions_Throws_On_Null_Or_Empty_Name(string name) { var action = CreateNewNotificationTypeAction(); action.NameResourceKey = name; - _notificationsController.SetNotificationTypeActions(new [] {action}, Constants.Messaging_NotificationTypeId); + this._notificationsController.SetNotificationTypeActions(new [] {action}, Constants.Messaging_NotificationTypeId); } [Test] @@ -344,13 +344,13 @@ public void SetNotificationTypeActions_Throws_On_Null_Or_Empty_APICall(string ap { var action = CreateNewNotificationTypeAction(); action.APICall = apiCall; - _notificationsController.SetNotificationTypeActions(new[] { action }, Constants.Messaging_NotificationTypeId); + this._notificationsController.SetNotificationTypeActions(new[] { action }, Constants.Messaging_NotificationTypeId); } [Test] public void SetNotificationTypeActions_Calls_DataService_AddNotificationTypeAction_For_Each_Of_Two_Actions() { - _mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); + this._mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); // _mockDataService // .Setup(ds => ds.AddNotificationTypeAction( @@ -362,13 +362,13 @@ public void SetNotificationTypeActions_Calls_DataService_AddNotificationTypeActi // Constants.UserID_User12)) // .Verifiable(); - _mockNotificationsController.Setup(nc => nc.GetNotificationTypeAction(It.IsAny())); + this._mockNotificationsController.Setup(nc => nc.GetNotificationTypeAction(It.IsAny())); - _mockNotificationsController.Object.SetNotificationTypeActions( + this._mockNotificationsController.Object.SetNotificationTypeActions( new [] {CreateNewNotificationTypeAction(), CreateNewNotificationTypeAction()}, Constants.Messaging_NotificationTypeId); - _mockDataService.Verify(x => x.AddNotificationTypeAction(Constants.Messaging_NotificationTypeId, + this._mockDataService.Verify(x => x.AddNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey, Constants.Messaging_NotificationTypeActionDescriptionResourceKey, Constants.Messaging_NotificationTypeActionConfirmResourceKey, @@ -381,9 +381,9 @@ public void SetNotificationTypeActions_Sets_NotificationTypeActionId_And_Notific { var expectedNotificationTypeAction = CreateValidNotificationTypeAction(); - _mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); + this._mockNotificationsController.Setup(nc => nc.GetCurrentUserId()).Returns(Constants.UserID_User12); - _mockDataService + this._mockDataService .Setup(ds => ds.AddNotificationTypeAction( expectedNotificationTypeAction.NotificationTypeId, expectedNotificationTypeAction.NameResourceKey, @@ -393,12 +393,12 @@ public void SetNotificationTypeActions_Sets_NotificationTypeActionId_And_Notific Constants.UserID_User12)) .Returns(expectedNotificationTypeAction.NotificationTypeActionId); - _mockNotificationsController + this._mockNotificationsController .Setup(nc => nc.GetNotificationTypeAction(expectedNotificationTypeAction.NotificationTypeActionId)) .Returns(expectedNotificationTypeAction); var action = CreateNewNotificationTypeAction(); - _mockNotificationsController.Object.SetNotificationTypeActions(new []{action}, expectedNotificationTypeAction.NotificationTypeId); + this._mockNotificationsController.Object.SetNotificationTypeActions(new []{action}, expectedNotificationTypeAction.NotificationTypeId); Assert.IsTrue(new NotificationTypeActionComparer().Equals(expectedNotificationTypeAction, action)); } @@ -410,19 +410,19 @@ public void SetNotificationTypeActions_Sets_NotificationTypeActionId_And_Notific [Test] public void DeleteNotificationTypeAction_Calls_DataService_DeleteNotificationTypeAction() { - _mockDataService.Setup(ds => ds.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId)).Verifiable(); - _mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeActionCache()); - _mockNotificationsController.Object.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId)).Verifiable(); + this._mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeActionCache()); + this._mockNotificationsController.Object.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); + this._mockDataService.Verify(); } [Test] public void DeleteNotificationTypeAction_Removes_Cache_Object() { - _mockDataService.Setup(ds => ds.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId)); - _mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeActionCache()).Verifiable(); - _mockNotificationsController.Object.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); - _mockNotificationsController.Verify(); + this._mockDataService.Setup(ds => ds.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId)); + this._mockNotificationsController.Setup(nc => nc.RemoveNotificationTypeActionCache()).Verifiable(); + this._mockNotificationsController.Object.DeleteNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); + this._mockNotificationsController.Verify(); } #endregion @@ -432,37 +432,37 @@ public void DeleteNotificationTypeAction_Removes_Cache_Object() [Test] public void GetNotificationTypeAction_By_Id_Gets_Object_From_Cache() { - _cachingProvider.Object.PurgeCache(); - _cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); - _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); - _cachingProvider.Verify(); + this._cachingProvider.Object.PurgeCache(); + this._cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); + this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); + this._cachingProvider.Verify(); } [Test] public void GetNotificationTypeAction_By_Id_Calls_DataService_GetNotificationTypeAction_When_Object_Is_Not_In_Cache() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId)) - .Returns(_dtNotificationTypeActions.CreateDataReader()) + .Returns(this._dtNotificationTypeActions.CreateDataReader()) .Verifiable(); - _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); + this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] public void GetNotificationTypeAction_By_Id_Returns_Valid_Object() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); var expectedNotificationTypeAction = CreateValidNotificationTypeAction(); - _dtNotificationTypeActions.Clear(); + this._dtNotificationTypeActions.Clear(); - _dtNotificationTypeActions.Rows.Add( + this._dtNotificationTypeActions.Rows.Add( expectedNotificationTypeAction.NotificationTypeActionId, expectedNotificationTypeAction.NotificationTypeId, expectedNotificationTypeAction.NameResourceKey, @@ -471,11 +471,11 @@ public void GetNotificationTypeAction_By_Id_Returns_Valid_Object() expectedNotificationTypeAction.Order, expectedNotificationTypeAction.APICall); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId)) - .Returns(_dtNotificationTypeActions.CreateDataReader); + .Returns(this._dtNotificationTypeActions.CreateDataReader); - var actualNotificationTypeAction = _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); + var actualNotificationTypeAction = this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeActionId); Assert.IsTrue(new NotificationTypeActionComparer().Equals(expectedNotificationTypeAction, actualNotificationTypeAction)); } @@ -486,45 +486,45 @@ public void GetNotificationTypeAction_By_Id_Returns_Valid_Object() [ExpectedException(typeof(ArgumentException))] public void GetNotificationTypeAction_By_Name_Throws_On_Null_Or_Empty_Name(string name) { - _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, name); + this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, name); } [Test] public void GetNotificationTypeAction_By_Name_Gets_Object_From_Cache() { - _cachingProvider.Object.PurgeCache(); - _cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); - _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey); - _cachingProvider.Verify(); + this._cachingProvider.Object.PurgeCache(); + this._cachingProvider.Setup(cp => cp.GetItem(It.IsAny())).Verifiable(); + this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey); + this._cachingProvider.Verify(); } [Test] public void GetNotificationTypeAction_By_Name_Calls_DataService_GetNotificationTypeActionByName_When_Object_Is_Not_In_Cache() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeActionByName( Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey)) - .Returns(_dtNotificationTypeActions.CreateDataReader()) + .Returns(this._dtNotificationTypeActions.CreateDataReader()) .Verifiable(); - _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey); + this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] public void GetNotificationTypeAction_By_Name_Returns_Valid_Object() { - _cachingProvider.Object.PurgeCache(); + this._cachingProvider.Object.PurgeCache(); var expectedNotificationTypeAction = CreateValidNotificationTypeAction(); - _dtNotificationTypeActions.Clear(); + this._dtNotificationTypeActions.Clear(); - _dtNotificationTypeActions.Rows.Add( + this._dtNotificationTypeActions.Rows.Add( expectedNotificationTypeAction.NotificationTypeActionId, expectedNotificationTypeAction.NotificationTypeId, expectedNotificationTypeAction.NameResourceKey, @@ -533,13 +533,13 @@ public void GetNotificationTypeAction_By_Name_Returns_Valid_Object() expectedNotificationTypeAction.Order, expectedNotificationTypeAction.APICall); - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeActionByName( Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey)) - .Returns(_dtNotificationTypeActions.CreateDataReader()); + .Returns(this._dtNotificationTypeActions.CreateDataReader()); - var actualNotificationTypeAction = _notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey); + var actualNotificationTypeAction = this._notificationsController.GetNotificationTypeAction(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationTypeActionNameResourceKey); Assert.IsTrue(new NotificationTypeActionComparer().Equals(expectedNotificationTypeAction, actualNotificationTypeAction)); } @@ -551,14 +551,14 @@ public void GetNotificationTypeAction_By_Name_Returns_Valid_Object() [Test] public void GetNotificationTypeActions_Calls_DataService_GetNotificationTypeActions() { - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId)) - .Returns(_dtNotificationTypeActions.CreateDataReader()) + .Returns(this._dtNotificationTypeActions.CreateDataReader()) .Verifiable(); - _notificationsController.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId); + this._notificationsController.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] @@ -566,9 +566,9 @@ public void GetNotificationTypeActions_Returns_Valid_Object() { var expectedNotificationTypeAction = CreateValidNotificationTypeAction(); - _dtNotificationTypeActions.Clear(); + this._dtNotificationTypeActions.Clear(); - _dtNotificationTypeActions.Rows.Add( + this._dtNotificationTypeActions.Rows.Add( expectedNotificationTypeAction.NotificationTypeActionId, expectedNotificationTypeAction.NotificationTypeId, expectedNotificationTypeAction.NameResourceKey, @@ -577,9 +577,9 @@ public void GetNotificationTypeActions_Returns_Valid_Object() expectedNotificationTypeAction.Order, expectedNotificationTypeAction.APICall); - _mockDataService.Setup(ds => ds.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId)).Returns(_dtNotificationTypeActions.CreateDataReader()); + this._mockDataService.Setup(ds => ds.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId)).Returns(this._dtNotificationTypeActions.CreateDataReader()); - var actualNotificationTypeActions = _notificationsController.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId); + var actualNotificationTypeActions = this._notificationsController.GetNotificationTypeActions(Constants.Messaging_NotificationTypeId); Assert.AreEqual(1, actualNotificationTypeActions.Count); Assert.IsTrue(new NotificationTypeActionComparer().Equals(expectedNotificationTypeAction, actualNotificationTypeActions[0])); @@ -599,9 +599,9 @@ public void SendNotification_Sets_Empty_SenderUserId_With_Admin() PortalID = Constants.CONTENT_ValidPortalId }; - _mockNotificationsController.Setup(nc => nc.GetAdminUser()).Returns(adminUser); + this._mockNotificationsController.Setup(nc => nc.GetAdminUser()).Returns(adminUser); - _mockNotificationsController + this._mockNotificationsController .Setup(nc => nc.SendNotification( It.IsAny(), Constants.PORTAL_Zero, @@ -610,7 +610,7 @@ public void SendNotification_Sets_Empty_SenderUserId_With_Admin() var notification = CreateUnsavedNotification(); - _mockNotificationsController.Object.SendNotification( + this._mockNotificationsController.Object.SendNotification( notification, Constants.PORTAL_Zero, new List(), @@ -632,9 +632,9 @@ public void SendNotification_Throws_On_Null_Or_Empty_Subject_And_Body(string sub notification.Body = body; var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); - _notificationsController.SendNotification( + this._notificationsController.SendNotification( notification, Constants.PORTAL_Zero, new List(), @@ -646,9 +646,9 @@ public void SendNotification_Throws_On_Null_Or_Empty_Subject_And_Body(string sub public void SendNotification_Throws_On_Null_Roles_And_Users() { var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); - _notificationsController.SendNotification( + this._notificationsController.SendNotification( CreateUnsavedNotification(), Constants.PORTAL_Zero, null, @@ -668,9 +668,9 @@ public void SendNotification_Throws_On_Large_Subject() notification.Subject = subject.ToString(); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); - _notificationsController.SendNotification( + this._notificationsController.SendNotification( notification, Constants.PORTAL_Zero, new List(), @@ -682,9 +682,9 @@ public void SendNotification_Throws_On_Large_Subject() public void SendNotification_Throws_On_Roles_And_Users_With_No_DisplayNames() { var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); - _notificationsController.SendNotification( + this._notificationsController.SendNotification( CreateUnsavedNotification(), Constants.PORTAL_Zero, new List(), @@ -705,9 +705,9 @@ public void SendNotification_Throws_On_Large_To_List() } var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); - _notificationsController.SendNotification( + this._notificationsController.SendNotification( CreateUnsavedNotification(), Constants.PORTAL_Zero, roles, @@ -724,9 +724,9 @@ public void SendNotification_Calls_DataService_On_Valid_Notification() PortalID = Constants.PORTAL_Zero }; - _mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); + this._mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); var roles = new List(); var users = new List @@ -738,25 +738,25 @@ public void SendNotification_Calls_DataService_On_Valid_Notification() } }; - _mockDataService + this._mockDataService .Setup(ds => ds.SendNotification( It.IsAny(), Constants.PORTAL_Zero)) .Verifiable(); - _mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); + this._mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); var notification = CreateUnsavedNotification(); notification.SenderUserID = adminUser.UserID; notification.SendToast = false; - _mockNotificationsController.Object.SendNotification( + this._mockNotificationsController.Object.SendNotification( notification, Constants.PORTAL_Zero, roles, users); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] @@ -769,13 +769,13 @@ public void SendNotification_Calls_DataService_On_Valid_Notification_When_Portal PortalID = Constants.PORTAL_Zero }; - _mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); + this._mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Constants.PORTALGROUP_ValidPortalGroupId); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); List portalGroups = new List() { CreatePortalGroupInfo(Constants.PORTALGROUP_ValidPortalGroupId, Constants.PORTAL_Zero) }; // CreatePortalGroupInfo(Constants.PORTALGROUP_ValidPortalGroupId, Constants.PORTAL_Zero); - _portalGroupController.Setup(pgc => pgc.GetPortalGroups()).Returns(portalGroups); + this._portalGroupController.Setup(pgc => pgc.GetPortalGroups()).Returns(portalGroups); var roles = new List(); var users = new List @@ -787,25 +787,25 @@ public void SendNotification_Calls_DataService_On_Valid_Notification_When_Portal } }; - _mockDataService + this._mockDataService .Setup(ds => ds.SendNotification( It.IsAny(), Constants.PORTAL_Zero)) .Verifiable(); - _mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); + this._mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); var notification = CreateUnsavedNotification(); notification.SenderUserID = adminUser.UserID; notification.SendToast = false; - _mockNotificationsController.Object.SendNotification( + this._mockNotificationsController.Object.SendNotification( notification, Constants.PORTAL_Zero, roles, users); - _mockDataService.Verify(); + this._mockDataService.Verify(); } [Test] public void SendNotification_Calls_Messaging_DataService_CreateSocialMessageRecipientsForRole_When_Passing_Roles() @@ -817,9 +817,9 @@ public void SendNotification_Calls_Messaging_DataService_CreateSocialMessageReci PortalID = Constants.PORTAL_Zero }; - _mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); + this._mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); var roles = new List { @@ -831,32 +831,32 @@ public void SendNotification_Calls_Messaging_DataService_CreateSocialMessageReci }; var users = new List(); - _mockDataService + this._mockDataService .Setup(ds => ds.SendNotification( It.IsAny(), Constants.PORTAL_Zero)) .Returns(Constants.Messaging_MessageId_1); - _mockMessagingDataService + this._mockMessagingDataService .Setup(mds => mds.CreateMessageRecipientsForRole( Constants.Messaging_MessageId_1, Constants.RoleID_RegisteredUsers.ToString(CultureInfo.InvariantCulture), It.IsAny())) .Verifiable(); - _mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); + this._mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); var notification = CreateUnsavedNotification(); notification.SenderUserID = adminUser.UserID; notification.SendToast = false; - _mockNotificationsController.Object.SendNotification( + this._mockNotificationsController.Object.SendNotification( notification, Constants.PORTAL_Zero, roles, users); - _mockMessagingDataService.Verify(); + this._mockMessagingDataService.Verify(); } [Test] @@ -869,9 +869,9 @@ public void SendNotification_Calls_Messaging_DataService_SaveSocialMessageRecipi PortalID = Constants.PORTAL_Zero }; - _mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); + this._mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); var roles = new List(); var users = new List @@ -883,19 +883,19 @@ public void SendNotification_Calls_Messaging_DataService_SaveSocialMessageRecipi } }; - _mockDataService + this._mockDataService .Setup(ds => ds.SendNotification( It.IsAny(), Constants.PORTAL_Zero)) .Returns(Constants.Messaging_MessageId_1); - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetMessageRecipient( Constants.Messaging_MessageId_1, Constants.UserID_User12)) .Returns((MessageRecipient)null); - _mockMessagingDataService + this._mockMessagingDataService .Setup(mds => mds.SaveMessageRecipient( It.Is(mr => mr.MessageID == Constants.Messaging_MessageId_1 && @@ -905,19 +905,19 @@ public void SendNotification_Calls_Messaging_DataService_SaveSocialMessageRecipi It.IsAny())) .Verifiable(); - _mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); + this._mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); var notification = CreateUnsavedNotification(); notification.SenderUserID = adminUser.UserID; notification.SendToast = false; - _mockNotificationsController.Object.SendNotification( + this._mockNotificationsController.Object.SendNotification( notification, Constants.PORTAL_Zero, roles, users); - _mockMessagingDataService.Verify(); + this._mockMessagingDataService.Verify(); } [Test] @@ -932,10 +932,10 @@ public void SendNotification_Returns_Valid_Object() PortalID = Constants.PORTAL_Zero }; - _mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); + this._mockInternalMessagingController.Setup(mc => mc.RecipientLimit(adminUser.PortalID)).Returns(10); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); var roles = new List(); var users = new List @@ -947,25 +947,25 @@ public void SendNotification_Returns_Valid_Object() } }; - _mockDataService + this._mockDataService .Setup(ds => ds.SendNotification( It.IsAny(), Constants.PORTAL_Zero)) .Returns(Constants.Messaging_MessageId_1); - _mockMessagingDataService + this._mockMessagingDataService .Setup(mds => mds.CreateMessageRecipientsForRole( Constants.Messaging_MessageId_1, Constants.RoleID_RegisteredUsers.ToString(CultureInfo.InvariantCulture), It.IsAny())); - _mockInternalMessagingController + this._mockInternalMessagingController .Setup(mc => mc.GetMessageRecipient( Constants.Messaging_MessageId_1, Constants.UserID_User12)) .Returns((MessageRecipient)null); - _mockMessagingDataService + this._mockMessagingDataService .Setup(mds => mds.SaveMessageRecipient( It.Is(mr => mr.MessageID == Constants.Messaging_MessageId_1 && @@ -974,13 +974,13 @@ public void SendNotification_Returns_Valid_Object() mr.RecipientID == Null.NullInteger), It.IsAny())); - _mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); + this._mockNotificationsController.Setup(nc => nc.GetExpirationDate(It.IsAny())).Returns(DateTime.MinValue); var notification = CreateUnsavedNotification(); notification.SenderUserID = adminUser.UserID; notification.SendToast = false; - _mockNotificationsController.Object.SendNotification( + this._mockNotificationsController.Object.SendNotification( notification, Constants.PORTAL_Zero, roles, @@ -1001,11 +1001,11 @@ public void DeleteNotification_Calls_DataService_DeleteNotification() new MessageRecipient() }; - _mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(messageRecipients); + this._mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(messageRecipients); - _mockDataService.Setup(ds => ds.DeleteNotification(Constants.Messaging_MessageId_1)).Verifiable(); - _notificationsController.DeleteNotification(Constants.Messaging_MessageId_1); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.DeleteNotification(Constants.Messaging_MessageId_1)).Verifiable(); + this._notificationsController.DeleteNotification(Constants.Messaging_MessageId_1); + this._mockDataService.Verify(); } #endregion @@ -1015,46 +1015,46 @@ public void DeleteNotification_Calls_DataService_DeleteNotification() [Test] public void GetNotifications_Calls_DataService_GetNotifications() { - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotifications(Constants.UserID_User12, Constants.PORTAL_Zero,It.IsAny(), It.IsAny())) .Returns(new DataTable().CreateDataReader()) .Verifiable(); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); - _notificationsController.GetNotifications(Constants.UserID_User12, Constants.PORTAL_Zero, 0, 10); - _mockDataService.Verify(); + this._notificationsController.GetNotifications(Constants.UserID_User12, Constants.PORTAL_Zero, 0, 10); + this._mockDataService.Verify(); } [Test] public void GetNotifications_Calls_DataService_GetNotifications_When_Portal_Is_In_Group() { - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotifications(Constants.UserID_User12, Constants.PORTAL_Zero, It.IsAny(), It.IsAny())) .Returns(new DataTable().CreateDataReader()) .Verifiable(); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Constants.PORTALGROUP_ValidPortalGroupId); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); List portalGroups = new List(){CreatePortalGroupInfo(Constants.PORTALGROUP_ValidPortalGroupId,Constants.PORTAL_Zero)}; // CreatePortalGroupInfo(Constants.PORTALGROUP_ValidPortalGroupId, Constants.PORTAL_Zero); - _portalGroupController.Setup(pgc => pgc.GetPortalGroups()).Returns(portalGroups); + this._portalGroupController.Setup(pgc => pgc.GetPortalGroups()).Returns(portalGroups); - _notificationsController.GetNotifications(Constants.UserID_User12, Constants.PORTAL_Zero, 0, 10); - _mockDataService.Verify(); + this._notificationsController.GetNotifications(Constants.UserID_User12, Constants.PORTAL_Zero, 0, 10); + this._mockDataService.Verify(); } [Test] public void GetNotifications_Calls_DataService_GetNotificationByContext() { - _mockDataService + this._mockDataService .Setup(ds => ds.GetNotificationByContext(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext)) .Returns(new DataTable().CreateDataReader()) .Verifiable(); - _notificationsController.GetNotificationByContext(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext); - _mockDataService.Verify(); + this._notificationsController.GetNotificationByContext(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext); + this._mockDataService.Verify(); } #endregion @@ -1064,9 +1064,9 @@ public void GetNotifications_Calls_DataService_GetNotificationByContext() [Test] public void CountNotifications_Calls_DataService_CountNotifications() { - _mockDataService.Setup(ds => ds.CountNotifications(Constants.UserID_User12, Constants.PORTAL_Zero)).Verifiable(); - _notificationsController.CountNotifications(Constants.UserID_User12,Constants.PORTAL_Zero); - _mockDataService.Verify(); + this._mockDataService.Setup(ds => ds.CountNotifications(Constants.UserID_User12, Constants.PORTAL_Zero)).Verifiable(); + this._notificationsController.CountNotifications(Constants.UserID_User12,Constants.PORTAL_Zero); + this._mockDataService.Verify(); } #endregion @@ -1076,20 +1076,20 @@ public void CountNotifications_Calls_DataService_CountNotifications() [Test] public void DeleteNotificationRecipient_Calls_MessagingController_DeleteMessageRecipient() { - _mockInternalMessagingController.Setup(mc => mc.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)).Verifiable(); - _mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(new List()); - _notificationsController.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); - _mockMessagingController.Verify(); + this._mockInternalMessagingController.Setup(mc => mc.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)).Verifiable(); + this._mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(new List()); + this._notificationsController.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); + this._mockMessagingController.Verify(); } [Test] public void DeleteNotificationRecipientByContext_Calls_DeleteMessageRecipient() { - _mockNotificationsController.Setup(mc => mc.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)).Verifiable(); - _mockNotificationsController.Setup(mc => mc.GetNotificationByContext(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext)) + this._mockNotificationsController.Setup(mc => mc.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)).Verifiable(); + this._mockNotificationsController.Setup(mc => mc.GetNotificationByContext(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext)) .Returns(new List { new Notification { NotificationID = Constants.Messaging_MessageId_1 } }); - _mockNotificationsController.Object.DeleteNotificationRecipient(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext, Constants.UserID_User12); - _mockMessagingController.Verify(); + this._mockNotificationsController.Object.DeleteNotificationRecipient(Constants.Messaging_NotificationTypeId, Constants.Messaging_NotificationContext, Constants.UserID_User12); + this._mockMessagingController.Verify(); } [Test] @@ -1100,20 +1100,20 @@ public void DeleteNotificationRecipient_Does_Not_Delete_Notification_When_There_ new MessageRecipient() }; - _mockInternalMessagingController.Setup(mc => mc.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)); - _mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(messageRecipients); - _mockNotificationsController.Object.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); + this._mockInternalMessagingController.Setup(mc => mc.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)); + this._mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(messageRecipients); + this._mockNotificationsController.Object.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); - _mockNotificationsController.Verify(nc => nc.DeleteNotification(Constants.Messaging_MessageId_1), Times.Never()); + this._mockNotificationsController.Verify(nc => nc.DeleteNotification(Constants.Messaging_MessageId_1), Times.Never()); } [Test] public void DeleteNotificationRecipient_Deletes_Notification_When_There_Are_No_More_Recipients() { - _mockInternalMessagingController.Setup(mc => mc.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)); - _mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(new List()); - _mockNotificationsController.Object.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); - _mockNotificationsController.Verify(nc => nc.DeleteNotification(Constants.Messaging_MessageId_1)); + this._mockInternalMessagingController.Setup(mc => mc.DeleteMessageRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12)); + this._mockInternalMessagingController.Setup(mc => mc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(new List()); + this._mockNotificationsController.Object.DeleteNotificationRecipient(Constants.Messaging_MessageId_1, Constants.UserID_User12); + this._mockNotificationsController.Verify(nc => nc.DeleteNotification(Constants.Messaging_MessageId_1)); } #endregion @@ -1129,19 +1129,19 @@ public void DeleteAllNotificationRecipients_Calls_DeleteNotificationRecipient_Fo new MessageRecipient { RecipientID = Constants.Messaging_RecipientId_2 } }; - _mockInternalMessagingController.Setup(imc => imc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(recipients); + this._mockInternalMessagingController.Setup(imc => imc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(recipients); - _mockNotificationsController.Object.DeleteAllNotificationRecipients(Constants.Messaging_MessageId_1); + this._mockNotificationsController.Object.DeleteAllNotificationRecipients(Constants.Messaging_MessageId_1); - _mockNotificationsController.Verify(nc => nc.DeleteNotificationRecipient(It.IsAny(), It.IsAny()), Times.Exactly(2)); + this._mockNotificationsController.Verify(nc => nc.DeleteNotificationRecipient(It.IsAny(), It.IsAny()), Times.Exactly(2)); } [Test] public void DeleteAllNotificationRecipients_Does_Not_Call_DeleteNotificationRecipient_When_Notification_Has_No_Recipients() { - _mockInternalMessagingController.Setup(imc => imc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(new List()); - _mockNotificationsController.Object.DeleteAllNotificationRecipients(Constants.Messaging_MessageId_1); - _mockNotificationsController.Verify(nc => nc.DeleteNotificationRecipient(It.IsAny(), It.IsAny()), Times.Never()); + this._mockInternalMessagingController.Setup(imc => imc.GetMessageRecipients(Constants.Messaging_MessageId_1)).Returns(new List()); + this._mockNotificationsController.Object.DeleteAllNotificationRecipients(Constants.Messaging_MessageId_1); + this._mockNotificationsController.Verify(nc => nc.DeleteNotificationRecipient(It.IsAny(), It.IsAny()), Times.Never()); } #endregion @@ -1232,40 +1232,40 @@ private static PortalGroupInfo CreatePortalGroupInfo(int portalGroupId, int mast private void SetupDataTables() { - _dtNotificationTypes = new DataTable(); - _dtNotificationTypes.Columns.Add("NotificationTypeID", typeof(int)); - _dtNotificationTypes.Columns.Add("Name", typeof(string)); - _dtNotificationTypes.Columns.Add("Description", typeof(string)); - _dtNotificationTypes.Columns.Add("TTL", typeof(int)); - _dtNotificationTypes.Columns.Add("DesktopModuleID", typeof(int)); - _dtNotificationTypes.Columns.Add("CreatedByUserID", typeof(int)); - _dtNotificationTypes.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtNotificationTypes.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtNotificationTypes.Columns.Add("LastModifiedOnDate", typeof(DateTime)); - _dtNotificationTypes.Columns.Add("IsTask", typeof(bool)); - - _dtNotificationTypeActions = new DataTable(); - _dtNotificationTypeActions.Columns.Add("NotificationTypeActionID", typeof(int)); - _dtNotificationTypeActions.Columns.Add("NotificationTypeID", typeof(int)); - _dtNotificationTypeActions.Columns.Add("NameResourceKey", typeof(string)); - _dtNotificationTypeActions.Columns.Add("DescriptionResourceKey", typeof(string)); - _dtNotificationTypeActions.Columns.Add("ConfirmResourceKey", typeof(string)); - _dtNotificationTypeActions.Columns.Add("Order", typeof(int)); - _dtNotificationTypeActions.Columns.Add("APICall", typeof(string)); - _dtNotificationTypeActions.Columns.Add("CreatedByUserID", typeof(int)); - _dtNotificationTypeActions.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtNotificationTypeActions.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtNotificationTypeActions.Columns.Add("LastModifiedOnDate", typeof(DateTime)); - - _dtNotificationActions = new DataTable(); - _dtNotificationActions.Columns.Add("NotificationActionID"); - _dtNotificationActions.Columns.Add("MessageID"); - _dtNotificationActions.Columns.Add("NotificationTypeActionID"); - _dtNotificationActions.Columns.Add("Key"); - _dtNotificationActions.Columns.Add("CreatedByUserID", typeof(int)); - _dtNotificationActions.Columns.Add("CreatedOnDate", typeof(DateTime)); - _dtNotificationActions.Columns.Add("LastModifiedByUserID", typeof(int)); - _dtNotificationActions.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtNotificationTypes = new DataTable(); + this._dtNotificationTypes.Columns.Add("NotificationTypeID", typeof(int)); + this._dtNotificationTypes.Columns.Add("Name", typeof(string)); + this._dtNotificationTypes.Columns.Add("Description", typeof(string)); + this._dtNotificationTypes.Columns.Add("TTL", typeof(int)); + this._dtNotificationTypes.Columns.Add("DesktopModuleID", typeof(int)); + this._dtNotificationTypes.Columns.Add("CreatedByUserID", typeof(int)); + this._dtNotificationTypes.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtNotificationTypes.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtNotificationTypes.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + this._dtNotificationTypes.Columns.Add("IsTask", typeof(bool)); + + this._dtNotificationTypeActions = new DataTable(); + this._dtNotificationTypeActions.Columns.Add("NotificationTypeActionID", typeof(int)); + this._dtNotificationTypeActions.Columns.Add("NotificationTypeID", typeof(int)); + this._dtNotificationTypeActions.Columns.Add("NameResourceKey", typeof(string)); + this._dtNotificationTypeActions.Columns.Add("DescriptionResourceKey", typeof(string)); + this._dtNotificationTypeActions.Columns.Add("ConfirmResourceKey", typeof(string)); + this._dtNotificationTypeActions.Columns.Add("Order", typeof(int)); + this._dtNotificationTypeActions.Columns.Add("APICall", typeof(string)); + this._dtNotificationTypeActions.Columns.Add("CreatedByUserID", typeof(int)); + this._dtNotificationTypeActions.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtNotificationTypeActions.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtNotificationTypeActions.Columns.Add("LastModifiedOnDate", typeof(DateTime)); + + this._dtNotificationActions = new DataTable(); + this._dtNotificationActions.Columns.Add("NotificationActionID"); + this._dtNotificationActions.Columns.Add("MessageID"); + this._dtNotificationActions.Columns.Add("NotificationTypeActionID"); + this._dtNotificationActions.Columns.Add("Key"); + this._dtNotificationActions.Columns.Add("CreatedByUserID", typeof(int)); + this._dtNotificationActions.Columns.Add("CreatedOnDate", typeof(DateTime)); + this._dtNotificationActions.Columns.Add("LastModifiedByUserID", typeof(int)); + this._dtNotificationActions.Columns.Add("LastModifiedOnDate", typeof(DateTime)); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionControllerTests.cs index b2284c9dfab..de6d28fcdb6 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionControllerTests.cs @@ -28,15 +28,15 @@ public class SubscriptionControllerTests public void SetUp() { // Setup Mocks and Stub - mockDataService = new Mock(); - mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); - subscriptionSecurityController = new Mock(); + this.mockDataService = new Mock(); + this.mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); + this.subscriptionSecurityController = new Mock(); - DataService.SetTestableInstance(mockDataService.Object); - SubscriptionSecurityController.SetTestableInstance(subscriptionSecurityController.Object); + DataService.SetTestableInstance(this.mockDataService.Object); + SubscriptionSecurityController.SetTestableInstance(this.subscriptionSecurityController.Object); // Setup SUT - subscriptionController = new SubscriptionController(); + this.subscriptionController = new SubscriptionController(); } [TearDown] @@ -55,7 +55,7 @@ public void IsSubscribed_ShouldReturnFalse_IfUserIsNotSubscribed() var subscription = new SubscriptionBuilder() .Build(); - mockDataService.Setup(ds => ds.IsSubscribed( + this.mockDataService.Setup(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -64,7 +64,7 @@ public void IsSubscribed_ShouldReturnFalse_IfUserIsNotSubscribed() It.IsAny())).Returns(SubscriptionDataReaderMockHelper.CreateEmptySubscriptionReader()); //Act - var isSubscribed = subscriptionController.IsSubscribed(subscription); + var isSubscribed = this.subscriptionController.IsSubscribed(subscription); // Assert Assert.AreEqual(false, isSubscribed); @@ -79,7 +79,7 @@ public void IsSubscribed_ShouldReturnFalse_WhenUserDoesNotHavePermissionOnTheSub var subscriptionCollection = new[] {subscription}; - mockDataService.Setup(ds => ds.IsSubscribed( + this.mockDataService.Setup(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -87,11 +87,11 @@ public void IsSubscribed_ShouldReturnFalse_WhenUserDoesNotHavePermissionOnTheSub It.IsAny(), It.IsAny())).Returns(SubscriptionDataReaderMockHelper.CreateSubscriptionReader(subscriptionCollection)); - subscriptionSecurityController + this.subscriptionSecurityController .Setup(ssc => ssc.HasPermission(It.IsAny())).Returns(false); //Act - var isSubscribed = subscriptionController.IsSubscribed(subscription); + var isSubscribed = this.subscriptionController.IsSubscribed(subscription); // Assert Assert.AreEqual(false, isSubscribed); @@ -106,7 +106,7 @@ public void IsSubscribed_ShouldReturnTrue_WhenUserHasPermissionOnTheSubscription var subscriptionCollection = new[] { subscription }; - mockDataService.Setup(ds => ds.IsSubscribed( + this.mockDataService.Setup(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -114,11 +114,11 @@ public void IsSubscribed_ShouldReturnTrue_WhenUserHasPermissionOnTheSubscription It.IsAny(), It.IsAny())).Returns(SubscriptionDataReaderMockHelper.CreateSubscriptionReader(subscriptionCollection)); - subscriptionSecurityController + this.subscriptionSecurityController .Setup(ssc => ssc.HasPermission(It.IsAny())).Returns(true); //Act - var isSubscribed = subscriptionController.IsSubscribed(subscription); + var isSubscribed = this.subscriptionController.IsSubscribed(subscription); // Assert Assert.AreEqual(true, isSubscribed); @@ -131,7 +131,7 @@ public void IsSubscribed_ShouldCallDataService_WhenNoError() var subscription = new SubscriptionBuilder() .Build(); - mockDataService.Setup(ds => ds.IsSubscribed( + this.mockDataService.Setup(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -140,10 +140,10 @@ public void IsSubscribed_ShouldCallDataService_WhenNoError() subscription.TabId)).Returns(SubscriptionDataReaderMockHelper.CreateEmptySubscriptionReader()).Verifiable(); //Act - subscriptionController.IsSubscribed(subscription); + this.subscriptionController.IsSubscribed(subscription); // Assert - mockDataService.Verify(ds => ds.IsSubscribed( + this.mockDataService.Verify(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -158,7 +158,7 @@ public void IsSubscribed_ShouldCallDataService_WhenNoError() public void AddSubscription_ShouldThrowArgumentNullException_WhenSubscriptionIsNull() { //Act, Arrange - Assert.Throws(() => subscriptionController.AddSubscription(null)); + Assert.Throws(() => this.subscriptionController.AddSubscription(null)); } [Test] @@ -170,7 +170,7 @@ public void AddSubscription_ShouldThrowArgumentOutOfRangeException_WhenSubscript .Build(); //Act, Assert - Assert.Throws(() => subscriptionController.AddSubscription(subscription)); + Assert.Throws(() => this.subscriptionController.AddSubscription(subscription)); } [Test] @@ -182,7 +182,7 @@ public void AddSubscription_ShouldThrowArgumentOutOfRangeException_WhenSubscript .Build(); //Act, Assert - Assert.Throws(() => subscriptionController.AddSubscription(subscription)); + Assert.Throws(() => this.subscriptionController.AddSubscription(subscription)); } [Test] @@ -194,7 +194,7 @@ public void AddSubscription_ShouldThrowArgumentNullException_WhenSubscriptionObj .Build(); //Act, Assert - Assert.Throws(() => subscriptionController.AddSubscription(subscription)); + Assert.Throws(() => this.subscriptionController.AddSubscription(subscription)); } [Test] @@ -204,7 +204,7 @@ public void AddSubscription_ShouldCallDataService_WhenNoError() var subscription = new SubscriptionBuilder() .Build(); - mockDataService.Setup(ds => ds.AddSubscription( + this.mockDataService.Setup(ds => ds.AddSubscription( subscription.UserId, subscription.PortalId, subscription.SubscriptionTypeId, @@ -215,10 +215,10 @@ public void AddSubscription_ShouldCallDataService_WhenNoError() subscription.ObjectData)).Verifiable(); //Act - subscriptionController.AddSubscription(subscription); + this.subscriptionController.AddSubscription(subscription); // Assert - mockDataService.Verify(ds => ds.AddSubscription( + this.mockDataService.Verify(ds => ds.AddSubscription( subscription.UserId, subscription.PortalId, subscription.SubscriptionTypeId, @@ -238,7 +238,7 @@ public void AddSubscription_ShouldFilledUpTheSubscriptionIdPropertyOfTheInputSub var subscription = new SubscriptionBuilder() .Build(); - mockDataService.Setup(ds => ds.AddSubscription( + this.mockDataService.Setup(ds => ds.AddSubscription( subscription.UserId, subscription.PortalId, subscription.SubscriptionTypeId, @@ -249,7 +249,7 @@ public void AddSubscription_ShouldFilledUpTheSubscriptionIdPropertyOfTheInputSub subscription.ObjectData)).Returns(expectedSubscriptionId); //Act - subscriptionController.AddSubscription(subscription); + this.subscriptionController.AddSubscription(subscription); // Assert Assert.AreEqual(expectedSubscriptionId, subscription.SubscriptionId); @@ -261,7 +261,7 @@ public void AddSubscription_ShouldFilledUpTheSubscriptionIdPropertyOfTheInputSub public void DeleteSubscription_ShouldThrowArgumentNullException_WhenSubscriptionIsNull() { //Act, Assert - Assert.Throws(() => subscriptionController.DeleteSubscription(null)); + Assert.Throws(() => this.subscriptionController.DeleteSubscription(null)); } [Test] @@ -271,7 +271,7 @@ public void DeleteSubscriptionType_ShouldCallDeleteSubscriptionDataService_WhenS var subscription = new SubscriptionBuilder() .Build(); - mockDataService.Setup(ds => ds.IsSubscribed( + this.mockDataService.Setup(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -279,13 +279,13 @@ public void DeleteSubscriptionType_ShouldCallDeleteSubscriptionDataService_WhenS It.IsAny(), It.IsAny())).Returns(SubscriptionDataReaderMockHelper.CreateSubscriptionReader(new [] { subscription })); - mockDataService.Setup(ds => ds.DeleteSubscription(It.IsAny())).Verifiable(); + this.mockDataService.Setup(ds => ds.DeleteSubscription(It.IsAny())).Verifiable(); //Act - subscriptionController.DeleteSubscription(subscription); + this.subscriptionController.DeleteSubscription(subscription); //Assert - mockDataService.Verify(ds => ds.DeleteSubscription(It.IsAny()), Times.Once); + this.mockDataService.Verify(ds => ds.DeleteSubscription(It.IsAny()), Times.Once); } [Test] @@ -295,7 +295,7 @@ public void DeleteSubscriptionType_ShouldNotCallDeleteSubscriptionDataService_Wh var subscription = new SubscriptionBuilder() .Build(); - mockDataService.Setup(ds => ds.IsSubscribed( + this.mockDataService.Setup(ds => ds.IsSubscribed( subscription.PortalId, subscription.UserId, subscription.SubscriptionTypeId, @@ -304,10 +304,10 @@ public void DeleteSubscriptionType_ShouldNotCallDeleteSubscriptionDataService_Wh It.IsAny())).Returns(SubscriptionDataReaderMockHelper.CreateEmptySubscriptionReader()); //Act - subscriptionController.DeleteSubscription(subscription); + this.subscriptionController.DeleteSubscription(subscription); //Assert - mockDataService.Verify(ds => ds.DeleteSubscription(It.IsAny()), Times.Never); + this.mockDataService.Verify(ds => ds.DeleteSubscription(It.IsAny()), Times.Never); } #endregion } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionTypeControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionTypeControllerTests.cs index 0d60283b9af..82b1d7f0a3c 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionTypeControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/SubscriptionTypeControllerTests.cs @@ -29,13 +29,13 @@ public class SubscriptionTypeControllerTests public void SetUp() { // Setup Mocks and Stub - mockDataService = new Mock(); - mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); + this.mockDataService = new Mock(); + this.mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); - DataService.SetTestableInstance(mockDataService.Object); + DataService.SetTestableInstance(this.mockDataService.Object); // Setup SUT - subscriptionTypeController = new SubscriptionTypeController(); + this.subscriptionTypeController = new SubscriptionTypeController(); } #region GetSubscriptionTypes method tests @@ -49,23 +49,23 @@ public void GetSubscriptionTypes_ShouldCallDataService_WhenNoError() .Returns("0"); HostController.RegisterInstance(mockHostController.Object); - mockDataService + this.mockDataService .Setup(ds => ds.GetSubscriptionTypes()) .Returns(SubscriptionTypeDataReaderMockHelper.CreateEmptySubscriptionTypeReader()) .Verifiable(); //Act - subscriptionTypeController.GetSubscriptionTypes(); + this.subscriptionTypeController.GetSubscriptionTypes(); //Assert - mockDataService.Verify(ds => ds.GetSubscriptionTypes(), Times.Once()); + this.mockDataService.Verify(ds => ds.GetSubscriptionTypes(), Times.Once()); } [Test] public void GetSubscriptionTypes_ShouldThrowArgumentNullException_WhenPredicateIsNull() { //Act, Arrange - Assert.Throws(() => subscriptionTypeController.GetSubscriptionTypes(null)); + Assert.Throws(() => this.subscriptionTypeController.GetSubscriptionTypes(null)); } #endregion @@ -74,7 +74,7 @@ public void GetSubscriptionTypes_ShouldThrowArgumentNullException_WhenPredicateI public void GetSubscriptionType_ShouldThrowArgumentNullException_WhenPredicateIsNull() { //Act, Assert - Assert.Throws(() => subscriptionTypeController.GetSubscriptionType(null)); + Assert.Throws(() => this.subscriptionTypeController.GetSubscriptionType(null)); } #endregion @@ -83,7 +83,7 @@ public void GetSubscriptionType_ShouldThrowArgumentNullException_WhenPredicateIs public void AddSubscriptionType_ShouldThrowArgumentNullException_WhenSubscriptionTypeIsNull() { //Act, Arrange - Assert.Throws(() => subscriptionTypeController.AddSubscriptionType(null)); + Assert.Throws(() => this.subscriptionTypeController.AddSubscriptionType(null)); } [Test] @@ -93,7 +93,7 @@ public void AddSubscriptionType_ShouldFilledUpTheSubscriptionTypeIdPropertyOfThe const int expectedSubscriptionTypeId = 12; var subscriptionType = new SubscriptionTypeBuilder().Build(); - mockDataService + this.mockDataService .Setup(ds => ds.AddSubscriptionType( subscriptionType.SubscriptionName, subscriptionType.FriendlyName, @@ -101,7 +101,7 @@ public void AddSubscriptionType_ShouldFilledUpTheSubscriptionTypeIdPropertyOfThe .Returns(expectedSubscriptionTypeId); //Act - subscriptionTypeController.AddSubscriptionType(subscriptionType); + this.subscriptionTypeController.AddSubscriptionType(subscriptionType); //Assert Assert.AreEqual(expectedSubscriptionTypeId, subscriptionType.SubscriptionTypeId); @@ -111,16 +111,16 @@ public void AddSubscriptionType_ShouldFilledUpTheSubscriptionTypeIdPropertyOfThe public void AddSubscriptionType_ShouldCleanCache_WhenNoError() { // Arrange - mockDataService.Setup(ds => ds.AddSubscriptionType(It.IsAny(), It.IsAny(), It.IsAny())); - mockCacheProvider.Setup(cp => cp.Remove(SubscriptionTypesCacheKey)).Verifiable(); + this.mockDataService.Setup(ds => ds.AddSubscriptionType(It.IsAny(), It.IsAny(), It.IsAny())); + this.mockCacheProvider.Setup(cp => cp.Remove(SubscriptionTypesCacheKey)).Verifiable(); var subscriptionType = new SubscriptionTypeBuilder().Build(); //Act - subscriptionTypeController.AddSubscriptionType(subscriptionType); + this.subscriptionTypeController.AddSubscriptionType(subscriptionType); //Assert - mockCacheProvider.Verify(cp => cp.Remove(SubscriptionTypesCacheKey), Times.Once()); + this.mockCacheProvider.Verify(cp => cp.Remove(SubscriptionTypesCacheKey), Times.Once()); } #endregion @@ -134,14 +134,14 @@ public void DeleteSubscriptionType_ShouldThrowArgumentOutOfRangeException_WhenSu .Build(); // Act, Assert - Assert.Throws(() => subscriptionTypeController.DeleteSubscriptionType(subscriptionType)); + Assert.Throws(() => this.subscriptionTypeController.DeleteSubscriptionType(subscriptionType)); } [Test] public void DeleteSubscriptionType_ShouldThrowNullArgumentException_WhenSubscriptionTypeIsNull() { // Act, Assert - Assert.Throws(() => subscriptionTypeController.DeleteSubscriptionType(null)); + Assert.Throws(() => this.subscriptionTypeController.DeleteSubscriptionType(null)); } [Test] @@ -150,15 +150,15 @@ public void DeleteSubscriptionType_ShouldCallDataService_WhenNoError() // Arrange var subscriptionType = new SubscriptionTypeBuilder().Build(); - mockDataService + this.mockDataService .Setup(ds => ds.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId)) .Verifiable(); //Act - subscriptionTypeController.DeleteSubscriptionType(subscriptionType); + this.subscriptionTypeController.DeleteSubscriptionType(subscriptionType); //Assert - mockDataService.Verify(ds => ds.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId), Times.Once()); + this.mockDataService.Verify(ds => ds.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId), Times.Once()); } [Test] @@ -167,14 +167,14 @@ public void DeleteSubscriptionType_ShouldCleanCache_WhenNoError() // Arrange var subscriptionType = new SubscriptionTypeBuilder().Build(); - mockDataService.Setup(ds => ds.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId)); - mockCacheProvider.Setup(cp => cp.Remove(SubscriptionTypesCacheKey)).Verifiable(); + this.mockDataService.Setup(ds => ds.DeleteSubscriptionType(subscriptionType.SubscriptionTypeId)); + this.mockCacheProvider.Setup(cp => cp.Remove(SubscriptionTypesCacheKey)).Verifiable(); //Act - subscriptionTypeController.DeleteSubscriptionType(subscriptionType); + this.subscriptionTypeController.DeleteSubscriptionType(subscriptionType); //Assert - mockCacheProvider.Verify(cp => cp.Remove(SubscriptionTypesCacheKey), Times.Once()); + this.mockCacheProvider.Verify(cp => cp.Remove(SubscriptionTypesCacheKey), Times.Once()); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/UserPreferencesControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/UserPreferencesControllerTests.cs index d617eec119d..a04122381bc 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/UserPreferencesControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Messaging/UserPreferencesControllerTests.cs @@ -32,14 +32,14 @@ public class UserPreferencesControllerTests public void SetUp() { // Setup Mocks and Stub - mockDataService = new Mock(); - mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); + this.mockDataService = new Mock(); + this.mockCacheProvider = MockComponentProvider.CreateDataCacheProvider(); - DataService.RegisterInstance(mockDataService.Object); - SetupCachingProviderHelper.SetupCachingProvider(mockCacheProvider); + DataService.RegisterInstance(this.mockDataService.Object); + SetupCachingProviderHelper.SetupCachingProvider(this.mockCacheProvider); // Setup SUT - userPrefencesController = new UserPreferencesController(); + this.userPrefencesController = new UserPreferencesController(); } [TearDown] @@ -64,17 +64,17 @@ public void SetUserPreference_ShouldCallDataService_WhenNoError() // Arrange var userPreference = new UserPreferenceBuilder().Build(); - mockDataService.Setup(ds => ds.SetUserPreference( + this.mockDataService.Setup(ds => ds.SetUserPreference( userPreference.PortalId, userPreference.UserId, (int) userPreference.MessagesEmailFrequency, (int)userPreference.NotificationsEmailFrequency)).Verifiable(); //Act - userPrefencesController.SetUserPreference(userPreference); + this.userPrefencesController.SetUserPreference(userPreference); // Assert - mockDataService.Verify(ds => ds.SetUserPreference( + this.mockDataService.Verify(ds => ds.SetUserPreference( userPreference.PortalId, userPreference.UserId, (int)userPreference.MessagesEmailFrequency, @@ -88,12 +88,12 @@ public void GetUserPreference_ShouldReturnNullObject_WhenUserDoesNotHavePreferen { // Arrange var user = GetValidUser(); - mockDataService.Setup(ds => ds.GetUserPreference( + this.mockDataService.Setup(ds => ds.GetUserPreference( Constants.PORTAL_ValidPortalId, Constants.UserID_User12)).Returns(UserPreferenceDataReaderMockHelper.CreateEmptyUserPreferenceReader); //Act - var userPreference = userPrefencesController.GetUserPreference(user); + var userPreference = this.userPrefencesController.GetUserPreference(user); // Assert Assert.IsNull(userPreference); @@ -109,11 +109,11 @@ public void GetUserPreference_ShouldReturnUserPreference_WhenUserHasPreference() .Build(); var user = GetValidUser(); - mockDataService.Setup(ds => ds.GetUserPreference(Constants.PORTAL_ValidPortalId,Constants.UserID_User12)) + this.mockDataService.Setup(ds => ds.GetUserPreference(Constants.PORTAL_ValidPortalId,Constants.UserID_User12)) .Returns(UserPreferenceDataReaderMockHelper.CreateUserPreferenceReader(expectedUserPreference)); //Act - var userPreference = userPrefencesController.GetUserPreference(user); + var userPreference = this.userPrefencesController.GetUserPreference(user); // Assert Assert.IsNotNull(userPreference); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalControllerTests.cs index 19abd7c7047..2634cefe9ac 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalControllerTests.cs @@ -81,8 +81,8 @@ public class PortalControllerTests [SetUp] public void SetUp() { - _mockPortalTemplateIO = new Mock(); - PortalTemplateIO.SetTestableInstance(_mockPortalTemplateIO.Object); + this._mockPortalTemplateIO = new Mock(); + PortalTemplateIO.SetTestableInstance(this._mockPortalTemplateIO.Object); } [TearDown] @@ -108,7 +108,7 @@ public void NoTemplatesReturnsEmptyList() public void LanguageFileWithoutATemplateIsIgnored() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(ToEnumerable(DefaultDePath)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(this.ToEnumerable(DefaultDePath)); //Act var templates = PortalController.Instance.GetAvailablePortalTemplates(); @@ -121,8 +121,8 @@ public void LanguageFileWithoutATemplateIsIgnored() public void TemplatesWithNoLanguageFilesAreLoaded() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(StaticPath)); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(StaticPath)).Returns(CreateTemplateFileReader(StaticDescription)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(StaticPath)); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(StaticPath)).Returns(this.CreateTemplateFileReader(StaticDescription)); //Act var templates = PortalController.Instance.GetAvailablePortalTemplates(); @@ -137,12 +137,12 @@ public void TemplatesWithNoLanguageFilesAreLoaded() public void TemplateWith2Languages() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(DefaultPath)); - _mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(ToEnumerable(DefaultDePath, DefaultUsPath)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "en-US")).Returns(DefaultUsPath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultUsPath)).Returns(CreateLanguageFileReader(DefaultName)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(DefaultPath)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(this.ToEnumerable(DefaultDePath, DefaultUsPath)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(this.CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "en-US")).Returns(DefaultUsPath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultUsPath)).Returns(this.CreateLanguageFileReader(DefaultName)); //Act var templates = PortalController.Instance.GetAvailablePortalTemplates(); @@ -157,14 +157,14 @@ public void TemplateWith2Languages() public void TwoTemplatesAssortedLanguages() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns( ToEnumerable(DefaultPath, AlternatePath) ); - _mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(ToEnumerable(DefaultDePath, DefaultUsPath, AlternateDePath )); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "en-US")).Returns(DefaultUsPath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultUsPath)).Returns(CreateLanguageFileReader(DefaultName)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(AlternatePath, "de-DE")).Returns(AlternateDePath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(AlternateDePath)).Returns(CreateLanguageFileReader(AlternateDeName)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns( this.ToEnumerable(DefaultPath, AlternatePath) ); + this._mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(this.ToEnumerable(DefaultDePath, DefaultUsPath, AlternateDePath )); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(this.CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "en-US")).Returns(DefaultUsPath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultUsPath)).Returns(this.CreateLanguageFileReader(DefaultName)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(AlternatePath, "de-DE")).Returns(AlternateDePath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(AlternateDePath)).Returns(this.CreateLanguageFileReader(AlternateDeName)); //Act var templates = PortalController.Instance.GetAvailablePortalTemplates(); @@ -180,8 +180,8 @@ public void TwoTemplatesAssortedLanguages() public void ResourceFileIsLocatedWhenPresent() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(ResourcePath)); - _mockPortalTemplateIO.Setup(x => x.GetResourceFilePath(ResourcePath)).Returns(ResourceFilePath); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(ResourcePath)); + this._mockPortalTemplateIO.Setup(x => x.GetResourceFilePath(ResourcePath)).Returns(ResourceFilePath); //Act var templates = PortalController.Instance.GetAvailablePortalTemplates(); @@ -195,10 +195,10 @@ public void ResourceFileIsLocatedWhenPresent() public void SingleTemplateAndLanguage() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(DefaultPath)); - _mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(ToEnumerable(DefaultDePath)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(DefaultPath)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(this.ToEnumerable(DefaultDePath)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(this.CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); //Act var templates = PortalController.Instance.GetAvailablePortalTemplates(); @@ -212,10 +212,10 @@ public void SingleTemplateAndLanguage() public void ATemplateCanBeLoadedDirectly() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(DefaultPath)); - _mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(ToEnumerable(DefaultDePath)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(DefaultPath)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(this.ToEnumerable(DefaultDePath)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(this.CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); //Act var template = PortalController.Instance.GetPortalTemplate(DefaultPath, "de-DE"); @@ -228,10 +228,10 @@ public void ATemplateCanBeLoadedDirectly() public void GetPortalTemplateReturnsNullIfCultureDoesNotMatch() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(DefaultPath)); - _mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(ToEnumerable(DefaultDePath)); - _mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(DefaultPath)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateLanguageFiles()).Returns(this.ToEnumerable(DefaultDePath)); + this._mockPortalTemplateIO.Setup(x => x.GetLanguageFilePath(DefaultPath, "de-DE")).Returns(DefaultDePath); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(DefaultDePath)).Returns(this.CreateLanguageFileReader(DefaultDeName, DefaultDeDescription)); //Act var template = PortalController.Instance.GetPortalTemplate(DefaultPath, "de"); @@ -244,8 +244,8 @@ public void GetPortalTemplateReturnsNullIfCultureDoesNotMatch() public void GetPortalTemplateCanReturnAStaticTemplate() { //Arrange - _mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(ToEnumerable(StaticPath)); - _mockPortalTemplateIO.Setup(x => x.OpenTextReader(StaticPath)).Returns(CreateTemplateFileReader(StaticDescription)); + this._mockPortalTemplateIO.Setup(x => x.EnumerateTemplates()).Returns(this.ToEnumerable(StaticPath)); + this._mockPortalTemplateIO.Setup(x => x.OpenTextReader(StaticPath)).Returns(this.CreateTemplateFileReader(StaticDescription)); //Act var template = PortalController.Instance.GetPortalTemplate(StaticPath, CultureCode); @@ -256,7 +256,7 @@ public void GetPortalTemplateCanReturnAStaticTemplate() private TextReader CreateLanguageFileReader(string name) { - return CreateLanguageFileReader(name, null); + return this.CreateLanguageFileReader(name, null); } private TextReader CreateLanguageFileReader(string name, string description) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalGroupControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalGroupControllerTests.cs index d339e36b135..d0aa7aa4dca 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalGroupControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Portal/PortalGroupControllerTests.cs @@ -36,7 +36,7 @@ public class PortalGroupControllerTests [SetUp] public void SetUp() { - _mockData = MockComponentProvider.CreateDataProvider(); + this._mockData = MockComponentProvider.CreateDataProvider(); DataTable hostSettingsTable = new DataTable("HostSettings"); var nameCol = hostSettingsTable.Columns.Add("SettingName"); @@ -45,7 +45,7 @@ public void SetUp() hostSettingsTable.PrimaryKey = new[] { nameCol }; hostSettingsTable.Rows.Add("PerformanceSetting", "0", false); - _mockData.Setup(c => c.GetHostSettings()).Returns(hostSettingsTable.CreateDataReader()); + this._mockData.Setup(c => c.GetHostSettings()).Returns(hostSettingsTable.CreateDataReader()); } [TearDown] @@ -95,7 +95,7 @@ public void PortalGroupController_AddPortalToGroup_Throws_On_Null_PortalGroup() var portal = new PortalInfo { PortalID = Constants.PORTAL_ValidPortalId }; //Act, Assert - controller.AddPortalToGroup(portal, null, userCopied); + controller.AddPortalToGroup(portal, null, this.userCopied); } [Test] @@ -110,7 +110,7 @@ public void PortalGroupController_AddPortalToGroup_Throws_On_Null_Portal() //Act, Assert - controller.AddPortalToGroup(null, portalGroup, userCopied); + controller.AddPortalToGroup(null, portalGroup, this.userCopied); } [Test] @@ -127,7 +127,7 @@ public void PortalGroupController_AddPortalToGroup_Throws_On_Negative_PortalGrou PortalGroupInfo portalGroup = new PortalGroupInfo { PortalGroupId = -1 }; //Act, Assert - controller.AddPortalToGroup(portal, portalGroup, userCopied); + controller.AddPortalToGroup(portal, portalGroup, this.userCopied); } [Test] @@ -144,7 +144,7 @@ public void PortalGroupController_AddPortalToGroup_Throws_On_Negative_PortalId() PortalGroupInfo portalGroup = new PortalGroupInfo { PortalGroupId = Constants.PORTALGROUP_ValidPortalGroupId }; //Act, Assert - controller.AddPortalToGroup(portal, portalGroup, userCopied); + controller.AddPortalToGroup(portal, portalGroup, this.userCopied); } #endregion @@ -379,7 +379,7 @@ public void PortalGroupController_RemovePortalFromGroup_Throws_On_Null_PortalGro var portal = new PortalInfo { PortalID = Constants.PORTAL_ValidPortalId }; //Act, Assert - controller.RemovePortalFromGroup(portal, null, false, userCopied); + controller.RemovePortalFromGroup(portal, null, false, this.userCopied); } [Test] @@ -394,7 +394,7 @@ public void PortalGroupController_RemovePortalFromGroup_Throws_On_Null_Portal() //Act, Assert - controller.RemovePortalFromGroup(null, portalGroup, false, userCopied); + controller.RemovePortalFromGroup(null, portalGroup, false, this.userCopied); } [Test] @@ -411,7 +411,7 @@ public void PortalGroupController_RemovePortalFromGroup_Throws_On_Negative_Porta PortalGroupInfo portalGroup = new PortalGroupInfo { PortalGroupId = -1 }; //Act, Assert - controller.RemovePortalFromGroup(portal, portalGroup, false, userCopied); + controller.RemovePortalFromGroup(portal, portalGroup, false, this.userCopied); } [Test] @@ -428,7 +428,7 @@ public void PortalGroupController_RemovePortalFromGroup_Throws_On_Negative_Porta PortalGroupInfo portalGroup = new PortalGroupInfo { PortalGroupId = Constants.PORTALGROUP_ValidPortalGroupId }; //Act, Assert - controller.RemovePortalFromGroup(portal, portalGroup, false, userCopied); + controller.RemovePortalFromGroup(portal, portalGroup, false, this.userCopied); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/InternalSearchControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/InternalSearchControllerTests.cs index 30dc85a2103..ab0df9ad940 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/InternalSearchControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/InternalSearchControllerTests.cs @@ -108,37 +108,37 @@ public void SetUp() ComponentFactory.Container = new SimpleContainer(); MockComponentProvider.ResetContainer(); - _mockDataProvider = MockComponentProvider.CreateDataProvider(); - _mockLocaleController = MockComponentProvider.CreateLocaleController(); - _mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); + this._mockDataProvider = MockComponentProvider.CreateDataProvider(); + this._mockLocaleController = MockComponentProvider.CreateLocaleController(); + this._mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); - _mockUserController = new Mock(); - _mockHostController = new Mock(); - _mockSearchHelper = new Mock(); + this._mockUserController = new Mock(); + this._mockHostController = new Mock(); + this._mockSearchHelper = new Mock(); - SetupDataProvider(); - SetupHostController(); - SetupSearchHelper(); - SetupLocaleController(); + this.SetupDataProvider(); + this.SetupHostController(); + this.SetupSearchHelper(); + this.SetupLocaleController(); - _mockUserController.Setup(c => c.GetUserById(It.IsAny(), It.IsAny())) - .Returns((int portalId, int userId) => GetUserByIdCallback(portalId, userId)); - UserController.SetTestableInstance(_mockUserController.Object); + this._mockUserController.Setup(c => c.GetUserById(It.IsAny(), It.IsAny())) + .Returns((int portalId, int userId) => this.GetUserByIdCallback(portalId, userId)); + UserController.SetTestableInstance(this._mockUserController.Object); - CreateNewLuceneControllerInstance(); + this.CreateNewLuceneControllerInstance(); } [TearDown] public void TearDown() { - _luceneController.Dispose(); - DeleteIndexFolder(); + this._luceneController.Dispose(); + this.DeleteIndexFolder(); InternalSearchController.ClearInstance(); UserController.ClearInstance(); SearchHelper.ClearInstance(); LuceneController.ClearInstance(); - _luceneController = null; + this._luceneController = null; } #endregion @@ -147,65 +147,65 @@ public void TearDown() private void CreateNewLuceneControllerInstance() { - DeleteIndexFolder(); + this.DeleteIndexFolder(); InternalSearchController.SetTestableInstance(new InternalSearchControllerImpl()); - _internalSearchController = InternalSearchController.Instance; + this._internalSearchController = InternalSearchController.Instance; - if (_luceneController != null) + if (this._luceneController != null) { LuceneController.ClearInstance(); - _luceneController.Dispose(); + this._luceneController.Dispose(); } - _luceneController = new LuceneControllerImpl(); - LuceneController.SetTestableInstance(_luceneController); + this._luceneController = new LuceneControllerImpl(); + LuceneController.SetTestableInstance(this._luceneController); } private void SetupHostController() { - _mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns(SearchIndexFolder); - _mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())).Returns(_readerStaleTimeSpan); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTitleBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTagBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTagBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchKeywordBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())) + this._mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns(SearchIndexFolder); + this._mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())).Returns(this._readerStaleTimeSpan); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTitleBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTagBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTagBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchKeywordBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())) .Returns(Constants.DefaultSearchDescriptionBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchAuthorBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns(Constants.DefaultMinLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns(Constants.DefaultMaxLen); - HostController.RegisterInstance(_mockHostController.Object); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchAuthorBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns(Constants.DefaultMinLen); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns(Constants.DefaultMaxLen); + HostController.RegisterInstance(this._mockHostController.Object); } private void SetupLocaleController() { - _mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale {LanguageId = -1, Code = string.Empty}); - _mockLocaleController.Setup(l => l.GetLocale(CultureEnUs)).Returns(new Locale {LanguageId = LanguageIdEnUs, Code = CultureEnUs}); - _mockLocaleController.Setup(l => l.GetLocale(CultureEnCa)).Returns(new Locale {LanguageId = LanguageIdEnFr, Code = CultureEnCa}); - _mockLocaleController.Setup(l => l.GetLocale(CultureItIt)).Returns(new Locale {LanguageId = LanguageIdItIt, Code = CultureItIt}); - _mockLocaleController.Setup(l => l.GetLocale(CultureEsEs)).Returns(new Locale {LanguageId = LanguageIdEsEs, Code = CultureEsEs}); + this._mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale {LanguageId = -1, Code = string.Empty}); + this._mockLocaleController.Setup(l => l.GetLocale(CultureEnUs)).Returns(new Locale {LanguageId = LanguageIdEnUs, Code = CultureEnUs}); + this._mockLocaleController.Setup(l => l.GetLocale(CultureEnCa)).Returns(new Locale {LanguageId = LanguageIdEnFr, Code = CultureEnCa}); + this._mockLocaleController.Setup(l => l.GetLocale(CultureItIt)).Returns(new Locale {LanguageId = LanguageIdItIt, Code = CultureItIt}); + this._mockLocaleController.Setup(l => l.GetLocale(CultureEsEs)).Returns(new Locale {LanguageId = LanguageIdEsEs, Code = CultureEsEs}); - _mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale {LanguageId = LanguageIdEnUs, Code = CultureEnUs}); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnUs)).Returns(new Locale {LanguageId = LanguageIdEnUs, Code = CultureEnUs}); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnFr)).Returns(new Locale {LanguageId = LanguageIdEnFr, Code = CultureEnCa}); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdItIt)).Returns(new Locale {LanguageId = LanguageIdItIt, Code = CultureItIt}); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdEsEs)).Returns(new Locale {LanguageId = LanguageIdEsEs, Code = CultureEsEs}); + this._mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale {LanguageId = LanguageIdEnUs, Code = CultureEnUs}); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnUs)).Returns(new Locale {LanguageId = LanguageIdEnUs, Code = CultureEnUs}); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnFr)).Returns(new Locale {LanguageId = LanguageIdEnFr, Code = CultureEnCa}); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdItIt)).Returns(new Locale {LanguageId = LanguageIdItIt, Code = CultureItIt}); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdEsEs)).Returns(new Locale {LanguageId = LanguageIdEsEs, Code = CultureEsEs}); } private void SetupDataProvider() { //Standard DataProvider Path for Logging - _mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); DataTableReader searchTypes = null; - _mockDataProvider.Setup(ds => ds.GetAllSearchTypes()) - .Callback(() => searchTypes = GetAllSearchTypes().CreateDataReader()) + this._mockDataProvider.Setup(ds => ds.GetAllSearchTypes()) + .Callback(() => searchTypes = this.GetAllSearchTypes().CreateDataReader()) .Returns(() => searchTypes); - _mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); + this._mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(this.GetPortalsCallBack); } private IDataReader GetPortalsCallBack(string culture) { - return GetPortalCallBack(PortalId0, CultureEnUs); + return this.GetPortalCallBack(PortalId0, CultureEnUs); } private IDataReader GetPortalCallBack(int portalId, string culture) @@ -240,25 +240,25 @@ private IDataReader GetPortalCallBack(int portalId, string culture) private void SetupSearchHelper() { - _mockSearchHelper.Setup(c => c.GetSearchMinMaxLength()).Returns(new Tuple(Constants.DefaultMinLen, Constants.DefaultMaxLen)); - _mockSearchHelper.Setup(c => c.GetSynonyms(It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(GetSynonymsCallBack); - _mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())) + this._mockSearchHelper.Setup(c => c.GetSearchMinMaxLength()).Returns(new Tuple(Constants.DefaultMinLen, Constants.DefaultMaxLen)); + this._mockSearchHelper.Setup(c => c.GetSynonyms(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(this.GetSynonymsCallBack); + this._mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())) .Returns((string name) => new SearchType {SearchTypeId = 0, SearchTypeName = name}); - _mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns(GetSearchTypeByNameCallback); - _mockSearchHelper.Setup(x => x.GetSearchTypes()).Returns(GetSearchTypes()); - _mockSearchHelper.Setup(c => c.GetSynonymsGroups(It.IsAny(), It.IsAny())).Returns(GetSynonymsGroupsCallBack); - _mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEsEs)).Returns( + this._mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns(this.GetSearchTypeByNameCallback); + this._mockSearchHelper.Setup(x => x.GetSearchTypes()).Returns(this.GetSearchTypes()); + this._mockSearchHelper.Setup(c => c.GetSynonymsGroups(It.IsAny(), It.IsAny())).Returns(this.GetSynonymsGroupsCallBack); + this._mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEsEs)).Returns( new SearchStopWords { PortalId = 0, CultureCode = CultureEsEs, StopWords = "los,de,el", }); - _mockSearchHelper.Setup(x => x.RephraseSearchText(It.IsAny(), It.IsAny(), It.IsAny())) + this._mockSearchHelper.Setup(x => x.RephraseSearchText(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new SearchHelperImpl().RephraseSearchText); - _mockSearchHelper.Setup(x => x.StripTagsNoAttributes(It.IsAny(), It.IsAny())).Returns((string html, bool retainSpace) => html); - SearchHelper.SetTestableInstance(_mockSearchHelper.Object); + this._mockSearchHelper.Setup(x => x.StripTagsNoAttributes(It.IsAny(), It.IsAny())).Returns((string html, bool retainSpace) => html); + SearchHelper.SetTestableInstance(this._mockSearchHelper.Object); } private IList GetSynonymsGroupsCallBack() @@ -372,7 +372,7 @@ public void SearchController_Add_Throws_On_Null_SearchDocument() //Arrange //Act, Assert - Assert.Throws(() => _internalSearchController.AddSearchDocument(null)); + Assert.Throws(() => this._internalSearchController.AddSearchDocument(null)); } [Test] @@ -381,7 +381,7 @@ public void SearchController_Add_Throws_On_Null_Or_Empty_UniqueuKey() //Arrange //Act, Assert - Assert.Throws(() => _internalSearchController.AddSearchDocument(new SearchDocument())); + Assert.Throws(() => this._internalSearchController.AddSearchDocument(new SearchDocument())); } [Test] @@ -391,7 +391,7 @@ public void SearchController_Add_Throws_On_Null_OrEmpty_Title() //Act, Assert Assert.Throws( - () => _internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString()})); + () => this._internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString()})); } @@ -402,7 +402,7 @@ public void SearchController_AddSearchDcoumets_Does_Not_Throw_On_Null_OrEmpty_Ti var documents = new List {new SearchDocument {UniqueKey = Guid.NewGuid().ToString()}}; //Act, Assert - _internalSearchController.AddSearchDocuments(documents); + this._internalSearchController.AddSearchDocuments(documents); } [Test] @@ -412,7 +412,7 @@ public void SearchController_AddSearchDcoumets_Does_Not_Throw_On_Empty_Search_Do var documents = new List {new SearchDocument()}; //Act, Assert - _internalSearchController.AddSearchDocuments(documents); + this._internalSearchController.AddSearchDocuments(documents); } [Test] @@ -422,7 +422,7 @@ public void SearchController_Add_Throws_On_Zero_SearchTypeId() //Act, Assert Assert.Throws( - () => _internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString()})); + () => this._internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString()})); } [Test] @@ -433,7 +433,7 @@ public void SearchController_Add_Throws_On_Negative_SearchTypeId() //Act, Assert Assert.Throws( () => - _internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString(), Title = "title", SearchTypeId = -1})); + this._internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString(), Title = "title", SearchTypeId = -1})); } [Test] @@ -443,7 +443,7 @@ public void SearchController_Add_Throws_On_DateTimeMin_ModifiedTimeUtc() //Act, Assert Assert.Throws( - () => _internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString(), Title = "title", SearchTypeId = 1})); + () => this._internalSearchController.AddSearchDocument(new SearchDocument {UniqueKey = Guid.NewGuid().ToString(), Title = "title", SearchTypeId = 1})); } #endregion @@ -470,28 +470,28 @@ public void SearchController_Add_Then_Delete_ModuleDefinition_WorksAsExpected() ModifiedTimeUtc = now, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } //Assert - var stats = GetSearchStatistics(); + var stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs, stats.TotalActiveDocuments); //Act - delete last item var searchDoc = new SearchDocument {ModuleDefId = totalDocs}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 1, stats.TotalActiveDocuments); Assert.AreEqual(1, stats.TotalDeletedDocuments); //Act - delete first item searchDoc = new SearchDocument {ModuleDefId = 1}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 2, stats.TotalActiveDocuments); Assert.AreEqual(2, stats.TotalDeletedDocuments); } @@ -516,28 +516,28 @@ public void SearchController_Add_Then_Delete_Module_WorksAsExpected() ModifiedTimeUtc = now, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } //Assert - var stats = GetSearchStatistics(); + var stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs, stats.TotalActiveDocuments); //Act - delete last item var searchDoc = new SearchDocument {ModuleId = totalDocs}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 1, stats.TotalActiveDocuments); Assert.AreEqual(1, stats.TotalDeletedDocuments); //Act - delete first item searchDoc = new SearchDocument {ModuleId = 1}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 2, stats.TotalActiveDocuments); Assert.AreEqual(2, stats.TotalDeletedDocuments); } @@ -562,19 +562,19 @@ public void SearchController_Add_Then_Delete_Portals_WorksAsExpected() ModuleDefId = 10, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } //Assert - var stats = GetSearchStatistics(); + var stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs, stats.TotalActiveDocuments); //Act - delete all portal 1 items var searchDoc = new SearchDocument {PortalId = PortalId1}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - delete all portal 1 - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs/2, stats.TotalActiveDocuments); Assert.AreEqual(totalDocs/2, stats.TotalDeletedDocuments); } @@ -600,28 +600,28 @@ public void SearchController_Add_Then_Delete_Roles_WorksAsExpected() ModuleDefId = 10, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } //Assert - var stats = GetSearchStatistics(); + var stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs, stats.TotalActiveDocuments); //Act - delete last item var searchDoc = new SearchDocument {RoleId = totalDocs}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 1, stats.TotalActiveDocuments); Assert.AreEqual(1, stats.TotalDeletedDocuments); //Act - delete first item searchDoc = new SearchDocument {RoleId = 1}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 2, stats.TotalActiveDocuments); Assert.AreEqual(2, stats.TotalDeletedDocuments); } @@ -645,28 +645,28 @@ public void SearchController_Add_Then_Delete_Tabs_WorksAsExpected() ModifiedTimeUtc = now, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } //Assert - var stats = GetSearchStatistics(); + var stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs, stats.TotalActiveDocuments); //Act - delete last item var searchDoc = new SearchDocument {TabId = totalDocs}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 1, stats.TotalActiveDocuments); Assert.AreEqual(1, stats.TotalDeletedDocuments); //Act - delete first item searchDoc = new SearchDocument {TabId = 1}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 2, stats.TotalActiveDocuments); Assert.AreEqual(2, stats.TotalDeletedDocuments); } @@ -692,37 +692,37 @@ public void SearchController_Add_Then_Delete_Users_WorksAsExpected() ModuleDefId = 10, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } //Assert - var stats = GetSearchStatistics(); + var stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs, stats.TotalActiveDocuments); //Act - delete last item var searchDoc = new SearchDocument {AuthorUserId = totalDocs}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 1, stats.TotalActiveDocuments); Assert.AreEqual(1, stats.TotalDeletedDocuments); //Act - delete first item searchDoc = new SearchDocument {AuthorUserId = 1}; - _internalSearchController.DeleteSearchDocument(searchDoc); + this._internalSearchController.DeleteSearchDocument(searchDoc); //Assert - stats = GetSearchStatistics(); + stats = this.GetSearchStatistics(); Assert.AreEqual(totalDocs - 2, stats.TotalActiveDocuments); Assert.AreEqual(2, stats.TotalDeletedDocuments); } private SearchStatistics GetSearchStatistics() { - _internalSearchController.Commit(); - Thread.Sleep((int)(_readerStaleTimeSpan * 1000)); // time to flush data to Lucene - return _internalSearchController.GetSearchStatistics(); + this._internalSearchController.Commit(); + Thread.Sleep((int)(this._readerStaleTimeSpan * 1000)); // time to flush data to Lucene + return this._internalSearchController.GetSearchStatistics(); } #if false // the rules have changed and these are invalid tests now diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/LuceneControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/LuceneControllerTests.cs index 277dd23ff22..e449365ba86 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/LuceneControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/LuceneControllerTests.cs @@ -67,34 +67,34 @@ public class LuceneControllerTests public void SetUp() { ComponentFactory.Container = new SimpleContainer(); - _cachingProvider = MockComponentProvider.CreateDataCacheProvider(); - - _mockHostController = new Mock(); - _mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns(SearchIndexFolder); - _mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())).Returns(_readerStaleTimeSpan); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns(Constants.DefaultMinLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns(Constants.DefaultMaxLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchRetryTimesKey, It.IsAny())).Returns(DefaultSearchRetryTimes); - HostController.RegisterInstance(_mockHostController.Object); - - _mockSearchHelper = new Mock(); - _mockSearchHelper.Setup(c => c.GetSynonyms(It.IsAny(), It.IsAny(), It.IsAny())).Returns(GetSynonymsCallBack); - _mockSearchHelper.Setup(c => c.GetSearchStopWords(It.IsAny(), It.IsAny())).Returns(new SearchStopWords()); - _mockSearchHelper.Setup(c => c.GetSearchMinMaxLength()).Returns(new Tuple(Constants.DefaultMinLen, Constants.DefaultMaxLen)); - _mockSearchHelper.Setup(x => x.StripTagsNoAttributes(It.IsAny(), It.IsAny())).Returns((string html, bool retainSpace) => html); - SearchHelper.SetTestableInstance(_mockSearchHelper.Object); - - _mockSearchQuery = new Mock(); - - DeleteIndexFolder(); - CreateNewLuceneControllerInstance(); + this._cachingProvider = MockComponentProvider.CreateDataCacheProvider(); + + this._mockHostController = new Mock(); + this._mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns(SearchIndexFolder); + this._mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())).Returns(this._readerStaleTimeSpan); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns(Constants.DefaultMinLen); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns(Constants.DefaultMaxLen); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchRetryTimesKey, It.IsAny())).Returns(DefaultSearchRetryTimes); + HostController.RegisterInstance(this._mockHostController.Object); + + this._mockSearchHelper = new Mock(); + this._mockSearchHelper.Setup(c => c.GetSynonyms(It.IsAny(), It.IsAny(), It.IsAny())).Returns(this.GetSynonymsCallBack); + this._mockSearchHelper.Setup(c => c.GetSearchStopWords(It.IsAny(), It.IsAny())).Returns(new SearchStopWords()); + this._mockSearchHelper.Setup(c => c.GetSearchMinMaxLength()).Returns(new Tuple(Constants.DefaultMinLen, Constants.DefaultMaxLen)); + this._mockSearchHelper.Setup(x => x.StripTagsNoAttributes(It.IsAny(), It.IsAny())).Returns((string html, bool retainSpace) => html); + SearchHelper.SetTestableInstance(this._mockSearchHelper.Object); + + this._mockSearchQuery = new Mock(); + + this.DeleteIndexFolder(); + this.CreateNewLuceneControllerInstance(); } [TearDown] public void TearDown() { - _luceneController.Dispose(); - DeleteIndexFolder(); + this._luceneController.Dispose(); + this.DeleteIndexFolder(); SearchHelper.ClearInstance(); } @@ -105,13 +105,13 @@ public void TearDown() private void CreateNewLuceneControllerInstance() { - if (_luceneController != null) + if (this._luceneController != null) { LuceneController.ClearInstance(); - _luceneController.Dispose(); + this._luceneController.Dispose(); } - _luceneController = new LuceneControllerImpl(); - LuceneController.SetTestableInstance(_luceneController); + this._luceneController = new LuceneControllerImpl(); + LuceneController.SetTestableInstance(this._luceneController); } private IList GetSynonymsCallBack(int portalId, string cultureCode, string term) @@ -145,7 +145,7 @@ private void AddStandardDocs() Line1, Line2, Line3, Line4 }; - AddLinesAsSearchDocs(lines); + this.AddLinesAsSearchDocs(lines); } private void AddLinesAsSearchDocs(IEnumerable lines) @@ -155,10 +155,10 @@ private void AddLinesAsSearchDocs(IEnumerable lines) var field = new Field(Constants.ContentTag, line, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); var doc = new Document(); doc.Add(field); - _luceneController.Add(doc); + this._luceneController.Add(doc); } - _luceneController.Commit(); + this._luceneController.Commit(); } #endregion @@ -169,7 +169,7 @@ private void AddLinesAsSearchDocs(IEnumerable lines) public void LuceneController_SearchFolderIsAsExpected() { var inf1 = new DirectoryInfo(SearchIndexFolder); - var inf2 = new DirectoryInfo(_luceneController.IndexFolder); + var inf2 = new DirectoryInfo(this._luceneController.IndexFolder); Assert.AreEqual(inf1.FullName, inf2.FullName); } @@ -179,7 +179,7 @@ public void LuceneController_Add_Throws_On_Null_Document() //Arrange //Act, Assert - Assert.Throws(() => _luceneController.Add(null)); + Assert.Throws(() => this._luceneController.Add(null)); } public void LuceneController_Add_Throws_On_Null_Query() @@ -187,7 +187,7 @@ public void LuceneController_Add_Throws_On_Null_Query() //Arrange //Act, Assert - Assert.Throws(() => _luceneController.Delete(null)); + Assert.Throws(() => this._luceneController.Delete(null)); } [Test] @@ -196,11 +196,11 @@ public void LuceneController_Add_Empty_FiledsCollection_DoesNot_Create_Index() //Arrange //Act - _luceneController.Add(new Document()); - _luceneController.Commit(); + this._luceneController.Add(new Document()); + this._luceneController.Commit(); var numFiles = 0; - DeleteIndexFolder(); + this.DeleteIndexFolder(); Assert.AreEqual(0, numFiles); } @@ -217,10 +217,10 @@ public void LuceneController_GetsHighlightedDesc() var doc = new Document(); doc.Add(field); - _luceneController.Add(doc); - _luceneController.Commit(); + this._luceneController.Add(doc); + this._luceneController.Commit(); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery {Query = new TermQuery(new Term(fieldName, "fox"))})); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery {Query = new TermQuery(new Term(fieldName, "fox"))})); //Assert Assert.AreEqual(1, hits.Results.Count()); @@ -241,10 +241,10 @@ public void LuceneController_HighlightedDescHtmlEncodesOutput() var doc = new Document(); doc.Add(field); - _luceneController.Add(doc); - _luceneController.Commit(); + this._luceneController.Add(doc); + this._luceneController.Commit(); - var hits = _luceneController.Search( CreateSearchContext(new LuceneQuery {Query = new TermQuery(new Term(fieldName, "fox"))})); + var hits = this._luceneController.Search( this.CreateSearchContext(new LuceneQuery {Query = new TermQuery(new Term(fieldName, "fox"))})); //Assert Assert.AreEqual(1, hits.Results.Count()); @@ -262,11 +262,11 @@ public void LuceneController_FindsResultsUsingNearRealtimeSearchWithoutCommit() var field = new Field(fieldName, fieldValue, Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS); var doc = new Document(); doc.Add(field); - _luceneController.Add(doc); + this._luceneController.Add(doc); // DONOT commit here to enable testing near-realtime of search writer //_luceneController.Commit(); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(fieldName, "fox")) })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(fieldName, "fox")) })); //Assert Assert.AreEqual(1, hits.Results.Count()); @@ -280,9 +280,9 @@ public void LuceneController_FindsResultsUsingNearRealtimeSearchWithoutCommit() public void LuceneController_Search_Returns_Correct_Total_Hits() { //Arrange - AddStandardDocs(); + this.AddStandardDocs(); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery {Query = new TermQuery(new Term(Constants.ContentTag, "fox"))})); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery {Query = new TermQuery(new Term(Constants.ContentTag, "fox"))})); //Assert Assert.AreEqual(4, hits.TotalHits); @@ -293,9 +293,9 @@ public void LuceneController_Search_Returns_Correct_Total_Hits() public void LuceneController_Search_Request_For_1_Result_Returns_1_Record_But_More_TotalHits() { //Arrange - AddStandardDocs(); + this.AddStandardDocs(); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 1, PageSize = 1 })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 1, PageSize = 1 })); //Assert Assert.AreEqual(4, hits.TotalHits); @@ -306,9 +306,9 @@ public void LuceneController_Search_Request_For_1_Result_Returns_1_Record_But_Mo public void LuceneController_Search_Request_For_4_Records_Returns_4_Records_With_4_TotalHits_Based_On_PageIndex1_PageSize4() { //Arrange - AddStandardDocs(); + this.AddStandardDocs(); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 1, PageSize = 4 })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 1, PageSize = 4 })); //Assert Assert.AreEqual(4, hits.TotalHits); @@ -319,9 +319,9 @@ public void LuceneController_Search_Request_For_4_Records_Returns_4_Records_With public void LuceneController_Search_Request_For_4_Records_Returns_4_Records_With_4_TotalHits_Based_On_PageIndex4_PageSize1() { //Arrange - AddStandardDocs(); + this.AddStandardDocs(); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 1, PageSize = 4 })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 1, PageSize = 4 })); //Assert Assert.AreEqual(4, hits.TotalHits); @@ -332,9 +332,9 @@ public void LuceneController_Search_Request_For_4_Records_Returns_4_Records_With public void LuceneController_Search_Request_For_NonExisting_PageNumbers_Returns_No_Record() { //Arrange - AddStandardDocs(); + this.AddStandardDocs(); - var hits = _luceneController.Search(CreateSearchContext( + var hits = this._luceneController.Search(this.CreateSearchContext( new LuceneQuery{ Query = new TermQuery(new Term(Constants.ContentTag, "fox")), PageIndex = 5, @@ -351,14 +351,14 @@ public void LuceneController_Search_Request_For_NonExisting_PageNumbers_Returns_ public void LuceneController_Search_Request_For_PagIndex2_PageSize1_Returns_2nd_Record_Only() { //Arrange - AddStandardDocs(); + this.AddStandardDocs(); var query = new LuceneQuery { Query = new TermQuery(new Term(Constants.ContentTag, "quick")), PageIndex = 2, PageSize = 1 }; - var hits = _luceneController.Search(CreateSearchContext(query)); + var hits = this._luceneController.Search(this.CreateSearchContext(query)); //Assert Assert.AreEqual(3, hits.TotalHits); @@ -382,27 +382,27 @@ public void LuceneController_NumericRangeCheck() //Add first numeric field var doc1 = new Document(); doc1.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(1)); - _luceneController.Add(doc1); + this._luceneController.Add(doc1); //Add second numeric field var doc2 = new Document(); doc2.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(2)); - _luceneController.Add(doc2); + this._luceneController.Add(doc2); //Add third numeric field var doc3 = new Document(); doc3.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(3)); - _luceneController.Add(doc3); + this._luceneController.Add(doc3); //Add fourth numeric field var doc4 = new Document(); doc4.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(4)); - _luceneController.Add(doc4); + this._luceneController.Add(doc4); - _luceneController.Commit(); + this._luceneController.Commit(); var query = NumericRangeQuery.NewIntRange(fieldName, 2, 3, true, true); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = query })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = query })); Assert.AreEqual(2, hits.Results.Count()); } @@ -418,48 +418,48 @@ public void LuceneController_DateRangeCheck() { var doc = new Document(); doc.Add(new NumericField(fieldName, Field.Store.YES, true).SetLongValue(long.Parse(date.ToString(Constants.DateTimeFormat)))); - _luceneController.Add(doc); + this._luceneController.Add(doc); } - _luceneController.Commit(); + this._luceneController.Commit(); var futureTime = DateTime.Now.AddMinutes(1).ToString(Constants.DateTimeFormat); var query = NumericRangeQuery.NewLongRange(fieldName, long.Parse(futureTime), long.Parse(futureTime), true, true); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = query })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = query })); Assert.AreEqual(0, hits.Results.Count()); query = NumericRangeQuery.NewLongRange(fieldName, long.Parse(DateTime.Now.AddDays(-1).ToString(Constants.DateTimeFormat)), long.Parse(DateTime.Now.ToString(Constants.DateTimeFormat)), true, true); - hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = query })); + hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = query })); Assert.AreEqual(1, hits.Results.Count()); query = NumericRangeQuery.NewLongRange(fieldName, long.Parse(DateTime.Now.AddDays(-368).ToString(Constants.DateTimeFormat)), long.Parse(DateTime.Now.ToString(Constants.DateTimeFormat)), true, true); - hits = _luceneController.Search(CreateSearchContext(new LuceneQuery {Query = query})); + hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery {Query = query})); Assert.AreEqual(2, hits.Results.Count()); } [Test] public void LuceneController_Search_Throws_On_Null_LuceneQuery() { - Assert.Throws(() => _luceneController.Search(CreateSearchContext(null))); + Assert.Throws(() => this._luceneController.Search(this.CreateSearchContext(null))); } [Test] public void LuceneController_Search_Throws_On_Null_Query() { - Assert.Throws(() => _luceneController.Search(CreateSearchContext(new LuceneQuery()))); + Assert.Throws(() => this._luceneController.Search(this.CreateSearchContext(new LuceneQuery()))); } [Test] public void LuceneController_Search_Throws_On_Zero_PageSize() { - Assert.Throws(() => _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = new BooleanQuery(), PageSize = 0 }))); + Assert.Throws(() => this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = new BooleanQuery(), PageSize = 0 }))); } [Test] public void LuceneController_Search_Throws_On_Zero_PageIndex() { - Assert.Throws(() => _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = new BooleanQuery(), PageIndex = 0 }))); + Assert.Throws(() => this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = new BooleanQuery(), PageIndex = 0 }))); } [Test] @@ -468,7 +468,7 @@ public void LuceneController_Search_Throws_On_Zero_PageIndex() [TestCase(ValidCustomAnalyzer)] public void LuceneController_Search_With_Chinese_Chars_And_Custom_Analyzer(string customAlalyzer = "") { - _mockHostController.Setup(c => c.GetString(Constants.SearchCustomAnalyzer, It.IsAny())).Returns(customAlalyzer); + this._mockHostController.Setup(c => c.GetString(Constants.SearchCustomAnalyzer, It.IsAny())).Returns(customAlalyzer); //Arrange const string fieldName = "content"; const string fieldValue = Line_Chinese; @@ -478,16 +478,16 @@ public void LuceneController_Search_With_Chinese_Chars_And_Custom_Analyzer(strin var doc = new Document(); doc.Add(field); - _luceneController.Add(doc); - _luceneController.Commit(); + this._luceneController.Add(doc); + this._luceneController.Commit(); - var analyzer = _luceneController.GetCustomAnalyzer() ?? new SearchQueryAnalyzer(true); + var analyzer = this._luceneController.GetCustomAnalyzer() ?? new SearchQueryAnalyzer(true); var keywordQuery = new BooleanQuery(); var parserContent = new QueryParser(Constants.LuceneVersion, fieldName, analyzer); var parsedQueryContent = parserContent.Parse(SearchKeyword_Chinese); keywordQuery.Add(parsedQueryContent, Occur.SHOULD); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = keywordQuery })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = keywordQuery })); //Assert if (customAlalyzer == ValidCustomAnalyzer) @@ -507,7 +507,7 @@ public void LuceneController_Search_With_Chinese_Chars_And_Custom_Analyzer(strin [TestCase(ValidCustomAnalyzer)] public void LuceneController_Search_With_English_Chars_And_Custom_Analyzer(string customAlalyzer = "") { - _mockHostController.Setup(c => c.GetString(Constants.SearchCustomAnalyzer, It.IsAny())).Returns(customAlalyzer); + this._mockHostController.Setup(c => c.GetString(Constants.SearchCustomAnalyzer, It.IsAny())).Returns(customAlalyzer); //Arrange const string fieldName = "content"; const string fieldValue = Line1; @@ -517,16 +517,16 @@ public void LuceneController_Search_With_English_Chars_And_Custom_Analyzer(strin var doc = new Document(); doc.Add(field); - _luceneController.Add(doc); - _luceneController.Commit(); + this._luceneController.Add(doc); + this._luceneController.Commit(); - var analyzer = _luceneController.GetCustomAnalyzer() ?? new SearchQueryAnalyzer(true); + var analyzer = this._luceneController.GetCustomAnalyzer() ?? new SearchQueryAnalyzer(true); var keywordQuery = new BooleanQuery(); var parserContent = new QueryParser(Constants.LuceneVersion, fieldName, analyzer); var parsedQueryContent = parserContent.Parse(SearchKeyword_Line1); keywordQuery.Add(parsedQueryContent, Occur.SHOULD); - var hits = _luceneController.Search(CreateSearchContext(new LuceneQuery { Query = keywordQuery })); + var hits = this._luceneController.Search(this.CreateSearchContext(new LuceneQuery { Query = keywordQuery })); //Assert Assert.AreEqual(1, hits.Results.Count()); @@ -547,11 +547,11 @@ public void LuceneController_Search_Single_FuzzyQuery() }; const string keyword = "wuzza"; - AddLinesAsSearchDocs(docs); + this.AddLinesAsSearchDocs(docs); //Act var luceneQuery = new LuceneQuery { Query = new FuzzyQuery(new Term(Constants.ContentTag, keyword)) }; - var previews = _luceneController.Search(CreateSearchContext(luceneQuery)); + var previews = this._luceneController.Search(this.CreateSearchContext(luceneQuery)); //Assert Assert.AreEqual(2, previews.Results.Count()); @@ -573,7 +573,7 @@ public void LuceneController_Search_Double_FuzzyQuery() "homy" }; - AddLinesAsSearchDocs(docs); + this.AddLinesAsSearchDocs(docs); //Act var finalQuery = new BooleanQuery(); @@ -583,7 +583,7 @@ public void LuceneController_Search_Double_FuzzyQuery() } var luceneQuery = new LuceneQuery { Query = finalQuery }; - var previews = _luceneController.Search(CreateSearchContext(luceneQuery)); + var previews = this._luceneController.Search(this.CreateSearchContext(luceneQuery)); //Assert Assert.AreEqual(3, previews.Results.Count()); @@ -594,7 +594,7 @@ public void LuceneController_Search_Double_FuzzyQuery() [Test] public void LuceneController_Throws_SearchIndexEmptyException_WhenNoDataInSearch() { - Assert.Throws(() => { var r = _luceneController.GetSearcher(); }); + Assert.Throws(() => { var r = this._luceneController.GetSearcher(); }); } [Test] @@ -608,13 +608,13 @@ public void LuceneController_ReaderNotChangedBeforeTimeSpanElapsed() //Add first numeric field var doc1 = new Document(); doc1.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(1)); - _luceneController.Add(doc1); - _luceneController.Commit(); + this._luceneController.Add(doc1); + this._luceneController.Commit(); - var reader = _luceneController.GetSearcher(); - Thread.Sleep(TimeSpan.FromSeconds(_readerStaleTimeSpan / 2)); + var reader = this._luceneController.GetSearcher(); + Thread.Sleep(TimeSpan.FromSeconds(this._readerStaleTimeSpan / 2)); - Assert.AreSame(reader, _luceneController.GetSearcher()); + Assert.AreSame(reader, this._luceneController.GetSearcher()); } [Test] @@ -628,13 +628,13 @@ public void LuceneController_ReaderNotChangedIfNoIndexUpdated() //Add first numeric field var doc1 = new Document(); doc1.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(1)); - _luceneController.Add(doc1); - _luceneController.Commit(); + this._luceneController.Add(doc1); + this._luceneController.Commit(); - var reader = _luceneController.GetSearcher(); - Thread.Sleep(TimeSpan.FromSeconds(_readerStaleTimeSpan * 1.1)); + var reader = this._luceneController.GetSearcher(); + Thread.Sleep(TimeSpan.FromSeconds(this._readerStaleTimeSpan * 1.1)); - Assert.AreSame(reader, _luceneController.GetSearcher()); + Assert.AreSame(reader, this._luceneController.GetSearcher()); } [Test] @@ -648,21 +648,21 @@ public void LuceneController_ReaderIsChangedWhenIndexIsUpdatedAndTimeIsElapsed() //Add first numeric field var doc1 = new Document(); doc1.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(1)); - _luceneController.Add(doc1); - _luceneController.Commit(); + this._luceneController.Add(doc1); + this._luceneController.Commit(); - var reader = _luceneController.GetSearcher(); - Thread.Sleep(TimeSpan.FromSeconds(_readerStaleTimeSpan * 1.1)); + var reader = this._luceneController.GetSearcher(); + Thread.Sleep(TimeSpan.FromSeconds(this._readerStaleTimeSpan * 1.1)); //Add second numeric field var doc2 = new Document(); doc2.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(2)); - _luceneController.Add(doc2); + this._luceneController.Add(doc2); //var lastAcccess = Directory.GetLastWriteTime(_luceneController.IndexFolder); //Directory.SetLastWriteTime(_luceneController.IndexFolder, lastAcccess + TimeSpan.FromSeconds(1)); - Assert.AreNotSame(reader, _luceneController.GetSearcher()); + Assert.AreNotSame(reader, this._luceneController.GetSearcher()); } #endregion @@ -686,7 +686,7 @@ public void LuceneController_LockFileWhenExistsDoesNotCauseProblemForFirstIContr //Assert Assert.True(File.Exists(lockFile)); - Assert.DoesNotThrow(() => _luceneController.Add(doc1)); + Assert.DoesNotThrow(() => this._luceneController.Add(doc1)); } [Test] @@ -699,7 +699,7 @@ public void LuceneController_LockFileCanBeObtainedByOnlySingleController() //Act var doc1 = new Document(); doc1.Add(new NumericField(fieldName, Field.Store.YES, true).SetIntValue(1)); - _luceneController.Add(doc1); + this._luceneController.Add(doc1); // create another controller then try to access the already locked index by the first one var secondController = new LuceneControllerImpl(); @@ -725,10 +725,10 @@ private int AddTestDocs() var doc = new Document(); // format to "D#" because LengthFilter will not consider words of length < 3 or > 255 characters in length (defaults) doc.Add(new Field(ContentFieldName, i.ToString("D" + Constants.DefaultMinLen), Field.Store.YES, Field.Index.ANALYZED)); - _luceneController.Add(doc); + this._luceneController.Add(doc); } - _luceneController.Commit(); + this._luceneController.Commit(); return TotalTestDocs2Create; } @@ -740,11 +740,11 @@ private int DeleteTestDocs() for (var i = 1; i < TotalTestDocs2Create; i += 2) { // format to "D#" because LengthFilter will not consider the defaults for these values - _luceneController.Delete(new TermQuery(new Term(ContentFieldName, i.ToString("D" + Constants.DefaultMinLen)))); + this._luceneController.Delete(new TermQuery(new Term(ContentFieldName, i.ToString("D" + Constants.DefaultMinLen)))); delCount++; } - _luceneController.Commit(); + this._luceneController.Commit(); return delCount; } @@ -752,44 +752,44 @@ private int DeleteTestDocs() [Test] public void LuceneController_DocumentMaxAndCountAreCorrect() { - AddTestDocs(); + this.AddTestDocs(); - Assert.AreEqual(TotalTestDocs2Create, _luceneController.MaxDocsCount()); - Assert.AreEqual(TotalTestDocs2Create, _luceneController.SearchbleDocsCount()); + Assert.AreEqual(TotalTestDocs2Create, this._luceneController.MaxDocsCount()); + Assert.AreEqual(TotalTestDocs2Create, this._luceneController.SearchbleDocsCount()); } [Test] public void LuceneController_TestDeleteBeforeOptimize() { //Arrange - AddTestDocs(); - var delCount = DeleteTestDocs(); + this.AddTestDocs(); + var delCount = this.DeleteTestDocs(); - Assert.IsTrue(_luceneController.HasDeletions()); - Assert.AreEqual(TotalTestDocs2Create, _luceneController.MaxDocsCount()); - Assert.AreEqual(TotalTestDocs2Create - delCount, _luceneController.SearchbleDocsCount()); + Assert.IsTrue(this._luceneController.HasDeletions()); + Assert.AreEqual(TotalTestDocs2Create, this._luceneController.MaxDocsCount()); + Assert.AreEqual(TotalTestDocs2Create - delCount, this._luceneController.SearchbleDocsCount()); } [Test] public void LuceneController_TestDeleteAfterOptimize() { //Arrange - AddTestDocs(); - var delCount = DeleteTestDocs(); + this.AddTestDocs(); + var delCount = this.DeleteTestDocs(); - _luceneController.OptimizeSearchIndex(true); + this._luceneController.OptimizeSearchIndex(true); - Assert.AreEqual(TotalTestDocs2Create, _luceneController.MaxDocsCount()); - Assert.AreEqual(TotalTestDocs2Create - delCount, _luceneController.SearchbleDocsCount()); + Assert.AreEqual(TotalTestDocs2Create, this._luceneController.MaxDocsCount()); + Assert.AreEqual(TotalTestDocs2Create - delCount, this._luceneController.SearchbleDocsCount()); } [Test] public void LuceneController_TestGetSearchStatistics() { //Arrange - var addedCount = AddTestDocs(); - var delCount = DeleteTestDocs(); - var statistics = _luceneController.GetSearchStatistics(); + var addedCount = this.AddTestDocs(); + var delCount = this.DeleteTestDocs(); + var statistics = this._luceneController.GetSearchStatistics(); Assert.IsNotNull(statistics); Assert.AreEqual(statistics.TotalDeletedDocuments, delCount); @@ -803,18 +803,18 @@ public void LuceneController_TestGetSearchStatistics() public void SearchController_LuceneControllerReaderIsNotNullWhenWriterIsNull() { //Arrange - AddTestDocs(); - CreateNewLuceneControllerInstance(); // to force a new reader for the next assertion + this.AddTestDocs(); + this.CreateNewLuceneControllerInstance(); // to force a new reader for the next assertion //Assert - Assert.IsNotNull(_luceneController.GetSearcher()); + Assert.IsNotNull(this._luceneController.GetSearcher()); } #endregion private LuceneSearchContext CreateSearchContext(LuceneQuery luceneQuery) { - return new LuceneSearchContext {LuceneQuery = luceneQuery, SearchQuery = _mockSearchQuery.Object }; + return new LuceneSearchContext {LuceneQuery = luceneQuery, SearchQuery = this._mockSearchQuery.Object }; } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchControllerTests.cs index 94e48bcb396..f183d356a90 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchControllerTests.cs @@ -152,36 +152,36 @@ public void SetUp() ComponentFactory.Container = new SimpleContainer(); MockComponentProvider.ResetContainer(); - _mockDataProvider = MockComponentProvider.CreateDataProvider(); - _mockLocaleController = MockComponentProvider.CreateLocaleController(); - _mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); + this._mockDataProvider = MockComponentProvider.CreateDataProvider(); + this._mockLocaleController = MockComponentProvider.CreateLocaleController(); + this._mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); - _mockUserController = new Mock(); - _mockHostController = new Mock(); - _mockSearchHelper = new Mock(); + this._mockUserController = new Mock(); + this._mockHostController = new Mock(); + this._mockSearchHelper = new Mock(); - SetupDataProvider(); - SetupHostController(); - SetupSearchHelper(); - SetupLocaleController(); + this.SetupDataProvider(); + this.SetupHostController(); + this.SetupSearchHelper(); + this.SetupLocaleController(); - _mockUserController.Setup(c => c.GetUserById(It.IsAny(), It.IsAny())).Returns((int portalId, int userId) => GetUserByIdCallback(portalId, userId)); - UserController.SetTestableInstance(_mockUserController.Object); + this._mockUserController.Setup(c => c.GetUserById(It.IsAny(), It.IsAny())).Returns((int portalId, int userId) => this.GetUserByIdCallback(portalId, userId)); + UserController.SetTestableInstance(this._mockUserController.Object); - CreateNewLuceneControllerInstance(); + this.CreateNewLuceneControllerInstance(); } [TearDown] public void TearDown() { - _luceneController.Dispose(); - DeleteIndexFolder(); + this._luceneController.Dispose(); + this.DeleteIndexFolder(); InternalSearchController.ClearInstance(); UserController.ClearInstance(); SearchHelper.ClearInstance(); LuceneController.ClearInstance(); - _luceneController = null; + this._luceneController = null; } #endregion @@ -191,69 +191,69 @@ public void TearDown() private void CreateNewLuceneControllerInstance(bool reCreate = false) { InternalSearchController.SetTestableInstance(new InternalSearchControllerImpl()); - _internalSearchController = InternalSearchController.Instance; - _searchController = new SearchControllerImpl(); + this._internalSearchController = InternalSearchController.Instance; + this._searchController = new SearchControllerImpl(); if (!reCreate) { - DeleteIndexFolder(); + this.DeleteIndexFolder(); - if (_luceneController != null) + if (this._luceneController != null) { LuceneController.ClearInstance(); - _luceneController.Dispose(); + this._luceneController.Dispose(); } - _luceneController = new LuceneControllerImpl(); - LuceneController.SetTestableInstance(_luceneController); + this._luceneController = new LuceneControllerImpl(); + LuceneController.SetTestableInstance(this._luceneController); } } private void SetupHostController() { - _mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns(SearchIndexFolder); - _mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())).Returns(_readerStaleTimeSpan); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTitleBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTagBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTagBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchKeywordBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchDescriptionBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchAuthorBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns(Constants.DefaultMinLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns(Constants.DefaultMaxLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchRetryTimesKey, It.IsAny())).Returns(DefaultSearchRetryTimes); - HostController.RegisterInstance(_mockHostController.Object); + this._mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns(SearchIndexFolder); + this._mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())).Returns(this._readerStaleTimeSpan); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTitleBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTagBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchTagBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchKeywordBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchDescriptionBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns(Constants.DefaultSearchAuthorBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns(Constants.DefaultMinLen); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns(Constants.DefaultMaxLen); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchRetryTimesKey, It.IsAny())).Returns(DefaultSearchRetryTimes); + HostController.RegisterInstance(this._mockHostController.Object); } private void SetupLocaleController() { - _mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale { LanguageId = -1, Code = string.Empty }); - _mockLocaleController.Setup(l => l.GetLocale(CultureEnUs)).Returns(new Locale { LanguageId = LanguageIdEnUs, Code = CultureEnUs }); - _mockLocaleController.Setup(l => l.GetLocale(CultureEnCa)).Returns(new Locale { LanguageId = LanguageIdEnFr, Code = CultureEnCa }); - _mockLocaleController.Setup(l => l.GetLocale(CultureItIt)).Returns(new Locale { LanguageId = LanguageIdItIt, Code = CultureItIt }); - _mockLocaleController.Setup(l => l.GetLocale(CultureEsEs)).Returns(new Locale { LanguageId = LanguageIdEsEs, Code = CultureEsEs }); + this._mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale { LanguageId = -1, Code = string.Empty }); + this._mockLocaleController.Setup(l => l.GetLocale(CultureEnUs)).Returns(new Locale { LanguageId = LanguageIdEnUs, Code = CultureEnUs }); + this._mockLocaleController.Setup(l => l.GetLocale(CultureEnCa)).Returns(new Locale { LanguageId = LanguageIdEnFr, Code = CultureEnCa }); + this._mockLocaleController.Setup(l => l.GetLocale(CultureItIt)).Returns(new Locale { LanguageId = LanguageIdItIt, Code = CultureItIt }); + this._mockLocaleController.Setup(l => l.GetLocale(CultureEsEs)).Returns(new Locale { LanguageId = LanguageIdEsEs, Code = CultureEsEs }); - _mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale { LanguageId = LanguageIdEnUs, Code = CultureEnUs }); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnUs)).Returns(new Locale { LanguageId = LanguageIdEnUs, Code = CultureEnUs }); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnFr)).Returns(new Locale { LanguageId = LanguageIdEnFr, Code = CultureEnCa }); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdItIt)).Returns(new Locale { LanguageId = LanguageIdItIt, Code = CultureItIt }); - _mockLocaleController.Setup(l => l.GetLocale(LanguageIdEsEs)).Returns(new Locale { LanguageId = LanguageIdEsEs, Code = CultureEsEs }); + this._mockLocaleController.Setup(l => l.GetLocale(It.IsAny())).Returns(new Locale { LanguageId = LanguageIdEnUs, Code = CultureEnUs }); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnUs)).Returns(new Locale { LanguageId = LanguageIdEnUs, Code = CultureEnUs }); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdEnFr)).Returns(new Locale { LanguageId = LanguageIdEnFr, Code = CultureEnCa }); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdItIt)).Returns(new Locale { LanguageId = LanguageIdItIt, Code = CultureItIt }); + this._mockLocaleController.Setup(l => l.GetLocale(LanguageIdEsEs)).Returns(new Locale { LanguageId = LanguageIdEsEs, Code = CultureEsEs }); } private void SetupDataProvider() { //Standard DataProvider Path for Logging - _mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); DataTableReader searchTypes = null; - _mockDataProvider.Setup(ds => ds.GetAllSearchTypes()) - .Callback(() => searchTypes = GetAllSearchTypes().CreateDataReader()) + this._mockDataProvider.Setup(ds => ds.GetAllSearchTypes()) + .Callback(() => searchTypes = this.GetAllSearchTypes().CreateDataReader()) .Returns(() => searchTypes); - _mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); + this._mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(this.GetPortalsCallBack); } private IDataReader GetPortalsCallBack(string culture) { - return GetPortalCallBack(PortalId0, CultureEnUs); + return this.GetPortalCallBack(PortalId0, CultureEnUs); } private IDataReader GetPortalCallBack(int portalId, string culture) @@ -284,27 +284,27 @@ private IDataReader GetPortalCallBack(int portalId, string culture) private void SetupSearchHelper() { - _mockSearchHelper.Setup(c => c.GetSearchMinMaxLength()).Returns(new Tuple(Constants.DefaultMinLen, Constants.DefaultMaxLen)); - _mockSearchHelper.Setup(c => c.GetSynonyms(It.IsAny(), It.IsAny(), It.IsAny())).Returns(GetSynonymsCallBack); - _mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns((string name) => new SearchType { SearchTypeId = 0, SearchTypeName = name }); - _mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns(GetSearchTypeByNameCallback); - _mockSearchHelper.Setup(x => x.GetSearchTypes()).Returns(GetSearchTypes()); - _mockSearchHelper.Setup(x => x.GetSearchStopWords(It.IsAny(), It.IsAny())).Returns(new SearchStopWords()); - _mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEsEs)).Returns( + this._mockSearchHelper.Setup(c => c.GetSearchMinMaxLength()).Returns(new Tuple(Constants.DefaultMinLen, Constants.DefaultMaxLen)); + this._mockSearchHelper.Setup(c => c.GetSynonyms(It.IsAny(), It.IsAny(), It.IsAny())).Returns(this.GetSynonymsCallBack); + this._mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns((string name) => new SearchType { SearchTypeId = 0, SearchTypeName = name }); + this._mockSearchHelper.Setup(x => x.GetSearchTypeByName(It.IsAny())).Returns(this.GetSearchTypeByNameCallback); + this._mockSearchHelper.Setup(x => x.GetSearchTypes()).Returns(this.GetSearchTypes()); + this._mockSearchHelper.Setup(x => x.GetSearchStopWords(It.IsAny(), It.IsAny())).Returns(new SearchStopWords()); + this._mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEsEs)).Returns( new SearchStopWords { PortalId = 0, CultureCode = CultureEsEs, StopWords = "los,de,el", }); - _mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEnUs)).Returns( + this._mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEnUs)).Returns( new SearchStopWords { PortalId = 0, CultureCode = CultureEnUs, StopWords = "the,over", }); - _mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEnCa)).Returns( + this._mockSearchHelper.Setup(x => x.GetSearchStopWords(0, CultureEnCa)).Returns( new SearchStopWords { PortalId = 0, @@ -312,9 +312,9 @@ private void SetupSearchHelper() StopWords = "the,over", }); - _mockSearchHelper.Setup(x => x.RephraseSearchText(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new SearchHelperImpl().RephraseSearchText); - _mockSearchHelper.Setup(x => x.StripTagsNoAttributes(It.IsAny(), It.IsAny())).Returns((string html, bool retainSpace) => html); - SearchHelper.SetTestableInstance(_mockSearchHelper.Object); + this._mockSearchHelper.Setup(x => x.RephraseSearchText(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new SearchHelperImpl().RephraseSearchText); + this._mockSearchHelper.Setup(x => x.StripTagsNoAttributes(It.IsAny(), It.IsAny())).Returns((string html, bool retainSpace) => html); + SearchHelper.SetTestableInstance(this._mockSearchHelper.Object); } private SearchType GetSearchTypeByNameCallback(string searchTypeName) @@ -462,15 +462,15 @@ private IEnumerable GetSearchDocsForCustomBoost(int searchTypeId /// Number of dcuments added private int AddStandardSearchDocs(int searchTypeId = ModuleSearchTypeId) { - var docs = GetStandardSearchDocs(searchTypeId).ToArray(); - _internalSearchController.AddSearchDocuments(docs); + var docs = this.GetStandardSearchDocs(searchTypeId).ToArray(); + this._internalSearchController.AddSearchDocuments(docs); return docs.Length; } private int AddSearchDocsForCustomBoost(int searchTypeId = ModuleSearchTypeId) { - var docs = GetSearchDocsForCustomBoost(searchTypeId).ToArray(); - _internalSearchController.AddSearchDocuments(docs); + var docs = this.GetSearchDocsForCustomBoost(searchTypeId).ToArray(); + this._internalSearchController.AddSearchDocuments(docs); return docs.Length; } @@ -525,7 +525,7 @@ private int AddDocumentsWithNumericKeys(int searchTypeId = OtherSearchTypeId) var docs = new List() {doc1, doc2, doc3, doc4, doc5}; - _internalSearchController.AddSearchDocuments(docs); + this._internalSearchController.AddSearchDocuments(docs); return docs.Count; } @@ -581,7 +581,7 @@ private int AddDocumentsWithKeywords(int searchTypeId = OtherSearchTypeId) var docs = new List() { doc1, doc2, doc3, doc4, doc5 }; - _internalSearchController.AddSearchDocuments(docs); + this._internalSearchController.AddSearchDocuments(docs); return docs.Count; } @@ -599,7 +599,7 @@ private int AddDocuments(IList titles, string body, int searchTypeId = PortalId = PortalId12 })) { - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); count++; } @@ -619,7 +619,7 @@ private int AddDocumentsWithKeywords(IEnumerable keywords, string title, PortalId = PortalId12 })) { - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); count++; } @@ -631,7 +631,7 @@ private void AddLinesAsSearchDocs(IList lines, int searchTypeId = OtherS var now = DateTime.UtcNow - TimeSpan.FromSeconds(lines.Count()); var i = 0; - _internalSearchController.AddSearchDocuments( + this._internalSearchController.AddSearchDocuments( lines.Select(line => new SearchDocument { @@ -645,19 +645,19 @@ private void AddLinesAsSearchDocs(IList lines, int searchTypeId = OtherS private SearchResults SearchForKeyword(string keyword, int searchTypeId = OtherSearchTypeId, bool useWildcard = false, bool allowLeadingWildcard = false) { var query = new SearchQuery { KeyWords = keyword, SearchTypeIds = new[] { searchTypeId }, WildCardSearch = useWildcard, AllowLeadingWildcard = allowLeadingWildcard }; - return _searchController.SiteSearch(query); + return this._searchController.SiteSearch(query); } private SearchResults SearchForKeywordWithWildCard(string keyword, int searchTypeId = OtherSearchTypeId) { var query = new SearchQuery { KeyWords = keyword, SearchTypeIds = new[] { searchTypeId }, WildCardSearch = true }; - return _searchController.SiteSearch(query); + return this._searchController.SiteSearch(query); } private SearchResults SearchForKeywordInModule(string keyword, int searchTypeId = ModuleSearchTypeId) { var query = new SearchQuery { KeyWords = keyword, SearchTypeIds = new[] { searchTypeId } }; - return _searchController.SiteSearch(query); + return this._searchController.SiteSearch(query); } private string StipEllipses(string text) @@ -735,7 +735,7 @@ public void SearchController_Search_Throws_On_Null_Query() //Arrange //Act, Assert - Assert.Throws(() => _searchController.SiteSearch(null)); + Assert.Throws(() => this._searchController.SiteSearch(null)); } [Test] @@ -744,7 +744,7 @@ public void SearchController_Search_Throws_On_Empty_TypeId_Collection() //Arrange //Act, Assert - Assert.Throws(() => _searchController.SiteSearch(new SearchQuery { KeyWords = "word" })); + Assert.Throws(() => this._searchController.SiteSearch(new SearchQuery { KeyWords = "word" })); } [Test] @@ -754,7 +754,7 @@ public void SearchController_AddSearchDcoumet_Regex_Does_Not_Sleep_On_Bad_Text_D var document = new SearchDocument { UniqueKey = Guid.NewGuid().ToString(), Title = "< ExecuteWithTimeout( () => { - _internalSearchController.AddSearchDocument(document); + this._internalSearchController.AddSearchDocument(document); return false; }, TimeSpan.FromSeconds(1))); } @@ -783,9 +783,9 @@ public void SearchController_Added_Item_IsRetrieved() var doc = new SearchDocument { UniqueKey = "key01", Title = "Hello World", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; //Act - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); - var result = SearchForKeyword("hello"); + var result = this.SearchForKeyword("hello"); //Assert Assert.AreEqual(1, result.Results.Count); @@ -806,23 +806,23 @@ public void SearchController_EnsureIndexIsAppended_When_Index_Is_NotDeleted_InBe //Add first document var doc1 = new SearchDocument { Title = docs[0], UniqueKey = Guid.NewGuid().ToString(), SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); //first luceneQuery var query1 = new SearchQuery { KeyWords = "fox", SearchTypeIds = new List { OtherSearchTypeId } }; - var search1 = _searchController.SiteSearch(query1); + var search1 = this._searchController.SiteSearch(query1); //Assert Assert.AreEqual(1, search1.Results.Count); //Add second document var doc2 = new SearchDocument { Title = docs[1], UniqueKey = Guid.NewGuid().ToString(), SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; - _internalSearchController.AddSearchDocument(doc2); - CreateNewLuceneControllerInstance(); // to force a new reader for the next assertion + this._internalSearchController.AddSearchDocument(doc2); + this.CreateNewLuceneControllerInstance(); // to force a new reader for the next assertion //second luceneQuery var query2 = new SearchQuery { KeyWords = "fox", SearchTypeIds = new List { OtherSearchTypeId } }; - var search2 = _searchController.SiteSearch(query2); + var search2 = this._searchController.SiteSearch(query2); //Assert Assert.AreEqual(2, search2.Results.Count); @@ -840,10 +840,10 @@ public void SearchController_Getsearch_TwoTermsSearch() Line5 }; - AddLinesAsSearchDocs(docs); + this.AddLinesAsSearchDocs(docs); //Act - var search = SearchForKeyword("fox jumps"); + var search = this.SearchForKeyword("fox jumps"); //Assert Assert.AreEqual(docs.Length, search.Results.Count); @@ -863,10 +863,10 @@ public void SearchController_GetResult_TwoTermsSearch() Line5 }; - AddLinesAsSearchDocs(docs); + this.AddLinesAsSearchDocs(docs); //Act - var search = SearchForKeyword("fox jumps"); + var search = this.SearchForKeyword("fox jumps"); //Assert Assert.AreEqual(docs.Length, search.Results.Count); @@ -878,11 +878,11 @@ public void SearchController_GetResult_TwoTermsSearch() public void SearchController_GetResult_PortalIdSearch() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, PortalIds = new List { PortalId0 } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -892,11 +892,11 @@ public void SearchController_GetResult_PortalIdSearch() public void SearchController_GetResult_SearchTypeIdSearch() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -920,15 +920,15 @@ public void SearchController_SearchFindsAnalyzedVeryLongWords() ModuleId = 1, ModuleDefId = 1 }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); //Act var query = new SearchQuery { KeyWords = veryLongWord, SearchTypeIds = new List { ModuleSearchTypeId } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); - Assert.AreEqual("" + veryLongWord + "", StipEllipses(search.Results[0].Snippet).Trim()); + Assert.AreEqual("" + veryLongWord + "", this.StipEllipses(search.Results[0].Snippet).Trim()); } #endregion @@ -938,10 +938,10 @@ public void SearchController_SearchFindsAnalyzedVeryLongWords() public void SearchController_SecurityTrimmedTest_ReturnsNoResultsWhenHavingNoPermission() { //Arrange - AddStandardSearchDocs(DocumentSearchTypeId); + this.AddStandardSearchDocs(DocumentSearchTypeId); //Act - var result = SearchForKeyword("fox", DocumentSearchTypeId); + var result = this.SearchForKeyword("fox", DocumentSearchTypeId); //Assert // by default AuthorUserId = 0 which have no permission, so this passes @@ -959,7 +959,7 @@ private void SetupSecurityTrimmingDocs(int totalDocs, int searchType = DocumentS var docModifyTime = DateTime.UtcNow - TimeSpan.FromSeconds(totalDocs); for (var i = 0; i < totalDocs; i++) { - _internalSearchController.AddSearchDocument(new SearchDocument + this._internalSearchController.AddSearchDocument(new SearchDocument { AuthorUserId = i, Title = "Fox and Dog", @@ -978,7 +978,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1A //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -989,7 +989,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1A SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1004,7 +1004,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1B //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1015,7 +1015,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1B SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1030,7 +1030,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1C //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1041,7 +1041,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1C SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1056,7 +1056,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1D //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; // user should have access to some documnets here - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1067,7 +1067,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1D SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1082,7 +1082,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1E //Arrange const int maxDocs = 30; const int stype = TabSearchTypeId; // user should have access to all documnets here - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1093,7 +1093,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1E SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).Skip(1).ToArray(); //Assert @@ -1108,7 +1108,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1F //Arrange const int maxDocs = 100; const int stype = TabSearchTypeId; // user should have access to all documnets here - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1119,7 +1119,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage1F SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1134,7 +1134,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage2A //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1145,7 +1145,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage2A SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1160,7 +1160,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage2B //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1171,7 +1171,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage2B SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1186,7 +1186,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage2C //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var query = new SearchQuery @@ -1197,7 +1197,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage2C SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(query); + var result = this._searchController.SiteSearch(query); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1212,7 +1212,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage3A //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var queryPg3 = new SearchQuery @@ -1223,7 +1223,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage3A SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(queryPg3); + var result = this._searchController.SiteSearch(queryPg3); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1238,7 +1238,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage3B //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var queryPg3 = new SearchQuery @@ -1249,7 +1249,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage3B SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(queryPg3); + var result = this._searchController.SiteSearch(queryPg3); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1264,7 +1264,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage3C //Arrange const int maxDocs = 30; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var queryPg3 = new SearchQuery @@ -1275,7 +1275,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage3C SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(queryPg3); + var result = this._searchController.SiteSearch(queryPg3); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1290,7 +1290,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage5( //Arrange const int maxDocs = 100; const int stype = DocumentSearchTypeId; - SetupSecurityTrimmingDocs(maxDocs, stype); + this.SetupSecurityTrimmingDocs(maxDocs, stype); //Act var queryPg3 = new SearchQuery @@ -1301,7 +1301,7 @@ public void SearchController_SecurityTrimmedTest_ReturnsExpectedResultsForPage5( SearchTypeIds = new[] { stype } }; - var result = _searchController.SiteSearch(queryPg3); + var result = this._searchController.SiteSearch(queryPg3); var ids = result.Results.Select(doc => doc.AuthorUserId).ToArray(); //Assert @@ -1342,10 +1342,10 @@ public void SearchController_GetResult_Returns_Correct_SuppliedData_When_Optiona NumericKeys = numericKeys, Keywords = keywords }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); //run luceneQuery on common keyword between both the docs - var search = SearchForKeywordInModule("Title"); + var search = this.SearchForKeywordInModule("Title"); //Assert Assert.AreEqual(1, search.Results.Count); @@ -1386,9 +1386,9 @@ public void SearchController_GetResult_Returns_EmptyData_When_Optionals_Are_Not_ SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = modifiedDateTime, }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); - var search = SearchForKeyword("Title"); + var search = this.SearchForKeyword("Title"); //Assert - Assert.AreEqual(1, search.Results.Count); @@ -1421,10 +1421,10 @@ public void SearchController_GetsHighlightedDesc() Line4, Line5 }; - AddLinesAsSearchDocs(docs); + this.AddLinesAsSearchDocs(docs); //Act - var search = SearchForKeyword("fox"); + var search = this.SearchForKeyword("fox"); //Assert Assert.AreEqual(docs.Length, search.Results.Count); @@ -1435,7 +1435,7 @@ public void SearchController_GetsHighlightedDesc() "gold fox jumped over the lazy black dog", "e red fox jumped over the lazy dark gray dog", "quick fox jumps over the white dog - los de el Espana" - }.SequenceEqual(search.Results.Select(r => StipEllipses(r.Snippet))), + }.SequenceEqual(search.Results.Select(r => this.StipEllipses(r.Snippet))), "Found: " + string.Join(Environment.NewLine, search.Results.Select(r => r.Snippet))); } @@ -1461,7 +1461,7 @@ public void SearchController_CorrectDocumentCultureIsUsedAtIndexing() title = Line3; } - _internalSearchController.AddSearchDocument( + this._internalSearchController.AddSearchDocument( new SearchDocument { Title = title, @@ -1470,9 +1470,9 @@ public void SearchController_CorrectDocumentCultureIsUsedAtIndexing() ModifiedTimeUtc = DateTime.UtcNow, CultureCode = cultureCode }); - _internalSearchController.Commit(); + this._internalSearchController.Commit(); - var searches = SearchForKeyword(searchWord); + var searches = this.SearchForKeyword(searchWord); //Assert Assert.AreEqual(1, searches.TotalHits); @@ -1487,11 +1487,11 @@ public void SearchController_CorrectDocumentCultureIsUsedAtIndexing() public void SearchController_GetResult_TimeRangeSearch_Ignores_When_Only_BeginDate_Specified() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, BeginModifiedTimeUtc = DateTime.Now }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1501,7 +1501,7 @@ public void SearchController_GetResult_TimeRangeSearch_Ignores_When_Only_BeginDa public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_When_BeginDate_Is_After_End_Date() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -1510,7 +1510,7 @@ public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_W BeginModifiedTimeUtc = DateTime.Now, EndModifiedTimeUtc = DateTime.Now.AddSeconds(-1) }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1520,32 +1520,32 @@ public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_W public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_When_Both_Dates_Specified() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); var stypeIds = new List { ModuleSearchTypeId }; var utcNow = DateTime.UtcNow.AddDays(1); const SortFields sfield = SortFields.LastModified; //Act and Assert - just a bit later var query = new SearchQuery { SearchTypeIds = stypeIds, SortField = sfield, BeginModifiedTimeUtc = utcNow.AddSeconds(1), EndModifiedTimeUtc = utcNow.AddDays(1) }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); Assert.AreEqual(0, search.Results.Count); //Act and Assert - 10 day query = new SearchQuery { SearchTypeIds = stypeIds, SortField = sfield, BeginModifiedTimeUtc = utcNow.AddDays(-10), EndModifiedTimeUtc = utcNow.AddDays(1) }; - search = _searchController.SiteSearch(query); + search = this._searchController.SiteSearch(query); Assert.AreEqual(1, search.Results.Count); Assert.AreEqual(Line5, search.Results[0].Title); //Act and Assert - 1 year or so query = new SearchQuery { SearchTypeIds = stypeIds, SortField = sfield, BeginModifiedTimeUtc = utcNow.AddDays(-368), EndModifiedTimeUtc = utcNow.AddDays(1) }; - search = _searchController.SiteSearch(query); + search = this._searchController.SiteSearch(query); Assert.AreEqual(2, search.Results.Count); Assert.AreEqual(Line5, search.Results[0].Title); Assert.AreEqual(Line4, search.Results[1].Title); //Act and Assert - 2 years or so query = new SearchQuery { SearchTypeIds = stypeIds, SortField = sfield, BeginModifiedTimeUtc = utcNow.AddDays(-800), EndModifiedTimeUtc = utcNow.AddDays(1) }; - search = _searchController.SiteSearch(query); + search = this._searchController.SiteSearch(query); Assert.AreEqual(3, search.Results.Count); Assert.AreEqual(Line5, search.Results[0].Title); Assert.AreEqual(Line4, search.Results[1].Title); @@ -1553,7 +1553,7 @@ public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_W //Act and Assert - 3 years or so query = new SearchQuery { SearchTypeIds = stypeIds, SortField = sfield, BeginModifiedTimeUtc = utcNow.AddDays(-1200), EndModifiedTimeUtc = utcNow.AddDays(1) }; - search = _searchController.SiteSearch(query); + search = this._searchController.SiteSearch(query); Assert.AreEqual(4, search.Results.Count); Assert.AreEqual(Line5, search.Results[0].Title); Assert.AreEqual(Line4, search.Results[1].Title); @@ -1562,7 +1562,7 @@ public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_W //Act and Assert - 2 to 3 years or so query = new SearchQuery { SearchTypeIds = stypeIds, SortField = sfield, BeginModifiedTimeUtc = utcNow.AddDays(-1200), EndModifiedTimeUtc = utcNow.AddDays(-800) }; - search = _searchController.SiteSearch(query); + search = this._searchController.SiteSearch(query); Assert.AreEqual(1, search.Results.Count); Assert.AreEqual(Line2, search.Results[0].Title); } @@ -1575,11 +1575,11 @@ public void SearchController_GetResult_TimeRangeSearch_Resturns_Scoped_Results_W public void SearchController_GetResult_TagSearch_Single_Tag_Returns_Single_Result() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, Tags = new List { Tag0 } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -1589,11 +1589,11 @@ public void SearchController_GetResult_TagSearch_Single_Tag_Returns_Single_Resul public void SearchController_GetResult_TagSearch_Single_Tag_With_Space_Returns_Single_Result() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, Tags = new List { Tag0WithSpace } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -1604,11 +1604,11 @@ public void SearchController_GetResult_TagSearch_Single_Tag_With_Space_Returns_S public void SearchController_GetResult_TagSearch_Lowercase_Search_Returns_PropercaseTag_Single_Result() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, Tags = new List { TagNeutral.ToLowerInvariant() } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -1618,11 +1618,11 @@ public void SearchController_GetResult_TagSearch_Lowercase_Search_Returns_Proper public void SearchController_GetResult_TagSearch_Single_Tag_Returns_Two_Results() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, Tags = new List { Tag1 } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(2, search.Results.Count); @@ -1636,11 +1636,11 @@ public void SearchController_GetResult_TagSearch_Single_Tag_Returns_Two_Results( public void SearchController_GetResult_TagSearch_Two_Tags_Returns_Nothing() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, Tags = new List { Tag0, Tag4 } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(0, search.Results.Count); @@ -1650,11 +1650,11 @@ public void SearchController_GetResult_TagSearch_Two_Tags_Returns_Nothing() public void SearchController_GetResult_TagSearch_Two_Tags_Returns_Single_Results() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery { SearchTypeIds = new List { ModuleSearchTypeId }, Tags = new List { Tag1, Tag2 } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -1670,9 +1670,9 @@ public void SearchController_GetResult_TagSearch_With_Vowel_Tags_Returns_Data() var doc1 = new SearchDocument { UniqueKey = "key01", Title = keyword, SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Tags = new List { TagTootsie } }; //Act - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); var query = new SearchQuery { KeyWords = keyword, SearchTypeIds = new[] { OtherSearchTypeId }, Tags = new List { TagTootsie } }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -1693,7 +1693,7 @@ public void SearchController_GetResult_Throws_When_CustomNumericField_Is_Specifi SortField = SortFields.CustomNumericField }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } [Test] @@ -1707,7 +1707,7 @@ public void SearchController_GetResult_Throws_When_CustomStringField_Is_Specifie SortField = SortFields.CustomStringField }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } [Test] @@ -1721,7 +1721,7 @@ public void SearchController_GetResult_Throws_When_NumericKey_Is_Specified_And_C SortField = SortFields.NumericKey }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } [Test] @@ -1735,14 +1735,14 @@ public void SearchController_GetResult_Throws_When_Keyword_Is_Specified_And_Cust SortField = SortFields.Keyword }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } [Test] public void SearchController_GetResult_Sorty_By_Date_Returns_Latest_Docs_First() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -1750,7 +1750,7 @@ public void SearchController_GetResult_Sorty_By_Date_Returns_Latest_Docs_First() SearchTypeIds = new List { ModuleSearchTypeId }, SortField = SortFields.LastModified }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count, "Found: " + string.Join(Environment.NewLine, search.Results.Select(r => r.Title))); @@ -1768,7 +1768,7 @@ public void SearchController_GetResult_Sorty_By_Date_Returns_Latest_Docs_First() public void SearchController_GetResult_Sorty_By_Date_Ascending_Returns_Earliest_Docs_First() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -1777,7 +1777,7 @@ public void SearchController_GetResult_Sorty_By_Date_Ascending_Returns_Earliest_ SortField = SortFields.LastModified, SortDirection = SortDirections.Ascending }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1793,7 +1793,7 @@ public void SearchController_GetResult_Sorty_By_Date_Ascending_Returns_Earliest_ [Test] public void SearchController_GetResult_Sorty_By_NumericKeys_Ascending_Returns_Smaller_Numers_First() { - var added = AddDocumentsWithNumericKeys(); + var added = this.AddDocumentsWithNumericKeys(); //Act var query = new SearchQuery @@ -1804,7 +1804,7 @@ public void SearchController_GetResult_Sorty_By_NumericKeys_Ascending_Returns_Sm SortDirection = SortDirections.Ascending, CustomSortField = NumericKey1 }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1815,7 +1815,7 @@ public void SearchController_GetResult_Sorty_By_NumericKeys_Ascending_Returns_Sm [Test] public void SearchController_GetResult_Sorty_By_NumericKeys_Descending_Returns_Bigger_Numbers_First() { - var added = AddDocumentsWithNumericKeys(); + var added = this.AddDocumentsWithNumericKeys(); //Act var query = new SearchQuery @@ -1826,7 +1826,7 @@ public void SearchController_GetResult_Sorty_By_NumericKeys_Descending_Returns_B SortDirection = SortDirections.Descending, CustomSortField = NumericKey1 }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1839,7 +1839,7 @@ public void SearchController_GetResult_Sorty_By_Title_Ascending_Returns_Alphabet { var titles = new List {"cat", "ant", "dog", "antelope", "zebra", "yellow", " "}; - var added = AddDocuments(titles, "animal"); + var added = this.AddDocuments(titles, "animal"); //Act var query = new SearchQuery @@ -1849,7 +1849,7 @@ public void SearchController_GetResult_Sorty_By_Title_Ascending_Returns_Alphabet SortField = SortFields.Title, SortDirection = SortDirections.Ascending }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1866,7 +1866,7 @@ public void SearchController_GetResult_Sorty_By_Title_Descending_Returns_Alphabe { var titles = new List { "cat", "ant", "dog", "antelope", "zebra", "yellow", " " }; - var added = AddDocuments(titles, "animal"); + var added = this.AddDocuments(titles, "animal"); //Act var query = new SearchQuery @@ -1876,7 +1876,7 @@ public void SearchController_GetResult_Sorty_By_Title_Descending_Returns_Alphabe SortField = SortFields.Title, SortDirection = SortDirections.Descending }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1893,7 +1893,7 @@ public void SearchController_GetResult_Sorty_By_Keyword_Ascending_Returns_Alphab { var titles = new List { "cat", "ant", "dog", "antelope", "zebra", "yellow", " " }; - var added = AddDocumentsWithKeywords(titles, "animal"); + var added = this.AddDocumentsWithKeywords(titles, "animal"); //Act var query = new SearchQuery @@ -1904,7 +1904,7 @@ public void SearchController_GetResult_Sorty_By_Keyword_Ascending_Returns_Alphab SortDirection = SortDirections.Ascending, CustomSortField = KeyWord1Name }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1921,7 +1921,7 @@ public void SearchController_GetResult_Sorty_By_Keyword_Descending_Returns_Alpha { var titles = new List { "cat", "ant", "dog", "antelope", "zebra", "yellow", " " }; - var added = AddDocumentsWithKeywords(titles, "animal"); + var added = this.AddDocumentsWithKeywords(titles, "animal"); //Act var query = new SearchQuery @@ -1932,7 +1932,7 @@ public void SearchController_GetResult_Sorty_By_Keyword_Descending_Returns_Alpha SortDirection = SortDirections.Descending, CustomSortField = KeyWord1Name }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -1948,7 +1948,7 @@ public void SearchController_GetResult_Sorty_By_Keyword_Descending_Returns_Alpha public void SearchController_GetResult_Sort_By_Unknown_StringField_In_Descending_Order_Does_Not_Throw() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -1958,7 +1958,7 @@ public void SearchController_GetResult_Sort_By_Unknown_StringField_In_Descending SortDirection = SortDirections.Descending, CustomSortField = "unknown" }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } @@ -1966,7 +1966,7 @@ public void SearchController_GetResult_Sort_By_Unknown_StringField_In_Descending public void SearchController_GetResult_Sort_By_Unknown_StringField_In_Ascending_Order_Does_Not_Throw() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -1976,14 +1976,14 @@ public void SearchController_GetResult_Sort_By_Unknown_StringField_In_Ascending_ SortDirection = SortDirections.Ascending, CustomSortField = "unknown" }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } [Test] public void SearchController_GetResult_Sort_By_Unknown_NumericField_In_Descending_Order_Does_Not_Throw() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -1993,7 +1993,7 @@ public void SearchController_GetResult_Sort_By_Unknown_NumericField_In_Descendin SortDirection = SortDirections.Descending, CustomSortField = "unknown" }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } @@ -2001,7 +2001,7 @@ public void SearchController_GetResult_Sort_By_Unknown_NumericField_In_Descendin public void SearchController_GetResult_Sort_By_Unknown_NumericField_In_Ascending_Order_Does_Not_Throw() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -2011,14 +2011,14 @@ public void SearchController_GetResult_Sort_By_Unknown_NumericField_In_Ascending SortDirection = SortDirections.Ascending, CustomSortField = "unknown" }; - _searchController.SiteSearch(query); + this._searchController.SiteSearch(query); } [Test] public void SearchController_GetResult_Sorty_By_Relevance_Returns_TopHit_Docs_First() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -2027,7 +2027,7 @@ public void SearchController_GetResult_Sorty_By_Relevance_Returns_TopHit_Docs_Fi SortField = SortFields.Relevance, KeyWords = "brown OR fox" }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -2037,11 +2037,11 @@ public void SearchController_GetResult_Sorty_By_Relevance_Returns_TopHit_Docs_Fi [Test] public void SearchController_GetResult_Sorty_By_RelevanceAndTitleKeyword_Returns_TopHit_Docs_First() { - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns(CustomBoost); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns(CustomBoost); //Arrange - var added = AddSearchDocsForCustomBoost(); - CreateNewLuceneControllerInstance(true); + var added = this.AddSearchDocsForCustomBoost(); + this.CreateNewLuceneControllerInstance(true); //Act var query = new SearchQuery @@ -2050,7 +2050,7 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndTitleKeyword_Returns SortField = SortFields.Relevance, KeyWords = "Hello" }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -2060,10 +2060,10 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndTitleKeyword_Returns [Test] public void SearchController_GetResult_Sorty_By_RelevanceAndSubjectKeyword_Returns_TopHit_Docs_First() { - _mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns(CustomBoost); - CreateNewLuceneControllerInstance(true); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns(CustomBoost); + this.CreateNewLuceneControllerInstance(true); //Arrange - var added = AddSearchDocsForCustomBoost(); + var added = this.AddSearchDocsForCustomBoost(); //Act var query = new SearchQuery @@ -2072,7 +2072,7 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndSubjectKeyword_Retur SortField = SortFields.Relevance, KeyWords = "Hello" }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -2082,10 +2082,10 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndSubjectKeyword_Retur [Test] public void SearchController_GetResult_Sorty_By_RelevanceAndCommentKeyword_Returns_TopHit_Docs_First() { - _mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())).Returns(CustomBoost); - CreateNewLuceneControllerInstance(true); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())).Returns(CustomBoost); + this.CreateNewLuceneControllerInstance(true); //Arrange - var added = AddSearchDocsForCustomBoost(); + var added = this.AddSearchDocsForCustomBoost(); //Act var query = new SearchQuery @@ -2094,7 +2094,7 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndCommentKeyword_Retur SortField = SortFields.Relevance, KeyWords = "Hello" }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -2104,10 +2104,10 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndCommentKeyword_Retur [Test] public void SearchController_GetResult_Sorty_By_RelevanceAndAuthorKeyword_Returns_TopHit_Docs_First() { - _mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns(CustomBoost); - CreateNewLuceneControllerInstance(true); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns(CustomBoost); + this.CreateNewLuceneControllerInstance(true); //Arrange - var added = AddSearchDocsForCustomBoost(); + var added = this.AddSearchDocsForCustomBoost(); //Act var query = new SearchQuery @@ -2116,7 +2116,7 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndAuthorKeyword_Return SortField = SortFields.Relevance, KeyWords = "Hello" }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -2127,7 +2127,7 @@ public void SearchController_GetResult_Sorty_By_RelevanceAndAuthorKeyword_Return public void SearchController_GetResult_Sorty_By_Relevance_Ascending_Does_Not_Change_Sequence_Of_Results() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -2137,7 +2137,7 @@ public void SearchController_GetResult_Sorty_By_Relevance_Ascending_Does_Not_Cha SortDirection = SortDirections.Ascending, KeyWords = "brown OR fox" }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(added, search.Results.Count); @@ -2152,7 +2152,7 @@ public void SearchController_GetResult_Sorty_By_Relevance_Ascending_Does_Not_Cha public void SearchController_GetResult_By_Locale_Returns_Specific_And_Neutral_Locales() { //Arrange - AddStandardSearchDocs(); + this.AddStandardSearchDocs(); //Act var query = new SearchQuery @@ -2161,7 +2161,7 @@ public void SearchController_GetResult_By_Locale_Returns_Specific_And_Neutral_Lo SortField = SortFields.LastModified, CultureCode = CultureItIt }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(2, search.Results.Count, "Found: " + string.Join(Environment.NewLine, search.Results.Select(r => r.Title))); @@ -2187,14 +2187,14 @@ public void SearchController_EnsureOldDocument_Deleted_Upon_Second_Index_Content //Add first document var doc1 = new SearchDocument { Title = docs[0], UniqueKey = docKey, SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); //Add second document with same key var doc2 = new SearchDocument { Title = docs[1], UniqueKey = docKey, SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; - _internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc2); //run luceneQuery on common keyword between both the docs - var search = SearchForKeyword("fox"); + var search = this.SearchForKeyword("fox"); //Assert - there should just be one entry - first one must have been removed. Assert.AreEqual(1, search.Results.Count); @@ -2213,7 +2213,7 @@ public void SearchController_Add_Does_Not_Throw_On_Empty_Url() QueryString = "?foo=bar", }; - Assert.DoesNotThrow(() => _internalSearchController.AddSearchDocument(doc)); + Assert.DoesNotThrow(() => this._internalSearchController.AddSearchDocument(doc)); } [Test] @@ -2226,7 +2226,7 @@ public void SearchController_Add_Does_Not_Throw_On_Empty_Title() ModifiedTimeUtc = DateTime.UtcNow }; - Assert.DoesNotThrow(() => _internalSearchController.AddSearchDocument(doc)); + Assert.DoesNotThrow(() => this._internalSearchController.AddSearchDocument(doc)); } #endregion @@ -2246,14 +2246,14 @@ public void SearchController_EnsureOldDocument_Deleted_Upon_Second_Index_When_Is //Add first document var doc1 = new SearchDocument { Title = docs[0], UniqueKey = docKey, SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); //Add second document with same key var doc2 = new SearchDocument { Title = docs[1], UniqueKey = docKey, SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, IsActive = false }; - _internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc2); //run luceneQuery on common keyword between both the docs - var search = SearchForKeyword("fox"); + var search = this.SearchForKeyword("fox"); //Assert - there should not be any record. Assert.AreEqual(0, search.Results.Count); @@ -2275,20 +2275,20 @@ public void SearchController_SearchFindsAccentedAndNonAccentedWords() "panthere without accent" }; - AddLinesAsSearchDocs(lines); + this.AddLinesAsSearchDocs(lines); //Act - var searches1 = SearchForKeyword("zèbre"); - var searches2 = SearchForKeyword("zebre"); + var searches1 = this.SearchForKeyword("zèbre"); + var searches2 = this.SearchForKeyword("zebre"); //Assert Assert.AreEqual(2, searches1.TotalHits); - Assert.AreEqual("zèbre or panthère", StipEllipses(searches1.Results[0].Snippet).Trim()); - Assert.AreEqual("zebre without accent", StipEllipses(searches1.Results[1].Snippet).Trim()); + Assert.AreEqual("zèbre or panthère", this.StipEllipses(searches1.Results[0].Snippet).Trim()); + Assert.AreEqual("zebre without accent", this.StipEllipses(searches1.Results[1].Snippet).Trim()); Assert.AreEqual(2, searches2.TotalHits); - Assert.AreEqual("zèbre or panthère", StipEllipses(searches2.Results[0].Snippet).Trim()); - Assert.AreEqual("zebre without accent", StipEllipses(searches2.Results[1].Snippet).Trim()); + Assert.AreEqual("zèbre or panthère", this.StipEllipses(searches2.Results[0].Snippet).Trim()); + Assert.AreEqual("zebre without accent", this.StipEllipses(searches2.Results[1].Snippet).Trim()); } [Test] @@ -2300,18 +2300,18 @@ public void SearchController_PorterFilterTest() "field2_value", }; - AddLinesAsSearchDocs(lines); + this.AddLinesAsSearchDocs(lines); //Act - var search1 = SearchForKeyword(lines[0]); - var search2 = SearchForKeyword("\"" + lines[1] + "\""); + var search1 = this.SearchForKeyword(lines[0]); + var search2 = this.SearchForKeyword("\"" + lines[1] + "\""); //Assert Assert.AreEqual(1, search1.TotalHits); Assert.AreEqual(1, search2.TotalHits); - Assert.AreEqual("" + lines[0] + "", StipEllipses(search1.Results[0].Snippet).Trim()); - Assert.AreEqual("" + lines[1] + "", StipEllipses(search2.Results[0].Snippet).Trim()); + Assert.AreEqual("" + lines[0] + "", this.StipEllipses(search1.Results[0].Snippet).Trim()); + Assert.AreEqual("" + lines[1] + "", this.StipEllipses(search2.Results[0].Snippet).Trim()); } [Test] @@ -2325,16 +2325,16 @@ public void SearchController_SearchFindsStemmedWords() "This sentence is missing the bike ri... word" }; - AddLinesAsSearchDocs(lines); + this.AddLinesAsSearchDocs(lines); //Act - var search = SearchForKeyword("ride"); + var search = this.SearchForKeyword("ride"); //Assert Assert.AreEqual(3, search.TotalHits); - Assert.AreEqual("I ride my bike to work", StipEllipses(search.Results[0].Snippet)); - Assert.AreEqual("m are riding their bikes", StipEllipses(search.Results[1].Snippet)); - Assert.AreEqual("e boy rides his bike to school", StipEllipses(search.Results[2].Snippet)); + Assert.AreEqual("I ride my bike to work", this.StipEllipses(search.Results[0].Snippet)); + Assert.AreEqual("m are riding their bikes", this.StipEllipses(search.Results[1].Snippet)); + Assert.AreEqual("e boy rides his bike to school", this.StipEllipses(search.Results[2].Snippet)); } #endregion @@ -2345,15 +2345,15 @@ public void SearchController_SearchFindsStemmedWords() public void SearchController_Search_Synonym_Works() { //Arrange - var added = AddStandardSearchDocs(); + var added = this.AddStandardSearchDocs(); //Act - var search = SearchForKeywordInModule("wolf"); + var search = this.SearchForKeywordInModule("wolf"); //Assert Assert.AreEqual(added, search.TotalHits); - var snippets = search.Results.Select(result => StipEllipses(result.Snippet)).OrderBy(s => s).ToArray(); + var snippets = search.Results.Select(result => this.StipEllipses(result.Snippet)).OrderBy(s => s).ToArray(); Assert.AreEqual("brown fox jumps over the lazy dog", snippets[0]); Assert.AreEqual("e red fox jumped over the lazy dark gray dog", snippets[1]); Assert.AreEqual("gold fox jumped over the lazy black dog", snippets[2]); @@ -2371,13 +2371,13 @@ public void SearchController_Title_Ranked_Higher_Than_Body() var doc3 = new SearchDocument { UniqueKey = "key03", Title = "I'm here", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "random text" }; //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.Commit(); - var result = SearchForKeyword("cow"); + var result = this.SearchForKeyword("cow"); //Assert Assert.AreEqual(result.TotalHits, 2); @@ -2394,13 +2394,13 @@ public void SearchController_Title_Ranked_Higher_Than_Body_Regardless_Of_Documen var doc3 = new SearchDocument { UniqueKey = "key03", Title = "cow is gone", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.Commit(); - var result = SearchForKeyword("cow"); + var result = this.SearchForKeyword("cow"); //Assert Assert.AreEqual(result.TotalHits, 2); @@ -2417,11 +2417,11 @@ public void SearchController_Title_Ranked_Higher_Than_Tag() var doc3 = new SearchDocument { UniqueKey = "key03", Title = "I'm here", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "random text" }; //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.Commit(); - var result = SearchForKeyword("cow"); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.Commit(); + var result = this.SearchForKeyword("cow"); //Assert Assert.AreEqual(result.TotalHits, 2); @@ -2444,16 +2444,16 @@ public void SearchController_RankingTest_With_Vowel() //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.AddSearchDocument(doc4); - _internalSearchController.AddSearchDocument(doc5); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.AddSearchDocument(doc4); + this._internalSearchController.AddSearchDocument(doc5); - _internalSearchController.Commit(); + this._internalSearchController.Commit(); - var result = SearchForKeyword("tootsie"); + var result = this.SearchForKeyword("tootsie"); //Assert Assert.AreEqual(5, result.TotalHits); @@ -2478,11 +2478,11 @@ public void SearchController_FileNameTest_With_WildCard() var doc1 = new SearchDocument { UniqueKey = "key01", Title = "file.ext", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; //Act - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); - _internalSearchController.Commit(); + this._internalSearchController.Commit(); - var result = SearchForKeywordWithWildCard("file"); + var result = this.SearchForKeywordWithWildCard("file"); //Assert Assert.AreEqual(1, result.TotalHits); @@ -2496,11 +2496,11 @@ public void SearchController_Full_FileNameTest_Without_WildCard() var doc1 = new SearchDocument { UniqueKey = "key01", Title = "file.ext", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; //Act - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); - _internalSearchController.Commit(); + this._internalSearchController.Commit(); - var result = SearchForKeywordWithWildCard("file.ext"); + var result = this.SearchForKeywordWithWildCard("file.ext"); //Assert Assert.AreEqual(1, result.TotalHits); @@ -2514,11 +2514,11 @@ public void SearchController_Full_FileNameTest_With_WildCard() var doc1 = new SearchDocument { UniqueKey = "key01", Title = "file.ext", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow }; //Act - _internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc1); - _internalSearchController.Commit(); + this._internalSearchController.Commit(); - var result = SearchForKeyword("file.ext"); + var result = this.SearchForKeyword("file.ext"); //Assert Assert.AreEqual(1, result.TotalHits); @@ -2555,22 +2555,22 @@ private void AddFoldersAndFiles() ModifiedTimeUtc = DateTime.UtcNow, Keywords = new Dictionary { { "folderName", file.Value.ToLowerInvariant() } } }; - _internalSearchController.AddSearchDocument(doc); + this._internalSearchController.AddSearchDocument(doc); } - _internalSearchController.Commit(); + this._internalSearchController.Commit(); } [Test] public void SearchController_Scope_By_FolderName() { //Arrange - AddFoldersAndFiles(); + this.AddFoldersAndFiles(); //Act - var result1 = SearchForKeyword("kw-folderName:Images/*"); - var result2 = SearchForKeyword("kw-folderName:Images/DNN/*"); - var result3 = SearchForKeywordWithWildCard("kw-folderName:Images/* AND spacer"); + var result1 = this.SearchForKeyword("kw-folderName:Images/*"); + var result2 = this.SearchForKeyword("kw-folderName:Images/DNN/*"); + var result3 = this.SearchForKeywordWithWildCard("kw-folderName:Images/* AND spacer"); //Assert Assert.AreEqual(5, result1.TotalHits); @@ -2582,15 +2582,15 @@ public void SearchController_Scope_By_FolderName() public void SearchController_Scope_By_FolderName_With_Spaces() { //Arrange - AddFoldersAndFiles(); + this.AddFoldersAndFiles(); //Act - Space is replaced by < var query1 = new SearchQuery {KeyWords = "kw-folderName:Images/*", SearchTypeIds = new[] { OtherSearchTypeId }, WildCardSearch = false }; var query2 = new SearchQuery { KeyWords = "kw-folderName:my { OtherSearchTypeId }, WildCardSearch = false }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -2946,7 +2946,7 @@ public void SearchController_GetResult_Works_With_Custom_Numeric_Querirs() public void SearchController_GetResult_Works_With_CustomKeyword_Querirs() { - AddDocumentsWithKeywords(); + this.AddDocumentsWithKeywords(); //Act var query = new SearchQuery @@ -2955,7 +2955,7 @@ public void SearchController_GetResult_Works_With_CustomKeyword_Querirs() SearchTypeIds = new List { OtherSearchTypeId }, WildCardSearch = false }; - var search = _searchController.SiteSearch(query); + var search = this._searchController.SiteSearch(query); //Assert Assert.AreEqual(1, search.Results.Count); @@ -2969,7 +2969,7 @@ public void SearchController_GetResult_Works_With_CustomKeyword_Querirs() [Test] public void SearchController_EnableLeadingWildcard_Should_Not_Return_Results_When_Property_Is_False() { - _mockHostController.Setup(c => c.GetString("Search_AllowLeadingWildcard", It.IsAny())).Returns("N"); + this._mockHostController.Setup(c => c.GetString("Search_AllowLeadingWildcard", It.IsAny())).Returns("N"); //Arrange var doc1 = new SearchDocument { UniqueKey = "key01", Title = "cow is gone", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "" }; @@ -2977,13 +2977,13 @@ public void SearchController_EnableLeadingWildcard_Should_Not_Return_Results_Whe var doc3 = new SearchDocument { UniqueKey = "key03", Title = "I'm here", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "" }; //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.Commit(); - var result = SearchForKeyword("rld", OtherSearchTypeId, true, false); + var result = this.SearchForKeyword("rld", OtherSearchTypeId, true, false); //Assert Assert.AreEqual(0, result.TotalHits); @@ -2992,7 +2992,7 @@ public void SearchController_EnableLeadingWildcard_Should_Not_Return_Results_Whe [Test] public void SearchController_EnableLeadingWildcard_Should_Return_Results_When_Property_Is_True() { - _mockHostController.Setup(c => c.GetString("Search_AllowLeadingWildcard", It.IsAny())).Returns("N"); + this._mockHostController.Setup(c => c.GetString("Search_AllowLeadingWildcard", It.IsAny())).Returns("N"); //Arrange var doc1 = new SearchDocument { UniqueKey = "key01", Title = "cow is gone", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "" }; @@ -3000,13 +3000,13 @@ public void SearchController_EnableLeadingWildcard_Should_Return_Results_When_Pr var doc3 = new SearchDocument { UniqueKey = "key03", Title = "I'm here", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "" }; //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.Commit(); - var result = SearchForKeyword("rld", OtherSearchTypeId, true, true); + var result = this.SearchForKeyword("rld", OtherSearchTypeId, true, true); //Assert Assert.AreEqual(1, result.TotalHits); @@ -3016,7 +3016,7 @@ public void SearchController_EnableLeadingWildcard_Should_Return_Results_When_Pr [Test] public void SearchController_EnableLeadingWildcard_Should_Return_Results_When_Property_Is_False_But_Host_Setting_Is_True() { - _mockHostController.Setup(c => c.GetString("Search_AllowLeadingWildcard", It.IsAny())).Returns("Y"); + this._mockHostController.Setup(c => c.GetString("Search_AllowLeadingWildcard", It.IsAny())).Returns("Y"); //Arrange var doc1 = new SearchDocument { UniqueKey = "key01", Title = "cow is gone", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "" }; @@ -3024,13 +3024,13 @@ public void SearchController_EnableLeadingWildcard_Should_Return_Results_When_Pr var doc3 = new SearchDocument { UniqueKey = "key03", Title = "I'm here", SearchTypeId = OtherSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, Body = "" }; //Act - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.Commit(); - var result = SearchForKeyword("rld", OtherSearchTypeId, true, false); + var result = this.SearchForKeyword("rld", OtherSearchTypeId, true, false); //Assert Assert.AreEqual(1, result.TotalHits); @@ -3045,25 +3045,25 @@ public void SearchController_EnableLeadingWildcard_Should_Return_Results_When_Pr public void SearchController_Search_StopWords_Works() { //Arrange - var added = AddStandardSearchDocs(); - _internalSearchController.Commit(); + var added = this.AddStandardSearchDocs(); + this._internalSearchController.Commit(); //Act - var search = SearchForKeywordInModule("the"); + var search = this.SearchForKeywordInModule("the"); //Assert // the word "the" is ignored in all languages except es-ES Assert.AreEqual(1, search.TotalHits, "Found: " + string.Join(Environment.NewLine, search.Results.Select(r => r.Title))); //Act - search = SearchForKeywordInModule("over"); + search = this.SearchForKeywordInModule("over"); //Assert // we won't find "over" in neutral, en-US, and en-CA documents, but will find it in the es-ES and it-IT documents. Assert.AreEqual(2, search.TotalHits, "Found: " + string.Join(Environment.NewLine, search.Results.Select(r => r.Title))); //Act - search = SearchForKeywordInModule("los"); + search = this.SearchForKeywordInModule("los"); //Assert // we won't find "los" in the es-ES document. diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchHelperTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchHelperTests.cs index 5ddc992a72a..93acbfdd04a 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchHelperTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Search/SearchHelperTests.cs @@ -52,10 +52,10 @@ public class SearchHelperTests public void SetUp() { ComponentFactory.Container = new SimpleContainer(); - _cachingProvider = MockComponentProvider.CreateDataCacheProvider(); - _dataProvider = MockComponentProvider.CreateDataProvider(); - SetupDataProvider(); - _searchHelper = new SearchHelperImpl(); + this._cachingProvider = MockComponentProvider.CreateDataCacheProvider(); + this._dataProvider = MockComponentProvider.CreateDataProvider(); + this.SetupDataProvider(); + this._searchHelper = new SearchHelperImpl(); DataCache.ClearCache(); } @@ -66,11 +66,11 @@ public void SetUp() private void SetupDataProvider() { //Standard DataProvider Path for Logging - _dataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._dataProvider.Setup(d => d.GetProviderPath()).Returns(""); - _dataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); + this._dataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(this.GetPortalsCallBack); - _dataProvider.Setup(d => d.GetPortalSettings(It.IsAny(), It.IsAny())).Returns(GetPortalSettingsCallBack); + this._dataProvider.Setup(d => d.GetPortalSettings(It.IsAny(), It.IsAny())).Returns(this.GetPortalSettingsCallBack); var dataTable = new DataTable("SynonymsGroups"); var pkId = dataTable.Columns.Add("SynonymsGroupID", typeof(int)); @@ -89,7 +89,7 @@ private void SetupDataProvider() dataTable.Rows.Add(2, string.Join(",", new[] { TermLaptop, TermNotebook }), 1, now, 1, now, 0); dataTable.Rows.Add(3, string.Join(",", new[] { TermJump, TermLeap, TermHop }), 1, now, 1, now, 0); - _dataProvider.Setup(x => x.GetAllSynonymsGroups(0, It.IsAny())).Returns(dataTable.CreateDataReader()); + this._dataProvider.Setup(x => x.GetAllSynonymsGroups(0, It.IsAny())).Returns(dataTable.CreateDataReader()); } private IDataReader GetPortalSettingsCallBack(int portalId, string culture) @@ -113,7 +113,7 @@ private IDataReader GetPortalSettingsCallBack(int portalId, string culture) private IDataReader GetPortalsCallBack(string culture) { - return GetPortalCallBack(PortalId0, CultureEnUs); + return this.GetPortalCallBack(PortalId0, CultureEnUs); } private IDataReader GetPortalCallBack(int portalId, string culture) @@ -149,7 +149,7 @@ public void SearchHelper_GetSynonyms_Two_Terms_Returns_Correct_Results() //Arrange //Act - var synonyms = _searchHelper.GetSynonyms(PortalId0, CultureEnUs, TermDNN).ToArray(); + var synonyms = this._searchHelper.GetSynonyms(PortalId0, CultureEnUs, TermDNN).ToArray(); //Assert Assert.AreEqual(1, synonyms.Count()); @@ -162,7 +162,7 @@ public void SearchHelper_GetSynonyms_Three_Terms_Returns_Correct_Results() //Arrange //Act - var synonyms = _searchHelper.GetSynonyms(PortalId0, CultureEnUs, TermHop).ToArray(); + var synonyms = this._searchHelper.GetSynonyms(PortalId0, CultureEnUs, TermHop).ToArray(); //Assert Assert.AreEqual(2, synonyms.Count()); @@ -182,7 +182,7 @@ public void SearchHelper_Rephrase_NoWildCardButExact_1() const string expected = inPhrase; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, false); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, false); //Assert Assert.AreEqual(expected, analyzed); @@ -196,7 +196,7 @@ public void SearchHelper_Rephrase_NoWildCardButExact_2() const string expected = inPhrase; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, false); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, false); //Assert Assert.AreEqual(expected, analyzed); @@ -210,7 +210,7 @@ public void SearchHelper_Rephrase_NoWildCardNoExact() const string expected = inPhrase; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, false); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, false); //Assert Assert.AreEqual(expected, analyzed); @@ -224,7 +224,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_0() const string expected = "(fox OR fox*) (dog OR dog*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -238,7 +238,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_1() const string expected = "(lazy-dog OR lazy-dog*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -252,7 +252,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_2() const string expected = "(fox OR fox*) (dog OR dog*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -266,7 +266,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_3() const string expected = "(dog OR dog*) (fox OR fox*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -280,7 +280,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_4() const string expected = "(brown OR brown*) (fox OR fox*) (lazy OR lazy*) (dog OR dog*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -294,7 +294,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_5() const string expected = "((brown OR brown*) (fox OR fox*)) (lazy OR lazy*) (dog OR dog*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -308,7 +308,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_6() const string expected = "(brown OR brown*) (fox OR fox*) ((lazy OR lazy*) (dog OR dog*))"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -322,7 +322,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_7() const string expected = "(brown OR brown*) (fox OR fox*) ((lazy OR lazy*) AND (dog OR dog*))"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -336,7 +336,7 @@ public void SearchHelper_Rephrase_WildCardNoExact_8() const string expected = "(brown OR brown*) (fox OR fox*) ((lazy OR lazy*) (and OR and*) (dog OR dog*))"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -350,7 +350,7 @@ public void SearchHelper_Rephrase_WildCardWithExact_1() const string expected = inPhrase; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -364,7 +364,7 @@ public void SearchHelper_Rephrase_WildCardWithExact_2() const string expected = "\"brown fox\" (dog OR dog*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -378,7 +378,7 @@ public void SearchHelper_Rephrase_WildCardWithExact_3() const string expected = "(The OR The*) +\"brown fox\" -\"Lazy dog\" (jumps OR jumps*)"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -392,7 +392,7 @@ public void SearchHelper_Rephrase_WildCardWithTilde_4() const string expected = "(dog OR dog*) jump~2"; //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); @@ -406,7 +406,7 @@ public void SearchHelper_Rephrase_WildCardWithTilde_4() public void SearchHelper_Rephrase_AccentedCharsReplaced_Replaced(string inPhrase, string expected) { //Act - var analyzed = _searchHelper.RephraseSearchText(inPhrase, true); + var analyzed = this._searchHelper.RephraseSearchText(inPhrase, true); //Assert Assert.AreEqual(expected, analyzed); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Social/RelationshipControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Social/RelationshipControllerTests.cs index 5232d159d64..86eba5c29b8 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Social/RelationshipControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Controllers/Social/RelationshipControllerTests.cs @@ -54,14 +54,14 @@ public void SetUp() var mockDataProvider = MockComponentProvider.CreateDataProvider(); mockDataProvider.Setup(dp => dp.GetProviderPath()).Returns(""); - mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); + this.mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); MockComponentProvider.CreateEventLogController(); - _portalController = new Mock(); - PortalController.SetTestableInstance(_portalController.Object); + this._portalController = new Mock(); + PortalController.SetTestableInstance(this._portalController.Object); - _portalGroupController = new Mock(); - PortalGroupController.RegisterInstance(_portalGroupController.Object); + this._portalGroupController = new Mock(); + PortalGroupController.RegisterInstance(this._portalGroupController.Object); var mockHostController = new Mock(); mockHostController.Setup(c => c.GetString("PerformanceSetting")).Returns("0"); @@ -71,9 +71,9 @@ public void SetUp() mockUserController.Setup(c => c.GetCurrentUserInfo()).Returns(new UserInfo() { UserID = 1}); UserController.SetTestableInstance(mockUserController.Object); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); - SetupDataTables(); + this.SetupDataTables(); } [TearDown] @@ -117,7 +117,7 @@ public void RelationshipController_Constructor_Throws_On_Null_EventLogController public void RelationshipController_DeleteRelationshipType_Throws_On_Null_RelationshipType() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.DeleteRelationshipType(null); @@ -127,8 +127,8 @@ public void RelationshipController_DeleteRelationshipType_Throws_On_Null_Relatio public void RelationshipController_DeleteRelationshipType_Calls_DataService() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); var relationshipType = new RelationshipType() { RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID @@ -147,8 +147,8 @@ public void RelationshipController_DeleteRelationshipType_Calls_EventLogControll //Arrange var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); - var relationshipController = CreateRelationshipController(mockEventLogController); + this.CreateLocalizationProvider(); + var relationshipController = this.CreateRelationshipController(mockEventLogController); var relationshipType = new RelationshipType() { RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID, @@ -168,7 +168,7 @@ public void RelationshipController_DeleteRelationshipType_Calls_EventLogControll public void RelationshipController_DeleteRelationshipType_Calls_DataCache_RemoveCache() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); var cacheKey = CachingProvider.GetCacheKey(DataCache.RelationshipTypesCacheKey); var relationshipType = new RelationshipType() { @@ -179,15 +179,15 @@ public void RelationshipController_DeleteRelationshipType_Calls_DataCache_Remove relationshipController.DeleteRelationshipType(relationshipType); //Assert - mockCachingProvider.Verify(e => e.Remove(cacheKey)); + this.mockCachingProvider.Verify(e => e.Remove(cacheKey)); } [Test] public void RelationshipController_GetAllRelationshipTypes_Calls_DataService() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationshipTypes = relationshipController.GetAllRelationshipTypes(); @@ -200,8 +200,8 @@ public void RelationshipController_GetAllRelationshipTypes_Calls_DataService() public void RelationshipController_GetRelationshipType_Calls_DataService_If_Not_Cached() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationshipTypes = relationshipController.GetRelationshipType(Constants.SOCIAL_FriendRelationshipTypeID); @@ -216,8 +216,8 @@ public void RelationshipController_GetRelationshipType_Calls_DataService_If_Not_ public void RelationshipController_GetRelationshipType_Returns_RelationshipType_For_Valid_ID(int relationshipTypeId) { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationshipType = relationshipController.GetRelationshipType(relationshipTypeId); @@ -230,8 +230,8 @@ public void RelationshipController_GetRelationshipType_Returns_RelationshipType_ public void RelationshipController_GetRelationshipType_Returns_Null_For_InValid_ID() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationshipType = relationshipController.GetRelationshipType(Constants.SOCIAL_InValidRelationshipType); @@ -245,7 +245,7 @@ public void RelationshipController_GetRelationshipType_Returns_Null_For_InValid_ public void RelationshipController_SaveRelationshipType_Throws_On_Null_RelationshipType() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.SaveRelationshipType(null); @@ -255,8 +255,8 @@ public void RelationshipController_SaveRelationshipType_Throws_On_Null_Relations public void RelationshipController_SaveRelationshipType_Calls_DataService() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); var relationshipType = new RelationshipType() { RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID @@ -275,9 +275,9 @@ public void RelationshipController_SaveRelationshipType_Calls_EventLogController //Arrange var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); - var relationshipController = CreateRelationshipController(mockEventLogController); + var relationshipController = this.CreateRelationshipController(mockEventLogController); var relationshipType = new RelationshipType() { RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID, @@ -296,7 +296,7 @@ public void RelationshipController_SaveRelationshipType_Calls_EventLogController public void RelationshipController_SaveRelationshipType_Calls_DataCache_RemoveCache() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); var cacheKey = CachingProvider.GetCacheKey(DataCache.RelationshipTypesCacheKey); var relationshipType = new RelationshipType() { @@ -307,7 +307,7 @@ public void RelationshipController_SaveRelationshipType_Calls_DataCache_RemoveCa relationshipController.SaveRelationshipType(relationshipType); //Assert - mockCachingProvider.Verify(e => e.Remove(cacheKey)); + this.mockCachingProvider.Verify(e => e.Remove(cacheKey)); } #endregion @@ -319,7 +319,7 @@ public void RelationshipController_SaveRelationshipType_Calls_DataCache_RemoveCa public void RelationshipController_DeleteRelationship_Throws_On_Null_Relationship() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.DeleteRelationship(null); @@ -330,7 +330,7 @@ public void RelationshipController_DeleteRelationship_Calls_DataService() { //Arrange var mockDataService = new Mock(); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); var relationship = new Relationship() { RelationshipId = Constants.SOCIAL_FollowerRelationshipID @@ -349,9 +349,9 @@ public void RelationshipController_DeleteRelationship_Calls_EventLogController_A //Arrange var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); - var relationshipController = CreateRelationshipController(mockEventLogController); + var relationshipController = this.CreateRelationshipController(mockEventLogController); var relationship = new Relationship() { RelationshipId = Constants.SOCIAL_FollowerRelationshipID, @@ -371,7 +371,7 @@ public void RelationshipController_DeleteRelationship_Calls_DataCache_RemoveCach { //Arrange var portalId = 1; - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); var cacheKey = CachingProvider.GetCacheKey(string.Format(DataCache.RelationshipByPortalIDCacheKey, portalId)); var relationship = new Relationship() { @@ -384,7 +384,7 @@ public void RelationshipController_DeleteRelationship_Calls_DataCache_RemoveCach relationshipController.DeleteRelationship(relationship); //Assert - mockCachingProvider.Verify(e => e.Remove(cacheKey)); + this.mockCachingProvider.Verify(e => e.Remove(cacheKey)); } [Test] @@ -394,10 +394,10 @@ public void RelationshipController_GetRelationship_Returns_Relationship_For_Vali { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); - dtRelationships.Rows.Add(relationshipId, defaultType, defaultType.ToString(), defaultType.ToString(), Constants.PORTAL_Zero, Constants.USER_Null, RelationshipStatus.None); - mockDataService.Setup(md => md.GetRelationship(relationshipId)).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + this.dtRelationships.Clear(); + this.dtRelationships.Rows.Add(relationshipId, defaultType, defaultType.ToString(), defaultType.ToString(), Constants.PORTAL_Zero, Constants.USER_Null, RelationshipStatus.None); + mockDataService.Setup(md => md.GetRelationship(relationshipId)).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationship = relationshipController.GetRelationship(relationshipId); @@ -411,9 +411,9 @@ public void RelationshipController_GetRelationship_Returns_Null_For_InValid_ID() { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); - mockDataService.Setup(md => md.GetRelationship(It.IsAny())).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + this.dtRelationships.Clear(); + mockDataService.Setup(md => md.GetRelationship(It.IsAny())).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationship = relationshipController.GetRelationship(Constants.SOCIAL_InValidRelationship); @@ -427,17 +427,17 @@ public void RelationshipController_GetRelationshipsByUserID_Returns_List_Of_Rela { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); + this.dtRelationships.Clear(); for (int i = 1; i <= 5; i ++) { - dtRelationships.Rows.Add(i, DefaultRelationshipTypes.Friends, DefaultRelationshipTypes.Friends.ToString(), + this.dtRelationships.Rows.Add(i, DefaultRelationshipTypes.Friends, DefaultRelationshipTypes.Friends.ToString(), DefaultRelationshipTypes.Friends.ToString(), Constants.PORTAL_Zero, Constants.USER_ValidId, RelationshipStatus.None); } - mockDataService.Setup(md => md.GetRelationshipsByUserId(Constants.USER_ValidId)).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + mockDataService.Setup(md => md.GetRelationshipsByUserId(Constants.USER_ValidId)).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationships = relationshipController.GetRelationshipsByUserId(Constants.USER_ValidId); @@ -452,9 +452,9 @@ public void RelationshipController_GetRelationshipsByUserID_Returns_EmptyList_Of { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); - mockDataService.Setup(md => md.GetRelationshipsByUserId(Constants.USER_InValidId)).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + this.dtRelationships.Clear(); + mockDataService.Setup(md => md.GetRelationshipsByUserId(Constants.USER_InValidId)).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var relationships = relationshipController.GetRelationshipsByUserId(Constants.USER_InValidId); @@ -469,20 +469,20 @@ public void RelationshipController_GetRelationshipsByPortalID_Returns_List_Of_Re { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); + this.dtRelationships.Clear(); for (int i = 1; i <= 5; i++) { - dtRelationships.Rows.Add(i, DefaultRelationshipTypes.Friends, DefaultRelationshipTypes.Friends.ToString(), + this.dtRelationships.Rows.Add(i, DefaultRelationshipTypes.Friends, DefaultRelationshipTypes.Friends.ToString(), DefaultRelationshipTypes.Friends.ToString(), Constants.PORTAL_Zero, Constants.USER_Null, RelationshipStatus.None); } - mockDataService.Setup(md => md.GetRelationshipsByPortalId(Constants.PORTAL_Zero)).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + mockDataService.Setup(md => md.GetRelationshipsByPortalId(Constants.PORTAL_Zero)).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); //Act var relationships = relationshipController.GetRelationshipsByPortalId(Constants.PORTAL_Zero); @@ -497,23 +497,23 @@ public void RelationshipController_GetRelationshipsByPortalID_Returns_List_Of_Re { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); + this.dtRelationships.Clear(); for (int i = 1; i <= 5; i++) { - dtRelationships.Rows.Add(i, DefaultRelationshipTypes.Friends, DefaultRelationshipTypes.Friends.ToString(), + this.dtRelationships.Rows.Add(i, DefaultRelationshipTypes.Friends, DefaultRelationshipTypes.Friends.ToString(), DefaultRelationshipTypes.Friends.ToString(), Constants.PORTAL_Zero, Constants.USER_Null, RelationshipStatus.None); } - mockDataService.Setup(md => md.GetRelationshipsByPortalId(Constants.PORTAL_Zero)).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + mockDataService.Setup(md => md.GetRelationshipsByPortalId(Constants.PORTAL_Zero)).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Zero, Constants.PORTALGROUP_ValidPortalGroupId); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Zero)).Returns(mockPortalInfo); List portalGroups = new List() { CreatePortalGroupInfo(Constants.PORTALGROUP_ValidPortalGroupId, Constants.PORTAL_Zero) }; // CreatePortalGroupInfo(Constants.PORTALGROUP_ValidPortalGroupId, Constants.PORTAL_Zero); - _portalGroupController.Setup(pgc => pgc.GetPortalGroups()).Returns(portalGroups); + this._portalGroupController.Setup(pgc => pgc.GetPortalGroups()).Returns(portalGroups); //Act var relationships = relationshipController.GetRelationshipsByPortalId(Constants.PORTAL_Zero); @@ -528,12 +528,12 @@ public void RelationshipController_GetRelationshipsByPortalID_Returns_EmptyList_ { //Arrange var mockDataService = new Mock(); - dtRelationships.Clear(); - mockDataService.Setup(md => md.GetRelationshipsByPortalId(Constants.PORTAL_Null)).Returns(dtRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + this.dtRelationships.Clear(); + mockDataService.Setup(md => md.GetRelationshipsByPortalId(Constants.PORTAL_Null)).Returns(this.dtRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); var mockPortalInfo = CreatePortalInfo(Constants.PORTAL_Null, Null.NullInteger); - _portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Null)).Returns(mockPortalInfo); + this._portalController.Setup(pc => pc.GetPortal(Constants.PORTAL_Null)).Returns(mockPortalInfo); //Act var relationships = relationshipController.GetRelationshipsByPortalId(Constants.PORTAL_Null); @@ -548,7 +548,7 @@ public void RelationshipController_GetRelationshipsByPortalID_Returns_EmptyList_ public void RelationshipController_SaveRelationship_Throws_On_Null_Relationship() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.SaveRelationship(null); @@ -558,8 +558,8 @@ public void RelationshipController_SaveRelationship_Throws_On_Null_Relationship( public void RelationshipController_SaveRelationship_Calls_DataService() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); var relationship = new Relationship { RelationshipId = Constants.SOCIAL_FollowerRelationshipID @@ -578,9 +578,9 @@ public void RelationshipController_SaveRelationship_Calls_EventLogController_Add //Arrange var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); - var relationshipController = CreateRelationshipController(mockEventLogController); + var relationshipController = this.CreateRelationshipController(mockEventLogController); var relationship = new Relationship { RelationshipId = Constants.SOCIAL_FollowerRelationshipID, @@ -599,7 +599,7 @@ public void RelationshipController_SaveRelationship_Calls_EventLogController_Add public void RelationshipController_SaveRelationship_Calls_DataCache_RemoveCache() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); var cacheKey = CachingProvider.GetCacheKey(DataCache.RelationshipTypesCacheKey); var relationshipType = new RelationshipType() { @@ -610,7 +610,7 @@ public void RelationshipController_SaveRelationship_Calls_DataCache_RemoveCache( relationshipController.SaveRelationshipType(relationshipType); //Assert - mockCachingProvider.Verify(e => e.Remove(cacheKey)); + this.mockCachingProvider.Verify(e => e.Remove(cacheKey)); } #endregion @@ -622,7 +622,7 @@ public void RelationshipController_SaveRelationship_Calls_DataCache_RemoveCache( public void RelationshipController_DeleteUserRelationship_Throws_On_Null_UserRelationship() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.DeleteUserRelationship(null); @@ -632,8 +632,8 @@ public void RelationshipController_DeleteUserRelationship_Throws_On_Null_UserRel public void RelationshipController_DeleteUserRelationship_Calls_DataService() { //Arrange - var mockDataService = CreateMockDataServiceWithRelationshipTypes(); - var relationshipController = CreateRelationshipController(mockDataService); + var mockDataService = this.CreateMockDataServiceWithRelationshipTypes(); + var relationshipController = this.CreateRelationshipController(mockDataService); var userRelationship = new UserRelationship() { UserRelationshipId = Constants.SOCIAL_UserRelationshipIDUser10User11 @@ -652,9 +652,9 @@ public void RelationshipController_DeleteUserRelationship_Calls_EventLogControll //Arrange var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); - var relationshipController = CreateRelationshipController(mockEventLogController); + var relationshipController = this.CreateRelationshipController(mockEventLogController); var userRelationship = new UserRelationship { UserRelationshipId = Constants.SOCIAL_UserRelationshipIDUser10User11, @@ -678,10 +678,10 @@ public void RelationshipController_GetUserRelationship_Returns_Relationship_For_ { //Arrange var mockDataService = new Mock(); - dtUserRelationships.Clear(); - dtUserRelationships.Rows.Add(userRelationshipId, userId, relatedUserId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); - mockDataService.Setup(md => md.GetUserRelationship(userRelationshipId)).Returns(dtUserRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + this.dtUserRelationships.Clear(); + this.dtUserRelationships.Rows.Add(userRelationshipId, userId, relatedUserId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); + mockDataService.Setup(md => md.GetUserRelationship(userRelationshipId)).Returns(this.dtUserRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var userRelationship = relationshipController.GetUserRelationship(userRelationshipId); @@ -695,9 +695,9 @@ public void RelationshipController_GetUserRelationship_Returns_Null_For_InValid_ { //Arrange var mockDataService = new Mock(); - dtUserRelationships.Clear(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + this.dtUserRelationships.Clear(); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var userRelationship = relationshipController.GetUserRelationship(Constants.SOCIAL_InValidUserRelationship); @@ -711,14 +711,14 @@ public void RelationshipController_GetUserRelationships_Returns_List_Of_UserRela { //Arrange var mockDataService = new Mock(); - dtUserRelationships.Clear(); + this.dtUserRelationships.Clear(); for (int i = 1; i <= 5; i++) { - dtUserRelationships.Rows.Add(i, Constants.USER_ValidId, Constants.USER_TenId, + this.dtUserRelationships.Rows.Add(i, Constants.USER_ValidId, Constants.USER_TenId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); } - mockDataService.Setup(md => md.GetUserRelationships(Constants.USER_ValidId)).Returns(dtUserRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + mockDataService.Setup(md => md.GetUserRelationships(Constants.USER_ValidId)).Returns(this.dtUserRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var user = new UserInfo {UserID = Constants.USER_ValidId}; @@ -734,10 +734,10 @@ public void RelationshipController_GetUserRelationships_Returns_EmptyList_Of_Use { //Arrange var mockDataService = new Mock(); - dtUserRelationships.Clear(); + this.dtUserRelationships.Clear(); - mockDataService.Setup(md => md.GetUserRelationships(Constants.USER_InValidId)).Returns(dtUserRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + mockDataService.Setup(md => md.GetUserRelationships(Constants.USER_InValidId)).Returns(this.dtUserRelationships.CreateDataReader()); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var user = new UserInfo { UserID = Constants.USER_InValidId }; @@ -754,7 +754,7 @@ public void RelationshipController_GetUserRelationships_Returns_EmptyList_Of_Use public void RelationshipController_SaveUserRelationship_Throws_On_Null_UserRelationship() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.SaveUserRelationship(null); @@ -765,7 +765,7 @@ public void RelationshipController_SaveUserRelationship_Calls_DataService() { //Arrange var mockDataService = new Mock(); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); var userRelationship = new UserRelationship() { UserRelationshipId = Constants.SOCIAL_UserRelationshipIDUser10User11 @@ -787,7 +787,7 @@ public void RelationshipController_SaveUserRelationship_Calls_EventLogController .Returns(Constants.SOCIAL_UserRelationshipIDUser10User11); var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); var relationshipController = new RelationshipControllerImpl(mockDataService.Object, mockEventLogController.Object); var userRelationship = new UserRelationship @@ -815,7 +815,7 @@ public void RelationshipController_SaveUserRelationship_Calls_EventLogController public void RelationshipController_DeleteUserRelationshipPreference_Throws_On_Null_UserRelationshipPreference() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.DeleteUserRelationshipPreference(null); @@ -826,7 +826,7 @@ public void RelationshipController_DeleteUserRelationshipPreference_Calls_DataSe { //Arrange var mockDataService = new Mock(); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); var preference = new UserRelationshipPreference() { PreferenceId = Constants.SOCIAL_PrefereceIDForUser11 @@ -845,9 +845,9 @@ public void RelationshipController_DeleteUserRelationshipPreference_Calls_EventL //Arrange var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); - var relationshipController = CreateRelationshipController(mockEventLogController); + var relationshipController = this.CreateRelationshipController(mockEventLogController); var preference = new UserRelationshipPreference() { PreferenceId = Constants.SOCIAL_PrefereceIDForUser11, @@ -869,8 +869,8 @@ public void RelationshipController_GetUserRelationshipPreference_Calls_DataServi //Arrange var mockDataService = new Mock(); mockDataService.Setup(ds => ds.GetUserRelationshipPreferenceById(It.IsAny())) - .Returns(dtUserRelationshipPreferences.CreateDataReader); - var relationshipController = CreateRelationshipController(mockDataService); + .Returns(this.dtUserRelationshipPreferences.CreateDataReader); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var preference = relationshipController.GetUserRelationshipPreference(Constants.SOCIAL_PrefereceIDForUser11); @@ -885,8 +885,8 @@ public void RelationshipController_GetUserRelationshipPreference_Overload_Calls_ //Arrange var mockDataService = new Mock(); mockDataService.Setup(ds => ds.GetUserRelationshipPreference(It.IsAny(), It.IsAny())) - .Returns(dtUserRelationshipPreferences.CreateDataReader); - var relationshipController = CreateRelationshipController(mockDataService); + .Returns(this.dtUserRelationshipPreferences.CreateDataReader); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var preference = relationshipController.GetUserRelationshipPreference(Constants.USER_ValidId, Constants.SOCIAL_FriendRelationshipID); @@ -900,7 +900,7 @@ public void RelationshipController_GetUserRelationshipPreference_Overload_Calls_ public void RelationshipController_SaveUserRelationshipPreference_Throws_On_Null_UserRelationshipPreference() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); //Act, Assert relationshipController.SaveUserRelationshipPreference(null); @@ -911,7 +911,7 @@ public void RelationshipController_SaveUserRelationshipPreference_Calls_DataServ { //Arrange var mockDataService = new Mock(); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); var preference = new UserRelationshipPreference() { PreferenceId = Constants.SOCIAL_PrefereceIDForUser11, @@ -935,7 +935,7 @@ public void RelationshipController_SaveUserRelationshipPreference_Calls_EventLog .Returns(Constants.SOCIAL_PrefereceIDForUser11); var mockEventLogController = new Mock(); mockEventLogController.Setup(c => c.AddLog(It.IsAny(), It.IsAny(), It.IsAny())); - CreateLocalizationProvider(); + this.CreateLocalizationProvider(); var relationshipController = new RelationshipControllerImpl(mockDataService.Object, mockEventLogController.Object); var preference = new UserRelationshipPreference() @@ -964,7 +964,7 @@ public void RelationshipController_SaveUserRelationshipPreference_Calls_EventLog public void RelationshipController_InitiateUserRelationship_Throws_On_Negative_RelationshipID() { //Arrange - var relationshipController = CreateRelationshipController(); + var relationshipController = this.CreateRelationshipController(); var initiatingUser = new UserInfo { UserID = Constants.USER_TenId, PortalID = Constants.PORTAL_Zero }; var targetUser = new UserInfo {UserID = Constants.USER_ElevenId, PortalID = Constants.PORTAL_Zero}; var relationship = new Relationship(); @@ -981,16 +981,16 @@ public void RelationshipController_InitiateUserRelationship_Returns_Status_Accep var targetUser = new UserInfo { UserID = Constants.USER_ElevenId, PortalID = Constants.PORTAL_Zero }; var relationship = new Relationship { RelationshipId = Constants.SOCIAL_FollowerRelationshipID, RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID, DefaultResponse = RelationshipStatus.Accepted }; - dtUserRelationships.Rows.Clear(); - dtUserRelationshipPreferences.Rows.Clear(); + this.dtUserRelationships.Rows.Clear(); + this.dtUserRelationshipPreferences.Rows.Clear(); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); - mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(dtUserRelationshipPreferences.CreateDataReader()); - mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(dtRelationshipTypes.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(this.dtUserRelationshipPreferences.CreateDataReader()); + mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(this.dtRelationshipTypes.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var userRelationship = relationshipController.InitiateUserRelationship(initiatingUser, targetUser, relationship); @@ -1007,16 +1007,16 @@ public void RelationshipController_InitiateUserRelationship_Returns_Status_Initi var targetUser = new UserInfo { UserID = Constants.USER_ElevenId, PortalID = Constants.PORTAL_Zero }; var relationship = new Relationship { RelationshipId = Constants.SOCIAL_FollowerRelationshipID, RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID, DefaultResponse = RelationshipStatus.None }; - dtUserRelationships.Rows.Clear(); - dtUserRelationshipPreferences.Rows.Clear(); + this.dtUserRelationships.Rows.Clear(); + this.dtUserRelationshipPreferences.Rows.Clear(); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); - mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(dtUserRelationshipPreferences.CreateDataReader()); - mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(dtRelationshipTypes.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(this.dtUserRelationshipPreferences.CreateDataReader()); + mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(this.dtRelationshipTypes.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var userRelationship = relationshipController.InitiateUserRelationship(initiatingUser, targetUser, relationship); @@ -1033,17 +1033,17 @@ public void RelationshipController_InitiateUserRelationship_Returns_Status_Accep var targetUser = new UserInfo { UserID = Constants.USER_ElevenId, PortalID = Constants.PORTAL_Zero }; var relationship = new Relationship { RelationshipId = Constants.SOCIAL_FollowerRelationshipID, RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID, DefaultResponse = RelationshipStatus.Accepted }; - dtUserRelationships.Rows.Clear(); - dtUserRelationshipPreferences.Rows.Clear(); - dtUserRelationshipPreferences.Rows.Add(Constants.SOCIAL_PrefereceIDForUser11, Constants.USER_TenId, Constants.USER_ElevenId, RelationshipStatus.Accepted); + this.dtUserRelationships.Rows.Clear(); + this.dtUserRelationshipPreferences.Rows.Clear(); + this.dtUserRelationshipPreferences.Rows.Add(Constants.SOCIAL_PrefereceIDForUser11, Constants.USER_TenId, Constants.USER_ElevenId, RelationshipStatus.Accepted); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); - mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(dtUserRelationshipPreferences.CreateDataReader()); - mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(dtRelationshipTypes.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(this.dtUserRelationshipPreferences.CreateDataReader()); + mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(this.dtRelationshipTypes.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var userRelationship = relationshipController.InitiateUserRelationship(initiatingUser, targetUser, relationship); @@ -1060,17 +1060,17 @@ public void RelationshipController_InitiateUserRelationship_Returns_Status_Initi var targetUser = new UserInfo { UserID = Constants.USER_ElevenId, PortalID = Constants.PORTAL_Zero }; var relationship = new Relationship { RelationshipId = Constants.SOCIAL_FollowerRelationshipID, RelationshipTypeId = Constants.SOCIAL_FollowerRelationshipTypeID, DefaultResponse = RelationshipStatus.Accepted }; - dtUserRelationships.Rows.Clear(); - dtUserRelationshipPreferences.Rows.Clear(); - dtUserRelationshipPreferences.Rows.Add(Constants.SOCIAL_PrefereceIDForUser11, Constants.USER_TenId, Constants.USER_ElevenId, RelationshipStatus.None); + this.dtUserRelationships.Rows.Clear(); + this.dtUserRelationshipPreferences.Rows.Clear(); + this.dtUserRelationshipPreferences.Rows.Add(Constants.SOCIAL_PrefereceIDForUser11, Constants.USER_TenId, Constants.USER_ElevenId, RelationshipStatus.None); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); - mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(dtUserRelationshipPreferences.CreateDataReader()); - mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(dtRelationshipTypes.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationshipPreference(It.IsAny(), It.IsAny())).Returns(this.dtUserRelationshipPreferences.CreateDataReader()); + mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(this.dtRelationshipTypes.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act var userRelationship = relationshipController.InitiateUserRelationship(initiatingUser, targetUser, relationship); @@ -1092,13 +1092,13 @@ public void RelationshipController_RemoveUserRelationship_Throws_On_NonExistent_ //Arrange //No UserRelationship between user10 and user11 - dtUserRelationships.Rows.Clear(); + this.dtUserRelationships.Rows.Clear(); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act, Assert relationshipController.RemoveUserRelationship(Constants.SOCIAL_UserRelationshipIDUser10User11); @@ -1111,13 +1111,13 @@ public void RelationshipController_AcceptRelationship_Throws_On_NonExistent_Rela //Arrange //No UserRelationship between user10 and user11 - dtUserRelationships.Rows.Clear(); + this.dtUserRelationships.Rows.Clear(); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act, Assert relationshipController.AcceptUserRelationship(Constants.SOCIAL_UserRelationshipIDUser10User11); @@ -1133,15 +1133,15 @@ public void RelationshipController_AcceptUserRelationship_Calls_DataService_On_V //Arrange //Any UserRelationship between user10 and user11 - dtUserRelationships.Rows.Clear(); - dtUserRelationships.Rows.Add(Constants.SOCIAL_UserRelationshipIDUser10User11, Constants.USER_TenId, Constants.USER_ElevenId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); + this.dtUserRelationships.Rows.Clear(); + this.dtUserRelationships.Rows.Add(Constants.SOCIAL_UserRelationshipIDUser10User11, Constants.USER_TenId, Constants.USER_ElevenId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); mockDataService.Setup(md => md.SaveUserRelationship(It.IsAny(), It.IsAny())); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act relationshipController.AcceptUserRelationship(Constants.SOCIAL_UserRelationshipIDUser10User11); @@ -1156,15 +1156,15 @@ public void RelationshipController_RemoveUserRelationship_Calls_DataService_On_V //Arrange //Any UserRelationship between user10 and user11 - dtUserRelationships.Rows.Clear(); - dtUserRelationships.Rows.Add(Constants.SOCIAL_UserRelationshipIDUser10User11, Constants.USER_TenId, Constants.USER_ElevenId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); + this.dtUserRelationships.Rows.Clear(); + this.dtUserRelationships.Rows.Add(Constants.SOCIAL_UserRelationshipIDUser10User11, Constants.USER_TenId, Constants.USER_ElevenId, Constants.SOCIAL_FriendRelationshipID, RelationshipStatus.None); //setup mock DataService var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(dtUserRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetUserRelationship(It.IsAny())).Returns(this.dtUserRelationships.CreateDataReader()); mockDataService.Setup(md => md.DeleteUserRelationship(It.IsAny())); - var relationshipController = CreateRelationshipController(mockDataService); + var relationshipController = this.CreateRelationshipController(mockDataService); //Act relationshipController.RemoveUserRelationship(Constants.SOCIAL_UserRelationshipIDUser10User11); @@ -1184,8 +1184,8 @@ public void RelationshipController_RemoveUserRelationship_Calls_DataService_On_V private Mock CreateMockDataServiceWithRelationshipTypes() { var mockDataService = new Mock(); - mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(dtRelationshipTypes.CreateDataReader()); - mockDataService.Setup(md => md.GetRelationshipsByPortalId(It.IsAny())).Returns(dtRelationships.CreateDataReader()); + mockDataService.Setup(md => md.GetAllRelationshipTypes()).Returns(this.dtRelationshipTypes.CreateDataReader()); + mockDataService.Setup(md => md.GetRelationshipsByPortalId(It.IsAny())).Returns(this.dtRelationships.CreateDataReader()); return mockDataService; } @@ -1219,7 +1219,7 @@ private void CreateLocalizationProvider() private RelationshipControllerImpl CreateRelationshipController() { var mockDataService = new Mock(); - return CreateRelationshipController(mockDataService); + return this.CreateRelationshipController(mockDataService); } private RelationshipControllerImpl CreateRelationshipController(Mock mockDataService) @@ -1237,64 +1237,64 @@ private RelationshipControllerImpl CreateRelationshipController(Mock + + stylecop.json + App.config Designer @@ -254,6 +257,10 @@ Always + + + + diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/BaseSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/BaseSettingsTests.cs index b1639f49220..62586b8c741 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/BaseSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/BaseSettingsTests.cs @@ -37,33 +37,33 @@ public abstract class BaseSettingsTests [TestFixtureSetUp] public virtual void TestFixtureSetUp() { - MockRepository = new MockRepository(MockBehavior.Default); - MockHostController = MockRepository.Create(); + this.MockRepository = new MockRepository(MockBehavior.Default); + this.MockHostController = this.MockRepository.Create(); } [SetUp] public virtual void SetUp() { //Mock Repository and component factory - MockRepository = new MockRepository(MockBehavior.Default); + this.MockRepository = new MockRepository(MockBehavior.Default); ComponentFactory.Container = new SimpleContainer(); // Setup Mock - MockCache = MockComponentProvider.CreateNew(); - HostController.RegisterInstance(MockHostController.Object); + this.MockCache = MockComponentProvider.CreateNew(); + HostController.RegisterInstance(this.MockHostController.Object); - MockPortalController = MockRepository.Create(); - PortalController.SetTestableInstance(MockPortalController.Object); - MockModuleController = MockRepository.Create(); - ModuleController.SetTestableInstance(MockModuleController.Object); + this.MockPortalController = this.MockRepository.Create(); + PortalController.SetTestableInstance(this.MockPortalController.Object); + this.MockModuleController = this.MockRepository.Create(); + ModuleController.SetTestableInstance(this.MockModuleController.Object); // Setup mock cache - MockCacheCollection = new Hashtable(); - MockHostController.Setup(hc => hc.GetString("PerformanceSetting")).Returns("3"); - MockCache.Setup(c => c.Insert(It.IsAny(), It.IsAny())).Callback((string cacheKey, object itemToCache) => MockCacheCollection[cacheKey] = itemToCache); - MockCache.Setup(c => c.Insert(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) - .Callback((string cacheKey, object itemToCache, DNNCacheDependency dcd, DateTime dt, TimeSpan ts, CacheItemPriority cip, CacheItemRemovedCallback circ) => MockCacheCollection[cacheKey] = itemToCache); - MockCache.Setup(c => c.GetItem(It.IsAny())).Returns((string cacheKey) => MockCacheCollection[cacheKey]); + this.MockCacheCollection = new Hashtable(); + this.MockHostController.Setup(hc => hc.GetString("PerformanceSetting")).Returns("3"); + this.MockCache.Setup(c => c.Insert(It.IsAny(), It.IsAny())).Callback((string cacheKey, object itemToCache) => this.MockCacheCollection[cacheKey] = itemToCache); + this.MockCache.Setup(c => c.Insert(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Callback((string cacheKey, object itemToCache, DNNCacheDependency dcd, DateTime dt, TimeSpan ts, CacheItemPriority cip, CacheItemRemovedCallback circ) => this.MockCacheCollection[cacheKey] = itemToCache); + this.MockCache.Setup(c => c.GetItem(It.IsAny())).Returns((string cacheKey) => this.MockCacheCollection[cacheKey]); } [TearDown] diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/ModuleSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/ModuleSettingsTests.cs index b90914ca2b7..fcb6a1b3af4 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/ModuleSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/ModuleSettingsTests.cs @@ -50,7 +50,7 @@ public class ModulesSettingsRepository : SettingsRepository { } [SetCulture("ar-JO")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_ar_JO(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -58,7 +58,7 @@ public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_ar_JO(stri [SetCulture("ca-ES")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_ca_ES(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -66,7 +66,7 @@ public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_ca_ES(stri [SetCulture("zh-CN")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_zh_CN(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -74,7 +74,7 @@ public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_zh_CN(stri [SetCulture("en-US")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_en_US(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -82,7 +82,7 @@ public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_en_US(stri [SetCulture("fr-FR")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_fr_FR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -90,7 +90,7 @@ public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_fr_FR(stri [SetCulture("he-IL")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_he_IL(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -98,7 +98,7 @@ public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_he_IL(stri [SetCulture("ru-RU")] public void SaveSettings_CallsUpdateModuleSetting_WithRightParameters_ru_RU(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdateModuleSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -126,15 +126,15 @@ private void SaveSettings_CallsUpdateModuleSetting_WithRightParameters(string st ComplexProperty = complexValue, }; - MockModuleSettings(moduleInfo, new Hashtable()); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "StringProperty", stringValue)); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "IntegerProperty", integerValue.ToString())); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "DoubleProperty", doubleValue.ToString(CultureInfo.InvariantCulture))); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "BooleanProperty", booleanValue.ToString())); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "DateTimeProperty", datetimeValue.ToString("o", CultureInfo.InvariantCulture))); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "TimeSpanProperty", timeSpanValue.ToString("c", CultureInfo.InvariantCulture))); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "EnumProperty", enumValue.ToString())); - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}")); + this.MockModuleSettings(moduleInfo, new Hashtable()); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "StringProperty", stringValue)); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "IntegerProperty", integerValue.ToString())); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "DoubleProperty", doubleValue.ToString(CultureInfo.InvariantCulture))); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "BooleanProperty", booleanValue.ToString())); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "DateTimeProperty", datetimeValue.ToString("o", CultureInfo.InvariantCulture))); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "TimeSpanProperty", timeSpanValue.ToString("c", CultureInfo.InvariantCulture))); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "EnumProperty", enumValue.ToString())); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}")); var settingsRepository = new ModulesSettingsRepository(); @@ -142,7 +142,7 @@ private void SaveSettings_CallsUpdateModuleSetting_WithRightParameters(string st settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -152,15 +152,15 @@ public void SaveSettings_UpdatesCache() var moduleInfo = GetModuleInfo; var settings = new ModulesSettings(); - MockModuleSettings(moduleInfo, new Hashtable()); - MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); + this.MockModuleSettings(moduleInfo, new Hashtable()); + this.MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); var settingsRepository = new ModulesSettingsRepository(); //Act settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -169,14 +169,14 @@ public void GetSettings_CallsGetCachedObject() //Arrange var moduleInfo = GetModuleInfo; - MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new ModulesSettings()); + this.MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new ModulesSettings()); var settingsRepository = new ModulesSettingsRepository(); //Act settingsRepository.GetSettings(moduleInfo); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -184,7 +184,7 @@ public void GetSettings_CallsGetCachedObject() [SetCulture("ar-JO")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ar_JO(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -192,7 +192,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ar_JO(string str [SetCulture("ca-ES")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ca_ES(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -200,7 +200,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ca_ES(string str [SetCulture("zh-CN")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_zh_CN(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -208,7 +208,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_zh_CN(string str [SetCulture("en-US")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_en_US(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -216,7 +216,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_en_US(string str [SetCulture("fr-FR")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_fr_FR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -224,7 +224,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_fr_FR(string str [SetCulture("he-IL")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_he_IL(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -232,7 +232,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_he_IL(string str [SetCulture("ru-RU")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ru_RU(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -240,7 +240,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ru_RU(string str [SetCulture("tr-TR")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_tr_TR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } public void GetSettings_GetsValuesFrom_ModuleSettingsCollection(string stringValue, int integerValue, double doubleValue, @@ -260,7 +260,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection(string stringVal { SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}" }, }; - MockModuleSettings(moduleInfo, moduleSettings); + this.MockModuleSettings(moduleInfo, moduleSettings); var settingsRepository = new ModulesSettingsRepository(); @@ -276,7 +276,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection(string stringVal Assert.AreEqual(timeSpanValue, settings.TimeSpanProperty, "The retrieved timespan property value is not equal to the stored one"); Assert.AreEqual(enumValue, settings.EnumProperty, "The retrieved enum property value is not equal to the stored one"); Assert.AreEqual(complexValue, settings.ComplexProperty, "The retrieved complex property value is not equal to the stored one"); - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/NullableSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/NullableSettingsTests.cs index 017b3e74b5c..c555654eb35 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/NullableSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/NullableSettingsTests.cs @@ -37,7 +37,7 @@ public class MyNullableSettingsRepository : SettingsRepository pc.UpdateModuleSetting(ModuleId, "StringProperty", expectedStringValue)); + this.MockModuleController.Setup(pc => pc.UpdateModuleSetting(ModuleId, "StringProperty", expectedStringValue)); var integerString = integerValue?.ToString() ?? string.Empty; - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, "IntegerProperty", integerString, true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, "IntegerProperty", integerString, true, Null.NullString, false)); var dateTimeString = datetimeValue?.ToString("o", CultureInfo.InvariantCulture) ?? string.Empty; - MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, "DateTimeProperty", dateTimeString)); + this.MockModuleController.Setup(mc => mc.UpdateModuleSetting(ModuleId, "DateTimeProperty", dateTimeString)); var timeSpanString = timeSpanValue?.ToString("c", CultureInfo.InvariantCulture) ?? string.Empty; - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, "TimeSpanProperty", timeSpanString)); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, "TimeSpanProperty", timeSpanString)); var settingsRepository = new MyNullableSettingsRepository(); @@ -125,7 +125,7 @@ private void SaveSettings_CallsUpdateSetting_WithRightParameters(string stringVa settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -135,16 +135,16 @@ public void SaveSettings_UpdatesCache() var moduleInfo = GetModuleInfo; var settings = new MyNullableSettings(); - MockModuleSettings(moduleInfo, new Hashtable()); - MockTabModuleSettings(moduleInfo, new Hashtable()); - MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); + this.MockModuleSettings(moduleInfo, new Hashtable()); + this.MockTabModuleSettings(moduleInfo, new Hashtable()); + this.MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); var settingsRepository = new MyNullableSettingsRepository(); //Act settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -153,14 +153,14 @@ public void GetSettings_CallsGetCachedObject() //Arrange var moduleInfo = GetModuleInfo; - MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new MyNullableSettings()); + this.MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new MyNullableSettings()); var settingsRepository = new MyNullableSettingsRepository(); //Act settingsRepository.GetSettings(moduleInfo); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -168,7 +168,7 @@ public void GetSettings_CallsGetCachedObject() [SetCulture("ar-JO")] public void GetSettings_GetsValues_FromCorrectSettings_ar_JO(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -176,7 +176,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_ar_JO(string stringValue, [SetCulture("ca-ES")] public void GetSettings_GetsValues_FromCorrectSettings_ca_ES(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -184,7 +184,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_ca_ES(string stringValue, [SetCulture("zh-CN")] public void GetSettings_GetsValues_FromCorrectSettings_zh_CN(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -192,7 +192,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_zh_CN(string stringValue, [SetCulture("en-US")] public void GetSettings_GetsValues_FromCorrectSettings_en_US(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -200,7 +200,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_en_US(string stringValue, [SetCulture("fr-FR")] public void GetSettings_GetsValues_FromCorrectSettings_fr_FR(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -208,7 +208,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_fr_FR(string stringValue, [SetCulture("he-IL")] public void GetSettings_GetsValues_FromCorrectSettings_he_IL(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -216,7 +216,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_he_IL(string stringValue, [SetCulture("ru-RU")] public void GetSettings_GetsValues_FromCorrectSettings_ru_RU(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } [Test] @@ -224,7 +224,7 @@ public void GetSettings_GetsValues_FromCorrectSettings_ru_RU(string stringValue, [SetCulture("tr-TR")] public void GetSettings_GetsValues_FromCorrectSettings_tr_TR(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) { - GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); + this.GetSettings_GetsValues_FromCorrectSettings(stringValue, integerValue, datetimeValue, timeSpanValue); } private void GetSettings_GetsValues_FromCorrectSettings(string stringValue, int? integerValue, DateTime? datetimeValue, TimeSpan? timeSpanValue) @@ -236,9 +236,9 @@ private void GetSettings_GetsValues_FromCorrectSettings(string stringValue, int? var moduleSettings = new Hashtable { ["DateTimeProperty"] = datetimeValue?.ToString("o", CultureInfo.InvariantCulture) ?? string.Empty, ["StringProperty"] = expectedStringValue, }; var tabModuleSettings = new Hashtable { ["TimeSpanProperty"] = timeSpanValue?.ToString("c", CultureInfo.InvariantCulture) ?? string.Empty, }; - MockPortalSettings(moduleInfo, portalSettings); - MockModuleSettings(moduleInfo, moduleSettings); - MockTabModuleSettings(moduleInfo, tabModuleSettings); + this.MockPortalSettings(moduleInfo, portalSettings); + this.MockModuleSettings(moduleInfo, moduleSettings); + this.MockTabModuleSettings(moduleInfo, tabModuleSettings); var settingsRepository = new MyNullableSettingsRepository(); @@ -250,7 +250,7 @@ private void GetSettings_GetsValues_FromCorrectSettings(string stringValue, int? Assert.AreEqual(integerValue, settings.IntegerProperty, "The retrieved integer property value is not equal to the stored one"); Assert.AreEqual(datetimeValue, settings.DateTimeProperty, "The retrieved datetime property value is not equal to the stored one"); Assert.AreEqual(timeSpanValue, settings.TimeSpanProperty, "The retrieved timespan property value is not equal to the stored one"); - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } public readonly object[] NullableCases = diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/PortalSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/PortalSettingsTests.cs index bd240e36014..000222d7fca 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/PortalSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/PortalSettingsTests.cs @@ -50,7 +50,7 @@ public class MyPortalSettingsRepository : SettingsRepository { [SetCulture("ar-JO")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_ar_JO(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -58,7 +58,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_ar_JO(stri [SetCulture("ca-ES")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_ca_ES(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -66,7 +66,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_ca_ES(stri [SetCulture("zh-CN")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_zh_CN(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -74,7 +74,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_zh_CN(stri [SetCulture("en-US")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_en_US(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -82,7 +82,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_en_US(stri [SetCulture("fr-FR")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_fr_FR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -90,7 +90,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_fr_FR(stri [SetCulture("he-IL")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_he_IL(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -98,7 +98,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_he_IL(stri [SetCulture("ru-RU")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_ru_RU(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -106,7 +106,7 @@ public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_ru_RU(stri [SetCulture("tr-TR")] public void SaveSettings_CallsUpdatePortalSetting_WithRightParameters_tr_TR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.SaveSettings_CallsUpdatePortalSetting_WithRightParameters(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } private void SaveSettings_CallsUpdatePortalSetting_WithRightParameters(string stringValue, int integerValue, double doubleValue, @@ -126,14 +126,14 @@ private void SaveSettings_CallsUpdatePortalSetting_WithRightParameters(string st ComplexProperty = complexValue, }; - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "StringProperty", stringValue, true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "IntegerProperty", integerValue.ToString(), true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "DoubleProperty", doubleValue.ToString(CultureInfo.InvariantCulture), true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "BooleanProperty", booleanValue.ToString(), true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "DateTimeProperty", datetimeValue.ToString("o", CultureInfo.InvariantCulture), true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "TimeSpanProperty", timeSpanValue.ToString("c", CultureInfo.InvariantCulture), true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "EnumProperty", enumValue.ToString(), true, Null.NullString, false)); - MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}", true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "StringProperty", stringValue, true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "IntegerProperty", integerValue.ToString(), true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "DoubleProperty", doubleValue.ToString(CultureInfo.InvariantCulture), true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "BooleanProperty", booleanValue.ToString(), true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "DateTimeProperty", datetimeValue.ToString("o", CultureInfo.InvariantCulture), true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "TimeSpanProperty", timeSpanValue.ToString("c", CultureInfo.InvariantCulture), true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "EnumProperty", enumValue.ToString(), true, Null.NullString, false)); + this.MockPortalController.Setup(pc => pc.UpdatePortalSetting(PortalId, SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}", true, Null.NullString, false)); var settingsRepository = new MyPortalSettingsRepository(); @@ -141,7 +141,7 @@ private void SaveSettings_CallsUpdatePortalSetting_WithRightParameters(string st settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -151,14 +151,14 @@ public void SaveSettings_UpdatesCache() var moduleInfo = GetModuleInfo; var settings = new MyPortalSettings(); - MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); + this.MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); var settingsRepository = new MyPortalSettingsRepository(); //Act settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -167,14 +167,14 @@ public void GetSettings_CallsGetCachedObject() //Arrange var moduleInfo = GetModuleInfo; - MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new MyPortalSettings()); + this.MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new MyPortalSettings()); var settingsRepository = new MyPortalSettingsRepository(); //Act settingsRepository.GetSettings(moduleInfo); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -182,7 +182,7 @@ public void GetSettings_CallsGetCachedObject() [SetCulture("ar-JO")] public void GetSettings_GetsValuesFrom_PortalSettings_ar_JO(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -190,7 +190,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_ar_JO(string stringValue, [SetCulture("ca-ES")] public void GetSettings_GetsValuesFrom_PortalSettings_ca_ES(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -198,7 +198,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_ca_ES(string stringValue, [SetCulture("zh-CN")] public void GetSettings_GetsValuesFrom_PortalSettings_zh_CN(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -206,7 +206,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_zh_CN(string stringValue, [SetCulture("en-US")] public void GetSettings_GetsValuesFrom_PortalSettings_en_US(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -214,7 +214,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_en_US(string stringValue, [SetCulture("fr-FR")] public void GetSettings_GetsValuesFrom_PortalSettings_fr_FR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -222,7 +222,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_fr_FR(string stringValue, [SetCulture("he-IL")] public void GetSettings_GetsValuesFrom_PortalSettings_he_IL(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -230,7 +230,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_he_IL(string stringValue, [SetCulture("ru-RU")] public void GetSettings_GetsValuesFrom_PortalSettings_ru_RU(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -238,7 +238,7 @@ public void GetSettings_GetsValuesFrom_PortalSettings_ru_RU(string stringValue, [SetCulture("tr-TR")] public void GetSettings_GetsValuesFrom_PortalSettings_tr_TR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_PortalSettings(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } private void GetSettings_GetsValuesFrom_PortalSettings(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) @@ -257,7 +257,7 @@ private void GetSettings_GetsValuesFrom_PortalSettings(string stringValue, int i { SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}" }, }; - MockPortalSettings(moduleInfo, portalSettings); + this.MockPortalSettings(moduleInfo, portalSettings); var settingsRepository = new MyPortalSettingsRepository(); @@ -273,7 +273,7 @@ private void GetSettings_GetsValuesFrom_PortalSettings(string stringValue, int i Assert.AreEqual(timeSpanValue, settings.TimeSpanProperty, "The retrieved timespan property value is not equal to the stored one"); Assert.AreEqual(enumValue, settings.EnumProperty, "The retrieved enum property value is not equal to the stored one"); Assert.AreEqual(complexValue, settings.ComplexProperty, "The retrieved complex property value is not equal to the stored one"); - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/TabModuleSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/TabModuleSettingsTests.cs index 8d4316b16c5..1e0c2cfb122 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/TabModuleSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Modules/Settings/TabModuleSettingsTests.cs @@ -50,7 +50,7 @@ public class MyTabModuleSettingsRepository : SettingsRepository mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "StringProperty", stringValue)); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "IntegerProperty", integerValue.ToString())); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "DoubleProperty", doubleValue.ToString(CultureInfo.InvariantCulture))); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "BooleanProperty", booleanValue.ToString())); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "DateTimeProperty", datetimeValue.ToString("o", CultureInfo.InvariantCulture))); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "TimeSpanProperty", timeSpanValue.ToString("c", CultureInfo.InvariantCulture))); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "EnumProperty", enumValue.ToString())); - MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}")); + this.MockTabModuleSettings(moduleInfo, new Hashtable()); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "StringProperty", stringValue)); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "IntegerProperty", integerValue.ToString())); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "DoubleProperty", doubleValue.ToString(CultureInfo.InvariantCulture))); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "BooleanProperty", booleanValue.ToString())); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "DateTimeProperty", datetimeValue.ToString("o", CultureInfo.InvariantCulture))); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "TimeSpanProperty", timeSpanValue.ToString("c", CultureInfo.InvariantCulture))); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "EnumProperty", enumValue.ToString())); + this.MockModuleController.Setup(mc => mc.UpdateTabModuleSetting(TabModuleId, SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}")); var settingsRepository = new MyTabModuleSettingsRepository(); @@ -141,7 +141,7 @@ private void SaveSettings_CallsUpdateTabModuleSetting_WithRightParameters(string settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -151,15 +151,15 @@ public void SaveSettings_UpdatesCache() var moduleInfo = GetModuleInfo; var settings = new MyTabModuleSettings(); - MockTabModuleSettings(moduleInfo, new Hashtable()); - MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); + this.MockTabModuleSettings(moduleInfo, new Hashtable()); + this.MockCache.Setup(c => c.Insert(CacheKey(moduleInfo), settings)); var settingsRepository = new MyTabModuleSettingsRepository(); //Act settingsRepository.SaveSettings(moduleInfo, settings); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -168,15 +168,15 @@ public void GetSettings_CallsGetCachedObject() //Arrange var moduleInfo = GetModuleInfo; - MockTabModuleSettings(moduleInfo, new Hashtable()); - MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new MyTabModuleSettings()); + this.MockTabModuleSettings(moduleInfo, new Hashtable()); + this.MockCache.Setup(c => c.GetItem("DNN_" + CacheKey(moduleInfo))).Returns(new MyTabModuleSettings()); var settingsRepository = new MyTabModuleSettingsRepository(); //Act settingsRepository.GetSettings(moduleInfo); //Assert - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } [Test] @@ -184,7 +184,7 @@ public void GetSettings_CallsGetCachedObject() [SetCulture("ar-JO")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ar_JO(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -192,7 +192,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ar_JO(string str [SetCulture("ca-ES")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ca_ES(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -200,7 +200,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ca_ES(string str [SetCulture("zh-CN")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_zh_CN(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -208,7 +208,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_zh_CN(string str [SetCulture("en-US")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_en_US(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -216,7 +216,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_en_US(string str [SetCulture("fr-FR")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_fr_FR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -224,7 +224,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_fr_FR(string str [SetCulture("he-IL")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_he_IL(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -232,7 +232,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_he_IL(string str [SetCulture("ru-RU")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ru_RU(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } [Test] @@ -240,7 +240,7 @@ public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_ru_RU(string str [SetCulture("tr-TR")] public void GetSettings_GetsValuesFrom_ModuleSettingsCollection_tr_TR(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) { - GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); + this.GetSettings_GetsValuesFrom_ModuleSettingsCollection(stringValue, integerValue, doubleValue, booleanValue, datetimeValue, timeSpanValue, enumValue, complexValue); } private void GetSettings_GetsValuesFrom_ModuleSettingsCollection(string stringValue, int integerValue, double doubleValue, bool booleanValue, DateTime datetimeValue, TimeSpan timeSpanValue, TestingEnum enumValue, ComplexType complexValue) @@ -259,7 +259,7 @@ private void GetSettings_GetsValuesFrom_ModuleSettingsCollection(string stringVa { SettingNamePrefix + "ComplexProperty", $"{complexValue.X} | {complexValue.Y}" }, }; - MockTabModuleSettings(moduleInfo, tabModuleSettings); + this.MockTabModuleSettings(moduleInfo, tabModuleSettings); var settingsRepository = new MyTabModuleSettingsRepository(); @@ -275,7 +275,7 @@ private void GetSettings_GetsValuesFrom_ModuleSettingsCollection(string stringVa Assert.AreEqual(timeSpanValue, settings.TimeSpanProperty, "The retrieved timespan property value is not equal to the stored one"); Assert.AreEqual(enumValue, settings.EnumProperty, "The retrieved enum property value is not equal to the stored one"); Assert.AreEqual(complexValue, settings.ComplexProperty, "The retrieved complex property value is not equal to the stored one"); - MockRepository.VerifyAll(); + this.MockRepository.VerifyAll(); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Portals/PortalSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Portals/PortalSettingsTests.cs index fe73b0b72fb..31f8e7ba074 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Portals/PortalSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Portals/PortalSettingsTests.cs @@ -63,7 +63,7 @@ public void Constructor_Sets_PortalId_When_Passed_PortalAlias() PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -80,7 +80,7 @@ public void Constructor_Sets_PortalAlias_When_Passed_PortalAlias() PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -95,7 +95,7 @@ public void Constructor_Sets_PortalId_When_Passed_Portal() //Arrange var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portal); @@ -110,7 +110,7 @@ public void Constructor_Does_Not_Set_PortalId_When_Passed_Null_Portal() //Arrange var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, (PortalInfo)null); @@ -142,7 +142,7 @@ public void Constructor_Calls_PortalController_GetPortal_When_Passed_PortalAlias PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -157,7 +157,7 @@ public void Constructor_Calls_PortalSettingsController_LoadPortal_When_Passed_Po //Arrange var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portal); @@ -170,14 +170,14 @@ public void Constructor_Calls_PortalSettingsController_LoadPortal_When_Passed_Po public void Constructor_Calls_PortalSettingsController_LoadPortal_When_Passed_Valid_PortalAlias() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -203,14 +203,14 @@ public void Constructor_Does_Not_Call_PortalSettingsController_LoadPortal_When_P public void Constructor_Does_Not_Call_PortalSettingsController_LoadPortal_When_Passed_InValid_PortalAlias() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(InValidPortalId); + var portalAlias = this.CreatePortalAlias(InValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -242,7 +242,7 @@ public void Constructor_Calls_PortalSettingsController_LoadPortalSettings_When_P PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portal); @@ -259,7 +259,7 @@ public void Constructor_Calls_PortalSettingsController_LoadPortalSettings_When_P PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -274,7 +274,7 @@ public void Constructor_Calls_PortalSettingsController_GetActiveTab_When_Passed_ //Arrange var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portal); @@ -287,14 +287,14 @@ public void Constructor_Calls_PortalSettingsController_GetActiveTab_When_Passed_ public void Constructor_Calls_PortalSettingsController_GetActiveTab_When_Passed_Valid_PortalAlias() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -320,14 +320,14 @@ public void Constructor_Does_Not_Call_PortalSettingsController_GetActiveTab_When public void Constructor_Does_Not_Call_PortalSettingsController_GetActiveTab_When_Passed_InValid_PortalAlias() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); - var portalAlias = CreatePortalAlias(InValidPortalId); + var portalAlias = this.CreatePortalAlias(InValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); @@ -340,7 +340,7 @@ public void Constructor_Does_Not_Call_PortalSettingsController_GetActiveTab_When public void Constructor_Sets_ActiveTab_Property_If_Valid_TabId_And_PortalId() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); @@ -360,7 +360,7 @@ public void Constructor_Sets_ActiveTab_Property_If_Valid_TabId_And_PortalId() public void Constructor_Sets_ActiveTab_Property_To_Null_If_InValid_TabId_And_PortalId() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); @@ -380,7 +380,7 @@ public void Constructor_Sets_ActiveTab_Property_To_Null_If_InValid_TabId_And_Por public void Constructor_Sets_ActiveTab_Property_If_Valid_TabId_And_Portal() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalSettingsController = MockComponentProvider.CreateNew("PortalSettingsController"); mockPortalSettingsController .Setup(c => c.GetActiveTab(ValidTabId, It.IsAny())) @@ -397,7 +397,7 @@ public void Constructor_Sets_ActiveTab_Property_If_Valid_TabId_And_Portal() public void Constructor_Sets_ActiveTab_Property_If_Valid_TabId_And_PortalAlias() { //Arrange - var portal = CreatePortal(ValidPortalId); + var portal = this.CreatePortal(ValidPortalId); var mockPortalController = new Mock(); mockPortalController.Setup(c => c.GetPortal(ValidPortalId)).Returns(portal); PortalController.SetTestableInstance(mockPortalController.Object); @@ -406,7 +406,7 @@ public void Constructor_Sets_ActiveTab_Property_If_Valid_TabId_And_PortalAlias() .Setup(c => c.GetActiveTab(ValidTabId, It.IsAny())) .Returns(new TabInfo()); - var portalAlias = CreatePortalAlias(ValidPortalId); + var portalAlias = this.CreatePortalAlias(ValidPortalId); //Act var settings = new PortalSettings(ValidTabId, portalAlias); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Urls/FriendlyUrlControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Urls/FriendlyUrlControllerTests.cs index 3da47350c3a..89f91a054d6 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Urls/FriendlyUrlControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Entities/Urls/FriendlyUrlControllerTests.cs @@ -24,7 +24,7 @@ public class FriendlyUrlControllerTests [SetUp] public void SetUp() { - _mockCache = MockComponentProvider.CreateNew(); + this._mockCache = MockComponentProvider.CreateNew(); } [Test] diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/EscapedStringTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/EscapedStringTest.cs index 6c02ccd50aa..8607917b544 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/EscapedStringTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/EscapedStringTest.cs @@ -19,7 +19,7 @@ public class EscapedStringTest [Test] public void SimpleCase() { - DoTest(new[] { "first", "second" }, "first,second"); + this.DoTest(new[] { "first", "second" }, "first,second"); } [Test] @@ -41,85 +41,85 @@ public void SeperatesWithSpecifiedSeperator() [Test] public void EmbeddedSeperator() { - DoTest(new[] { "fi,rst", "second" }, @"fi\,rst,second"); + this.DoTest(new[] { "fi,rst", "second" }, @"fi\,rst,second"); } [Test] public void DoubleSeperator() { - DoTest(new[] { "fi,,rst", "second" }, @"fi\,\,rst,second"); + this.DoTest(new[] { "fi,,rst", "second" }, @"fi\,\,rst,second"); } [Test] public void MultipleSeperators() { - DoTest(new[] { "fi,rst", ",second," }, @"fi\,rst,\,second\,"); + this.DoTest(new[] { "fi,rst", ",second," }, @"fi\,rst,\,second\,"); } [Test] public void EscapeCharacter() { - DoTest(new[] { @"fi\rst", "second" }, @"fi\\rst,second"); + this.DoTest(new[] { @"fi\rst", "second" }, @"fi\\rst,second"); } [Test] public void EmbeddedEscapeSequence() { - DoTest(new[] { @"fi\,rst", "second" }, @"fi\\\,rst,second"); + this.DoTest(new[] { @"fi\,rst", "second" }, @"fi\\\,rst,second"); } [Test] public void CrazyContrivedStuff() { - DoTest(new[] { @"\\\,,fi\,rst,,\,\\", "second" }, @"\\\\\\\,\,fi\\\,rst\,\,\\\,\\\\,second"); + this.DoTest(new[] { @"\\\,,fi\,rst,,\,\\", "second" }, @"\\\\\\\,\,fi\\\,rst\,\,\\\,\\\\,second"); } [Test] public void EmptyElement() { - DoTest(new[] { "first", "", "third" }, "first,,third"); + this.DoTest(new[] { "first", "", "third" }, "first,,third"); } [Test] public void MultipleEmptyElements() { - DoTest(new[] {"", "", ""}, ",,"); + this.DoTest(new[] {"", "", ""}, ",,"); } [Test] public void EmptyEnumerable() { - DoTest(new object[] {}, ""); + this.DoTest(new object[] {}, ""); } [Test] public void SingleElement() { - DoTest(new [] {"only item here"}, "only item here"); + this.DoTest(new [] {"only item here"}, "only item here"); } [Test] public void AllEscapeChars() { - DoTest(new [] {@"\", @"\\", @"\\\"}, @"\\,\\\\,\\\\\\"); + this.DoTest(new [] {@"\", @"\\", @"\\\"}, @"\\,\\\\,\\\\\\"); } [Test] public void AllSeperatorChars() { - DoTest(new [] {",", ",,", ",,,"}, @"\,,\,\,,\,\,\,"); + this.DoTest(new [] {",", ",,", ",,,"}, @"\,,\,\,,\,\,\,"); } [Test] public void AllEscapedSeperators() { - DoTest(new [] {@"\,", @"\,\,", @"\,\,\,"}, @"\\\,,\\\,\\\,,\\\,\\\,\\\,"); + this.DoTest(new [] {@"\,", @"\,\,", @"\,\,\,"}, @"\\\,,\\\,\\\,,\\\,\\\,\\\,"); } private void DoTest(IEnumerable enumerable, string s) { - CombineTest(enumerable, s); - SeperateTest(enumerable.Cast(), s); + this.CombineTest(enumerable, s); + this.SeperateTest(enumerable.Cast(), s); } private void SeperateTest(IEnumerable expected, string data) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/FileSystemUtilsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/FileSystemUtilsTests.cs index 2390b983d3c..3062ffde6cb 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/FileSystemUtilsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/FileSystemUtilsTests.cs @@ -29,7 +29,7 @@ public void SetUp() field.SetValue(null, null); var rootPath = Path.Combine(Globals.ApplicationMapPath, "FileSystemUtilsTest"); - PrepareRootPath(rootPath); + this.PrepareRootPath(rootPath); field.SetValue(null, rootPath); } @@ -60,7 +60,7 @@ public void DeleteFiles_Should_Not_Able_To_Delete_Root_Folder(string path) public void AddToZip_Should_Able_To_Add_Multiple_Files() { //Action - DeleteZippedFiles(); + this.DeleteZippedFiles(); var zipFilePath = Path.Combine(Globals.ApplicationMapPath, $"Test{Guid.NewGuid().ToString().Substring(0, 8)}.zip"); var files = Directory.GetFiles(Globals.ApplicationMapPath, "*.*", SearchOption.TopDirectoryOnly); using (var stream = File.Create(zipFilePath)) @@ -98,8 +98,8 @@ public void AddToZip_Should_Able_To_Add_Multiple_Files() } finally { - DeleteZippedFiles(); - DeleteUnzippedFolder(destPath); + this.DeleteZippedFiles(); + this.DeleteUnzippedFolder(destPath); } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Framework/JavaScriptLibraries/JavaScriptTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Framework/JavaScriptLibraries/JavaScriptTests.cs index 2320818bfb2..29f37005147 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Framework/JavaScriptLibraries/JavaScriptTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Framework/JavaScriptLibraries/JavaScriptTests.cs @@ -54,8 +54,8 @@ public void TearDown() public void CanRegisterLibraryByName() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -73,8 +73,8 @@ public void CanRegisterLibraryByName() public void CanRegisterLibraryByNameWithMismatchedCase() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -92,8 +92,8 @@ public void CanRegisterLibraryByNameWithMismatchedCase() public void CanRegisterLibraryByNameAndVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -111,8 +111,8 @@ public void CanRegisterLibraryByNameAndVersion() public void CanRegisterLibraryByNameAndExactVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -130,8 +130,8 @@ public void CanRegisterLibraryByNameAndExactVersion() public void CanRegisterLibraryByNameWithMismatchedCaseAndExactVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -149,8 +149,8 @@ public void CanRegisterLibraryByNameWithMismatchedCaseAndExactVersion() public void FailToRegisterLibraryByNameAndMismatchedVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -168,8 +168,8 @@ public void FailToRegisterLibraryByNameAndMismatchedVersion() public void FailToRegisterLibraryByNameAndMismatchedExactVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -187,8 +187,8 @@ public void FailToRegisterLibraryByNameAndMismatchedExactVersion() public void CanRegisterLibraryByNameAndSameMinorVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -206,8 +206,8 @@ public void CanRegisterLibraryByNameAndSameMinorVersion() public void CanRegisterLibraryByNameWithMismatchedCaseAndSameMinorVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -225,9 +225,9 @@ public void CanRegisterLibraryByNameWithMismatchedCaseAndSameMinorVersion() public void FallbackToHighestVersionLibraryWhenDifferentMinorVersion() { //Arrange - int lowerVersionJavaScriptLibraryId = libraryIdCounter++; - int higherVersionJavaScriptLibraryId = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int lowerVersionJavaScriptLibraryId = this.libraryIdCounter++; + int higherVersionJavaScriptLibraryId = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = lowerVersionJavaScriptLibraryId, LibraryName = "Test", @@ -251,9 +251,9 @@ public void FallbackToHighestVersionLibraryWhenDifferentMinorVersion() public void FallbackToHighestVersionLibraryWhenDifferentMinorVersionWithMismatchedCase() { //Arrange - int lowerVersionJavaScriptLibraryId = libraryIdCounter++; - int higherVersionJavaScriptLibraryId = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int lowerVersionJavaScriptLibraryId = this.libraryIdCounter++; + int higherVersionJavaScriptLibraryId = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = lowerVersionJavaScriptLibraryId, LibraryName = "test", @@ -277,8 +277,8 @@ public void FallbackToHighestVersionLibraryWhenDifferentMinorVersionWithMismatch public void CanRegisterLibraryByNameAndSameMajorVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -296,8 +296,8 @@ public void CanRegisterLibraryByNameAndSameMajorVersion() public void CanRegisterLibraryByNameWithMismatchedCaseAndSameMajorVersion() { //Arrange - int JavaScriptLibraryID = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int JavaScriptLibraryID = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = JavaScriptLibraryID, LibraryName = "Test", @@ -315,9 +315,9 @@ public void CanRegisterLibraryByNameWithMismatchedCaseAndSameMajorVersion() public void FallbackToHighestVersionLibraryWhenDifferentMajorVersion() { //Arrange - int lowerVersionJavaScriptLibraryId = libraryIdCounter++; - int higherVersionJavaScriptLibraryId = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int lowerVersionJavaScriptLibraryId = this.libraryIdCounter++; + int higherVersionJavaScriptLibraryId = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = lowerVersionJavaScriptLibraryId, LibraryName = "Test", @@ -341,9 +341,9 @@ public void FallbackToHighestVersionLibraryWhenDifferentMajorVersion() public void FallbackToHighestVersionLibraryWhenDifferentMajorVersionWithMismatchedCase() { //Arrange - int lowerVersionJavaScriptLibraryId = libraryIdCounter++; - int higherVersionJavaScriptLibraryId = libraryIdCounter++; - SetupJavaScriptLibraryController(new JavaScriptLibrary + int lowerVersionJavaScriptLibraryId = this.libraryIdCounter++; + int higherVersionJavaScriptLibraryId = this.libraryIdCounter++; + this.SetupJavaScriptLibraryController(new JavaScriptLibrary { JavaScriptLibraryID = lowerVersionJavaScriptLibraryId, LibraryName = "test", diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FileInfoBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FileInfoBuilder.cs index 51846febab6..cd69f3433a9 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FileInfoBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FileInfoBuilder.cs @@ -22,14 +22,14 @@ internal class FileInfoBuilder internal FileInfoBuilder() { - fileId = Constants.FOLDER_ValidFileId; - portalId = Constants.CONTENT_ValidPortalId; - startDate = DateTime.Today; - endDate = DateTime.MaxValue; - enablePublishPeriod = false; - contentItemId = Null.NullInteger; - folderMappingID = Constants.FOLDER_ValidFolderMappingID; - folderId = Constants.FOLDER_ValidFolderId; + this.fileId = Constants.FOLDER_ValidFileId; + this.portalId = Constants.CONTENT_ValidPortalId; + this.startDate = DateTime.Today; + this.endDate = DateTime.MaxValue; + this.enablePublishPeriod = false; + this.contentItemId = Null.NullInteger; + this.folderMappingID = Constants.FOLDER_ValidFolderMappingID; + this.folderId = Constants.FOLDER_ValidFolderId; } internal FileInfoBuilder WithFileId(int fileId) @@ -66,14 +66,14 @@ internal FileInfo Build() { return new FileInfo { - FileId = fileId, - PortalId = portalId, - StartDate = startDate, - EnablePublishPeriod = enablePublishPeriod, - EndDate = endDate, - ContentItemID = contentItemId, - FolderMappingID = folderMappingID, - FolderId = folderId + FileId = this.fileId, + PortalId = this.portalId, + StartDate = this.startDate, + EnablePublishPeriod = this.enablePublishPeriod, + EndDate = this.endDate, + ContentItemID = this.contentItemId, + FolderMappingID = this.folderMappingID, + FolderId = this.folderId }; } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FolderInfoBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FolderInfoBuilder.cs index 334b4131d74..05a92c62b33 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FolderInfoBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Builders/FolderInfoBuilder.cs @@ -20,12 +20,12 @@ internal class FolderInfoBuilder internal FolderInfoBuilder() { - portalId = Constants.CONTENT_ValidPortalId; - folderPath = Constants.FOLDER_ValidFolderRelativePath; - physicalPath = Constants.FOLDER_ValidFolderPath; - folderMappingID = Constants.FOLDER_ValidFolderMappingID; - folderId = Constants.FOLDER_ValidFolderId; - physicalPath = ""; + this.portalId = Constants.CONTENT_ValidPortalId; + this.folderPath = Constants.FOLDER_ValidFolderRelativePath; + this.physicalPath = Constants.FOLDER_ValidFolderPath; + this.folderMappingID = Constants.FOLDER_ValidFolderMappingID; + this.folderId = Constants.FOLDER_ValidFolderId; + this.physicalPath = ""; } internal FolderInfoBuilder WithPhysicalPath(string phisicalPath) { @@ -42,11 +42,11 @@ internal FolderInfoBuilder WithFolderId(int folderId) internal IFolderInfo Build() { var mock = new Mock(); - mock.Setup(f => f.FolderID).Returns(folderId); - mock.Setup(f => f.PortalID).Returns(portalId); - mock.Setup(f => f.FolderPath).Returns(folderPath); - mock.Setup(f => f.PhysicalPath).Returns(physicalPath); - mock.Setup(f => f.FolderMappingID).Returns(folderMappingID); + mock.Setup(f => f.FolderID).Returns(this.folderId); + mock.Setup(f => f.PortalID).Returns(this.portalId); + mock.Setup(f => f.FolderPath).Returns(this.folderPath); + mock.Setup(f => f.PhysicalPath).Returns(this.physicalPath); + mock.Setup(f => f.FolderMappingID).Returns(this.folderMappingID); return mock.Object; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Caching/DataCacheTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Caching/DataCacheTests.cs index 30cd3d915ac..9cc2643f75f 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Caching/DataCacheTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Caching/DataCacheTests.cs @@ -34,7 +34,7 @@ public void SetUp() //Create a Container ComponentFactory.Container = new SimpleContainer(); - mockCache = MockComponentProvider.CreateNew(); + this.mockCache = MockComponentProvider.CreateNew(); } #endregion @@ -45,7 +45,7 @@ public void SetUp() public void DataCache_GetCache_Should_Return_On_Correct_CacheKey() { // Arrange - mockCache.Setup(cache => cache.GetItem(GetDnnCacheKey(Constants.CACHEING_ValidKey))).ReturnsValidValue(); + this.mockCache.Setup(cache => cache.GetItem(this.GetDnnCacheKey(Constants.CACHEING_ValidKey))).ReturnsValidValue(); // Act object cacheValue = DataCache.GetCache(Constants.CACHEING_ValidKey); @@ -59,7 +59,7 @@ public void DataCache_GetCache_Should_Return_On_Correct_CacheKey() public void DataCache_GetCache_Should_Return_Null_On_Incorrect_CacheKey() { // Arrange - mockCache.Setup(cache => cache.GetItem(GetDnnCacheKey(Constants.CACHEING_InValidKey))).Returns(null); + this.mockCache.Setup(cache => cache.GetItem(this.GetDnnCacheKey(Constants.CACHEING_InValidKey))).Returns(null); // Act object cacheValue = DataCache.GetCache(Constants.CACHEING_InValidKey); @@ -84,7 +84,7 @@ public void DataCache_GetCache_Should_Throw_On_NullOrEmpty_CacheKey(string key) public void DataCache_GetCacheOfT_Should_Return_On_Correct_CacheKey() { // Arrange - mockCache.Setup(cache => cache.GetItem(GetDnnCacheKey(Constants.CACHEING_ValidKey))).ReturnsValidValue(); + this.mockCache.Setup(cache => cache.GetItem(this.GetDnnCacheKey(Constants.CACHEING_ValidKey))).ReturnsValidValue(); // Act object cacheValue = DataCache.GetCache(Constants.CACHEING_ValidKey); @@ -98,7 +98,7 @@ public void DataCache_GetCacheOfT_Should_Return_On_Correct_CacheKey() public void DataCache_GetCacheOfT_Should_Return_Null_On_Incorrect_CacheKey() { // Arrange - mockCache.Setup(cache => cache.GetItem(GetDnnCacheKey(Constants.CACHEING_InValidKey))).Returns(null); + this.mockCache.Setup(cache => cache.GetItem(this.GetDnnCacheKey(Constants.CACHEING_InValidKey))).Returns(null); // Act object cacheValue = DataCache.GetCache(Constants.CACHEING_InValidKey); @@ -128,7 +128,7 @@ public void DataCache_RemoveCache_Should_Succeed_On_Valid_CacheKey() DataCache.RemoveCache(Constants.CACHEING_ValidKey); // Assert - mockCache.Verify(cache => cache.Remove(GetDnnCacheKey(Constants.CACHEING_ValidKey))); + this.mockCache.Verify(cache => cache.Remove(this.GetDnnCacheKey(Constants.CACHEING_ValidKey))); } [Test] @@ -163,9 +163,9 @@ public void DataCache_SetCache_Should_Succeed_On_Valid_CacheKey_And_Any_Value() // Assert DNNCacheDependency dep = null; - mockCache.Verify( + this.mockCache.Verify( cache => - cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), + cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, Cache.NoAbsoluteExpiration, @@ -183,7 +183,7 @@ public void DataCache_SetCache_Should_Succeed_On_Valid_CacheKey_And_Any_Value() [TestCase("")] public void DataCache_SetCache_With_Dependency_Should_Throw_On_Null_CacheKey(string key) { - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter Assert.Throws(() => DataCache.SetCache(key, Constants.CACHEING_ValidValue, dep)); } @@ -191,15 +191,15 @@ public void DataCache_SetCache_With_Dependency_Should_Throw_On_Null_CacheKey(str public void DataCache_SetCache_With_Dependency_Should_Succeed_On_Valid_CacheKey_And_Any_Value() { // Arrange - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter // Act DataCache.SetCache(Constants.CACHEING_ValidKey, Constants.CACHEING_ValidValue, dep); // Assert - mockCache.Verify( + this.mockCache.Verify( cache => - cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), + cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, Cache.NoAbsoluteExpiration, @@ -232,9 +232,9 @@ public void DataCache_SetCache_With_AbsoluteExpiration_Should_Succeed_On_Valid_C // Assert DNNCacheDependency dep = null; - mockCache.Verify( + this.mockCache.Verify( cache => - cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), + cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, @@ -268,9 +268,9 @@ public void DataCache_SetCache_With_SlidingExpiration_Should_Succeed_On_Valid_Ca // Assert // Assert DNNCacheDependency dep = null; - mockCache.Verify( + this.mockCache.Verify( cache => - cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), + cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, Cache.NoAbsoluteExpiration, @@ -288,7 +288,7 @@ public void DataCache_SetCache_With_SlidingExpiration_Should_Succeed_On_Valid_Ca [TestCase("")] public void DataCache_SetCache_With_CacheDependency_AbsoluteExpiration_SlidingExpiration_Should_Throw_On_Null_CacheKey(string key) { - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter DateTime absExpiry = DateTime.Today.AddDays(1); // DateTime doesn't matter TimeSpan slidingExpiry = TimeSpan.FromMinutes(5); // TimeSpan doesn't matter Assert.Throws(() => DataCache.SetCache(key, Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry)); @@ -298,7 +298,7 @@ public void DataCache_SetCache_With_CacheDependency_AbsoluteExpiration_SlidingEx public void DataCache_SetCache_With_CacheDependency_AbsoluteExpiration_SlidingExpiration_Should_Succeed_On_Valid_CacheKey_And_Any_Value() { // Arrange - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter DateTime absExpiry = DateTime.Today.AddDays(1); // DateTime doesn't matter TimeSpan slidingExpiry = TimeSpan.FromMinutes(5); // TimeSpan doesn't matter @@ -306,9 +306,9 @@ public void DataCache_SetCache_With_CacheDependency_AbsoluteExpiration_SlidingEx DataCache.SetCache(Constants.CACHEING_ValidKey, Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry); // Assert - mockCache.Verify( + this.mockCache.Verify( cache => - cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, CacheItemPriority.Normal, DataCache.ItemRemovedCallback)); + cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, CacheItemPriority.Normal, DataCache.ItemRemovedCallback)); } #endregion @@ -320,7 +320,7 @@ public void DataCache_SetCache_With_CacheDependency_AbsoluteExpiration_SlidingEx [TestCase("")] public void DataCache_SetCache_With_Priority_Should_Throw_On_Null_CacheKey(string key) { - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter DateTime absExpiry = DateTime.Today.AddDays(1); // DateTime doesn't matter TimeSpan slidingExpiry = TimeSpan.FromMinutes(5); // TimeSpan doesn't matter CacheItemPriority priority = CacheItemPriority.High; // Priority doesn't matter @@ -331,7 +331,7 @@ public void DataCache_SetCache_With_Priority_Should_Throw_On_Null_CacheKey(strin public void DataCache_SetCache_With_Priority_Should_Succeed_On_Valid_CacheKey_And_Any_Value() { // Arrange - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter DateTime absExpiry = DateTime.Today.AddDays(1); // DateTime doesn't matter TimeSpan slidingExpiry = TimeSpan.FromMinutes(5); // TimeSpan doesn't matter CacheItemPriority priority = CacheItemPriority.High; // Priority doesn't matter @@ -340,24 +340,24 @@ public void DataCache_SetCache_With_Priority_Should_Succeed_On_Valid_CacheKey_An DataCache.SetCache(Constants.CACHEING_ValidKey, Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, priority, null); // Assert - mockCache.Verify(cache => cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, priority, DataCache.ItemRemovedCallback)); + this.mockCache.Verify(cache => cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, priority, DataCache.ItemRemovedCallback)); } [Test] public void DataCache_SetCache_With_Callback_Should_Succeed_On_Valid_CacheKey_And_Any_Value() { // Arrange - DNNCacheDependency dep = CreateTestDependency(); // Dependency type or value doesn't matter + DNNCacheDependency dep = this.CreateTestDependency(); // Dependency type or value doesn't matter DateTime absExpiry = DateTime.Today.AddDays(1); // DateTime doesn't matter TimeSpan slidingExpiry = TimeSpan.FromMinutes(5); // TimeSpan doesn't matter - CacheItemRemovedCallback callback = ItemRemovedCallback; + CacheItemRemovedCallback callback = this.ItemRemovedCallback; // Act - DataCache.SetCache(Constants.CACHEING_ValidKey, Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, CacheItemPriority.Normal, ItemRemovedCallback); + DataCache.SetCache(Constants.CACHEING_ValidKey, Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, CacheItemPriority.Normal, this.ItemRemovedCallback); // Assert - mockCache.Verify( - cache => cache.Insert(GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, CacheItemPriority.Normal, ItemRemovedCallback)); + this.mockCache.Verify( + cache => cache.Insert(this.GetDnnCacheKey(Constants.CACHEING_ValidKey), Constants.CACHEING_ValidValue, dep, absExpiry, slidingExpiry, CacheItemPriority.Normal, this.ItemRemovedCallback)); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/DatabaseFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/DatabaseFolderProviderTests.cs index ca1661d16e1..1e41c53f0d6 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/DatabaseFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/DatabaseFolderProviderTests.cs @@ -42,15 +42,15 @@ public class DatabaseFolderProviderTests [SetUp] public void Setup() { - _dfp = new DatabaseFolderProvider(); - _mockData = MockComponentProvider.CreateDataProvider(); - _folderInfo = new Mock(); - _fileInfo = new Mock(); - _folderManager = new Mock(); - _fileManager = new Mock(); + this._dfp = new DatabaseFolderProvider(); + this._mockData = MockComponentProvider.CreateDataProvider(); + this._folderInfo = new Mock(); + this._fileInfo = new Mock(); + this._folderManager = new Mock(); + this._fileManager = new Mock(); - FolderManager.RegisterInstance(_folderManager.Object); - FileManager.RegisterInstance(_fileManager.Object); + FolderManager.RegisterInstance(this._folderManager.Object); + FileManager.RegisterInstance(this._fileManager.Object); } [TearDown] @@ -69,7 +69,7 @@ public void AddFile_Throws_On_Null_Folder() { var stream = new Mock(); - _dfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object); + this._dfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object); } [Test] @@ -80,7 +80,7 @@ public void AddFile_Throws_On_NullOrEmpty_FileName(string fileName) { var stream = new Mock(); - _dfp.AddFile(_folderInfo.Object, fileName, stream.Object); + this._dfp.AddFile(this._folderInfo.Object, fileName, stream.Object); } #endregion @@ -91,17 +91,17 @@ public void AddFile_Throws_On_NullOrEmpty_FileName(string fileName) [ExpectedException(typeof(ArgumentNullException))] public void DeleteFile_Throws_On_Null_File() { - _dfp.DeleteFile(null); + this._dfp.DeleteFile(null); } [Test] public void DeleteFile_Calls_DataProvider_ClearFileContent() { - _fileInfo.Setup(fi => fi.FileId).Returns(Constants.FOLDER_ValidFileId); + this._fileInfo.Setup(fi => fi.FileId).Returns(Constants.FOLDER_ValidFileId); - _dfp.DeleteFile(_fileInfo.Object); + this._dfp.DeleteFile(this._fileInfo.Object); - _mockData.Verify(md => md.ClearFileContent(Constants.FOLDER_ValidFileId), Times.Once()); + this._mockData.Verify(md => md.ClearFileContent(Constants.FOLDER_ValidFileId), Times.Once()); } #endregion @@ -112,25 +112,25 @@ public void DeleteFile_Calls_DataProvider_ClearFileContent() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_Folder() { - _dfp.FileExists(null, Constants.FOLDER_ValidFileName); + this._dfp.FileExists(null, Constants.FOLDER_ValidFileName); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_FileName() { - _dfp.FileExists(_folderInfo.Object, null); + this._dfp.FileExists(this._folderInfo.Object, null); } [Test] public void ExistsFile_Returns_True_When_File_Exists() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, true)).Returns(new FileInfo()); + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, true)).Returns(new FileInfo()); - var result = _dfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._dfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsTrue(result); } @@ -138,13 +138,13 @@ public void ExistsFile_Returns_True_When_File_Exists() [Test] public void ExistsFile_Returns_False_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); FileInfo file = null; - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(file); + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(file); - var result = _dfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._dfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsFalse(result); } @@ -157,7 +157,7 @@ public void ExistsFile_Returns_False_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFolder_Throws_On_Null_FolderMapping() { - _dfp.FolderExists(Constants.FOLDER_ValidFolderPath, null); + this._dfp.FolderExists(Constants.FOLDER_ValidFolderPath, null); } [Test] @@ -166,7 +166,7 @@ public void ExistsFolder_Throws_On_Null_FolderPath() { var folderMapping = new FolderMappingInfo(); - _dfp.FolderExists(null, folderMapping); + this._dfp.FolderExists(null, folderMapping); } [Test] @@ -175,9 +175,9 @@ public void ExistsFolder_Returns_True_When_Folder_Exists() var folderMapping = new FolderMappingInfo(); folderMapping.PortalID = Constants.CONTENT_ValidPortalId; - _folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(new FolderInfo()); + this._folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(new FolderInfo()); - var result = _dfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + var result = this._dfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); Assert.IsTrue(result); } @@ -189,9 +189,9 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() folderMapping.PortalID = Constants.CONTENT_ValidPortalId; FolderInfo folder = null; - _folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(folder); + this._folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(folder); - var result = _dfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + var result = this._dfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); Assert.IsFalse(result); } @@ -203,7 +203,7 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() [Test] public void GetFileAttributes_Returns_Null() { - var result = _dfp.GetFileAttributes(It.IsAny()); + var result = this._dfp.GetFileAttributes(It.IsAny()); Assert.IsNull(result); } @@ -216,7 +216,7 @@ public void GetFileAttributes_Returns_Null() [ExpectedException(typeof(ArgumentNullException))] public void GetFiles_Throws_On_Null_Folder() { - _dfp.GetFiles(null); + this._dfp.GetFiles(null); } [Test] @@ -229,11 +229,11 @@ public void GetFiles_Calls_FolderManager_GetFilesByFolder() new FileInfo { FileName = "" } }; - _folderManager.Setup(fm => fm.GetFiles(_folderInfo.Object)).Returns((IList)fileInfos); + this._folderManager.Setup(fm => fm.GetFiles(this._folderInfo.Object)).Returns((IList)fileInfos); - _dfp.GetFiles(_folderInfo.Object); + this._dfp.GetFiles(this._folderInfo.Object); - _folderManager.Verify(fm => fm.GetFiles(_folderInfo.Object), Times.Once()); + this._folderManager.Verify(fm => fm.GetFiles(this._folderInfo.Object), Times.Once()); } [Test] @@ -248,9 +248,9 @@ public void GetFiles_Count_Equals_DataProvider_GetFiles_Count() new FileInfo { FileName = "" } }; - _folderManager.Setup(fm => fm.GetFiles(_folderInfo.Object)).Returns((IList)fileInfos); + this._folderManager.Setup(fm => fm.GetFiles(this._folderInfo.Object)).Returns((IList)fileInfos); - var files = _dfp.GetFiles(_folderInfo.Object); + var files = this._dfp.GetFiles(this._folderInfo.Object); Assert.AreEqual(expectedFiles.Length, files.Length); } @@ -267,9 +267,9 @@ public void GetFiles_Returns_Valid_FileNames_When_Folder_Contains_Files() new FileInfo { FileName = "file3.txt" } }; - _folderManager.Setup(fm => fm.GetFiles(_folderInfo.Object)).Returns((IList)fileInfos); + this._folderManager.Setup(fm => fm.GetFiles(this._folderInfo.Object)).Returns((IList)fileInfos); - var files = _dfp.GetFiles(_folderInfo.Object); + var files = this._dfp.GetFiles(this._folderInfo.Object); CollectionAssert.AreEqual(expectedFiles, files); } @@ -282,27 +282,27 @@ public void GetFiles_Returns_Valid_FileNames_When_Folder_Contains_Files() [ExpectedException(typeof(ArgumentNullException))] public void GetFileStream_Throws_On_Null_Folder() { - _dfp.GetFileStream(null, Constants.FOLDER_ValidFileName); + this._dfp.GetFileStream(null, Constants.FOLDER_ValidFileName); } [Test] [ExpectedException(typeof(ArgumentException))] public void GetFileStream_Throws_On_NullOrEmpty_FileName() { - _dfp.GetFileStream(_folderInfo.Object, null); + this._dfp.GetFileStream(this._folderInfo.Object, null); } [Test] public void GetFileStream_Calls_FileManager_GetFile() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns((IFileInfo)null); + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns((IFileInfo)null); - _dfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._dfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _fileManager.Verify(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, true), Times.Once()); + this._fileManager.Verify(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, true), Times.Once()); } [Test] @@ -310,20 +310,20 @@ public void GetFileStream_Returns_Valid_Stream_When_File_Exists() { var validFileBytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); var _filesTable = new DataTable("Files"); _filesTable.Columns.Add("Content", typeof(byte[])); _filesTable.Rows.Add(validFileBytes); - _mockData.Setup(md => md.GetFileContent(Constants.FOLDER_ValidFileId)).Returns(_filesTable.CreateDataReader()); + this._mockData.Setup(md => md.GetFileContent(Constants.FOLDER_ValidFileId)).Returns(_filesTable.CreateDataReader()); - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, true)) + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, true)) .Returns(new FileInfo { FileId = Constants.FOLDER_ValidFileId, PortalId = Constants.CONTENT_ValidPortalId }); - var result = _dfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._dfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); byte[] resultBytes; var buffer = new byte[16 * 1024]; @@ -343,13 +343,13 @@ public void GetFileStream_Returns_Valid_Stream_When_File_Exists() [Test] public void GetFileStream_Returns_Null_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())) + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())) .Returns((IFileInfo)null); - var result = _dfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._dfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsNull(result); } @@ -364,7 +364,7 @@ public void GetImageUrl_Calls_IconControllerWrapper_IconURL() var iconControllerWrapper = new Mock(); IconControllerWrapper.RegisterInstance(iconControllerWrapper.Object); - _dfp.GetFolderProviderIconPath(); + this._dfp.GetFolderProviderIconPath(); iconControllerWrapper.Verify(icw => icw.IconURL("FolderDatabase", "32x32"), Times.Once()); } @@ -378,7 +378,7 @@ public void GetLastModificationTime_Returns_Null_Date() { var expectedResult = Null.NullDate; - var result = _dfp.GetLastModificationTime(_fileInfo.Object); + var result = this._dfp.GetLastModificationTime(this._fileInfo.Object); Assert.AreEqual(expectedResult, result); } @@ -391,7 +391,7 @@ public void GetLastModificationTime_Returns_Null_Date() [ExpectedException(typeof(ArgumentNullException))] public void GetSubFolders_Throws_On_Null_FolderMapping() { - _dfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList(); + this._dfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList(); } [Test] @@ -400,7 +400,7 @@ public void GetSubFolders_Throws_On_Null_FolderPath() { var folderMappingInfo = new FolderMappingInfo(); - _dfp.GetSubFolders(null, folderMappingInfo).ToList(); + this._dfp.GetSubFolders(null, folderMappingInfo).ToList(); } [Test] @@ -409,12 +409,12 @@ public void GetSubFolders_Calls_FolderManager_GetFoldersByParentFolder() var folderMapping = new FolderMappingInfo(); folderMapping.PortalID = Constants.CONTENT_ValidPortalId; - _folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object); - _folderManager.Setup(fm => fm.GetFolders(_folderInfo.Object)).Returns(new List()); + this._folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolders(this._folderInfo.Object)).Returns(new List()); - _dfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + this._dfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); - _folderManager.Verify(fm => fm.GetFolders(_folderInfo.Object), Times.Once()); + this._folderManager.Verify(fm => fm.GetFolders(this._folderInfo.Object), Times.Once()); } [Test] @@ -428,10 +428,10 @@ public void GetSubFolders_Count_Equals_DataProvider_GetFoldersByParentFolder_Cou new FolderInfo { FolderPath = Constants.FOLDER_OtherValidSubFolderRelativePath } }; - _folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object); - _folderManager.Setup(fm => fm.GetFolders(_folderInfo.Object)).Returns(subFolders); + this._folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolders(this._folderInfo.Object)).Returns(subFolders); - var result = _dfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + var result = this._dfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); Assert.AreEqual(subFolders.Count, result.Count); } @@ -452,10 +452,10 @@ public void GetSubFolders_Returns_Valid_SubFolders_When_Folder_Is_Not_Empty() new FolderInfo { FolderPath = Constants.FOLDER_OtherValidSubFolderRelativePath } }; - _folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object); - _folderManager.Setup(fm => fm.GetFolders(_folderInfo.Object)).Returns(subFolders); + this._folderManager.Setup(fm => fm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolders(this._folderInfo.Object)).Returns(subFolders); - var result = _dfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + var result = this._dfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); CollectionAssert.AreEqual(expectedResult, result); } @@ -467,7 +467,7 @@ public void GetSubFolders_Returns_Valid_SubFolders_When_Folder_Is_Not_Empty() [Test] public void IsInSync_Returns_True() { - var result = _dfp.IsInSync(It.IsAny()); + var result = this._dfp.IsInSync(It.IsAny()); Assert.IsTrue(result); } @@ -479,7 +479,7 @@ public void IsInSync_Returns_True() [Test] public void SupportsFileAttributes_Returns_False() { - var result = _dfp.SupportsFileAttributes(); + var result = this._dfp.SupportsFileAttributes(); Assert.IsFalse(result); } @@ -494,7 +494,7 @@ public void UpdateFile_Throws_On_Null_Folder() { var stream = new Mock(); - _dfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object); + this._dfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object); } [Test] @@ -505,35 +505,35 @@ public void UpdateFile_Throws_On_NullOrEmpty_FileName(string fileName) { var stream = new Mock(); - _dfp.UpdateFile(_folderInfo.Object, fileName, stream.Object); + this._dfp.UpdateFile(this._folderInfo.Object, fileName, stream.Object); } [Test] public void UpdateFile_Calls_DataProvider_UpdateFileContent_When_File_Exists() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _fileInfo.Setup(fi => fi.FileId).Returns(Constants.FOLDER_ValidFileId); + this._fileInfo.Setup(fi => fi.FileId).Returns(Constants.FOLDER_ValidFileId); - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, true)).Returns(_fileInfo.Object); + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, true)).Returns(this._fileInfo.Object); - _dfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, new MemoryStream(new byte[16 * 1024])); + this._dfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, new MemoryStream(new byte[16 * 1024])); - _mockData.Verify(md => md.UpdateFileContent(Constants.FOLDER_ValidFileId, It.IsAny()), Times.Once()); + this._mockData.Verify(md => md.UpdateFileContent(Constants.FOLDER_ValidFileId, It.IsAny()), Times.Once()); } [Test] public void UpdateFile_Does_Not_Call_DataProvider_UpdateFileContent_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _fileManager.Setup(fm => fm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns((IFileInfo)null); + this._fileManager.Setup(fm => fm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns((IFileInfo)null); - _dfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, null); + this._dfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null); - _mockData.Verify(md => md.UpdateFileContent(It.IsAny(), It.IsAny()), Times.Never()); + this._mockData.Verify(md => md.UpdateFileContent(It.IsAny(), It.IsAny()), Times.Never()); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileDeletionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileDeletionControllerTests.cs index e815bb2af46..b40b123f606 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileDeletionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileDeletionControllerTests.cs @@ -29,18 +29,18 @@ public class FileDeletionControllerTests [SetUp] public void Setup() { - _mockFileLockingController = new Mock(); - _mockData = MockComponentProvider.CreateDataProvider(); - _fileVersionController = new Mock(); - _folderMappingController = new Mock(); - _mockFolderProvider = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType); - _mockContentController = new Mock(); + this._mockFileLockingController = new Mock(); + this._mockData = MockComponentProvider.CreateDataProvider(); + this._fileVersionController = new Mock(); + this._folderMappingController = new Mock(); + this._mockFolderProvider = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType); + this._mockContentController = new Mock(); - FileLockingController.SetTestableInstance(_mockFileLockingController.Object); - FileVersionController.RegisterInstance(_fileVersionController.Object); - FolderMappingController.RegisterInstance(_folderMappingController.Object); + FileLockingController.SetTestableInstance(this._mockFileLockingController.Object); + FileVersionController.RegisterInstance(this._fileVersionController.Object); + FolderMappingController.RegisterInstance(this._folderMappingController.Object); - ComponentFactory.RegisterComponentInstance(_mockContentController.Object); + ComponentFactory.RegisterComponentInstance(this._mockContentController.Object); } [TearDown] @@ -55,23 +55,23 @@ public void DeleteFile_Calls_FolderProviderDeleteFile() { //Arrange var fileInfo = new FileInfoBuilder().Build(); - _fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); + this._fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockData.Setup(md => md.DeleteFile(It.IsAny(), It.IsAny(), It.IsAny())); + this._mockData.Setup(md => md.DeleteFile(It.IsAny(), It.IsAny(), It.IsAny())); - _mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)).Verifiable(); + this._mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)).Verifiable(); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); //Act FileDeletionController.Instance.DeleteFile(fileInfo); //Assert - _mockFolderProvider.Verify(); + this._mockFolderProvider.Verify(); } [Test] @@ -82,7 +82,7 @@ public void DeleteFile_Throws_WhenFileIsLocked() var fileInfo = new FileInfoBuilder().Build(); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(true); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(true); //Act FileDeletionController.Instance.DeleteFile(fileInfo); @@ -95,16 +95,16 @@ public void DeleteFile_Throws_WhenFolderProviderThrows() //Arrange var fileInfo = new FileInfoBuilder().Build(); - _fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); + this._fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); - _mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)).Throws(); + this._mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)).Throws(); FileDeletionController.Instance.DeleteFile(fileInfo); @@ -116,23 +116,23 @@ public void DeleteFileData_Calls_DataProviderDeleteFile() //Arrange var fileInfo = new FileInfoBuilder().Build(); - _fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); + this._fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockData.Setup(md => md.DeleteFile(Constants.CONTENT_ValidPortalId, It.IsAny(), Constants.FOLDER_ValidFolderId)).Verifiable(); + this._mockData.Setup(md => md.DeleteFile(Constants.CONTENT_ValidPortalId, It.IsAny(), Constants.FOLDER_ValidFolderId)).Verifiable(); - _mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)); + this._mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); //Act FileDeletionController.Instance.DeleteFileData(fileInfo); //Assert - _mockData.Verify(); + this._mockData.Verify(); } [Test] @@ -143,25 +143,25 @@ public void DeleteFileData_Calls_ContentControllerDeleteContentItem() .WithContentItemId(Constants.CONTENT_ValidContentItemId) .Build(); - _fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); + this._fileVersionController.Setup(fv => fv.DeleteAllUnpublishedVersions(fileInfo, false)); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockData.Setup(md => md.DeleteFile(It.IsAny(), It.IsAny(), It.IsAny())); + this._mockData.Setup(md => md.DeleteFile(It.IsAny(), It.IsAny(), It.IsAny())); - _mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)); + this._mockFolderProvider.Setup(mf => mf.DeleteFile(fileInfo)); - _mockContentController.Setup(mcc => mcc.DeleteContentItem(Constants.CONTENT_ValidContentItemId)).Verifiable(); + this._mockContentController.Setup(mcc => mcc.DeleteContentItem(Constants.CONTENT_ValidContentItemId)).Verifiable(); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(fileInfo, out someString)).Returns(false); //Act FileDeletionController.Instance.DeleteFileData(fileInfo); //Assert - _mockContentController.Verify(); + this._mockContentController.Verify(); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileLockingControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileLockingControllerTests.cs index 15202c99c9f..2ac50c2a390 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileLockingControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileLockingControllerTests.cs @@ -27,11 +27,11 @@ public class FileLockingControllerTests [SetUp] public void Setup() { - _mockWorkFlowEngine = new Mock(); - _mockUserSecurityController = new Mock(); + this._mockWorkFlowEngine = new Mock(); + this._mockUserSecurityController = new Mock(); - WorkflowEngine.SetTestableInstance(_mockWorkFlowEngine.Object); - UserSecurityController.SetTestableInstance(_mockUserSecurityController.Object); + WorkflowEngine.SetTestableInstance(this._mockWorkFlowEngine.Object); + UserSecurityController.SetTestableInstance(this._mockUserSecurityController.Object); } @@ -59,7 +59,7 @@ public void IsFileLocked_ReturnsTrue_WhenPublishPeriodIsOut() .WithEndDate(DateTime.Today.AddDays(-1)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); //Act string someReason; @@ -80,8 +80,8 @@ public void IsFileLocked_ReturnsTrue_WhenWorkflowIsNotComplete() .WithContentItemId(It.IsAny()) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); - _mockWorkFlowEngine.Setup(mwc => mwc.IsWorkflowCompleted(It.IsAny())).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); + this._mockWorkFlowEngine.Setup(mwc => mwc.IsWorkflowCompleted(It.IsAny())).Returns(false); //Act string someReason; @@ -101,7 +101,7 @@ public void IsFileLocked_ReturnsFalse_WhenUserIsHostOrAdmin() .WithEndDate(DateTime.Today.AddDays(-1)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(true); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(true); //Act string someReason; @@ -119,7 +119,7 @@ public void IsFileLocked_ReturnsFalse_WhenPublishPeriodIsIn() .WithEndDate(DateTime.Today.AddDays(2)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); //Act string someReason; @@ -137,7 +137,7 @@ public void IsFileLocked_ReturnsFalse_WhenPublishPeriodHasNotEndDate() .WithEndDate(DateTime.Today.AddDays(2)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); //Act string someReason; @@ -152,7 +152,7 @@ public void IsFileLocked_ReturnsFalse_WhenPublishPeriodIsDisabled() { //Arrange var fileInfo = new FileInfoBuilder().Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(Constants.CONTENT_ValidPortalId)).Returns(false); //Act string someReason; @@ -173,7 +173,7 @@ public void IsFileOutOfPublishPeriod_ReturnsTrue_WhenPublishPeriodIsOut() .WithEndDate(DateTime.Today.AddDays(-1)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); //Act var result = FileLockingController.Instance.IsFileOutOfPublishPeriod(fileInfo, It.IsAny(),It.IsAny()); @@ -191,7 +191,7 @@ public void IsFileOutOfPublishPeriod_ReturnsFalse_WhenUserIsHostOrAdmin() .WithEndDate(DateTime.Today.AddDays(-1)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(true); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(true); //Act var result = FileLockingController.Instance.IsFileOutOfPublishPeriod(fileInfo, It.IsAny(), It.IsAny()); @@ -208,7 +208,7 @@ public void IsFileOutOfPublishPeriod_ReturnsFalse_WhenPublishPeriodIsIn() .WithEndDate(DateTime.Today.AddDays(2)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); //Act var result = FileLockingController.Instance.IsFileOutOfPublishPeriod(fileInfo, It.IsAny(), It.IsAny()); @@ -225,7 +225,7 @@ public void IsFileOutOfPublishPeriod_ReturnsFalse_WhenPublishPeriodHasNotEndDate .WithEndDate(DateTime.Today.AddDays(2)) .WithEnablePublishPeriod(true) .Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); //Act var result = FileLockingController.Instance.IsFileOutOfPublishPeriod(fileInfo, It.IsAny(), It.IsAny()); @@ -240,7 +240,7 @@ public void IsFileOutOfPublishPeriod_ReturnsFalse_WhenPublishPeriodIsDisabled() //Arrange var fileInfo = new FileInfoBuilder().Build(); - _mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); + this._mockUserSecurityController.Setup(msc => msc.IsHostAdminUser(It.IsAny(), It.IsAny())).Returns(false); //Act var result = FileLockingController.Instance.IsFileOutOfPublishPeriod(fileInfo, It.IsAny(), It.IsAny()); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileManagerTests.cs index c0d44d0e5a1..62d7a2f6798 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FileManagerTests.cs @@ -65,45 +65,45 @@ public class FileManagerTests [SetUp] public void Setup() { - _mockData = MockComponentProvider.CreateDataProvider(); - _mockFolder = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType); - _mockCache = MockComponentProvider.CreateDataCacheProvider(); - - _folderManager = new Mock(); - _folderPermissionController = new Mock(); - _portalController = new Mock(); - _hostController = new Mock(); - _folderMappingController = new Mock(); - _fileVersionController = new Mock(); - _workflowManager = new Mock(); - _fileEventHandlersContainer = new Mock>(); - _globals = new Mock(); - _cbo = new Mock(); - _pathUtils = new Mock(); - _mockFileLockingController = new Mock(); - _mockFileDeletionController = new Mock(); + this._mockData = MockComponentProvider.CreateDataProvider(); + this._mockFolder = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType); + this._mockCache = MockComponentProvider.CreateDataCacheProvider(); + + this._folderManager = new Mock(); + this._folderPermissionController = new Mock(); + this._portalController = new Mock(); + this._hostController = new Mock(); + this._folderMappingController = new Mock(); + this._fileVersionController = new Mock(); + this._workflowManager = new Mock(); + this._fileEventHandlersContainer = new Mock>(); + this._globals = new Mock(); + this._cbo = new Mock(); + this._pathUtils = new Mock(); + this._mockFileLockingController = new Mock(); + this._mockFileDeletionController = new Mock(); EventLogController.SetTestableInstance(Mock.Of()); - FolderManager.RegisterInstance(_folderManager.Object); - FolderPermissionController.SetTestableInstance(_folderPermissionController.Object); - PortalController.SetTestableInstance(_portalController.Object); - HostController.RegisterInstance(_hostController.Object); - FolderMappingController.RegisterInstance(_folderMappingController.Object); - TestableGlobals.SetTestableInstance(_globals.Object); - CBO.SetTestableInstance(_cbo.Object); - PathUtils.RegisterInstance(_pathUtils.Object); - FileVersionController.RegisterInstance(_fileVersionController.Object); - WorkflowManager.SetTestableInstance(_workflowManager.Object); - EventHandlersContainer.RegisterInstance(_fileEventHandlersContainer.Object); - _mockFileManager = new Mock { CallBase = true }; + FolderManager.RegisterInstance(this._folderManager.Object); + FolderPermissionController.SetTestableInstance(this._folderPermissionController.Object); + PortalController.SetTestableInstance(this._portalController.Object); + HostController.RegisterInstance(this._hostController.Object); + FolderMappingController.RegisterInstance(this._folderMappingController.Object); + TestableGlobals.SetTestableInstance(this._globals.Object); + CBO.SetTestableInstance(this._cbo.Object); + PathUtils.RegisterInstance(this._pathUtils.Object); + FileVersionController.RegisterInstance(this._fileVersionController.Object); + WorkflowManager.SetTestableInstance(this._workflowManager.Object); + EventHandlersContainer.RegisterInstance(this._fileEventHandlersContainer.Object); + this._mockFileManager = new Mock { CallBase = true }; - _folderInfo = new Mock(); - _fileInfo = new Mock(); + this._folderInfo = new Mock(); + this._fileInfo = new Mock(); - _fileManager = new FileManager(); + this._fileManager = new FileManager(); - FileLockingController.SetTestableInstance(_mockFileLockingController.Object); - FileDeletionController.SetTestableInstance(_mockFileDeletionController.Object); + FileLockingController.SetTestableInstance(this._mockFileLockingController.Object); + FileDeletionController.SetTestableInstance(this._mockFileDeletionController.Object); } [TearDown] @@ -128,7 +128,7 @@ public void TearDown() [ExpectedException(typeof(ArgumentNullException))] public void AddFile_Throws_On_Null_Folder() { - _fileManager.AddFile(null, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()); + this._fileManager.AddFile(null, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()); } [Test] @@ -137,89 +137,89 @@ public void AddFile_Throws_On_Null_Folder() [ExpectedException(typeof(ArgumentException))] public void AddFile_Throws_On_Null_Or_Empty_FileName(string fileName) { - _fileManager.AddFile(_folderInfo.Object, fileName, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()); + this._fileManager.AddFile(this._folderInfo.Object, fileName, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()); } [Test] [ExpectedException(typeof(ArgumentException))] public void AddFile_Throws_On_Null_FileContent() { - _fileManager.AddFile(_folderInfo.Object, It.IsAny(), null, It.IsAny(), It.IsAny(), It.IsAny()); + this._fileManager.AddFile(this._folderInfo.Object, It.IsAny(), null, It.IsAny(), It.IsAny(), It.IsAny()); } [Test] [ExpectedException(typeof(PermissionsNotMetException))] public void AddFile_Throws_When_Permissions_Are_Not_Met() { - _folderPermissionController.Setup(fpc => fpc.CanAddFolder(_folderInfo.Object)).Returns(false); + this._folderPermissionController.Setup(fpc => fpc.CanAddFolder(this._folderInfo.Object)).Returns(false); - _fileManager.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, new MemoryStream(), It.IsAny(), true, It.IsAny()); + this._fileManager.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, new MemoryStream(), It.IsAny(), true, It.IsAny()); } [Test] [ExpectedException(typeof(NoSpaceAvailableException))] public void AddFile_Throws_When_Portal_Has_No_Space_Available() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _mockData.Setup(c => c.GetProviderPath()).Returns(String.Empty); + this._mockData.Setup(c => c.GetProviderPath()).Returns(String.Empty); var fileContent = new MemoryStream(); - _globals.Setup(g => g.GetSubFolderPath(Constants.FOLDER_ValidFilePath, Constants.CONTENT_ValidPortalId)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._globals.Setup(g => g.GetSubFolderPath(Constants.FOLDER_ValidFilePath, Constants.CONTENT_ValidPortalId)).Returns(Constants.FOLDER_ValidFolderRelativePath); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(false); + this._portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(false); - _mockFileManager.Setup(fm => fm.CreateFileContentItem()).Returns(new ContentItem()); - _mockFileManager.Setup(fm => fm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(true); + this._mockFileManager.Setup(fm => fm.CreateFileContentItem()).Returns(new ContentItem()); + this._mockFileManager.Setup(fm => fm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(true); - _mockFileManager.Object.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); + this._mockFileManager.Object.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); } [Test] public void AddFile_Checks_Space_For_Stream_Length() { //Arrange - PrepareFileSecurityCheck(); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderInfo.Setup(fi => fi.WorkflowID).Returns(Null.NullInteger); + this.PrepareFileSecurityCheck(); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.WorkflowID).Returns(Null.NullInteger); var fileContent = new MemoryStream(Encoding.ASCII.GetBytes("some data here")); - _portalController.Setup(pc => pc.HasSpaceAvailable(It.IsAny(), It.IsAny())).Returns(true); + this._portalController.Setup(pc => pc.HasSpaceAvailable(It.IsAny(), It.IsAny())).Returns(true); - _globals.Setup(g => g.GetSubFolderPath(Constants.FOLDER_ValidFilePath, Constants.CONTENT_ValidPortalId)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._globals.Setup(g => g.GetSubFolderPath(Constants.FOLDER_ValidFilePath, Constants.CONTENT_ValidPortalId)).Returns(Constants.FOLDER_ValidFolderRelativePath); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(false); - _mockFolder.Setup(mf => mf.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent)).Verifiable(); + this._mockFolder.Setup(mf => mf.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(false); + this._mockFolder.Setup(mf => mf.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent)).Verifiable(); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(true); - _mockFileManager.Setup(mfm => mfm.CreateFileContentItem()).Returns(new ContentItem()); - _mockFileManager.Setup(mfm => mfm.IsImageFile(It.IsAny())).Returns(false); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.CreateFileContentItem()).Returns(new ContentItem()); + this._mockFileManager.Setup(mfm => mfm.IsImageFile(It.IsAny())).Returns(false); - _workflowManager.Setup(we => we.GetWorkflow(It.IsAny())).Returns((Workflow)null); + this._workflowManager.Setup(we => we.GetWorkflow(It.IsAny())).Returns((Workflow)null); //Act - _mockFileManager.Object.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, true, false, Constants.CONTENTTYPE_ValidContentType); + this._mockFileManager.Object.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, true, false, Constants.CONTENTTYPE_ValidContentType); //Assert - _portalController.Verify(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)); + this._portalController.Verify(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)); } class UnSeekableStream : MemoryStream @@ -234,15 +234,15 @@ public override bool CanSeek [ExpectedException(typeof(InvalidFileExtensionException))] public void AddFile_Throws_When_Extension_Is_Invalid() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); var fileContent = new MemoryStream(); - _portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); + this._portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(false); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(false); - _mockFileManager.Object.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); + this._mockFileManager.Object.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); } [TestCase("invalid_script.svg")] @@ -251,35 +251,35 @@ public void AddFile_Throws_When_Extension_Is_Invalid() [ExpectedException(typeof(InvalidFileContentException))] public void AddFile_Throws_When_File_Content_Is_Invalid(string fileName) { - PrepareFileSecurityCheck(); + this.PrepareFileSecurityCheck(); using (var fileContent = File.OpenRead(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"Resources\\{fileName}"))) { - _portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidSvgFileName)).Returns(true); + this._portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidSvgFileName)).Returns(true); - _mockFileManager.Object.AddFile(_folderInfo.Object, Constants.FOLDER_ValidSvgFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); + this._mockFileManager.Object.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidSvgFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); } } [Test] public void AddFile_No_Error_When_File_Content_Is_Valid() { - PrepareFileSecurityCheck(); + this.PrepareFileSecurityCheck(); using (var fileContent = File.OpenRead(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources\\valid.svg"))) { - _portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidSvgFileName)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsImageFile(It.IsAny())).Returns(false); + this._portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidSvgFileName)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.IsImageFile(It.IsAny())).Returns(false); - _mockFileManager.Object.AddFile(_folderInfo.Object, Constants.FOLDER_ValidSvgFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); + this._mockFileManager.Object.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidSvgFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); } } private void PrepareFileSecurityCheck() { - _mockData.Setup(p => p.GetListEntriesByListName("FileSecurityChecker", string.Empty, Null.NullInteger)).Returns(() => + this._mockData.Setup(p => p.GetListEntriesByListName("FileSecurityChecker", string.Empty, Null.NullInteger)).Returns(() => { var dataTable = new DataTable(); dataTable.Columns.Add("EntryID", typeof(int)); @@ -310,47 +310,47 @@ private void PrepareFileSecurityCheck() return dataTable.CreateDataReader(); }); - _hostController.Setup(c => c.GetString("PerformanceSetting")).Returns("NoCaching"); - _globals.Setup(g => g.HostMapPath).Returns(AppDomain.CurrentDomain.BaseDirectory); + this._hostController.Setup(c => c.GetString("PerformanceSetting")).Returns("NoCaching"); + this._globals.Setup(g => g.HostMapPath).Returns(AppDomain.CurrentDomain.BaseDirectory); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); } [Test] public void AddFile_Does_Not_Call_FolderProvider_AddFile_When_Not_Overwritting_And_File_Exists() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderInfo.Setup(fi => fi.WorkflowID).Returns(Null.NullInteger); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.WorkflowID).Returns(Null.NullInteger); var fileContent = new MemoryStream(); - _portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); + this._portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, fileContent.Length)).Returns(true); - _globals.Setup(g => g.GetSubFolderPath(Constants.FOLDER_ValidFilePath, Constants.CONTENT_ValidPortalId)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._globals.Setup(g => g.GetSubFolderPath(Constants.FOLDER_ValidFilePath, Constants.CONTENT_ValidPortalId)).Returns(Constants.FOLDER_ValidFolderRelativePath); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(true); - _mockFolder.Setup(mf => mf.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent)); - _mockFolder.Setup(mf => mf.GetHashCode(It.IsAny())).Returns("aaa"); + this._mockFolder.Setup(mf => mf.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(true); + this._mockFolder.Setup(mf => mf.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent)); + this._mockFolder.Setup(mf => mf.GetHashCode(It.IsAny())).Returns("aaa"); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(true); - _mockFileManager.Setup(mfm => mfm.UpdateFile(It.IsAny(), It.IsAny())); - _mockFileManager.Setup(mfm => mfm.CreateFileContentItem()).Returns(new ContentItem()); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_ValidFileName)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.UpdateFile(It.IsAny(), It.IsAny())); + this._mockFileManager.Setup(mfm => mfm.CreateFileContentItem()).Returns(new ContentItem()); - _workflowManager.Setup(wc => wc.GetWorkflow(It.IsAny())).Returns((Workflow)null); + this._workflowManager.Setup(wc => wc.GetWorkflow(It.IsAny())).Returns((Workflow)null); - _mockData.Setup( + this._mockData.Setup( md => md.AddFile(It.IsAny(), It.IsAny(), @@ -374,11 +374,11 @@ public void AddFile_Does_Not_Call_FolderProvider_AddFile_When_Not_Overwritting_A It.IsAny())) .Returns(Constants.FOLDER_ValidFileId); - _mockData.Setup(md => md.UpdateFileLastModificationTime(It.IsAny(), It.IsAny())); + this._mockData.Setup(md => md.UpdateFileLastModificationTime(It.IsAny(), It.IsAny())); - _mockFileManager.Object.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); + this._mockFileManager.Object.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, false, false, Constants.CONTENTTYPE_ValidContentType); - _mockFolder.Verify(mf => mf.AddFile(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); + this._mockFolder.Verify(mf => mf.AddFile(It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); } #endregion @@ -389,14 +389,14 @@ public void AddFile_Does_Not_Call_FolderProvider_AddFile_When_Not_Overwritting_A [ExpectedException(typeof(ArgumentNullException))] public void CopyFile_Throws_On_Null_File() { - _fileManager.CopyFile(null, _folderInfo.Object); + this._fileManager.CopyFile(null, this._folderInfo.Object); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void CopyFile_Throws_On_Null_DestinationFolder() { - _fileManager.CopyFile(_fileInfo.Object, null); + this._fileManager.CopyFile(this._fileInfo.Object, null); } [Test] @@ -405,49 +405,49 @@ public void CopyFile_Calls_FileManager_AddFile_When_FolderMapping_Of_Source_And_ const int sourceFolderMappingID = Constants.FOLDER_ValidFolderMappingID; const int destinationFolderMappingID = Constants.FOLDER_ValidFolderMappingID + 1; - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.ContentType).Returns(Constants.CONTENTTYPE_ValidContentType); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(sourceFolderMappingID); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.ContentType).Returns(Constants.CONTENTTYPE_ValidContentType); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(sourceFolderMappingID); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(destinationFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(destinationFolderMappingID); var bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var fileContent = new MemoryStream(bytes); - _mockFileManager.Setup(mfm => mfm.GetFileContent(_fileInfo.Object)).Returns(fileContent); - _mockFileManager.Setup(mfm => mfm.CopyContentItem(It.IsAny())).Returns(Constants.CONTENT_ValidContentItemId); - _mockFileManager.Setup(mfm => mfm.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny(), true, true, Constants.CONTENTTYPE_ValidContentType)); + this._mockFileManager.Setup(mfm => mfm.GetFileContent(this._fileInfo.Object)).Returns(fileContent); + this._mockFileManager.Setup(mfm => mfm.CopyContentItem(It.IsAny())).Returns(Constants.CONTENT_ValidContentItemId); + this._mockFileManager.Setup(mfm => mfm.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny(), true, true, Constants.CONTENTTYPE_ValidContentType)); - _mockFileManager.Object.CopyFile(_fileInfo.Object, _folderInfo.Object); + this._mockFileManager.Object.CopyFile(this._fileInfo.Object, this._folderInfo.Object); - _mockFileManager.Verify(fm => fm.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, true, true, Constants.CONTENTTYPE_ValidContentType), Times.Once()); + this._mockFileManager.Verify(fm => fm.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent, true, true, Constants.CONTENTTYPE_ValidContentType), Times.Once()); } [Test] [ExpectedException(typeof(PermissionsNotMetException))] public void CopyFile_Throws_When_FolderMapping_Of_Source_And_Destination_Folders_Are_Equal_And_Cannot_Add_Folder() { - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderPermissionController.Setup(fpc => fpc.CanAddFolder(_folderInfo.Object)).Returns(false); + this._folderPermissionController.Setup(fpc => fpc.CanAddFolder(this._folderInfo.Object)).Returns(false); - _fileManager.CopyFile(_fileInfo.Object, _folderInfo.Object); + this._fileManager.CopyFile(this._fileInfo.Object, this._folderInfo.Object); } [Test] [ExpectedException(typeof(NoSpaceAvailableException))] public void CopyFile_Throws_When_FolderMapping_Of_Source_And_Destination_Folders_Are_Equal_And_Portal_Has_No_Space_Available() { - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _fileInfo.Setup(fi => fi.Size).Returns(Constants.FOLDER_ValidFileSize); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.Size).Returns(Constants.FOLDER_ValidFileSize); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderPermissionController.Setup(fpc => fpc.CanAddFolder(_folderInfo.Object)).Returns(true); - _portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFileSize)).Returns(false); + this._folderPermissionController.Setup(fpc => fpc.CanAddFolder(this._folderInfo.Object)).Returns(true); + this._portalController.Setup(pc => pc.HasSpaceAvailable(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFileSize)).Returns(false); - _fileManager.CopyFile(_fileInfo.Object, _folderInfo.Object); + this._fileManager.CopyFile(this._fileInfo.Object, this._folderInfo.Object); } #endregion @@ -458,34 +458,34 @@ public void CopyFile_Throws_When_FolderMapping_Of_Source_And_Destination_Folders [ExpectedException(typeof(ArgumentNullException))] public void DeleteFile_Throws_On_Null_File() { - _fileManager.DeleteFile(null); + this._fileManager.DeleteFile(null); } [Test] public void DeleteFile_Calls_FileDeletionControllerDeleteFile() { - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(_fileInfo.Object)).Verifiable(); + this._mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(this._fileInfo.Object)).Verifiable(); - _mockFileManager.Object.DeleteFile(_fileInfo.Object); + this._mockFileManager.Object.DeleteFile(this._fileInfo.Object); - _mockFileDeletionController.Verify(); + this._mockFileDeletionController.Verify(); } [Test] [ExpectedException(typeof(FolderProviderException))] public void DeleteFile_Throws_WhenFileDeletionControllerThrows() { - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(_fileInfo.Object)) + this._mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(this._fileInfo.Object)) .Throws(); - _mockFileManager.Object.DeleteFile(_fileInfo.Object); + this._mockFileManager.Object.DeleteFile(this._fileInfo.Object); } #endregion @@ -496,76 +496,76 @@ public void DeleteFile_Throws_WhenFileDeletionControllerThrows() [ExpectedException(typeof(ArgumentNullException))] public void DownloadFile_Throws_On_Null_File() { - _fileManager.WriteFileToResponse(null, ContentDisposition.Inline); + this._fileManager.WriteFileToResponse(null, ContentDisposition.Inline); } [Test] [ExpectedException(typeof(PermissionsNotMetException))] public void DownloadFile_Throws_When_Permissions_Are_Not_Met() { - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _folderPermissionController.Setup(fpc => fpc.CanViewFolder(_folderInfo.Object)).Returns(false); + this._folderPermissionController.Setup(fpc => fpc.CanViewFolder(this._folderInfo.Object)).Returns(false); - _fileManager.WriteFileToResponse(_fileInfo.Object, ContentDisposition.Inline); + this._fileManager.WriteFileToResponse(this._fileInfo.Object, ContentDisposition.Inline); } [Test] public void DownloadFile_Calls_FileManager_AutoSyncFile_When_File_AutoSync_Is_Enabled() { - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _folderPermissionController.Setup(fpc => fpc.CanViewFolder(_folderInfo.Object)).Returns(true); + this._folderPermissionController.Setup(fpc => fpc.CanViewFolder(this._folderInfo.Object)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsFileAutoSyncEnabled()).Returns(true); - _mockFileManager.Setup(mfm => mfm.AutoSyncFile(_fileInfo.Object)).Verifiable(); - _mockFileManager.Setup(mfm => mfm.WriteFileToHttpContext(_fileInfo.Object, It.IsAny())); + this._mockFileManager.Setup(mfm => mfm.IsFileAutoSyncEnabled()).Returns(true); + this._mockFileManager.Setup(mfm => mfm.AutoSyncFile(this._fileInfo.Object)).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.WriteFileToHttpContext(this._fileInfo.Object, It.IsAny())); - _mockFileManager.Object.WriteFileToResponse(_fileInfo.Object, ContentDisposition.Inline); + this._mockFileManager.Object.WriteFileToResponse(this._fileInfo.Object, ContentDisposition.Inline); - _mockFileManager.Verify(); + this._mockFileManager.Verify(); } [Test] public void DownloadFile_Does_Not_Call_FileManager_AutoSyncFile_When_File_AutoSync_Is_Not_Enabled() { - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _folderPermissionController.Setup(fpc => fpc.CanViewFolder(_folderInfo.Object)).Returns(true); + this._folderPermissionController.Setup(fpc => fpc.CanViewFolder(this._folderInfo.Object)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsFileAutoSyncEnabled()).Returns(false); - _mockFileManager.Setup(mfm => mfm.WriteFileToHttpContext(_fileInfo.Object, It.IsAny())); + this._mockFileManager.Setup(mfm => mfm.IsFileAutoSyncEnabled()).Returns(false); + this._mockFileManager.Setup(mfm => mfm.WriteFileToHttpContext(this._fileInfo.Object, It.IsAny())); - _mockFileManager.Object.WriteFileToResponse(_fileInfo.Object, ContentDisposition.Inline); + this._mockFileManager.Object.WriteFileToResponse(this._fileInfo.Object, ContentDisposition.Inline); - _mockFileManager.Verify(mfm => mfm.AutoSyncFile(_fileInfo.Object), Times.Never()); + this._mockFileManager.Verify(mfm => mfm.AutoSyncFile(this._fileInfo.Object), Times.Never()); } [Test] public void DownloadFile_Calls_FileManager_WriteBytesToHttpContext() { - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _folderPermissionController.Setup(fpc => fpc.CanViewFolder(_folderInfo.Object)).Returns(true); + this._folderPermissionController.Setup(fpc => fpc.CanViewFolder(this._folderInfo.Object)).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsFileAutoSyncEnabled()).Returns(false); - _mockFileManager.Setup(mfm => mfm.WriteFileToHttpContext(_fileInfo.Object, It.IsAny())).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.IsFileAutoSyncEnabled()).Returns(false); + this._mockFileManager.Setup(mfm => mfm.WriteFileToHttpContext(this._fileInfo.Object, It.IsAny())).Verifiable(); - _mockFileManager.Object.WriteFileToResponse(_fileInfo.Object, ContentDisposition.Inline); + this._mockFileManager.Object.WriteFileToResponse(this._fileInfo.Object, ContentDisposition.Inline); - _mockFileManager.Verify(); + this._mockFileManager.Verify(); } #endregion @@ -576,7 +576,7 @@ public void DownloadFile_Calls_FileManager_WriteBytesToHttpContext() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_Folder() { - _fileManager.FileExists(null, It.IsAny()); + this._fileManager.FileExists(null, It.IsAny()); } [Test] @@ -585,62 +585,62 @@ public void ExistsFile_Throws_On_Null_Folder() [ExpectedException(typeof(ArgumentException))] public void ExistsFile_Throws_On_Null_Or_Empty_FileName(string fileName) { - _fileManager.FileExists(_folderInfo.Object, fileName); + this._fileManager.FileExists(this._folderInfo.Object, fileName); } [Test] public void ExistsFile_Calls_FileManager_GetFile() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _mockFileManager.Setup(mfm => mfm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(null).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(null).Verifiable(); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFileManager.Object.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._mockFileManager.Object.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _mockFileManager.Verify(); + this._mockFileManager.Verify(); } [Test] public void ExistsFile_Calls_FolderProvider_ExistsFile() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _mockFileManager.Setup(mfm => mfm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(_fileInfo.Object); + this._mockFileManager.Setup(mfm => mfm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(this._fileInfo.Object); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(true).Verifiable(); + this._mockFolder.Setup(mf => mf.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(true).Verifiable(); - _mockFileManager.Object.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._mockFileManager.Object.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _mockFolder.Verify(); + this._mockFolder.Verify(); } [Test] public void ExistsFile_Returns_True_When_File_Exists() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _mockFileManager.Setup(mfm => mfm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(_fileInfo.Object); + this._mockFileManager.Setup(mfm => mfm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(this._fileInfo.Object); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(true); + this._mockFolder.Setup(mf => mf.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(true); - var result = _mockFileManager.Object.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._mockFileManager.Object.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsTrue(result); } @@ -648,19 +648,19 @@ public void ExistsFile_Returns_True_When_File_Exists() [Test] public void ExistsFile_Returns_False_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _mockFileManager.Setup(mfm => mfm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(_fileInfo.Object); + this._mockFileManager.Setup(mfm => mfm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(this._fileInfo.Object); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(false); + this._mockFolder.Setup(mf => mf.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Returns(false); - var result = _mockFileManager.Object.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._mockFileManager.Object.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsFalse(result); } @@ -669,19 +669,19 @@ public void ExistsFile_Returns_False_When_File_Does_Not_Exist() [ExpectedException(typeof(FolderProviderException))] public void ExistsFile_Throws_When_FolderProvider_Throws() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _mockFileManager.Setup(mfm => mfm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(_fileInfo.Object); + this._mockFileManager.Setup(mfm => mfm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(this._fileInfo.Object); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName)).Throws(); + this._mockFolder.Setup(mf => mf.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName)).Throws(); - _mockFileManager.Object.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._mockFileManager.Object.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); } #endregion @@ -694,45 +694,45 @@ public void ExistsFile_Throws_When_FolderProvider_Throws() [ExpectedException(typeof(ArgumentException))] public void GetFile_Throws_On_Null_Or_Empty_FileName(string fileName) { - _fileManager.GetFile(_folderInfo.Object, fileName); + this._fileManager.GetFile(this._folderInfo.Object, fileName); } [Test] public void GetFile_Calls_DataProvider_GetFile() { - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _mockData.Setup(md => md.GetFile(Constants.FOLDER_ValidFileName, Constants.FOLDER_ValidFolderId, It.IsAny())).Returns(It.IsAny()).Verifiable(); + this._mockData.Setup(md => md.GetFile(Constants.FOLDER_ValidFileName, Constants.FOLDER_ValidFolderId, It.IsAny())).Returns(It.IsAny()).Verifiable(); - _fileManager.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._fileManager.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _mockData.Verify(); + this._mockData.Verify(); } [Test] public void GetFile_Handles_Path_In_Portal_Root() { - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(x => x.GetFolder(Constants.CONTENT_ValidPortalId, "")).Returns(_folderInfo.Object).Verifiable(); - _mockData.Setup(md => md.GetFile(Constants.FOLDER_ValidFileName, Constants.FOLDER_ValidFolderId, It.IsAny())).Returns(It.IsAny()).Verifiable(); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderManager.Setup(x => x.GetFolder(Constants.CONTENT_ValidPortalId, "")).Returns(this._folderInfo.Object).Verifiable(); + this._mockData.Setup(md => md.GetFile(Constants.FOLDER_ValidFileName, Constants.FOLDER_ValidFolderId, It.IsAny())).Returns(It.IsAny()).Verifiable(); - _fileManager.GetFile(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFileName); + this._fileManager.GetFile(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFileName); - _folderManager.Verify(); - _mockData.Verify(); + this._folderManager.Verify(); + this._mockData.Verify(); } [Test] public void GetFile_Handles_Path_Beyond_Portal_Root() { - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(x => x.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object).Verifiable(); - _mockData.Setup(md => md.GetFile(Constants.FOLDER_ValidFileName, Constants.FOLDER_ValidFolderId, It.IsAny())).Returns(It.IsAny()).Verifiable(); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderManager.Setup(x => x.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object).Verifiable(); + this._mockData.Setup(md => md.GetFile(Constants.FOLDER_ValidFileName, Constants.FOLDER_ValidFolderId, It.IsAny())).Returns(It.IsAny()).Verifiable(); - _fileManager.GetFile(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath + Constants.FOLDER_ValidFileName); + this._fileManager.GetFile(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath + Constants.FOLDER_ValidFileName); - _folderManager.Verify(); - _mockData.Verify(); + this._folderManager.Verify(); + this._mockData.Verify(); } #endregion @@ -742,31 +742,31 @@ public void GetFile_Handles_Path_Beyond_Portal_Root() [Test] public void GetFileByID_Does_Not_Call_DataCache_GetCache_If_FileId_Is_Not_Valid() { - _mockCache.Setup(mc => mc.GetItem(It.IsAny())).Returns(_fileInfo.Object).Verifiable(); + this._mockCache.Setup(mc => mc.GetItem(It.IsAny())).Returns(this._fileInfo.Object).Verifiable(); - _fileManager.GetFile(Constants.FOLDER_InvalidFileId); + this._fileManager.GetFile(Constants.FOLDER_InvalidFileId); - _mockCache.Verify(mc => mc.GetItem(It.IsAny()), Times.Never()); + this._mockCache.Verify(mc => mc.GetItem(It.IsAny()), Times.Never()); } [Test] public void GetFileByID_Calls_DataCache_GetCache_First() { - _mockCache.Setup(mc => mc.GetItem(It.IsAny())).Returns(_fileInfo.Object).Verifiable(); + this._mockCache.Setup(mc => mc.GetItem(It.IsAny())).Returns(this._fileInfo.Object).Verifiable(); - _fileManager.GetFile(Constants.FOLDER_ValidFileId); + this._fileManager.GetFile(Constants.FOLDER_ValidFileId); - _mockCache.Verify(); + this._mockCache.Verify(); } [Test] public void GetFileByID_Calls_DataProvider_GetFileById_When_File_Is_Not_In_Cache() { - _mockCache.Setup(mc => mc.GetItem(It.IsAny())).Returns(null); + this._mockCache.Setup(mc => mc.GetItem(It.IsAny())).Returns(null); - _fileManager.GetFile(Constants.FOLDER_ValidFileId); + this._fileManager.GetFile(Constants.FOLDER_ValidFileId); - _mockData.Verify(md => md.GetFileById(Constants.FOLDER_ValidFileId, It.IsAny()), Times.Once()); + this._mockData.Verify(md => md.GetFileById(Constants.FOLDER_ValidFileId, It.IsAny()), Times.Once()); } #endregion @@ -777,115 +777,115 @@ public void GetFileByID_Calls_DataProvider_GetFileById_When_File_Is_Not_In_Cache [ExpectedException(typeof(ArgumentNullException))] public void MoveFile_Throws_On_Null_File() { - _fileManager.MoveFile(null, _folderInfo.Object); + this._fileManager.MoveFile(null, this._folderInfo.Object); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void MoveFile_Throws_On_Null_DestinationFolder() { - _fileManager.MoveFile(_fileInfo.Object, null); + this._fileManager.MoveFile(this._fileInfo.Object, null); } [Test] public void MoveFile_Calls_FolderProvider_AddFile_And_DeleteFile_And_FileManager_UpdateFile() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_OtherValidFolderId); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_OtherValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); var fileContent = new MemoryStream(); - _mockFileManager.Setup(mfm => mfm.GetFileContent(_fileInfo.Object)).Returns(fileContent); + this._mockFileManager.Setup(mfm => mfm.GetFileContent(this._fileInfo.Object)).Returns(fileContent); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(_fileInfo.Object, out someString)).Returns(false); - _mockFileManager.Setup(mfm => mfm.MoveVersions(_fileInfo.Object, It.IsAny(), It.IsAny(), It.IsAny())); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(this._fileInfo.Object, out someString)).Returns(false); + this._mockFileManager.Setup(mfm => mfm.MoveVersions(this._fileInfo.Object, It.IsAny(), It.IsAny(), It.IsAny())); - _mockFolder.Setup(mf => mf.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent)).Verifiable(); - _mockFolder.Setup(mf => mf.DeleteFile(_fileInfo.Object)).Verifiable(); + this._mockFolder.Setup(mf => mf.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, fileContent)).Verifiable(); + this._mockFolder.Setup(mf => mf.DeleteFile(this._fileInfo.Object)).Verifiable(); - _mockFileManager.Setup(mfm => mfm.UpdateFile(_fileInfo.Object)).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.UpdateFile(this._fileInfo.Object)).Verifiable(); - _mockFileManager.Object.MoveFile(_fileInfo.Object, _folderInfo.Object); + this._mockFileManager.Object.MoveFile(this._fileInfo.Object, this._folderInfo.Object); - _mockFolder.Verify(); - _mockFileManager.Verify(); + this._mockFolder.Verify(); + this._mockFileManager.Verify(); } [Test] public void MoveFile_Updates_FolderId_And_Folder() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _fileInfo.Setup(fi => fi.Folder).Returns(Constants.FOLDER_ValidFolderRelativePath); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.Folder).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_OtherValidFolderId); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_OtherValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_OtherValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_OtherValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _fileInfo.SetupSet(fi => fi.FolderId = Constants.FOLDER_OtherValidFolderId).Verifiable(); - _fileInfo.SetupSet(fi => fi.Folder = Constants.FOLDER_OtherValidFolderRelativePath).Verifiable(); + this._fileInfo.SetupSet(fi => fi.FolderId = Constants.FOLDER_OtherValidFolderId).Verifiable(); + this._fileInfo.SetupSet(fi => fi.Folder = Constants.FOLDER_OtherValidFolderRelativePath).Verifiable(); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); var fileContent = new MemoryStream(); - _mockFileManager.Setup(mfm => mfm.GetFileContent(_fileInfo.Object)).Returns(fileContent); + this._mockFileManager.Setup(mfm => mfm.GetFileContent(this._fileInfo.Object)).Returns(fileContent); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(_fileInfo.Object, out someString)).Returns(false); - _mockFileManager.Setup(mfm => mfm.MoveVersions(_fileInfo.Object, It.IsAny(), It.IsAny(), It.IsAny())); - _mockFileManager.Object.MoveFile(_fileInfo.Object, _folderInfo.Object); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(this._fileInfo.Object, out someString)).Returns(false); + this._mockFileManager.Setup(mfm => mfm.MoveVersions(this._fileInfo.Object, It.IsAny(), It.IsAny(), It.IsAny())); + this._mockFileManager.Object.MoveFile(this._fileInfo.Object, this._folderInfo.Object); - _fileInfo.Verify(); + this._fileInfo.Verify(); } [Test] public void MoveFile_Calls_DeleteFile_When_A_File_With_The_Same_Name_Exists_On_The_Destination_Folder() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_OtherValidFolderId); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_OtherValidFolderId); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); var fileContent = new MemoryStream(); - _mockFileManager.Setup(mfm => mfm.GetFileContent(_fileInfo.Object)).Returns(fileContent); + this._mockFileManager.Setup(mfm => mfm.GetFileContent(this._fileInfo.Object)).Returns(fileContent); string someString; - _mockFileLockingController.Setup(mflc => mflc.IsFileLocked(_fileInfo.Object, out someString)).Returns(false); - _mockFileManager.Setup(mfm => mfm.MoveVersions(_fileInfo.Object, It.IsAny(), It.IsAny(), It.IsAny())); + this._mockFileLockingController.Setup(mflc => mflc.IsFileLocked(this._fileInfo.Object, out someString)).Returns(false); + this._mockFileManager.Setup(mfm => mfm.MoveVersions(this._fileInfo.Object, It.IsAny(), It.IsAny(), It.IsAny())); var existingFile = new FileInfo(); - _mockFileManager.Setup(mfm => mfm.GetFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(existingFile); + this._mockFileManager.Setup(mfm => mfm.GetFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, It.IsAny())).Returns(existingFile); - _mockFileManager.Setup(mfm => mfm.DeleteFile(existingFile)).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.DeleteFile(existingFile)).Verifiable(); - _mockFileManager.Object.MoveFile(_fileInfo.Object, _folderInfo.Object); + this._mockFileManager.Object.MoveFile(this._fileInfo.Object, this._folderInfo.Object); - _mockFileManager.Verify(); + this._mockFileManager.Verify(); } #endregion @@ -896,7 +896,7 @@ public void MoveFile_Calls_DeleteFile_When_A_File_With_The_Same_Name_Exists_On_T [ExpectedException(typeof(ArgumentNullException))] public void RenameFile_Throws_On_Null_File() { - _fileManager.RenameFile(null, It.IsAny()); + this._fileManager.RenameFile(null, It.IsAny()); } [Test] @@ -905,96 +905,96 @@ public void RenameFile_Throws_On_Null_File() [ExpectedException(typeof(ArgumentException))] public void RenameFile_Throws_On_Null_Or_Empty_NewFileName(string newFileName) { - _fileManager.RenameFile(_fileInfo.Object, newFileName); + this._fileManager.RenameFile(this._fileInfo.Object, newFileName); } [Test] public void RenameFile_Calls_FolderProvider_RenameFile_When_FileNames_Are_Distinct_And_NewFileName_Does_Not_Exist() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _mockFileManager.Setup(mfm => mfm.FileExists(_folderInfo.Object, Constants.FOLDER_OtherValidFileName, It.IsAny())).Returns(false); - _mockFileManager.Setup(mfm => mfm.UpdateFile(_fileInfo.Object)); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_OtherValidFileName)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.FileExists(this._folderInfo.Object, Constants.FOLDER_OtherValidFileName, It.IsAny())).Returns(false); + this._mockFileManager.Setup(mfm => mfm.UpdateFile(this._fileInfo.Object)); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_OtherValidFileName)).Returns(true); var folderMapping = new FolderMappingInfo(); folderMapping.FolderProviderType = Constants.FOLDER_ValidFolderProviderType; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFileManager.Object.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName); + this._mockFileManager.Object.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName); - _mockFolder.Verify(mf => mf.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName), Times.Once()); + this._mockFolder.Verify(mf => mf.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName), Times.Once()); } [Test] public void RenameFile_Does_Not_Call_FolderProvider_RenameFile_When_FileNames_Are_Equal() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileManager.RenameFile(_fileInfo.Object, Constants.FOLDER_ValidFileName); + this._fileManager.RenameFile(this._fileInfo.Object, Constants.FOLDER_ValidFileName); - _mockFolder.Verify(mf => mf.RenameFile(_fileInfo.Object, It.IsAny()), Times.Never()); + this._mockFolder.Verify(mf => mf.RenameFile(this._fileInfo.Object, It.IsAny()), Times.Never()); } [Test] [ExpectedException(typeof(FileAlreadyExistsException))] public void RenameFile_Does_Not_Call_FolderProvider_RenameFile_When_NewFileName_Exists() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _mockFileManager.Setup(mfm => mfm.FileExists(_folderInfo.Object, Constants.FOLDER_OtherValidFileName, It.IsAny())).Returns(true); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_OtherValidFileName)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.FileExists(this._folderInfo.Object, Constants.FOLDER_OtherValidFileName, It.IsAny())).Returns(true); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_OtherValidFileName)).Returns(true); - _mockFileManager.Object.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName); + this._mockFileManager.Object.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName); } [Test] [ExpectedException(typeof(InvalidFileExtensionException))] public void RenameFile_Does_Not_Call_FolderProvider_RenameFile_When_InvalidExtensionType() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); - _mockFileManager.Setup(fm => fm.IsAllowedExtension(It.IsAny())).Returns(false); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); + this._mockFileManager.Setup(fm => fm.IsAllowedExtension(It.IsAny())).Returns(false); - _mockFileManager.Object.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherInvalidFileNameExtension); + this._mockFileManager.Object.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherInvalidFileNameExtension); } [Test] [ExpectedException(typeof(FolderProviderException))] public void RenameFile_Throws_When_FolderProvider_Throws() { - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._fileInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); - _mockFileManager.Setup(mfm => mfm.FileExists(_folderInfo.Object, Constants.FOLDER_OtherValidFileName, It.IsAny())).Returns(false); - _mockFileManager.Setup(mfm => mfm.UpdateFile(_fileInfo.Object)); - _mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_OtherValidFileName)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.FileExists(this._folderInfo.Object, Constants.FOLDER_OtherValidFileName, It.IsAny())).Returns(false); + this._mockFileManager.Setup(mfm => mfm.UpdateFile(this._fileInfo.Object)); + this._mockFileManager.Setup(mfm => mfm.IsAllowedExtension(Constants.FOLDER_OtherValidFileName)).Returns(true); var folderMapping = new FolderMappingInfo(); folderMapping.FolderProviderType = Constants.FOLDER_ValidFolderProviderType; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName)).Throws(); + this._mockFolder.Setup(mf => mf.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName)).Throws(); - _mockFileManager.Object.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName); + this._mockFileManager.Object.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName); } #endregion @@ -1005,35 +1005,35 @@ public void RenameFile_Throws_When_FolderProvider_Throws() [ExpectedException(typeof(ArgumentNullException))] public void UnzipFile_Throws_On_Null_File() { - _fileManager.UnzipFile(null, It.IsAny()); + this._fileManager.UnzipFile(null, It.IsAny()); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void UnzipFile_Throws_On_Null_DestinationFolder() { - _fileManager.UnzipFile(It.IsAny(), null); + this._fileManager.UnzipFile(It.IsAny(), null); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void UnzipFile_Throws_When_File_Extension_Is_Not_Zip() { - _fileInfo.Setup(fi => fi.Extension).Returns("txt"); + this._fileInfo.Setup(fi => fi.Extension).Returns("txt"); - _fileManager.UnzipFile(_fileInfo.Object, It.IsAny()); + this._fileManager.UnzipFile(this._fileInfo.Object, It.IsAny()); } [Test] public void UnzipFile_Calls_FileManager_ExtractFiles() { - _fileInfo.Setup(fi => fi.Extension).Returns("zip"); + this._fileInfo.Setup(fi => fi.Extension).Returns("zip"); - _mockFileManager.Setup(mfm => mfm.ExtractFiles(_fileInfo.Object, _folderInfo.Object, null)).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.ExtractFiles(this._fileInfo.Object, this._folderInfo.Object, null)).Verifiable(); - _mockFileManager.Object.UnzipFile(_fileInfo.Object, _folderInfo.Object); + this._mockFileManager.Object.UnzipFile(this._fileInfo.Object, this._folderInfo.Object); - _mockFileManager.Verify(); + this._mockFileManager.Verify(); } #endregion @@ -1044,16 +1044,16 @@ public void UnzipFile_Calls_FileManager_ExtractFiles() [ExpectedException(typeof(ArgumentNullException))] public void UpdateFile_Throws_On_Null_File() { - _fileManager.UpdateFile(null); + this._fileManager.UpdateFile(null); } [Test] public void UpdateFile_Calls_DataProvider_UpdateFile() { - _fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); - _mockFileManager.Object.UpdateFile(_fileInfo.Object); + this._fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); + this._mockFileManager.Object.UpdateFile(this._fileInfo.Object); - _mockData.Verify(md => md.UpdateFile( + this._mockData.Verify(md => md.UpdateFile( It.IsAny(), It.IsAny(), It.IsAny(), @@ -1079,7 +1079,7 @@ public void UpdateFile_Calls_DataProvider_UpdateFile() [ExpectedException(typeof(ArgumentNullException))] public void UpdateFile_Throws_On_Null_File_Overload() { - _fileManager.UpdateFile(null, It.IsAny()); + this._fileManager.UpdateFile(null, It.IsAny()); } [Test] @@ -1087,22 +1087,22 @@ public void UpdateFile_Sets_With_And_Height_When_File_Is_Image() { var image = new Bitmap(10, 20); - _mockFileManager.Setup(mfm => mfm.IsImageFile(_fileInfo.Object)).Returns(true); - _mockFileManager.Setup(mfm => mfm.GetImageFromStream(It.IsAny())).Returns(image); - _mockFileManager.Setup(mfm => mfm.GetHash(_fileInfo.Object)); + this._mockFileManager.Setup(mfm => mfm.IsImageFile(this._fileInfo.Object)).Returns(true); + this._mockFileManager.Setup(mfm => mfm.GetImageFromStream(It.IsAny())).Returns(image); + this._mockFileManager.Setup(mfm => mfm.GetHash(this._fileInfo.Object)); var bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var stream = new MemoryStream(bytes); - _fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); + this._fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); - _folderMappingController.Setup(mp => mp.GetFolderMapping(It.IsAny())).Returns(new FolderMappingInfo() { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }); - _mockFolder.Setup(fp => fp.GetHashCode(It.IsAny(), It.IsAny())).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._folderMappingController.Setup(mp => mp.GetFolderMapping(It.IsAny())).Returns(new FolderMappingInfo() { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }); + this._mockFolder.Setup(fp => fp.GetHashCode(It.IsAny(), It.IsAny())).Returns(Constants.FOLDER_UnmodifiedFileHash); - _mockFileManager.Object.UpdateFile(_fileInfo.Object, stream); + this._mockFileManager.Object.UpdateFile(this._fileInfo.Object, stream); - _fileInfo.VerifySet(fi => fi.Width = 10); - _fileInfo.VerifySet(fi => fi.Height = 20); + this._fileInfo.VerifySet(fi => fi.Width = 10); + this._fileInfo.VerifySet(fi => fi.Height = 20); } [Test] @@ -1111,17 +1111,17 @@ public void UpdateFile_Sets_SHA1Hash() var bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var stream = new MemoryStream(bytes); - _mockFileManager.Setup(mfm => mfm.IsImageFile(_fileInfo.Object)).Returns(false); - _mockFileManager.Setup(mfm => mfm.GetHash(stream)).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._mockFileManager.Setup(mfm => mfm.IsImageFile(this._fileInfo.Object)).Returns(false); + this._mockFileManager.Setup(mfm => mfm.GetHash(stream)).Returns(Constants.FOLDER_UnmodifiedFileHash); - _fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); + this._fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); - _folderMappingController.Setup(mp => mp.GetFolderMapping(It.IsAny())).Returns(new FolderMappingInfo() { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }); - _mockFolder.Setup(fp => fp.GetHashCode(It.IsAny(), It.IsAny())).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._folderMappingController.Setup(mp => mp.GetFolderMapping(It.IsAny())).Returns(new FolderMappingInfo() { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }); + this._mockFolder.Setup(fp => fp.GetHashCode(It.IsAny(), It.IsAny())).Returns(Constants.FOLDER_UnmodifiedFileHash); - _mockFileManager.Object.UpdateFile(_fileInfo.Object, stream); + this._mockFileManager.Object.UpdateFile(this._fileInfo.Object, stream); - _fileInfo.VerifySet(fi => fi.SHA1Hash = Constants.FOLDER_UnmodifiedFileHash); + this._fileInfo.VerifySet(fi => fi.SHA1Hash = Constants.FOLDER_UnmodifiedFileHash); } [Test] @@ -1130,17 +1130,17 @@ public void UpdateFile_Calls_FileManager_UpdateFile_Overload() var bytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var stream = new MemoryStream(bytes); - _mockFileManager.Setup(mfm => mfm.IsImageFile(_fileInfo.Object)).Returns(false); - _mockFileManager.Setup(mfm => mfm.GetHash(_fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._mockFileManager.Setup(mfm => mfm.IsImageFile(this._fileInfo.Object)).Returns(false); + this._mockFileManager.Setup(mfm => mfm.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash); - _fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); + this._fileInfo.Setup(fi => fi.StartDate).Returns(DateTime.Parse(Constants.FOLDER_FileStartDate)); - _folderMappingController.Setup(mp => mp.GetFolderMapping(It.IsAny())).Returns(new FolderMappingInfo() { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }); - _mockFolder.Setup(fp => fp.GetHashCode(It.IsAny(), It.IsAny())).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._folderMappingController.Setup(mp => mp.GetFolderMapping(It.IsAny())).Returns(new FolderMappingInfo() { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }); + this._mockFolder.Setup(fp => fp.GetHashCode(It.IsAny(), It.IsAny())).Returns(Constants.FOLDER_UnmodifiedFileHash); - _mockFileManager.Object.UpdateFile(_fileInfo.Object, stream); + this._mockFileManager.Object.UpdateFile(this._fileInfo.Object, stream); - _mockFileManager.Verify(mfm => mfm.UpdateFile(_fileInfo.Object), Times.Once()); + this._mockFileManager.Verify(mfm => mfm.UpdateFile(this._fileInfo.Object), Times.Once()); } #endregion @@ -1151,14 +1151,14 @@ public void UpdateFile_Calls_FileManager_UpdateFile_Overload() [ExpectedException(typeof(ArgumentNullException))] public void GetSeekableStream_Throws_On_Null_Stream() { - _fileManager.GetSeekableStream(null); + this._fileManager.GetSeekableStream(null); } [Test] public void GetSeekableStream_Returns_The_Same_Stream_If_It_Is_Seekable() { var inputStream = new MemoryStream(); - var seekableStream = _fileManager.GetSeekableStream(inputStream); + var seekableStream = this._fileManager.GetSeekableStream(inputStream); Assert.AreEqual(inputStream, seekableStream); } @@ -1170,12 +1170,12 @@ public void GetSeekableStream_Calls_GetHostMapPath_And_Creates_A_Temporary_FileS inputStream.Setup(s => s.CanSeek).Returns(false); inputStream.Setup(s => s.Read(It.IsAny(), It.IsAny(), It.IsAny())).Returns(0); - _mockFileManager.Setup(mfm => mfm.GetHostMapPath()).Returns("").Verifiable(); - _mockFileManager.Setup(mfm => mfm.GetAutoDeleteFileStream(It.Is((string x) => x.EndsWith(".resx")))).Returns(new MemoryStream()).Verifiable(); + this._mockFileManager.Setup(mfm => mfm.GetHostMapPath()).Returns("").Verifiable(); + this._mockFileManager.Setup(mfm => mfm.GetAutoDeleteFileStream(It.Is((string x) => x.EndsWith(".resx")))).Returns(new MemoryStream()).Verifiable(); - _mockFileManager.Object.GetSeekableStream(inputStream.Object); + this._mockFileManager.Object.GetSeekableStream(inputStream.Object); - _mockFileManager.Verify(); + this._mockFileManager.Verify(); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FolderManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FolderManagerTests.cs index 996a03a3c7f..103b02a5799 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FolderManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/FolderManagerTests.cs @@ -53,30 +53,30 @@ public class FolderManagerTests [SetUp] public void Setup() { - _mockFolder = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType); - _mockData = MockComponentProvider.CreateDataProvider(); + this._mockFolder = MockComponentProvider.CreateFolderProvider(Constants.FOLDER_ValidFolderProviderType); + this._mockData = MockComponentProvider.CreateDataProvider(); - _folderMappingController = new Mock(); - _directory = new Mock(); - _file = new Mock(); - _cbo = new Mock(); - _pathUtils = new Mock(); - _mockUserSecurityController = new Mock(); - _mockFileDeletionController = new Mock(); + this._folderMappingController = new Mock(); + this._directory = new Mock(); + this._file = new Mock(); + this._cbo = new Mock(); + this._pathUtils = new Mock(); + this._mockUserSecurityController = new Mock(); + this._mockFileDeletionController = new Mock(); - FolderMappingController.RegisterInstance(_folderMappingController.Object); - DirectoryWrapper.RegisterInstance(_directory.Object); - FileWrapper.RegisterInstance(_file.Object); - CBO.SetTestableInstance(_cbo.Object); - PathUtils.RegisterInstance(_pathUtils.Object); - UserSecurityController.SetTestableInstance(_mockUserSecurityController.Object); - FileDeletionController.SetTestableInstance(_mockFileDeletionController.Object); + FolderMappingController.RegisterInstance(this._folderMappingController.Object); + DirectoryWrapper.RegisterInstance(this._directory.Object); + FileWrapper.RegisterInstance(this._file.Object); + CBO.SetTestableInstance(this._cbo.Object); + PathUtils.RegisterInstance(this._pathUtils.Object); + UserSecurityController.SetTestableInstance(this._mockUserSecurityController.Object); + FileDeletionController.SetTestableInstance(this._mockFileDeletionController.Object); - _mockFolderManager = new Mock { CallBase = true }; + this._mockFolderManager = new Mock { CallBase = true }; - _folderManager = new FolderManager(); + this._folderManager = new FolderManager(); - _folderInfo = new Mock(); + this._folderInfo = new Mock(); } @@ -99,7 +99,7 @@ public void TearDown() [ExpectedException(typeof(ArgumentNullException))] public void AddFolder_Throws_On_Null_FolderPath() { - _folderManager.AddFolder(It.IsAny(), null); + this._folderManager.AddFolder(It.IsAny(), null); } //[Test] @@ -180,9 +180,9 @@ public void AddFolder_Throws_When_Folder_Already_Exists() PortalID = Constants.CONTENT_ValidPortalId }; - _mockFolderManager.Setup(mfm => mfm.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderRelativePath)).Returns(true); + this._mockFolderManager.Setup(mfm => mfm.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderRelativePath)).Returns(true); - _mockFolderManager.Object.AddFolder(folderMapping, Constants.FOLDER_ValidSubFolderRelativePath); + this._mockFolderManager.Object.AddFolder(folderMapping, Constants.FOLDER_ValidSubFolderRelativePath); } @@ -196,16 +196,16 @@ public void AddFolder_Throws_When_FolderPath_Is_Invalid() PortalID = Constants.CONTENT_ValidPortalId }; - _mockFolderManager + this._mockFolderManager .Setup(mfm => mfm.FolderExists(It.IsAny(), It.IsAny())) .Returns(false); - _mockFolderManager + this._mockFolderManager .Setup(mfm => mfm.IsValidFolderPath(It.IsAny())) .Returns(false); // act - _mockFolderManager.Object.AddFolder(folderMapping, Constants.FOLDER_ValidSubFolderRelativePath); + this._mockFolderManager.Object.AddFolder(folderMapping, Constants.FOLDER_ValidSubFolderRelativePath); // assert (implicit) } @@ -216,7 +216,7 @@ public void IsValidFolderPath_Returns_True_When_FolderPath_Is_Valid() // arrange (implicit) // act - var result = _mockFolderManager.Object.IsValidFolderPath(Constants.FOLDER_ValidSubFolderRelativePath); + var result = this._mockFolderManager.Object.IsValidFolderPath(Constants.FOLDER_ValidSubFolderRelativePath); // assert Assert.IsTrue(result); @@ -228,7 +228,7 @@ public void IsValidFolderPath_Returns_False_When_FolderPath_Is_Invalid() // arrange (implicit) // act - var result = _mockFolderManager.Object.IsValidFolderPath(Constants.FOLDER_InvalidSubFolderRelativePath); + var result = this._mockFolderManager.Object.IsValidFolderPath(Constants.FOLDER_InvalidSubFolderRelativePath); // assert Assert.IsFalse(result); @@ -242,7 +242,7 @@ public void IsValidFolderPath_Returns_False_When_FolderPath_Is_Invalid() [ExpectedException(typeof(ArgumentNullException))] public void DeleteFolder_Throws_On_Null_Folder() { - _folderManager.DeleteFolder(null); + this._folderManager.DeleteFolder(null); } [Test] @@ -251,11 +251,11 @@ public void DeleteFolder_Throws_OnNullFolder_WhenRecursive() { //Arrange var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); //Act var notDeletedSubfolders = new List(); - _folderManager.DeleteFolder(null, notDeletedSubfolders); + this._folderManager.DeleteFolder(null, notDeletedSubfolders); } [Test] @@ -267,23 +267,23 @@ public void DeleteFolder_CallsFolderProviderDeleteFolder_WhenRecursive() .Build(); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(folderInfo)).Verifiable(); + this._mockFolder.Setup(mf => mf.DeleteFolder(folderInfo)).Verifiable(); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); - _mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(new List()); - _mockFolderManager.Setup(mfm => mfm.GetFiles(folderInfo, It.IsAny(), It.IsAny())).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(folderInfo, It.IsAny(), It.IsAny())).Returns(new List()); - _mockUserSecurityController.Setup(musc => musc.HasFolderPermission(folderInfo, "DELETE")).Returns(true); + this._mockUserSecurityController.Setup(musc => musc.HasFolderPermission(folderInfo, "DELETE")).Returns(true); //Act var subfoldersNotDeleted = new List(); - _mockFolderManager.Object.DeleteFolder(folderInfo, subfoldersNotDeleted); + this._mockFolderManager.Object.DeleteFolder(folderInfo, subfoldersNotDeleted); //Assert - _mockFolder.Verify(); + this._mockFolder.Verify(); Assert.AreEqual(0, subfoldersNotDeleted.Count); } @@ -311,27 +311,27 @@ public void DeleteFolder_CallsFolderProviderDeleteFolder_WhenRecursive_WhenExist }; var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(folderInfo)).Verifiable(); - _mockFolder.Setup(mf => mf.DeleteFolder(subfolder1)).Verifiable(); - _mockFolder.Setup(mf => mf.DeleteFolder(subfolder2)).Verifiable(); + this._mockFolder.Setup(mf => mf.DeleteFolder(folderInfo)).Verifiable(); + this._mockFolder.Setup(mf => mf.DeleteFolder(subfolder1)).Verifiable(); + this._mockFolder.Setup(mf => mf.DeleteFolder(subfolder2)).Verifiable(); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); - _mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(subfolders); - _mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsNotIn(folderInfo))).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(subfolders); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsNotIn(folderInfo))).Returns(new List()); - _mockFolderManager.Setup(mfm => mfm.GetFiles(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List()); - _mockUserSecurityController.Setup(musc => musc.HasFolderPermission(It.IsAny(), "DELETE")).Returns(true); + this._mockUserSecurityController.Setup(musc => musc.HasFolderPermission(It.IsAny(), "DELETE")).Returns(true); //Act var subfoldersNotDeleted = new List(); - _mockFolderManager.Object.DeleteFolder(folderInfo, subfoldersNotDeleted); + this._mockFolderManager.Object.DeleteFolder(folderInfo, subfoldersNotDeleted); //Assert - _mockFolder.Verify(); + this._mockFolder.Verify(); Assert.AreEqual(0, subfoldersNotDeleted.Count); } @@ -359,23 +359,23 @@ public void DeleteFolder_SubFoldersCollectionIsNotEmpty_WhenRecursive_WhenUserHa }; var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(subfolder1)); + this._mockFolder.Setup(mf => mf.DeleteFolder(subfolder1)); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); - _mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(subfolders); - _mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsNotIn(folderInfo))).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(subfolders); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsNotIn(folderInfo))).Returns(new List()); - _mockFolderManager.Setup(mfm => mfm.GetFiles(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(It.IsAny(), It.IsAny(), It.IsAny())).Returns(new List()); - _mockUserSecurityController.Setup(musc => musc.HasFolderPermission(subfolder2, "DELETE")).Returns(false); - _mockUserSecurityController.Setup(musc => musc.HasFolderPermission(It.IsNotIn(subfolder2), "DELETE")).Returns(true); + this._mockUserSecurityController.Setup(musc => musc.HasFolderPermission(subfolder2, "DELETE")).Returns(false); + this._mockUserSecurityController.Setup(musc => musc.HasFolderPermission(It.IsNotIn(subfolder2), "DELETE")).Returns(true); //Act var subfoldersNotDeleted = new List(); - _mockFolderManager.Object.DeleteFolder(folderInfo, subfoldersNotDeleted); + this._mockFolderManager.Object.DeleteFolder(folderInfo, subfoldersNotDeleted); //Assert Assert.AreEqual(2, subfoldersNotDeleted.Count); //folderInfo and subfolder2 are not deleted @@ -404,105 +404,105 @@ public void DeleteFolder_Throws_OnFileDeletionControllerThrows_WhenRecursive_Whe }; var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); //_mockFolder.Setup(mf => mf.DeleteFolder(folderInfo)); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); - _mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(folderInfo)).Returns(new List()); - _mockFolderManager.Setup(mfm => mfm.GetFiles(folderInfo, It.IsAny(), It.IsAny())).Returns(files); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(folderInfo, It.IsAny(), It.IsAny())).Returns(files); - _mockUserSecurityController.Setup(musc => musc.HasFolderPermission(It.IsAny(), "DELETE")).Returns(true); + this._mockUserSecurityController.Setup(musc => musc.HasFolderPermission(It.IsAny(), "DELETE")).Returns(true); - _mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(fileInfo1)); - _mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(fileInfo2)).Throws(); + this._mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(fileInfo1)); + this._mockFileDeletionController.Setup(mfdc => mfdc.DeleteFile(fileInfo2)).Throws(); //Act - _mockFolderManager.Object.DeleteFolder(folderInfo, new List()); + this._mockFolderManager.Object.DeleteFolder(folderInfo, new List()); } [Test] public void DeleteFolder_Calls_FolderProvider_DeleteFolder() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(_folderInfo.Object)).Verifiable(); + this._mockFolder.Setup(mf => mf.DeleteFolder(this._folderInfo.Object)).Verifiable(); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); - _mockFolderManager.Object.DeleteFolder(_folderInfo.Object); + this._mockFolderManager.Object.DeleteFolder(this._folderInfo.Object); - _mockFolder.Verify(); + this._mockFolder.Verify(); } [Test] [ExpectedException(typeof(FolderProviderException))] public void DeleteFolder_Throws_When_FolderProvider_Throws() { - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(_folderInfo.Object)).Throws(); + this._mockFolder.Setup(mf => mf.DeleteFolder(this._folderInfo.Object)).Throws(); - _mockFolderManager.Object.DeleteFolder(_folderInfo.Object); + this._mockFolderManager.Object.DeleteFolder(this._folderInfo.Object); } [Test] public void DeleteFolder_Calls_Directory_Delete_When_Directory_Exists() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(_folderInfo.Object)); + this._mockFolder.Setup(mf => mf.DeleteFolder(this._folderInfo.Object)); - _directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); - _directory.Setup(d => d.Delete(Constants.FOLDER_ValidFolderPath, true)).Verifiable(); + this._directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); + this._directory.Setup(d => d.Delete(Constants.FOLDER_ValidFolderPath, true)).Verifiable(); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); - _mockFolderManager.Object.DeleteFolder(_folderInfo.Object); + this._mockFolderManager.Object.DeleteFolder(this._folderInfo.Object); - _directory.Verify(); + this._directory.Verify(); } [Test] public void DeleteFolder_Calls_FolderManager_DeleteFolder_Overload() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var folderMapping = new FolderMappingInfo { FolderProviderType = Constants.FOLDER_ValidFolderProviderType }; - _folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._folderMappingController.Setup(fmc => fmc.GetFolderMapping(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolder.Setup(mf => mf.DeleteFolder(_folderInfo.Object)); + this._mockFolder.Setup(mf => mf.DeleteFolder(this._folderInfo.Object)); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Verifiable(); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Verifiable(); - _mockFolderManager.Object.DeleteFolder(_folderInfo.Object); + this._mockFolderManager.Object.DeleteFolder(this._folderInfo.Object); - _mockFolderManager.Verify(); + this._mockFolderManager.Verify(); } #endregion @@ -513,25 +513,25 @@ public void DeleteFolder_Calls_FolderManager_DeleteFolder_Overload() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFolder_Throws_On_Null_FolderPath() { - _folderManager.FolderExists(Constants.CONTENT_ValidPortalId, null); + this._folderManager.FolderExists(Constants.CONTENT_ValidPortalId, null); } [Test] public void ExistsFolder_Calls_FolderManager_GetFolder() { - _mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object).Verifiable(); + this._mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object).Verifiable(); - _mockFolderManager.Object.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + this._mockFolderManager.Object.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); - _mockFolderManager.Verify(); + this._mockFolderManager.Verify(); } [Test] public void ExistsFolder_Returns_True_When_Folder_Exists() { - _mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object); + this._mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object); - var result = _mockFolderManager.Object.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + var result = this._mockFolderManager.Object.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); Assert.IsTrue(result); } @@ -539,9 +539,9 @@ public void ExistsFolder_Returns_True_When_Folder_Exists() [Test] public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() { - _mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(null); + this._mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(null); - var result = _mockFolderManager.Object.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + var result = this._mockFolderManager.Object.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); Assert.IsFalse(result); } @@ -554,36 +554,36 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetFilesByFolder_Throws_On_Null_Folder() { - _folderManager.GetFiles(null); + this._folderManager.GetFiles(null); } [Test] public void GetFilesByFolder_Calls_DataProvider_GetFiles() { - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); var files = new DataTable(); files.Columns.Add("FolderName"); var dr = files.CreateDataReader(); - _mockData.Setup(md => md.GetFiles(Constants.FOLDER_ValidFolderId, It.IsAny(), It.IsAny())).Returns(dr).Verifiable(); + this._mockData.Setup(md => md.GetFiles(Constants.FOLDER_ValidFolderId, It.IsAny(), It.IsAny())).Returns(dr).Verifiable(); var filesList = new List { new FileInfo() { FileName = Constants.FOLDER_ValidFileName } }; - _cbo.Setup(cbo => cbo.FillCollection(dr)).Returns(filesList); + this._cbo.Setup(cbo => cbo.FillCollection(dr)).Returns(filesList); - _folderManager.GetFiles(_folderInfo.Object); + this._folderManager.GetFiles(this._folderInfo.Object); - _mockData.Verify(); + this._mockData.Verify(); } [Test] public void GetFilesByFolder_Count_Equals_DataProvider_GetFiles_Count() { - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); var files = new DataTable(); files.Columns.Add("FileName"); @@ -591,13 +591,13 @@ public void GetFilesByFolder_Count_Equals_DataProvider_GetFiles_Count() var dr = files.CreateDataReader(); - _mockData.Setup(md => md.GetFiles(Constants.FOLDER_ValidFolderId, It.IsAny(), It.IsAny())).Returns(dr); + this._mockData.Setup(md => md.GetFiles(Constants.FOLDER_ValidFolderId, It.IsAny(), It.IsAny())).Returns(dr); var filesList = new List { new FileInfo { FileName = Constants.FOLDER_ValidFileName } }; - _cbo.Setup(cbo => cbo.FillCollection(dr)).Returns(filesList); + this._cbo.Setup(cbo => cbo.FillCollection(dr)).Returns(filesList); - var result = _folderManager.GetFiles(_folderInfo.Object).ToList(); + var result = this._folderManager.GetFiles(this._folderInfo.Object).ToList(); Assert.AreEqual(1, result.Count); } @@ -605,8 +605,8 @@ public void GetFilesByFolder_Count_Equals_DataProvider_GetFiles_Count() [Test] public void GetFilesByFolder_Returns_Valid_FileNames_When_Folder_Contains_Files() { - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); var files = new DataTable(); files.Columns.Add("FileName"); @@ -615,7 +615,7 @@ public void GetFilesByFolder_Returns_Valid_FileNames_When_Folder_Contains_Files( var dr = files.CreateDataReader(); - _mockData.Setup(md => md.GetFiles(Constants.FOLDER_ValidFolderId, It.IsAny(), It.IsAny())).Returns(dr); + this._mockData.Setup(md => md.GetFiles(Constants.FOLDER_ValidFolderId, It.IsAny(), It.IsAny())).Returns(dr); var filesList = new List { @@ -623,9 +623,9 @@ public void GetFilesByFolder_Returns_Valid_FileNames_When_Folder_Contains_Files( new FileInfo { FileName = Constants.FOLDER_OtherValidFileName } }; - _cbo.Setup(cbo => cbo.FillCollection(dr)).Returns(filesList); + this._cbo.Setup(cbo => cbo.FillCollection(dr)).Returns(filesList); - var result = _folderManager.GetFiles(_folderInfo.Object).Cast(); + var result = this._folderManager.GetFiles(this._folderInfo.Object).Cast(); CollectionAssert.AreEqual(filesList, result); } @@ -640,11 +640,11 @@ public void GetFolder_Calls_DataProvider_GetFolder() var folderDataTable = new DataTable(); folderDataTable.Columns.Add("FolderName"); - _mockData.Setup(md => md.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(folderDataTable.CreateDataReader()).Verifiable(); + this._mockData.Setup(md => md.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(folderDataTable.CreateDataReader()).Verifiable(); - _folderManager.GetFolder(Constants.FOLDER_ValidFolderId); + this._folderManager.GetFolder(Constants.FOLDER_ValidFolderId); - _mockData.Verify(); + this._mockData.Verify(); } [Test] @@ -655,10 +655,10 @@ public void GetFolder_Returns_Null_When_Folder_Does_Not_Exist() var dr = folderDataTable.CreateDataReader(); - _mockData.Setup(md => md.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(dr); - _cbo.Setup(cbo => cbo.FillObject(dr)).Returns(null); + this._mockData.Setup(md => md.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(dr); + this._cbo.Setup(cbo => cbo.FillObject(dr)).Returns(null); - var result = _folderManager.GetFolder(Constants.FOLDER_ValidFolderId); + var result = this._folderManager.GetFolder(Constants.FOLDER_ValidFolderId); Assert.IsNull(result); } @@ -666,9 +666,9 @@ public void GetFolder_Returns_Null_When_Folder_Does_Not_Exist() [Test] public void GetFolder_Returns_Valid_Folder_When_Folder_Exists() { - _folderInfo.Setup(fi => fi.FolderName).Returns(Constants.FOLDER_ValidFolderName); + this._folderInfo.Setup(fi => fi.FolderName).Returns(Constants.FOLDER_ValidFolderName); - _pathUtils.Setup(pu => pu.RemoveTrailingSlash(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderName); + this._pathUtils.Setup(pu => pu.RemoveTrailingSlash(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderName); var folderDataTable = new DataTable(); folderDataTable.Columns.Add("FolderName"); @@ -676,13 +676,13 @@ public void GetFolder_Returns_Valid_Folder_When_Folder_Exists() var dr = folderDataTable.CreateDataReader(); - _mockData.Setup(md => md.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(dr); + this._mockData.Setup(md => md.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(dr); var folderInfo = new FolderInfo { FolderPath = Constants.FOLDER_ValidFolderRelativePath }; - _cbo.Setup(cbo => cbo.FillObject(dr)).Returns(folderInfo); + this._cbo.Setup(cbo => cbo.FillObject(dr)).Returns(folderInfo); - var result = _mockFolderManager.Object.GetFolder(Constants.FOLDER_ValidFolderId); + var result = this._mockFolderManager.Object.GetFolder(Constants.FOLDER_ValidFolderId); Assert.AreEqual(Constants.FOLDER_ValidFolderName, result.FolderName); } @@ -691,7 +691,7 @@ public void GetFolder_Returns_Valid_Folder_When_Folder_Exists() [ExpectedException(typeof(ArgumentNullException))] public void GetFolder_Throws_On_Null_FolderPath() { - _folderManager.GetFolder(It.IsAny(), null); + this._folderManager.GetFolder(It.IsAny(), null); } [Test] @@ -699,25 +699,25 @@ public void GetFolder_Calls_GetFolders() { var foldersSorted = new List(); - _mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(foldersSorted).Verifiable(); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(foldersSorted).Verifiable(); - _mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + this._mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); - _mockFolderManager.Verify(); + this._mockFolderManager.Verify(); } [Test] public void GetFolder_Calls_DataProvider_GetFolder_When_Folder_Is_Not_In_Cache() { - _pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderRelativePath); var foldersSorted = new List(); - _mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(foldersSorted); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(foldersSorted); - _mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + this._mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); - _mockData.Verify(md => md.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath), Times.Once()); + this._mockData.Verify(md => md.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath), Times.Once()); } [Test] @@ -728,13 +728,13 @@ public void GetFolder_Returns_Null_When_Folder_Does_Not_Exist_Overload() var dr = folderDataTable.CreateDataReader(); - _mockData.Setup(md => md.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(dr); + this._mockData.Setup(md => md.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(dr); - _cbo.Setup(cbo => cbo.FillObject(dr)).Returns(null); + this._cbo.Setup(cbo => cbo.FillObject(dr)).Returns(null); - _mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(new List()); - var result = _mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + var result = this._mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); Assert.IsNull(result); } @@ -742,8 +742,8 @@ public void GetFolder_Returns_Null_When_Folder_Does_Not_Exist_Overload() [Test] public void GetFolder_Returns_Valid_Folder_When_Folder_Exists_Overload() { - _pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderRelativePath); - _pathUtils.Setup(pu => pu.RemoveTrailingSlash(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderName); + this._pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._pathUtils.Setup(pu => pu.RemoveTrailingSlash(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderName); var folderDataTable = new DataTable(); folderDataTable.Columns.Add("FolderName"); @@ -751,15 +751,15 @@ public void GetFolder_Returns_Valid_Folder_When_Folder_Exists_Overload() var dr = folderDataTable.CreateDataReader(); - _mockData.Setup(md => md.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(dr); + this._mockData.Setup(md => md.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(dr); var folderInfo = new FolderInfo { FolderPath = Constants.FOLDER_ValidFolderRelativePath }; - _cbo.Setup(cbo => cbo.FillObject(dr)).Returns(folderInfo); + this._cbo.Setup(cbo => cbo.FillObject(dr)).Returns(folderInfo); - _mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(new List()); - var result = _mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); + var result = this._mockFolderManager.Object.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath); Assert.AreEqual(Constants.FOLDER_ValidFolderName, result.FolderName); } @@ -772,17 +772,17 @@ public void GetFolder_Returns_Valid_Folder_When_Folder_Exists_Overload() [ExpectedException(typeof(ArgumentNullException))] public void GetFoldersByParentFolder_Throws_On_Null_ParentFolder() { - _folderManager.GetFolders((IFolderInfo)null); + this._folderManager.GetFolders((IFolderInfo)null); } [Test] public void GetFoldersByParentFolder_Returns_Empty_List_When_ParentFolder_Contains_No_Subfolders() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(new List()); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(new List()); - var result = _mockFolderManager.Object.GetFolders(_folderInfo.Object).ToList(); + var result = this._mockFolderManager.Object.GetFolders(this._folderInfo.Object).ToList(); Assert.AreEqual(0, result.Count); } @@ -790,8 +790,8 @@ public void GetFoldersByParentFolder_Returns_Empty_List_When_ParentFolder_Contai [Test] public void GetFoldersByParentFolder_Returns_Valid_Subfolders() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderID).Returns(Constants.FOLDER_ValidFolderId); var foldersSorted = new List { @@ -799,9 +799,9 @@ public void GetFoldersByParentFolder_Returns_Valid_Subfolders() new FolderInfo { FolderID = Constants.FOLDER_OtherValidFolderId, ParentID = Constants.FOLDER_ValidFolderId} }; - _mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(foldersSorted); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(Constants.CONTENT_ValidPortalId)).Returns(foldersSorted); - var result = _mockFolderManager.Object.GetFolders(_folderInfo.Object).ToList(); + var result = this._mockFolderManager.Object.GetFolders(this._folderInfo.Object).ToList(); Assert.AreEqual(1, result.Count); Assert.AreEqual(Constants.FOLDER_OtherValidFolderId, result[0].FolderID); @@ -816,11 +816,11 @@ public void GetFolders_Calls_CBO_GetCachedObject() { var folders = new List(); - _cbo.Setup(cbo => cbo.GetCachedObject>(It.IsAny(), It.IsAny(), false)).Returns(folders).Verifiable(); + this._cbo.Setup(cbo => cbo.GetCachedObject>(It.IsAny(), It.IsAny(), false)).Returns(folders).Verifiable(); - _mockFolderManager.Object.GetFolders(Constants.CONTENT_ValidPortalId); + this._mockFolderManager.Object.GetFolders(Constants.CONTENT_ValidPortalId); - _cbo.Verify(); + this._cbo.Verify(); } #endregion @@ -831,7 +831,7 @@ public void GetFolders_Calls_CBO_GetCachedObject() [ExpectedException(typeof(ArgumentNullException))] public void RenameFolder_Throws_On_Null_Folder() { - _folderManager.RenameFolder(null, It.IsAny()); + this._folderManager.RenameFolder(null, It.IsAny()); } [Test] @@ -840,22 +840,22 @@ public void RenameFolder_Throws_On_Null_Folder() [ExpectedException(typeof(ArgumentException))] public void RenameFolder_Throws_On_Null_Or_Empty_NewFolderName(string newFolderName) { - _folderManager.RenameFolder(_folderInfo.Object, newFolderName); + this._folderManager.RenameFolder(this._folderInfo.Object, newFolderName); } [Test] [ExpectedException(typeof(FolderAlreadyExistsException))] public void RenameFolder_Throws_When_DestinationFolder_Exists() { - _pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_OtherValidFolderName)).Returns(Constants.FOLDER_OtherValidFolderRelativePath); + this._pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_OtherValidFolderName)).Returns(Constants.FOLDER_OtherValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderName).Returns(Constants.FOLDER_ValidFolderName); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderName).Returns(Constants.FOLDER_ValidFolderName); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _mockFolderManager.Setup(mfm => mfm.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidFolderRelativePath)).Returns(true); + this._mockFolderManager.Setup(mfm => mfm.FolderExists(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidFolderRelativePath)).Returns(true); - _mockFolderManager.Object.RenameFolder(_folderInfo.Object, Constants.FOLDER_OtherValidFolderName); + this._mockFolderManager.Object.RenameFolder(this._folderInfo.Object, Constants.FOLDER_OtherValidFolderName); } #endregion @@ -866,19 +866,19 @@ public void RenameFolder_Throws_When_DestinationFolder_Exists() [ExpectedException(typeof(ArgumentNullException))] public void UpdateFolder_Throws_On_Null_Folder() { - _folderManager.UpdateFolder(null); + this._folderManager.UpdateFolder(null); } [Test] public void UpdateFolder_Calls_DataProvider_UpdateFolder() { - _mockFolderManager.Setup(mfm => mfm.AddLogEntry(_folderInfo.Object, It.IsAny())); - _mockFolderManager.Setup(mfm => mfm.SaveFolderPermissions(_folderInfo.Object)); - _mockFolderManager.Setup(mfm => mfm.ClearFolderCache(It.IsAny())); + this._mockFolderManager.Setup(mfm => mfm.AddLogEntry(this._folderInfo.Object, It.IsAny())); + this._mockFolderManager.Setup(mfm => mfm.SaveFolderPermissions(this._folderInfo.Object)); + this._mockFolderManager.Setup(mfm => mfm.ClearFolderCache(It.IsAny())); - _mockFolderManager.Object.UpdateFolder(_folderInfo.Object); + this._mockFolderManager.Object.UpdateFolder(this._folderInfo.Object); - _mockData.Verify(md => md.UpdateFolder( + this._mockData.Verify(md => md.UpdateFolder( It.IsAny(), It.IsAny(), It.IsAny(), @@ -903,17 +903,17 @@ public void UpdateFolder_Calls_DataProvider_UpdateFolder() [ExpectedException(typeof(ArgumentNullException))] public void SynchronizeFolder_Throws_On_Null_RelativePath() { - _folderManager.Synchronize(It.IsAny(), null, It.IsAny(), It.IsAny()); + this._folderManager.Synchronize(It.IsAny(), null, It.IsAny(), It.IsAny()); } [Test] [ExpectedException(typeof(NoNetworkAvailableException))] public void SynchronizeFolder_Throws_When_Some_Folder_Mapping_Requires_Network_Connectivity_But_There_Is_No_Network_Available() { - _mockFolderManager.Setup(mfm => mfm.AreThereFolderMappingsRequiringNetworkConnectivity(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false)).Returns(true); - _mockFolderManager.Setup(mfm => mfm.IsNetworkAvailable()).Returns(false); + this._mockFolderManager.Setup(mfm => mfm.AreThereFolderMappingsRequiringNetworkConnectivity(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false)).Returns(true); + this._mockFolderManager.Setup(mfm => mfm.IsNetworkAvailable()).Returns(false); - _mockFolderManager.Object.Synchronize(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false, false); + this._mockFolderManager.Object.Synchronize(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false, false); } #endregion @@ -923,11 +923,11 @@ public void SynchronizeFolder_Throws_When_Some_Folder_Mapping_Requires_Network_C [Test] public void GetFileSystemFolders_Returns_Empty_List_When_Folder_Does_Not_Exist() { - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false); + this._directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false); - var result = _mockFolderManager.Object.GetFileSystemFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); + var result = this._mockFolderManager.Object.GetFileSystemFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); Assert.IsEmpty(result); } @@ -935,11 +935,11 @@ public void GetFileSystemFolders_Returns_Empty_List_When_Folder_Does_Not_Exist() [Test] public void GetFileSystemFolders_Returns_One_Item_When_Folder_Exists_And_Is_Not_Recursive() { - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); + this._directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); - var result = _mockFolderManager.Object.GetFileSystemFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); + var result = this._mockFolderManager.Object.GetFileSystemFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); Assert.AreEqual(1, result.Count); Assert.IsTrue(result.Values[0].ExistsInFileSystem); @@ -948,18 +948,18 @@ public void GetFileSystemFolders_Returns_One_Item_When_Folder_Exists_And_Is_Not_ [Test] public void GetFileSystemFolders_Calls_FolderManager_GetFileSystemFoldersRecursive_When_Folder_Exists_And_Is_Recursive() { - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)) + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)) .Returns(Constants.FOLDER_ValidFolderPath); - _mockFolderManager.Setup(mfm => mfm.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderPath)) + this._mockFolderManager.Setup(mfm => mfm.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderPath)) .Returns(It.IsAny>()) .Verifiable(); - _directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); + this._directory.Setup(d => d.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); - _mockFolderManager.Object.GetFileSystemFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, true); + this._mockFolderManager.Object.GetFileSystemFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, true); - _mockFolderManager.Verify(); + this._mockFolderManager.Verify(); } #endregion @@ -969,11 +969,11 @@ public void GetFileSystemFolders_Calls_FolderManager_GetFileSystemFoldersRecursi [Test] public void GetFileSystemFoldersRecursive_Returns_One_Item_When_Folder_Does_Not_Have_SubFolders() { - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderPath)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderPath)).Returns(Constants.FOLDER_ValidFolderRelativePath); - _directory.Setup(d => d.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(new string[0]); + this._directory.Setup(d => d.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(new string[0]); - var result = _mockFolderManager.Object.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderPath); + var result = this._mockFolderManager.Object.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderPath); Assert.AreEqual(1, result.Count); } @@ -990,15 +990,15 @@ public void GetFileSystemFoldersRecursive_Returns_All_The_Folders_In_Folder_Tree {@"C:\folder\subfolder2\subsubfolder2", "folder/subfolder2/subsubfolder2/"} }; - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, It.IsAny())) + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, It.IsAny())) .Returns((portalID, physicalPath) => relativePaths[physicalPath]); var directories = new List { @"C:\folder\subfolder", @"C:\folder\subfolder2", @"C:\folder\subfolder2\subsubfolder", @"C:\folder\subfolder2\subsubfolder2" }; - _directory.Setup(d => d.GetDirectories(It.IsAny())) + this._directory.Setup(d => d.GetDirectories(It.IsAny())) .Returns(path => directories.FindAll(sub => sub.StartsWith(path + "\\") && sub.LastIndexOf("\\") == path.Length).ToArray()); - var result = _mockFolderManager.Object.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, @"C:\folder"); + var result = this._mockFolderManager.Object.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, @"C:\folder"); Assert.AreEqual(5, result.Count); @@ -1016,15 +1016,15 @@ public void GetFileSystemFoldersRecursive_Sets_ExistsInFileSystem_For_All_Items( {@"C:\folder\subfolder2\subsubfolder2", "folder/subfolder2/subsubfolder2/"} }; - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, It.IsAny())) + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, It.IsAny())) .Returns((portalID, physicalPath) => relativePaths[physicalPath]); var directories = new List { @"C:\folder", @"C:\folder\subfolder", @"C:\folder\subfolder2", @"C:\folder\subfolder2\subsubfolder", @"C:\folder\subfolder2\subsubfolder2" }; - _directory.Setup(d => d.GetDirectories(It.IsAny())) + this._directory.Setup(d => d.GetDirectories(It.IsAny())) .Returns(path => directories.FindAll(sub => sub.StartsWith(path + "\\") && sub.LastIndexOf("\\") == path.Length).ToArray()); - var result = _mockFolderManager.Object.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, @"C:\folder"); + var result = this._mockFolderManager.Object.GetFileSystemFoldersRecursive(Constants.CONTENT_ValidPortalId, @"C:\folder"); foreach (var mergedTreeItem in result.Values) { @@ -1039,9 +1039,9 @@ public void GetFileSystemFoldersRecursive_Sets_ExistsInFileSystem_For_All_Items( [Test] public void GetDatabaseFolders_Returns_Empty_List_When_Folder_Does_Not_Exist() { - _mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(null); + this._mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(null); - var result = _mockFolderManager.Object.GetDatabaseFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); + var result = this._mockFolderManager.Object.GetDatabaseFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); Assert.IsEmpty(result); } @@ -1049,9 +1049,9 @@ public void GetDatabaseFolders_Returns_Empty_List_When_Folder_Does_Not_Exist() [Test] public void GetDatabaseFolders_Returns_One_Item_When_Folder_Exists_And_Is_Not_Recursive() { - _mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(_folderInfo.Object); + this._mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(this._folderInfo.Object); - var result = _mockFolderManager.Object.GetDatabaseFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); + var result = this._mockFolderManager.Object.GetDatabaseFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, false); Assert.AreEqual(1, result.Count); Assert.IsTrue(result.Values[0].ExistsInDatabase); @@ -1060,16 +1060,16 @@ public void GetDatabaseFolders_Returns_One_Item_When_Folder_Exists_And_Is_Not_Re [Test] public void GetDatabaseFolders_Calls_FolderManager_GetDatabaseFoldersRecursive_When_Folder_Exists_And_Is_Recursive() { - _mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)) - .Returns(_folderInfo.Object); + this._mockFolderManager.Setup(mfm => mfm.GetFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)) + .Returns(this._folderInfo.Object); - _mockFolderManager.Setup(mfm => mfm.GetDatabaseFoldersRecursive(_folderInfo.Object)) + this._mockFolderManager.Setup(mfm => mfm.GetDatabaseFoldersRecursive(this._folderInfo.Object)) .Returns(It.IsAny>()) .Verifiable(); - _mockFolderManager.Object.GetDatabaseFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, true); + this._mockFolderManager.Object.GetDatabaseFolders(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath, true); - _mockFolderManager.Verify(); + this._mockFolderManager.Verify(); } #endregion @@ -1079,14 +1079,14 @@ public void GetDatabaseFolders_Calls_FolderManager_GetDatabaseFoldersRecursive_W [Test] public void GetDatabaseFoldersRecursive_Returns_One_Item_When_Folder_Does_Not_Have_SubFolders() { - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var subfolders = new List(); - _mockFolderManager.Setup(mfm => mfm.GetFolders(_folderInfo.Object)).Returns(subfolders); + this._mockFolderManager.Setup(mfm => mfm.GetFolders(this._folderInfo.Object)).Returns(subfolders); - var result = _mockFolderManager.Object.GetDatabaseFoldersRecursive(_folderInfo.Object); + var result = this._mockFolderManager.Object.GetDatabaseFoldersRecursive(this._folderInfo.Object); Assert.AreEqual(1, result.Count); } @@ -1094,8 +1094,8 @@ public void GetDatabaseFoldersRecursive_Returns_One_Item_When_Folder_Does_Not_Ha [Test] public void GetDatabaseFoldersRecursive_Returns_All_The_Folders_In_Folder_Tree() { - _folderInfo.Setup(fi => fi.FolderPath).Returns("folder/"); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderPath).Returns("folder/"); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var subfolders = new List { @@ -1105,13 +1105,13 @@ public void GetDatabaseFoldersRecursive_Returns_All_The_Folders_In_Folder_Tree() new FolderInfo {FolderPath = "folder/subfolder2/subsubfolder2/", FolderMappingID = Constants.FOLDER_ValidFolderMappingID} }; - _mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsAny())) + this._mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsAny())) .Returns(parent => subfolders.FindAll(sub => sub.FolderPath.StartsWith(parent.FolderPath) && sub.FolderPath.Length > parent.FolderPath.Length && sub.FolderPath.Substring(parent.FolderPath.Length).IndexOf("/") == sub.FolderPath.Substring(parent.FolderPath.Length).LastIndexOf("/"))); - var result = _mockFolderManager.Object.GetDatabaseFoldersRecursive(_folderInfo.Object); + var result = this._mockFolderManager.Object.GetDatabaseFoldersRecursive(this._folderInfo.Object); Assert.AreEqual(5, result.Count); } @@ -1119,8 +1119,8 @@ public void GetDatabaseFoldersRecursive_Returns_All_The_Folders_In_Folder_Tree() [Test] public void GetDatabaseFoldersRecursive_Sets_ExistsInDatabase_For_All_Items() { - _folderInfo.Setup(fi => fi.FolderPath).Returns("folder/"); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderPath).Returns("folder/"); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var subfolders = new List { @@ -1130,13 +1130,13 @@ public void GetDatabaseFoldersRecursive_Sets_ExistsInDatabase_For_All_Items() new FolderInfo() {FolderPath = "folder/subfolder2/subsubfolder2/", FolderMappingID = Constants.FOLDER_ValidFolderMappingID} }; - _mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsAny())) + this._mockFolderManager.Setup(mfm => mfm.GetFolders(It.IsAny())) .Returns(parent => subfolders.FindAll(sub => sub.FolderPath.StartsWith(parent.FolderPath) && sub.FolderPath.Length > parent.FolderPath.Length && sub.FolderPath.Substring(parent.FolderPath.Length).IndexOf("/") == sub.FolderPath.Substring(parent.FolderPath.Length).LastIndexOf("/"))); - var result = _mockFolderManager.Object.GetDatabaseFoldersRecursive(_folderInfo.Object); + var result = this._mockFolderManager.Object.GetDatabaseFoldersRecursive(this._folderInfo.Object); foreach (var mergedTreeItem in result.Values) { @@ -1228,7 +1228,7 @@ public void MergeFolderLists_Returns_Empty_List_When_Both_Lists_Are_Empty() var list1 = new SortedList(); var list2 = new SortedList(); - var result = _folderManager.MergeFolderLists(list1, list2); + var result = this._folderManager.MergeFolderLists(list1, list2); Assert.IsEmpty(result); } @@ -1248,7 +1248,7 @@ public void MergeFolderLists_Count_Equals_The_Intersection_Count_Between_Both_Li {"folder3", new FolderManager.MergedTreeItem {FolderPath = "folder3"}} }; - var result = _folderManager.MergeFolderLists(list1, list2); + var result = this._folderManager.MergeFolderLists(list1, list2); Assert.AreEqual(3, result.Count); } @@ -2168,7 +2168,7 @@ public void MergeFolderLists_Count_Equals_The_Intersection_Count_Between_Both_Li [ExpectedException(typeof(ArgumentNullException))] public void MoveFolder_Throws_On_Null_Folder() { - _folderManager.MoveFolder(null, It.IsAny()); + this._folderManager.MoveFolder(null, It.IsAny()); } [Test] @@ -2177,42 +2177,42 @@ public void MoveFolder_Throws_On_Null_Folder() [ExpectedException(typeof(ArgumentException))] public void MoveFolder_Throws_On_Null_Or_Emtpy_NewFolderPath(string newFolderPath) { - _folderManager.MoveFolder(_folderInfo.Object, newFolderPath); + this._folderManager.MoveFolder(this._folderInfo.Object, newFolderPath); } [Test] public void MoveFolder_Returns_The_Same_Folder_If_The_Paths_Are_The_Same() { - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); IFolderInfo destinationFolder = new FolderInfo(); destinationFolder.FolderPath = Constants.FOLDER_ValidFolderRelativePath; - _pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderRelativePath); - var movedFolder = _folderManager.MoveFolder(_folderInfo.Object, destinationFolder); + var movedFolder = this._folderManager.MoveFolder(this._folderInfo.Object, destinationFolder); - Assert.AreEqual(_folderInfo.Object, movedFolder); + Assert.AreEqual(this._folderInfo.Object, movedFolder); } [Test] [ExpectedException(typeof(InvalidOperationException))] public void MoveFolder_Throws_When_Move_Operation_Is_Not_Valid() { - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); IFolderInfo destinationFolder = new FolderInfo(); destinationFolder.FolderPath = Constants.FOLDER_OtherValidFolderRelativePath; destinationFolder.FolderMappingID = Constants.FOLDER_ValidFolderMappingID; - _pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_OtherValidFolderRelativePath)).Returns(Constants.FOLDER_OtherValidFolderRelativePath); + this._pathUtils.Setup(pu => pu.FormatFolderPath(Constants.FOLDER_OtherValidFolderRelativePath)).Returns(Constants.FOLDER_OtherValidFolderRelativePath); - _mockFolderManager.Setup(mfm => mfm.FolderExists(It.IsAny(), It.IsAny())).Returns(false); - _mockFolderManager.Setup(mfm => mfm.CanMoveBetweenFolderMappings(It.IsAny(), It.IsAny())).Returns(true); - _mockFolderManager.Setup(mfm => mfm.IsMoveOperationValid(_folderInfo.Object, destinationFolder, It.IsAny())).Returns(false); + this._mockFolderManager.Setup(mfm => mfm.FolderExists(It.IsAny(), It.IsAny())).Returns(false); + this._mockFolderManager.Setup(mfm => mfm.CanMoveBetweenFolderMappings(It.IsAny(), It.IsAny())).Returns(true); + this._mockFolderManager.Setup(mfm => mfm.IsMoveOperationValid(this._folderInfo.Object, destinationFolder, It.IsAny())).Returns(false); - _mockFolderManager.Object.MoveFolder(_folderInfo.Object, destinationFolder); + this._mockFolderManager.Object.MoveFolder(this._folderInfo.Object, destinationFolder); } //[Test] @@ -2276,9 +2276,9 @@ public void MoveFolder_Throws_When_Move_Operation_Is_Not_Valid() [Test] public void OverwriteFolder_Calls_MoveFile_For_Each_File_In_Source_Folder() { - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var destinationFolder = new FolderInfo(); @@ -2287,21 +2287,21 @@ public void OverwriteFolder_Calls_MoveFile_For_Each_File_In_Source_Folder() var file3 = new FileInfo(); var files = new List { file1, file2, file3 }; - _mockFolderManager.Setup(mfm => mfm.GetFiles(_folderInfo.Object, It.IsAny(), It.IsAny())).Returns(files); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(this._folderInfo.Object, It.IsAny(), It.IsAny())).Returns(files); var fileManager = new Mock(); FileManager.RegisterInstance(fileManager.Object); fileManager.Setup(fm => fm.MoveFile(It.IsAny(), destinationFolder)); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); var folderMapping = new FolderMappingInfo(); - _mockFolderManager.Setup(mfm => mfm.GetFolderMapping(It.IsAny>(), Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolderManager.Setup(mfm => mfm.IsFolderMappingEditable(folderMapping)).Returns(false); + this._mockFolderManager.Setup(mfm => mfm.GetFolderMapping(It.IsAny>(), Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._mockFolderManager.Setup(mfm => mfm.IsFolderMappingEditable(folderMapping)).Returns(false); - _mockFolderManager.Object.OverwriteFolder(_folderInfo.Object, destinationFolder, new Dictionary(), new SortedList()); + this._mockFolderManager.Object.OverwriteFolder(this._folderInfo.Object, destinationFolder, new Dictionary(), new SortedList()); fileManager.Verify(fm => fm.MoveFile(It.IsAny(), destinationFolder), Times.Exactly(3)); } @@ -2312,25 +2312,25 @@ public void OverwriteFolder_Deletes_Source_Folder_In_Database() var fileManager = new Mock(); FileManager.RegisterInstance(fileManager.Object); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var files = new List(); - _mockFolderManager.Setup(mfm => mfm.GetFiles(_folderInfo.Object, It.IsAny(), It.IsAny())).Returns(files); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(this._folderInfo.Object, It.IsAny(), It.IsAny())).Returns(files); var destinationFolder = new FolderInfo(); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Verifiable(); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Verifiable(); var folderMapping = new FolderMappingInfo(); - _mockFolderManager.Setup(mfm => mfm.GetFolderMapping(It.IsAny>(), Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolderManager.Setup(mfm => mfm.IsFolderMappingEditable(folderMapping)).Returns(false); + this._mockFolderManager.Setup(mfm => mfm.GetFolderMapping(It.IsAny>(), Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._mockFolderManager.Setup(mfm => mfm.IsFolderMappingEditable(folderMapping)).Returns(false); - _mockFolderManager.Object.OverwriteFolder(_folderInfo.Object, destinationFolder, new Dictionary(), new SortedList()); + this._mockFolderManager.Object.OverwriteFolder(this._folderInfo.Object, destinationFolder, new Dictionary(), new SortedList()); - _mockFolderManager.Verify(); + this._mockFolderManager.Verify(); } [Test] @@ -2339,24 +2339,24 @@ public void OverwriteFolder_Adds_Folder_To_FoldersToDelete_If_FolderMapping_Is_E var fileManager = new Mock(); FileManager.RegisterInstance(fileManager.Object); - _folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); - _folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); - _folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); + this._folderInfo.Setup(fi => fi.PortalID).Returns(Constants.CONTENT_ValidPortalId); + this._folderInfo.Setup(fi => fi.FolderPath).Returns(Constants.FOLDER_ValidFolderRelativePath); + this._folderInfo.Setup(fi => fi.FolderMappingID).Returns(Constants.FOLDER_ValidFolderMappingID); var files = new List(); - _mockFolderManager.Setup(mfm => mfm.GetFiles(_folderInfo.Object, It.IsAny(), It.IsAny())).Returns(files); + this._mockFolderManager.Setup(mfm => mfm.GetFiles(this._folderInfo.Object, It.IsAny(), It.IsAny())).Returns(files); var destinationFolder = new FolderInfo(); - _mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); + this._mockFolderManager.Setup(mfm => mfm.DeleteFolder(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)); var folderMapping = new FolderMappingInfo(); - _mockFolderManager.Setup(mfm => mfm.GetFolderMapping(It.IsAny>(), Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); - _mockFolderManager.Setup(mfm => mfm.IsFolderMappingEditable(folderMapping)).Returns(true); + this._mockFolderManager.Setup(mfm => mfm.GetFolderMapping(It.IsAny>(), Constants.FOLDER_ValidFolderMappingID)).Returns(folderMapping); + this._mockFolderManager.Setup(mfm => mfm.IsFolderMappingEditable(folderMapping)).Returns(true); var foldersToDelete = new SortedList(); - _mockFolderManager.Object.OverwriteFolder(_folderInfo.Object, destinationFolder, new Dictionary(), foldersToDelete); + this._mockFolderManager.Object.OverwriteFolder(this._folderInfo.Object, destinationFolder, new Dictionary(), foldersToDelete); Assert.AreEqual(1, foldersToDelete.Count); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/SecureFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/SecureFolderProviderTests.cs index dfc3f25c893..3fd1bd7f543 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/SecureFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/SecureFolderProviderTests.cs @@ -39,20 +39,20 @@ public class SecureFolderProviderTests [SetUp] public void Setup() { - _sfp = new SecureFolderProvider(); - _folderInfo = new Mock(); - _fileInfo = new Mock(); - _fileWrapper = new Mock(); - _directoryWrapper = new Mock(); - _folderManager = new Mock(); - _fileManager = new Mock(); - _pathUtils = new Mock(); - - FileWrapper.RegisterInstance(_fileWrapper.Object); - DirectoryWrapper.RegisterInstance(_directoryWrapper.Object); - FolderManager.RegisterInstance(_folderManager.Object); - FileManager.RegisterInstance(_fileManager.Object); - PathUtils.RegisterInstance(_pathUtils.Object); + this._sfp = new SecureFolderProvider(); + this._folderInfo = new Mock(); + this._fileInfo = new Mock(); + this._fileWrapper = new Mock(); + this._directoryWrapper = new Mock(); + this._folderManager = new Mock(); + this._fileManager = new Mock(); + this._pathUtils = new Mock(); + + FileWrapper.RegisterInstance(this._fileWrapper.Object); + DirectoryWrapper.RegisterInstance(this._directoryWrapper.Object); + FolderManager.RegisterInstance(this._folderManager.Object); + FileManager.RegisterInstance(this._fileManager.Object); + PathUtils.RegisterInstance(this._pathUtils.Object); } [TearDown] @@ -71,7 +71,7 @@ public void AddFile_Throws_On_Null_Folder() { var stream = new Mock(); - _sfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object); } [Test] @@ -82,14 +82,14 @@ public void AddFile_Throws_On_NullOrEmpty_FileName(string fileName) { var stream = new Mock(); - _sfp.AddFile(_folderInfo.Object, fileName, stream.Object); + this._sfp.AddFile(this._folderInfo.Object, fileName, stream.Object); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void AddFile_Throws_On_Null_Content() { - _sfp.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, null); + this._sfp.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null); } #endregion @@ -100,31 +100,31 @@ public void AddFile_Throws_On_Null_Content() [ExpectedException(typeof(ArgumentNullException))] public void DeleteFile_Throws_On_Null_File() { - _sfp.DeleteFile(null); + this._sfp.DeleteFile(null); } [Test] public void DeleteFile_Calls_FileWrapper_Delete_When_File_Exists() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true); - _sfp.DeleteFile(_fileInfo.Object); + this._sfp.DeleteFile(this._fileInfo.Object); - _fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } [Test] public void DeleteFile_Does_Not_Call_FileWrapper_Delete_When_File_Does_Not_Exists() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false); - _sfp.DeleteFile(_fileInfo.Object); + this._sfp.DeleteFile(this._fileInfo.Object); - _fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidFilePath), Times.Never()); + this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidFilePath), Times.Never()); } #endregion @@ -135,34 +135,34 @@ public void DeleteFile_Does_Not_Call_FileWrapper_Delete_When_File_Does_Not_Exist [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_Folder() { - _sfp.FileExists(null, Constants.FOLDER_ValidFileName); + this._sfp.FileExists(null, Constants.FOLDER_ValidFileName); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_FileName() { - _sfp.FileExists(_folderInfo.Object, null); + this._sfp.FileExists(this._folderInfo.Object, null); } [Test] public void ExistsFile_Calls_FileWrapper_Exists() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _fileWrapper.Verify(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } [Test] public void ExistsFile_Returns_True_When_File_Exists() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true); - var result = _sfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsTrue(result); } @@ -170,11 +170,11 @@ public void ExistsFile_Returns_True_When_File_Exists() [Test] public void ExistsFile_Returns_False_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(false); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(false); - var result = _sfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsFalse(result); } @@ -187,7 +187,7 @@ public void ExistsFile_Returns_False_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFolder_Throws_On_Null_FolderMapping() { - _sfp.FolderExists(Constants.FOLDER_ValidFolderPath, null); + this._sfp.FolderExists(Constants.FOLDER_ValidFolderPath, null); } [Test] @@ -196,7 +196,7 @@ public void ExistsFolder_Throws_On_Null_FolderPath() { var folderMapping = new FolderMappingInfo(); - _sfp.FolderExists(null, folderMapping); + this._sfp.FolderExists(null, folderMapping); } [Test] @@ -204,11 +204,11 @@ public void ExistsFolder_Calls_DirectoryWrapper_Exists() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); - _directoryWrapper.Verify(dw => dw.Exists(Constants.FOLDER_ValidFolderPath), Times.Once()); + this._directoryWrapper.Verify(dw => dw.Exists(Constants.FOLDER_ValidFolderPath), Times.Once()); } [Test] @@ -216,11 +216,11 @@ public void ExistsFolder_Returns_True_When_Folder_Exists() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); + this._directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); - var result = _sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + var result = this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); Assert.IsTrue(result); } @@ -230,11 +230,11 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false); + this._directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false); - var result = _sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + var result = this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); Assert.IsFalse(result); } @@ -247,17 +247,17 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetFileAttributes_Throws_On_Null_File() { - _sfp.GetFileAttributes(null); + this._sfp.GetFileAttributes(null); } [Test] public void GetFileAttributes_Calls_FileWrapper_GetAttributes() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _sfp.GetFileAttributes(_fileInfo.Object); + this._sfp.GetFileAttributes(this._fileInfo.Object); - _fileWrapper.Verify(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } [Test] @@ -265,11 +265,11 @@ public void GetFileAttributes_Returns_File_Attributes_When_File_Exists() { var expectedFileAttributes = FileAttributes.Normal; - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath)).Returns(expectedFileAttributes); + this._fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath)).Returns(expectedFileAttributes); - var result = _sfp.GetFileAttributes(_fileInfo.Object); + var result = this._sfp.GetFileAttributes(this._fileInfo.Object); Assert.AreEqual(expectedFileAttributes, result); } @@ -277,11 +277,11 @@ public void GetFileAttributes_Returns_File_Attributes_When_File_Exists() [Test] public void GetFileAttributes_Returns_Null_When_File_Does_Not_Exist() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath)).Throws(); + this._fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidSecureFilePath)).Throws(); - var result = _sfp.GetFileAttributes(_fileInfo.Object); + var result = this._sfp.GetFileAttributes(this._fileInfo.Object); Assert.IsNull(result); } @@ -294,29 +294,29 @@ public void GetFileAttributes_Returns_Null_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetFiles_Throws_On_Null_Folder() { - _sfp.GetFiles(null); + this._sfp.GetFiles(null); } [Test] public void GetFiles_Calls_DirectoryWrapper_GetFiles() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.GetFiles(_folderInfo.Object); + this._sfp.GetFiles(this._folderInfo.Object); - _directoryWrapper.Verify(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)); + this._directoryWrapper.Verify(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)); } [Test] public void GetFiles_Count_Equals_DirectoryWrapper_GetFiles_Count() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); var filesReturned = new string[] { "C:\\folder\\file1.txt.resources", "C:\\folder\\file2.txt.resources", "C:\\folder\\file3.txt.resources" }; - _directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); + this._directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); - var files = _sfp.GetFiles(_folderInfo.Object); + var files = this._sfp.GetFiles(this._folderInfo.Object); Assert.AreEqual(filesReturned.Length, files.Length); } @@ -324,14 +324,14 @@ public void GetFiles_Count_Equals_DirectoryWrapper_GetFiles_Count() [Test] public void GetFiles_Return_Valid_FileNames_When_Folder_Contains_Files() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); var filesReturned = new string[] { "C:\\folder\\file1.txt.resources", "C:\\folder\\file2.txt.resources", "C:\\folder\\file3.txt.resources" }; var expectedValues = new string[] { "file1.txt", "file2.txt", "file3.txt" }; - _directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); + this._directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); - var files = _sfp.GetFiles(_folderInfo.Object); + var files = this._sfp.GetFiles(this._folderInfo.Object); CollectionAssert.AreEqual(expectedValues, files); } @@ -344,24 +344,24 @@ public void GetFiles_Return_Valid_FileNames_When_Folder_Contains_Files() [ExpectedException(typeof(ArgumentNullException))] public void GetFileStream_Throws_On_Null_Folder() { - _sfp.GetFileStream(null, Constants.FOLDER_ValidFileName); + this._sfp.GetFileStream(null, Constants.FOLDER_ValidFileName); } [Test] [ExpectedException(typeof(ArgumentException))] public void GetFileStream_Throws_On_Null_FileName() { - _sfp.GetFileStream(_folderInfo.Object, null); + this._sfp.GetFileStream(this._folderInfo.Object, null); } [Test] public void GetFileStream_Calls_FileWrapper_OpenRead() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _fileWrapper.Verify(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } [Test] @@ -370,11 +370,11 @@ public void GetFileStream_Returns_Valid_Stream_When_File_Exists() var validFileBytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var memoryStream = new MemoryStream(validFileBytes); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath)).Returns(memoryStream); + this._fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath)).Returns(memoryStream); - var result = _sfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); byte[] resultBytes; var buffer = new byte[16 * 1024]; @@ -394,11 +394,11 @@ public void GetFileStream_Returns_Valid_Stream_When_File_Exists() [Test] public void GetFileStream_Returns_Null_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath)).Throws(); + this._fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidSecureFilePath)).Throws(); - var result = _sfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsNull(result); } @@ -413,7 +413,7 @@ public void GetImageUrl_Calls_IconControllerWrapper_IconURL() var iconControllerWrapper = new Mock(); IconControllerWrapper.RegisterInstance(iconControllerWrapper.Object); - _sfp.GetFolderProviderIconPath(); + this._sfp.GetFolderProviderIconPath(); iconControllerWrapper.Verify(icw => icw.IconURL("FolderSecure", "32x32"), Times.Once()); } @@ -426,17 +426,17 @@ public void GetImageUrl_Calls_IconControllerWrapper_IconURL() [ExpectedException(typeof(ArgumentNullException))] public void GetLastModificationTime_Throws_On_Null_File() { - _sfp.GetLastModificationTime(null); + this._sfp.GetLastModificationTime(null); } [Test] public void GetLastModificationTime_Calls_FileWrapper_GetLastWriteTime() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _sfp.GetLastModificationTime(_fileInfo.Object); + this._sfp.GetLastModificationTime(this._fileInfo.Object); - _fileWrapper.Verify(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } [Test] @@ -444,11 +444,11 @@ public void GetLastModificationTime_Returns_Valid_Date_When_File_Exists() { var expectedDate = DateTime.Now; - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath)).Returns(expectedDate); + this._fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath)).Returns(expectedDate); - var result = _sfp.GetLastModificationTime(_fileInfo.Object); + var result = this._sfp.GetLastModificationTime(this._fileInfo.Object); Assert.AreEqual(expectedDate, result); } @@ -458,11 +458,11 @@ public void GetLastModificationTime_Returns_Null_Date_When_File_Does_Not_Exist() { var expectedDate = Null.NullDate; - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath)).Throws(); + this._fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidSecureFilePath)).Throws(); - var result = _sfp.GetLastModificationTime(_fileInfo.Object); + var result = this._sfp.GetLastModificationTime(this._fileInfo.Object); Assert.AreEqual(expectedDate, result); } @@ -475,7 +475,7 @@ public void GetLastModificationTime_Returns_Null_Date_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetSubFolders_Throws_On_Null_FolderMapping() { - _sfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList(); + this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList(); } [Test] @@ -484,7 +484,7 @@ public void GetSubFolders_Throws_On_Null_FolderPath() { var folderMapping = new FolderMappingInfo(); - _sfp.GetSubFolders(null, folderMapping).ToList(); + this._sfp.GetSubFolders(null, folderMapping).ToList(); } [Test] @@ -492,11 +492,11 @@ public void GetSubFolders_Calls_DirectoryWrapper_GetFiles() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); - _directoryWrapper.Verify(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath), Times.Once()); + this._directoryWrapper.Verify(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath), Times.Once()); } [Test] @@ -504,18 +504,18 @@ public void GetSubFolders_Count_Equals_DirectoryWrapper_GetDirectories_Count() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); var subFolders = new[] { Constants.FOLDER_ValidSubFolderPath, Constants.FOLDER_OtherValidSubFolderPath }; - _directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); + this._directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); - var result = _sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + var result = this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); Assert.AreEqual(subFolders.Length, result.Count); } @@ -530,18 +530,18 @@ public void GetSubFolders_Returns_Valid_SubFolders_When_Folder_Is_Not_Empty() var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); var subFolders = new[] { Constants.FOLDER_ValidSubFolderPath, Constants.FOLDER_OtherValidSubFolderPath }; - _directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); + this._directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); - var result = _sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + var result = this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); CollectionAssert.AreEqual(expectedSubFolders, result); } @@ -554,18 +554,18 @@ public void GetSubFolders_Returns_Valid_SubFolders_When_Folder_Is_Not_Empty() [ExpectedException(typeof(ArgumentNullException))] public void IsInSync_Throws_On_Null_File() { - _sfp.IsInSync(null); + this._sfp.IsInSync(null); } [Test] public void IsInSync_Returns_True_When_File_Is_In_Sync() { - _fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); var sfp = new Mock { CallBase = true }; - sfp.Setup(fp => fp.GetHash(_fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash); + sfp.Setup(fp => fp.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash); - var result = sfp.Object.IsInSync(_fileInfo.Object); + var result = sfp.Object.IsInSync(this._fileInfo.Object); Assert.IsTrue(result); } @@ -573,12 +573,12 @@ public void IsInSync_Returns_True_When_File_Is_In_Sync() [Test] public void IsInSync_Returns_True_When_File_Is_Not_In_Sync() { - _fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); var sfp = new Mock { CallBase = true }; - sfp.Setup(fp => fp.GetHash(_fileInfo.Object)).Returns(Constants.FOLDER_ModifiedFileHash); + sfp.Setup(fp => fp.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_ModifiedFileHash); - var result = sfp.Object.IsInSync(_fileInfo.Object); + var result = sfp.Object.IsInSync(this._fileInfo.Object); Assert.IsTrue(result); } @@ -591,7 +591,7 @@ public void IsInSync_Returns_True_When_File_Is_Not_In_Sync() [ExpectedException(typeof(ArgumentNullException))] public void RenameFile_Throws_On_Null_File() { - _sfp.RenameFile(null, Constants.FOLDER_ValidFileName); + this._sfp.RenameFile(null, Constants.FOLDER_ValidFileName); } [Test] @@ -600,32 +600,32 @@ public void RenameFile_Throws_On_Null_File() [ExpectedException(typeof(ArgumentException))] public void RenameFile_Throws_On_NullOrEmpty_NewFileName(string newFileName) { - _sfp.RenameFile(_fileInfo.Object, newFileName); + this._sfp.RenameFile(this._fileInfo.Object, newFileName); } [Test] public void RenameFile_Calls_FileWrapper_Move_When_FileNames_Are_Not_Equal() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName); + this._sfp.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName); - _fileWrapper.Verify(fw => fw.Move(Constants.FOLDER_ValidSecureFilePath, Constants.FOLDER_OtherValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Move(Constants.FOLDER_ValidSecureFilePath, Constants.FOLDER_OtherValidSecureFilePath), Times.Once()); } [Test] public void RenameFile_Does_Not_Call_FileWrapper_Move_When_FileNames_Are_Equal() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _sfp.RenameFile(_fileInfo.Object, Constants.FOLDER_ValidFileName); + this._sfp.RenameFile(this._fileInfo.Object, Constants.FOLDER_ValidFileName); - _fileWrapper.Verify(fw => fw.Move(It.IsAny(), It.IsAny()), Times.Never()); + this._fileWrapper.Verify(fw => fw.Move(It.IsAny(), It.IsAny()), Times.Never()); } #endregion @@ -636,7 +636,7 @@ public void RenameFile_Does_Not_Call_FileWrapper_Move_When_FileNames_Are_Equal() [ExpectedException(typeof(ArgumentNullException))] public void SetFileAttributes_Throws_On_Null_File() { - _sfp.SetFileAttributes(null, FileAttributes.Archive); + this._sfp.SetFileAttributes(null, FileAttributes.Archive); } [Test] @@ -644,11 +644,11 @@ public void SetFileAttributes_Calls_FileWrapper_SetAttributes() { const FileAttributes validFileAttributes = FileAttributes.Archive; - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _sfp.SetFileAttributes(_fileInfo.Object, validFileAttributes); + this._sfp.SetFileAttributes(this._fileInfo.Object, validFileAttributes); - _fileWrapper.Verify(fw => fw.SetAttributes(Constants.FOLDER_ValidSecureFilePath, validFileAttributes), Times.Once()); + this._fileWrapper.Verify(fw => fw.SetAttributes(Constants.FOLDER_ValidSecureFilePath, validFileAttributes), Times.Once()); } #endregion @@ -658,7 +658,7 @@ public void SetFileAttributes_Calls_FileWrapper_SetAttributes() [Test] public void SupportsFileAttributes_Returns_True() { - var result = _sfp.SupportsFileAttributes(); + var result = this._sfp.SupportsFileAttributes(); Assert.IsTrue(result); } @@ -673,7 +673,7 @@ public void UpdateFile_Throws_On_Null_Folder() { var stream = new Mock(); - _sfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object); } [Test] @@ -684,42 +684,42 @@ public void UpdateFile_Throws_On_NullOrEmpty_FileName(string fileName) { var stream = new Mock(); - _sfp.UpdateFile(_folderInfo.Object, fileName, stream.Object); + this._sfp.UpdateFile(this._folderInfo.Object, fileName, stream.Object); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void UpdateFile_Throws_On_Null_Content() { - _sfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, null); + this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null); } [Test] public void UpdateFile_Calls_FileWrapper_Delete_When_File_Exists() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(true); var stream = new Mock(); - _sfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); - _fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } [Test] public void UpdateFile_Calls_FileWrapper_Create() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(false); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidSecureFilePath)).Returns(false); var stream = new Mock(); - _sfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); - _fileWrapper.Verify(fw => fw.Create(Constants.FOLDER_ValidSecureFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Create(Constants.FOLDER_ValidSecureFilePath), Times.Once()); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs index 79250cec96e..c04b675e36e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Folder/StandardFolderProviderTests.cs @@ -56,35 +56,35 @@ public void FixtureSetup() [SetUp] public void Setup() { - _sfp = new StandardFolderProvider(); - _folderInfo = new Mock(); - _fileInfo = new Mock(); - _fileWrapper = new Mock(); - _directoryWrapper = new Mock(); - _folderManager = new Mock(); - _fileManager = new Mock(); - _pathUtils = new Mock(); - _portalControllerMock = new Mock(); - _portalControllerMock.Setup(p => p.GetPortalSettings(Constants.CONTENT_ValidPortalId)) - .Returns(GetPortalSettingsDictionaryMock()); - _portalControllerMock.Setup(p => p.GetCurrentPortalSettings()).Returns(GetPortalSettingsMock()); - _cryptographyProviderMock = new Mock(); - _cryptographyProviderMock.Setup(c => c.EncryptParameter(It.IsAny(), It.IsAny())) + this._sfp = new StandardFolderProvider(); + this._folderInfo = new Mock(); + this._fileInfo = new Mock(); + this._fileWrapper = new Mock(); + this._directoryWrapper = new Mock(); + this._folderManager = new Mock(); + this._fileManager = new Mock(); + this._pathUtils = new Mock(); + this._portalControllerMock = new Mock(); + this._portalControllerMock.Setup(p => p.GetPortalSettings(Constants.CONTENT_ValidPortalId)) + .Returns(this.GetPortalSettingsDictionaryMock()); + this._portalControllerMock.Setup(p => p.GetCurrentPortalSettings()).Returns(this.GetPortalSettingsMock()); + this._cryptographyProviderMock = new Mock(); + this._cryptographyProviderMock.Setup(c => c.EncryptParameter(It.IsAny(), It.IsAny())) .Returns(Guid.NewGuid().ToString("N")); - _localeControllerMock = new Mock(); - _localeControllerMock.Setup(l => l.GetLocales(Constants.CONTENT_ValidPortalId)).Returns(new Dictionary + this._localeControllerMock = new Mock(); + this._localeControllerMock.Setup(l => l.GetLocales(Constants.CONTENT_ValidPortalId)).Returns(new Dictionary { {"en-us", new Locale()} }); - FileWrapper.RegisterInstance(_fileWrapper.Object); - DirectoryWrapper.RegisterInstance(_directoryWrapper.Object); - FolderManager.RegisterInstance(_folderManager.Object); - FileManager.RegisterInstance(_fileManager.Object); - PathUtils.RegisterInstance(_pathUtils.Object); - PortalController.SetTestableInstance(_portalControllerMock.Object); - ComponentFactory.RegisterComponentInstance("CryptographyProviderMock", _cryptographyProviderMock.Object); - LocaleController.RegisterInstance(_localeControllerMock.Object); + FileWrapper.RegisterInstance(this._fileWrapper.Object); + DirectoryWrapper.RegisterInstance(this._directoryWrapper.Object); + FolderManager.RegisterInstance(this._folderManager.Object); + FileManager.RegisterInstance(this._fileManager.Object); + PathUtils.RegisterInstance(this._pathUtils.Object); + PortalController.SetTestableInstance(this._portalControllerMock.Object); + ComponentFactory.RegisterComponentInstance("CryptographyProviderMock", this._cryptographyProviderMock.Object); + LocaleController.RegisterInstance(this._localeControllerMock.Object); } private Dictionary GetPortalSettingsDictionaryMock() @@ -124,7 +124,7 @@ public void AddFile_Throws_On_Null_Folder() { var stream = new Mock(); - _sfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.AddFile(null, Constants.FOLDER_ValidFileName, stream.Object); } [Test] @@ -135,14 +135,14 @@ public void AddFile_Throws_On_NullOrEmpty_FileName(string fileName) { var stream = new Mock(); - _sfp.AddFile(_folderInfo.Object, fileName, stream.Object); + this._sfp.AddFile(this._folderInfo.Object, fileName, stream.Object); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void AddFile_Throws_On_Null_Content() { - _sfp.AddFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, null); + this._sfp.AddFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null); } #endregion @@ -153,7 +153,7 @@ public void AddFile_Throws_On_Null_Content() [ExpectedException(typeof(ArgumentNullException))] public void DeleteFile_Throws_On_Null_File() { - _sfp.DeleteFile(null); + this._sfp.DeleteFile(null); } //[Test] @@ -188,34 +188,34 @@ public void DeleteFile_Throws_On_Null_File() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_Folder() { - _sfp.FileExists(null, Constants.FOLDER_ValidFileName); + this._sfp.FileExists(null, Constants.FOLDER_ValidFileName); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void ExistsFile_Throws_On_Null_FileName() { - _sfp.FileExists(_folderInfo.Object, null); + this._sfp.FileExists(this._folderInfo.Object, null); } [Test] public void ExistsFile_Calls_FileWrapper_Exists() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _fileWrapper.Verify(fw => fw.Exists(Constants.FOLDER_ValidFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Exists(Constants.FOLDER_ValidFilePath), Times.Once()); } [Test] public void ExistsFile_Returns_True_When_File_Exists() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(true); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(true); - var result = _sfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsTrue(result); } @@ -223,11 +223,11 @@ public void ExistsFile_Returns_True_When_File_Exists() [Test] public void ExistsFile_Returns_False_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false); - var result = _sfp.FileExists(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.FileExists(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsFalse(result); } @@ -240,7 +240,7 @@ public void ExistsFile_Returns_False_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void ExistsFolder_Throws_On_Null_FolderMapping() { - _sfp.FolderExists(Constants.FOLDER_ValidFolderPath, null); + this._sfp.FolderExists(Constants.FOLDER_ValidFolderPath, null); } [Test] @@ -249,7 +249,7 @@ public void ExistsFolder_Throws_On_Null_FolderPath() { var folderMapping = new FolderMappingInfo(); - _sfp.FolderExists(null, folderMapping); + this._sfp.FolderExists(null, folderMapping); } [Test] @@ -257,11 +257,11 @@ public void ExistsFolder_Calls_DirectoryWrapper_Exists() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); - _directoryWrapper.Verify(dw => dw.Exists(Constants.FOLDER_ValidFolderPath), Times.Once()); + this._directoryWrapper.Verify(dw => dw.Exists(Constants.FOLDER_ValidFolderPath), Times.Once()); } [Test] @@ -269,11 +269,11 @@ public void ExistsFolder_Returns_True_When_Folder_Exists() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); + this._directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(true); - var result = _sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + var result = this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); Assert.IsTrue(result); } @@ -283,11 +283,11 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false); + this._directoryWrapper.Setup(dw => dw.Exists(Constants.FOLDER_ValidFolderPath)).Returns(false); - var result = _sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); + var result = this._sfp.FolderExists(Constants.FOLDER_ValidFolderRelativePath, folderMapping); Assert.IsFalse(result); } @@ -300,7 +300,7 @@ public void ExistsFolder_Returns_False_When_Folder_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetFileAttributes_Throws_On_Null_File() { - _sfp.GetFileAttributes(null); + this._sfp.GetFileAttributes(null); } //[Test] @@ -330,11 +330,11 @@ public void GetFileAttributes_Throws_On_Null_File() [Test] public void GetFileAttributes_Returns_Null_When_File_Does_Not_Exist() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidFilePath)).Throws(); + this._fileWrapper.Setup(fw => fw.GetAttributes(Constants.FOLDER_ValidFilePath)).Throws(); - var result = _sfp.GetFileAttributes(_fileInfo.Object); + var result = this._sfp.GetFileAttributes(this._fileInfo.Object); Assert.IsNull(result); } @@ -347,29 +347,29 @@ public void GetFileAttributes_Returns_Null_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetFiles_Throws_On_Null_Folder() { - _sfp.GetFiles(null); + this._sfp.GetFiles(null); } [Test] public void GetFiles_Calls_DirectoryWrapper_GetFiles() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.GetFiles(_folderInfo.Object); + this._sfp.GetFiles(this._folderInfo.Object); - _directoryWrapper.Verify(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)); + this._directoryWrapper.Verify(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)); } [Test] public void GetFiles_Count_Equals_DirectoryWrapper_GetFiles_Count() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); var filesReturned = new[] { "", "", "" }; - _directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); + this._directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); - var files = _sfp.GetFiles(_folderInfo.Object); + var files = this._sfp.GetFiles(this._folderInfo.Object); Assert.AreEqual(filesReturned.Length, files.Length); } @@ -377,14 +377,14 @@ public void GetFiles_Count_Equals_DirectoryWrapper_GetFiles_Count() [Test] public void GetFiles_Returns_Valid_FileNames_When_Folder_Contains_Files() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); var filesReturned = new[] { "C:\\folder\\file1.txt", "C:\\folder\\file2.txt", "C:\\folder\\file3.txt" }; var expectedValues = new[] { "file1.txt", "file2.txt", "file3.txt" }; - _directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); + this._directoryWrapper.Setup(dw => dw.GetFiles(Constants.FOLDER_ValidFolderPath)).Returns(filesReturned); - var files = _sfp.GetFiles(_folderInfo.Object); + var files = this._sfp.GetFiles(this._folderInfo.Object); CollectionAssert.AreEqual(expectedValues, files); } @@ -397,24 +397,24 @@ public void GetFiles_Returns_Valid_FileNames_When_Folder_Contains_Files() [ExpectedException(typeof(ArgumentNullException))] public void GetFileStream_Throws_On_Null_Folder() { - _sfp.GetFileStream(null, Constants.FOLDER_ValidFileName); + this._sfp.GetFileStream(null, Constants.FOLDER_ValidFileName); } [Test] [ExpectedException(typeof(ArgumentException))] public void GetFileStream_Throws_On_Null_FileName() { - _sfp.GetFileStream(_folderInfo.Object, null); + this._sfp.GetFileStream(this._folderInfo.Object, null); } [Test] public void GetFileStream_Calls_FileWrapper_OpenRead() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); - _fileWrapper.Verify(fw => fw.OpenRead(Constants.FOLDER_ValidFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.OpenRead(Constants.FOLDER_ValidFilePath), Times.Once()); } [Test] @@ -423,11 +423,11 @@ public void GetFileStream_Returns_Valid_Stream_When_File_Exists() var validFileBytes = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; var memoryStream = new MemoryStream(validFileBytes); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidFilePath)).Returns(memoryStream); + this._fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidFilePath)).Returns(memoryStream); - var result = _sfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); byte[] resultBytes; var buffer = new byte[16 * 1024]; @@ -447,11 +447,11 @@ public void GetFileStream_Returns_Valid_Stream_When_File_Exists() [Test] public void GetFileStream_Returns_Null_When_File_Does_Not_Exist() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidFilePath)).Throws(); + this._fileWrapper.Setup(fw => fw.OpenRead(Constants.FOLDER_ValidFilePath)).Throws(); - var result = _sfp.GetFileStream(_folderInfo.Object, Constants.FOLDER_ValidFileName); + var result = this._sfp.GetFileStream(this._folderInfo.Object, Constants.FOLDER_ValidFileName); Assert.IsNull(result); } @@ -466,7 +466,7 @@ public void GetImageUrl_Calls_IconControllerWrapper_IconURL() var iconControllerWrapper = new Mock(); IconControllerWrapper.RegisterInstance(iconControllerWrapper.Object); - _sfp.GetFolderProviderIconPath(); + this._sfp.GetFolderProviderIconPath(); iconControllerWrapper.Verify(icw => icw.IconURL("FolderStandard", "32x32"), Times.Once()); } @@ -479,7 +479,7 @@ public void GetImageUrl_Calls_IconControllerWrapper_IconURL() [ExpectedException(typeof(ArgumentNullException))] public void GetLastModificationTime_Throws_On_Null_File() { - _sfp.GetLastModificationTime(null); + this._sfp.GetLastModificationTime(null); } //[Test] @@ -511,11 +511,11 @@ public void GetLastModificationTime_Returns_Null_Date_When_File_Does_Not_Exist() { var expectedDate = Null.NullDate; - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidFilePath)).Throws(); + this._fileWrapper.Setup(fw => fw.GetLastWriteTime(Constants.FOLDER_ValidFilePath)).Throws(); - var result = _sfp.GetLastModificationTime(_fileInfo.Object); + var result = this._sfp.GetLastModificationTime(this._fileInfo.Object); Assert.AreEqual(expectedDate, result); } @@ -528,7 +528,7 @@ public void GetLastModificationTime_Returns_Null_Date_When_File_Does_Not_Exist() [ExpectedException(typeof(ArgumentNullException))] public void GetSubFolders_Throws_On_Null_FolderMapping() { - _sfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList(); + this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderPath, null).ToList(); } [Test] @@ -537,7 +537,7 @@ public void GetSubFolders_Throws_On_Null_FolderPath() { var folderMapping = new FolderMappingInfo(); - _sfp.GetSubFolders(null, folderMapping).ToList(); + this._sfp.GetSubFolders(null, folderMapping).ToList(); } [Test] @@ -545,11 +545,11 @@ public void GetSubFolders_Calls_DirectoryWrapper_GetDirectories() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(folderMapping.PortalID, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); - _directoryWrapper.Verify(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath), Times.Once()); + this._directoryWrapper.Verify(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath), Times.Once()); } [Test] @@ -557,18 +557,18 @@ public void GetSubFolders_Count_Equals_DirectoryWrapper_GetDirectories_Count() { var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); var subFolders = new[] { Constants.FOLDER_ValidSubFolderPath, Constants.FOLDER_OtherValidSubFolderPath }; - _directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); + this._directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); - var result = _sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + var result = this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); Assert.AreEqual(subFolders.Length, result.Count); } @@ -583,18 +583,18 @@ public void GetSubFolders_Returns_Valid_SubFolders_When_Folder_Is_Not_Empty() var folderMapping = new FolderMappingInfo { PortalID = Constants.CONTENT_ValidPortalId }; - _pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); - _pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetPhysicalPath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidFolderRelativePath)).Returns(Constants.FOLDER_ValidFolderPath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_ValidSubFolderPath)).Returns(Constants.FOLDER_ValidSubFolderRelativePath); + this._pathUtils.Setup(pu => pu.GetRelativePath(Constants.CONTENT_ValidPortalId, Constants.FOLDER_OtherValidSubFolderPath)).Returns(Constants.FOLDER_OtherValidSubFolderRelativePath); var subFolders = new[] { Constants.FOLDER_ValidSubFolderPath, Constants.FOLDER_OtherValidSubFolderPath }; - _directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); + this._directoryWrapper.Setup(dw => dw.GetDirectories(Constants.FOLDER_ValidFolderPath)).Returns(subFolders); - var result = _sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); + var result = this._sfp.GetSubFolders(Constants.FOLDER_ValidFolderRelativePath, folderMapping).ToList(); CollectionAssert.AreEqual(expectedSubFolders, result); } @@ -611,13 +611,13 @@ public void GetFileUrl_ReturnsStandardUrl_WhenFileUrlDoesNotContainInvalidCharac { //Arrange var sfp = new Mock { CallBase = true }; - var portalSettingsMock = GetPortalSettingsMock(); + var portalSettingsMock = this.GetPortalSettingsMock(); sfp.Setup(fp => fp.GetPortalSettings(Constants.CONTENT_ValidPortalId)).Returns(portalSettingsMock); - _fileInfo.Setup(f => f.FileName).Returns($"MyFileName {fileNameChar} Copy"); - _fileInfo.Setup(f => f.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(f => f.FileName).Returns($"MyFileName {fileNameChar} Copy"); + this._fileInfo.Setup(f => f.PortalId).Returns(Constants.CONTENT_ValidPortalId); //Act - var fileUrl = sfp.Object.GetFileUrl(_fileInfo.Object); + var fileUrl = sfp.Object.GetFileUrl(this._fileInfo.Object); //Assert Assert.IsFalse(fileUrl.ToLowerInvariant().Contains("linkclick")); @@ -638,13 +638,13 @@ public void GetFileUrl_ReturnsLinkclickUrl_WhenFileUrlContainsInvalidCharactes(s { //Arrange var sfp = new Mock { CallBase = true }; - var portalSettingsMock = GetPortalSettingsMock(); + var portalSettingsMock = this.GetPortalSettingsMock(); sfp.Setup(fp => fp.GetPortalSettings(Constants.CONTENT_ValidPortalId)).Returns(portalSettingsMock); - _fileInfo.Setup(f => f.FileName).Returns($"MyFileName {fileNameChar} Copy"); - _fileInfo.Setup(f => f.PortalId).Returns(Constants.CONTENT_ValidPortalId); + this._fileInfo.Setup(f => f.FileName).Returns($"MyFileName {fileNameChar} Copy"); + this._fileInfo.Setup(f => f.PortalId).Returns(Constants.CONTENT_ValidPortalId); //Act - var fileUrl = sfp.Object.GetFileUrl(_fileInfo.Object); + var fileUrl = sfp.Object.GetFileUrl(this._fileInfo.Object); //Assert Assert.IsTrue(fileUrl.ToLowerInvariant().Contains("linkclick")); @@ -657,18 +657,18 @@ public void GetFileUrl_ReturnsLinkclickUrl_WhenFileUrlContainsInvalidCharactes(s [ExpectedException(typeof(ArgumentNullException))] public void IsInSync_Throws_On_Null_File() { - _sfp.IsInSync(null); + this._sfp.IsInSync(null); } [Test] public void IsInSync_Returns_True_When_File_Is_In_Sync() { - _fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); var sfp = new Mock { CallBase = true }; - sfp.Setup(fp => fp.GetHash(_fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash); + sfp.Setup(fp => fp.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_UnmodifiedFileHash); - var result = sfp.Object.IsInSync(_fileInfo.Object); + var result = sfp.Object.IsInSync(this._fileInfo.Object); Assert.IsTrue(result); } @@ -676,12 +676,12 @@ public void IsInSync_Returns_True_When_File_Is_In_Sync() [Test] public void IsInSync_Returns_True_When_File_Is_Not_In_Sync() { - _fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); + this._fileInfo.Setup(fi => fi.SHA1Hash).Returns(Constants.FOLDER_UnmodifiedFileHash); var sfp = new Mock { CallBase = true }; - sfp.Setup(fp => fp.GetHash(_fileInfo.Object)).Returns(Constants.FOLDER_ModifiedFileHash); + sfp.Setup(fp => fp.GetHash(this._fileInfo.Object)).Returns(Constants.FOLDER_ModifiedFileHash); - var result = sfp.Object.IsInSync(_fileInfo.Object); + var result = sfp.Object.IsInSync(this._fileInfo.Object); Assert.IsTrue(result); } @@ -694,7 +694,7 @@ public void IsInSync_Returns_True_When_File_Is_Not_In_Sync() [ExpectedException(typeof(ArgumentNullException))] public void RenameFile_Throws_On_Null_File() { - _sfp.RenameFile(null, Constants.FOLDER_ValidFileName); + this._sfp.RenameFile(null, Constants.FOLDER_ValidFileName); } [Test] @@ -703,32 +703,32 @@ public void RenameFile_Throws_On_Null_File() [ExpectedException(typeof(ArgumentException))] public void RenameFile_Throws_On_NullOrEmpty_NewFileName(string newFileName) { - _sfp.RenameFile(_fileInfo.Object, newFileName); + this._sfp.RenameFile(this._fileInfo.Object, newFileName); } [Test] public void RenameFile_Calls_FileWrapper_Move_When_FileNames_Are_Not_Equal() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); - _folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(_folderInfo.Object); - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.FolderId).Returns(Constants.FOLDER_ValidFolderId); + this._folderManager.Setup(fm => fm.GetFolder(Constants.FOLDER_ValidFolderId)).Returns(this._folderInfo.Object); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _sfp.RenameFile(_fileInfo.Object, Constants.FOLDER_OtherValidFileName); + this._sfp.RenameFile(this._fileInfo.Object, Constants.FOLDER_OtherValidFileName); - _fileWrapper.Verify(fw => fw.Move(Constants.FOLDER_ValidFilePath, Constants.FOLDER_OtherValidFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Move(Constants.FOLDER_ValidFilePath, Constants.FOLDER_OtherValidFilePath), Times.Once()); } [Test] public void RenameFile_Does_Not_Call_FileWrapper_Move_When_FileNames_Are_Equal() { - _fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); - _fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); + this._fileInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFilePath); + this._fileInfo.Setup(fi => fi.FileName).Returns(Constants.FOLDER_ValidFileName); - _sfp.RenameFile(_fileInfo.Object, Constants.FOLDER_ValidFileName); + this._sfp.RenameFile(this._fileInfo.Object, Constants.FOLDER_ValidFileName); - _fileWrapper.Verify(fw => fw.Move(It.IsAny(), It.IsAny()), Times.Never()); + this._fileWrapper.Verify(fw => fw.Move(It.IsAny(), It.IsAny()), Times.Never()); } #endregion @@ -739,7 +739,7 @@ public void RenameFile_Does_Not_Call_FileWrapper_Move_When_FileNames_Are_Equal() [ExpectedException(typeof(ArgumentNullException))] public void SetFileAttributes_Throws_On_Null_File() { - _sfp.SetFileAttributes(null, FileAttributes.Archive); + this._sfp.SetFileAttributes(null, FileAttributes.Archive); } //[Test] @@ -761,7 +761,7 @@ public void SetFileAttributes_Throws_On_Null_File() [Test] public void SupportsFileAttributes_Returns_True() { - var result = _sfp.SupportsFileAttributes(); + var result = this._sfp.SupportsFileAttributes(); Assert.IsTrue(result); } @@ -776,7 +776,7 @@ public void UpdateFile_Throws_On_Null_Folder() { var stream = new Mock(); - _sfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.UpdateFile(null, Constants.FOLDER_ValidFileName, stream.Object); } [Test] @@ -787,42 +787,42 @@ public void UpdateFile_Throws_On_NullOrEmpty_FileName(string fileName) { var stream = new Mock(); - _sfp.UpdateFile(_folderInfo.Object, fileName, stream.Object); + this._sfp.UpdateFile(this._folderInfo.Object, fileName, stream.Object); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void UpdateFile_Throws_On_Null_Content() { - _sfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, null); + this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, null); } [Test] public void UpdateFile_Calls_FileWrapper_Delete_When_File_Exists() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(true); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(true); var stream = new Mock(); - _sfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); - _fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Delete(Constants.FOLDER_ValidFilePath), Times.Once()); } [Test] public void UpdateFile_Calls_FileWrapper_Create() { - _folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); + this._folderInfo.Setup(fi => fi.PhysicalPath).Returns(Constants.FOLDER_ValidFolderPath); - _fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false); + this._fileWrapper.Setup(fw => fw.Exists(Constants.FOLDER_ValidFilePath)).Returns(false); var stream = new Mock(); - _sfp.UpdateFile(_folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); + this._sfp.UpdateFile(this._folderInfo.Object, Constants.FOLDER_ValidFileName, stream.Object); - _fileWrapper.Verify(fw => fw.Create(Constants.FOLDER_ValidFilePath), Times.Once()); + this._fileWrapper.Verify(fw => fw.Create(Constants.FOLDER_ValidFilePath), Times.Once()); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Membership/MembershipProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Membership/MembershipProviderTests.cs index 30b6735e73a..7513aca7c2a 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Membership/MembershipProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Membership/MembershipProviderTests.cs @@ -76,7 +76,7 @@ public void Password_Should_Saved_In_History_During_Create_User() var user = CreateNewUser(); var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator("/", AppDomain.CurrentDomain.BaseDirectory); - simulator.SimulateRequest(new Uri(WebsiteAppPath)); + simulator.SimulateRequest(new Uri(this.WebsiteAppPath)); HttpContextBase httpContextBase = new HttpContextWrapper(HttpContext.Current); HttpContextSource.RegisterInstance(httpContextBase); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Permissions/PermissionTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Permissions/PermissionTests.cs index a91d94e2356..831e28ad7ef 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Permissions/PermissionTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Providers/Permissions/PermissionTests.cs @@ -320,7 +320,7 @@ private void CreateUser(bool isSuperUser, IEnumerable Roles) userRoles.Add(new UserRoleInfo() { RoleName = role, Status = RoleStatus.Approved }); } mockRoleProvider.Setup(rp => rp.GetUserRoles(It.Is(u => u.UserID == UserId), It.IsAny())).Returns(userRoles); - var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator(WebsitePhysicalAppPath); + var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator(this.WebsitePhysicalAppPath); simulator.SimulateRequest(); HttpContextBase httpContextBase = new HttpContextWrapper(HttpContext.Current); HttpContextSource.RegisterInstance(httpContextBase); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/RetryableActionTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/RetryableActionTests.cs index b8bfdfc64e5..bf5478d363c 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/RetryableActionTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/RetryableActionTests.cs @@ -19,8 +19,8 @@ public class RetryableActionTests [SetUp] public void Setup() { - _sleepMonitor = new SleepMonitor(); - RetryableAction.SleepAction = _sleepMonitor.GoToSleep; + this._sleepMonitor = new SleepMonitor(); + RetryableAction.SleepAction = this._sleepMonitor.GoToSleep; } [Test] @@ -53,9 +53,9 @@ public void DelaysIncreaseWithEachRetry() retryable.TryIt(); - var firstRetry = _sleepMonitor.SleepPeriod[0]; - var secondRetry = _sleepMonitor.SleepPeriod[1]; - var thirdRetry = _sleepMonitor.SleepPeriod[2]; + var firstRetry = this._sleepMonitor.SleepPeriod[0]; + var secondRetry = this._sleepMonitor.SleepPeriod[1]; + var thirdRetry = this._sleepMonitor.SleepPeriod[2]; Assert.AreEqual(5, firstRetry); Assert.AreEqual(50, secondRetry); @@ -89,14 +89,14 @@ class SleepMonitor public void GoToSleep(int delay) { - _periods.Add(delay); + this._periods.Add(delay); } public IList SleepPeriod { get { - return _periods.AsReadOnly(); + return this._periods.AsReadOnly(); } } } @@ -110,7 +110,7 @@ public ActionMonitor() : this(0) {} public ActionMonitor(int failureCount) { - _failuresRemaining = failureCount; + this._failuresRemaining = failureCount; } public int TimesCalled { get; private set; } @@ -119,20 +119,20 @@ public IList CallTime { get { - return _callTimes.AsReadOnly(); + return this._callTimes.AsReadOnly(); } } public void Action() { - _callTimes.Add(DateTime.Now); - TimesCalled++; + this._callTimes.Add(DateTime.Now); + this.TimesCalled++; - if(_failuresRemaining != 0) + if(this._failuresRemaining != 0) { - if (_failuresRemaining > 0) + if (this._failuresRemaining > 0) { - _failuresRemaining--; + this._failuresRemaining--; } throw new Exception("it failed"); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/FacebookRequestControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/FacebookRequestControllerTests.cs index 617383da348..5ac584a6e25 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/FacebookRequestControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/FacebookRequestControllerTests.cs @@ -31,14 +31,14 @@ public class FacebookRequestControllerTests [SetUp] public void SetUp() { - _requestDics = new Dictionary(); - _requestDics.Add("Empty", string.Empty); - _requestDics.Add("Valid", "vlXgu64BQGFSQrY0ZcJBZASMvYvTHu9GQ0YM9rjPSso.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsIjAiOiJwYXlsb2FkIiwidXNlcl9pZCI6ICIxIiwiZXhwaXJlcyI6IjEzMjUzNzU5OTkifQ=="); + this._requestDics = new Dictionary(); + this._requestDics.Add("Empty", string.Empty); + this._requestDics.Add("Valid", "vlXgu64BQGFSQrY0ZcJBZASMvYvTHu9GQ0YM9rjPSso.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsIjAiOiJwYXlsb2FkIiwidXNlcl9pZCI6ICIxIiwiZXhwaXJlcyI6IjEzMjUzNzU5OTkifQ=="); - _requestDics.Add("ValidForAPage", "ylleuHAFR0DTpZ3bNr0fjMp7X7le_j8_HN3ONpbbgkk.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZF9hdCI6MTMxOTQ4ODEwNywicGFnZSI6eyJpZCI6IjEzMDYzNDU0MDM3MjcyOCIsImxpa2VkIjpmYWxzZSwiYWRtaW4iOnRydWV9LCJ1c2VyIjp7ImNvdW50cnkiOiJjYSIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MjF9fX0"); + this._requestDics.Add("ValidForAPage", "ylleuHAFR0DTpZ3bNr0fjMp7X7le_j8_HN3ONpbbgkk.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZF9hdCI6MTMxOTQ4ODEwNywicGFnZSI6eyJpZCI6IjEzMDYzNDU0MDM3MjcyOCIsImxpa2VkIjpmYWxzZSwiYWRtaW4iOnRydWV9LCJ1c2VyIjp7ImNvdW50cnkiOiJjYSIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MjF9fX0"); //json data "{\"algorithm\":\"HMAC-SHA256\",\"issued_at\":1319488107,\"page\":{\"id\":\"130634540372728\",\"liked\":false,\"admin\":true},\"user\":{\"country\":\"ca\",\"locale\":\"en_US\",\"age\":{\"min\":21}}}" - _requestDics.Add("Invalid", "Invalid Content"); + this._requestDics.Add("Invalid", "Invalid Content"); } #endregion @@ -48,28 +48,28 @@ public void SetUp() [Test] public void FacebookRequestController_GetFacebookDetailsFromRequest_With_Empty_Request_String() { - var request = FacebookRequestController.GetFacebookDetailsFromRequest(_requestDics["Empty"]); + var request = FacebookRequestController.GetFacebookDetailsFromRequest(this._requestDics["Empty"]); Assert.IsNull(request); } [Test] public void FacebookRequestController_GetFacebookDetailsFromRequest_With_Invalid_Request_String() { - var request = FacebookRequestController.GetFacebookDetailsFromRequest(_requestDics["Invalid"]); + var request = FacebookRequestController.GetFacebookDetailsFromRequest(this._requestDics["Invalid"]); Assert.IsNull(request); } [Test] public void FacebookRequestController_GetFacebookDetailsFromRequest_With_Valid_Request_String() { - var request = FacebookRequestController.GetFacebookDetailsFromRequest(_requestDics["Valid"]); + var request = FacebookRequestController.GetFacebookDetailsFromRequest(this._requestDics["Valid"]); Assert.AreEqual(true, request.IsValid); } [Test] public void FacebookRequestController_GetFacebookDetailsFromRequest_With_Valid_Request_String_ForAPage() { - var request = FacebookRequestController.GetFacebookDetailsFromRequest(_requestDics["ValidForAPage"]); + var request = FacebookRequestController.GetFacebookDetailsFromRequest(this._requestDics["ValidForAPage"]); Assert.AreEqual(true, request.IsValid); Assert.AreEqual("HMAC-SHA256", request.Algorithm); Assert.AreEqual(ConvertToTimestamp(1319488107), request.IssuedAt); @@ -108,8 +108,8 @@ public void FacebookRequestController_GetFacebookDetailsFromRequest_With_Post_In { HttpRequest httpRequest = new HttpRequest("unittest.aspx", "http://localhost/unittest.aspx", ""); httpRequest.RequestType = "POST"; - SetReadonly(httpRequest.Form, false); - httpRequest.Form.Add("signed_request", _requestDics["Invalid"]); + this.SetReadonly(httpRequest.Form, false); + httpRequest.Form.Add("signed_request", this._requestDics["Invalid"]); var request = FacebookRequestController.GetFacebookDetailsFromRequest(httpRequest); Assert.IsNull(request); @@ -120,8 +120,8 @@ public void FacebookRequestController_GetFacebookDetailsFromRequest_With_Post_Va { HttpRequest httpRequest = new HttpRequest("unittest.aspx", "http://localhost/unittest.aspx", ""); httpRequest.RequestType = "POST"; - SetReadonly(httpRequest.Form, false); - httpRequest.Form.Add("signed_request", _requestDics["Valid"]); + this.SetReadonly(httpRequest.Form, false); + httpRequest.Form.Add("signed_request", this._requestDics["Valid"]); var request = FacebookRequestController.GetFacebookDetailsFromRequest(httpRequest); Assert.AreEqual(true, request.IsValid); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/TestClientCapability.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/TestClientCapability.cs index 79cdff8bd79..fa35eb1c09f 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/TestClientCapability.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/ClientCapability/TestClientCapability.cs @@ -16,9 +16,9 @@ public override string this[string name] { get { - if (Capabilities.ContainsKey(name)) + if (this.Capabilities.ContainsKey(name)) { - return Capabilities[name]; + return this.Capabilities[name]; } return string.Empty; diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/HtmlUtilsTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/HtmlUtilsTest.cs index e23d1422832..b5079c79d1e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/HtmlUtilsTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/HtmlUtilsTest.cs @@ -55,66 +55,66 @@ public void TearDown() public void HtmlUtils_CleanWithTagInfo_Should_Return_Clean_Content_With_Attribute_Values() { // Arrange - SetUp(); - _expected = + this.SetUp(); + this._expected = "Hello World This is a sample HTML text for testing DotNetNuke Corp HappyFaceAlt HappyFaceTitle /dotnetnuke_enterprise/Portals/0/Telerik/images/Emoticons/1.gif http://localhost/dotnetnuke_enterprise/Portals/0/aspnet.gif https://www.dnnsoftware.com "; // Act object retValue = HtmlUtils.CleanWithTagInfo(HtmlStr, Filters, true); // Assert - Assert.AreEqual(_expected, retValue); + Assert.AreEqual(this._expected, retValue); // TearDown - TearDown(); + this.TearDown(); } [Test] public void HtmlUtils_CleanWithTagInfo_Should_Return_Clean_Content_Without_Attribute_Values() { // Arrange - SetUp(); - _expected = "Hello World This is a sample HTML text for testing DotNetNuke Corp "; + this.SetUp(); + this._expected = "Hello World This is a sample HTML text for testing DotNetNuke Corp "; // Act object retValue = HtmlUtils.CleanWithTagInfo(HtmlStr, " ", true); // Assert - Assert.AreEqual(_expected, retValue); + Assert.AreEqual(this._expected, retValue); // TearDown - TearDown(); + this.TearDown(); } [Test] public void HtmlUtils_StripUnspecifiedTags_Should_Return_Attribute_Values() { // Arrange - SetUp(); - _expected = + this.SetUp(); + this._expected = "Hello World!This is a sample HTML text for testing!DotNetNuke Corp. \"HappyFaceAlt\" \"HappyFaceTitle\" \"/dotnetnuke_enterprise/Portals/0/Telerik/images/Emoticons/1.gif\" \"\" \"http://localhost/dotnetnuke_enterprise/Portals/0/aspnet.gif\" \"https://www.dnnsoftware.com\""; // Act object retValue = HtmlUtils.StripUnspecifiedTags(HtmlStr, Filters, false); // Assert - Assert.AreEqual(_expected, retValue); + Assert.AreEqual(this._expected, retValue); // TearDown - TearDown(); + this.TearDown(); } [Test] public void HtmlUtils_StripUnspecifiedTags_Should_Not_Return_Attribute_Values() { // Arrange - SetUp(); - _expected = "Hello World!This is a sample HTML text for testing!DotNetNuke Corp."; + this.SetUp(); + this._expected = "Hello World!This is a sample HTML text for testing!DotNetNuke Corp."; // Act object retValue = HtmlUtils.StripUnspecifiedTags(HtmlStr, " ", false); // Assert - Assert.AreEqual(_expected, retValue); + Assert.AreEqual(this._expected, retValue); // TearDown - TearDown(); + this.TearDown(); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Localization/LocalizationTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Localization/LocalizationTests.cs index 720f5c90e83..b3edc650191 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Localization/LocalizationTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Localization/LocalizationTests.cs @@ -22,8 +22,8 @@ public class LocalizationTests [SetUp] public void Setup() { - _mockHttpContext = HttpContextHelper.RegisterMockHttpContext(); - _httpContext = _mockHttpContext.Object; + this._mockHttpContext = HttpContextHelper.RegisterMockHttpContext(); + this._httpContext = this._mockHttpContext.Object; } [Test] @@ -69,10 +69,10 @@ public void FallBackCannotBeNull() public void PerfectMatchPossible() { //Arrange - _mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] {"de-DE"}); + this._mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] {"de-DE"}); //Act - var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(_standardCultureCodes); + var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(this._standardCultureCodes); //Assert Assert.AreEqual(ret, "de-DE"); @@ -82,10 +82,10 @@ public void PerfectMatchPossible() public void QParamsAreIgnored() { //Arrange - _mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] { "de-DE;q=0.8" }); + this._mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] { "de-DE;q=0.8" }); //Act - var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(_standardCultureCodes); + var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(this._standardCultureCodes); //Assert Assert.AreEqual(ret, "de-DE"); @@ -95,10 +95,10 @@ public void QParamsAreIgnored() public void MatchOnOnlyLanguage() { //Arrange - _mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] { "fr-FR" }); + this._mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] { "fr-FR" }); //Act - var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(_standardCultureCodes); + var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(this._standardCultureCodes); //Assert Assert.AreEqual(ret, "fr-CA"); @@ -108,7 +108,7 @@ public void MatchOnOnlyLanguage() public void PerfectMatchPreferredToFirstMatch() { //Arrange - _mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] { "fr-FR" }); + this._mockHttpContext.Setup(x => x.Request.UserLanguages).Returns(new[] { "fr-FR" }); //Act var ret = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(new[] {"fr-CA", "fr-FR"}); @@ -123,7 +123,7 @@ public void PerfectMatchPreferredToFirstMatch() [TestCase("My\\Path\\To\\File with.locale-extension")] public void ParseLocaleFromResxFileName(string fileName) { - foreach (var standardCultureCode in _standardCultureCodes) + foreach (var standardCultureCode in this._standardCultureCodes) { var f = fileName + "." + standardCultureCode + ".resx"; Assert.AreEqual(f.GetLocaleCodeFromFileName(), standardCultureCode); @@ -135,7 +135,7 @@ public void ParseLocaleFromResxFileName(string fileName) [TestCase("My\\Path\\To\\File with.locale-extension")] public void ParseFileNameFromResxFile(string fileName) { - foreach (var standardCultureCode in _standardCultureCodes) + foreach (var standardCultureCode in this._standardCultureCodes) { var f = fileName + "." + standardCultureCode + ".resx"; Assert.AreEqual(f.GetFileNameFromLocalizedResxFile(), fileName); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/PreviewProfileControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/PreviewProfileControllerTests.cs index f246f7ed35a..574792b1a57 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/PreviewProfileControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/PreviewProfileControllerTests.cs @@ -37,23 +37,23 @@ public class PreviewProfileControllerTests public void SetUp() { ComponentFactory.Container = new SimpleContainer(); - _dataProvider = MockComponentProvider.CreateDataProvider(); - _dataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._dataProvider = MockComponentProvider.CreateDataProvider(); + this._dataProvider.Setup(d => d.GetProviderPath()).Returns(""); MockComponentProvider.CreateDataCacheProvider(); MockComponentProvider.CreateEventLogController(); - _dtProfiles = new DataTable("PreviewProfiles"); - var pkCol = _dtProfiles.Columns.Add("Id", typeof(int)); - _dtProfiles.Columns.Add("PortalId", typeof(int)); - _dtProfiles.Columns.Add("Name", typeof(string)); - _dtProfiles.Columns.Add("Width", typeof(int)); - _dtProfiles.Columns.Add("Height", typeof(int)); - _dtProfiles.Columns.Add("UserAgent", typeof(string)); - _dtProfiles.Columns.Add("SortOrder", typeof(int)); + this._dtProfiles = new DataTable("PreviewProfiles"); + var pkCol = this._dtProfiles.Columns.Add("Id", typeof(int)); + this._dtProfiles.Columns.Add("PortalId", typeof(int)); + this._dtProfiles.Columns.Add("Name", typeof(string)); + this._dtProfiles.Columns.Add("Width", typeof(int)); + this._dtProfiles.Columns.Add("Height", typeof(int)); + this._dtProfiles.Columns.Add("UserAgent", typeof(string)); + this._dtProfiles.Columns.Add("SortOrder", typeof(int)); - _dtProfiles.PrimaryKey = new[] { pkCol }; + this._dtProfiles.PrimaryKey = new[] { pkCol }; - _dataProvider.Setup(d => + this._dataProvider.Setup(d => d.SavePreviewProfile(It.IsAny(), It.IsAny(), It.IsAny(), @@ -66,16 +66,16 @@ public void SetUp() { if (id == -1) { - if (_dtProfiles.Rows.Count == 0) + if (this._dtProfiles.Rows.Count == 0) { id = 1; } else { - id = Convert.ToInt32(_dtProfiles.Select("", "Id Desc")[0]["Id"]) + 1; + id = Convert.ToInt32(this._dtProfiles.Select("", "Id Desc")[0]["Id"]) + 1; } - var row = _dtProfiles.NewRow(); + var row = this._dtProfiles.NewRow(); row["Id"] = id; row["PortalId"] = portalId; row["name"] = name; @@ -84,11 +84,11 @@ public void SetUp() row["useragent"] = userAgent; row["sortorder"] = sortOrder; - _dtProfiles.Rows.Add(row); + this._dtProfiles.Rows.Add(row); } else { - var rows = _dtProfiles.Select("Id = " + id); + var rows = this._dtProfiles.Select("Id = " + id); if (rows.Length == 1) { var row = rows[0]; @@ -104,13 +104,13 @@ public void SetUp() return id; }); - _dataProvider.Setup(d => d.GetPreviewProfiles(It.IsAny())).Returns((portalId) => { return GetProfilesCallBack(portalId); }); - _dataProvider.Setup(d => d.DeletePreviewProfile(It.IsAny())).Callback((id) => + this._dataProvider.Setup(d => d.GetPreviewProfiles(It.IsAny())).Returns((portalId) => { return this.GetProfilesCallBack(portalId); }); + this._dataProvider.Setup(d => d.DeletePreviewProfile(It.IsAny())).Callback((id) => { - var rows = _dtProfiles.Select("Id = " + id); + var rows = this._dtProfiles.Select("Id = " + id); if (rows.Length == 1) { - _dtProfiles.Rows.Remove(rows[0]); + this._dtProfiles.Rows.Remove(rows[0]); } }); } @@ -125,7 +125,7 @@ public void PreviewProfileController_Save_Valid_Profile() var profile = new PreviewProfile { Name = "Test R", PortalId = 0, Width = 800, Height = 480 }; new PreviewProfileController().Save(profile); - var dataReader = _dataProvider.Object.GetPreviewProfiles(0); + var dataReader = this._dataProvider.Object.GetPreviewProfiles(0); var affectedCount = 0; while (dataReader.Read()) { @@ -138,7 +138,7 @@ public void PreviewProfileController_Save_Valid_Profile() [Test] public void PreviewProfileController_GetProfilesByPortal_With_Valid_PortalID() { - PrepareData(); + this.PrepareData(); IList list = new PreviewProfileController().GetProfilesByPortal(0); @@ -148,7 +148,7 @@ public void PreviewProfileController_GetProfilesByPortal_With_Valid_PortalID() [Test] public void PreviewProfileController_Delete_With_ValidID() { - PrepareData(); + this.PrepareData(); new PreviewProfileController().Delete(0, 1); IList list = new PreviewProfileController().GetProfilesByPortal(0); @@ -162,8 +162,8 @@ public void PreviewProfileController_Delete_With_ValidID() private IDataReader GetProfilesCallBack(int portalId) { - var dtCheck = _dtProfiles.Clone(); - foreach (var row in _dtProfiles.Select("PortalId = " + portalId)) + var dtCheck = this._dtProfiles.Clone(); + foreach (var row in this._dtProfiles.Select("PortalId = " + portalId)) { dtCheck.Rows.Add(row.ItemArray); } @@ -173,12 +173,12 @@ private IDataReader GetProfilesCallBack(int portalId) private void PrepareData() { - _dtProfiles.Rows.Add(1, 0, "R1", 640, 480, "", 1); - _dtProfiles.Rows.Add(2, 0, "R2", 640, 480, "", 2); - _dtProfiles.Rows.Add(3, 0, "R3", 640, 480, "", 3); - _dtProfiles.Rows.Add(4, 1, "R4", 640, 480, "", 4); - _dtProfiles.Rows.Add(5, 1, "R5", 640, 480, "", 5); - _dtProfiles.Rows.Add(6, 1, "R6", 640, 480, "", 6); + this._dtProfiles.Rows.Add(1, 0, "R1", 640, 480, "", 1); + this._dtProfiles.Rows.Add(2, 0, "R2", 640, 480, "", 2); + this._dtProfiles.Rows.Add(3, 0, "R3", 640, 480, "", 3); + this._dtProfiles.Rows.Add(4, 1, "R4", 640, 480, "", 4); + this._dtProfiles.Rows.Add(5, 1, "R5", 640, 480, "", 5); + this._dtProfiles.Rows.Add(6, 1, "R6", 640, 480, "", 6); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs index c3a0cd882b7..94e39856206 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Mobile/RedirectionControllerTests.cs @@ -93,27 +93,27 @@ public class RedirectionControllerTests [SetUp] public void SetUp() { - SetupContianer(); + this.SetupContianer(); ComponentFactory.Container = new SimpleContainer(); UnitTestHelper.ClearHttpContext(); - _dataProvider = MockComponentProvider.CreateDataProvider(); + this._dataProvider = MockComponentProvider.CreateDataProvider(); MockComponentProvider.CreateDataCacheProvider(); MockComponentProvider.CreateEventLogController(); - _clientCapabilityProvider = MockComponentProvider.CreateNew(); - _mockHostController = new Mock(); - HostController.RegisterInstance(_mockHostController.Object); + this._clientCapabilityProvider = MockComponentProvider.CreateNew(); + this._mockHostController = new Mock(); + HostController.RegisterInstance(this._mockHostController.Object); - _redirectionController = new RedirectionController(); + this._redirectionController = new RedirectionController(); - SetupDataProvider(); - SetupClientCapabilityProvider(); - SetupRoleProvider(); + this.SetupDataProvider(); + this.SetupClientCapabilityProvider(); + this.SetupRoleProvider(); var tabController = TabController.Instance; var dataProviderField = tabController.GetType().GetField("_dataProvider", BindingFlags.NonPublic | BindingFlags.Instance); if (dataProviderField != null) { - dataProviderField.SetValue(tabController, _dataProvider.Object); + dataProviderField.SetValue(tabController, this._dataProvider.Object); } } @@ -125,15 +125,15 @@ public void TearDown() CachingProvider.Instance().PurgeCache(); MockComponentProvider.ResetContainer(); UnitTestHelper.ClearHttpContext(); - if (_dtRedirections != null) + if (this._dtRedirections != null) { - _dtRedirections.Dispose(); - _dtRedirections = null; + this._dtRedirections.Dispose(); + this._dtRedirections = null; } - if (_dtRules != null) + if (this._dtRules != null) { - _dtRules.Dispose(); - _dtRules = null; + this._dtRules.Dispose(); + this._dtRules = null; } ComponentFactory.Container = null; } @@ -141,7 +141,7 @@ public void TearDown() private void SetupContianer() { var navigationManagerMock = new Mock(); - navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => NavigateUrl(x)); + navigationManagerMock.Setup(x => x.NavigateURL(It.IsAny())).Returns(x => this.NavigateUrl(x)); var containerMock = new Mock(); containerMock.Setup(x => x.GetService(typeof(INavigationManager))).Returns(navigationManagerMock.Object); Globals.DependencyProvider = containerMock.Object; @@ -157,9 +157,9 @@ private void SetupContianer() public void RedirectionController_Save_Valid_Redirection() { var redirection = new Redirection { Name = "Test R", PortalId = Portal0, SortOrder = 1, SourceTabId = -1, Type = RedirectionType.MobilePhone, TargetType = TargetType.Portal, TargetValue = Portal1 }; - _redirectionController.Save(redirection); + this._redirectionController.Save(redirection); - var dataReader = _dataProvider.Object.GetRedirections(Portal0); + var dataReader = this._dataProvider.Object.GetRedirections(Portal0); var affectedCount = 0; while (dataReader.Read()) { @@ -174,9 +174,9 @@ public void RedirectionController_Save_ValidRedirection_With_Rules() var redirection = new Redirection { Name = "Test R", PortalId = Portal0, SortOrder = 1, SourceTabId = -1, IncludeChildTabs = true, Type = RedirectionType.Other, TargetType = TargetType.Portal, TargetValue = Portal1 }; redirection.MatchRules.Add(new MatchRule { Capability = "Platform", Expression = "IOS" }); redirection.MatchRules.Add(new MatchRule { Capability = "Version", Expression = "5" }); - _redirectionController.Save(redirection); + this._redirectionController.Save(redirection); - var dataReader = _dataProvider.Object.GetRedirections(Portal0); + var dataReader = this._dataProvider.Object.GetRedirections(Portal0); var affectedCount = 0; while (dataReader.Read()) { @@ -184,16 +184,16 @@ public void RedirectionController_Save_ValidRedirection_With_Rules() } Assert.AreEqual(1, affectedCount); - var getRe = _redirectionController.GetRedirectionsByPortal(Portal0)[0]; + var getRe = this._redirectionController.GetRedirectionsByPortal(Portal0)[0]; Assert.AreEqual(2, getRe.MatchRules.Count); } [Test] public void RedirectionController_GetRedirectionsByPortal_With_Valid_PortalID() { - PrepareData(); + this.PrepareData(); - IList list = _redirectionController.GetRedirectionsByPortal(Portal0); + IList list = this._redirectionController.GetRedirectionsByPortal(Portal0); Assert.AreEqual(7, list.Count); } @@ -201,10 +201,10 @@ public void RedirectionController_GetRedirectionsByPortal_With_Valid_PortalID() [Test] public void RedirectionController_Delete_With_ValidID() { - PrepareData(); - _redirectionController.Delete(Portal0, 1); + this.PrepareData(); + this._redirectionController.Delete(Portal0, 1); - IList list = _redirectionController.GetRedirectionsByPortal(Portal0); + IList list = this._redirectionController.GetRedirectionsByPortal(Portal0); Assert.AreEqual(6, list.Count); } @@ -212,33 +212,33 @@ public void RedirectionController_Delete_With_ValidID() [Test] public void RedirectionController_PurgeInvalidRedirections_DoNotPurgeRuleForNonDeletetedSource() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, HomePageOnPortal0, IncludeChildTabsFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); - _redirectionController.PurgeInvalidRedirections(0); - Assert.AreEqual(1, _redirectionController.GetRedirectionsByPortal(0).Count); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, HomePageOnPortal0, IncludeChildTabsFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); + this._redirectionController.PurgeInvalidRedirections(0); + Assert.AreEqual(1, this._redirectionController.GetRedirectionsByPortal(0).Count); } [Test] public void RedirectionController_PurgeInvalidRedirections_DoPurgeRuleForDeletetedSource() { - _dtRedirections.Rows.Add(new object[] { 1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, DeletedPageOnSamePortal2, IncludeChildTabsFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag }); - _redirectionController.PurgeInvalidRedirections(0); - Assert.AreEqual(0, _redirectionController.GetRedirectionsByPortal(0).Count); + this._dtRedirections.Rows.Add(new object[] { 1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, DeletedPageOnSamePortal2, IncludeChildTabsFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag }); + this._redirectionController.PurgeInvalidRedirections(0); + Assert.AreEqual(0, this._redirectionController.GetRedirectionsByPortal(0).Count); } [Test] public void RedirectionController_PurgeInvalidRedirections_DoPurgeRuleForDeletetedTargetPortal() { - _dtRedirections.Rows.Add(new object[] { 1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, HomePageOnPortal0, IncludeChildTabsFlag, (int)TargetType.Portal, Portal2, EnabledFlag }); - _redirectionController.PurgeInvalidRedirections(0); - Assert.AreEqual(0, _redirectionController.GetRedirectionsByPortal(0).Count); + this._dtRedirections.Rows.Add(new object[] { 1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, HomePageOnPortal0, IncludeChildTabsFlag, (int)TargetType.Portal, Portal2, EnabledFlag }); + this._redirectionController.PurgeInvalidRedirections(0); + Assert.AreEqual(0, this._redirectionController.GetRedirectionsByPortal(0).Count); } [Test] public void RedirectionController_PurgeInvalidRedirections_DoPurgeRuleForDeletetedTargetTab() { - _dtRedirections.Rows.Add(new object[] { 1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, HomePageOnPortal0, IncludeChildTabsFlag, (int)TargetType.Tab, DeletedPageOnSamePortal2, EnabledFlag }); - _redirectionController.PurgeInvalidRedirections(0); - Assert.AreEqual(0, _redirectionController.GetRedirectionsByPortal(0).Count); + this._dtRedirections.Rows.Add(new object[] { 1, Portal0, "R1", (int)RedirectionType.MobilePhone, SortOrder1, HomePageOnPortal0, IncludeChildTabsFlag, (int)TargetType.Tab, DeletedPageOnSamePortal2, EnabledFlag }); + this._redirectionController.PurgeInvalidRedirections(0); + Assert.AreEqual(0, this._redirectionController.GetRedirectionsByPortal(0).Count); } #endregion @@ -249,56 +249,56 @@ public void RedirectionController_PurgeInvalidRedirections_DoPurgeRuleForDeletet [ExpectedException(typeof(ArgumentException))] public void RedirectionController_GetRedirectionUrl_Throws_On_Null_UserAgent() { - _redirectionController.GetRedirectUrl(null, Portal0, 0); + this._redirectionController.GetRedirectUrl(null, Portal0, 0); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_Redirection_IsNotSet() { - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, HomePageOnPortal0)); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, HomePageOnPortal0)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_Redirection_IsNotEnabled() { - PrepareSingleDisabledRedirectionRule(); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, HomePageOnPortal0)); + this.PrepareSingleDisabledRedirectionRule(); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, HomePageOnPortal0)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_UserAgent_Is_Desktop() { - PrepareData(); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(msIE9UserAgent, Portal0, HomePageOnPortal0)); + this.PrepareData(); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(msIE9UserAgent, Portal0, HomePageOnPortal0)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_CurrentPage_IsSameAs_TargetPage_OnMobile() { - PreparePortalToAnotherPageOnSamePortal(); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, AnotherPageOnSamePortal)); + this.PreparePortalToAnotherPageOnSamePortal(); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, AnotherPageOnSamePortal)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_TargetPage_IsDeleted() { //prepare rule to a deleted tab on the same portal - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, AnotherPageOnSamePortal, EnabledFlag, (int)TargetType.Tab, DeletedPageOnSamePortal, 1); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, AnotherPageOnSamePortal)); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, AnotherPageOnSamePortal, EnabledFlag, (int)TargetType.Tab, DeletedPageOnSamePortal, 1); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, AnotherPageOnSamePortal)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_CurrentPortal_IsSameAs_TargetPortal_OnMobile() { - PrepareSamePortalToSamePortalRedirectionRule(); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, AnotherPageOnSamePortal)); + this.PrepareSamePortalToSamePortalRedirectionRule(); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, AnotherPageOnSamePortal)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_TargetPageOnSamePortal_When_Surfing_HomePage_OnMobile() { - PreparePortalToAnotherPageOnSamePortal(); - Assert.AreEqual(NavigateUrl(AnotherPageOnSamePortal), _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); + this.PreparePortalToAnotherPageOnSamePortal(); + Assert.AreEqual(this.NavigateUrl(AnotherPageOnSamePortal), this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); } //[Test] @@ -312,57 +312,57 @@ public void RedirectionController_GetRedirectionUrl_Returns_TargetPageOnSamePort [Test] public void RedirectionController_GetRedirectionUrl_Returns_ExternalSite_When_Surfing_AnyPageOfCurrentPortal_OnMobile() { - PrepareExternalSiteRedirectionRule(); - Assert.AreEqual(ExternalSite, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); - Assert.AreEqual(ExternalSite, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 2)); + this.PrepareExternalSiteRedirectionRule(); + Assert.AreEqual(ExternalSite, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); + Assert.AreEqual(ExternalSite, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 2)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_MobileLanding_ForMobile_And_TabletLanding_ForTablet() { - PrepareMobileAndTabletRedirectionRuleWithMobileFirst(); - Assert.AreEqual(NavigateUrl(MobileLandingPage), _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); - Assert.AreEqual(NavigateUrl(TabletLandingPage), _redirectionController.GetRedirectUrl(iPadTabletUserAgent, Portal0, 1)); + this.PrepareMobileAndTabletRedirectionRuleWithMobileFirst(); + Assert.AreEqual(this.NavigateUrl(MobileLandingPage), this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); + Assert.AreEqual(this.NavigateUrl(TabletLandingPage), this._redirectionController.GetRedirectUrl(iPadTabletUserAgent, Portal0, 1)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_TabletLanding_ForTablet_And_MobileLanding_ForMobile() { - PrepareMobileAndTabletRedirectionRuleWithAndTabletRedirectionRuleTabletFirst(); - Assert.AreEqual(NavigateUrl(MobileLandingPage), _redirectionController.GetRedirectUrl(iphoneUserAgent, 0, 1)); - Assert.AreEqual(NavigateUrl(TabletLandingPage), _redirectionController.GetRedirectUrl(iPadTabletUserAgent, 0, 1)); + this.PrepareMobileAndTabletRedirectionRuleWithAndTabletRedirectionRuleTabletFirst(); + Assert.AreEqual(this.NavigateUrl(MobileLandingPage), this._redirectionController.GetRedirectUrl(iphoneUserAgent, 0, 1)); + Assert.AreEqual(this.NavigateUrl(TabletLandingPage), this._redirectionController.GetRedirectUrl(iPadTabletUserAgent, 0, 1)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_SameLandingPage_For_AllMobile() { - PrepareAllMobileRedirectionRule(); - string mobileLandingPage = _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1); - string tabletLandingPage = _redirectionController.GetRedirectUrl(iPadTabletUserAgent, Portal0, 1); - Assert.AreEqual(NavigateUrl(AllMobileLandingPage), mobileLandingPage); - Assert.AreEqual(NavigateUrl(AllMobileLandingPage), tabletLandingPage); + this.PrepareAllMobileRedirectionRule(); + string mobileLandingPage = this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1); + string tabletLandingPage = this._redirectionController.GetRedirectUrl(iPadTabletUserAgent, Portal0, 1); + Assert.AreEqual(this.NavigateUrl(AllMobileLandingPage), mobileLandingPage); + Assert.AreEqual(this.NavigateUrl(AllMobileLandingPage), tabletLandingPage); Assert.AreEqual(mobileLandingPage, tabletLandingPage); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_Capability_DoesNot_Match() { - PrepareOperaBrowserOnSymbianOSRedirectionRule(); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); + this.PrepareOperaBrowserOnSymbianOSRedirectionRule(); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_ValidUrl_When_Capability_Matches() { - PrepareOperaBrowserOnSymbianOSRedirectionRule(); - Assert.AreEqual(NavigateUrl(AnotherPageOnSamePortal), _redirectionController.GetRedirectUrl(motorolaRIZRSymbianOSOpera865, Portal0, 1)); + this.PrepareOperaBrowserOnSymbianOSRedirectionRule(); + Assert.AreEqual(this.NavigateUrl(AnotherPageOnSamePortal), this._redirectionController.GetRedirectUrl(motorolaRIZRSymbianOSOpera865, Portal0, 1)); } [Test] public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_NotAll_Capability_Matches() { - PrepareOperaBrowserOnIPhoneOSRedirectionRule(); - Assert.AreEqual(string.Empty, _redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); + this.PrepareOperaBrowserOnIPhoneOSRedirectionRule(); + Assert.AreEqual(string.Empty, this._redirectionController.GetRedirectUrl(iphoneUserAgent, Portal0, 1)); } @@ -373,7 +373,7 @@ public void RedirectionController_GetRedirectionUrl_Returns_EmptyString_When_Not [Test] public void RedirectionController_GetFullSiteUrl_With_NoRedirections() { - var url = _redirectionController.GetFullSiteUrl(Portal0, HomePageOnPortal0); + var url = this._redirectionController.GetFullSiteUrl(Portal0, HomePageOnPortal0); Assert.AreEqual(string.Empty, url); } @@ -401,9 +401,9 @@ public void RedirectionController_GetFullSiteUrl_With_NoRedirections() [Test] public void RedirectionController_GetFullSiteUrl_When_Redirect_To_DifferentUrl() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, HomePageOnPortal0, EnabledFlag, (int)TargetType.Url, ExternalSite, 1); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, HomePageOnPortal0, EnabledFlag, (int)TargetType.Url, ExternalSite, 1); - var url = _redirectionController.GetFullSiteUrl(Portal1, AnotherPageOnSamePortal); + var url = this._redirectionController.GetFullSiteUrl(Portal1, AnotherPageOnSamePortal); Assert.AreEqual(string.Empty, url); } @@ -415,7 +415,7 @@ public void RedirectionController_GetFullSiteUrl_When_Redirect_To_DifferentUrl() [Test] public void RedirectionController_GetMobileSiteUrl_With_NoRedirections() { - var url = _redirectionController.GetMobileSiteUrl(Portal0, HomePageOnPortal0); + var url = this._redirectionController.GetMobileSiteUrl(Portal0, HomePageOnPortal0); Assert.AreEqual(string.Empty, url); } @@ -427,14 +427,14 @@ public void RedirectionController_GetMobileSiteUrl_Returns_Page_Specific_Url_Whe string redirectUrlPage2 = "m.cnn.com"; //first page goes to one url - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, Page1, EnabledFlag, (int)TargetType.Url, redirectUrlPage1, 1); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, Page1, EnabledFlag, (int)TargetType.Url, redirectUrlPage1, 1); //second page goes to another url (this is Tablet - it should not matter) - _dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.Tablet, 2, Page2, EnabledFlag, (int)TargetType.Url, redirectUrlPage2, 1); + this._dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.Tablet, 2, Page2, EnabledFlag, (int)TargetType.Url, redirectUrlPage2, 1); - var mobileUrlForPage1 = _redirectionController.GetMobileSiteUrl(Portal0, Page1); - var mobileUrlForPage2 = _redirectionController.GetMobileSiteUrl(Portal0, Page2); - var mobileUrlForPage3 = _redirectionController.GetMobileSiteUrl(Portal0, Page3); + var mobileUrlForPage1 = this._redirectionController.GetMobileSiteUrl(Portal0, Page1); + var mobileUrlForPage2 = this._redirectionController.GetMobileSiteUrl(Portal0, Page2); + var mobileUrlForPage3 = this._redirectionController.GetMobileSiteUrl(Portal0, Page3); //First Page returns link to first url Assert.AreEqual(String.Format("{0}?nomo=0",redirectUrlPage1), mobileUrlForPage1); @@ -461,9 +461,9 @@ public void RedirectionController_GetMobileSiteUrl_Returns_Page_Specific_Url_Whe [Test] public void RedirectionController_GetMobileSiteUrl_When_Redirect_To_DifferentUrl() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, HomePageOnPortal0, EnabledFlag, (int)TargetType.Url, ExternalSite, 1); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, HomePageOnPortal0, EnabledFlag, (int)TargetType.Url, ExternalSite, 1); - var url = _redirectionController.GetMobileSiteUrl(Portal1, AnotherPageOnSamePortal); + var url = this._redirectionController.GetMobileSiteUrl(Portal1, AnotherPageOnSamePortal); Assert.AreEqual(string.Empty, url); } @@ -475,18 +475,18 @@ public void RedirectionController_GetMobileSiteUrl_When_Redirect_To_DifferentUrl [Test] public void RedirectionController_IsRedirectAllowedForTheSession_In_Normal_Action() { - var app = GenerateApplication(); + var app = this.GenerateApplication(); - Assert.IsTrue(_redirectionController.IsRedirectAllowedForTheSession(app)); + Assert.IsTrue(this._redirectionController.IsRedirectAllowedForTheSession(app)); } [Test] public void RedirectionController_IsRedirectAllowedForTheSession_With_Nonmo_Param_Set_To_1() { - var app = GenerateApplication(); + var app = this.GenerateApplication(); app.Context.Request.QueryString.Add(DisableMobileRedirectQueryStringName, "1"); - Assert.IsFalse(_redirectionController.IsRedirectAllowedForTheSession(app)); + Assert.IsFalse(this._redirectionController.IsRedirectAllowedForTheSession(app)); Assert.IsNotNull(app.Request.Cookies[DisableMobileRedirectCookieName]); Assert.IsNotNull(app.Request.Cookies[DisableRedirectPresistCookieName]); } @@ -494,21 +494,21 @@ public void RedirectionController_IsRedirectAllowedForTheSession_With_Nonmo_Para [Test] public void RedirectionController_IsRedirectAllowedForTheSession_With_Nonmo_Param_Set_To_0() { - var app = GenerateApplication(); + var app = this.GenerateApplication(); app.Context.Request.QueryString.Add(DisableMobileRedirectQueryStringName, "0"); - Assert.IsTrue(_redirectionController.IsRedirectAllowedForTheSession(app)); + Assert.IsTrue(this._redirectionController.IsRedirectAllowedForTheSession(app)); } [Test] public void RedirectionController_IsRedirectAllowedForTheSession_With_Nonmo_Param_Set_To_1_And_Then_Setback_To_0() { - var app = GenerateApplication(); + var app = this.GenerateApplication(); app.Context.Request.QueryString.Add(DisableMobileRedirectQueryStringName, "1"); - Assert.IsFalse(_redirectionController.IsRedirectAllowedForTheSession(app)); + Assert.IsFalse(this._redirectionController.IsRedirectAllowedForTheSession(app)); app.Context.Request.QueryString.Add(DisableMobileRedirectQueryStringName, "0"); - Assert.IsTrue(_redirectionController.IsRedirectAllowedForTheSession(app)); + Assert.IsTrue(this._redirectionController.IsRedirectAllowedForTheSession(app)); } #endregion @@ -519,31 +519,31 @@ public void RedirectionController_IsRedirectAllowedForTheSession_With_Nonmo_Para private void SetupDataProvider() { - _dataProvider.Setup(d => d.GetProviderPath()).Returns(""); - - _dtRedirections = new DataTable("Redirections"); - var pkCol = _dtRedirections.Columns.Add("Id", typeof(int)); - _dtRedirections.Columns.Add("PortalId", typeof(int)); - _dtRedirections.Columns.Add("Name", typeof(string)); - _dtRedirections.Columns.Add("Type", typeof(int)); - _dtRedirections.Columns.Add("SortOrder", typeof(int)); - _dtRedirections.Columns.Add("SourceTabId", typeof(int)); - _dtRedirections.Columns.Add("IncludeChildTabs", typeof(bool)); - _dtRedirections.Columns.Add("TargetType", typeof(int)); - _dtRedirections.Columns.Add("TargetValue", typeof(object)); - _dtRedirections.Columns.Add("Enabled", typeof(bool)); - - _dtRedirections.PrimaryKey = new[] { pkCol }; - - _dtRules = new DataTable("Rules"); - var pkCol1 = _dtRules.Columns.Add("Id", typeof(int)); - _dtRules.Columns.Add("RedirectionId", typeof(int)); - _dtRules.Columns.Add("Capability", typeof(string)); - _dtRules.Columns.Add("Expression", typeof(string)); - - _dtRules.PrimaryKey = new[] { pkCol1 }; - - _dataProvider.Setup(d => + this._dataProvider.Setup(d => d.GetProviderPath()).Returns(""); + + this._dtRedirections = new DataTable("Redirections"); + var pkCol = this._dtRedirections.Columns.Add("Id", typeof(int)); + this._dtRedirections.Columns.Add("PortalId", typeof(int)); + this._dtRedirections.Columns.Add("Name", typeof(string)); + this._dtRedirections.Columns.Add("Type", typeof(int)); + this._dtRedirections.Columns.Add("SortOrder", typeof(int)); + this._dtRedirections.Columns.Add("SourceTabId", typeof(int)); + this._dtRedirections.Columns.Add("IncludeChildTabs", typeof(bool)); + this._dtRedirections.Columns.Add("TargetType", typeof(int)); + this._dtRedirections.Columns.Add("TargetValue", typeof(object)); + this._dtRedirections.Columns.Add("Enabled", typeof(bool)); + + this._dtRedirections.PrimaryKey = new[] { pkCol }; + + this._dtRules = new DataTable("Rules"); + var pkCol1 = this._dtRules.Columns.Add("Id", typeof(int)); + this._dtRules.Columns.Add("RedirectionId", typeof(int)); + this._dtRules.Columns.Add("Capability", typeof(string)); + this._dtRules.Columns.Add("Expression", typeof(string)); + + this._dtRules.PrimaryKey = new[] { pkCol1 }; + + this._dataProvider.Setup(d => d.SaveRedirection(It.IsAny(), It.IsAny(), It.IsAny(), @@ -559,16 +559,16 @@ private void SetupDataProvider() { if (id == -1) { - if (_dtRedirections.Rows.Count == 0) + if (this._dtRedirections.Rows.Count == 0) { id = 1; } else { - id = Convert.ToInt32(_dtRedirections.Select("", "Id Desc")[0]["Id"]) + 1; + id = Convert.ToInt32(this._dtRedirections.Select("", "Id Desc")[0]["Id"]) + 1; } - var row = _dtRedirections.NewRow(); + var row = this._dtRedirections.NewRow(); row["Id"] = id; row["PortalId"] = portalId; row["name"] = name; @@ -580,11 +580,11 @@ private void SetupDataProvider() row["targetValue"] = targetValue; row["enabled"] = enabled; - _dtRedirections.Rows.Add(row); + this._dtRedirections.Rows.Add(row); } else { - var rows = _dtRedirections.Select("Id = " + id); + var rows = this._dtRedirections.Select("Id = " + id); if (rows.Length == 1) { var row = rows[0]; @@ -603,43 +603,43 @@ private void SetupDataProvider() return id; }); - _dataProvider.Setup(d => d.GetRedirections(It.IsAny())).Returns(GetRedirectionsCallBack); - _dataProvider.Setup(d => d.DeleteRedirection(It.IsAny())).Callback((id) => + this._dataProvider.Setup(d => d.GetRedirections(It.IsAny())).Returns(this.GetRedirectionsCallBack); + this._dataProvider.Setup(d => d.DeleteRedirection(It.IsAny())).Callback((id) => { - var rows = _dtRedirections.Select("Id = " + id); + var rows = this._dtRedirections.Select("Id = " + id); if (rows.Length == 1) { - _dtRedirections.Rows.Remove(rows[0]); + this._dtRedirections.Rows.Remove(rows[0]); } }); - _dataProvider.Setup(d => d.SaveRedirectionRule(It.IsAny(), + this._dataProvider.Setup(d => d.SaveRedirectionRule(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Callback((id, rid, capbility, expression) => { if (id == -1) { - if (_dtRules.Rows.Count == 0) + if (this._dtRules.Rows.Count == 0) { id = 1; } else { - id = Convert.ToInt32(_dtRules.Select("", "Id Desc")[0]["Id"]) + 1; + id = Convert.ToInt32(this._dtRules.Select("", "Id Desc")[0]["Id"]) + 1; } - var row = _dtRules.NewRow(); + var row = this._dtRules.NewRow(); row["Id"] = id; row["RedirectionId"] = rid; row["capability"] = capbility; row["expression"] = expression; - _dtRules.Rows.Add(row); + this._dtRules.Rows.Add(row); } else { - var rows = _dtRules.Select("Id = " + id); + var rows = this._dtRules.Select("Id = " + id); if (rows.Length == 1) { var row = rows[0]; @@ -650,30 +650,30 @@ private void SetupDataProvider() } }); - _dataProvider.Setup(d => d.GetRedirectionRules(It.IsAny())).Returns(GetRedirectionRulesCallBack); - _dataProvider.Setup(d => d.DeleteRedirectionRule(It.IsAny())).Callback((id) => + this._dataProvider.Setup(d => d.GetRedirectionRules(It.IsAny())).Returns(this.GetRedirectionRulesCallBack); + this._dataProvider.Setup(d => d.DeleteRedirectionRule(It.IsAny())).Callback((id) => { - var rows = _dtRules.Select("Id = " + id); + var rows = this._dtRules.Select("Id = " + id); if (rows.Length == 1) { - _dtRules.Rows.Remove(rows[0]); + this._dtRules.Rows.Remove(rows[0]); } }); - _dataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); - _dataProvider.Setup(d => d.GetTabs(It.IsAny())).Returns(GetTabsCallBack); - _dataProvider.Setup(d => d.GetTab(It.IsAny())).Returns(GetTabCallBack); - _dataProvider.Setup(d => d.GetTabModules(It.IsAny())).Returns(GetTabModulesCallBack); - _dataProvider.Setup(d => d.GetPortalSettings(It.IsAny(), It.IsAny())).Returns(GetPortalSettingsCallBack); - _dataProvider.Setup(d => d.GetAllRedirections()).Returns(GetAllRedirectionsCallBack); + this._dataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(this.GetPortalsCallBack); + this._dataProvider.Setup(d => d.GetTabs(It.IsAny())).Returns(this.GetTabsCallBack); + this._dataProvider.Setup(d => d.GetTab(It.IsAny())).Returns(this.GetTabCallBack); + this._dataProvider.Setup(d => d.GetTabModules(It.IsAny())).Returns(this.GetTabModulesCallBack); + this._dataProvider.Setup(d => d.GetPortalSettings(It.IsAny(), It.IsAny())).Returns(this.GetPortalSettingsCallBack); + this._dataProvider.Setup(d => d.GetAllRedirections()).Returns(this.GetAllRedirectionsCallBack); var portalDataService = MockComponentProvider.CreateNew(); - portalDataService.Setup(p => p.GetPortalGroups()).Returns(GetPortalGroupsCallBack); + portalDataService.Setup(p => p.GetPortalGroups()).Returns(this.GetPortalGroupsCallBack); } private void SetupClientCapabilityProvider() { - _clientCapabilityProvider.Setup(p => p.GetClientCapability(It.IsAny())).Returns(GetClientCapabilityCallBack); + this._clientCapabilityProvider.Setup(p => p.GetClientCapability(It.IsAny())).Returns(this.GetClientCapabilityCallBack); } private void SetupRoleProvider() @@ -683,8 +683,8 @@ private void SetupRoleProvider() private IDataReader GetRedirectionsCallBack(int portalId) { - var dtCheck = _dtRedirections.Clone(); - foreach (var row in _dtRedirections.Select("PortalId = " + portalId)) + var dtCheck = this._dtRedirections.Clone(); + foreach (var row in this._dtRedirections.Select("PortalId = " + portalId)) { dtCheck.Rows.Add(row.ItemArray); } @@ -694,8 +694,8 @@ private IDataReader GetRedirectionsCallBack(int portalId) private IDataReader GetRedirectionRulesCallBack(int rid) { - var dtCheck = _dtRules.Clone(); - foreach (var row in _dtRules.Select("RedirectionId = " + rid)) + var dtCheck = this._dtRules.Clone(); + foreach (var row in this._dtRules.Select("RedirectionId = " + rid)) { dtCheck.Rows.Add(row.ItemArray); } @@ -705,7 +705,7 @@ private IDataReader GetRedirectionRulesCallBack(int rid) private IDataReader GetPortalsCallBack(string culture) { - return GetPortalCallBack(Portal0, DotNetNuke.Services.Localization.Localization.SystemLocale); + return this.GetPortalCallBack(Portal0, DotNetNuke.Services.Localization.Localization.SystemLocale); } private IDataReader GetPortalCallBack(int portalId, string culture) @@ -763,7 +763,7 @@ private DataTable GetTabsDataTable() private IDataReader GetTabsCallBack(int portalId) { - var table = GetTabsDataTable(); + var table = this.GetTabsDataTable(); var newTable = table.Clone(); foreach (var row in table.Select("PortalID = " + portalId)) { @@ -775,7 +775,7 @@ private IDataReader GetTabsCallBack(int portalId) private IDataReader GetTabCallBack(int tabId) { - var table = GetTabsDataTable(); + var table = this.GetTabsDataTable(); var newTable = table.Clone(); foreach (var row in table.Select("TabID = " + tabId)) { @@ -874,83 +874,83 @@ private IClientCapability GetClientCapabilityCallBack(string userAgent) private IDataReader GetAllRedirectionsCallBack() { - return _dtRedirections.CreateDataReader(); + return this._dtRedirections.CreateDataReader(); } private void PrepareData() { //id, portalId, name, type, sortOrder, sourceTabId, includeChildTabs, targetType, targetValue, enabled - _dtRedirections.Rows.Add(1, Portal0, "R4", (int)RedirectionType.Other, 4, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); - _dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.Tablet, 2, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); - _dtRedirections.Rows.Add(3, Portal0, "R3", (int)RedirectionType.AllMobile, 3, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); - _dtRedirections.Rows.Add(4, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); - _dtRedirections.Rows.Add(5, Portal0, "R5", (int)RedirectionType.MobilePhone, 5, HomePageOnPortal0, EnabledFlag, (int)TargetType.Portal, "1", EnabledFlag); - _dtRedirections.Rows.Add(6, Portal0, "R6", (int)RedirectionType.MobilePhone, 6, -1, DisabledFlag, (int)TargetType.Tab, HomePageOnPortal0, EnabledFlag); - _dtRedirections.Rows.Add(7, Portal0, "R7", (int)RedirectionType.MobilePhone, 7, -1, DisabledFlag, (int)TargetType.Url, ExternalSite, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R4", (int)RedirectionType.Other, 4, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); + this._dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.Tablet, 2, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); + this._dtRedirections.Rows.Add(3, Portal0, "R3", (int)RedirectionType.AllMobile, 3, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); + this._dtRedirections.Rows.Add(4, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Portal, "1", EnabledFlag); + this._dtRedirections.Rows.Add(5, Portal0, "R5", (int)RedirectionType.MobilePhone, 5, HomePageOnPortal0, EnabledFlag, (int)TargetType.Portal, "1", EnabledFlag); + this._dtRedirections.Rows.Add(6, Portal0, "R6", (int)RedirectionType.MobilePhone, 6, -1, DisabledFlag, (int)TargetType.Tab, HomePageOnPortal0, EnabledFlag); + this._dtRedirections.Rows.Add(7, Portal0, "R7", (int)RedirectionType.MobilePhone, 7, -1, DisabledFlag, (int)TargetType.Url, ExternalSite, EnabledFlag); //id, redirectionId, capability, expression - _dtRules.Rows.Add(1, 1, "mobile_browser", "Safari"); - _dtRules.Rows.Add(2, 1, "device_os_version", "4.0"); + this._dtRules.Rows.Add(1, 1, "mobile_browser", "Safari"); + this._dtRules.Rows.Add(2, 1, "device_os_version", "4.0"); - _dtRedirections.Rows.Add(8, Portal1, "R8", (int)RedirectionType.MobilePhone, 1, -1, EnabledFlag, (int)TargetType.Portal, 2, true); - _dtRedirections.Rows.Add(9, Portal1, "R9", (int)RedirectionType.Tablet, 1, -1, EnabledFlag, (int)TargetType.Portal, 2, true); - _dtRedirections.Rows.Add(10, Portal1, "R10", (int)RedirectionType.AllMobile, 1, -1, EnabledFlag, (int)TargetType.Portal, 2, true); + this._dtRedirections.Rows.Add(8, Portal1, "R8", (int)RedirectionType.MobilePhone, 1, -1, EnabledFlag, (int)TargetType.Portal, 2, true); + this._dtRedirections.Rows.Add(9, Portal1, "R9", (int)RedirectionType.Tablet, 1, -1, EnabledFlag, (int)TargetType.Portal, 2, true); + this._dtRedirections.Rows.Add(10, Portal1, "R10", (int)RedirectionType.AllMobile, 1, -1, EnabledFlag, (int)TargetType.Portal, 2, true); } private void PrepareOperaBrowserOnSymbianOSRedirectionRule() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.Other, 1, -1, DisabledFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.Other, 1, -1, DisabledFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); //id, redirectionId, capability, expression - _dtRules.Rows.Add(1, 1, "mobile_browser", "Opera Mini"); - _dtRules.Rows.Add(2, 1, "device_os", "Symbian OS"); + this._dtRules.Rows.Add(1, 1, "mobile_browser", "Opera Mini"); + this._dtRules.Rows.Add(2, 1, "device_os", "Symbian OS"); } private void PrepareOperaBrowserOnIPhoneOSRedirectionRule() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.Other, 1, -1, DisabledFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.Other, 1, -1, DisabledFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); //id, redirectionId, capability, expression - _dtRules.Rows.Add(1, 1, "mobile_browser", "Opera Mini"); - _dtRules.Rows.Add(2, 1, "device_os", "iPhone OS"); + this._dtRules.Rows.Add(1, 1, "mobile_browser", "Opera Mini"); + this._dtRules.Rows.Add(2, 1, "device_os", "iPhone OS"); } private void PreparePortalToAnotherPageOnSamePortal() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Tab, AnotherPageOnSamePortal, EnabledFlag); } private void PrepareSamePortalToSamePortalRedirectionRule() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Portal, Portal0, 1); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Portal, Portal0, 1); } private void PrepareExternalSiteRedirectionRule() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 7, -1, DisabledFlag, (int)TargetType.Url, ExternalSite, 1); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 7, -1, DisabledFlag, (int)TargetType.Url, ExternalSite, 1); } private void PrepareMobileAndTabletRedirectionRuleWithMobileFirst() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Tab, MobileLandingPage, EnabledFlag); - _dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.Tablet, 2, -1, DisabledFlag, (int)TargetType.Tab, TabletLandingPage, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.MobilePhone, 1, -1, DisabledFlag, (int)TargetType.Tab, MobileLandingPage, EnabledFlag); + this._dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.Tablet, 2, -1, DisabledFlag, (int)TargetType.Tab, TabletLandingPage, EnabledFlag); } private void PrepareMobileAndTabletRedirectionRuleWithAndTabletRedirectionRuleTabletFirst() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.Tablet, 1, -1, DisabledFlag, (int)TargetType.Tab, TabletLandingPage, EnabledFlag); - _dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.MobilePhone, 2, -1, DisabledFlag, (int)TargetType.Tab, MobileLandingPage, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.Tablet, 1, -1, DisabledFlag, (int)TargetType.Tab, TabletLandingPage, EnabledFlag); + this._dtRedirections.Rows.Add(2, Portal0, "R2", (int)RedirectionType.MobilePhone, 2, -1, DisabledFlag, (int)TargetType.Tab, MobileLandingPage, EnabledFlag); } private void PrepareAllMobileRedirectionRule() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.AllMobile, 1, -1, DisabledFlag, (int)TargetType.Tab, AllMobileLandingPage, EnabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.AllMobile, 1, -1, DisabledFlag, (int)TargetType.Tab, AllMobileLandingPage, EnabledFlag); } private void PrepareSingleDisabledRedirectionRule() { - _dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.AllMobile, 1, -1, DisabledFlag, (int)TargetType.Tab, AllMobileLandingPage, DisabledFlag); + this._dtRedirections.Rows.Add(1, Portal0, "R1", (int)RedirectionType.AllMobile, 1, -1, DisabledFlag, (int)TargetType.Tab, AllMobileLandingPage, DisabledFlag); } private HttpApplication GenerateApplication() diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Tokens/TokenReplaceTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Tokens/TokenReplaceTests.cs index 6b418eb3e85..2669ffd446e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Tokens/TokenReplaceTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/Tokens/TokenReplaceTests.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information -using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Controllers; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; @@ -29,19 +28,18 @@ public class TokenReplaceTests [SetUp] public void SetUp() { - ComponentFactory.RegisterComponentInstance(new CoreTokenProvider()); - _mockCache = MockComponentProvider.CreateDataCacheProvider(); - _mockHostController = new Mock(); - _portalController = new Mock(); - _moduleController = new Mock(); - _userController = new Mock(); - PortalController.SetTestableInstance(_portalController.Object); - ModuleController.SetTestableInstance(_moduleController.Object); - UserController.SetTestableInstance(_userController.Object); - HostController.RegisterInstance(_mockHostController.Object); - SetupPortalSettings(); - SetupModuleInfo(); - SetupUserInfo(); + this._mockCache = MockComponentProvider.CreateDataCacheProvider(); + this._mockHostController = new Mock(); + this._portalController = new Mock(); + this._moduleController = new Mock(); + this._userController = new Mock(); + PortalController.SetTestableInstance(this._portalController.Object); + ModuleController.SetTestableInstance(this._moduleController.Object); + UserController.SetTestableInstance(this._userController.Object); + HostController.RegisterInstance(this._mockHostController.Object); + this.SetupPortalSettings(); + this.SetupModuleInfo(); + this.SetupUserInfo(); } [TearDown] @@ -93,7 +91,7 @@ private void SetupPortalSettings() ActiveTab = new TabInfo { ModuleID = 1, TabID = 1 } }; - _portalController.Setup(pc => pc.GetCurrentPortalSettings()).Returns(portalSettings); + this._portalController.Setup(pc => pc.GetCurrentPortalSettings()).Returns(portalSettings); } private void SetupModuleInfo() @@ -101,10 +99,10 @@ private void SetupModuleInfo() var moduleInfo = new ModuleInfo { ModuleID = 1, - PortalID = _portalController.Object.GetCurrentPortalSettings().PortalId + PortalID = this._portalController.Object.GetCurrentPortalSettings().PortalId }; - _moduleController.Setup(mc => mc.GetModule(It.IsAny(), It.IsAny(), It.IsAny())) + this._moduleController.Setup(mc => mc.GetModule(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(moduleInfo); } @@ -114,9 +112,9 @@ private void SetupUserInfo() { UserID = 1, Username = "admin", - PortalID = _portalController.Object.GetCurrentPortalSettings().PortalId + PortalID = this._portalController.Object.GetCurrentPortalSettings().PortalId }; - _userController.Setup(uc => uc.GetUser(It.IsAny(), It.IsAny())).Returns(userInfo); + this._userController.Setup(uc => uc.GetUser(It.IsAny(), It.IsAny())).Returns(userInfo); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UserRequest/UserRequestIPAddressControllerTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UserRequest/UserRequestIPAddressControllerTest.cs index 7e7fe100fd9..328756282cf 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UserRequest/UserRequestIPAddressControllerTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UserRequest/UserRequestIPAddressControllerTest.cs @@ -30,15 +30,15 @@ public void Setup() NameValueCollection serverVariables = new NameValueCollection(); // Setup Mock - _mockhttpContext = HttpContextHelper.RegisterMockHttpContext(); - _mockRequest = Mock.Get(_mockhttpContext.Object.Request); - _mockRequest.Setup(x => x.ServerVariables).Returns(serverVariables); - _mockHostController = MockComponentProvider.CreateNew(); - _mockPortalController = MockComponentProvider.CreateNew(); - PortalController.SetTestableInstance(_mockPortalController.Object); + this._mockhttpContext = HttpContextHelper.RegisterMockHttpContext(); + this._mockRequest = Mock.Get(this._mockhttpContext.Object.Request); + this._mockRequest.Setup(x => x.ServerVariables).Returns(serverVariables); + this._mockHostController = MockComponentProvider.CreateNew(); + this._mockPortalController = MockComponentProvider.CreateNew(); + PortalController.SetTestableInstance(this._mockPortalController.Object); // System under test - _userRequestIPAddressController = new UserRequestIPAddressController(); + this._userRequestIPAddressController = new UserRequestIPAddressController(); } [TearDown] @@ -58,11 +58,11 @@ public void UserRequestIPAddress_ShouldReturnIP_IfAnyHeaderIsPresent(string requ NameValueCollection headersWithXForwardedHeaders = new NameValueCollection(); headersWithXForwardedHeaders.Add(headerName, requestIp); - _mockHostController.Setup(hc => hc.GetString(It.IsAny(), It.IsAny())).Returns(headerName); - _mockRequest.Setup(x => x.Headers).Returns(headersWithXForwardedHeaders); + this._mockHostController.Setup(hc => hc.GetString(It.IsAny(), It.IsAny())).Returns(headerName); + this._mockRequest.Setup(x => x.Headers).Returns(headersWithXForwardedHeaders); //Act - string userRequestIPAddress = _userRequestIPAddressController.GetUserRequestIPAddress(_mockhttpContext.Object.Request); + string userRequestIPAddress = this._userRequestIPAddressController.GetUserRequestIPAddress(this._mockhttpContext.Object.Request); //Assert Assert.AreEqual(expectedIp, userRequestIPAddress); @@ -78,16 +78,16 @@ public void UserRequestIPAddress_ShouldReturnIP_IfRemoteAddrServerVariablePresen NameValueCollection serverVariables = new NameValueCollection(); serverVariables.Add(remoteVariable, requestIp); - _mockRequest.Setup(x => x.ServerVariables).Returns(serverVariables); + this._mockRequest.Setup(x => x.ServerVariables).Returns(serverVariables); //Act - var userRequestIPAddress = _userRequestIPAddressController.GetUserRequestIPAddress(_mockhttpContext.Object.Request); + var userRequestIPAddress = this._userRequestIPAddressController.GetUserRequestIPAddress(this._mockhttpContext.Object.Request); //Assert Assert.AreSame(expectedIp, userRequestIPAddress); - _mockRequest.VerifyGet(r => r.ServerVariables); - _mockRequest.VerifyGet(r => r.Headers); - _mockHostController.Verify(hc => hc.GetString(It.IsAny(), It.IsAny())); + this._mockRequest.VerifyGet(r => r.ServerVariables); + this._mockRequest.VerifyGet(r => r.Headers); + this._mockHostController.Verify(hc => hc.GetString(It.IsAny(), It.IsAny())); } [Test] @@ -95,14 +95,14 @@ public void UserRequestIPAddress_ShouldReturnIP_IfUserHostAddress() { //Arrange var expectedIp = "111.111.111.111"; - _mockRequest.Setup(x => x.UserHostAddress).Returns(expectedIp); + this._mockRequest.Setup(x => x.UserHostAddress).Returns(expectedIp); //Act - var userRequestIPAddress = _userRequestIPAddressController.GetUserRequestIPAddress(_mockhttpContext.Object.Request); + var userRequestIPAddress = this._userRequestIPAddressController.GetUserRequestIPAddress(this._mockhttpContext.Object.Request); //Assert Assert.AreSame(expectedIp, userRequestIPAddress); - _mockRequest.VerifyGet(r => r.UserHostAddress); + this._mockRequest.VerifyGet(r => r.UserHostAddress); } [TestCase("abc.111.eer")] @@ -115,11 +115,11 @@ public void UserRequestIPAddress_ShouldReturnEmptyString_IfIPAddressIsNotValid(s NameValueCollection headersWithXForwardedHeaders = new NameValueCollection(); headersWithXForwardedHeaders.Add(headerName, requestIp); - _mockRequest.Setup(x => x.Headers).Returns(headersWithXForwardedHeaders); - _mockHostController.Setup(hc => hc.GetString(It.IsAny(), It.IsAny())).Returns(headerName); + this._mockRequest.Setup(x => x.Headers).Returns(headersWithXForwardedHeaders); + this._mockHostController.Setup(hc => hc.GetString(It.IsAny(), It.IsAny())).Returns(headerName); //Act - var userRequestIPAddress = _userRequestIPAddressController.GetUserRequestIPAddress(_mockhttpContext.Object.Request); + var userRequestIPAddress = this._userRequestIPAddressController.GetUserRequestIPAddress(this._mockhttpContext.Object.Request); //Assert Assert.AreSame(string.Empty, userRequestIPAddress); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UtilTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UtilTest.cs index 54372690a23..6a36163fb23 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UtilTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/Services/UtilTest.cs @@ -16,13 +16,13 @@ public class UtilTest [Test] public void Dnn_9838_TryToCreateAndExecute_UnsuccesfulRewrite() { - TryToRewriteFile(lockFileFor: 1000, tryRewriteFileFor: 500, isRewritten: false); + this.TryToRewriteFile(lockFileFor: 1000, tryRewriteFileFor: 500, isRewritten: false); } [Test] public void Dnn_9838_TryToCreateAndExecute_SuccessfulRewrite() { - TryToRewriteFile(lockFileFor: 500, tryRewriteFileFor: 1000, isRewritten: true); + this.TryToRewriteFile(lockFileFor: 500, tryRewriteFileFor: 1000, isRewritten: true); } private void TryToRewriteFile(int lockFileFor, int tryRewriteFileFor, bool isRewritten) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Core/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Core/packages.config index 53b44f9d8fe..97fd3abee1b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Core/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Core/packages.config @@ -1,6 +1,7 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Data/DotNetNuke.Tests.Data.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Data/DotNetNuke.Tests.Data.csproj index f70da21bf13..c1d181cbde1 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Data/DotNetNuke.Tests.Data.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Data/DotNetNuke.Tests.Data.csproj @@ -1,170 +1,177 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2595AADE-D3E0-4205-B8AF-109CB23F4223} - Library - Properties - DotNetNuke.Tests.Data - DotNetNuke.Tests.Data - v4.7.2 - 512 - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - - ..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll - True - - - ..\..\Components\DataAccessBlock\bin\Microsoft.ApplicationBlocks.Data.dll - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - ..\..\Library\bin\PetaPoco.dll - - - - - - - ..\..\..\packages\Microsoft.SqlServer.Compact.4.0.8876.1\lib\net40\System.Data.SqlServerCe.dll - - - - - - - - - - - - - - DataResources.resx - True - True - - - - - - - - - - - - - ResXFileCodeGenerator - DataResources.Designer.cs - Designer - - - - - {ddf18e36-41a0-4ca7-a098-78ca6e6f41c1} - DotNetNuke.Instrumentation - - - {04f77171-0634-46e0-a95e-d7477c88712e} - DotNetNuke.Log4Net - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {68368906-57dd-40d1-ac10-35211a17d617} - DotNetNuke.Tests.Utilities - - - - - - - - App.config - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {2595AADE-D3E0-4205-B8AF-109CB23F4223} + Library + Properties + DotNetNuke.Tests.Data + DotNetNuke.Tests.Data + v4.7.2 + 512 + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + + ..\..\..\packages\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll + True + + + ..\..\Components\DataAccessBlock\bin\Microsoft.ApplicationBlocks.Data.dll + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\..\Library\bin\PetaPoco.dll + + + + + + + ..\..\..\packages\Microsoft.SqlServer.Compact.4.0.8876.1\lib\net40\System.Data.SqlServerCe.dll + + + + + + + + + + + + + + DataResources.resx + True + True + + + + + + + + + + + + + ResXFileCodeGenerator + DataResources.Designer.cs + Designer + + + + + {ddf18e36-41a0-4ca7-a098-78ca6e6f41c1} + DotNetNuke.Instrumentation + + + {04f77171-0634-46e0-a95e-d7477c88712e} + DotNetNuke.Log4Net + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {68368906-57dd-40d1-ac10-35211a17d617} + DotNetNuke.Tests.Utilities + + + + + + + + stylecop.json + + + App.config + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + if not exist "$(TargetDir)x86" md "$(TargetDir)x86" xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\x86\*.*" "$(TargetDir)x86" if not exist "$(TargetDir)amd64" md "$(TargetDir)amd64" - xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64" - + xcopy /s /y "$(SolutionDir)packages\Microsoft.SqlServer.Compact.4.0.8876.1\NativeBinaries\amd64\*.*" "$(TargetDir)amd64" + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Data/Fakes/FakeDataProvider.cs b/DNN Platform/Tests/DotNetNuke.Tests.Data/Fakes/FakeDataProvider.cs index 05844c8bdb1..9fcec43d6a4 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Data/Fakes/FakeDataProvider.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Data/Fakes/FakeDataProvider.cs @@ -13,7 +13,7 @@ internal class FakeDataProvider : DataProvider { public FakeDataProvider(Dictionary settings ) { - Settings = settings; + this.Settings = settings; } #region Overrides of DataProvider diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Data/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Data/packages.config index a66673d77cd..f49a8207a2a 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Data/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Data/packages.config @@ -1,8 +1,9 @@ - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoIntegrationTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoIntegrationTests.cs index 4686f747b05..3c6af16282b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoIntegrationTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoIntegrationTests.cs @@ -57,8 +57,8 @@ public void SetUp() .Property(d => d.Age, "Age") .Property(d => d.Name, "Name"); - _mappers = new Dictionary {{typeof (Dog), dogMapper}}; - _mappers = new Dictionary { { typeof(Cat), catMapper } }; + this._mappers = new Dictionary {{typeof (Dog), dogMapper}}; + this._mappers = new Dictionary { { typeof(Cat), catMapper } }; } [TearDown] @@ -109,7 +109,7 @@ public void PetaPoco_Add_Inserts_Item_Using_FluentMapper() Name = Constants.PETAPOCO_InsertDogName }; - using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, _mappers)) + using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, this._mappers)) { IRepository dogRepository = dataContext.GetRepository(); @@ -163,7 +163,7 @@ public void PetaPoco_Delete_Deletes_Item_Using_FluentMapper() Name = Constants.PETAPOCO_DeleteDogName }; - using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, _mappers)) + using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, this._mappers)) { IRepository dogRepository = dataContext.GetRepository(); @@ -293,7 +293,7 @@ public void PetaPoco_GetById_Returns_Single_Item_Using_FluentMapper() DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); Dog dog; - using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, _mappers)) + using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, this._mappers)) { IRepository dogRepository = dataContext.GetRepository(); @@ -358,7 +358,7 @@ public void PetaPoco_Update_Updates_Item_Using_FluentMapper() }; //Act - using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, _mappers)) + using (var dataContext = new PetaPocoDataContext(ConnectionStringName, String.Empty, this._mappers)) { IRepository dogRepository = dataContext.GetRepository(); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoRepositoryTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoRepositoryTests.cs index 1604a6559d0..66820ae607e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoRepositoryTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Data/PetaPocoRepositoryTests.cs @@ -90,7 +90,7 @@ public void PetaPocoRepository_Constructor_Registers_Mapper() public void PetaPocoRepository_Get_Returns_All_Rows(int count) { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(count); @@ -108,7 +108,7 @@ public void PetaPocoRepository_Get_Returns_All_Rows(int count) public void PetaPocoRepository_Get_Returns_List_Of_Models() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -129,7 +129,7 @@ public void PetaPocoRepository_Get_Returns_List_Of_Models() public void PetaPocoRepository_Get_Returns_Models_With_Correct_Properties() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -141,15 +141,15 @@ public void PetaPocoRepository_Get_Returns_Models_With_Correct_Properties() //Assert var dog = dogs.First(); - Assert.AreEqual(_dogAges[0], dog.Age.ToString()); - Assert.AreEqual(_dogNames[0], dog.Name); + Assert.AreEqual(this._dogAges[0], dog.Age.ToString()); + Assert.AreEqual(this._dogNames[0], dog.Name); } [Test] public void PetaPocoRepository_Get_Returns_Models_With_Correct_Properties_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.Property(d => d.Age, "Age"); @@ -164,8 +164,8 @@ public void PetaPocoRepository_Get_Returns_Models_With_Correct_Properties_Using_ //Assert var dog = dogs.First(); - Assert.AreEqual(_dogAges[0], dog.Age.ToString()); - Assert.AreEqual(_dogNames[0], dog.Name); + Assert.AreEqual(this._dogAges[0], dog.Age.ToString()); + Assert.AreEqual(this._dogNames[0], dog.Name); } #endregion @@ -176,7 +176,7 @@ public void PetaPocoRepository_Get_Returns_Models_With_Correct_Properties_Using_ public void PetaPocoRepository_GetById_Returns_Instance_Of_Model_If_Valid_Id() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -194,7 +194,7 @@ public void PetaPocoRepository_GetById_Returns_Instance_Of_Model_If_Valid_Id() public void PetaPocoRepository_GetById_Returns_Null_If_InValid_Id() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -212,7 +212,7 @@ public void PetaPocoRepository_GetById_Returns_Null_If_InValid_Id() public void PetaPocoRepository_GetById_Returns_Null_If_InValid_Id_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.PrimaryKey("ID"); @@ -235,7 +235,7 @@ public void PetaPocoRepository_GetById_Returns_Null_If_InValid_Id_Using_FluentMa public void PetaPocoRepository_GetById_Returns_Model_With_Correct_Properties() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -254,7 +254,7 @@ public void PetaPocoRepository_GetById_Returns_Model_With_Correct_Properties() public void PetaPocoRepository_GetById_Returns_Model_With_Correct_Properties_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.PrimaryKey("ID"); @@ -282,7 +282,7 @@ public void PetaPocoRepository_GetById_Returns_Model_With_Correct_Properties_Usi public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -307,7 +307,7 @@ public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase() public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase_With_Correct_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -332,7 +332,7 @@ public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase_With_Correct_ID() public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase_With_Correct_ColumnValues() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -359,7 +359,7 @@ public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase_With_Correct_Colum public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase_With_Correct_ColumnValues_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.PrimaryKey("ID"); @@ -395,7 +395,7 @@ public void PetaPocoRepository_Add_Inserts_Item_Into_DataBase_With_Correct_Colum public void PetaPocoRepository_Delete_Deletes_Item_From_DataBase() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -421,7 +421,7 @@ public void PetaPocoRepository_Delete_Deletes_Item_From_DataBase() public void PetaPocoRepository_Delete_Deletes_Item_From_DataBase_With_Correct_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -449,7 +449,7 @@ public void PetaPocoRepository_Delete_Deletes_Item_From_DataBase_With_Correct_ID public void PetaPocoRepository_Delete_Deletes_Item_From_DataBase_With_Correct_ID_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.PrimaryKey("ID"); @@ -482,7 +482,7 @@ public void PetaPocoRepository_Delete_Deletes_Item_From_DataBase_With_Correct_ID public void PetaPocoRepository_Delete_Does_Nothing_With_Invalid_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -509,7 +509,7 @@ public void PetaPocoRepository_Delete_Does_Nothing_With_Invalid_ID() public void PetaPocoRepository_Delete_Does_Nothing_With_Invalid_ID_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.PrimaryKey("ID"); @@ -545,7 +545,7 @@ public void PetaPocoRepository_Delete_Does_Nothing_With_Invalid_ID_Using_FluentM public void PetaPocoRepository_Delete_Overload_Deletes_Item_From_DataBase() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -565,7 +565,7 @@ public void PetaPocoRepository_Delete_Overload_Deletes_Item_From_DataBase() public void PetaPocoRepository_Delete_Overload_Deletes_Item_From_DataBase_With_Correct_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -587,7 +587,7 @@ public void PetaPocoRepository_Delete_Overload_Deletes_Item_From_DataBase_With_C public void PetaPocoRepository_Delete_Overload_Does_Nothing_With_Invalid_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -614,7 +614,7 @@ public void PetaPocoRepository_Delete_Overload_Does_Nothing_With_Invalid_ID() public void PetaPocoRepository_Find_Returns_Correct_Rows(int count, string sqlCondition, object arg) { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -639,7 +639,7 @@ public void PetaPocoRepository_Find_Returns_Correct_Rows(int count, string sqlCo public void PetaPocoRepository_GetPage_Overload_Returns_Page_Of_Rows(int pageIndex, int pageSize) { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PAGE_TotalCount); @@ -657,7 +657,7 @@ public void PetaPocoRepository_GetPage_Overload_Returns_Page_Of_Rows(int pageInd public void PetaPocoRepository_GetPage_Overload_Returns_List_Of_Models() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PAGE_TotalCount); @@ -678,7 +678,7 @@ public void PetaPocoRepository_GetPage_Overload_Returns_List_Of_Models() public void PetaPocoRepository_GetPage_Overload_Returns_Models_With_Correct_Properties() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PAGE_TotalCount); @@ -690,8 +690,8 @@ public void PetaPocoRepository_GetPage_Overload_Returns_Models_With_Correct_Prop //Assert var dog = dogs.First(); - Assert.AreEqual(_dogAges[0], dog.Age.ToString()); - Assert.AreEqual(_dogNames[0], dog.Name); + Assert.AreEqual(this._dogAges[0], dog.Age.ToString()); + Assert.AreEqual(this._dogNames[0], dog.Name); } [Test] @@ -701,7 +701,7 @@ public void PetaPocoRepository_GetPage_Overload_Returns_Models_With_Correct_Prop public void PetaPocoRepository_GetPage_Overload_Returns_Correct_Page(int pageIndex, int pageSize, int firstId) { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PAGE_TotalCount); @@ -724,7 +724,7 @@ public void PetaPocoRepository_GetPage_Overload_Returns_Correct_Page(int pageInd public void PetaPocoRepository_Update_Updates_Item_In_DataBase() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -750,7 +750,7 @@ public void PetaPocoRepository_Update_Updates_Item_In_DataBase() public void PetaPocoRepository_Update_Updates_Item_With_Correct_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -782,7 +782,7 @@ public void PetaPocoRepository_Update_Updates_Item_With_Correct_ID() public void PetaPocoRepository_Update_Updates_Item_With_Correct_ID_Using_FluentMapper() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new FluentMapper(String.Empty); mapper.TableName(Constants.PETAPOCO_DogTableName); mapper.PrimaryKey("ID"); @@ -823,7 +823,7 @@ public void PetaPocoRepository_Update_Updates_Item_With_Correct_ID_Using_FluentM public void PetaPocoRepository_Update_Overload_Updates_Item_In_DataBase() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); @@ -843,7 +843,7 @@ public void PetaPocoRepository_Update_Overload_Updates_Item_In_DataBase() public void PetaPocoRepository_Update_Overload_Updates_Item_With_Correct_ID() { //Arrange - var db = CreatePecaPocoDatabase(); + var db = this.CreatePecaPocoDatabase(); var mapper = new PetaPocoMapper(String.Empty); DataUtil.SetUpDatabase(Constants.PETAPOCO_RecordCount); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/DotNetNuke.Tests.Integration.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Integration/DotNetNuke.Tests.Integration.csproj index b89b33a8555..ae1fca959f5 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/DotNetNuke.Tests.Integration.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/DotNetNuke.Tests.Integration.csproj @@ -167,8 +167,14 @@ DotNetNuke.Tests.Utilities - + + + + + + stylecop.json + App.config Designer diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/PageSettingsBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/PageSettingsBuilder.cs index f3f6cbbe8df..b0a6bdca166 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/PageSettingsBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/PageSettingsBuilder.cs @@ -13,89 +13,89 @@ public class PageSettingsBuilder : TestDataBuilder x.tabId, tabId); + this.Set(x => x.tabId, tabId); return this; } public PageSettingsBuilder WithPageType(string pageType) { - Set(x => x.pageType, pageType); + this.Set(x => x.pageType, pageType); return this; } public PageSettingsBuilder WithName(string name) { - Set(x => x.Name, name); + this.Set(x => x.Name, name); return this; } public PageSettingsBuilder WithStartDate(DateTime startDate) { - Set(x => x.startDate, startDate); + this.Set(x => x.startDate, startDate); return this; } public PageSettingsBuilder WithEndDate(DateTime endDate) { - Set(x => x.endDate, endDate); + this.Set(x => x.endDate, endDate); return this; } public PageSettingsBuilder WithKeyWords(string keyWords) { - Set(x => x.keywords, keyWords); + this.Set(x => x.keywords, keyWords); return this; } public PageSettingsBuilder WithDescription(string description) { - Set(x => x.Description, description); + this.Set(x => x.Description, description); return this; } public PageSettingsBuilder WithUrl(string url) { - Set(x => x.Url, url); + this.Set(x => x.Url, url); return this; } public PageSettingsBuilder WithPermission(TabPermissions permissions) { - Set(x => x.permissions, permissions); + this.Set(x => x.permissions, permissions); return this; } public PageSettingsBuilder WithTemplateTabId(int templateTabId) { - Set(x => x.templateTabId, templateTabId); + this.Set(x => x.templateTabId, templateTabId); return this; } public PageSettingsBuilder WithCopyModules(IList modules) { - Set(x => x.modules, modules); + this.Set(x => x.modules, modules); return this; } public PageSettingsBuilder WithSecure(bool secure) { - Set(x => x.isSecure, secure); + this.Set(x => x.isSecure, secure); return this; } protected override PageSettings BuildObject() { - var name = GetOrDefault(p => p.Name); + var name = this.GetOrDefault(p => p.Name); var pageSettings = new PageSettings { ApplyWorkflowToChildren = false, @@ -107,25 +107,25 @@ protected override PageSettings BuildObject() isCopy = false, isWorkflowCompleted = true, isWorkflowPropagationAvailable = false, - keywords = GetOrDefault(p => p.keywords), + keywords = this.GetOrDefault(p => p.keywords), localizedName = "", Name = name, - pageType = GetOrDefault(p => p.pageType), - tabId = GetOrDefault(p => p.tabId), + pageType = this.GetOrDefault(p => p.pageType), + tabId = this.GetOrDefault(p => p.tabId), tags = "", thumbnail = "", title = "", trackLinks = false, type = 0, - workflowId = GetOrDefault(p => p.workflowId), - Url = GetOrDefault(p => p.Url), - Description = GetOrDefault(p => p.Description), - startDate = GetOrDefault(p => p.startDate), - endDate = GetOrDefault(p => p.endDate), - permissions = GetOrDefault(p => p.permissions), - templateTabId = GetOrDefault(p => p.templateTabId), - modules = GetOrDefault(p => p.modules), - isSecure = GetOrDefault(p => p.isSecure) + workflowId = this.GetOrDefault(p => p.workflowId), + Url = this.GetOrDefault(p => p.Url), + Description = this.GetOrDefault(p => p.Description), + startDate = this.GetOrDefault(p => p.startDate), + endDate = this.GetOrDefault(p => p.endDate), + permissions = this.GetOrDefault(p => p.permissions), + templateTabId = this.GetOrDefault(p => p.templateTabId), + modules = this.GetOrDefault(p => p.modules), + isSecure = this.GetOrDefault(p => p.isSecure) }; return pageSettings; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/TabPermissionsBuilder.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/TabPermissionsBuilder.cs index 5cf81883815..7f98214143d 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/TabPermissionsBuilder.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Builders/TabPermissionsBuilder.cs @@ -13,25 +13,25 @@ public class TabPermissionsBuilder : TestDataBuilder x.TabId, tabId); return this; } + public TabPermissionsBuilder WithTabId(int tabId) { this.Set(x => x.TabId, tabId); return this; } - public TabPermissionsBuilder WithPermissionDefinitions(IList permissionDefinitions) { Set(x => x.PermissionDefinitions, permissionDefinitions); return this; } + public TabPermissionsBuilder WithPermissionDefinitions(IList permissionDefinitions) { this.Set(x => x.PermissionDefinitions, permissionDefinitions); return this; } - public TabPermissionsBuilder WithRolePermissions(IList rolePermissions) { Set(x => x.RolePermissions, rolePermissions); return this; } + public TabPermissionsBuilder WithRolePermissions(IList rolePermissions) { this.Set(x => x.RolePermissions, rolePermissions); return this; } - public TabPermissionsBuilder WithUserPermissions(IList userPermissions) { Set(x => x.UserPermissions, userPermissions); return this; } + public TabPermissionsBuilder WithUserPermissions(IList userPermissions) { this.Set(x => x.UserPermissions, userPermissions); return this; } protected override TabPermissions BuildObject() { return new TabPermissions { - TabId = GetOrDefault(x => x.TabId), - PermissionDefinitions = GetOrDefault(x => x.PermissionDefinitions), - RolePermissions = GetOrDefault(x => x.RolePermissions), - UserPermissions = GetOrDefault(x => x.UserPermissions), + TabId = this.GetOrDefault(x => x.TabId), + PermissionDefinitions = this.GetOrDefault(x => x.PermissionDefinitions), + RolePermissions = this.GetOrDefault(x => x.RolePermissions), + UserPermissions = this.GetOrDefault(x => x.UserPermissions), }; } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Dto/CopyModuleItem.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Dto/CopyModuleItem.cs index 8aaf6ce9509..f89378bc823 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Dto/CopyModuleItem.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/Dto/CopyModuleItem.cs @@ -16,14 +16,14 @@ public class CopyModuleItem : IHydratable public int KeyID { - get { return Id; } - set { Id = value; } + get { return this.Id; } + set { this.Id = value; } } public void Fill(IDataReader dr) { - Id = Convert.ToInt32(dr["ModuleId"]); - Title = Convert.ToString(dr["ModuleTitle"]); + this.Id = Convert.ToInt32(dr["ModuleId"]); + this.Title = Convert.ToString(dr["ModuleTitle"]); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/PagesExecuter.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/PagesExecuter.cs index 18fff98376c..bc618c0b810 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/PagesExecuter.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/PagesExecuter.cs @@ -10,7 +10,7 @@ public class PagesExecuter : WebApiExecuter public PagesExecuter GetPageDetails(int pageId) { - Responses.Add(Connector.GetContent( + this.Responses.Add(this.Connector.GetContent( "API/PersonaBar/Pages/GetPageDetails?pageId=" + pageId)); return this; @@ -18,9 +18,9 @@ public PagesExecuter GetPageDetails(int pageId) public dynamic SavePageDetails(dynamic pageDetails) { - Responses.Add(Connector.PostJson("API/PersonaBar/Pages/SavePageDetails", + this.Responses.Add(this.Connector.PostJson("API/PersonaBar/Pages/SavePageDetails", pageDetails)); - return GetLastDeserializeResponseMessage(); + return this.GetLastDeserializeResponseMessage(); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/WebApiExecuter.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/WebApiExecuter.cs index 4b14054738c..1c6b1345e29 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/WebApiExecuter.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Executers/WebApiExecuter.cs @@ -32,12 +32,12 @@ public LoginAsUser LoginAs { get { - return _loginAs; + return this._loginAs; } set { - _loginAs = value; - _connector = null; + this._loginAs = value; + this._connector = null; } } @@ -49,46 +49,46 @@ public LoginAsUser LoginAs protected WebApiExecuter() { - LoginAs = LoginAsUser.RegisteredUser; - Login = WebApiTestHelper.LoginRegisteredUser; - Anonymous = WebApiTestHelper.GetAnnonymousConnector; + this.LoginAs = LoginAsUser.RegisteredUser; + this.Login = WebApiTestHelper.LoginRegisteredUser; + this.Anonymous = WebApiTestHelper.GetAnnonymousConnector; - UserFirstName = Constants.RuFirstName; - UserLastName = Constants.RuLastName; + this.UserFirstName = Constants.RuFirstName; + this.UserLastName = Constants.RuLastName; } public IWebApiConnector Connector { get { - if (_connector == null) + if (this._connector == null) { - switch (LoginAs) + switch (this.LoginAs) { case LoginAsUser.RegisteredUser: - _connector = Login(UserFirstName, UserLastName, null); + this._connector = this.Login(this.UserFirstName, this.UserLastName, null); break; case LoginAsUser.AnonymousUser: - _connector = Anonymous(null); + this._connector = this.Anonymous(null); break; case LoginAsUser.Host: - _connector = WebApiTestHelper.LoginHost(); + this._connector = WebApiTestHelper.LoginHost(); break; default: - _connector = Login(UserFirstName, UserLastName, null); + this._connector = this.Login(this.UserFirstName, this.UserLastName, null); break; } } - return _connector; + return this._connector; } set { - _connector = value; - var userName = _connector.UserName.Split('.'); + this._connector = value; + var userName = this._connector.UserName.Split('.'); if (userName.Length == 2) { - UserFirstName = userName[0]; - UserLastName = userName[1]; + this.UserFirstName = userName[0]; + this.UserLastName = userName[1]; } } } @@ -97,7 +97,7 @@ public string UserName { get { - return Connector.UserName; + return this.Connector.UserName; } } @@ -105,7 +105,7 @@ public string DisplayName { get { - return string.Join(" ", UserFirstName, UserLastName); + return string.Join(" ", this.UserFirstName, this.UserLastName); } } @@ -113,7 +113,7 @@ public int UserId { get { - return DatabaseHelper.ExecuteScalar($"SELECT UserId FROM {{objectQualifier}}Users WHERE UserName = '{UserName}'"); + return DatabaseHelper.ExecuteScalar($"SELECT UserId FROM {{objectQualifier}}Users WHERE UserName = '{this.UserName}'"); } } @@ -121,7 +121,7 @@ public int UserId public HttpResponseMessage GetLastResponseMessage() { - return Responses.Last(); + return this.Responses.Last(); } /// @@ -131,17 +131,17 @@ public HttpResponseMessage GetLastResponseMessage() /// public JContainer GetLastDeserializeResponseMessage() { - if (!Responses.Any()) + if (!this.Responses.Any()) { throw new InvalidOperationException("GetLastDeserializeResponseMessage cannot be called when the Executer does not have any Responses"); } - var data = Responses.Last().Content.ReadAsStringAsync().Result; + var data = this.Responses.Last().Content.ReadAsStringAsync().Result; return JsonConvert.DeserializeObject(data); } public IEnumerable GetResponseMessages() { - return Responses.ToArray(); + return this.Responses.ToArray(); } /// @@ -151,11 +151,11 @@ public IEnumerable GetResponseMessages() /// public IEnumerable GetDeserializeResponseMessages() { - if (!Responses.Any()) + if (!this.Responses.Any()) { throw new InvalidOperationException("GetDeserializeResponseMessages cannot be called when the Executer does not have any Responses"); } - return GetResponseMessages().Select(r => JsonConvert.DeserializeObject(r.Content.ReadAsStringAsync().Result)); + return this.GetResponseMessages().Select(r => JsonConvert.DeserializeObject(r.Content.ReadAsStringAsync().Result)); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DDRMenu/DDRMenuTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DDRMenu/DDRMenuTests.cs index 6076ca7342c..7fba76c0203 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DDRMenu/DDRMenuTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DDRMenu/DDRMenuTests.cs @@ -31,8 +31,8 @@ public class DDRMenuTests : IntegrationTestBase public DDRMenuTests() { var url = ConfigurationManager.AppSettings["siteUrl"]; - _hostName = ConfigurationManager.AppSettings["hostUsername"]; - _hostPass = ConfigurationManager.AppSettings["hostPassword"]; + this._hostName = ConfigurationManager.AppSettings["hostUsername"]; + this._hostPass = ConfigurationManager.AppSettings["hostPassword"]; } [TestFixtureSetUp] @@ -50,16 +50,16 @@ public void Page_Should_Able_To_Duplicate_With_Ddr_Menu_On_It() { //Create new page with DDR Menu on it int tabId; - CreateNewPage(Null.NullInteger, out tabId); + this.CreateNewPage(Null.NullInteger, out tabId); int moduleId; - AddModuleToPage(tabId, "DDRMenu", out moduleId); + this.AddModuleToPage(tabId, "DDRMenu", out moduleId); //apply module settings. ModuleController.SetModuleSettingValue(moduleId, "MenuStyle", "Menus/MainMenu"); //Copy Page int copyTabId; - CreateNewPage(tabId, out copyTabId); + this.CreateNewPage(tabId, out copyTabId); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DigitalAssets/DigitalAssetsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DigitalAssets/DigitalAssetsTests.cs index b1b9f166d94..4659e655c4a 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DigitalAssets/DigitalAssetsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/DigitalAssets/DigitalAssetsTests.cs @@ -23,17 +23,17 @@ public void File_Url_Should_Update_After_Rename_Folder() { var connector = WebApiTestHelper.LoginAdministrator(); - var folder = CreateNewFolder(connector); + var folder = this.CreateNewFolder(connector); var folderId = Convert.ToInt32(folder.FolderID); var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Files\\Test.png"); connector.UploadCmsFile(filePath, folder.FolderPath.ToString()); - var fileId = GetFileId(folderId, "Test.png"); + var fileId = this.GetFileId(folderId, "Test.png"); var newFolderName = Guid.NewGuid().ToString(); - RenameFolder(connector, folderId, newFolderName); + this.RenameFolder(connector, folderId, newFolderName); var getUrlApi = "API/DigitalAssets/ContentService/GetUrl"; - var fileUrl = connector.PostJson(getUrlApi, new {fileId = fileId}, GetRequestHeaders()).Content.ReadAsStringAsync().Result; + var fileUrl = connector.PostJson(getUrlApi, new {fileId = fileId}, this.GetRequestHeaders()).Content.ReadAsStringAsync().Result; Assert.IsTrue(fileUrl.Contains(newFolderName)); } @@ -41,13 +41,13 @@ public void File_Url_Should_Update_After_Rename_Folder() private int GetRootFolderId() { return DatabaseHelper.ExecuteScalar( - $"SELECT FolderID FROM {{objectQualifier}}[Folders] WHERE PortalId = {PortalId} AND FolderPath = ''"); + $"SELECT FolderID FROM {{objectQualifier}}[Folders] WHERE PortalId = {this.PortalId} AND FolderPath = ''"); } private int GetStandardFolderMappingId() { return DatabaseHelper.ExecuteScalar( - $"SELECT FolderMappingId from {{objectQualifier}}[FolderMappings] where PortalID = {PortalId} and MappingName = 'Standard'"); + $"SELECT FolderMappingId from {{objectQualifier}}[FolderMappings] where PortalID = {this.PortalId} and MappingName = 'Standard'"); } private int GetFileId(int folderId, string fileName) @@ -58,17 +58,17 @@ private int GetFileId(int folderId, string fileName) private dynamic CreateNewFolder(IWebApiConnector connector) { - var rootFolderId = GetRootFolderId(); + var rootFolderId = this.GetRootFolderId(); var apiUrl = "API/DigitalAssets/ContentService/CreateNewFolder"; var postData = new { FolderName = Guid.NewGuid().ToString(), ParentFolderId = rootFolderId, - FolderMappingId = GetStandardFolderMappingId(), + FolderMappingId = this.GetStandardFolderMappingId(), MappedName = string.Empty }; - var response = connector.PostJson(apiUrl, postData, GetRequestHeaders()); + var response = connector.PostJson(apiUrl, postData, this.GetRequestHeaders()); return Json.Deserialize(response.Content.ReadAsStringAsync().Result); } @@ -81,12 +81,12 @@ private void RenameFolder(IWebApiConnector connector, int folderId, string newFo newFolderName = newFolderName }; - connector.PostJson(apiUrl, postData, GetRequestHeaders()); + connector.PostJson(apiUrl, postData, this.GetRequestHeaders()); } private IDictionary GetRequestHeaders() { - return WebApiTestHelper.GetRequestHeaders("//Admin//FileManagement", "Digital Asset Management", PortalId); + return WebApiTestHelper.GetRequestHeaders("//Admin//FileManagement", "Digital Asset Management", this.PortalId); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/Journal/PostJournalTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/Journal/PostJournalTests.cs index 016546945f3..ccfb23fa294 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/Journal/PostJournalTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Modules/Journal/PostJournalTests.cs @@ -29,8 +29,8 @@ public class PostJournalTests : IntegrationTestBase public PostJournalTests() { var url = ConfigurationManager.AppSettings["siteUrl"]; - _hostName = ConfigurationManager.AppSettings["hostUsername"]; - _hostPass = ConfigurationManager.AppSettings["hostPassword"]; + this._hostName = ConfigurationManager.AppSettings["hostUsername"]; + this._hostPass = ConfigurationManager.AppSettings["hostPassword"]; } [TestFixtureSetUp] @@ -57,7 +57,7 @@ public void Journal_Should_Able_To_Attach_Files_Upload_By_Himself() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var postData = new @@ -71,7 +71,7 @@ public void Journal_Should_Able_To_Attach_Files_Upload_By_Himself() }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); } [Test] @@ -79,8 +79,8 @@ public void Journal_Should_Not_Able_To_Attach_Files_Upload_By_Other_User() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); - fileId = DatabaseHelper.ExecuteScalar($"SELECT MIN(FileId) FROM {{objectQualifier}}Files WHERE PortalId = {PortalId}"); + var connector = this.PrepareNewUser(out userId, out username, out fileId); + fileId = DatabaseHelper.ExecuteScalar($"SELECT MIN(FileId) FROM {{objectQualifier}}Files WHERE PortalId = {this.PortalId}"); //POST JOURNAL var postData = new { @@ -96,7 +96,7 @@ public void Journal_Should_Not_Able_To_Attach_Files_Upload_By_Other_User() var exceptionMessage = string.Empty; try { - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); } catch (WebApiException ex) { @@ -113,7 +113,7 @@ public void Journal_Should_Not_Able_To_Post_On_Other_User_Profile_Page() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var postData = new @@ -130,7 +130,7 @@ public void Journal_Should_Not_Able_To_Post_On_Other_User_Profile_Page() var exceptionMessage = string.Empty; try { - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); } catch (WebApiException ex) { @@ -147,14 +147,14 @@ public void Journal_Should_Able_To_Post_On_Friends_Profile_Page() { int userId1, fileId1, userId2, fileId2; string username1, username2; - var connector1 = PrepareNewUser(out userId1, out username1, out fileId1); - var connector2 = PrepareNewUser(out userId2, out username2, out fileId2); + var connector1 = this.PrepareNewUser(out userId1, out username1, out fileId1); + var connector2 = this.PrepareNewUser(out userId2, out username2, out fileId2); //ADD FRIENDS - connector1.PostJson("/API/MemberDirectory/MemberDirectory/AddFriend", new {friendId = userId2}, GetRequestHeaders("Member Directory")); + connector1.PostJson("/API/MemberDirectory/MemberDirectory/AddFriend", new {friendId = userId2}, this.GetRequestHeaders("Member Directory")); var notificationId = DatabaseHelper.ExecuteScalar($"SELECT TOP 1 MessageID FROM {{objectQualifier}}CoreMessaging_Messages WHERE SenderUserID = {userId1}"); - connector2.PostJson("/API/InternalServices/RelationshipService/AcceptFriend", new { NotificationId = notificationId }, GetRequestHeaders()); + connector2.PostJson("/API/InternalServices/RelationshipService/AcceptFriend", new { NotificationId = notificationId }, this.GetRequestHeaders()); //POST JOURNAL var postData = new @@ -167,7 +167,7 @@ public void Journal_Should_Able_To_Post_On_Friends_Profile_Page() itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"fileid={fileId1}\"}}" }; - connector1.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector1.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); } [Test] @@ -175,9 +175,9 @@ public void Journal_Should_Able_To_Post_On_Group_Already_Join() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); - var groupId = CreateNewGroup(username.Replace("testuser", "testrole")); - AddUserToGroup(groupId, userId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); + var groupId = this.CreateNewGroup(username.Replace("testuser", "testrole")); + this.AddUserToGroup(groupId, userId); //POST JOURNAL var postData = new @@ -190,7 +190,7 @@ public void Journal_Should_Able_To_Post_On_Group_Already_Join() itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"fileid={fileId}\"}}" }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); } [Test] @@ -198,8 +198,8 @@ public void Journal_Should_Not_Able_To_Post_On_Group_Not_Join() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); - var groupId = CreateNewGroup(username.Replace("testuser", "testrole")); + var connector = this.PrepareNewUser(out userId, out username, out fileId); + var groupId = this.CreateNewGroup(username.Replace("testuser", "testrole")); //POST JOURNAL var postData = new @@ -216,7 +216,7 @@ public void Journal_Should_Not_Able_To_Post_On_Group_Not_Join() var exceptionMessage = string.Empty; try { - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); } catch (WebApiException ex) { @@ -233,7 +233,7 @@ public void Journal_Should_Not_Able_To_Post_Xss_Code_In_ImageUrl() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var postData = new @@ -246,7 +246,7 @@ public void Journal_Should_Not_Able_To_Post_Xss_Code_In_ImageUrl() itemData = $"{{\"ImageUrl\":\"javascript:alert(1);\\\" onerror=\\\"alert(2);.png\",\"Url\":\"fileid={fileId}\"}}" }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var itemData = DatabaseHelper.ExecuteScalar($"SELECT ItemData FROM {{objectQualifier}}Journal WHERE UserId = {userId}"); var imageUrl = Json.Deserialize(itemData).ImageUrl.ToString(); @@ -261,7 +261,7 @@ public void Journal_Should_Not_Able_To_Post_Xss_Code_In_Url() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var postData = new @@ -274,7 +274,7 @@ public void Journal_Should_Not_Able_To_Post_Xss_Code_In_Url() itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"javascript:alert(1);\", \"Title\": \"Test.png\"}}" }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var itemData = DatabaseHelper.ExecuteScalar($"SELECT ItemData FROM {{objectQualifier}}Journal WHERE UserId = {userId}"); var url = Json.Deserialize(itemData).Url.ToString(); @@ -287,7 +287,7 @@ public void Journal_Should_Not_Able_To_Post_Extenal_Link_In_Url() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var postData = new @@ -300,7 +300,7 @@ public void Journal_Should_Not_Able_To_Post_Extenal_Link_In_Url() itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"http://www.dnnsoftware.com\", \"Title\": \"Test.png\"}}" }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var itemData = DatabaseHelper.ExecuteScalar($"SELECT ItemData FROM {{objectQualifier}}Journal WHERE UserId = {userId}"); var url = Json.Deserialize(itemData).Url.ToString(); @@ -313,7 +313,7 @@ public void Journal_Should_Able_See_By_All_When_Set_Security_To_Everyone() { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var journalText = $"{username} Post"; @@ -327,7 +327,7 @@ public void Journal_Should_Able_See_By_All_When_Set_Security_To_Everyone() itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"fileid={fileId}\"}}" }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var response = connector.GetContent($"/Activity-Feed/userId/{userId}").Content.ReadAsStringAsync().Result; Assert.Greater(response.IndexOf(journalText), 0); @@ -342,8 +342,8 @@ public void Journal_Should_Only_Able_See_By_Members_When_Set_Security_To_Communi { int userId1, fileId1, userId2, fileId2; string username1, username2; - var connector1 = PrepareNewUser(out userId1, out username1, out fileId1); - var connector2 = PrepareNewUser(out userId2, out username2, out fileId2); + var connector1 = this.PrepareNewUser(out userId1, out username1, out fileId1); + var connector2 = this.PrepareNewUser(out userId2, out username2, out fileId2); //POST JOURNAL var journalText = $"{username1} Post"; @@ -357,7 +357,7 @@ public void Journal_Should_Only_Able_See_By_Members_When_Set_Security_To_Communi itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"fileid={fileId1}\"}}" }; - connector1.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector1.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var response = connector2.GetContent($"/Activity-Feed/userId/{userId1}").Content.ReadAsStringAsync().Result; Assert.Greater(response.IndexOf(journalText), 0); @@ -372,15 +372,15 @@ public void Journal_Should_Only_Able_See_By_Friends_When_Set_Security_To_Friends { int userId1, fileId1, userId2, fileId2, userId3, fileId3; string username1, username2, username3; - var connector1 = PrepareNewUser(out userId1, out username1, out fileId1); - var connector2 = PrepareNewUser(out userId2, out username2, out fileId2); - var connector3 = PrepareNewUser(out userId3, out username3, out fileId3); + var connector1 = this.PrepareNewUser(out userId1, out username1, out fileId1); + var connector2 = this.PrepareNewUser(out userId2, out username2, out fileId2); + var connector3 = this.PrepareNewUser(out userId3, out username3, out fileId3); //ADD FRIENDS - connector1.PostJson("/API/MemberDirectory/MemberDirectory/AddFriend", new { friendId = userId2 }, GetRequestHeaders("Member Directory")); + connector1.PostJson("/API/MemberDirectory/MemberDirectory/AddFriend", new { friendId = userId2 }, this.GetRequestHeaders("Member Directory")); var notificationId = DatabaseHelper.ExecuteScalar($"SELECT TOP 1 MessageID FROM {{objectQualifier}}CoreMessaging_Messages WHERE SenderUserID = {userId1}"); - connector2.PostJson("/API/InternalServices/RelationshipService/AcceptFriend", new { NotificationId = notificationId }, GetRequestHeaders()); + connector2.PostJson("/API/InternalServices/RelationshipService/AcceptFriend", new { NotificationId = notificationId }, this.GetRequestHeaders()); //POST JOURNAL @@ -395,7 +395,7 @@ public void Journal_Should_Only_Able_See_By_Friends_When_Set_Security_To_Friends itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"fileid={fileId1}\"}}" }; - connector1.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector1.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var response = connector2.GetContent($"/Activity-Feed/userId/{userId1}").Content.ReadAsStringAsync().Result; Assert.Greater(response.IndexOf(journalText), 0); @@ -409,7 +409,7 @@ public void Journal_Should_Only_Able_See_By_Himself_When_Set_Security_To_Private { int userId, fileId; string username; - var connector = PrepareNewUser(out userId, out username, out fileId); + var connector = this.PrepareNewUser(out userId, out username, out fileId); //POST JOURNAL var journalText = $"{username} Post"; @@ -423,7 +423,7 @@ public void Journal_Should_Only_Able_See_By_Himself_When_Set_Security_To_Private itemData = $"{{\"ImageUrl\":\"\",\"Url\":\"fileid={fileId}\"}}" }; - connector.PostJson("/API/Journal/Services/Create", postData, GetRequestHeaders()); + connector.PostJson("/API/Journal/Services/Create", postData, this.GetRequestHeaders()); var response = connector.GetContent($"/Activity-Feed/userId/{userId}").Content.ReadAsStringAsync().Result; Assert.Greater(response.IndexOf(journalText), 0); @@ -440,7 +440,7 @@ public void Journal_Should_Only_Able_See_By_Himself_When_Set_Security_To_Private private IWebApiConnector PrepareNewUser(out int userId, out string username, out int fileId) { - return WebApiTestHelper.PrepareNewUser(out userId, out username, out fileId, PortalId); + return WebApiTestHelper.PrepareNewUser(out userId, out username, out fileId, this.PortalId); } private int CreateNewGroup(string roleName) @@ -461,7 +461,7 @@ private int CreateNewGroup(string roleName) isSystem = false }); - return DatabaseHelper.ExecuteScalar($"SELECT RoleId FROM {{objectQualifier}}Roles WHERE RoleName = '{roleName}' AND PortalId = {PortalId}"); + return DatabaseHelper.ExecuteScalar($"SELECT RoleId FROM {{objectQualifier}}Roles WHERE RoleName = '{roleName}' AND PortalId = {this.PortalId}"); } private void AddUserToGroup(int groupId, int userId) @@ -479,7 +479,7 @@ private void AddUserToGroup(int groupId, int userId) private IDictionary GetRequestHeaders(string moduleName = "Journal") { - return WebApiTestHelper.GetRequestHeaders("//ActivityFeed", moduleName, PortalId); + return WebApiTestHelper.GetRequestHeaders("//ActivityFeed", moduleName, this.PortalId); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Manage/Users/UsersFiltersTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Manage/Users/UsersFiltersTests.cs index 06449841265..5456bf2e522 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Manage/Users/UsersFiltersTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Manage/Users/UsersFiltersTests.cs @@ -35,8 +35,8 @@ public override void TestFixtureSetUp() int userId, fileId; string userName; WebApiTestHelper.PrepareNewUser(out userId, out userName, out fileId); - _userIds[i] = userId; - _userNames[i] = userName; + this._userIds[i] = userId; + this._userNames[i] = userName; Console.WriteLine(@"Created test users => id: {0}, username: {1}", userId, userName); } @@ -44,22 +44,22 @@ public override void TestFixtureSetUp() var userIdx = 0; // make first user as admin - var makeAdminItem = new { RoleId = 0, UserId = _userIds[userIdx] }; + var makeAdminItem = new { RoleId = 0, UserId = this._userIds[userIdx] }; var response = hostConnector.PostJson(MakeAdminApi, makeAdminItem).Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject(response); - Assert.AreEqual(_userNames[userIdx], result.displayName.ToString()); + Assert.AreEqual(this._userNames[userIdx], result.displayName.ToString()); // Unauthorize the next 2 new users for (userIdx = 1; userIdx <= 2; userIdx++) { - var unauthorizeLink = string.Format(UnauthorizeApi, _userIds[userIdx]); + var unauthorizeLink = string.Format(UnauthorizeApi, this._userIds[userIdx]); response = hostConnector.PostJson(unauthorizeLink, "").Content.ReadAsStringAsync().Result; result = JsonConvert.DeserializeObject(response); Assert.IsTrue(bool.Parse(result.Success.ToString())); } // soft delete the next new user - var deleteLink = string.Format(DeleteApi, _userIds[userIdx]); + var deleteLink = string.Format(DeleteApi, this._userIds[userIdx]); response = hostConnector.PostJson(deleteLink, "").Content.ReadAsStringAsync().Result; result = JsonConvert.DeserializeObject(response); Assert.IsTrue(bool.Parse(result.Success.ToString())); @@ -94,7 +94,7 @@ public void GetUsersAsAdminWithVariousFiltersShoudlReturnExpectedResult(string a // Arrange: all is done in TestFixtureSetUp() // Act - var adminConnector = WebApiTestHelper.LoginUser(_userNames[0]); + var adminConnector = WebApiTestHelper.LoginUser(this._userNames[0]); var response = adminConnector.GetContent(apiMethod, null).Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject(response); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Pages/PagesManagementTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Pages/PagesManagementTests.cs index dde9909e859..d0da41696a1 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Pages/PagesManagementTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/PersonaBar/Pages/PagesManagementTests.cs @@ -33,8 +33,8 @@ public class PagesManagementTests : IntegrationTestBase public PagesManagementTests() { var url = ConfigurationManager.AppSettings["siteUrl"]; - _hostName = ConfigurationManager.AppSettings["hostUsername"]; - _hostPass = ConfigurationManager.AppSettings["hostPassword"]; + this._hostName = ConfigurationManager.AppSettings["hostUsername"]; + this._hostPass = ConfigurationManager.AppSettings["hostPassword"]; } [TestFixtureSetUp] @@ -44,9 +44,9 @@ public override void TestFixtureSetUp() ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; - UpdateSslSettings(true); + this.UpdateSslSettings(true); - UpdateContentLocalization(true); + this.UpdateContentLocalization(true); } [TestFixtureTearDown] @@ -54,9 +54,9 @@ public override void TestFixtureTearDown() { base.TestFixtureTearDown(); - UpdateSslSettings(false); + this.UpdateSslSettings(false); - UpdateContentLocalization(false); + this.UpdateContentLocalization(false); } #endregion @@ -67,7 +67,7 @@ public override void TestFixtureTearDown() public void Page_Marked_As_Secure_Should_Able_To_Management_In_Insecure_Channel() { int tabId; - var connector = CreateNewSecurePage(out tabId); + var connector = this.CreateNewSecurePage(out tabId); //Try to request the GetLocalization API var response = connector.GetContent($"API/PersonaBar/Pages/GetTabLocalization?pageId={tabId}", null, true, false); @@ -80,7 +80,7 @@ private void UpdateContentLocalization(bool enabled) var postData = new { - PortalId = PortalId, + PortalId = this.PortalId, ContentLocalizationEnabled = false, SystemDefaultLanguage = "English (United States)", SystemDefaultLanguageIcon = "/images/Flags/en-US.gif", @@ -97,8 +97,8 @@ private void UpdateContentLocalization(bool enabled) connector.PostJson( enabled - ? $"API/PersonaBar/Languages/EnableLocalizedContent?portalId={PortalId}&translatePages=false" - : $"API/PersonaBar/Languages/DisableLocalizedContent?portalId={PortalId}", new {}); + ? $"API/PersonaBar/Languages/EnableLocalizedContent?portalId={this.PortalId}&translatePages=false" + : $"API/PersonaBar/Languages/DisableLocalizedContent?portalId={this.PortalId}", new {}); } private void UpdateSslSettings(bool sslEnabled) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Services/Installer/XmlMergeTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Services/Installer/XmlMergeTests.cs index cf982aa3153..ae0f45e7392 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Services/Installer/XmlMergeTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Services/Installer/XmlMergeTests.cs @@ -29,7 +29,7 @@ public class XmlMergeTests : DnnUnitTest /// XmlDocument with the result of the merge operation private XmlDocument ExecuteMerge() { - return ExecuteMerge(null); + return this.ExecuteMerge(null); } /// @@ -37,14 +37,14 @@ private XmlDocument ExecuteMerge() /// private XmlDocument ExecuteMerge(string mergeName) { - string testMethodName = GetTestMethodName(); + string testMethodName = this.GetTestMethodName(); - XmlMerge merge = GetXmlMerge(mergeName ?? testMethodName); - XmlDocument targetDoc = LoadTargetDoc(testMethodName); + XmlMerge merge = this.GetXmlMerge(mergeName ?? testMethodName); + XmlDocument targetDoc = this.LoadTargetDoc(testMethodName); merge.UpdateConfig(targetDoc); - WriteToDebug(targetDoc); + this.WriteToDebug(targetDoc); return targetDoc; } @@ -67,7 +67,7 @@ private string GetTestMethodName() private XmlDocument LoadTargetDoc(string testMethodName) { using (Stream targetStream = - _assembly.GetManifestResourceStream(string.Format("DotNetNuke.Tests.Integration.Services.Installer.MergeFiles.{0}Target.xml", + this._assembly.GetManifestResourceStream(string.Format("DotNetNuke.Tests.Integration.Services.Installer.MergeFiles.{0}Target.xml", testMethodName))) { Debug.Assert(targetStream != null, @@ -81,7 +81,7 @@ private XmlDocument LoadTargetDoc(string testMethodName) private XmlMerge GetXmlMerge(string fileName) { using (Stream mergeStream = - _assembly.GetManifestResourceStream(string.Format("DotNetNuke.Tests.Integration.Services.Installer.MergeFiles.{0}Merge.xml", + this._assembly.GetManifestResourceStream(string.Format("DotNetNuke.Tests.Integration.Services.Installer.MergeFiles.{0}Merge.xml", fileName))) { Debug.Assert(mergeStream != null, @@ -112,7 +112,7 @@ private void WriteToDebug(XmlDocument targetDoc) [SetUp] public void SetUp() { - AppDomain.CurrentDomain.SetData("APPBASE", WebsitePhysicalAppPath); + AppDomain.CurrentDomain.SetData("APPBASE", this.WebsitePhysicalAppPath); LoggerSource.SetTestableInstance(new TestLogSource()); } @@ -121,7 +121,7 @@ public void SetUp() [Test] public void SimpleUpdate() { - XmlDocument targetDoc = ExecuteMerge(); + XmlDocument targetDoc = this.ExecuteMerge(); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -135,7 +135,7 @@ public void SimpleUpdate() [Test] public void SimpleUpdateInLocation() { - XmlDocument targetDoc = ExecuteMerge("SimpleUpdate"); + XmlDocument targetDoc = this.ExecuteMerge("SimpleUpdate"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/location/updateme/children/child"); @@ -149,7 +149,7 @@ public void SimpleUpdateInLocation() [Test] public void SimpleUpdateInLocationWithDistractingLocations() { - XmlDocument targetDoc = ExecuteMerge("SimpleUpdate"); + XmlDocument targetDoc = this.ExecuteMerge("SimpleUpdate"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/location/updateme/children/child"); @@ -163,7 +163,7 @@ public void SimpleUpdateInLocationWithDistractingLocations() [Test] public void UpdateWithTargetPath() { - XmlDocument targetDoc = ExecuteMerge(); + XmlDocument targetDoc = this.ExecuteMerge(); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -177,7 +177,7 @@ public void UpdateWithTargetPath() [Test] public void UpdateInLocationWithTargetPath() { - XmlDocument targetDoc = ExecuteMerge("UpdateWithTargetPath"); + XmlDocument targetDoc = this.ExecuteMerge("UpdateWithTargetPath"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/location/updateme/children/child"); @@ -191,7 +191,7 @@ public void UpdateInLocationWithTargetPath() [Test] public void UpdateWithDistractingLocationAndTargetPath() { - XmlDocument targetDoc = ExecuteMerge("UpdateWithTargetPath"); + XmlDocument targetDoc = this.ExecuteMerge("UpdateWithTargetPath"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -205,7 +205,7 @@ public void UpdateWithDistractingLocationAndTargetPath() [Test] public void UpdateInLocationWithDistractingLocationAndTargetPath() { - XmlDocument targetDoc = ExecuteMerge("UpdateWithTargetPath"); + XmlDocument targetDoc = this.ExecuteMerge("UpdateWithTargetPath"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/location/updateme/children/child"); @@ -219,7 +219,7 @@ public void UpdateInLocationWithDistractingLocationAndTargetPath() [Test] public void UpdateInFirstLocationWithDistractingLocationAndTargetPath() { - XmlDocument targetDoc = ExecuteMerge("UpdateWithTargetPath"); + XmlDocument targetDoc = this.ExecuteMerge("UpdateWithTargetPath"); //children are in correct location //first location/updateme has updated node @@ -244,7 +244,7 @@ public void UpdateInFirstLocationWithDistractingLocationAndTargetPath() [Test] public void SimpleAdd() { - XmlDocument targetDoc = ExecuteMerge(); + XmlDocument targetDoc = this.ExecuteMerge(); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -254,7 +254,7 @@ public void SimpleAdd() [Test] public void AddWithLocation() { - XmlDocument targetDoc = ExecuteMerge("SimpleAdd"); + XmlDocument targetDoc = this.ExecuteMerge("SimpleAdd"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -277,7 +277,7 @@ public void AddWithLocation() [Test] public void SimpleInsertBefore() { - XmlDocument targetDoc = ExecuteMerge(); + XmlDocument targetDoc = this.ExecuteMerge(); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -291,7 +291,7 @@ public void SimpleInsertBefore() [Test] public void InsertBeforeInLocation() { - XmlDocument targetDoc = ExecuteMerge("SimpleInsertBefore"); + XmlDocument targetDoc = this.ExecuteMerge("SimpleInsertBefore"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/location/updateme/children/child"); @@ -305,7 +305,7 @@ public void InsertBeforeInLocation() [Test] public void SimpleInsertAfter() { - XmlDocument targetDoc = ExecuteMerge(); + XmlDocument targetDoc = this.ExecuteMerge(); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/updateme/children/child"); @@ -319,7 +319,7 @@ public void SimpleInsertAfter() [Test] public void InsertAfterInLocation() { - XmlDocument targetDoc = ExecuteMerge("SimpleInsertAfter"); + XmlDocument targetDoc = this.ExecuteMerge("SimpleInsertAfter"); //children are in correct location XmlNodeList nodes = targetDoc.SelectNodes("/configuration/location/updateme/children/child"); @@ -333,7 +333,7 @@ public void InsertAfterInLocation() [Test] public void SimpleRemove() { - XmlDocument targetDoc = ExecuteMerge(); + XmlDocument targetDoc = this.ExecuteMerge(); //node is gone var nodes = targetDoc.SelectNodes("//removeme"); @@ -347,7 +347,7 @@ public void SimpleRemove() [Test] public void RemoveFromLocation() { - XmlDocument targetDoc = ExecuteMerge("SimpleRemove"); + XmlDocument targetDoc = this.ExecuteMerge("SimpleRemove"); //node is gone var nodes = targetDoc.SelectNodes("//removeme"); @@ -361,7 +361,7 @@ public void RemoveFromLocation() [Test] public void SimpleRemoveAttribute() { - var targetDoc = ExecuteMerge(); + var targetDoc = this.ExecuteMerge(); var node = targetDoc.SelectSingleNode("/configuration/updateme"); Assert.AreEqual(0, node.Attributes.Count); @@ -370,7 +370,7 @@ public void SimpleRemoveAttribute() [Test] public void RemoveAttributeFromLocation() { - var targetDoc = ExecuteMerge("SimpleRemoveAttribute"); + var targetDoc = this.ExecuteMerge("SimpleRemoveAttribute"); var node = targetDoc.SelectSingleNode("/configuration/location/updateme"); Assert.AreEqual(0, node.Attributes.Count); @@ -379,7 +379,7 @@ public void RemoveAttributeFromLocation() [Test] public void SimpleInsertAttribute() { - var targetDoc = ExecuteMerge(); + var targetDoc = this.ExecuteMerge(); var node = targetDoc.SelectSingleNode("/configuration/updateme"); Assert.AreEqual(2, node.Attributes.Count); @@ -389,7 +389,7 @@ public void SimpleInsertAttribute() [Test] public void InsertAttributeInLocation() { - var targetDoc = ExecuteMerge("SimpleInsertAttribute"); + var targetDoc = this.ExecuteMerge("SimpleInsertAttribute"); var node = targetDoc.SelectSingleNode("/configuration/location/updateme"); Assert.AreEqual(2, node.Attributes.Count); @@ -399,7 +399,7 @@ public void InsertAttributeInLocation() [Test] public void UpdateAttributeInLocation() { - var targetDoc = ExecuteMerge("SimpleInsertAttribute"); + var targetDoc = this.ExecuteMerge("SimpleInsertAttribute"); var node = targetDoc.SelectSingleNode("/configuration/location/updateme"); Assert.AreEqual(2, node.Attributes.Count); @@ -409,7 +409,7 @@ public void UpdateAttributeInLocation() [Test] public void SimpleUpdateWithKey() { - var targetDoc = ExecuteMerge(); + var targetDoc = this.ExecuteMerge(); //a key was added var nodes = targetDoc.SelectNodes("/configuration/updateme/add"); @@ -424,7 +424,7 @@ public void SimpleUpdateWithKey() [Test] public void UpdateWithKeyInLocation() { - var targetDoc = ExecuteMerge("SimpleUpdateWithKey"); + var targetDoc = this.ExecuteMerge("SimpleUpdateWithKey"); //a key was added var nodes = targetDoc.SelectNodes("/configuration/location/updateme/add"); @@ -439,12 +439,12 @@ public void UpdateWithKeyInLocation() [Test] public void NoChangeOnOverwrite() { - XmlMerge merge = GetXmlMerge(nameof(NoChangeOnOverwrite)); - XmlDocument targetDoc = LoadTargetDoc(nameof(NoChangeOnOverwrite)); + XmlMerge merge = this.GetXmlMerge(nameof(this.NoChangeOnOverwrite)); + XmlDocument targetDoc = this.LoadTargetDoc(nameof(this.NoChangeOnOverwrite)); merge.UpdateConfig(targetDoc); - WriteToDebug(targetDoc); + this.WriteToDebug(targetDoc); var nodes = targetDoc.SelectNodes("/configuration/appSettings/add"); Assert.AreEqual(3, nodes.Count); @@ -455,12 +455,12 @@ public void NoChangeOnOverwrite() [Test] public void ShouldChangeOnOverwrite() { - XmlMerge merge = GetXmlMerge(nameof(ShouldChangeOnOverwrite)); - XmlDocument targetDoc = LoadTargetDoc(nameof(ShouldChangeOnOverwrite)); + XmlMerge merge = this.GetXmlMerge(nameof(this.ShouldChangeOnOverwrite)); + XmlDocument targetDoc = this.LoadTargetDoc(nameof(this.ShouldChangeOnOverwrite)); merge.UpdateConfig(targetDoc); - WriteToDebug(targetDoc); + this.WriteToDebug(targetDoc); var nodes = targetDoc.SelectNodes("/configuration/appSettings/add"); Assert.AreEqual(3, nodes.Count); @@ -471,7 +471,7 @@ public void ShouldChangeOnOverwrite() [Test] public void ShouldPreserveEmptyNamespaceOnSave() { - var targetDoc = ExecuteMerge(); + var targetDoc = this.ExecuteMerge(); var ns = new XmlNamespaceManager(targetDoc.NameTable); ns.AddNamespace("ab", "urn:schemas-microsoft-com:asm.v1"); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/DotNetNukeWeb/DotNetNukeWebTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/DotNetNukeWeb/DotNetNukeWebTests.cs index a3ca8494b09..acb8c3d8ea9 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/DotNetNukeWeb/DotNetNukeWebTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/DotNetNukeWeb/DotNetNukeWebTests.cs @@ -28,7 +28,7 @@ public DotNetNukeWebTests() { var url = ConfigurationManager.AppSettings["siteUrl"]; var siteUri = new Uri(url); - _httpClient = new HttpClient { BaseAddress = siteUri, Timeout = _timeout }; + this._httpClient = new HttpClient { BaseAddress = siteUri, Timeout = this._timeout }; } #endregion @@ -40,7 +40,7 @@ public DotNetNukeWebTests() [TestCase(GetModuleDetailsQuery)] public void CallingHelperForAnonymousUserShouldReturnSuccess(string query) { - var result = _httpClient.GetAsync(query + HttpUtility.UrlEncode("ViewProfile")).Result; + var result = this._httpClient.GetAsync(query + HttpUtility.UrlEncode("ViewProfile")).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/FriendsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/FriendsTests.cs index caf2d18ee13..eb1395e15d1 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/FriendsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/FriendsTests.cs @@ -55,23 +55,23 @@ public void SetUp() [Test] public void Friend_Request_Should_Match_Target_User_Culture() { - PrepareSecondLanguage(); + this.PrepareSecondLanguage(); int userId1, userId2, fileId1, fileId2; string userName1, userName2; - CreateNewUser(out userId1, out userName1, out fileId1); - CreateNewUser(out userId2, out userName2, out fileId2); + this.CreateNewUser(out userId1, out userName1, out fileId1); + this.CreateNewUser(out userId2, out userName2, out fileId2); - UpdateUserProfile(userId1, UserProfile.USERPROFILE_PreferredLocale, FirstLanguage); - UpdateUserProfile(userId2, UserProfile.USERPROFILE_PreferredLocale, SecondLanguage); + this.UpdateUserProfile(userId1, UserProfile.USERPROFILE_PreferredLocale, FirstLanguage); + this.UpdateUserProfile(userId2, UserProfile.USERPROFILE_PreferredLocale, SecondLanguage); WebApiTestHelper.ClearHostCache(); var connector = WebApiTestHelper.LoginUser(userName1); connector.PostJson("API/MemberDirectory/MemberDirectory/AddFriend", new { friendId = userId2 - }, GetRequestHeaders()); + }, this.GetRequestHeaders()); - var notificationTitle = GetNotificationTitle(userId1); + var notificationTitle = this.GetNotificationTitle(userId1); //the notification should use french language: testuser8836 veut être amis avec vous Assert.AreEqual($"{userName1} veut être amis", notificationTitle); @@ -90,7 +90,7 @@ private void UpdateUserProfile(int userId, string propertyName, string propertyV private void PrepareSecondLanguage() { - if (!LanguageEnabled(PortalId, SecondLanguage)) + if (!this.LanguageEnabled(PortalId, SecondLanguage)) { } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Jwt/JwtAuthTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Jwt/JwtAuthTest.cs index 8d2dcf37c10..f60b1f0cb93 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Jwt/JwtAuthTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Jwt/JwtAuthTest.cs @@ -46,9 +46,9 @@ public JwtAuthTest() { var url = ConfigurationManager.AppSettings["siteUrl"]; var siteUri = new Uri(url); - _httpClient = new HttpClient { BaseAddress = siteUri, Timeout = _timeout }; - _hostName = ConfigurationManager.AppSettings["hostUsername"]; - _hostPass = ConfigurationManager.AppSettings["hostPassword"]; + this._httpClient = new HttpClient { BaseAddress = siteUri, Timeout = this._timeout }; + this._hostName = ConfigurationManager.AppSettings["hostUsername"]; + this._hostPass = ConfigurationManager.AppSettings["hostPassword"]; } [TestFixtureSetUp] @@ -73,8 +73,8 @@ public override void TestFixtureSetUp() [Test] public void InvalidUserLoginShouldFail() { - var credentials = new { u = _hostName, p = _hostPass + "." }; - var result = _httpClient.PostAsJsonAsync(LoginQuery, credentials).Result; + var credentials = new { u = this._hostName, p = this._hostPass + "." }; + var result = this._httpClient.PostAsJsonAsync(LoginQuery, credentials).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -83,7 +83,7 @@ public void InvalidUserLoginShouldFail() [Test] public void ValidUserLoginShouldPass() { - var token = GetAuthorizationTokenFor(_hostName, _hostPass); + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); Assert.IsNotNull(token.UserId); Assert.IsNotNull(token.AccessToken); Assert.IsNotNull(token.DisplayName); @@ -101,18 +101,18 @@ public void ValidUserLoginShouldPass() [Test] public void RequestUsingInvaldatedTokenAfterLogoutShouldFail() { - var token = GetAuthorizationTokenFor(_hostName, _hostPass); + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); - SetAuthHeaderToken(token.AccessToken); - var result1 = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token.AccessToken); + var result1 = this._httpClient.GetAsync(TestGetQuery).Result; var content1 = result1.Content.ReadAsStringAsync().Result; LogText(@"content1 => " + content1); Assert.AreEqual(HttpStatusCode.OK, result1.StatusCode); - LogoutUser(token.AccessToken); + this.LogoutUser(token.AccessToken); - SetAuthHeaderToken(token.AccessToken); - var result2 = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token.AccessToken); + var result2 = this._httpClient.GetAsync(TestGetQuery).Result; var content2 = result2.Content.ReadAsStringAsync().Result; LogText(@"content2 => " + content2); Assert.AreEqual(HttpStatusCode.Unauthorized, result2.StatusCode); @@ -121,7 +121,7 @@ public void RequestUsingInvaldatedTokenAfterLogoutShouldFail() [Test] public void RequestWithoutTokenShouldFail() { - var result = _httpClient.GetAsync(TestGetQuery).Result; + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -130,9 +130,9 @@ public void RequestWithoutTokenShouldFail() [Test] public void ValidatedUserGetRequestShouldPass() { - var token = GetAuthorizationTokenFor(_hostName, _hostPass); - SetAuthHeaderToken(token.AccessToken); - var result = _httpClient.GetAsync(TestGetQuery).Result; + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + this.SetAuthHeaderToken(token.AccessToken); + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); @@ -142,9 +142,9 @@ public void ValidatedUserGetRequestShouldPass() [Test] public void ValidatedUserPostRequestShouldPass() { - var token = GetAuthorizationTokenFor(_hostName, _hostPass); - SetAuthHeaderToken(token.AccessToken); - var result = _httpClient.PostAsJsonAsync(TestPostQuery, new { text = "Integraton Testing Rocks!" }).Result; + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + this.SetAuthHeaderToken(token.AccessToken); + var result = this._httpClient.PostAsJsonAsync(TestPostQuery, new { text = "Integraton Testing Rocks!" }).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); @@ -155,8 +155,8 @@ public void ValidatedUserPostRequestShouldPass() [Test] public void RenewValidTokenShouldPass() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); - var token2 = RenewAuthorizationToken(token1); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + var token2 = this.RenewAuthorizationToken(token1); Assert.AreNotEqual(token1.AccessToken, token2.AccessToken); Assert.AreEqual(token1.RenewalToken, token2.RenewalToken); Assert.AreEqual(token1.DisplayName, token2.DisplayName); @@ -165,14 +165,14 @@ public void RenewValidTokenShouldPass() [Test] public void UsingOriginalAccessTokenAfterRenewalShouldFail() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); - var token2 = RenewAuthorizationToken(token1); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + var token2 = this.RenewAuthorizationToken(token1); Assert.AreNotEqual(token1.AccessToken, token2.AccessToken); Assert.AreEqual(token1.RenewalToken, token2.RenewalToken); Assert.AreEqual(token1.DisplayName, token2.DisplayName); - SetAuthHeaderToken(token1.AccessToken); - var result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token1.AccessToken); + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -181,34 +181,34 @@ public void UsingOriginalAccessTokenAfterRenewalShouldFail() [Test] public void TryingToRenewUsingSameTokenMoreTHanOneTimeShouldFail() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); - RenewAuthorizationToken(token1); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + this.RenewAuthorizationToken(token1); - SetAuthHeaderToken(token1.AccessToken); - var result = _httpClient.PostAsJsonAsync(ExtendTokenQuery, new { rtoken = token1.RenewalToken }).Result; + this.SetAuthHeaderToken(token1.AccessToken); + var result = this._httpClient.PostAsJsonAsync(ExtendTokenQuery, new { rtoken = token1.RenewalToken }).Result; Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); } [Test] public void RenewMultipleTimesShouldPass() { - RenewAuthorizationToken( - RenewAuthorizationToken( - RenewAuthorizationToken( - GetAuthorizationTokenFor(_hostName, _hostPass)))); + this.RenewAuthorizationToken( + this.RenewAuthorizationToken( + this.RenewAuthorizationToken( + this.GetAuthorizationTokenFor(this._hostName, this._hostPass)))); } [Test] public void UsingTheNewAccessTokenAfterRenewalShouldPass() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); - var token2 = RenewAuthorizationToken(token1); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + var token2 = this.RenewAuthorizationToken(token1); Assert.AreNotEqual(token1.AccessToken, token2.AccessToken); Assert.AreEqual(token1.RenewalToken, token2.RenewalToken); Assert.AreEqual(token1.DisplayName, token2.DisplayName); - SetAuthHeaderToken(token2.AccessToken); - var result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token2.AccessToken); + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); @@ -217,18 +217,18 @@ public void UsingTheNewAccessTokenAfterRenewalShouldPass() [Test] public void TamperedTokenShouldFail() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); // tampered header - SetAuthHeaderToken("x" + token1.AccessToken); - var result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken("x" + token1.AccessToken); + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); // tampered signature - SetAuthHeaderToken(token1.AccessToken + "y"); - result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token1.AccessToken + "y"); + result = this._httpClient.GetAsync(TestGetQuery).Result; content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -236,8 +236,8 @@ public void TamperedTokenShouldFail() // tampered claims var idx = token1.AccessToken.IndexOf('.'); var tampered = token1.AccessToken.Substring(0, idx + 10) + "z" + token1.AccessToken.Substring(idx + 10); - SetAuthHeaderToken(tampered); - result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(tampered); + result = this._httpClient.GetAsync(TestGetQuery).Result; content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -246,7 +246,7 @@ public void TamperedTokenShouldFail() [Test] public void ExtendingTokenWithinLastHourExtendsUpToRenewalExpiry() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); var parts = token1.AccessToken.Split('.'); var decoded = DecodeBase64(parts[1]); dynamic claims = JsonConvert.DeserializeObject(decoded); @@ -256,7 +256,7 @@ public void ExtendingTokenWithinLastHourExtendsUpToRenewalExpiry() DatabaseHelper.ExecuteNonQuery(query); WebApiTestHelper.ClearHostCache(); - var token2 = RenewAuthorizationToken(token1); + var token2 = this.RenewAuthorizationToken(token1); parts = token2.AccessToken.Split('.'); decoded = DecodeBase64(parts[1]); claims = JsonConvert.DeserializeObject(decoded); @@ -277,7 +277,7 @@ public void ExtendingTokenWithinLastHourExtendsUpToRenewalExpiry() [Test] public void UsingExpiredAccessTokenShouldFail() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); var parts = token1.AccessToken.Split('.'); var decoded = DecodeBase64(parts[1]); dynamic claims = JsonConvert.DeserializeObject(decoded); @@ -287,8 +287,8 @@ public void UsingExpiredAccessTokenShouldFail() DatabaseHelper.ExecuteNonQuery(query); WebApiTestHelper.ClearHostCache(); - SetAuthHeaderToken(token1.AccessToken); - var result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token1.AccessToken); + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -297,7 +297,7 @@ public void UsingExpiredAccessTokenShouldFail() [Test] public void UsingExpiredRenewalTokenShouldFail() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); var parts = token1.AccessToken.Split('.'); var decoded = DecodeBase64(parts[1]); dynamic claims = JsonConvert.DeserializeObject(decoded); @@ -307,8 +307,8 @@ public void UsingExpiredRenewalTokenShouldFail() DatabaseHelper.ExecuteNonQuery(query); WebApiTestHelper.ClearHostCache(); - SetAuthHeaderToken(token1.AccessToken); - var result = _httpClient.GetAsync(TestGetQuery).Result; + this.SetAuthHeaderToken(token1.AccessToken); + var result = this._httpClient.GetAsync(TestGetQuery).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); @@ -317,7 +317,7 @@ public void UsingExpiredRenewalTokenShouldFail() [Test] public void TryingToRenewUsingAnExpiredRenewalTokenShouldFail() { - var token1 = GetAuthorizationTokenFor(_hostName, _hostPass); + var token1 = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); var parts = token1.AccessToken.Split('.'); var decoded = DecodeBase64(parts[1]); dynamic claims = JsonConvert.DeserializeObject(decoded); @@ -327,8 +327,8 @@ public void TryingToRenewUsingAnExpiredRenewalTokenShouldFail() DatabaseHelper.ExecuteNonQuery(query); WebApiTestHelper.ClearHostCache(); - SetAuthHeaderToken(token1.AccessToken); - var result = _httpClient.PostAsJsonAsync(ExtendTokenQuery, new { rtoken = token1.RenewalToken }).Result; + this.SetAuthHeaderToken(token1.AccessToken); + var result = this._httpClient.PostAsJsonAsync(ExtendTokenQuery, new { rtoken = token1.RenewalToken }).Result; Assert.AreEqual(HttpStatusCode.Unauthorized, result.StatusCode); } @@ -337,9 +337,9 @@ public void TryingToRenewUsingAnExpiredRenewalTokenShouldFail() [TestCase(GetModuleDetailsQuery)] public void CallingHelperForLoggedinUserShouldReturnSuccess(string query) { - var token = GetAuthorizationTokenFor(_hostName, _hostPass); - SetAuthHeaderToken(token.AccessToken); - var result = _httpClient.GetAsync(query + HttpUtility.UrlEncode("ViewProfile")).Result; + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + this.SetAuthHeaderToken(token.AccessToken); + var result = this._httpClient.GetAsync(query + HttpUtility.UrlEncode("ViewProfile")).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); Assert.NotNull(content); @@ -363,11 +363,11 @@ WHERE TabId IN (SELECT TabId FROM {objectQualifier}Tabs WHERE TabName='Activity WebApiTestHelper.ClearHostCache(); // Act - var token = GetAuthorizationTokenFor(_hostName, _hostPass); - SetAuthHeaderToken(token.AccessToken); - SetMonikerHeader("myjournal"); + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + this.SetAuthHeaderToken(token.AccessToken); + this.SetMonikerHeader("myjournal"); var postItem = new {ProfileId = 1, GroupId = -1, RowIndex = 0, MaxRows = 1}; - var result = _httpClient.PostAsJsonAsync( + var result = this._httpClient.PostAsJsonAsync( "/API/Journal/Services/GetListForProfile", postItem).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); @@ -390,11 +390,11 @@ WHERE TabId IN (SELECT TabId FROM {objectQualifier}Tabs WHERE TabName='Activity WebApiTestHelper.ClearHostCache(); // Act - var token = GetAuthorizationTokenFor(_hostName, _hostPass); - SetAuthHeaderToken(token.AccessToken); - SetMonikerHeader("myjournal"); + var token = this.GetAuthorizationTokenFor(this._hostName, this._hostPass); + this.SetAuthHeaderToken(token.AccessToken); + this.SetMonikerHeader("myjournal"); var postItem = new {ProfileId = 1, GroupId = -1, RowIndex = 0, MaxRows = 1}; - var result = _httpClient.PostAsJsonAsync( + var result = this._httpClient.PostAsJsonAsync( "/API/Journal/Services/GetListForProfile", postItem).Result; var content = result.Content.ReadAsStringAsync().Result; LogText(@"content => " + content); @@ -417,20 +417,20 @@ public void TemplateMethod() private LoginResultData GetAuthorizationTokenFor(string uname, string upass) { var credentials = new { u = uname, p = upass }; - var result = _httpClient.PostAsJsonAsync(LoginQuery, credentials).Result; + var result = this._httpClient.PostAsJsonAsync(LoginQuery, credentials).Result; Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); var token = result.Content.ReadAsAsync().Result; Assert.IsNotNull(token); LogText(@"AuthToken => " + JsonConvert.SerializeObject(token)); - _httpClient.DefaultRequestHeaders.Clear(); + this._httpClient.DefaultRequestHeaders.Clear(); return token; } private LoginResultData RenewAuthorizationToken(LoginResultData currentToken) { Thread.Sleep(1000); // must delay at least 1 second so the expiry time is different - SetAuthHeaderToken(currentToken.AccessToken); - var result = _httpClient.PostAsJsonAsync(ExtendTokenQuery, new { rtoken = currentToken.RenewalToken }).Result; + this.SetAuthHeaderToken(currentToken.AccessToken); + var result = this._httpClient.PostAsJsonAsync(ExtendTokenQuery, new { rtoken = currentToken.RenewalToken }).Result; Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); var token = result.Content.ReadAsAsync().Result; Assert.IsNotNull(token); @@ -440,8 +440,8 @@ private LoginResultData RenewAuthorizationToken(LoginResultData currentToken) private void LogoutUser(string accessToken) { - SetAuthHeaderToken(accessToken); - var result = _httpClient.GetAsync(LogoutQuery).Result; + this.SetAuthHeaderToken(accessToken); + var result = this._httpClient.GetAsync(LogoutQuery).Result; Assert.AreEqual(HttpStatusCode.OK, result.StatusCode); var content = result.Content.ReadAsStringAsync().Result; dynamic response = !string.IsNullOrEmpty(content) ? JsonConvert.DeserializeObject(content) : null; @@ -450,13 +450,13 @@ private void LogoutUser(string accessToken) private void SetAuthHeaderToken(string token, string scheme = "Bearer") { - _httpClient.DefaultRequestHeaders.Authorization = + this._httpClient.DefaultRequestHeaders.Authorization = AuthenticationHeaderValue.Parse(scheme.Trim() + " " + token.Trim()); } private void SetMonikerHeader(string monikerValue) { - _httpClient.DefaultRequestHeaders.Add("X-DNN-MONIKER", monikerValue); + this._httpClient.DefaultRequestHeaders.Add("X-DNN-MONIKER", monikerValue); } private static string DecodeBase64(string b64Str) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalInfoTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalInfoTests.cs index c3d33ee2d6f..4cec7ca99de 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalInfoTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalInfoTests.cs @@ -31,7 +31,7 @@ public void Processor_Password_In_DB_Must_Be_Encrypted() PortalController.Instance.UpdatePortalInfo(firstPortal); var result = DatabaseHelper.ExecuteScalar( - @"SELECT TOP(1) COALESCE(ProcessorPassword, '') FROM {objectQualifier}Portals WHERE PortalID=" + PortalId); + @"SELECT TOP(1) COALESCE(ProcessorPassword, '') FROM {objectQualifier}Portals WHERE PortalID=" + this.PortalId); var decrypted = DotNetNuke.Security.FIPSCompliant.DecryptAES(result, Config.GetDecryptionkey(), Host.GUID); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalSettingsTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalSettingsTests.cs index e75242cdd10..5cc5bf3a3f7 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalSettingsTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Portals/PortalSettingsTests.cs @@ -24,36 +24,36 @@ public PortalSettingsTests() : base(Constants.PORTAL_Zero) [SetUp] public void Setup() { - _settingName = "NameToCheckFor"; + this._settingName = "NameToCheckFor"; // we need different value so when we save we force going to database - _settingValue = "ValueToCheckFor_" + new Random().Next(1, 100); + this._settingValue = "ValueToCheckFor_" + new Random().Next(1, 100); } [Test] public void Saving_Non_Secure_Value_Doesnt_Encrypt_It() { //Act - PortalController.UpdatePortalSetting(PortalId, _settingName, _settingValue, true, null, false); - var result = PortalController.GetPortalSetting(_settingName, PortalId, ""); + PortalController.UpdatePortalSetting(this.PortalId, this._settingName, this._settingValue, true, null, false); + var result = PortalController.GetPortalSetting(this._settingName, this.PortalId, ""); //Assert Assert.AreNotEqual(result, ""); - Assert.AreEqual(_settingValue, result); + Assert.AreEqual(this._settingValue, result); } [Test] public void Saving_Secure_Value_Encrypts_It() { //Act - PortalController.UpdatePortalSetting(PortalId, _settingName, _settingValue, true, null, true); + PortalController.UpdatePortalSetting(this.PortalId, this._settingName, this._settingValue, true, null, true); - var result = PortalController.GetPortalSetting(_settingName, PortalId, ""); + var result = PortalController.GetPortalSetting(this._settingName, this.PortalId, ""); var decrypted = DotNetNuke.Security.FIPSCompliant.DecryptAES(result, Config.GetDecryptionkey(), Host.GUID); //Assert Assert.AreNotEqual(result, ""); - Assert.AreNotEqual(_settingValue, result); - Assert.AreEqual(decrypted, _settingValue); + Assert.AreNotEqual(this._settingValue, result); + Assert.AreEqual(decrypted, this._settingValue); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Security/AuthCookieTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Security/AuthCookieTests.cs index 7ea265a1239..80a086e17a8 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Security/AuthCookieTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/Tests/Security/AuthCookieTests.cs @@ -28,7 +28,7 @@ public void Using_Logged_Out_Cookie_Should_Be_Unauthorized() // make sure the request succeeds when the user is logged in //var result1 = session.GetContent(GetPortaslApi, null, false); -- use same method to validate - var result1 = SendDirectGetRequest(session.Domain, GetPortaslApi, session.Timeout, cookies); + var result1 = this.SendDirectGetRequest(session.Domain, GetPortaslApi, session.Timeout, cookies); Assert.IsTrue(result1.IsSuccessStatusCode); Assert.AreEqual(HttpStatusCode.OK, result1.StatusCode); @@ -36,7 +36,7 @@ public void Using_Logged_Out_Cookie_Should_Be_Unauthorized() Assert.IsFalse(session.IsLoggedIn); // make sure the request fails when using the same cookies before logging out - var result2 = SendDirectGetRequest(session.Domain, GetPortaslApi, session.Timeout, cookies); + var result2 = this.SendDirectGetRequest(session.Domain, GetPortaslApi, session.Timeout, cookies); Assert.IsFalse(result2.IsSuccessStatusCode); Assert.AreEqual(HttpStatusCode.Unauthorized, result2.StatusCode); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Integration/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Integration/packages.config index 5f9964cfa94..3e2870b85fe 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Integration/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Integration/packages.config @@ -1,13 +1,14 @@ - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.UI/DotNetNuke.Tests.UI.csproj b/DNN Platform/Tests/DotNetNuke.Tests.UI/DotNetNuke.Tests.UI.csproj index 4ad0a9a63b0..68a30fae87b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.UI/DotNetNuke.Tests.UI.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.UI/DotNetNuke.Tests.UI.csproj @@ -1,118 +1,125 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5484768D-80AA-4D07-86F0-8CB0A06AFD99} - Library - Properties - DotNetNuke.Tests.UI - DotNetNuke.Tests.UI - v4.7.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - - - 4.0 - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - - - - - - - - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {68368906-57dd-40d1-ac10-35211a17d617} - DotNetNuke.Tests.Utilities - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {5484768D-80AA-4D07-86F0-8CB0A06AFD99} + Library + Properties + DotNetNuke.Tests.UI + DotNetNuke.Tests.UI + v4.7.2 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + + + 4.0 + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + + + + + + + + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {68368906-57dd-40d1-ac10-35211a17d617} + DotNetNuke.Tests.Utilities + + + + + + + + + stylecop.json + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.UI/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.UI/packages.config index 53b44f9d8fe..97fd3abee1b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.UI/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.UI/packages.config @@ -1,6 +1,7 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Urls/DotNetNuke.Tests.Urls.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Urls/DotNetNuke.Tests.Urls.csproj index c6ad5ecdfe4..42295f10c70 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Urls/DotNetNuke.Tests.Urls.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Urls/DotNetNuke.Tests.Urls.csproj @@ -1,215 +1,222 @@ - - - - - Debug - AnyCPU - {F9CE7C63-C729-4E3A-A266-6B23D75A1247} - Library - Properties - DotNetNuke.Tests.Urls - DotNetNuke.Tests.Urls - v4.7.2 - 512 - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 7 - - - - False - ..\..\HttpModules\bin\DotNetNuke.HttpModules.dll - - - False - ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll - - - False - ..\..\DotNetNuke.Log4net\bin\dotnetnuke.log4net.dll - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - ..\..\Components\PetaPoco\bin\PetaPoco.dll - - - - - - - - - - - - - - - - - - - - - - - - - App.config - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {5AECE021-E449-4A7F-BF82-2FA7B236ED3E} - DotNetNuke.Tests.Utilities - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {F9CE7C63-C729-4E3A-A266-6B23D75A1247} + Library + Properties + DotNetNuke.Tests.Urls + DotNetNuke.Tests.Urls + v4.7.2 + 512 + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + 7 + + + + False + ..\..\HttpModules\bin\DotNetNuke.HttpModules.dll + + + False + ..\..\DotNetNuke.Instrumentation\bin\DotNetNuke.Instrumentation.dll + + + False + ..\..\DotNetNuke.Log4net\bin\dotnetnuke.log4net.dll + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\..\Components\PetaPoco\bin\PetaPoco.dll + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + App.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {5AECE021-E449-4A7F-BF82-2FA7B236ED3E} + DotNetNuke.Tests.Utilities + + + + + + + + + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Urls/FriendlyUrlTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Urls/FriendlyUrlTests.cs index 9943d19a0b4..5946edd963e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Urls/FriendlyUrlTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Urls/FriendlyUrlTests.cs @@ -40,12 +40,12 @@ public override void SetUp() { base.SetUp(); - UpdateTabName(_tabId, "About Us"); + this.UpdateTabName(this._tabId, "About Us"); CacheController.FlushPageIndexFromCache(); - GetDefaultAlias(); - _redirectMode = PortalController.GetPortalSetting("PortalAliasMapping", PortalId, "CANONICALURL"); - _primaryAlias = null; - _customLocale = null; + this.GetDefaultAlias(); + this._redirectMode = PortalController.GetPortalSetting("PortalAliasMapping", this.PortalId, "CANONICALURL"); + this._primaryAlias = null; + this._customLocale = null; } [TestFixtureSetUp] @@ -53,26 +53,26 @@ public override void TestFixtureSetUp() { base.TestFixtureSetUp(); - var tab = TabController.Instance.GetTabByName(_aboutUsPageName, PortalId); + var tab = TabController.Instance.GetTabByName(_aboutUsPageName, this.PortalId); if (tab == null) { - CreateTab(_aboutUsPageName); - tab = TabController.Instance.GetTabByName(_aboutUsPageName, PortalId); + this.CreateTab(_aboutUsPageName); + tab = TabController.Instance.GetTabByName(_aboutUsPageName, this.PortalId); } - _tabId = tab.TabID; + this._tabId = tab.TabID; //Add Portal Aliases var aliasController = PortalAliasController.Instance; TestUtil.ReadStream(String.Format("{0}", "Aliases"), (line, header) => { string[] fields = line.Split(','); - var alias = aliasController.GetPortalAlias(fields[0], PortalId); + var alias = aliasController.GetPortalAlias(fields[0], this.PortalId); if (alias == null) { alias = new PortalAliasInfo { HTTPAlias = fields[0], - PortalID = PortalId + PortalID = this.PortalId }; PortalAliasController.Instance.AddPortalAlias(alias); } @@ -81,7 +81,7 @@ public override void TestFixtureSetUp() { string[] fields = line.Split(','); - TestUtil.AddUser(PortalId, fields[0].Trim(), fields[1].Trim(), fields[2].Trim()); + TestUtil.AddUser(this.PortalId, fields[0].Trim(), fields[1].Trim(), fields[2].Trim()); }); } @@ -90,24 +90,24 @@ public override void TearDown() { base.TearDown(); - UpdateTabName(_tabId, "About Us"); + this.UpdateTabName(this._tabId, "About Us"); - if (_customLocale != null) + if (this._customLocale != null) { - Localization.RemoveLanguageFromPortals(_customLocale.LanguageId, true); - Localization.DeleteLanguage(_customLocale, true); + Localization.RemoveLanguageFromPortals(this._customLocale.LanguageId, true); + Localization.DeleteLanguage(this._customLocale, true); } - if (_primaryAlias != null) + if (this._primaryAlias != null) { - PortalAliasController.Instance.DeletePortalAlias(_primaryAlias); + PortalAliasController.Instance.DeletePortalAlias(this._primaryAlias); } - SetDefaultAlias(DefaultAlias); - PortalController.UpdatePortalSetting(PortalId, "PortalAliasMapping", _redirectMode); + this.SetDefaultAlias(this.DefaultAlias); + PortalController.UpdatePortalSetting(this.PortalId, "PortalAliasMapping", this._redirectMode); - foreach (var tabUrl in CBO.FillCollection(DataProvider.Instance().GetTabUrls(PortalId))) + foreach (var tabUrl in CBO.FillCollection(DataProvider.Instance().GetTabUrls(this.PortalId))) { - TabController.Instance.DeleteTabUrl(tabUrl, PortalId, true); + TabController.Instance.DeleteTabUrl(tabUrl, this.PortalId, true); } } @@ -120,14 +120,14 @@ public override void TestFixtureTearDown() TestUtil.ReadStream(String.Format("{0}", "Aliases"), (line, header) => { string[] fields = line.Split(','); - var alias = aliasController.GetPortalAlias(fields[0], PortalId); + var alias = aliasController.GetPortalAlias(fields[0], this.PortalId); PortalAliasController.Instance.DeletePortalAlias(alias); }); TestUtil.ReadStream(String.Format("{0}", "Users"), (line, header) => { string[] fields = line.Split(','); - TestUtil.DeleteUser(PortalId, fields[0]); + TestUtil.DeleteUser(this.PortalId, fields[0]); }); } @@ -137,21 +137,21 @@ public override void TestFixtureTearDown() private void ExecuteTest(string test, Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], this.PortalId); - SetDefaultAlias(testFields); + this.SetDefaultAlias(testFields); - ExecuteTest(test, settings, testFields); + this.ExecuteTest(test, settings, testFields); } private void ExecuteTest(string test, FriendlyUrlSettings settings, Dictionary testFields) { var tabName = testFields["Page Name"]; - var tab = TabController.Instance.GetTabByName(tabName, PortalId); + var tab = TabController.Instance.GetTabByName(tabName, this.PortalId); if (tab == null) Assert.Fail($"TAB with name [{tabName}] is not found!"); - ExecuteTestForTab(test, tab, settings, testFields); + this.ExecuteTestForTab(test, tab, settings, testFields); } private void ExecuteTestForTab(string test, TabInfo tab, FriendlyUrlSettings settings, Dictionary testFields) @@ -182,7 +182,7 @@ private void ExecuteTestForTab(string test, TabInfo tab, FriendlyUrlSettings set var userName = testFields.GetValue("UserName", String.Empty); if (!String.IsNullOrEmpty(userName)) { - var user = UserController.GetUserByName(PortalId, userName); + var user = UserController.GetUserByName(this.PortalId, userName); if (user != null) { expectedResult = expectedResult.Replace("{userId}", user.UserID.ToString()); @@ -217,7 +217,7 @@ private void ExecuteTestForTab(string test, TabInfo tab, FriendlyUrlSettings set private void UpdateTabName(int tabId, string newName) { - var tab = TabController.Instance.GetTab(tabId, PortalId, false); + var tab = TabController.Instance.GetTab(tabId, this.PortalId, false); tab.TabName = newName; TabController.Instance.UpdateTab(tab); } @@ -230,21 +230,21 @@ private void UpdateTabName(int tabId, string newName) [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_BaseTestCases")] public void AdvancedUrlProvider_BaseFriendlyUrl(Dictionary testFields) { - ExecuteTest("Base", testFields); + this.ExecuteTest("Base", testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_ImprovedTestCases")] public void AdvancedUrlProvider_ImprovedFriendlyUrl(Dictionary testFields) { - ExecuteTest("Improved", testFields); + this.ExecuteTest("Improved", testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_SpaceEncodingTestCases")] public void AdvancedUrlProvider_SpaceEncoding(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "SpaceEncoding", PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "SpaceEncoding", this.PortalId); settings.ReplaceSpaceWith = " "; string spaceEncoding = testFields.GetValue("SpaceEncoding"); @@ -254,14 +254,14 @@ public void AdvancedUrlProvider_SpaceEncoding(Dictionary testFie settings.SpaceEncodingValue = spaceEncoding; } - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_PageExtensionTestCases")] public void AdvancedUrlProvider_PageExtension(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "PageExtension", PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "PageExtension", this.PortalId); string pageExtensionUsageType = testFields.GetValue("PageExtensionUsageType"); string pageExtension = testFields.GetValue("PageExtension"); @@ -283,7 +283,7 @@ public void AdvancedUrlProvider_PageExtension(Dictionary testFie break; } - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } [Test] @@ -293,41 +293,41 @@ public void AdvancedUrlProvider_PrimaryPortalAlias(Dictionary te string defaultAlias = testFields["DefaultAlias"]; string redirectMode = testFields["RedirectMode"]; - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "PrimaryPortalAlias", PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", "PrimaryPortalAlias", this.PortalId); string language = testFields["Language"].Trim(); if (!String.IsNullOrEmpty(language)) { - _customLocale = new Locale { Code = language, Fallback = "en-US" }; - _customLocale.Text = CultureInfo.GetCultureInfo(_customLocale.Code).NativeName; - Localization.SaveLanguage(_customLocale); - Localization.AddLanguageToPortals(_customLocale.LanguageId); + this._customLocale = new Locale { Code = language, Fallback = "en-US" }; + this._customLocale.Text = CultureInfo.GetCultureInfo(this._customLocale.Code).NativeName; + Localization.SaveLanguage(this._customLocale); + Localization.AddLanguageToPortals(this._customLocale.LanguageId); //add new primary alias - _primaryAlias = new PortalAliasInfo + this._primaryAlias = new PortalAliasInfo { - PortalID = PortalId, + PortalID = this.PortalId, HTTPAlias = defaultAlias, CultureCode = language, IsPrimary = true }; - _primaryAlias.PortalAliasID = PortalAliasController.Instance.AddPortalAlias(_primaryAlias); + this._primaryAlias.PortalAliasID = PortalAliasController.Instance.AddPortalAlias(this._primaryAlias); } else { - SetDefaultAlias(defaultAlias); + this.SetDefaultAlias(defaultAlias); } - PortalController.UpdatePortalSetting(PortalId, "PortalAliasMapping", redirectMode); + PortalController.UpdatePortalSetting(this.PortalId, "PortalAliasMapping", redirectMode); - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_RegexTestCases")] public void AdvancedUrlProvider_Regex(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], this.PortalId); string regexSetting = testFields["Setting"]; string regexValue = testFields["Value"]; @@ -368,21 +368,21 @@ public void AdvancedUrlProvider_Regex(Dictionary testFields) } } - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_ReplaceCharsTestCases")] public void AdvancedUrlProvider_ReplaceChars(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], this.PortalId); string testPageName = testFields.GetValue("TestPageName"); TabInfo tab = null; if (!String.IsNullOrEmpty(testPageName)) { var tabName = testFields["Page Name"]; - tab = TabController.Instance.GetTabByName(tabName, PortalId); + tab = TabController.Instance.GetTabByName(tabName, this.PortalId); tab.TabName = testPageName; TabController.Instance.UpdateTab(tab); @@ -399,14 +399,14 @@ public void AdvancedUrlProvider_ReplaceChars(Dictionary testFiel TestUtil.GetReplaceCharDictionary(testFields, settings.ReplaceCharacterDictionary); - ExecuteTestForTab("Improved", tab, settings, testFields); + this.ExecuteTestForTab("Improved", tab, settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_ReplaceSpaceTestCases")] public void AdvancedUrlProvider_ReplaceSpace(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], this.PortalId); string replaceSpaceWith = testFields.GetValue("ReplaceSpaceWith"); if (!String.IsNullOrEmpty(replaceSpaceWith)) @@ -414,14 +414,14 @@ public void AdvancedUrlProvider_ReplaceSpace(Dictionary testFiel settings.ReplaceSpaceWith = replaceSpaceWith; } - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_VanityUrlTestCases")] public void AdvancedUrlProvider_VanityUrl(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], this.PortalId); var vanityUrl = testFields.GetValue("VanityUrl", String.Empty); var userName = testFields.GetValue("UserName", String.Empty); @@ -433,21 +433,21 @@ public void AdvancedUrlProvider_VanityUrl(Dictionary testFields) if (!String.IsNullOrEmpty(userName)) { - var user = UserController.GetUserByName(PortalId, userName); + var user = UserController.GetUserByName(this.PortalId, userName); if (user != null) { user.VanityUrl = vanityUrl; - UserController.UpdateUser(PortalId, user); + UserController.UpdateUser(this.PortalId, user); } } - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "FriendlyUrl_ForceLowerCaseTestCases")] public void AdvancedUrlProvider_ForceLowerCase(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("FriendlyUrl", testFields["TestName"], this.PortalId); string forceLowerCaseRegex = testFields.GetValue("ForceLowerCaseRegex"); @@ -456,7 +456,7 @@ public void AdvancedUrlProvider_ForceLowerCase(Dictionary testFi settings.ForceLowerCaseRegex = forceLowerCaseRegex; } - ExecuteTest("Improved", settings, testFields); + this.ExecuteTest("Improved", settings, testFields); } #endregion diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlRewriteTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlRewriteTests.cs index 37f2b5af109..190dff17074 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlRewriteTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlRewriteTests.cs @@ -44,7 +44,7 @@ public UrlRewriteTests() : base(0) { } private void CreateSimulatedRequest(Uri url) { - var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator("/", WebsitePhysicalAppPath); + var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator("/", this.WebsitePhysicalAppPath); simulator.SimulateRequest(url); var browserCaps = new HttpBrowserCapabilities { Capabilities = new Hashtable() }; @@ -75,7 +75,7 @@ private string ReplaceTokens(Dictionary testFields, string url, string userId = String.Empty; if (!String.IsNullOrEmpty(userName)) { - var user = UserController.GetUserByName(PortalId, userName); + var user = UserController.GetUserByName(this.PortalId, userName); if (user != null) { userId = user.UserID.ToString(); @@ -86,7 +86,7 @@ private string ReplaceTokens(Dictionary testFields, string url, .Replace("{usealias}", defaultAlias) .Replace("{tabName}", tabName) .Replace("{tabId}", tabId) - .Replace("{portalId}", PortalId.ToString()) + .Replace("{portalId}", this.PortalId.ToString()) .Replace("{vanityUrl}", vanityUrl) .Replace("{userId}", userId) .Replace("{defaultPage}", _defaultPage); @@ -101,17 +101,17 @@ public override void SetUp() { base.SetUp(); - DeleteTab(_testPage); - CreateTab(_testPage); - UpdateTabName(_tabId, "About Us"); - UpdateTabSkin(_tabId, ""); + this.DeleteTab(_testPage); + this.CreateTab(_testPage); + this.UpdateTabName(this._tabId, "About Us"); + this.UpdateTabSkin(this._tabId, ""); CacheController.FlushPageIndexFromCache(); - GetDefaultAlias(); - _redirectMode = PortalController.GetPortalSetting("PortalAliasMapping", PortalId, "CANONICALURL"); - _sslEnforced = PortalController.GetPortalSettingAsBoolean("SSLEnforced", PortalId, false); - _sslEnabled = PortalController.GetPortalSettingAsBoolean("SSLEnabled", PortalId, false); - _primaryAlias = null; - _customLocale = null; + this.GetDefaultAlias(); + this._redirectMode = PortalController.GetPortalSetting("PortalAliasMapping", this.PortalId, "CANONICALURL"); + this._sslEnforced = PortalController.GetPortalSettingAsBoolean("SSLEnforced", this.PortalId, false); + this._sslEnabled = PortalController.GetPortalSettingAsBoolean("SSLEnabled", this.PortalId, false); + this._primaryAlias = null; + this._customLocale = null; DataCache.ClearCache(); } @@ -120,39 +120,39 @@ public override void TearDown() { base.TearDown(); - DeleteTab(_testPage); - UpdateTabName(_tabId, "About Us"); - UpdateTabSkin(_tabId, "[G]Skins/Xcillion/Inner.ascx"); + this.DeleteTab(_testPage); + this.UpdateTabName(this._tabId, "About Us"); + this.UpdateTabSkin(this._tabId, "[G]Skins/Xcillion/Inner.ascx"); - if (!String.IsNullOrEmpty(_securePageName)) + if (!String.IsNullOrEmpty(this._securePageName)) { - var tab = TabController.Instance.GetTabByName(_securePageName, PortalId); + var tab = TabController.Instance.GetTabByName(this._securePageName, this.PortalId); if (tab != null) { tab.IsSecure = false; - UpdateTab(tab); + this.UpdateTab(tab); } } - if (_customLocale != null) + if (this._customLocale != null) { - Localization.RemoveLanguageFromPortals(_customLocale.LanguageId, true); - Localization.DeleteLanguage(_customLocale, true); + Localization.RemoveLanguageFromPortals(this._customLocale.LanguageId, true); + Localization.DeleteLanguage(this._customLocale, true); } - if (_primaryAlias != null) + if (this._primaryAlias != null) { - PortalAliasController.Instance.DeletePortalAlias(_primaryAlias); + PortalAliasController.Instance.DeletePortalAlias(this._primaryAlias); } - SetDefaultAlias(DefaultAlias); - PortalController.UpdatePortalSetting(PortalId, "PortalAliasMapping", _redirectMode, true, "en-us"); - PortalController.UpdatePortalSetting(PortalId, "SSLEnforced", _sslEnforced.ToString(), true, "en-us"); - PortalController.UpdatePortalSetting(PortalId, "SSLEnabled", _sslEnabled.ToString(), true, "en-us"); + this.SetDefaultAlias(this.DefaultAlias); + PortalController.UpdatePortalSetting(this.PortalId, "PortalAliasMapping", this._redirectMode, true, "en-us"); + PortalController.UpdatePortalSetting(this.PortalId, "SSLEnforced", this._sslEnforced.ToString(), true, "en-us"); + PortalController.UpdatePortalSetting(this.PortalId, "SSLEnabled", this._sslEnabled.ToString(), true, "en-us"); - foreach (var tabUrl in CBO.FillCollection(DataProvider.Instance().GetTabUrls(PortalId))) + foreach (var tabUrl in CBO.FillCollection(DataProvider.Instance().GetTabUrls(this.PortalId))) { - TabController.Instance.DeleteTabUrl(tabUrl, PortalId, true); + TabController.Instance.DeleteTabUrl(tabUrl, this.PortalId, true); } } @@ -162,26 +162,26 @@ public override void TestFixtureSetUp() { base.TestFixtureSetUp(); - var tab = TabController.Instance.GetTabByName(_aboutUsPageName, PortalId); + var tab = TabController.Instance.GetTabByName(_aboutUsPageName, this.PortalId); if (tab == null) { - CreateTab(_aboutUsPageName); - tab = TabController.Instance.GetTabByName(_aboutUsPageName, PortalId); + this.CreateTab(_aboutUsPageName); + tab = TabController.Instance.GetTabByName(_aboutUsPageName, this.PortalId); } - _tabId = tab.TabID; + this._tabId = tab.TabID; //Add Portal Aliases var aliasController = PortalAliasController.Instance; TestUtil.ReadStream(String.Format("{0}", "Aliases"), (line, header) => { string[] fields = line.Split(','); - var alias = aliasController.GetPortalAlias(fields[0], PortalId); + var alias = aliasController.GetPortalAlias(fields[0], this.PortalId); if (alias == null) { alias = new PortalAliasInfo { HTTPAlias = fields[0], - PortalID = PortalId + PortalID = this.PortalId }; PortalAliasController.Instance.AddPortalAlias(alias); } @@ -190,7 +190,7 @@ public override void TestFixtureSetUp() { string[] fields = line.Split(','); - TestUtil.AddUser(PortalId, fields[0].Trim(), fields[1].Trim(), fields[2].Trim()); + TestUtil.AddUser(this.PortalId, fields[0].Trim(), fields[1].Trim(), fields[2].Trim()); }); } @@ -203,14 +203,14 @@ public override void TestFixtureTearDown() TestUtil.ReadStream(String.Format("{0}", "Aliases"), (line, header) => { string[] fields = line.Split(','); - var alias = aliasController.GetPortalAlias(fields[0], PortalId); + var alias = aliasController.GetPortalAlias(fields[0], this.PortalId); PortalAliasController.Instance.DeletePortalAlias(alias); }); TestUtil.ReadStream(String.Format("{0}", "Users"), (line, header) => { string[] fields = line.Split(','); - TestUtil.DeleteUser(PortalId, fields[0]); + TestUtil.DeleteUser(this.PortalId, fields[0]); }); } @@ -221,11 +221,11 @@ public override void TestFixtureTearDown() private void DeleteTab(string tabName) { - var tab = TabController.Instance.GetTabByName(tabName, PortalId); + var tab = TabController.Instance.GetTabByName(tabName, this.PortalId); if (tab != null) { - TabController.Instance.DeleteTab(tab.TabID, PortalId); + TabController.Instance.DeleteTab(tab.TabID, this.PortalId); } } @@ -241,11 +241,11 @@ private void ExecuteTestForTab(TabInfo tab, FriendlyUrlSettings settings, Dictio var tabID = (tab == null) ? "-1" : tab.TabID.ToString(); - var expectedResult = ReplaceTokens(testFields, result, tabID); - var testurl = ReplaceTokens(testFields, url, tabID); - var expectedRedirectUrl = ReplaceTokens(testFields, redirectUrl, tabID); + var expectedResult = this.ReplaceTokens(testFields, result, tabID); + var testurl = this.ReplaceTokens(testFields, url, tabID); + var expectedRedirectUrl = this.ReplaceTokens(testFields, redirectUrl, tabID); - CreateSimulatedRequest(new Uri(testurl)); + this.CreateSimulatedRequest(new Uri(testurl)); var request = HttpContext.Current.Request; var testHelper = new UrlTestHelper @@ -260,7 +260,7 @@ private void ExecuteTestForTab(TabInfo tab, FriendlyUrlSettings settings, Dictio QueryStringCol = new NameValueCollection() }; - ProcessRequest(settings, testHelper); + this.ProcessRequest(settings, testHelper); //Test expected response status Assert.AreEqual(expectedStatus, testHelper.Response.StatusCode); @@ -286,14 +286,14 @@ private void ExecuteTestForTab(TabInfo tab, FriendlyUrlSettings settings, Dictio private void ExecuteTest(FriendlyUrlSettings settings, Dictionary testFields, bool setDefaultAlias) { var tabName = testFields["Page Name"]; - var tab = TabController.Instance.GetTabByName(tabName, PortalId); + var tab = TabController.Instance.GetTabByName(tabName, this.PortalId); if (setDefaultAlias) { - SetDefaultAlias(testFields); + this.SetDefaultAlias(testFields); } - ExecuteTestForTab(tab, settings, testFields); + this.ExecuteTestForTab(tab, settings, testFields); } private void UpdateTab(TabInfo tab) @@ -307,14 +307,14 @@ private void UpdateTab(TabInfo tab) private void UpdateTabName(int tabId, string newName) { - var tab = TabController.Instance.GetTab(tabId, PortalId, false); + var tab = TabController.Instance.GetTab(tabId, this.PortalId, false); tab.TabName = newName; TabController.Instance.UpdateTab(tab); } private void UpdateTabSkin(int tabId, string newSkin) { - var tab = TabController.Instance.GetTab(tabId, PortalId, false); + var tab = TabController.Instance.GetTab(tabId, this.PortalId, false); tab.SkinSrc = newSkin; TabController.Instance.UpdateTab(tab); } @@ -327,21 +327,21 @@ private void UpdateTabSkin(int tabId, string newSkin) [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_BasicTestCases")] public void AdvancedUrlRewriter_BasicTest(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_DeletedTabHandlingTestCases")] public void AdvancedUrlRewriter_DeletedTabHandling(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); - var tab = TabController.Instance.GetTabByName(_testPage, PortalId); + var tab = TabController.Instance.GetTabByName(_testPage, this.PortalId); if (Convert.ToBoolean(testFields["HardDeleted"])) { - DeleteTab(_testPage); + this.DeleteTab(_testPage); CacheController.FlushPageIndexFromCache(); } else @@ -352,7 +352,7 @@ public void AdvancedUrlRewriter_DeletedTabHandling(Dictionary te { tab.EndDate = DateTime.Now - TimeSpan.FromDays(1); } - UpdateTab(tab); + this.UpdateTab(tab); CacheController.FlushPageIndexFromCache(); } @@ -371,9 +371,9 @@ public void AdvancedUrlRewriter_DeletedTabHandling(Dictionary te } } - SetDefaultAlias(testFields); + this.SetDefaultAlias(testFields); - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] @@ -383,34 +383,34 @@ public void AdvancedUrlRewriter_DoNotRedirect(Dictionary testFie var tabName = testFields["Page Name"]; var doNotRedirect = testFields["DoNotRedirect"]; - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); - UpdateTabSetting(tabName, "DoNotRedirect", doNotRedirect); + this.UpdateTabSetting(tabName, "DoNotRedirect", doNotRedirect); settings.UseBaseFriendlyUrls = testFields["UseBaseFriendlyUrls"]; - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); - UpdateTabSetting(tabName, "DoNotRedirect", "False"); + this.UpdateTabSetting(tabName, "DoNotRedirect", "False"); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_ForwardExternalUrlTestCases")] public void AdvancedUrlRewriter_ForwardExternalUrls(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); - var tab = TabController.Instance.GetTabByName(_testPage, PortalId); + var tab = TabController.Instance.GetTabByName(_testPage, this.PortalId); tab.Url = testFields["ExternalUrl"]; TabController.Instance.UpdateTab(tab); - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_ForceLowerCaseTestCases")] public void AdvancedUrlRewriter_ForceLowerCase(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); string forceLowerCaseRegex = testFields.GetValue("ForceLowerCaseRegex"); @@ -419,14 +419,14 @@ public void AdvancedUrlRewriter_ForceLowerCase(Dictionary testFi settings.ForceLowerCaseRegex = forceLowerCaseRegex; } - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_RegexTestCases")] public void AdvancedUrlRewriter_Regex(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); string regexSetting = testFields["Setting"]; string regexValue = testFields["Value"]; @@ -467,21 +467,21 @@ public void AdvancedUrlRewriter_Regex(Dictionary testFields) } } - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_ReplaceCharsTestCases")] public void AdvancedUrlRewriter_ReplaceChars(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); string testPageName = testFields.GetValue("TestPageName"); TabInfo tab = null; if (!String.IsNullOrEmpty(testPageName)) { var tabName = testFields["Page Name"]; - tab = TabController.Instance.GetTabByName(tabName, PortalId); + tab = TabController.Instance.GetTabByName(tabName, this.PortalId); tab.TabName = testPageName; TabController.Instance.UpdateTab(tab); @@ -498,16 +498,16 @@ public void AdvancedUrlRewriter_ReplaceChars(Dictionary testFiel TestUtil.GetReplaceCharDictionary(testFields, settings.ReplaceCharacterDictionary); - SetDefaultAlias(testFields); + this.SetDefaultAlias(testFields); - ExecuteTestForTab(tab, settings, testFields); + this.ExecuteTestForTab(tab, settings, testFields); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_ReplaceSpaceTestCases")] public void AdvancedUrlRewriter_ReplaceSpace(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); string replaceSpaceWith = testFields.GetValue("ReplaceSpaceWith"); if (!String.IsNullOrEmpty(replaceSpaceWith)) @@ -515,24 +515,24 @@ public void AdvancedUrlRewriter_ReplaceSpace(Dictionary testFiel settings.ReplaceSpaceWith = replaceSpaceWith; } - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_SiteRootRedirectTestCases")] public void AdvancedUrlRewriter_SiteRootRedirect(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", "SiteRootRedirect", PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", "SiteRootRedirect", this.PortalId); string scheme = testFields["Scheme"]; - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); if (testFields["TestName"].Contains("Resubmit")) { var httpAlias = testFields["Alias"]; settings.DoNotRedirectRegex = scheme + httpAlias; - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } } @@ -542,16 +542,16 @@ public void AdvancedUrlRewriter_0_PrimaryPortalAlias(Dictionary { string defaultAlias = testFields["DefaultAlias"]; - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); string language = testFields["Language"].Trim(); string skin = testFields["Skin"].Trim(); if (!String.IsNullOrEmpty(language)) { - _customLocale = new Locale { Code = language, Fallback = "en-US" }; - _customLocale.Text = CultureInfo.GetCultureInfo(_customLocale.Code).NativeName; - Localization.SaveLanguage(_customLocale); - Localization.AddLanguageToPortals(_customLocale.LanguageId); + this._customLocale = new Locale { Code = language, Fallback = "en-US" }; + this._customLocale.Text = CultureInfo.GetCultureInfo(this._customLocale.Code).NativeName; + Localization.SaveLanguage(this._customLocale); + Localization.AddLanguageToPortals(this._customLocale.LanguageId); } @@ -560,14 +560,14 @@ public void AdvancedUrlRewriter_0_PrimaryPortalAlias(Dictionary testFields["Final Url"] = testFields["Final Url"].Replace("{useAlias}", defaultAlias); } - PortalController.UpdatePortalSetting(PortalId, "PortalAliasMapping", "REDIRECT", true, "en-us"); - var alias = PortalAliasController.Instance.GetPortalAlias(defaultAlias, PortalId); + PortalController.UpdatePortalSetting(this.PortalId, "PortalAliasMapping", "REDIRECT", true, "en-us"); + var alias = PortalAliasController.Instance.GetPortalAlias(defaultAlias, this.PortalId); if (alias == null) { alias = new PortalAliasInfo { HTTPAlias = defaultAlias, - PortalID = PortalId, + PortalID = this.PortalId, IsPrimary = true }; if (!(String.IsNullOrEmpty(language) && String.IsNullOrEmpty(skin))) @@ -577,11 +577,11 @@ public void AdvancedUrlRewriter_0_PrimaryPortalAlias(Dictionary } PortalAliasController.Instance.AddPortalAlias(alias); } - SetDefaultAlias(defaultAlias); - ExecuteTest(settings, testFields, false); + this.SetDefaultAlias(defaultAlias); + this.ExecuteTest(settings, testFields, false); - alias = PortalAliasController.Instance.GetPortalAlias(defaultAlias, PortalId); + alias = PortalAliasController.Instance.GetPortalAlias(defaultAlias, this.PortalId); if (alias != null) { PortalAliasController.Instance.DeletePortalAlias(alias); @@ -592,7 +592,7 @@ public void AdvancedUrlRewriter_0_PrimaryPortalAlias(Dictionary [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_VanityUrlTestCases")] public void AdvancedUrlRewriter_VanityUrl(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); settings.DeletedTabHandlingType = DeletedTabHandlingType.Do301RedirectToPortalHome; var vanityUrl = testFields.GetValue("VanityUrl", String.Empty); @@ -601,11 +601,11 @@ public void AdvancedUrlRewriter_VanityUrl(Dictionary testFields) if (!String.IsNullOrEmpty(userName)) { - var user = UserController.GetUserByName(PortalId, userName); + var user = UserController.GetUserByName(this.PortalId, userName); if (user != null) { user.VanityUrl = vanityUrl; - UserController.UpdateUser(PortalId, user); + UserController.UpdateUser(this.PortalId, user); } } @@ -613,34 +613,34 @@ public void AdvancedUrlRewriter_VanityUrl(Dictionary testFields) { settings.RedirectOldProfileUrl = Convert.ToBoolean(redirectOld); } - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] [TestCaseSource(typeof(UrlTestFactoryClass), "UrlRewrite_SecureRedirectTestCases")] public void AdvancedUrlRewriter_SecureRedirect(Dictionary testFields) { - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", testFields["TestName"], this.PortalId); var isClient = Convert.ToBoolean(testFields["Client"]); - _securePageName = testFields["Page Name"].Trim(); + this._securePageName = testFields["Page Name"].Trim(); - PortalController.UpdatePortalSetting(PortalId, "SSLEnforced", testFields["Enforced"].Trim(), true, "en-us"); - PortalController.UpdatePortalSetting(PortalId, "SSLEnabled", testFields["Enabled"].Trim(), true, "en-us"); + PortalController.UpdatePortalSetting(this.PortalId, "SSLEnforced", testFields["Enforced"].Trim(), true, "en-us"); + PortalController.UpdatePortalSetting(this.PortalId, "SSLEnabled", testFields["Enabled"].Trim(), true, "en-us"); var isSecure = Convert.ToBoolean(testFields["IsSecure"].Trim()); if (isSecure) { - var tab = TabController.Instance.GetTabByName(_securePageName, PortalId); + var tab = TabController.Instance.GetTabByName(this._securePageName, this.PortalId); tab.IsSecure = true; - UpdateTab(tab); + this.UpdateTab(tab); } settings.SSLClientRedirect = isClient; - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); } [Test] @@ -649,7 +649,7 @@ public void AdvancedUrlRewriter_JiraTests(Dictionary testFields) { var testName = testFields.GetValue("Test File", String.Empty); - var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", "Jira_Tests", testName + ".csv", PortalId); + var settings = UrlTestFactoryClass.GetSettings("UrlRewrite", "Jira_Tests", testName + ".csv", this.PortalId); var dictionary = UrlTestFactoryClass.GetDictionary("UrlRewrite", "Jira_Tests", testName + "_dic.csv"); int homeTabId = -1; @@ -658,25 +658,25 @@ public void AdvancedUrlRewriter_JiraTests(Dictionary testFields) switch (keyValuePair.Key) { case "HomeTabId": - homeTabId = UpdateHomeTab(Int32.Parse(keyValuePair.Value)); + homeTabId = this.UpdateHomeTab(Int32.Parse(keyValuePair.Value)); break; default: break; } } - ExecuteTest(settings, testFields, true); + this.ExecuteTest(settings, testFields, true); if (homeTabId != -1) { - UpdateHomeTab(homeTabId); + this.UpdateHomeTab(homeTabId); } } private int UpdateHomeTab(int homeTabId) { - var portalInfo = PortalController.Instance.GetPortal(PortalId); + var portalInfo = PortalController.Instance.GetPortal(this.PortalId); int oldHomeTabId = portalInfo.HomeTabId; portalInfo.HomeTabId = homeTabId; @@ -685,7 +685,7 @@ private int UpdateHomeTab(int homeTabId) private void UpdateTabSetting(string tabName, string settingName, string settingValue) { - var tab = TabController.Instance.GetTabByName(tabName, PortalId); + var tab = TabController.Instance.GetTabByName(tabName, this.PortalId); tab.TabSettings[settingName] = settingValue; TabController.Instance.UpdateTab(tab); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlTestBase.cs b/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlTestBase.cs index b679e4a8381..46d4ab81ecd 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlTestBase.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Urls/UrlTestBase.cs @@ -29,29 +29,29 @@ public UrlTestBase(int portalId) : base(portalId) public virtual void SetUp() { - ExecuteScriptFile(String.Format("{0}\\{1}\\{2}", TestType, GetTestFolder(), "SetUp.sql")); + this.ExecuteScriptFile(String.Format("{0}\\{1}\\{2}", this.TestType, this.GetTestFolder(), "SetUp.sql")); } public virtual void TestFixtureSetUp() { - ExecuteScriptFile(String.Format("{0}\\{1}", TestType, "SetUp.sql")); + this.ExecuteScriptFile(String.Format("{0}\\{1}", this.TestType, "SetUp.sql")); } public virtual void TearDown() { - ExecuteScriptFile(String.Format("{0}\\{1}\\{2}", TestType, GetTestFolder(), "TearDown.sql")); + this.ExecuteScriptFile(String.Format("{0}\\{1}\\{2}", this.TestType, this.GetTestFolder(), "TearDown.sql")); } public virtual void TestFixtureTearDown() { - ExecuteScriptFile(String.Format("{0}\\{1}", TestType, "TearDown.sql")); + this.ExecuteScriptFile(String.Format("{0}\\{1}", this.TestType, "TearDown.sql")); } #endregion protected void CreateTab(string tabName) { - var tab = new TabInfo { PortalID = PortalId, TabName = tabName }; + var tab = new TabInfo { PortalID = this.PortalId, TabName = tabName }; TabController.Instance.AddTab(tab); } @@ -74,11 +74,11 @@ private string GetTestFolder() protected void GetDefaultAlias() { - foreach (var alias in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalId)) + foreach (var alias in PortalAliasController.Instance.GetPortalAliasesByPortalId(this.PortalId)) { if (alias.IsPrimary) { - DefaultAlias = alias.HTTPAlias; + this.DefaultAlias = alias.HTTPAlias; break; } } @@ -86,12 +86,12 @@ protected void GetDefaultAlias() protected void SetDefaultAlias(Dictionary testFields) { - SetDefaultAlias(testFields["Alias"]); + this.SetDefaultAlias(testFields["Alias"]); } protected void SetDefaultAlias(string defaultAlias) { - foreach (var alias in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalId)) + foreach (var alias in PortalAliasController.Instance.GetPortalAliasesByPortalId(this.PortalId)) { if (string.Equals(alias.HTTPAlias, defaultAlias, StringComparison.InvariantCultureIgnoreCase)) { diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Urls/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Urls/packages.config index 5d90198d8bc..2b03ba86c18 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Urls/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Urls/packages.config @@ -1,5 +1,6 @@ - - - - + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnUnitTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnUnitTest.cs index 470cd9d710d..10d16c63fc6 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnUnitTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnUnitTest.cs @@ -16,10 +16,10 @@ public DnnUnitTest() var uri = new System.Uri(Assembly.GetExecutingAssembly().CodeBase); string path = HttpUtility.UrlDecode(Path.GetFullPath(uri.AbsolutePath)); - WebsiteAppPath = "http://localhost/DNN_Platform"; + this.WebsiteAppPath = "http://localhost/DNN_Platform"; var websiteRootPath = path.Substring(0, path.IndexOf("DNN Platform", System.StringComparison.Ordinal)); - WebsitePhysicalAppPath = Path.Combine(websiteRootPath, "Website"); - HighlightDataPath = Path.Combine(websiteRootPath, "DNN Platform//Modules//PreviewProfileManagement//Resources//highlightDevices.xml"); + this.WebsitePhysicalAppPath = Path.Combine(websiteRootPath, "Website"); + this.HighlightDataPath = Path.Combine(websiteRootPath, "DNN Platform//Modules//PreviewProfileManagement//Resources//highlightDevices.xml"); } public string HighlightDataPath { get; set; } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnWebTest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnWebTest.cs index 8ed5b1199f4..31ed49e204f 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnWebTest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DnnWebTest.cs @@ -43,8 +43,8 @@ public class DnnWebTest : DnnUnitTest public DnnWebTest(int portalId) { - var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator("/", WebsitePhysicalAppPath); - simulator.SimulateRequest(new Uri(WebsiteAppPath)); + var simulator = new Instance.Utilities.HttpSimulator.HttpSimulator("/", this.WebsitePhysicalAppPath); + simulator.SimulateRequest(new Uri(this.WebsiteAppPath)); InstallComponents(); @@ -54,7 +54,7 @@ public DnnWebTest(int portalId) LoadDnnProviders("data;logging;caching;authentication;members;roles;profiles;permissions;folder;clientcapability"); //fix Globals.ApplicationMapPath - var appPath = WebsitePhysicalAppPath; + var appPath = this.WebsitePhysicalAppPath; if (!string.IsNullOrEmpty(appPath)) { var mappath = typeof(Globals).GetField("_applicationMapPath", BindingFlags.Static | BindingFlags.NonPublic); @@ -73,7 +73,7 @@ public DnnWebTest(int portalId) var ps = new Entities.Portals.PortalSettings(59, objPortalAliasInfo); HttpContext.Current.Items.Add("PortalSettings", ps); - PortalId = portalId; + this.PortalId = portalId; } private static void InstallComponents() diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DotNetNuke.Tests.Utilities.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DotNetNuke.Tests.Utilities.csproj index 1458b6cbf6b..0f38dc99d65 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DotNetNuke.Tests.Utilities.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/DotNetNuke.Tests.Utilities.csproj @@ -1,139 +1,146 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {68368906-57DD-40D1-AC10-35211A17D617} - Library - Properties - DotNetNuke.Tests.Utilities - DotNetNuke.Tests.Utilities - v4.7.2 - 512 - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - 1591 - 7 - - - - ..\..\..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll - - - False - ..\..\..\..\..\Windows\System32\inetsrv\Microsoft.Web.Administration.dll - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - ..\..\..\packages\System.Management.Automation.6.1.7601.17515\lib\net45\System.Management.Automation.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - Code - - - - - - - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {68368906-57DD-40D1-AC10-35211A17D617} + Library + Properties + DotNetNuke.Tests.Utilities + DotNetNuke.Tests.Utilities + v4.7.2 + 512 + + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + 1591 + 7 + + + + ..\..\..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll + + + False + ..\..\..\..\..\Windows\System32\inetsrv\Microsoft.Web.Administration.dll + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + ..\..\..\packages\System.Management.Automation.6.1.7601.17515\lib\net45\System.Management.Automation.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + + + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + + + + + + stylecop.json + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/Fakes/FakeCachingProvider.cs b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/Fakes/FakeCachingProvider.cs index 1c4531fd8bc..d4599c7d448 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/Fakes/FakeCachingProvider.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/Fakes/FakeCachingProvider.cs @@ -17,18 +17,18 @@ public class FakeCachingProvider : CachingProvider public FakeCachingProvider(Dictionary dictionary) { - _dictionary = dictionary; + this._dictionary = dictionary; } public override void Insert(string cacheKey, object itemToCache, DNNCacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback) { - _dictionary[cacheKey] = itemToCache; + this._dictionary[cacheKey] = itemToCache; } public override object GetItem(string cacheKey) { - return _dictionary.ContainsKey(cacheKey) ? _dictionary[cacheKey] : null; + return this._dictionary.ContainsKey(cacheKey) ? this._dictionary[cacheKey] : null; } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/HttpSimulator.cs b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/HttpSimulator.cs index 328b0071330..abeec79a071 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/HttpSimulator.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/HttpSimulator.cs @@ -49,8 +49,8 @@ public HttpSimulator(string applicationPath) : this(applicationPath, WebsitePhys public HttpSimulator(string applicationPath, string physicalApplicationPath) { - ApplicationPath = applicationPath; - PhysicalApplicationPath = physicalApplicationPath; + this.ApplicationPath = applicationPath; + this.PhysicalApplicationPath = physicalApplicationPath; } /// @@ -61,7 +61,7 @@ public HttpSimulator(string applicationPath, string physicalApplicationPath) /// public HttpSimulator SimulateRequest() { - return SimulateRequest(new Uri("http://localhost/")); + return this.SimulateRequest(new Uri("http://localhost/")); } /// @@ -70,7 +70,7 @@ public HttpSimulator SimulateRequest() /// public HttpSimulator SimulateRequest(Uri url) { - return SimulateRequest(url, HttpVerb.GET); + return this.SimulateRequest(url, HttpVerb.GET); } /// @@ -80,7 +80,7 @@ public HttpSimulator SimulateRequest(Uri url) /// public HttpSimulator SimulateRequest(Uri url, HttpVerb httpVerb) { - return SimulateRequest(url, httpVerb, null, null); + return this.SimulateRequest(url, httpVerb, null, null); } /// @@ -90,7 +90,7 @@ public HttpSimulator SimulateRequest(Uri url, HttpVerb httpVerb) /// public HttpSimulator SimulateRequest(Uri url, NameValueCollection formVariables) { - return SimulateRequest(url, HttpVerb.POST, formVariables, null); + return this.SimulateRequest(url, HttpVerb.POST, formVariables, null); } /// @@ -101,7 +101,7 @@ public HttpSimulator SimulateRequest(Uri url, NameValueCollection formVariables) /// public HttpSimulator SimulateRequest(Uri url, NameValueCollection formVariables, NameValueCollection headers) { - return SimulateRequest(url, HttpVerb.POST, formVariables, headers); + return this.SimulateRequest(url, HttpVerb.POST, formVariables, headers); } /// @@ -112,7 +112,7 @@ public HttpSimulator SimulateRequest(Uri url, NameValueCollection formVariables, /// public HttpSimulator SimulateRequest(Uri url, HttpVerb httpVerb, NameValueCollection headers) { - return SimulateRequest(url, httpVerb, null, headers); + return this.SimulateRequest(url, httpVerb, null, headers); } /// @@ -126,36 +126,36 @@ protected virtual HttpSimulator SimulateRequest(Uri url, HttpVerb httpVerb, Name { HttpContext.Current = null; - ParseRequestUrl(url); + this.ParseRequestUrl(url); - if (ResponseWriter == null) + if (this.ResponseWriter == null) { - _builder = new StringBuilder(); - ResponseWriter = new StringWriter(_builder); + this._builder = new StringBuilder(); + this.ResponseWriter = new StringWriter(this._builder); } - SetHttpRuntimeInternals(); + this.SetHttpRuntimeInternals(); var query = ExtractQueryStringPart(url); if (formVariables != null) - _formVars.Add(formVariables); + this._formVars.Add(formVariables); - if (_formVars.Count > 0) + if (this._formVars.Count > 0) httpVerb = HttpVerb.POST; //Need to enforce this. if (headers != null) - _headers.Add(headers); + this._headers.Add(headers); - WorkerRequest = new SimulatedHttpRequest(ApplicationPath, PhysicalApplicationPath, PhysicalPath, Page, query, ResponseWriter, Host, Port, httpVerb.ToString()); + this.WorkerRequest = new SimulatedHttpRequest(this.ApplicationPath, this.PhysicalApplicationPath, this.PhysicalPath, this.Page, query, this.ResponseWriter, this.Host, this.Port, httpVerb.ToString()); - WorkerRequest.Form.Add(_formVars); - WorkerRequest.Headers.Add(_headers); + this.WorkerRequest.Form.Add(this._formVars); + this.WorkerRequest.Headers.Add(this._headers); - if (_referer != null) - WorkerRequest.SetReferer(_referer); + if (this._referer != null) + this.WorkerRequest.SetReferer(this._referer); - InitializeSession(); + this.InitializeSession(); InitializeApplication(); @@ -197,7 +197,7 @@ private static void InitializeApplication() private void InitializeSession() { - HttpContext.Current = new HttpContext(WorkerRequest); + HttpContext.Current = new HttpContext(this.WorkerRequest); HttpContext.Current.Items.Clear(); var session = (HttpSessionState)ReflectionHelper.Instantiate(typeof(HttpSessionState), new[] { typeof(IHttpSessionState) }, new FakeHttpSessionState()); @@ -218,7 +218,7 @@ public class FakeHttpSessionState : NameObjectCollectionBase, IHttpSessionState /// public void Abandon() { - BaseClear(); + this.BaseClear(); } /// @@ -229,7 +229,7 @@ public void Abandon() ///The value of the item to add to the session-state collection. public void Add(string name, object value) { - BaseAdd(name, value); + this.BaseAdd(name, value); } /// @@ -239,7 +239,7 @@ public void Add(string name, object value) ///The name of the item to delete from the session-state item collection. public void Remove(string name) { - BaseRemove(name); + this.BaseRemove(name); } /// @@ -249,7 +249,7 @@ public void Remove(string name) ///The index of the item to remove from the session-state collection. public void RemoveAt(int index) { - BaseRemoveAt(index); + this.BaseRemoveAt(index); } /// @@ -258,7 +258,7 @@ public void RemoveAt(int index) /// public void Clear() { - BaseClear(); + this.BaseClear(); } /// @@ -267,7 +267,7 @@ public void Clear() /// public void RemoveAll() { - BaseClear(); + this.BaseClear(); } /// @@ -291,7 +291,7 @@ public void CopyTo(Array array, int index) /// public string SessionID { - get { return _sessionId; } + get { return this._sessionId; } } /// @@ -304,8 +304,8 @@ public string SessionID /// public int Timeout { - get { return _timeout; } - set { _timeout = value; } + get { return this._timeout; } + set { this._timeout = value; } } /// @@ -390,7 +390,7 @@ public HttpCookieMode CookieMode /// public HttpStaticObjectsCollection StaticObjects { - get { return _staticObjects; } + get { return this._staticObjects; } } /// @@ -404,8 +404,8 @@ public HttpStaticObjectsCollection StaticObjects ///The key name of the session-state item value. public object this[string name] { - get { return BaseGet(name); } - set { BaseSet(name, value); } + get { return this.BaseGet(name); } + set { this.BaseSet(name, value); } } /// @@ -419,8 +419,8 @@ public object this[string name] ///The numerical index of the session-state item value. public object this[int index] { - get { return BaseGet(index); } - set { BaseSet(index, value); } + get { return this.BaseGet(index); } + set { this.BaseSet(index, value); } } /// @@ -433,7 +433,7 @@ public object this[int index] /// public object SyncRoot { - get { return _syncRoot; } + get { return this._syncRoot; } } @@ -474,9 +474,9 @@ bool IHttpSessionState.IsReadOnly /// public HttpSimulator SetReferer(Uri referer) { - if(WorkerRequest != null) - WorkerRequest.SetReferer(referer); - _referer = referer; + if(this.WorkerRequest != null) + this.WorkerRequest.SetReferer(referer); + this._referer = referer; return this; } @@ -488,10 +488,10 @@ public HttpSimulator SetReferer(Uri referer) /// public HttpSimulator SetFormVariable(string name, string value) { - if (WorkerRequest != null) + if (this.WorkerRequest != null) throw new InvalidOperationException("Cannot set form variables after calling Simulate()."); - _formVars.Add(name, value); + this._formVars.Add(name, value); return this; } @@ -504,10 +504,10 @@ public HttpSimulator SetFormVariable(string name, string value) /// public HttpSimulator SetHeader(string name, string value) { - if (WorkerRequest != null) + if (this.WorkerRequest != null) throw new InvalidOperationException("Cannot set headers after calling Simulate()."); - _headers.Add(name, value); + this._headers.Add(name, value); return this; } @@ -516,11 +516,11 @@ private void ParseRequestUrl(Uri url) { if (url == null) return; - Host = url.Host; - Port = url.Port; - LocalPath = url.LocalPath; - Page = StripPrecedingSlashes(RightAfter(url.LocalPath, ApplicationPath)); - _physicalPath = Path.Combine(_physicalApplicationPath, Page.Replace("/", @"\")); + this.Host = url.Host; + this.Port = url.Port; + this.LocalPath = url.LocalPath; + this.Page = StripPrecedingSlashes(RightAfter(url.LocalPath, this.ApplicationPath)); + this._physicalPath = Path.Combine(this._physicalApplicationPath, this.Page.Replace("/", @"\")); } static string RightAfter(string original, string search) @@ -563,11 +563,11 @@ static string RightAfter(string original, string search) /// public string ApplicationPath { - get { return _applicationPath; } + get { return this._applicationPath; } set { - _applicationPath = value ?? "/"; - _applicationPath = NormalizeSlashes(_applicationPath); + this._applicationPath = value ?? "/"; + this._applicationPath = NormalizeSlashes(this._applicationPath); } } @@ -578,12 +578,12 @@ public string ApplicationPath /// public string PhysicalApplicationPath { - get { return _physicalApplicationPath; } + get { return this._physicalApplicationPath; } set { - _physicalApplicationPath = value ?? WebsitePhysicalAppPath; + this._physicalApplicationPath = value ?? WebsitePhysicalAppPath; //strip trailing backslashes. - _physicalApplicationPath = StripTrailingBackSlashes(_physicalApplicationPath) + @"\"; + this._physicalApplicationPath = StripTrailingBackSlashes(this._physicalApplicationPath) + @"\"; } } @@ -594,7 +594,7 @@ public string PhysicalApplicationPath /// public string PhysicalPath { - get { return _physicalPath; } + get { return this._physicalPath; } } public TextWriter ResponseWriter { get; set; } @@ -606,7 +606,7 @@ public string ResponseText { get { - return (_builder ?? new StringBuilder()).ToString(); + return (this._builder ?? new StringBuilder()).ToString(); } } @@ -626,17 +626,17 @@ void SetHttpRuntimeInternals() var runtime = ReflectionHelper.GetStaticFieldValue("_theRuntime", typeof (HttpRuntime)); // set app path property value - ReflectionHelper.SetPrivateInstanceFieldValue("_appDomainAppPath", runtime, PhysicalApplicationPath); + ReflectionHelper.SetPrivateInstanceFieldValue("_appDomainAppPath", runtime, this.PhysicalApplicationPath); // set app virtual path property value const string vpathTypeName = "System.Web.VirtualPath, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - var virtualPath = ReflectionHelper.Instantiate(vpathTypeName, new[] { typeof(string) }, new object[] { ApplicationPath }); + var virtualPath = ReflectionHelper.Instantiate(vpathTypeName, new[] { typeof(string) }, new object[] { this.ApplicationPath }); ReflectionHelper.SetPrivateInstanceFieldValue("_appDomainAppVPath", runtime, virtualPath); // set codegen dir property value - ReflectionHelper.SetPrivateInstanceFieldValue("_codegenDir", runtime, PhysicalApplicationPath); + ReflectionHelper.SetPrivateInstanceFieldValue("_codegenDir", runtime, this.PhysicalApplicationPath); var environment = GetHostingEnvironment(); - ReflectionHelper.SetPrivateInstanceFieldValue("_appPhysicalPath", environment, PhysicalApplicationPath); + ReflectionHelper.SetPrivateInstanceFieldValue("_appPhysicalPath", environment, this.PhysicalApplicationPath); ReflectionHelper.SetPrivateInstanceFieldValue("_appVirtualPath", environment, virtualPath); ReflectionHelper.SetPrivateInstanceFieldValue("_configMapPath", environment, new ConfigMapPath(this)); } @@ -695,7 +695,7 @@ internal class ConfigMapPath : IConfigMapPath private readonly HttpSimulator _requestSimulation; public ConfigMapPath(HttpSimulator simulation) { - _requestSimulation = simulation; + this._requestSimulation = simulation; } public string GetMachineConfigFilename() @@ -725,13 +725,13 @@ public void ResolveSiteArgument(string siteArgument, out string siteName, out st public string MapPath(string siteId, string path) { - var page = StripPrecedingSlashes(RightAfter(path, _requestSimulation.ApplicationPath)); - return Path.Combine(_requestSimulation.PhysicalApplicationPath, page.Replace("/", @"\")); + var page = StripPrecedingSlashes(RightAfter(path, this._requestSimulation.ApplicationPath)); + return Path.Combine(this._requestSimulation.PhysicalApplicationPath, page.Replace("/", @"\")); } public string GetAppPathForPath(string siteId, string path) { - return _requestSimulation.ApplicationPath; + return this._requestSimulation.ApplicationPath; } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/SimulatedHttpRequest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/SimulatedHttpRequest.cs index b4c69b25025..b80072bbf6a 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/SimulatedHttpRequest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/HttpSimulator/SimulatedHttpRequest.cs @@ -36,8 +36,8 @@ public class SimulatedHttpRequest : SimpleWorkerRequest /// The HTTP Verb to use. public SimulatedHttpRequest(string applicationPath, string physicalAppPath, string physicalFilePath, string page, string query, TextWriter output, string host, int port, string verb) : base(applicationPath, physicalAppPath, page, query, output) { - Form = new NameValueCollection(); - Headers = new NameValueCollection(); + this.Form = new NameValueCollection(); + this.Headers = new NameValueCollection(); if (host == null) throw new ArgumentNullException("host", "Host cannot be null."); @@ -47,15 +47,15 @@ public SimulatedHttpRequest(string applicationPath, string physicalAppPath, stri if (applicationPath == null) throw new ArgumentNullException("applicationPath", "Can't create a request with a null application path. Try empty string."); - _host = host; - _verb = verb; - _port = port; - _physicalFilePath = physicalFilePath; + this._host = host; + this._verb = verb; + this._port = port; + this._physicalFilePath = physicalFilePath; } internal void SetReferer(Uri referer) { - _referer = referer; + this._referer = referer; } /// @@ -67,7 +67,7 @@ internal void SetReferer(Uri referer) /// public override string GetHttpVerbName() { - return _verb; + return this._verb; } /// @@ -76,17 +76,17 @@ public override string GetHttpVerbName() /// public override string GetServerName() { - return _host; + return this._host; } public override int GetLocalPort() { - return _port; + return this._port; } public override bool IsSecure() { - return (_port == 443) ? true : false; + return (this._port == 443) ? true : false; } //public override string GetProtocol() @@ -112,16 +112,16 @@ public override bool IsSecure() /// An array of header name-value pairs. public override string[][] GetUnknownRequestHeaders() { - if(Headers == null || Headers.Count == 0) + if(this.Headers == null || this.Headers.Count == 0) { return null; } - var headersArray = new string[Headers.Count][]; - for(var i = 0; i < Headers.Count; i++) + var headersArray = new string[this.Headers.Count][]; + for(var i = 0; i < this.Headers.Count; i++) { headersArray[i] = new string[2]; - headersArray[i][0] = Headers.Keys[i]; - headersArray[i][1] = Headers[i]; + headersArray[i][0] = this.Headers.Keys[i]; + headersArray[i][1] = this.Headers[i]; } return headersArray; } @@ -129,9 +129,9 @@ public override string[][] GetUnknownRequestHeaders() public override string GetKnownRequestHeader(int index) { if (index == 0x24) - return _referer == null ? string.Empty : _referer.ToString(); + return this._referer == null ? string.Empty : this._referer.ToString(); - if (index == 12 && _verb == "POST") + if (index == 12 && this._verb == "POST") return "application/x-www-form-urlencoded"; return base.GetKnownRequestHeader(index); @@ -139,7 +139,7 @@ public override string GetKnownRequestHeader(int index) public override string GetFilePathTranslated() { - return _physicalFilePath; + return this._physicalFilePath; } /// @@ -148,7 +148,7 @@ public override string GetFilePathTranslated() /// The number of bytes read. public override byte[] GetPreloadedEntityBody() { - return Encoding.UTF8.GetBytes(Form.Keys.Cast().Aggregate(string.Empty, (current, key) => current + string.Format("{0}={1}&", key, Form[key]))); + return Encoding.UTF8.GetBytes(this.Form.Keys.Cast().Aggregate(string.Empty, (current, key) => current + string.Format("{0}={1}&", key, this.Form[key]))); } /// diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/SimulatedHttpRequest.cs b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/SimulatedHttpRequest.cs index a67028f7313..7ea4895c9d4 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/SimulatedHttpRequest.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/SimulatedHttpRequest.cs @@ -28,7 +28,7 @@ public SimulatedHttpRequest(string appVirtualDir, string appPhysicalDir, string { if (string.IsNullOrEmpty(host)) throw new ArgumentNullException("host", "Host cannot be null nor empty."); - _host = host; + this._host = host; } /// @@ -37,7 +37,7 @@ public SimulatedHttpRequest(string appVirtualDir, string appPhysicalDir, string /// public override string GetServerName() { - return _host; + return this._host; } /// @@ -48,7 +48,7 @@ public override string GetServerName() public override string MapPath(string virtualPath) { var path = ""; - var appPath = GetAppPath(); + var appPath = this.GetAppPath(); if (appPath != null) path = Path.Combine(appPath, virtualPath); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/packages.config index d4327f7444f..95aadebccfe 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Utilities/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Utilities/packages.config @@ -1,7 +1,8 @@ - - - - - - + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/DotNetNuke.Tests.Web.Mvc.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/DotNetNuke.Tests.Web.Mvc.csproj index 66e52914ab4..6c9aedb30fc 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/DotNetNuke.Tests.Web.Mvc.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/DotNetNuke.Tests.Web.Mvc.csproj @@ -1,155 +1,162 @@ - - - - - Debug - AnyCPU - {AF3A5042-B67B-4F84-9E40-BE06B1105337} - Library - Properties - DotNetNuke.Tests.Web.Mvc - DotNetNuke.Tests.Web.Mvc - v4.7.2 - 512 - ..\..\..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 7 - - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - True - ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - True - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - - ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll - True - - - False - ..\..\..\Packages\Microsoft.AspNet.Mvc.5.1.3\lib\net45\System.Web.Mvc.dll - - - ..\..\..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll - True - - - ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll - True - - - ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll - True - - - ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {0fca217a-5f9a-4f5b-a31b-86d64ae65198} - DotNetNuke.DependencyInjection - - - {64dc5798-9d37-4f8d-97dd-8403e6e70dd3} - DotNetNuke.Web.Mvc - - - {6B29ADED-7B56-4484-BEA5-C0E09079535B} - DotNetNuke.Library - - - {68368906-57DD-40D1-AC10-35211A17D617} - DotNetNuke.Tests.Utilities - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {AF3A5042-B67B-4F84-9E40-BE06B1105337} + Library + Properties + DotNetNuke.Tests.Web.Mvc + DotNetNuke.Tests.Web.Mvc + v4.7.2 + 512 + ..\..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + 7 + + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + True + ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + True + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.Helpers.dll + True + + + False + ..\..\..\Packages\Microsoft.AspNet.Mvc.5.1.3\lib\net45\System.Web.Mvc.dll + + + ..\..\..\packages\Microsoft.AspNet.Razor.3.1.1\lib\net45\System.Web.Razor.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\..\..\packages\Microsoft.AspNet.WebPages.3.1.1\lib\net45\System.Web.WebPages.Razor.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + stylecop.json + + + + + + + {0fca217a-5f9a-4f5b-a31b-86d64ae65198} + DotNetNuke.DependencyInjection + + + {64dc5798-9d37-4f8d-97dd-8403e6e70dd3} + DotNetNuke.Web.Mvc + + + {6B29ADED-7B56-4484-BEA5-C0E09079535B} + DotNetNuke.Library + + + {68368906-57DD-40D1-AC10-35211A17D617} + DotNetNuke.Tests.Utilities + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Fakes/FakeDnnController.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Fakes/FakeDnnController.cs index 04918ac7055..2b2ebd33e10 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Fakes/FakeDnnController.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Fakes/FakeDnnController.cs @@ -14,17 +14,17 @@ public class FakeDnnController : DnnController { public ActionResult Action1() { - return View("Action1"); + return this.View("Action1"); } public ActionResult Action2() { - return View("Action2", "Master2"); + return this.View("Action2", "Master2"); } public ActionResult Action3(Dog dog) { - return View("Action3", "Master3", dog); + return this.View("Action3", "Master3", dog); } [FakeHandleExceptionRedirect] @@ -36,13 +36,13 @@ public ActionResult ActionWithExceptionFilter() [FakeOnExecutingRedirect] public ActionResult ActionWithOnExecutingFilter() { - return View("Action1"); + return this.View("Action1"); } [FakeOnExecutedRedirect] public ActionResult ActionWithOnExecutedFilter() { - return View("Action1"); + return this.View("Action1"); } public void MockInitialize(RequestContext requestContext) @@ -50,7 +50,7 @@ public void MockInitialize(RequestContext requestContext) // Mocking out the entire MvcHandler and Controller lifecycle proved to be difficult // This method executes the initialization logic that occurs on every request which is // executed from the Execute method. - Initialize(requestContext); + this.Initialize(requestContext); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnAuthorizeAttributeTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnAuthorizeAttributeTests.cs index a8e37f56bbf..aba50a7633c 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnAuthorizeAttributeTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnAuthorizeAttributeTests.cs @@ -25,55 +25,55 @@ class DnnAuthorizeAttributeTests [SetUp] public void Setup() { - _mockRepository = new MockRepository(MockBehavior.Default); + this._mockRepository = new MockRepository(MockBehavior.Default); - _mockActionDescriptor = _mockRepository.Create(); - _mockControllerDescriptor = _mockRepository.Create(); - _mockRoleController = _mockRepository.Create(); + this._mockActionDescriptor = this._mockRepository.Create(); + this._mockControllerDescriptor = this._mockRepository.Create(); + this._mockRoleController = this._mockRepository.Create(); - _mockDnnAuthorizeAttribute = _mockRepository.Create(); - _mockDnnAuthorizeAttribute.CallBase = true; + this._mockDnnAuthorizeAttribute = this._mockRepository.Create(); + this._mockDnnAuthorizeAttribute.CallBase = true; } [Test] public void AnonymousUser_IsNotAllowed_If_AllowAnonymousAtribute_IsNotPresent() { // Arrange - _mockDnnAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); - var sut = _mockDnnAuthorizeAttribute.Object; + this._mockDnnAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); + var sut = this._mockDnnAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof (AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof (AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] public void AnonymousUser_IsAllowed_If_AllowAnonymousAtribute_IsAtControllerLevel() { // Arrange - var sut = _mockDnnAuthorizeAttribute.Object; + var sut = this._mockDnnAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] @@ -81,18 +81,18 @@ public void AnonymousUser_IsAllowed_If_AllowAnonymousAtribute_IsAtActionLevel() { // Arrange - var sut = _mockDnnAuthorizeAttribute.Object; + var sut = this._mockDnnAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] @@ -100,22 +100,22 @@ public void RegisteredUser_IsAllowed_ByDefault() { // Arrange - _mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); - _mockDnnAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); - var sut = _mockDnnAuthorizeAttribute.Object; + this._mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); + this._mockDnnAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); + var sut = this._mockDnnAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } private UserInfo SetUpUserWithRole(string roleName) @@ -135,8 +135,8 @@ private UserInfo SetUpUserWithRole(string roleName) } }; - _mockRoleController.Setup(x => x.GetUserRoles(user, true)).Returns(roles); - RoleController.SetTestableInstance(_mockRoleController.Object); + this._mockRoleController.Setup(x => x.GetUserRoles(user, true)).Returns(roles); + RoleController.SetTestableInstance(this._mockRoleController.Object); return user; } @@ -147,26 +147,26 @@ public void RegisteredUser_IsDenied_If_IncludedIn_DeniedRoles() // Arrange const string roleName = "MyRole"; - var user = SetUpUserWithRole(roleName); + var user = this.SetUpUserWithRole(roleName); - _mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); - _mockDnnAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); - _mockDnnAuthorizeAttribute.Protected().Setup("GetCurrentUser").Returns(user); - var sut = _mockDnnAuthorizeAttribute.Object; + this._mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); + this._mockDnnAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); + this._mockDnnAuthorizeAttribute.Protected().Setup("GetCurrentUser").Returns(user); + var sut = this._mockDnnAuthorizeAttribute.Object; sut.DenyRoles = roleName; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] @@ -177,24 +177,24 @@ public void RegisteredUser_IsAllowed_If_IncludedIn_DeniedRoles_But_IsSuperUser() var user = new UserInfo { IsSuperUser = true }; - _mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); - _mockDnnAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); - _mockDnnAuthorizeAttribute.Protected().Setup("GetCurrentUser").Returns(user); - var sut = _mockDnnAuthorizeAttribute.Object; + this._mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); + this._mockDnnAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); + this._mockDnnAuthorizeAttribute.Protected().Setup("GetCurrentUser").Returns(user); + var sut = this._mockDnnAuthorizeAttribute.Object; sut.DenyRoles = roleName; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] @@ -203,26 +203,26 @@ public void RegisteredUser_IsDenied_If_IncludedIn_StaticRoles() // Arrange const string roleName = "MyRole"; - var user = SetUpUserWithRole(roleName); + var user = this.SetUpUserWithRole(roleName); - _mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); - _mockDnnAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); - _mockDnnAuthorizeAttribute.Protected().Setup("GetCurrentUser").Returns(user); - var sut = _mockDnnAuthorizeAttribute.Object; + this._mockDnnAuthorizeAttribute.Protected().Setup("IsAuthenticated").Returns(true); + this._mockDnnAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); + this._mockDnnAuthorizeAttribute.Protected().Setup("GetCurrentUser").Returns(user); + var sut = this._mockDnnAuthorizeAttribute.Object; sut.StaticRoles = roleName; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var controllerContext = new ControllerContext(); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnModuleAuthorizeAttributeTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnModuleAuthorizeAttributeTests.cs index 95e14e7ff96..f3c9d87ef32 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnModuleAuthorizeAttributeTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Attributes/DnnModuleAuthorizeAttributeTests.cs @@ -24,126 +24,126 @@ class DnnModuleAuthorizeAttributeTests [SetUp] public void Setup() { - _mockRepository = new MockRepository(MockBehavior.Default); + this._mockRepository = new MockRepository(MockBehavior.Default); - _mockActionDescriptor = _mockRepository.Create(); - _mockControllerDescriptor = _mockRepository.Create(); + this._mockActionDescriptor = this._mockRepository.Create(); + this._mockControllerDescriptor = this._mockRepository.Create(); - _mockDnnModuleAuthorizeAttribute = _mockRepository.Create(); - _mockDnnModuleAuthorizeAttribute.CallBase = true; + this._mockDnnModuleAuthorizeAttribute = this._mockRepository.Create(); + this._mockDnnModuleAuthorizeAttribute.CallBase = true; } [Test] public void AnonymousUser_IsNotAllowed_If_AllowAnonymousAttribute_IsNotPresent() { // Arrange - _mockDnnModuleAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); - var sut = _mockDnnModuleAuthorizeAttribute.Object; + this._mockDnnModuleAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); + var sut = this._mockDnnModuleAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof (AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof (AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var fakeController = new Fakes.FakeDnnController { ModuleContext = new ModuleInstanceContext() }; var controllerContext = new ControllerContext(new RequestContext(), fakeController); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] public void AnonymousUser_IsAllowed_If_AllowAnonymousAttribute_IsAtControllerLevel() { // Arrange - var sut = _mockDnnModuleAuthorizeAttribute.Object; + var sut = this._mockDnnModuleAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var fakeController = new Fakes.FakeDnnController { ModuleContext = new ModuleInstanceContext() }; var controllerContext = new ControllerContext(new RequestContext(), fakeController); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] public void AnonymousUser_IsAllowed_If_AllowAnonymousAttribute_IsAtActionLevel() { // Arrange - var sut = _mockDnnModuleAuthorizeAttribute.Object; + var sut = this._mockDnnModuleAuthorizeAttribute.Object; - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(true); var fakeController = new Fakes.FakeDnnController { ModuleContext = new ModuleInstanceContext() }; var controllerContext = new ControllerContext(new RequestContext(), fakeController); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert //Assert.IsTrue(a.IsAuthorized); - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] public void RegisteredUser_IsAllowed_IfHasModuleAccess() { // Arrange - var sut = _mockDnnModuleAuthorizeAttribute.Object; - _mockDnnModuleAuthorizeAttribute.Protected().Setup("HasModuleAccess").Returns(true); - _mockDnnModuleAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); + var sut = this._mockDnnModuleAuthorizeAttribute.Object; + this._mockDnnModuleAuthorizeAttribute.Protected().Setup("HasModuleAccess").Returns(true); + this._mockDnnModuleAuthorizeAttribute.Protected().Setup("HandleAuthorizedRequest", ItExpr.IsAny()); - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var moduleContext = new ModuleInstanceContext(); moduleContext.Configuration = new ModuleInfo(); var fakeController = new Fakes.FakeDnnController { ModuleContext = moduleContext }; var controllerContext = new ControllerContext(new RequestContext(), fakeController); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } [Test] public void RegisteredUser_IsDenied_IfHasNoModuleAccess() { // Arrange - var sut = _mockDnnModuleAuthorizeAttribute.Object; - _mockDnnModuleAuthorizeAttribute.Protected().Setup("HasModuleAccess").Returns(false); - _mockDnnModuleAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); + var sut = this._mockDnnModuleAuthorizeAttribute.Object; + this._mockDnnModuleAuthorizeAttribute.Protected().Setup("HasModuleAccess").Returns(false); + this._mockDnnModuleAuthorizeAttribute.Protected().Setup("HandleUnauthorizedRequest", ItExpr.IsAny()); - _mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); - _mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(_mockControllerDescriptor.Object); + this._mockActionDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockControllerDescriptor.Setup(x => x.IsDefined(typeof(AllowAnonymousAttribute), true)).Returns(false); + this._mockActionDescriptor.SetupGet(x => x.ControllerDescriptor).Returns(this._mockControllerDescriptor.Object); var moduleContext = new ModuleInstanceContext(); moduleContext.Configuration = new ModuleInfo(); var fakeController = new Fakes.FakeDnnController { ModuleContext = moduleContext }; var controllerContext = new ControllerContext(new RequestContext(), fakeController); - var context = new AuthorizationContext(controllerContext, _mockActionDescriptor.Object); + var context = new AuthorizationContext(controllerContext, this._mockActionDescriptor.Object); // Act sut.OnAuthorization(context); // Assert - _mockRepository.VerifyAll(); + this._mockRepository.VerifyAll(); } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Controllers/DnnControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Controllers/DnnControllerTests.cs index 32b734bf5d9..cc1f45fd1d8 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Controllers/DnnControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Controllers/DnnControllerTests.cs @@ -23,7 +23,7 @@ public void ActivePage_Property_Is_Null_If_PortalSettings_Not_Set_In_Context() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); //Assert Assert.IsNull(controller.ActivePage); @@ -36,7 +36,7 @@ public void PortalSettings_Property_Is_Null_If_Not_Set_In_Context() HttpContextBase context = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(context); + var controller = this.SetupController(context); //Assert Assert.IsNull(controller.PortalSettings); @@ -49,7 +49,7 @@ public void ResultOfLastExecute_Returns_ViewResult() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); controller.ActionInvoker.InvokeAction(controller.ControllerContext, "Action1"); //Assert @@ -64,7 +64,7 @@ public void User_Property_Is_Null_If_PortalSettings_Not_Set_In_Context() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); //Assert Assert.IsNull(controller.User); @@ -77,7 +77,7 @@ public void View_Returns_DnnViewResult() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var viewResult = controller.Action1(); //Assert @@ -91,7 +91,7 @@ public void View_Returns_DnnViewResult_With_Correct_ViewName() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var viewResult = controller.Action1(); //Assert @@ -107,7 +107,7 @@ public void View_Returns_DnnViewResult_With_Correct_MasterName() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var viewResult = controller.Action2(); //Assert @@ -124,7 +124,7 @@ public void View_Returns_DnnViewResult_With_Correct_ViewData() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); controller.ViewData.Add("key", "value"); var viewResult = controller.Action2(); @@ -142,7 +142,7 @@ public void View_Returns_DnnViewResult_With_Correct_Model() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var viewResult = controller.Action3(dog); //Assert @@ -159,7 +159,7 @@ public void View_Returns_DnnViewResult_With_Correct_ViewEngines() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var viewResult = controller.Action3(dog); //Assert @@ -175,7 +175,7 @@ public void Initialize_CreatesInstance_Of_DnnUrlHelper() HttpContextBase httpContextBase = MockHelper.CreateMockHttpContext(); //Act - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); controller.MockInitialize(httpContextBase.Request.RequestContext); //Assert diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Modules/ResultCapturingActionInvokerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Modules/ResultCapturingActionInvokerTests.cs index b10845ac5dc..3d6d0810bf5 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Modules/ResultCapturingActionInvokerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Framework/Modules/ResultCapturingActionInvokerTests.cs @@ -21,13 +21,13 @@ public class ResultCapturingActionInvokerTests [SetUp] public void Setup() { - _actionInvoker = new ResultCapturingActionInvoker(); + this._actionInvoker = new ResultCapturingActionInvoker(); } [TearDown] public void TearDown() { - _actionInvoker = null; + this._actionInvoker = null; } [Test] @@ -40,11 +40,11 @@ public void InvokeActionResult_Sets_ResultOfLastInvoke() controller.ControllerContext = new ControllerContext(context, new RouteData(), controller); //Act - _actionInvoker.InvokeAction(controller.ControllerContext, "Index"); + this._actionInvoker.InvokeAction(controller.ControllerContext, "Index"); //Assert - Assert.IsNotNull(_actionInvoker.ResultOfLastInvoke); - Assert.IsInstanceOf(_actionInvoker.ResultOfLastInvoke); + Assert.IsNotNull(this._actionInvoker.ResultOfLastInvoke); + Assert.IsInstanceOf(this._actionInvoker.ResultOfLastInvoke); } [Test] @@ -52,15 +52,15 @@ public void ActionInvoker_InvokeExceptionFilters_IsExceptionHandled_True() { //Arrange var httpContextBase = MockHelper.CreateMockHttpContext(); - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); FakeHandleExceptionRedirectAttribute.IsExceptionHandled = true; var expectedResult = FakeHandleExceptionRedirectAttribute.Result; //Act - _actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithExceptionFilter)); + this._actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithExceptionFilter)); //Assert - Assert.AreEqual(expectedResult, _actionInvoker.ResultOfLastInvoke); + Assert.AreEqual(expectedResult, this._actionInvoker.ResultOfLastInvoke); } [Test] @@ -68,15 +68,15 @@ public void ActionInvoker_InvokeExceptionFilters_IsExceptionHandled_False() { //Arrange var httpContextBase = MockHelper.CreateMockHttpContext(); - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); FakeHandleExceptionRedirectAttribute.IsExceptionHandled = false; var expectedResult = FakeRedirectAttribute.Result; //Act - Assert.Throws(() => _actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithExceptionFilter))); + Assert.Throws(() => this._actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithExceptionFilter))); //Assert - Assert.AreEqual(expectedResult, _actionInvoker.ResultOfLastInvoke); + Assert.AreEqual(expectedResult, this._actionInvoker.ResultOfLastInvoke); } [Test] @@ -84,14 +84,14 @@ public void ActionInvoker_InvokeOnExecutingFilters() { //Arrange var httpContextBase = MockHelper.CreateMockHttpContext(); - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var expectedResult = FakeRedirectAttribute.Result; //Act - _actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithOnExecutingFilter)); + this._actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithOnExecutingFilter)); //Assert - Assert.AreEqual(expectedResult, _actionInvoker.ResultOfLastInvoke); + Assert.AreEqual(expectedResult, this._actionInvoker.ResultOfLastInvoke); } [Test] @@ -99,14 +99,14 @@ public void ActionInvoker_InvokeOnExecutedFilters() { //Arrange var httpContextBase = MockHelper.CreateMockHttpContext(); - var controller = SetupController(httpContextBase); + var controller = this.SetupController(httpContextBase); var expectedResult = FakeRedirectAttribute.Result; //Act - _actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithOnExecutedFilter)); + this._actionInvoker.InvokeAction(controller.ControllerContext, nameof(FakeDnnController.ActionWithOnExecutedFilter)); //Assert - Assert.AreEqual(expectedResult, _actionInvoker.ResultOfLastInvoke); + Assert.AreEqual(expectedResult, this._actionInvoker.ResultOfLastInvoke); } private FakeDnnController SetupController(HttpContextBase context) diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Helpers/DnnHelperTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Helpers/DnnHelperTests.cs index ffe57262b14..7f89e58a90b 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Helpers/DnnHelperTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/Helpers/DnnHelperTests.cs @@ -23,34 +23,34 @@ public class DnnHelperTests [SetUp] public void SetUp() { - _mockController = new Mock(); - _viewContext = new ViewContext(); + this._mockController = new Mock(); + this._viewContext = new ViewContext(); - _mockViewDataContainer = new Mock(); + this._mockViewDataContainer = new Mock(); } [Test] public void Constructor_Throws_On_Null_ViewContext() { //Act,Assert - Assert.Throws(() => new DnnHelper(null, _mockViewDataContainer.Object)); + Assert.Throws(() => new DnnHelper(null, this._mockViewDataContainer.Object)); } [Test] public void Constructor_Throws_On_Null_ViewDataContainer() { //Act,Assert - Assert.Throws(() => new DnnHelper(null, _mockViewDataContainer.Object)); + Assert.Throws(() => new DnnHelper(null, this._mockViewDataContainer.Object)); } [Test] public void Constructor_Throws_On_Invalid_Controller_Property() { //Arrange - _viewContext.Controller = _mockController.Object; + this._viewContext.Controller = this._mockController.Object; //Act,Assert - Assert.Throws(() => new DnnHelper(_viewContext, _mockViewDataContainer.Object)); + Assert.Throws(() => new DnnHelper(this._viewContext, this._mockViewDataContainer.Object)); } [Test] @@ -58,12 +58,12 @@ public void Constructor_Sets_ModuleContext_Property() { //Arrange var expectedContext = new ModuleInstanceContext(); - var mockDnnController = _mockController.As(); + var mockDnnController = this._mockController.As(); mockDnnController.Setup(c => c.ModuleContext).Returns(expectedContext); - _viewContext.Controller = _mockController.Object; + this._viewContext.Controller = this._mockController.Object; //Act - var helper = new DnnHelper(_viewContext, _mockViewDataContainer.Object); + var helper = new DnnHelper(this._viewContext, this._mockViewDataContainer.Object); //Assert Assert.AreEqual(expectedContext, helper.ModuleContext); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/packages.config index 6e583871502..7729029ef39 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web.Mvc/packages.config @@ -10,4 +10,5 @@ + \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/Internals/DnnDependencyResolverTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/Internals/DnnDependencyResolverTests.cs index 486dd402c3c..d8d56eb4a1e 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/Internals/DnnDependencyResolverTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/Internals/DnnDependencyResolverTests.cs @@ -25,38 +25,38 @@ public void FixtureSetUp() services.AddSingleton(sp => new FakeScopeAccessor(sp.CreateScope())); services.AddScoped(typeof(ITestService), typeof(TestService)); - _serviceProvider = services.BuildServiceProvider(); - _dependencyResolver = new DnnDependencyResolver(_serviceProvider); + this._serviceProvider = services.BuildServiceProvider(); + this._dependencyResolver = new DnnDependencyResolver(this._serviceProvider); } [TestFixtureTearDown] public void FixtureTearDown() { - _dependencyResolver = null; + this._dependencyResolver = null; - if (_serviceProvider is IDisposable disposable) + if (this._serviceProvider is IDisposable disposable) disposable.Dispose(); - _serviceProvider = null; + this._serviceProvider = null; } [Test] public void NotNull() { - Assert.NotNull(_dependencyResolver); + Assert.NotNull(this._dependencyResolver); } [Test] public void IsOfTypeDnnDependencyResolver() { - Assert.IsInstanceOf(_dependencyResolver); + Assert.IsInstanceOf(this._dependencyResolver); } [Test] public void GetTestService() { var expected = new TestService(); - var actual = _dependencyResolver.GetService(typeof(ITestService)); + var actual = this._dependencyResolver.GetService(typeof(ITestService)); Assert.NotNull(actual); Assert.AreEqual(expected.GetType(), actual.GetType()); @@ -66,7 +66,7 @@ public void GetTestService() public void GetTestServices() { var expected = new TestService(); - var actual = _dependencyResolver.GetServices(typeof(ITestService)).ToArray(); + var actual = this._dependencyResolver.GetServices(typeof(ITestService)).ToArray(); Assert.NotNull(actual); Assert.AreEqual(1, actual.Length); @@ -76,7 +76,7 @@ public void GetTestServices() [Test] public void BeginScope() { - var actual = _dependencyResolver.BeginScope(); + var actual = this._dependencyResolver.BeginScope(); Assert.NotNull(actual); Assert.IsInstanceOf(actual); @@ -85,7 +85,7 @@ public void BeginScope() [Test] public void BeginScope_GetService() { - var scope = _dependencyResolver.BeginScope(); + var scope = this._dependencyResolver.BeginScope(); var expected = new TestService(); var actual = scope.GetService(typeof(ITestService)); @@ -97,7 +97,7 @@ public void BeginScope_GetService() [Test] public void BeginScope_GetServices() { - var scope = _dependencyResolver.BeginScope(); + var scope = this._dependencyResolver.BeginScope(); var expected = new TestService(); var actual = scope.GetServices(typeof(ITestService)).ToArray(); @@ -121,7 +121,7 @@ public FakeScopeAccessor(IServiceScope fakeScope) public IServiceScope GetScope() { - return fakeScope; + return this.fakeScope; } } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/JwtAuthMessageHandlerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/JwtAuthMessageHandlerTests.cs index 3365a6d1279..288e901c985 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/JwtAuthMessageHandlerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/JwtAuthMessageHandlerTests.cs @@ -45,33 +45,33 @@ public void SetupMockServices() { MockComponentProvider.CreateDataCacheProvider(); - _mockDataService = new Mock(); - _mockDataProvider = MockComponentProvider.CreateDataProvider(); - _mockPortalController = new Mock(); - _mockUserController = new Mock(); - _mockMembership = MockComponentProvider.CreateNew(); - - _mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); - _mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); - _mockDataProvider.Setup(d => d.GetUser(It.IsAny(), It.IsAny())).Returns(GetUser); - _mockDataService.Setup(ds => ds.GetPortalGroups()).Returns(GetPortalGroups); - Entities.Portals.Data.DataService.RegisterInstance(_mockDataService.Object); - - _mockMembership.Setup(m => m.PasswordRetrievalEnabled).Returns(true); - _mockMembership.Setup(m => m.GetUser(It.IsAny(), It.IsAny())).Returns((int portalId, int userId) => GetUserByIdCallback(portalId, userId)); - - _mockJwtDataService = new Mock(); - _mockJwtDataService.Setup(x => x.GetTokenById(It.IsAny())).Returns((string sid) => GetPersistedToken(sid)); - DataService.RegisterInstance(_mockJwtDataService.Object); - - PortalController.SetTestableInstance(_mockPortalController.Object); - _mockPortalController.Setup(x => x.GetPortal(It.IsAny())).Returns( + this._mockDataService = new Mock(); + this._mockDataProvider = MockComponentProvider.CreateDataProvider(); + this._mockPortalController = new Mock(); + this._mockUserController = new Mock(); + this._mockMembership = MockComponentProvider.CreateNew(); + + this._mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); + this._mockDataProvider.Setup(d => d.GetUser(It.IsAny(), It.IsAny())).Returns(GetUser); + this._mockDataService.Setup(ds => ds.GetPortalGroups()).Returns(this.GetPortalGroups); + Entities.Portals.Data.DataService.RegisterInstance(this._mockDataService.Object); + + this._mockMembership.Setup(m => m.PasswordRetrievalEnabled).Returns(true); + this._mockMembership.Setup(m => m.GetUser(It.IsAny(), It.IsAny())).Returns((int portalId, int userId) => GetUserByIdCallback(portalId, userId)); + + this._mockJwtDataService = new Mock(); + this._mockJwtDataService.Setup(x => x.GetTokenById(It.IsAny())).Returns((string sid) => GetPersistedToken(sid)); + DataService.RegisterInstance(this._mockJwtDataService.Object); + + PortalController.SetTestableInstance(this._mockPortalController.Object); + this._mockPortalController.Setup(x => x.GetPortal(It.IsAny())).Returns( new PortalInfo {PortalID = 0, PortalGroupID = -1, UserTabId = 55}); - _mockPortalController.Setup(x => x.GetPortalSettings(It.IsAny())).Returns((int portalId) => new Dictionary()); - _mockPortalController.Setup(x => x.GetCurrentPortalSettings()).Returns(() => new PortalSettings()); + this._mockPortalController.Setup(x => x.GetPortalSettings(It.IsAny())).Returns((int portalId) => new Dictionary()); + this._mockPortalController.Setup(x => x.GetCurrentPortalSettings()).Returns(() => new PortalSettings()); - UserController.SetTestableInstance(_mockUserController.Object); - _mockUserController.Setup(x => x.GetUserById(It.IsAny(), It.IsAny())).Returns( + UserController.SetTestableInstance(this._mockUserController.Object); + this._mockUserController.Setup(x => x.GetUserById(It.IsAny(), It.IsAny())).Returns( (int portalId, int userId) => GetUserByIdCallback(portalId, userId)); //_mockUserController.Setup(x => x.ValidateUser(It.IsAny(), It.IsAny(), It.IsAny())).Returns(UserValidStatus.VALID); } @@ -299,7 +299,7 @@ public void AuthoizationTokenWithoorResponse() request.Headers.Authorization = AuthenticationHeaderValue.Parse("Bearer " + ValidToken); //Act - SetupMockServices(); + this.SetupMockServices(); var handler = new JwtAuthMessageHandler(true, false); var response = handler.OnInboundRequest(request, new CancellationToken()); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs index eda9503ce78..01a1dd7377d 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ServiceRoutingManagerTests.cs @@ -35,9 +35,9 @@ public void Setup() { FakeServiceRouteMapper.RegistrationCalls = 0; - _mockPortalController = new Mock(); - _portalController = _mockPortalController.Object; - PortalController.SetTestableInstance(_portalController); + this._mockPortalController = new Mock(); + this._portalController = this._mockPortalController.Object; + PortalController.SetTestableInstance(this._portalController); var navigationManagerMock = new Mock(); var services = new ServiceCollection(); @@ -63,7 +63,7 @@ public void LocatesAllServiceRouteMappers() //including the assembly with object ensures that the assignabliity is done correctly var assembliesToReflect = new IAssembly[2]; - assembliesToReflect[0] = new AssemblyWrapper(GetType().Assembly); + assembliesToReflect[0] = new AssemblyWrapper(this.GetType().Assembly); assembliesToReflect[1] = new AssemblyWrapper(typeof (Object).Assembly); assemblyLocator.Setup(x => x.Assemblies).Returns(assembliesToReflect); @@ -144,7 +144,7 @@ public void UniqueNameRequiredOnMapRouteCalls(string uniqueName) public void UrlCanStartWithSlash() { //Arrange - _mockPortalController.Setup(x => x.GetPortals()).Returns(new ArrayList()); + this._mockPortalController.Setup(x => x.GetPortals()).Returns(new ArrayList()); //Act var srm = new ServicesRoutingManager(new RouteCollection()); @@ -158,7 +158,7 @@ public void NameIsInsertedInRouteDataTokens() { //Arrange var portalInfo = new ArrayList { new PortalInfo { PortalID = 0 } }; - _mockPortalController.Setup(x => x.GetPortals()).Returns(portalInfo); + this._mockPortalController.Setup(x => x.GetPortals()).Returns(portalInfo); var mockPac = new Mock(); mockPac.Setup(x => x.GetPortalAliasesByPortalId(0)).Returns(new[] { new PortalAliasInfo { HTTPAlias = "www.foo.com" } }); PortalAliasController.SetTestableInstance(mockPac.Object); @@ -179,7 +179,7 @@ public void TwoRoutesOnTheSameFolderHaveSimilarNames() { //Arrange var portalInfo = new ArrayList { new PortalInfo { PortalID = 0 } }; - _mockPortalController.Setup(x => x.GetPortals()).Returns(portalInfo); + this._mockPortalController.Setup(x => x.GetPortals()).Returns(portalInfo); var mockPac = new Mock(); mockPac.Setup(x => x.GetPortalAliasesByPortalId(0)).Returns(new[] { new PortalAliasInfo { HTTPAlias = "www.foo.com" } }); PortalAliasController.SetTestableInstance(mockPac.Object); @@ -203,7 +203,7 @@ public void RoutesShouldHaveBackwardCompability() { //Arrange var portalInfo = new ArrayList { new PortalInfo { PortalID = 0 } }; - _mockPortalController.Setup(x => x.GetPortals()).Returns(portalInfo); + this._mockPortalController.Setup(x => x.GetPortals()).Returns(portalInfo); var mockPac = new Mock(); mockPac.Setup(x => x.GetPortalAliasesByPortalId(0)).Returns(new[] { new PortalAliasInfo { HTTPAlias = "www.foo.com" } }); PortalAliasController.SetTestableInstance(mockPac.Object); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/StandardTabAndModuleInfoProviderTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/StandardTabAndModuleInfoProviderTests.cs index b889ec5cb91..199ef569d7a 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/StandardTabAndModuleInfoProviderTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/StandardTabAndModuleInfoProviderTests.cs @@ -44,26 +44,26 @@ public class StandardTabAndModuleInfoProviderTests public void Setup() { MockComponentProvider.CreateDataCacheProvider(); - _mockDataProvider = MockComponentProvider.CreateDataProvider(); - _mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); - _mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); + this._mockDataProvider = MockComponentProvider.CreateDataProvider(); + this._mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); + this._mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); - RegisterMock(ModuleController.SetTestableInstance, out _mockModuleController, out _moduleController); - RegisterMock(TabController.SetTestableInstance, out _mockTabController, out _tabController); - RegisterMock(TabModulesController.SetTestableInstance, out _mockTabModuleController, out _tabModuleController); + this.RegisterMock(ModuleController.SetTestableInstance, out this._mockModuleController, out this._moduleController); + this.RegisterMock(TabController.SetTestableInstance, out this._mockTabController, out this._tabController); + this.RegisterMock(TabModulesController.SetTestableInstance, out this._mockTabModuleController, out this._tabModuleController); - _tabInfo = new TabInfo { TabID = ValidTabId }; - _moduleInfo = new ModuleInfo + this._tabInfo = new TabInfo { TabID = ValidTabId }; + this._moduleInfo = new ModuleInfo { TabModuleID = ValidTabModuleId, TabID = ValidTabId, ModuleID = ValidModuleId, PortalID = ValidPortalId }; - _mockTabController.Setup(x => x.GetTab(ValidTabId, ValidPortalId)).Returns(_tabInfo); - _mockModuleController.Setup(x => x.GetModule(ValidModuleId, ValidTabId, false)).Returns(_moduleInfo); - _mockModuleController.Setup(x => x.GetTabModule(ValidTabModuleId)).Returns(_moduleInfo); - _mockTabModuleController.Setup(x => x.GetTabModuleIdsBySetting(MonikerSettingName, MonikerSettingValue)).Returns( + this._mockTabController.Setup(x => x.GetTab(ValidTabId, ValidPortalId)).Returns(this._tabInfo); + this._mockModuleController.Setup(x => x.GetModule(ValidModuleId, ValidTabId, false)).Returns(this._moduleInfo); + this._mockModuleController.Setup(x => x.GetTabModule(ValidTabModuleId)).Returns(this._moduleInfo); + this._mockTabModuleController.Setup(x => x.GetTabModuleIdsBySetting(MonikerSettingName, MonikerSettingValue)).Returns( new List { ValidTabModuleId }); - _mockTabModuleController.Setup(x => x.GetTabModuleSettingsByName(MonikerSettingName)).Returns( + this._mockTabModuleController.Setup(x => x.GetTabModuleSettingsByName(MonikerSettingName)).Returns( new Dictionary { { ValidTabModuleId, MonikerSettingValue } }); } @@ -134,7 +134,7 @@ public void ValidTabAndModuleIdLoadsActiveModule() //Assert Assert.IsTrue(result); - Assert.AreSame(_moduleInfo, returnedModuleInfo); + Assert.AreSame(this._moduleInfo, returnedModuleInfo); } [Test] @@ -150,7 +150,7 @@ public void ExistingMonikerValueInHeaderShouldFindTheCorrectModuleInfo() //Assert Assert.IsTrue(result); - Assert.AreSame(_moduleInfo, returnedModuleInfo); + Assert.AreSame(this._moduleInfo, returnedModuleInfo); } [Test] @@ -167,7 +167,7 @@ public void ExistingMonikerValueInQueryStringShouldFindTheCorrectModuleInfo() //Assert Assert.IsTrue(result); - Assert.AreSame(_moduleInfo, returnedModuleInfo); + Assert.AreSame(this._moduleInfo, returnedModuleInfo); } [Test] @@ -214,8 +214,8 @@ public void OmittedTabIdWillNotLoadModule() var result = new StandardTabAndModuleInfoProvider().TryFindModuleInfo(request, out returnedModuleInfo); //Assert - _mockTabController.Verify(x => x.GetTab(It.IsAny(), It.IsAny()), Times.Never()); - _mockModuleController.Verify(x => x.GetModule(It.IsAny(), It.IsAny(), false), Times.Never()); + this._mockTabController.Verify(x => x.GetTab(It.IsAny(), It.IsAny()), Times.Never()); + this._mockModuleController.Verify(x => x.GetModule(It.IsAny(), It.IsAny(), false), Times.Never()); Assert.IsNull(returnedModuleInfo); Assert.IsFalse(result); } @@ -233,7 +233,7 @@ public void OmittedModuleIdWillNotLoadModule() var result = new StandardTabAndModuleInfoProvider().TryFindModuleInfo(request, out returnedModuleInfo); //Assert - _mockModuleController.Verify(x => x.GetModule(It.IsAny(), It.IsAny(), false), Times.Never()); + this._mockModuleController.Verify(x => x.GetModule(It.IsAny(), It.IsAny(), false), Times.Never()); Assert.IsNull(returnedModuleInfo); Assert.IsFalse(result); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ValidateAntiForgeryTokenAttributeTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ValidateAntiForgeryTokenAttributeTests.cs index 2c2bf18bce3..5f938dca3ae 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ValidateAntiForgeryTokenAttributeTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Api/ValidateAntiForgeryTokenAttributeTests.cs @@ -31,7 +31,7 @@ public void TearDown() [TestCase("foo=fee; {0}={1}")] //no terminating semi-colon public void LocateCookies(string cookieFormat) { - LocatesCookie(cookieFormat, "__RequestVerificationToken_thiscanbemany_characters_in_some_cases", "some text goes here"); + this.LocatesCookie(cookieFormat, "__RequestVerificationToken_thiscanbemany_characters_in_some_cases", "some text goes here"); } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj index 78a529a1e64..1cb7e417df4 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/DotNetNuke.Tests.Web.csproj @@ -1,170 +1,177 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {705708E8-6AD9-4021-9B36-EFC83AD42EE7} - Library - Properties - DotNetNuke.Tests.Web - DotNetNuke.Tests.Web - v4.7.2 - 512 - ..\..\..\..\Evoq.Content\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - 618 - 7 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - 618 - 7 - - - - False - ..\..\Library\bin\Lucene.Net.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - - ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll - - - ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll - - - False - ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True - - - - - False - ..\..\Components\WebAPI\System.Net.Http.dll - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - - - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - - - False - ..\..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll - - - - - - - - - ..\..\..\packages\WebFormsMVP.1.4.1.0\lib\WebFormsMvp.dll - - - - - - - - - - - - - - - - - Code - - - - - - - - - - - - - - - - {3b2fa1d9-ec7d-4cec-8ff5-a7700cf5cb40} - Dnn.AuthServices.Jwt - - - {6928A9B1-F88A-4581-A132-D3EB38669BB0} - DotNetNuke.Abstractions - - - {0FCA217A-5F9A-4F5B-A31B-86D64AE65198} - DotNetNuke.DependencyInjection - - - {04f77171-0634-46e0-a95e-d7477c88712e} - DotNetNuke.Log4Net - - - {ee1329fe-fd88-4e1a-968c-345e394ef080} - DotNetNuke.Web - - - {6b29aded-7b56-4484-bea5-c0e09079535b} - DotNetNuke.Library - - - {5AECE021-E449-4A7F-BF82-2FA7B236ED3E} - DotNetNuke.Tests.Utilities - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {705708E8-6AD9-4021-9B36-EFC83AD42EE7} + Library + Properties + DotNetNuke.Tests.Web + DotNetNuke.Tests.Web + v4.7.2 + 512 + ..\..\..\..\Evoq.Content\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + 618 + 7 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + 618 + 7 + + + + False + ..\..\Library\bin\Lucene.Net.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll + + + ..\..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\..\packages\Moq.4.2.1502.0911\lib\net40\Moq.dll + + + False + ..\..\..\Packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + + + False + ..\..\Components\WebAPI\System.Net.Http.dll + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll + + + False + ..\..\..\Packages\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll + + + + + + + + + ..\..\..\packages\WebFormsMVP.1.4.1.0\lib\WebFormsMvp.dll + + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + stylecop.json + + + + + + + {3b2fa1d9-ec7d-4cec-8ff5-a7700cf5cb40} + Dnn.AuthServices.Jwt + + + {6928A9B1-F88A-4581-A132-D3EB38669BB0} + DotNetNuke.Abstractions + + + {0FCA217A-5F9A-4F5B-A31B-86D64AE65198} + DotNetNuke.DependencyInjection + + + {04f77171-0634-46e0-a95e-d7477c88712e} + DotNetNuke.Log4Net + + + {ee1329fe-fd88-4e1a-968c-345e394ef080} + DotNetNuke.Web + + + {6b29aded-7b56-4484-bea5-c0e09079535b} + DotNetNuke.Library + + + {5AECE021-E449-4A7F-BF82-2FA7B236ED3E} + DotNetNuke.Tests.Utilities + + + + + + + + + + - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + --> + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + --> \ No newline at end of file diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/SearchServiceControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/SearchServiceControllerTests.cs index afa6097578b..0bef861ab33 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/SearchServiceControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/SearchServiceControllerTests.cs @@ -105,31 +105,31 @@ public void SetUp() ComponentFactory.Container = new SimpleContainer(); MockComponentProvider.ResetContainer(); - _mockDataProvider = MockComponentProvider.CreateDataProvider(); - _mockLocaleController = MockComponentProvider.CreateLocaleController(); - _mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); - _mockDataService = new Mock(); - _mockUserController = new Mock(); - _mockModuleController = new Mock(); - _mockTabController = new Mock(); - _mockHostController = new Mock(); - - SetupDataProvider(); - SetupHostController(); - SetupUserController(); - SetupPortalSettings(); - SetupModuleController(); - DeleteIndexFolder(); + this._mockDataProvider = MockComponentProvider.CreateDataProvider(); + this._mockLocaleController = MockComponentProvider.CreateLocaleController(); + this._mockCachingProvider = MockComponentProvider.CreateDataCacheProvider(); + this._mockDataService = new Mock(); + this._mockUserController = new Mock(); + this._mockModuleController = new Mock(); + this._mockTabController = new Mock(); + this._mockHostController = new Mock(); + + this.SetupDataProvider(); + this.SetupHostController(); + this.SetupUserController(); + this.SetupPortalSettings(); + this.SetupModuleController(); + this.DeleteIndexFolder(); - TabController.SetTestableInstance(_mockTabController.Object); - _internalSearchController = InternalSearchController.Instance; + TabController.SetTestableInstance(this._mockTabController.Object); + this._internalSearchController = InternalSearchController.Instance; - _mockCBO = new Mock(); + this._mockCBO = new Mock(); var tabKey = string.Format("{0}-{1}", TabSearchTypeId, 0); var userKey = string.Format("{0}-{1}", UserSearchTypeId, 0); - _mockCBO.Setup(c => c.GetCachedObject>(It.IsAny(), It.IsAny(), It.IsAny())) + this._mockCBO.Setup(c => c.GetCachedObject>(It.IsAny(), It.IsAny(), It.IsAny())) .Returns(new Dictionary() { { tabKey, TabSearchTypeName }, { userKey, UserSearchTypeName } }); - CBO.SetTestableInstance(_mockCBO.Object); + CBO.SetTestableInstance(this._mockCBO.Object); //create instance of the SearchServiceController var request = new HttpRequestMessage(); @@ -139,15 +139,15 @@ public void SetUp() provider.Setup(x => x.TryFindModuleInfo(request, out expectedModule)).Returns(true); configuration.AddTabAndModuleInfoProvider(provider.Object); request.Properties[HttpPropertyKeys.HttpConfigurationKey] = configuration; - _searchServiceController = new SearchServiceController(HtmlModDefId){Request = request }; + this._searchServiceController = new SearchServiceController(HtmlModDefId){Request = request }; - CreateNewLuceneControllerInstance(); + this.CreateNewLuceneControllerInstance(); } [TearDown] public void TearDown() { - _luceneController.Dispose(); - DeleteIndexFolder(); + this._luceneController.Dispose(); + this.DeleteIndexFolder(); CBO.ClearInstance(); TabController.ClearInstance(); InternalSearchController.ClearInstance(); @@ -160,59 +160,59 @@ public void TearDown() #region Private Methods private void CreateNewLuceneControllerInstance() { - if (_luceneController != null) + if (this._luceneController != null) { LuceneController.ClearInstance(); - _luceneController.Dispose(); + this._luceneController.Dispose(); } - _luceneController = new LuceneControllerImpl(); - LuceneController.SetTestableInstance(_luceneController); + this._luceneController = new LuceneControllerImpl(); + LuceneController.SetTestableInstance(this._luceneController); } private void SetupUserController() { - _mockUserController.Setup(c => c.GetUserById(It.IsAny(), It.IsAny())).Returns( + this._mockUserController.Setup(c => c.GetUserById(It.IsAny(), It.IsAny())).Returns( new UserInfo { UserID = UserId1, Username = UserName1, Profile = new UserProfile {} }); - UserController.SetTestableInstance(_mockUserController.Object); + UserController.SetTestableInstance(this._mockUserController.Object); } private void SetupHostController() { - _mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetString(Constants.SearchIndexFolderKey, It.IsAny())).Returns( SearchIndexFolder); - _mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())). - Returns(_readerStaleTimeSpan); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetDouble(Constants.SearchReaderRefreshTimeKey, It.IsAny())). + Returns(this._readerStaleTimeSpan); + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTitleBoostSetting, It.IsAny())).Returns( Constants.DefaultSearchTitleBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchTagBoostSetting, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchTagBoostSetting, It.IsAny())).Returns( Constants.DefaultSearchTagBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchContentBoostSetting, It.IsAny())).Returns( Constants.DefaultSearchKeywordBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())). + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchDescriptionBoostSetting, It.IsAny())). Returns(Constants.DefaultSearchDescriptionBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchAuthorBoostSetting, It.IsAny())).Returns( Constants.DefaultSearchAuthorBoost); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMinLengthKey, It.IsAny())).Returns( Constants.DefaultMinLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchMaxLengthKey, It.IsAny())).Returns( Constants.DefaultMaxLen); - _mockHostController.Setup(c => c.GetInteger(Constants.SearchRetryTimesKey, It.IsAny())).Returns( + this._mockHostController.Setup(c => c.GetInteger(Constants.SearchRetryTimesKey, It.IsAny())).Returns( DefaultSearchRetryTimes); - HostController.RegisterInstance(_mockHostController.Object); + HostController.RegisterInstance(this._mockHostController.Object); } private void SetupDataProvider() { //Standard DataProvider Path for Logging - _mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); - - _mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(GetPortalsCallBack); - _mockDataProvider.Setup(d => d.GetSearchModules(It.IsAny())).Returns(GetSearchModules); - _mockDataProvider.Setup(d => d.GetModuleDefinitions()).Returns(GetModuleDefinitions); - _mockDataProvider.Setup(d => d.GetAllSearchTypes()).Returns(GetAllSearchTypes); - _mockDataProvider.Setup(d => d.GetUser(It.IsAny(), It.IsAny())).Returns(GetUser); - _mockDataProvider.Setup(d => d.GetTabs(It.IsAny())).Returns(GetTabs); - _mockDataService.Setup(ds => ds.GetPortalGroups()).Returns(GetPortalGroups); + this._mockDataProvider.Setup(d => d.GetProviderPath()).Returns(""); + + this._mockDataProvider.Setup(d => d.GetPortals(It.IsAny())).Returns(this.GetPortalsCallBack); + this._mockDataProvider.Setup(d => d.GetSearchModules(It.IsAny())).Returns(this.GetSearchModules); + this._mockDataProvider.Setup(d => d.GetModuleDefinitions()).Returns(this.GetModuleDefinitions); + this._mockDataProvider.Setup(d => d.GetAllSearchTypes()).Returns(this.GetAllSearchTypes); + this._mockDataProvider.Setup(d => d.GetUser(It.IsAny(), It.IsAny())).Returns(this.GetUser); + this._mockDataProvider.Setup(d => d.GetTabs(It.IsAny())).Returns(this.GetTabs); + this._mockDataService.Setup(ds => ds.GetPortalGroups()).Returns(this.GetPortalGroups); - DataService.RegisterInstance(_mockDataService.Object); + DataService.RegisterInstance(this._mockDataService.Object); } @@ -224,16 +224,16 @@ private void SetupPortalSettings() } private void SetupModuleController() { - _mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId1), It.Is(p => p == PortalId0), false)).Returns( + this._mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId1), It.Is(p => p == PortalId0), false)).Returns( new ModuleInfo { ModuleID = HtmlModuleId1, ModuleDefID = HtmlModDefId, ModuleTitle = HtmlModuleTitle1 }); - _mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId2), It.Is(p => p == PortalId0), false)).Returns( + this._mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId2), It.Is(p => p == PortalId0), false)).Returns( new ModuleInfo { ModuleID = HtmlModuleId2, ModuleDefID = HtmlModDefId, ModuleTitle = HtmlModuleTitle2 }); - _mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId3), It.Is(p => p == PortalId0), false)).Returns( + this._mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId3), It.Is(p => p == PortalId0), false)).Returns( new ModuleInfo { ModuleID = HtmlModuleId3, ModuleDefID = HtmlModDefId, ModuleTitle = HtmlModuleTitle3 }); - _mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId4), It.Is(p => p == PortalId0), false)).Returns( + this._mockModuleController.Setup(mc => mc.GetModule(It.Is(m => m == HtmlModuleId4), It.Is(p => p == PortalId0), false)).Returns( new ModuleInfo { ModuleID = HtmlModuleId4, ModuleDefID = HtmlModDefId, ModuleTitle = HtmlModuleTitle4 }); - ModuleController.SetTestableInstance(_mockModuleController.Object); + ModuleController.SetTestableInstance(this._mockModuleController.Object); } private void DeleteIndexFolder() { @@ -486,7 +486,7 @@ private IDataReader GetAllSearchTypes() } private IDataReader GetPortalsCallBack(string culture) { - return GetPortalCallBack(PortalId0, CultureEnUs); + return this.GetPortalCallBack(PortalId0, CultureEnUs); } private IDataReader GetPortalCallBack(int portalId, string culture) { @@ -533,7 +533,7 @@ private IEnumerable GetGroupBasicViewResults(SearchQuery query LocalizedName = UserSearchTypeName, ModuleDefinitionId = 0 }; - var results = _searchServiceController.GetGroupedBasicViews(query, userSearchContentSource, PortalId0); + var results = this._searchServiceController.GetGroupedBasicViews(query, userSearchContentSource, PortalId0); return results; } @@ -541,7 +541,7 @@ private IEnumerable GetGroupedDetailViewResults(SearchQuery s { bool more = false; int totalHits = 0; - var results = _searchServiceController.GetGroupedDetailViews(searchQuery, UserSearchTypeId, out totalHits, out more); + var results = this._searchServiceController.GetGroupedDetailViews(searchQuery, UserSearchTypeId, out totalHits, out more); return results; } @@ -565,12 +565,12 @@ public void GetSearchResultsDetailed() //user doc var userdoc = new SearchDocument { UniqueKey = "key06", Url = userUrl, Title = keyword, SearchTypeId = UserSearchTypeId, ModifiedTimeUtc = DateTime.UtcNow, RoleId = RoleId731 }; - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(doc3); - _internalSearchController.AddSearchDocument(doc4); - _internalSearchController.AddSearchDocument(doc5); - _internalSearchController.AddSearchDocument(userdoc); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(doc3); + this._internalSearchController.AddSearchDocument(doc4); + this._internalSearchController.AddSearchDocument(doc5); + this._internalSearchController.AddSearchDocument(userdoc); var query = new SearchQuery { @@ -580,7 +580,7 @@ public void GetSearchResultsDetailed() }; //Run - var search = GetGroupedDetailViewResults(query); + var search = this.GetGroupedDetailViewResults(query); //Assert var groupedDetailViews = search as List ?? search.ToList(); @@ -611,10 +611,10 @@ public void GetSearchResultsBasic() var doc2 = new SearchDocument { UniqueKey = "key02", TabId = TabId2, Url = tabUrl2, Title = keyword, SearchTypeId = TabSearchTypeId, ModifiedTimeUtc = now, PortalId = PortalId0, RoleId = RoleId0 }; var userdoc = new SearchDocument { UniqueKey = "key03", Url = userUrl, Title = keyword, SearchTypeId = UserSearchTypeId, ModifiedTimeUtc = now, PortalId = PortalId0, RoleId = RoleId0 }; - _internalSearchController.AddSearchDocument(doc1); - _internalSearchController.AddSearchDocument(doc2); - _internalSearchController.AddSearchDocument(userdoc); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(doc1); + this._internalSearchController.AddSearchDocument(doc2); + this._internalSearchController.AddSearchDocument(userdoc); + this._internalSearchController.Commit(); var query = new SearchQuery { @@ -632,7 +632,7 @@ public void GetSearchResultsBasic() }; //Run - var search = GetGroupBasicViewResults(query); + var search = this.GetGroupBasicViewResults(query); //Assert - overall 2 groups: tabs and users var groupedBasicViews = search as List ?? search.ToList(); Assert.AreEqual(2, groupedBasicViews.Count()); @@ -673,8 +673,8 @@ public void ModifyingDocumentsDoesNotCreateDuplicates() NumericKeys = { {"points", 5} } }; - _internalSearchController.AddSearchDocument(originalDocument); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(originalDocument); + this._internalSearchController.Commit(); var modifiedDocument = new SearchDocument { @@ -691,8 +691,8 @@ public void ModifyingDocumentsDoesNotCreateDuplicates() NumericKeys = { { "points", 8 }, {"point2", 7 } } }; - _internalSearchController.AddSearchDocument(modifiedDocument); - _internalSearchController.Commit(); + this._internalSearchController.AddSearchDocument(modifiedDocument); + this._internalSearchController.Commit(); var query = new SearchQuery { @@ -710,7 +710,7 @@ public void ModifyingDocumentsDoesNotCreateDuplicates() }; //Run - var searchResults = GetGroupedDetailViewResults(query).ToList(); + var searchResults = this.GetGroupedDetailViewResults(query).ToList(); //Assert Assert.AreEqual(1, searchResults.Count()); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/TabVersionControllerTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/TabVersionControllerTests.cs index 0234b6c32d3..cce4bed6d04 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/TabVersionControllerTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/InternalServices/TabVersionControllerTests.cs @@ -61,8 +61,8 @@ public static IEnumerable TestCases() public void Setup() { MockComponentProvider.ResetContainer(); - SetupCBO(); - SetupHostController(); + this.SetupCBO(); + this.SetupHostController(); } [Test, TestCaseSource(typeof(TestCaseFactory), "TestCases")] @@ -70,7 +70,7 @@ public void GetTabVersions_Verify_User_Preferred_TimeZone(string userPreferredTi { // Arrange - SetupUserController(userPreferredTimeZone); + this.SetupUserController(userPreferredTimeZone); // Act var tabVersionController = new TabVersionControllerTestable(); @@ -87,23 +87,23 @@ public void GetTabVersions_Verify_User_Preferred_TimeZone(string userPreferredTi private void SetupCBO() { - _mockCBO = new Mock(); - _mockCBO.Setup(c => c.GetCachedObject>(It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(GetMockedTabVersions); - CBO.SetTestableInstance(_mockCBO.Object); + this._mockCBO = new Mock(); + this._mockCBO.Setup(c => c.GetCachedObject>(It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(this.GetMockedTabVersions); + CBO.SetTestableInstance(this._mockCBO.Object); } private void SetupUserController(string timeZoneId) { - _mockUserController = new Mock(); - _mockUserController.Setup(userController => userController.GetCurrentUserInfo()).Returns(GetMockedUser(timeZoneId)); - UserController.SetTestableInstance(_mockUserController.Object); + this._mockUserController = new Mock(); + this._mockUserController.Setup(userController => userController.GetCurrentUserInfo()).Returns(this.GetMockedUser(timeZoneId)); + UserController.SetTestableInstance(this._mockUserController.Object); } private UserInfo GetMockedUser(string timeZoneId) { var profile = new UserProfile() { - PreferredTimeZone = GetMockedUserTimeZone(timeZoneId) + PreferredTimeZone = this.GetMockedUserTimeZone(timeZoneId) }; profile.ProfileProperties.Add(new Entities.Profile.ProfilePropertyDefinition(99) @@ -112,7 +112,7 @@ private UserInfo GetMockedUser(string timeZoneId) PropertyDefinitionId = 20, PropertyCategory = "Preferences", PropertyName = "PreferredTimeZone", - PropertyValue = GetMockedUserTimeZone(timeZoneId).Id + PropertyValue = this.GetMockedUserTimeZone(timeZoneId).Id }); var user = new UserInfo() { @@ -139,7 +139,7 @@ private TabVersion GetMockedTabVersion() Version = 1, CreatedByUserID = UserID }; - tabVersion.GetType().BaseType.GetProperty("CreatedOnDate").SetValue(tabVersion, ServerCreateOnDate, null); + tabVersion.GetType().BaseType.GetProperty("CreatedOnDate").SetValue(tabVersion, this.ServerCreateOnDate, null); return tabVersion; } @@ -148,15 +148,15 @@ private List GetMockedTabVersions() { return new List() { - GetMockedTabVersion() + this.GetMockedTabVersion() }; } private void SetupHostController() { - _mockHostController = new Mock(); - _mockHostController.Setup(c => c.GetString(It.IsRegex("PerformanceSetting"))).Returns(Globals.PerformanceSettings.LightCaching.ToString()); - HostController.RegisterInstance(_mockHostController.Object); + this._mockHostController = new Mock(); + this._mockHostController.Setup(c => c.GetString(It.IsRegex("PerformanceSetting"))).Returns(Globals.PerformanceSettings.LightCaching.ToString()); + HostController.RegisterInstance(this._mockHostController.Object); } } diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/Mvp/ModuleSettingsPresenterTests.cs b/DNN Platform/Tests/DotNetNuke.Tests.Web/Mvp/ModuleSettingsPresenterTests.cs index 42705e5f5b1..8dace5bec22 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/Mvp/ModuleSettingsPresenterTests.cs +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/Mvp/ModuleSettingsPresenterTests.cs @@ -52,7 +52,7 @@ public void ModuleSettingsPresenter_Load_Initialises_Both_Dictionaries_On_PostBa var view = new Mock>(); view.SetupGet(v => v.Model).Returns(new SettingsModel()); - var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = CreateModuleContext() }; + var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = this.CreateModuleContext() }; presenter.IsPostBack = true; //Act @@ -73,7 +73,7 @@ public void ModuleSettingsPresenter_Load_Does_Not_Initialise_Dictionaries_If_Not var view = new Mock>(); view.SetupGet(v => v.Model).Returns(new SettingsModel()); - var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = CreateModuleContext() }; + var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = this.CreateModuleContext() }; presenter.IsPostBack = false; //Act @@ -91,7 +91,7 @@ public void ModuleSettingsPresenter_LoadSettings_Loads_Both_Dictionaries() var view = new Mock>(); view.SetupGet(v => v.Model).Returns(new SettingsModel()); - var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = CreateModuleContext() }; + var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = this.CreateModuleContext() }; presenter.IsPostBack = false; view.Raise(v => v.Load += null, EventArgs.Empty); @@ -117,7 +117,7 @@ public void ModuleSettingsPresenter_SaveSettings_Saves_ModuleSettings() var controller = new Mock(); - var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = CreateModuleContext() }; + var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = this.CreateModuleContext() }; presenter.IsPostBack = true; view.Raise(v => v.Load += null, EventArgs.Empty); @@ -143,7 +143,7 @@ public void ModuleSettingsPresenter_SaveSettings_Saves_TabModuleSettings() var controller = new Mock(); - var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = CreateModuleContext() }; + var presenter = new TestSettingsPresenter(view.Object) { ModuleContext = this.CreateModuleContext() }; presenter.IsPostBack = true; view.Raise(v => v.Load += null, EventArgs.Empty); diff --git a/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config b/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config index ac1084c42d4..b736bdf53e0 100644 --- a/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config +++ b/DNN Platform/Tests/DotNetNuke.Tests.Web/packages.config @@ -1,14 +1,15 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DNN Platform/Website/Default.aspx.cs b/DNN Platform/Website/Default.aspx.cs index 9bbfcf117bb..e15c57bd451 100644 --- a/DNN Platform/Website/Default.aspx.cs +++ b/DNN Platform/Website/Default.aspx.cs @@ -69,7 +69,7 @@ public partial class DefaultPage : CDefault, IClientAPICallbackEventHandler public DefaultPage() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Properties @@ -87,28 +87,28 @@ public int PageScrollTop get { int pageScrollTop; - var scrollValue = ScrollTop != null ? ScrollTop.Value : ""; + var scrollValue = this.ScrollTop != null ? this.ScrollTop.Value : ""; if (!int.TryParse(scrollValue, out pageScrollTop) || pageScrollTop < 0) { pageScrollTop = Null.NullInteger; } return pageScrollTop; } - set { ScrollTop.Value = value.ToString(); } + set { this.ScrollTop.Value = value.ToString(); } } protected string HtmlAttributeList { get { - if ((HtmlAttributes != null) && (HtmlAttributes.Count > 0)) + if ((this.HtmlAttributes != null) && (this.HtmlAttributes.Count > 0)) { var attr = new StringBuilder(); - foreach (string attributeName in HtmlAttributes.Keys) + foreach (string attributeName in this.HtmlAttributes.Keys) { - if ((!String.IsNullOrEmpty(attributeName)) && (HtmlAttributes[attributeName] != null)) + if ((!String.IsNullOrEmpty(attributeName)) && (this.HtmlAttributes[attributeName] != null)) { - string attributeValue = HtmlAttributes[attributeName]; + string attributeValue = this.HtmlAttributes[attributeName]; if ((attributeValue.IndexOf(",") > 0)) { var attributeValues = attributeValue.Split(','); @@ -145,7 +145,7 @@ public string CurrentSkinPath public string RaiseClientAPICallbackEvent(string eventArgument) { - var dict = ParsePageCallBackArgs(eventArgument); + var dict = this.ParsePageCallBackArgs(eventArgument); if (dict.ContainsKey("type")) { if (DNNClientAPI.IsPersonalizationKeyRegistered(dict["namingcontainer"] + ClientAPI.CUSTOM_COLUMN_DELIMITER + dict["key"]) == false) @@ -193,79 +193,79 @@ private void InitializePage() } //Configure the ActiveTab with Skin/Container information - PortalSettingsController.Instance().ConfigureActiveTab(PortalSettings); + PortalSettingsController.Instance().ConfigureActiveTab(this.PortalSettings); //redirect to a specific tab based on name - if (!String.IsNullOrEmpty(Request.QueryString["tabname"])) + if (!String.IsNullOrEmpty(this.Request.QueryString["tabname"])) { - TabInfo tab = TabController.Instance.GetTabByName(Request.QueryString["TabName"], PortalSettings.PortalId); + TabInfo tab = TabController.Instance.GetTabByName(this.Request.QueryString["TabName"], this.PortalSettings.PortalId); if (tab != null) { var parameters = new List(); //maximum number of elements - for (int intParam = 0; intParam <= Request.QueryString.Count - 1; intParam++) + for (int intParam = 0; intParam <= this.Request.QueryString.Count - 1; intParam++) { - switch (Request.QueryString.Keys[intParam].ToLowerInvariant()) + switch (this.Request.QueryString.Keys[intParam].ToLowerInvariant()) { case "tabid": case "tabname": break; default: parameters.Add( - Request.QueryString.Keys[intParam] + "=" + Request.QueryString[intParam]); + this.Request.QueryString.Keys[intParam] + "=" + this.Request.QueryString[intParam]); break; } } - Response.Redirect(NavigationManager.NavigateURL(tab.TabID, Null.NullString, parameters.ToArray()), true); + this.Response.Redirect(this.NavigationManager.NavigateURL(tab.TabID, Null.NullString, parameters.ToArray()), true); } else { //404 Error - Redirect to ErrorPage - Exceptions.ProcessHttpException(Request); + Exceptions.ProcessHttpException(this.Request); } } - string cacheability = Request.IsAuthenticated ? Host.AuthenticatedCacheability : Host.UnauthenticatedCacheability; + string cacheability = this.Request.IsAuthenticated ? Host.AuthenticatedCacheability : Host.UnauthenticatedCacheability; switch (cacheability) { case "0": - Response.Cache.SetCacheability(HttpCacheability.NoCache); + this.Response.Cache.SetCacheability(HttpCacheability.NoCache); break; case "1": - Response.Cache.SetCacheability(HttpCacheability.Private); + this.Response.Cache.SetCacheability(HttpCacheability.Private); break; case "2": - Response.Cache.SetCacheability(HttpCacheability.Public); + this.Response.Cache.SetCacheability(HttpCacheability.Public); break; case "3": - Response.Cache.SetCacheability(HttpCacheability.Server); + this.Response.Cache.SetCacheability(HttpCacheability.Server); break; case "4": - Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); + this.Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); break; case "5": - Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate); + this.Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate); break; } //Only insert the header control if a comment is needed - if(!String.IsNullOrWhiteSpace(Comment)) - Page.Header.Controls.AddAt(0, new LiteralControl(Comment)); + if(!String.IsNullOrWhiteSpace(this.Comment)) + this.Page.Header.Controls.AddAt(0, new LiteralControl(this.Comment)); - if (PortalSettings.ActiveTab.PageHeadText != Null.NullString && !Globals.IsAdminControl()) + if (this.PortalSettings.ActiveTab.PageHeadText != Null.NullString && !Globals.IsAdminControl()) { - Page.Header.Controls.Add(new LiteralControl(PortalSettings.ActiveTab.PageHeadText)); + this.Page.Header.Controls.Add(new LiteralControl(this.PortalSettings.ActiveTab.PageHeadText)); } - if (!string.IsNullOrEmpty(PortalSettings.PageHeadText)) + if (!string.IsNullOrEmpty(this.PortalSettings.PageHeadText)) { - metaPanel.Controls.Add(new LiteralControl(PortalSettings.PageHeadText)); + this.metaPanel.Controls.Add(new LiteralControl(this.PortalSettings.PageHeadText)); } //set page title if (UrlUtils.InPopUp()) { - var strTitle = new StringBuilder(PortalSettings.PortalName); - var slaveModule = UIUtilities.GetSlaveModule(PortalSettings.ActiveTab.TabID); + var strTitle = new StringBuilder(this.PortalSettings.PortalName); + var slaveModule = UIUtilities.GetSlaveModule(this.PortalSettings.ActiveTab.TabID); //Skip is popup is just a tab (no slave module) if (slaveModule.DesktopModuleID != Null.NullInteger) @@ -292,142 +292,142 @@ private void InitializePage() } var title = Localization.LocalizeControlTitle(control); - strTitle.Append(string.Concat(" > ", PortalSettings.ActiveTab.LocalizedTabName)); + strTitle.Append(string.Concat(" > ", this.PortalSettings.ActiveTab.LocalizedTabName)); strTitle.Append(string.Concat(" > ", title)); } else { - strTitle.Append(string.Concat(" > ", PortalSettings.ActiveTab.LocalizedTabName)); + strTitle.Append(string.Concat(" > ", this.PortalSettings.ActiveTab.LocalizedTabName)); } //Set to page - Title = strTitle.ToString(); + this.Title = strTitle.ToString(); } else { //If tab is named, use that title, otherwise build it out via breadcrumbs - if (!string.IsNullOrEmpty(PortalSettings.ActiveTab.Title)) + if (!string.IsNullOrEmpty(this.PortalSettings.ActiveTab.Title)) { - Title = PortalSettings.ActiveTab.Title; + this.Title = this.PortalSettings.ActiveTab.Title; } else { //Elected for SB over true concatenation here due to potential for long nesting depth - var strTitle = new StringBuilder(PortalSettings.PortalName); - foreach (TabInfo tab in PortalSettings.ActiveTab.BreadCrumbs) + var strTitle = new StringBuilder(this.PortalSettings.PortalName); + foreach (TabInfo tab in this.PortalSettings.ActiveTab.BreadCrumbs) { strTitle.Append(string.Concat(" > ", tab.TabName)); } - Title = strTitle.ToString(); + this.Title = strTitle.ToString(); } } //set the background image if there is one selected - if (!UrlUtils.InPopUp() && FindControl("Body") != null) + if (!UrlUtils.InPopUp() && this.FindControl("Body") != null) { - if (!string.IsNullOrEmpty(PortalSettings.BackgroundFile)) + if (!string.IsNullOrEmpty(this.PortalSettings.BackgroundFile)) { - var fileInfo = GetBackgroundFileInfo(); + var fileInfo = this.GetBackgroundFileInfo(); var url = FileManager.Instance.GetUrl(fileInfo); - ((HtmlGenericControl)FindControl("Body")).Attributes["style"] = string.Concat("background-image: url('", url, "')"); + ((HtmlGenericControl)this.FindControl("Body")).Attributes["style"] = string.Concat("background-image: url('", url, "')"); } } //META Refresh // Only autorefresh the page if we are in VIEW-mode and if we aren't displaying some module's subcontrol. - if (PortalSettings.ActiveTab.RefreshInterval > 0 && this.PortalSettings.UserMode == PortalSettings.Mode.View && Request.QueryString["ctl"] == null) + if (this.PortalSettings.ActiveTab.RefreshInterval > 0 && this.PortalSettings.UserMode == PortalSettings.Mode.View && this.Request.QueryString["ctl"] == null) { - MetaRefresh.Content = PortalSettings.ActiveTab.RefreshInterval.ToString(); - MetaRefresh.Visible = true; + this.MetaRefresh.Content = this.PortalSettings.ActiveTab.RefreshInterval.ToString(); + this.MetaRefresh.Visible = true; } else { - MetaRefresh.Visible = false; + this.MetaRefresh.Visible = false; } //META description - if (!string.IsNullOrEmpty(PortalSettings.ActiveTab.Description)) + if (!string.IsNullOrEmpty(this.PortalSettings.ActiveTab.Description)) { - Description = PortalSettings.ActiveTab.Description; + this.Description = this.PortalSettings.ActiveTab.Description; } else { - Description = PortalSettings.Description; + this.Description = this.PortalSettings.Description; } //META keywords - if (!string.IsNullOrEmpty(PortalSettings.ActiveTab.KeyWords)) + if (!string.IsNullOrEmpty(this.PortalSettings.ActiveTab.KeyWords)) { - KeyWords = PortalSettings.ActiveTab.KeyWords; + this.KeyWords = this.PortalSettings.ActiveTab.KeyWords; } else { - KeyWords = PortalSettings.KeyWords; + this.KeyWords = this.PortalSettings.KeyWords; } //META copyright - if (!string.IsNullOrEmpty(PortalSettings.FooterText)) + if (!string.IsNullOrEmpty(this.PortalSettings.FooterText)) { - Copyright = PortalSettings.FooterText.Replace("[year]", DateTime.Now.Year.ToString()); + this.Copyright = this.PortalSettings.FooterText.Replace("[year]", DateTime.Now.Year.ToString()); } else { - Copyright = string.Concat("Copyright (c) ", DateTime.Now.Year, " by ", PortalSettings.PortalName); + this.Copyright = string.Concat("Copyright (c) ", DateTime.Now.Year, " by ", this.PortalSettings.PortalName); } //META generator - Generator = ""; + this.Generator = ""; //META Robots - hide it inside popups and if PageHeadText of current tab already contains a robots meta tag if (!UrlUtils.InPopUp() && - !(HeaderTextRegex.IsMatch(PortalSettings.ActiveTab.PageHeadText) || - HeaderTextRegex.IsMatch(PortalSettings.PageHeadText))) + !(HeaderTextRegex.IsMatch(this.PortalSettings.ActiveTab.PageHeadText) || + HeaderTextRegex.IsMatch(this.PortalSettings.PageHeadText))) { - MetaRobots.Visible = true; + this.MetaRobots.Visible = true; var allowIndex = true; - if ((PortalSettings.ActiveTab.TabSettings.ContainsKey("AllowIndex") && - bool.TryParse(PortalSettings.ActiveTab.TabSettings["AllowIndex"].ToString(), out allowIndex) && + if ((this.PortalSettings.ActiveTab.TabSettings.ContainsKey("AllowIndex") && + bool.TryParse(this.PortalSettings.ActiveTab.TabSettings["AllowIndex"].ToString(), out allowIndex) && !allowIndex) || - (Request.QueryString["ctl"] != null && - (Request.QueryString["ctl"] == "Login" || Request.QueryString["ctl"] == "Register"))) + (this.Request.QueryString["ctl"] != null && + (this.Request.QueryString["ctl"] == "Login" || this.Request.QueryString["ctl"] == "Register"))) { - MetaRobots.Content = "NOINDEX, NOFOLLOW"; + this.MetaRobots.Content = "NOINDEX, NOFOLLOW"; } else { - MetaRobots.Content = "INDEX, FOLLOW"; + this.MetaRobots.Content = "INDEX, FOLLOW"; } } //NonProduction Label Injection - if (NonProductionVersion() && Host.DisplayBetaNotice && !UrlUtils.InPopUp()) + if (this.NonProductionVersion() && Host.DisplayBetaNotice && !UrlUtils.InPopUp()) { string versionString = string.Format(" ({0} Version: {1})", DotNetNukeContext.Current.Application.Status, DotNetNukeContext.Current.Application.Version); - Title += versionString; + this.Title += versionString; } //register the custom stylesheet of current page - if (PortalSettings.ActiveTab.TabSettings.ContainsKey("CustomStylesheet") && !string.IsNullOrEmpty(PortalSettings.ActiveTab.TabSettings["CustomStylesheet"].ToString())) + if (this.PortalSettings.ActiveTab.TabSettings.ContainsKey("CustomStylesheet") && !string.IsNullOrEmpty(this.PortalSettings.ActiveTab.TabSettings["CustomStylesheet"].ToString())) { - var customStylesheet = Path.Combine(PortalSettings.HomeDirectory, PortalSettings.ActiveTab.TabSettings["CustomStylesheet"].ToString()); + var customStylesheet = Path.Combine(this.PortalSettings.HomeDirectory, this.PortalSettings.ActiveTab.TabSettings["CustomStylesheet"].ToString()); ClientResourceManager.RegisterStyleSheet(this, customStylesheet); } // Cookie Consent - if (PortalSettings.ShowCookieConsent) + if (this.PortalSettings.ShowCookieConsent) { - ClientAPI.RegisterClientVariable(this, "cc_morelink", PortalSettings.CookieMoreLink, true); + ClientAPI.RegisterClientVariable(this, "cc_morelink", this.PortalSettings.CookieMoreLink, true); ClientAPI.RegisterClientVariable(this, "cc_message", Localization.GetString("cc_message", Localization.GlobalResourceFile), true); ClientAPI.RegisterClientVariable(this, "cc_dismiss", Localization.GetString("cc_dismiss", Localization.GlobalResourceFile), true); ClientAPI.RegisterClientVariable(this, "cc_link", Localization.GetString("cc_link", Localization.GlobalResourceFile), true); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/Components/CookieConsent/cookieconsent.min.js", FileOrder.Js.DnnControls); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/Components/CookieConsent/cookieconsent.min.css", FileOrder.Css.ResourceCss); - ClientResourceManager.RegisterScript(Page, "~/js/dnn.cookieconsent.js", FileOrder.Js.DefaultPriority); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/Components/CookieConsent/cookieconsent.min.js", FileOrder.Js.DnnControls); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/Components/CookieConsent/cookieconsent.min.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterScript(this.Page, "~/js/dnn.cookieconsent.js", FileOrder.Js.DefaultPriority); } } @@ -442,37 +442,37 @@ private void InitializePage() private void SetSkinDoctype() { string strLang = CultureInfo.CurrentCulture.ToString(); - string strDocType = PortalSettings.ActiveTab.SkinDoctype; + string strDocType = this.PortalSettings.ActiveTab.SkinDoctype; if (strDocType.Contains("XHTML 1.0")) { //XHTML 1.0 - HtmlAttributes.Add("xml:lang", strLang); - HtmlAttributes.Add("lang", strLang); - HtmlAttributes.Add("xmlns", "http://www.w3.org/1999/xhtml"); + this.HtmlAttributes.Add("xml:lang", strLang); + this.HtmlAttributes.Add("lang", strLang); + this.HtmlAttributes.Add("xmlns", "http://www.w3.org/1999/xhtml"); } else if (strDocType.Contains("XHTML 1.1")) { //XHTML 1.1 - HtmlAttributes.Add("xml:lang", strLang); - HtmlAttributes.Add("xmlns", "http://www.w3.org/1999/xhtml"); + this.HtmlAttributes.Add("xml:lang", strLang); + this.HtmlAttributes.Add("xmlns", "http://www.w3.org/1999/xhtml"); } else { //other - HtmlAttributes.Add("lang", strLang); + this.HtmlAttributes.Add("lang", strLang); } //Find the placeholder control and render the doctype - skinDocType.Text = PortalSettings.ActiveTab.SkinDoctype; - attributeList.Text = HtmlAttributeList; + this.skinDocType.Text = this.PortalSettings.ActiveTab.SkinDoctype; + this.attributeList.Text = this.HtmlAttributeList; } private void ManageFavicon() { - string headerLink = FavIcon.GetHeaderLink(PortalSettings.PortalId); + string headerLink = FavIcon.GetHeaderLink(this.PortalSettings.PortalId); if (!String.IsNullOrEmpty(headerLink)) { - Page.Header.Controls.Add(new Literal { Text = headerLink }); + this.Page.Header.Controls.Add(new Literal { Text = headerLink }); } } @@ -510,7 +510,7 @@ private Dictionary ParsePageCallBackArgs(string strArg) /// private string RenderDefaultsWarning() { - var warningLevel = Request.QueryString["runningDefault"]; + var warningLevel = this.Request.QueryString["runningDefault"]; var warningMessage = string.Empty; switch (warningLevel) { @@ -529,16 +529,16 @@ private string RenderDefaultsWarning() private IFileInfo GetBackgroundFileInfo() { - string cacheKey = String.Format(Common.Utilities.DataCache.PortalCacheKey, PortalSettings.PortalId, "BackgroundFile"); + string cacheKey = String.Format(Common.Utilities.DataCache.PortalCacheKey, this.PortalSettings.PortalId, "BackgroundFile"); var file = CBO.GetCachedObject(new CacheItemArgs(cacheKey, Common.Utilities.DataCache.PortalCacheTimeOut, Common.Utilities.DataCache.PortalCachePriority), - GetBackgroundFileInfoCallBack); + this.GetBackgroundFileInfoCallBack); return file; } private IFileInfo GetBackgroundFileInfoCallBack(CacheItemArgs itemArgs) { - return FileManager.Instance.GetFile(PortalSettings.PortalId, PortalSettings.BackgroundFile); + return FileManager.Instance.GetFile(this.PortalSettings.PortalId, this.PortalSettings.BackgroundFile); } #endregion @@ -567,11 +567,11 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //set global page settings - InitializePage(); + this.InitializePage(); //load skin control and register UI js UI.Skins.Skin ctlSkin; - if (PortalSettings.EnablePopUps) + if (this.PortalSettings.EnablePopUps) { ctlSkin = UrlUtils.InPopUp() ? UI.Skins.Skin.GetPopUpSkin(this) : UI.Skins.Skin.GetSkin(this); @@ -590,14 +590,14 @@ protected override void OnInit(EventArgs e) } // DataBind common paths for the client resource loader - ClientResourceLoader.DataBind(); - ClientResourceLoader.PreRender += (sender, args) => JavaScript.Register(Page); + this.ClientResourceLoader.DataBind(); + this.ClientResourceLoader.PreRender += (sender, args) => JavaScript.Register(this.Page); //check for and read skin package level doctype - SetSkinDoctype(); + this.SetSkinDoctype(); //Manage disabled pages - if (PortalSettings.ActiveTab.DisableLink) + if (this.PortalSettings.ActiveTab.DisableLink) { if (TabPermissionController.CanAdminPage()) { @@ -608,56 +608,56 @@ protected override void OnInit(EventArgs e) } else { - if (PortalSettings.HomeTabId > 0) + if (this.PortalSettings.HomeTabId > 0) { - Response.Redirect(NavigationManager.NavigateURL(PortalSettings.HomeTabId), true); + this.Response.Redirect(this.NavigationManager.NavigateURL(this.PortalSettings.HomeTabId), true); } else { - Response.Redirect(Globals.GetPortalDomainName(PortalSettings.PortalAlias.HTTPAlias, Request, true), true); + this.Response.Redirect(Globals.GetPortalDomainName(this.PortalSettings.PortalAlias.HTTPAlias, this.Request, true), true); } } } //Manage canonical urls - if (PortalSettings.PortalAliasMappingMode == PortalSettings.PortalAliasMapping.CanonicalUrl) + if (this.PortalSettings.PortalAliasMappingMode == PortalSettings.PortalAliasMapping.CanonicalUrl) { string primaryHttpAlias = null; if (Config.GetFriendlyUrlProvider() == "advanced") //advanced mode compares on the primary alias as set during alias identification { - if (PortalSettings.PrimaryAlias != null && PortalSettings.PortalAlias != null) + if (this.PortalSettings.PrimaryAlias != null && this.PortalSettings.PortalAlias != null) { - if (string.Compare(PortalSettings.PrimaryAlias.HTTPAlias, PortalSettings.PortalAlias.HTTPAlias, StringComparison.InvariantCulture ) != 0) + if (string.Compare(this.PortalSettings.PrimaryAlias.HTTPAlias, this.PortalSettings.PortalAlias.HTTPAlias, StringComparison.InvariantCulture ) != 0) { - primaryHttpAlias = PortalSettings.PrimaryAlias.HTTPAlias; + primaryHttpAlias = this.PortalSettings.PrimaryAlias.HTTPAlias; } } } else //other modes just depend on the default alias { - if (string.Compare(PortalSettings.PortalAlias.HTTPAlias, PortalSettings.DefaultPortalAlias, StringComparison.InvariantCulture ) != 0) - primaryHttpAlias = PortalSettings.DefaultPortalAlias; + if (string.Compare(this.PortalSettings.PortalAlias.HTTPAlias, this.PortalSettings.DefaultPortalAlias, StringComparison.InvariantCulture ) != 0) + primaryHttpAlias = this.PortalSettings.DefaultPortalAlias; } - if (primaryHttpAlias != null && string.IsNullOrEmpty(CanonicalLinkUrl))//a primary http alias was identified + if (primaryHttpAlias != null && string.IsNullOrEmpty(this.CanonicalLinkUrl))//a primary http alias was identified { - var originalurl = Context.Items["UrlRewrite:OriginalUrl"].ToString(); - CanonicalLinkUrl = originalurl.Replace(PortalSettings.PortalAlias.HTTPAlias, primaryHttpAlias); + var originalurl = this.Context.Items["UrlRewrite:OriginalUrl"].ToString(); + this.CanonicalLinkUrl = originalurl.Replace(this.PortalSettings.PortalAlias.HTTPAlias, primaryHttpAlias); - if (UrlUtils.IsSecureConnectionOrSslOffload(Request)) + if (UrlUtils.IsSecureConnectionOrSslOffload(this.Request)) { - CanonicalLinkUrl = CanonicalLinkUrl.Replace("http://", "https://"); + this.CanonicalLinkUrl = this.CanonicalLinkUrl.Replace("http://", "https://"); } } } //check if running with known account defaults - if (Request.IsAuthenticated && string.IsNullOrEmpty(Request.QueryString["runningDefault"]) == false) + if (this.Request.IsAuthenticated && string.IsNullOrEmpty(this.Request.QueryString["runningDefault"]) == false) { var userInfo = HttpContext.Current.Items["UserInfo"] as UserInfo; var usernameLower = userInfo?.Username?.ToLowerInvariant(); //only show message to default users if ("admin".Equals(usernameLower) || "host".Equals(usernameLower)) { - var messageText = RenderDefaultsWarning(); + var messageText = this.RenderDefaultsWarning(); var messageTitle = Localization.GetString("InsecureDefaults.Title", Localization.GlobalResourceFile); UI.Skins.Skin.AddPageMessage(ctlSkin, messageTitle, messageText, ModuleMessage.ModuleMessageType.RedError); } @@ -671,20 +671,20 @@ protected override void OnInit(EventArgs e) ClientResourceManager.RegisterStyleSheet(this, ctlSkin.SkinSrc.Replace(".ascx", ".css"), FileOrder.Css.SpecificSkinCss); //add skin to page - SkinPlaceHolder.Controls.Add(ctlSkin); + this.SkinPlaceHolder.Controls.Add(ctlSkin); - ClientResourceManager.RegisterStyleSheet(this, string.Concat(PortalSettings.HomeDirectory, "portal.css"), FileOrder.Css.PortalCss); + ClientResourceManager.RegisterStyleSheet(this, string.Concat(this.PortalSettings.HomeDirectory, "portal.css"), FileOrder.Css.PortalCss); //add Favicon - ManageFavicon(); + this.ManageFavicon(); //ClientCallback Logic ClientAPI.HandleClientAPICallbackEvent(this); //add viewstateuserkey to protect against CSRF attacks - if (User.Identity.IsAuthenticated) + if (this.User.Identity.IsAuthenticated) { - ViewStateUserKey = User.Identity.Name; + this.ViewStateUserKey = this.User.Identity.Name; } //set the async postback timeout. @@ -706,12 +706,12 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - ManageInstallerFiles(); + this.ManageInstallerFiles(); - if (!String.IsNullOrEmpty(ScrollTop.Value)) + if (!String.IsNullOrEmpty(this.ScrollTop.Value)) { - DNNClientAPI.SetScrollTop(Page); - ScrollTop.Value = ScrollTop.Value; + DNNClientAPI.SetScrollTop(this.Page); + this.ScrollTop.Value = this.ScrollTop.Value; } } @@ -720,55 +720,55 @@ protected override void OnPreRender(EventArgs evt) base.OnPreRender(evt); //Set the Head tags - metaPanel.Visible = !UrlUtils.InPopUp(); + this.metaPanel.Visible = !UrlUtils.InPopUp(); if (!UrlUtils.InPopUp()) { - MetaGenerator.Content = Generator; - MetaGenerator.Visible = (!String.IsNullOrEmpty(Generator)); - MetaAuthor.Content = PortalSettings.PortalName; + this.MetaGenerator.Content = this.Generator; + this.MetaGenerator.Visible = (!String.IsNullOrEmpty(this.Generator)); + this.MetaAuthor.Content = this.PortalSettings.PortalName; /* * Never show to be html5 compatible and stay backward compatible * * MetaCopyright.Content = Copyright; * MetaCopyright.Visible = (!String.IsNullOrEmpty(Copyright)); */ - MetaKeywords.Content = KeyWords; - MetaKeywords.Visible = (!String.IsNullOrEmpty(KeyWords)); - MetaDescription.Content = Description; - MetaDescription.Visible = (!String.IsNullOrEmpty(Description)); + this.MetaKeywords.Content = this.KeyWords; + this.MetaKeywords.Visible = (!String.IsNullOrEmpty(this.KeyWords)); + this.MetaDescription.Content = this.Description; + this.MetaDescription.Visible = (!String.IsNullOrEmpty(this.Description)); } - Page.Header.Title = Title; - if (!string.IsNullOrEmpty(PortalSettings.AddCompatibleHttpHeader) && !HeaderIsWritten) + this.Page.Header.Title = this.Title; + if (!string.IsNullOrEmpty(this.PortalSettings.AddCompatibleHttpHeader) && !this.HeaderIsWritten) { - Page.Response.AddHeader("X-UA-Compatible", PortalSettings.AddCompatibleHttpHeader); + this.Page.Response.AddHeader("X-UA-Compatible", this.PortalSettings.AddCompatibleHttpHeader); } - if (!string.IsNullOrEmpty(CanonicalLinkUrl)) + if (!string.IsNullOrEmpty(this.CanonicalLinkUrl)) { //Add Canonical using the primary alias var canonicalLink = new HtmlLink(); - canonicalLink.Href = CanonicalLinkUrl; + canonicalLink.Href = this.CanonicalLinkUrl; canonicalLink.Attributes.Add("rel", "canonical"); // Add the HtmlLink to the Head section of the page. - Page.Header.Controls.Add(canonicalLink); + this.Page.Header.Controls.Add(canonicalLink); } } protected override void Render(HtmlTextWriter writer) { - if (PortalSettings.UserMode == PortalSettings.Mode.Edit) + if (this.PortalSettings.UserMode == PortalSettings.Mode.Edit) { var editClass = "dnnEditState"; - var bodyClass = Body.Attributes["class"]; + var bodyClass = this.Body.Attributes["class"]; if (!string.IsNullOrEmpty(bodyClass)) { - Body.Attributes["class"] = string.Format("{0} {1}", bodyClass, editClass); + this.Body.Attributes["class"] = string.Format("{0} {1}", bodyClass, editClass); } else { - Body.Attributes["class"] = editClass; + this.Body.Attributes["class"] = editClass; } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Authentication/Authentication.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Authentication/Authentication.ascx.cs index ffe79776ba6..8a970cf1e2e 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Authentication/Authentication.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Authentication/Authentication.ascx.cs @@ -34,14 +34,14 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdUpdate.Click += OnUpdateClick; + this.cmdUpdate.Click += this.OnUpdateClick; var authSystems = AuthenticationController.GetEnabledAuthenticationServices(); foreach (var authSystem in authSystems) { //Add a Section Header - var sectionHeadControl = (SectionHeadControl) LoadControl("~/controls/SectionHeadControl.ascx"); + var sectionHeadControl = (SectionHeadControl) this.LoadControl("~/controls/SectionHeadControl.ascx"); sectionHeadControl.IncludeRule = true; sectionHeadControl.CssClass = "Head"; @@ -49,7 +49,7 @@ protected override void OnLoad(EventArgs e) var container = new HtmlGenericControl(); container.ID = authSystem.AuthenticationType; - var authSettingsControl = (AuthenticationSettingsBase) LoadControl("~/" + authSystem.SettingsControlSrc); + var authSettingsControl = (AuthenticationSettingsBase) this.LoadControl("~/" + authSystem.SettingsControlSrc); //set the control ID to the resource file name ( ie. controlname.ascx = controlname ) //this is necessary for the Localization in PageBase @@ -57,13 +57,13 @@ protected override void OnLoad(EventArgs e) //Add Settings Control to Container container.Controls.Add(authSettingsControl); - _settingControls.Add(authSettingsControl); + this._settingControls.Add(authSettingsControl); //Add Section Head Control to Container - pnlSettings.Controls.Add(sectionHeadControl); + this.pnlSettings.Controls.Add(sectionHeadControl); //Add Container to Controls - pnlSettings.Controls.Add(container); + this.pnlSettings.Controls.Add(container); //Attach Settings Control's container to Section Head Control sectionHeadControl.Section = container.ID; @@ -72,14 +72,14 @@ protected override void OnLoad(EventArgs e) authSettingsControl.LocalResourceFile = authSettingsControl.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + Path.GetFileNameWithoutExtension(authSystem.SettingsControlSrc); sectionHeadControl.Text = Localization.GetString("Title", authSettingsControl.LocalResourceFile); - pnlSettings.Controls.Add(new LiteralControl("
    ")); - cmdUpdate.Visible = IsEditable; + this.pnlSettings.Controls.Add(new LiteralControl("
    ")); + this.cmdUpdate.Visible = this.IsEditable; } } protected void OnUpdateClick(object sender, EventArgs e) { - foreach (var settingControl in _settingControls) + foreach (var settingControl in this._settingControls) { settingControl.UpdateSettings(); } @@ -89,7 +89,7 @@ protected void OnUpdateClick(object sender, EventArgs e) var authSystems = AuthenticationController.GetEnabledAuthenticationServices(); foreach (var authSystem in authSystems) { - var authLoginControl = (AuthenticationLoginBase) LoadControl("~/" + authSystem.LoginControlSrc); + var authLoginControl = (AuthenticationLoginBase) this.LoadControl("~/" + authSystem.LoginControlSrc); //Check if AuthSystem is Enabled if (authLoginControl.Enabled) @@ -101,7 +101,7 @@ protected void OnUpdateClick(object sender, EventArgs e) if (!enabled) { //Display warning - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NoProvidersEnabled", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NoProvidersEnabled", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Authentication/Login.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Authentication/Login.ascx.cs index 7e9eb59d68e..8d84c5814ac 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Authentication/Login.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Authentication/Login.ascx.cs @@ -64,7 +64,7 @@ public partial class Login : UserModuleBase public Login() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -86,15 +86,15 @@ protected string AuthenticationType get { var authenticationType = Null.NullString; - if (ViewState["AuthenticationType"] != null) + if (this.ViewState["AuthenticationType"] != null) { - authenticationType = Convert.ToString(ViewState["AuthenticationType"]); + authenticationType = Convert.ToString(this.ViewState["AuthenticationType"]); } return authenticationType; } set { - ViewState["AuthenticationType"] = value; + this.ViewState["AuthenticationType"] = value; } } @@ -106,15 +106,15 @@ protected bool AutoRegister get { var autoRegister = Null.NullBoolean; - if (ViewState["AutoRegister"] != null) + if (this.ViewState["AutoRegister"] != null) { - autoRegister = Convert.ToBoolean(ViewState["AutoRegister"]); + autoRegister = Convert.ToBoolean(this.ViewState["AutoRegister"]); } return autoRegister; } set { - ViewState["AutoRegister"] = value; + this.ViewState["AutoRegister"] = value; } } @@ -123,15 +123,15 @@ protected NameValueCollection ProfileProperties get { var profile = new NameValueCollection(); - if (ViewState["ProfileProperties"] != null) + if (this.ViewState["ProfileProperties"] != null) { - profile = (NameValueCollection)ViewState["ProfileProperties"]; + profile = (NameValueCollection)this.ViewState["ProfileProperties"]; } return profile; } set { - ViewState["ProfileProperties"] = value; + this.ViewState["ProfileProperties"] = value; } } @@ -143,15 +143,15 @@ protected int PageNo get { var pageNo = 0; - if (ViewState["PageNo"] != null) + if (this.ViewState["PageNo"] != null) { - pageNo = Convert.ToInt32(ViewState["PageNo"]); + pageNo = Convert.ToInt32(this.ViewState["PageNo"]); } return pageNo; } set { - ViewState["PageNo"] = value; + this.ViewState["PageNo"] = value; } } @@ -164,35 +164,35 @@ protected string RedirectURL { var redirectURL = ""; - var setting = GetSetting(PortalId, "Redirect_AfterLogin"); + var setting = GetSetting(this.PortalId, "Redirect_AfterLogin"); //first we need to check if there is a returnurl - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to signin - redirectURL = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + redirectURL = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. redirectURL = UrlUtils.ValidReturnUrl(redirectURL); } - if (Request.Cookies["returnurl"] != null) + if (this.Request.Cookies["returnurl"] != null) { //return to the url passed to signin - redirectURL = HttpUtility.UrlDecode(Request.Cookies["returnurl"].Value); + redirectURL = HttpUtility.UrlDecode(this.Request.Cookies["returnurl"].Value); //clean the return url to avoid possible XSS attack. redirectURL = UrlUtils.ValidReturnUrl(redirectURL); } - if (Request.Params["appctx"] != null) + if (this.Request.Params["appctx"] != null) { //HACK return to the url passed to signin (LiveID) - redirectURL = HttpUtility.UrlDecode(Request.Params["appctx"]); + redirectURL = HttpUtility.UrlDecode(this.Request.Params["appctx"]); //clean the return url to avoid possible XSS attack. redirectURL = UrlUtils.ValidReturnUrl(redirectURL); } - var alias = PortalAlias.HTTPAlias; + var alias = this.PortalAlias.HTTPAlias; var comparison = StringComparison.InvariantCultureIgnoreCase; // we need .TrimEnd('/') because a portlalias for a specific culture will not have a trailing /, while a returnurl will. var isDefaultPage = redirectURL == "/" @@ -201,24 +201,24 @@ protected string RedirectURL if (string.IsNullOrEmpty(redirectURL) || isDefaultPage) { if ( - NeedRedirectAfterLogin - && (isDefaultPage || IsRedirectingFromLoginUrl()) + this.NeedRedirectAfterLogin + && (isDefaultPage || this.IsRedirectingFromLoginUrl()) && Convert.ToInt32(setting) != Null.NullInteger ) { - redirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); + redirectURL = this._navigationManager.NavigateURL(Convert.ToInt32(setting)); } else { - if (PortalSettings.LoginTabId != -1 && PortalSettings.HomeTabId != -1) + if (this.PortalSettings.LoginTabId != -1 && this.PortalSettings.HomeTabId != -1) { //redirect to portal home page specified - redirectURL = _navigationManager.NavigateURL(PortalSettings.HomeTabId); + redirectURL = this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId); } else { //redirect to current page - redirectURL = _navigationManager.NavigateURL(); + redirectURL = this._navigationManager.NavigateURL(); } } @@ -226,13 +226,13 @@ protected string RedirectURL //replace language parameter in querystring, to make sure that user will see page in correct language - if (UserId != -1 && User != null) + if (this.UserId != -1 && this.User != null) { - if (!String.IsNullOrEmpty(User.Profile.PreferredLocale) - && User.Profile.PreferredLocale != CultureInfo.CurrentCulture.Name - && LocaleEnabled(User.Profile.PreferredLocale)) + if (!String.IsNullOrEmpty(this.User.Profile.PreferredLocale) + && this.User.Profile.PreferredLocale != CultureInfo.CurrentCulture.Name + && this.LocaleEnabled(this.User.Profile.PreferredLocale)) { - redirectURL = ReplaceLanguage(redirectURL, CultureInfo.CurrentCulture.Name, User.Profile.PreferredLocale); + redirectURL = ReplaceLanguage(redirectURL, CultureInfo.CurrentCulture.Name, this.User.Profile.PreferredLocale); } } @@ -242,11 +242,11 @@ protected string RedirectURL { qsDelimiter = "&"; } - if (LoginStatus == UserLoginStatus.LOGIN_INSECUREADMINPASSWORD) + if (this.LoginStatus == UserLoginStatus.LOGIN_INSECUREADMINPASSWORD) { redirectURL = redirectURL + qsDelimiter + "runningDefault=1"; } - else if (LoginStatus == UserLoginStatus.LOGIN_INSECUREHOSTPASSWORD) + else if (this.LoginStatus == UserLoginStatus.LOGIN_INSECUREHOSTPASSWORD) { redirectURL = redirectURL + qsDelimiter + "runningDefault=2"; } @@ -256,15 +256,15 @@ protected string RedirectURL private bool IsRedirectingFromLoginUrl() { - return Request.UrlReferrer != null && - Request.UrlReferrer.LocalPath.ToLowerInvariant().EndsWith(LOGIN_PATH); + return this.Request.UrlReferrer != null && + this.Request.UrlReferrer.LocalPath.ToLowerInvariant().EndsWith(LOGIN_PATH); } private bool NeedRedirectAfterLogin => - LoginStatus == UserLoginStatus.LOGIN_SUCCESS - || LoginStatus == UserLoginStatus.LOGIN_SUPERUSER - || LoginStatus == UserLoginStatus.LOGIN_INSECUREHOSTPASSWORD - || LoginStatus == UserLoginStatus.LOGIN_INSECUREADMINPASSWORD; + this.LoginStatus == UserLoginStatus.LOGIN_SUCCESS + || this.LoginStatus == UserLoginStatus.LOGIN_SUPERUSER + || this.LoginStatus == UserLoginStatus.LOGIN_INSECUREHOSTPASSWORD + || this.LoginStatus == UserLoginStatus.LOGIN_INSECUREADMINPASSWORD; /// /// Replaces the original language with user language @@ -290,15 +290,15 @@ protected bool RememberMe get { var rememberMe = Null.NullBoolean; - if (ViewState["RememberMe"] != null) + if (this.ViewState["RememberMe"] != null) { - rememberMe = Convert.ToBoolean(ViewState["RememberMe"]); + rememberMe = Convert.ToBoolean(this.ViewState["RememberMe"]); } return rememberMe; } set { - ViewState["RememberMe"] = value; + this.ViewState["RememberMe"] = value; } } @@ -309,7 +309,7 @@ protected bool UseCaptcha { get { - object setting = GetSetting(PortalId, "Security_CaptchaLogin"); + object setting = GetSetting(this.PortalId, "Security_CaptchaLogin"); return Convert.ToBoolean(setting); } } @@ -319,15 +319,15 @@ protected UserLoginStatus LoginStatus get { UserLoginStatus loginStatus = UserLoginStatus.LOGIN_FAILURE; - if (ViewState["LoginStatus"] != null) + if (this.ViewState["LoginStatus"] != null) { - loginStatus = (UserLoginStatus)ViewState["LoginStatus"]; + loginStatus = (UserLoginStatus)this.ViewState["LoginStatus"]; } return loginStatus; } set { - ViewState["LoginStatus"] = value; + this.ViewState["LoginStatus"] = value; } } @@ -339,15 +339,15 @@ protected string UserToken get { var userToken = ""; - if (ViewState["UserToken"] != null) + if (this.ViewState["UserToken"] != null) { - userToken = Convert.ToString(ViewState["UserToken"]); + userToken = Convert.ToString(this.ViewState["UserToken"]); } return userToken; } set { - ViewState["UserToken"] = value; + this.ViewState["UserToken"] = value; } } @@ -359,15 +359,15 @@ protected string UserName get { var userName = ""; - if (ViewState["UserName"] != null) + if (this.ViewState["UserName"] != null) { - userName = Convert.ToString(ViewState["UserName"]); + userName = Convert.ToString(this.ViewState["UserName"]); } return userName; } set { - ViewState["UserName"] = value; + this.ViewState["UserName"] = value; } } @@ -395,7 +395,7 @@ private void BindLogin() { List authSystems = AuthenticationController.GetEnabledAuthenticationServices(); AuthenticationLoginBase defaultLoginControl = null; - var defaultAuthProvider = PortalController.GetPortalSetting("DefaultAuthProvider", PortalId, "DNN"); + var defaultAuthProvider = PortalController.GetPortalSetting("DefaultAuthProvider", this.PortalId, "DNN"); foreach (AuthenticationInfo authSystem in authSystems) { try @@ -405,13 +405,13 @@ private void BindLogin() if (authSystem.AuthenticationType.Equals("Facebook") || authSystem.AuthenticationType.Equals("Google") || authSystem.AuthenticationType.Equals("Live") || authSystem.AuthenticationType.Equals("Twitter")) { - enabled = AuthenticationController.IsEnabledForPortal(authSystem, PortalSettings.PortalId); + enabled = AuthenticationController.IsEnabledForPortal(authSystem, this.PortalSettings.PortalId); } if (enabled) { - var authLoginControl = (AuthenticationLoginBase)LoadControl("~/" + authSystem.LoginControlSrc); - BindLoginControl(authLoginControl, authSystem); + var authLoginControl = (AuthenticationLoginBase)this.LoadControl("~/" + authSystem.LoginControlSrc); + this.BindLoginControl(authLoginControl, authSystem); if (authSystem.AuthenticationType == "DNN") { defaultLoginControl = authLoginControl; @@ -424,18 +424,18 @@ private void BindLogin() if (oAuthLoginControl != null) { //Add Login Control to List - _oAuthControls.Add(oAuthLoginControl); + this._oAuthControls.Add(oAuthLoginControl); } else { if (authLoginControl.AuthenticationType == defaultAuthProvider) { - _defaultauthLogin.Add(authLoginControl); + this._defaultauthLogin.Add(authLoginControl); } else { //Add Login Control to List - _loginControls.Add(authLoginControl); + this._loginControls.Add(authLoginControl); } } } @@ -446,7 +446,7 @@ private void BindLogin() Exceptions.LogException(ex); } } - int authCount = _loginControls.Count + _defaultauthLogin.Count; + int authCount = this._loginControls.Count + this._defaultauthLogin.Count; switch (authCount) { case 0: @@ -455,52 +455,52 @@ private void BindLogin() { //No controls enabled for portal, and default DNN control is not enabled by host, so load system default (DNN) AuthenticationInfo authSystem = AuthenticationController.GetAuthenticationServiceByType("DNN"); - var authLoginControl = (AuthenticationLoginBase)LoadControl("~/" + authSystem.LoginControlSrc); - BindLoginControl(authLoginControl, authSystem); - DisplayLoginControl(authLoginControl, false, false); + var authLoginControl = (AuthenticationLoginBase)this.LoadControl("~/" + authSystem.LoginControlSrc); + this.BindLoginControl(authLoginControl, authSystem); + this.DisplayLoginControl(authLoginControl, false, false); } else { //if there are social authprovider only - if (_oAuthControls.Count == 0) + if (this._oAuthControls.Count == 0) { //Portal has no login controls enabled so load default DNN control - DisplayLoginControl(defaultLoginControl, false, false); + this.DisplayLoginControl(defaultLoginControl, false, false); } } break; case 1: //We don't want the control to render with tabbed interface - DisplayLoginControl(_defaultauthLogin.Count == 1 - ? _defaultauthLogin[0] - : _loginControls.Count == 1 - ? _loginControls[0] - : _oAuthControls[0], + this.DisplayLoginControl(this._defaultauthLogin.Count == 1 + ? this._defaultauthLogin[0] + : this._loginControls.Count == 1 + ? this._loginControls[0] + : this._oAuthControls[0], false, false); break; default: //make sure defaultAuth provider control is diplayed first - if (_defaultauthLogin.Count > 0) + if (this._defaultauthLogin.Count > 0) { - DisplayTabbedLoginControl(_defaultauthLogin[0], tsLogin.Tabs); + this.DisplayTabbedLoginControl(this._defaultauthLogin[0], this.tsLogin.Tabs); } - foreach (AuthenticationLoginBase authLoginControl in _loginControls) + foreach (AuthenticationLoginBase authLoginControl in this._loginControls) { - DisplayTabbedLoginControl(authLoginControl, tsLogin.Tabs); + this.DisplayTabbedLoginControl(authLoginControl, this.tsLogin.Tabs); } break; } - BindOAuthControls(); + this.BindOAuthControls(); } private void BindOAuthControls() { - foreach (OAuthLoginBase oAuthLoginControl in _oAuthControls) + foreach (OAuthLoginBase oAuthLoginControl in this._oAuthControls) { - socialLoginControls.Controls.Add(oAuthLoginControl); + this.socialLoginControls.Controls.Add(oAuthLoginControl); } } @@ -512,65 +512,65 @@ private void BindLoginControl(AuthenticationLoginBase authLoginControl, Authenti authLoginControl.ID = Path.GetFileNameWithoutExtension(authSystem.LoginControlSrc) + "_" + authSystem.AuthenticationType; authLoginControl.LocalResourceFile = authLoginControl.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + Path.GetFileNameWithoutExtension(authSystem.LoginControlSrc); - authLoginControl.RedirectURL = RedirectURL; - authLoginControl.ModuleConfiguration = ModuleConfiguration; + authLoginControl.RedirectURL = this.RedirectURL; + authLoginControl.ModuleConfiguration = this.ModuleConfiguration; if (authSystem.AuthenticationType != "DNN") { authLoginControl.ViewStateMode = ViewStateMode.Enabled; } //attempt to inject control attributes - AddLoginControlAttributes(authLoginControl); - authLoginControl.UserAuthenticated += UserAuthenticated; + this.AddLoginControlAttributes(authLoginControl); + authLoginControl.UserAuthenticated += this.UserAuthenticated; } private void BindRegister() { - lblType.Text = AuthenticationType; - lblToken.Text = UserToken; + this.lblType.Text = this.AuthenticationType; + this.lblToken.Text = this.UserToken; //Verify that the current user has access to this page - if (PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration && Request.IsAuthenticated == false) + if (this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration && this.Request.IsAuthenticated == false) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } - lblRegisterHelp.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_REGISTRATION_INSTRUCTIONS"); - switch (PortalSettings.UserRegistration) + this.lblRegisterHelp.Text = Localization.GetSystemMessage(this.PortalSettings, "MESSAGE_REGISTRATION_INSTRUCTIONS"); + switch (this.PortalSettings.UserRegistration) { case (int)Globals.PortalRegistrationType.PrivateRegistration: - lblRegisterHelp.Text += Localization.GetString("PrivateMembership", Localization.SharedResourceFile); + this.lblRegisterHelp.Text += Localization.GetString("PrivateMembership", Localization.SharedResourceFile); break; case (int)Globals.PortalRegistrationType.PublicRegistration: - lblRegisterHelp.Text += Localization.GetString("PublicMembership", Localization.SharedResourceFile); + this.lblRegisterHelp.Text += Localization.GetString("PublicMembership", Localization.SharedResourceFile); break; case (int)Globals.PortalRegistrationType.VerifiedRegistration: - lblRegisterHelp.Text += Localization.GetString("VerifiedMembership", Localization.SharedResourceFile); + this.lblRegisterHelp.Text += Localization.GetString("VerifiedMembership", Localization.SharedResourceFile); break; } - if (AutoRegister) + if (this.AutoRegister) { - InitialiseUser(); + this.InitialiseUser(); } bool UserValid = true; - if (string.IsNullOrEmpty(User.Username) || string.IsNullOrEmpty(User.Email) || string.IsNullOrEmpty(User.FirstName) || string.IsNullOrEmpty(User.LastName)) + if (string.IsNullOrEmpty(this.User.Username) || string.IsNullOrEmpty(this.User.Email) || string.IsNullOrEmpty(this.User.FirstName) || string.IsNullOrEmpty(this.User.LastName)) { UserValid = Null.NullBoolean; } - if (AutoRegister && UserValid) + if (this.AutoRegister && UserValid) { - ctlUser.Visible = false; - lblRegisterTitle.Text = Localization.GetString("CreateTitle", LocalResourceFile); - cmdCreateUser.Text = Localization.GetString("cmdCreate", LocalResourceFile); + this.ctlUser.Visible = false; + this.lblRegisterTitle.Text = Localization.GetString("CreateTitle", this.LocalResourceFile); + this.cmdCreateUser.Text = Localization.GetString("cmdCreate", this.LocalResourceFile); } else { - lblRegisterHelp.Text += Localization.GetString("Required", Localization.SharedResourceFile); - lblRegisterTitle.Text = Localization.GetString("RegisterTitle", LocalResourceFile); - cmdCreateUser.Text = Localization.GetString("cmdRegister", LocalResourceFile); - ctlUser.ShowPassword = false; - ctlUser.ShowUpdate = false; - ctlUser.User = User; - ctlUser.DataBind(); + this.lblRegisterHelp.Text += Localization.GetString("Required", Localization.SharedResourceFile); + this.lblRegisterTitle.Text = Localization.GetString("RegisterTitle", this.LocalResourceFile); + this.cmdCreateUser.Text = Localization.GetString("cmdRegister", this.LocalResourceFile); + this.ctlUser.ShowPassword = false; + this.ctlUser.ShowUpdate = false; + this.ctlUser.User = this.User; + this.ctlUser.DataBind(); } } @@ -586,7 +586,7 @@ private void DisplayLoginControl(AuthenticationLoginBase authLoginControl, bool SectionHeadControl sectionHeadControl; if (addHeader) { - sectionHeadControl = (SectionHeadControl)LoadControl("~/controls/SectionHeadControl.ascx"); + sectionHeadControl = (SectionHeadControl)this.LoadControl("~/controls/SectionHeadControl.ascx"); sectionHeadControl.IncludeRule = true; sectionHeadControl.CssClass = "Head"; sectionHeadControl.Text = Localization.GetString("Title", authLoginControl.LocalResourceFile); @@ -594,21 +594,21 @@ private void DisplayLoginControl(AuthenticationLoginBase authLoginControl, bool sectionHeadControl.Section = container.ID; //Add Section Head Control to Container - pnlLoginContainer.Controls.Add(sectionHeadControl); + this.pnlLoginContainer.Controls.Add(sectionHeadControl); } //Add Container to Controls - pnlLoginContainer.Controls.Add(container); + this.pnlLoginContainer.Controls.Add(container); //Add LineBreak if (addFooter) { - pnlLoginContainer.Controls.Add(new LiteralControl("
    ")); + this.pnlLoginContainer.Controls.Add(new LiteralControl("
    ")); } //Display the container - pnlLoginContainer.Visible = true; + this.pnlLoginContainer.Visible = true; } private void DisplayTabbedLoginControl(AuthenticationLoginBase authLoginControl, TabStripTabCollection Tabs) @@ -618,57 +618,57 @@ private void DisplayTabbedLoginControl(AuthenticationLoginBase authLoginControl, tab.Controls.Add(authLoginControl); Tabs.Add(tab); - tsLogin.Visible = true; + this.tsLogin.Visible = true; } private void InitialiseUser() { //Load any Profile properties that may have been returned - UpdateProfile(User, false); + this.UpdateProfile(this.User, false); //Set UserName to authentication Token - User.Username = GenerateUserName(); + this.User.Username = this.GenerateUserName(); //Set DisplayName to UserToken if null - if (string.IsNullOrEmpty(User.DisplayName)) + if (string.IsNullOrEmpty(this.User.DisplayName)) { - User.DisplayName = UserToken.Replace("http://", "").TrimEnd('/'); + this.User.DisplayName = this.UserToken.Replace("http://", "").TrimEnd('/'); } //Parse DisplayName into FirstName/LastName - if (User.DisplayName.IndexOf(' ') > 0) + if (this.User.DisplayName.IndexOf(' ') > 0) { - User.FirstName = User.DisplayName.Substring(0, User.DisplayName.IndexOf(' ')); - User.LastName = User.DisplayName.Substring(User.DisplayName.IndexOf(' ') + 1); + this.User.FirstName = this.User.DisplayName.Substring(0, this.User.DisplayName.IndexOf(' ')); + this.User.LastName = this.User.DisplayName.Substring(this.User.DisplayName.IndexOf(' ') + 1); } //Set FirstName to Authentication Type (if null) - if (string.IsNullOrEmpty(User.FirstName)) + if (string.IsNullOrEmpty(this.User.FirstName)) { - User.FirstName = AuthenticationType; + this.User.FirstName = this.AuthenticationType; } //Set FirstName to "User" (if null) - if (string.IsNullOrEmpty(User.LastName)) + if (string.IsNullOrEmpty(this.User.LastName)) { - User.LastName = "User"; + this.User.LastName = "User"; } } private string GenerateUserName() { - if (!string.IsNullOrEmpty(UserName)) + if (!string.IsNullOrEmpty(this.UserName)) { - return UserName; + return this.UserName; } //Try Email prefix var emailPrefix = string.Empty; - if (!string.IsNullOrEmpty(User.Email)) + if (!string.IsNullOrEmpty(this.User.Email)) { - if (User.Email.IndexOf("@", StringComparison.Ordinal) != -1) + if (this.User.Email.IndexOf("@", StringComparison.Ordinal) != -1) { - emailPrefix = User.Email.Substring(0, User.Email.IndexOf("@", StringComparison.Ordinal)); - var user = UserController.GetUserByName(PortalId, emailPrefix); + emailPrefix = this.User.Email.Substring(0, this.User.Email.IndexOf("@", StringComparison.Ordinal)); + var user = UserController.GetUserByName(this.PortalId, emailPrefix); if (user == null) { return emailPrefix; @@ -677,30 +677,30 @@ private string GenerateUserName() } //Try First Name - if (!string.IsNullOrEmpty(User.FirstName)) + if (!string.IsNullOrEmpty(this.User.FirstName)) { - var user = UserController.GetUserByName(PortalId, User.FirstName); + var user = UserController.GetUserByName(this.PortalId, this.User.FirstName); if (user == null) { - return User.FirstName; + return this.User.FirstName; } } //Try Last Name - if (!string.IsNullOrEmpty(User.LastName)) + if (!string.IsNullOrEmpty(this.User.LastName)) { - var user = UserController.GetUserByName(PortalId, User.LastName); + var user = UserController.GetUserByName(this.PortalId, this.User.LastName); if (user == null) { - return User.LastName; + return this.User.LastName; } } //Try First Name + space + First letter last name - if (!string.IsNullOrEmpty(User.LastName) && !string.IsNullOrEmpty(User.FirstName)) + if (!string.IsNullOrEmpty(this.User.LastName) && !string.IsNullOrEmpty(this.User.FirstName)) { - var newUserName = User.FirstName + " " + User.LastName.Substring(0, 1); - var user = UserController.GetUserByName(PortalId, newUserName); + var newUserName = this.User.FirstName + " " + this.User.LastName.Substring(0, 1); + var user = UserController.GetUserByName(this.PortalId, newUserName); if (user == null) { return newUserName; @@ -708,10 +708,10 @@ private string GenerateUserName() } //Try First letter of First Name + lastname - if (!string.IsNullOrEmpty(User.LastName) && !string.IsNullOrEmpty(User.FirstName)) + if (!string.IsNullOrEmpty(this.User.LastName) && !string.IsNullOrEmpty(this.User.FirstName)) { - var newUserName = User.FirstName.Substring(0, 1) + User.LastName; - var user = UserController.GetUserByName(PortalId, newUserName); + var newUserName = this.User.FirstName.Substring(0, 1) + this.User.LastName; + var user = UserController.GetUserByName(this.PortalId, newUserName); if (user == null) { return newUserName; @@ -724,7 +724,7 @@ private string GenerateUserName() for (var i = 1; i < 10000; i++) { var newUserName = emailPrefix + i; - var user = UserController.GetUserByName(PortalId, newUserName); + var user = UserController.GetUserByName(this.PortalId, newUserName); if (user == null) { return newUserName; @@ -732,7 +732,7 @@ private string GenerateUserName() } } - return UserToken.Replace("http://", "").TrimEnd('/'); + return this.UserToken.Replace("http://", "").TrimEnd('/'); } /// ----------------------------------------------------------------------------- @@ -742,84 +742,84 @@ private string GenerateUserName() /// ----------------------------------------------------------------------------- private void ShowPanel() { - bool showLogin = (PageNo == 0); - bool showRegister = (PageNo == 1); - bool showPassword = (PageNo == 2); - bool showProfile = (PageNo == 3); - bool showDataConsent = (PageNo == 4); - pnlProfile.Visible = showProfile; - pnlPassword.Visible = showPassword; - pnlLogin.Visible = showLogin; - pnlRegister.Visible = showRegister; - pnlAssociate.Visible = showRegister; - pnlDataConsent.Visible = showDataConsent; - switch (PageNo) + bool showLogin = (this.PageNo == 0); + bool showRegister = (this.PageNo == 1); + bool showPassword = (this.PageNo == 2); + bool showProfile = (this.PageNo == 3); + bool showDataConsent = (this.PageNo == 4); + this.pnlProfile.Visible = showProfile; + this.pnlPassword.Visible = showPassword; + this.pnlLogin.Visible = showLogin; + this.pnlRegister.Visible = showRegister; + this.pnlAssociate.Visible = showRegister; + this.pnlDataConsent.Visible = showDataConsent; + switch (this.PageNo) { case 0: - BindLogin(); + this.BindLogin(); break; case 1: - BindRegister(); + this.BindRegister(); break; case 2: - ctlPassword.UserId = UserId; - ctlPassword.DataBind(); + this.ctlPassword.UserId = this.UserId; + this.ctlPassword.DataBind(); break; case 3: - ctlProfile.UserId = UserId; - ctlProfile.DataBind(); + this.ctlProfile.UserId = this.UserId; + this.ctlProfile.DataBind(); break; case 4: - ctlDataConsent.UserId = UserId; - ctlDataConsent.DataBind(); + this.ctlDataConsent.UserId = this.UserId; + this.ctlDataConsent.DataBind(); break; } if (showProfile && UrlUtils.InPopUp()) { - ScriptManager.RegisterClientScriptBlock(this, GetType(), "ResizePopup", "if(parent.$('#iPopUp').length > 0 && parent.$('#iPopUp').dialog('isOpen')){parent.$('#iPopUp').dialog({width: 950, height: 550}).dialog({position: 'center'});};", true); + ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "ResizePopup", "if(parent.$('#iPopUp').length > 0 && parent.$('#iPopUp').dialog('isOpen')){parent.$('#iPopUp').dialog({width: 950, height: 550}).dialog({position: 'center'});};", true); } } private void UpdateProfile(UserInfo objUser, bool update) { bool bUpdateUser = false; - if (ProfileProperties.Count > 0) + if (this.ProfileProperties.Count > 0) { - foreach (string key in ProfileProperties) + foreach (string key in this.ProfileProperties) { switch (key) { case "FirstName": - if (objUser.FirstName != ProfileProperties[key]) + if (objUser.FirstName != this.ProfileProperties[key]) { - objUser.FirstName = ProfileProperties[key]; + objUser.FirstName = this.ProfileProperties[key]; bUpdateUser = true; } break; case "LastName": - if (objUser.LastName != ProfileProperties[key]) + if (objUser.LastName != this.ProfileProperties[key]) { - objUser.LastName = ProfileProperties[key]; + objUser.LastName = this.ProfileProperties[key]; bUpdateUser = true; } break; case "Email": - if (objUser.Email != ProfileProperties[key]) + if (objUser.Email != this.ProfileProperties[key]) { - objUser.Email = ProfileProperties[key]; + objUser.Email = this.ProfileProperties[key]; bUpdateUser = true; } break; case "DisplayName": - if (objUser.DisplayName != ProfileProperties[key]) + if (objUser.DisplayName != this.ProfileProperties[key]) { - objUser.DisplayName = ProfileProperties[key]; + objUser.DisplayName = this.ProfileProperties[key]; bUpdateUser = true; } break; default: - objUser.Profile.SetProfileProperty(key, ProfileProperties[key]); + objUser.Profile.SetProfileProperty(key, this.ProfileProperties[key]); break; } } @@ -827,7 +827,7 @@ private void UpdateProfile(UserInfo objUser, bool update) { if (bUpdateUser) { - UserController.UpdateUser(PortalId, objUser); + UserController.UpdateUser(this.PortalId, objUser); } ProfileController.UpdateUserProfile(objUser); } @@ -849,13 +849,13 @@ private void ValidateUser(UserInfo objUser, bool ignoreExpiring) DateTime expiryDate = Null.NullDate; bool okToShowPanel = true; - validStatus = UserController.ValidateUser(objUser, PortalId, ignoreExpiring); + validStatus = UserController.ValidateUser(objUser, this.PortalId, ignoreExpiring); if (PasswordConfig.PasswordExpiry > 0) { expiryDate = objUser.Membership.LastPasswordChangeDate.AddDays(PasswordConfig.PasswordExpiry); } - UserId = objUser.UserID; + this.UserId = objUser.UserID; //Check if the User has valid Password/Profile switch (validStatus) @@ -864,14 +864,14 @@ private void ValidateUser(UserInfo objUser, bool ignoreExpiring) //check if the user is an admin/host and validate their IP if (Host.EnableIPChecking) { - bool isAdminUser = objUser.IsSuperUser || objUser.IsInRole(PortalSettings.AdministratorRoleName); + bool isAdminUser = objUser.IsSuperUser || objUser.IsInRole(this.PortalSettings.AdministratorRoleName); if (isAdminUser) { - var clientIp = NetworkUtils.GetClientIpAddress(Request); + var clientIp = NetworkUtils.GetClientIpAddress(this.Request); if (IPFilterController.Instance.IsIPBanned(clientIp)) { PortalSecurity.Instance.SignOut(); - AddModuleMessage("IPAddressBanned", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("IPAddressBanned", ModuleMessage.ModuleMessageType.RedError, true); okToShowPanel = false; break; } @@ -879,36 +879,36 @@ private void ValidateUser(UserInfo objUser, bool ignoreExpiring) } //Set the Page Culture(Language) based on the Users Preferred Locale - if ((objUser.Profile != null) && (objUser.Profile.PreferredLocale != null) && LocaleEnabled(objUser.Profile.PreferredLocale)) + if ((objUser.Profile != null) && (objUser.Profile.PreferredLocale != null) && this.LocaleEnabled(objUser.Profile.PreferredLocale)) { Localization.SetLanguage(objUser.Profile.PreferredLocale); } else { - Localization.SetLanguage(PortalSettings.DefaultLanguage); + Localization.SetLanguage(this.PortalSettings.DefaultLanguage); } //Set the Authentication Type used - AuthenticationController.SetAuthenticationType(AuthenticationType); + AuthenticationController.SetAuthenticationType(this.AuthenticationType); //Complete Login var userRequestIpAddressController = UserRequestIPAddressController.Instance; - var ipAddress = userRequestIpAddressController.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); - UserController.UserLogin(PortalId, objUser, PortalSettings.PortalName, ipAddress, RememberMe); + var ipAddress = userRequestIpAddressController.GetUserRequestIPAddress(new HttpRequestWrapper(this.Request)); + UserController.UserLogin(this.PortalId, objUser, this.PortalSettings.PortalName, ipAddress, this.RememberMe); //check whether user request comes with IPv6 and log it to make sure admin is aware of that if (string.IsNullOrWhiteSpace(ipAddress)) { - var ipAddressV6 = userRequestIpAddressController.GetUserRequestIPAddress(new HttpRequestWrapper(Request), IPAddressFamily.IPv6); + var ipAddressV6 = userRequestIpAddressController.GetUserRequestIPAddress(new HttpRequestWrapper(this.Request), IPAddressFamily.IPv6); if (!string.IsNullOrWhiteSpace(ipAddressV6)) { - AddEventLog(objUser.UserID, objUser.Username, PortalId, "IPv6", ipAddressV6); + this.AddEventLog(objUser.UserID, objUser.Username, this.PortalId, "IPv6", ipAddressV6); } } //redirect browser - var redirectUrl = RedirectURL; + var redirectUrl = this.RedirectURL; //Clear the cookie HttpContext.Current.Response.Cookies.Set(new HttpCookie("returnurl", "") @@ -917,60 +917,60 @@ private void ValidateUser(UserInfo objUser, bool ignoreExpiring) Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }); - Response.Redirect(redirectUrl, true); + this.Response.Redirect(redirectUrl, true); break; case UserValidStatus.PASSWORDEXPIRED: - strMessage = string.Format(Localization.GetString("PasswordExpired", LocalResourceFile), expiryDate.ToLongDateString()); - AddLocalizedModuleMessage(strMessage, ModuleMessage.ModuleMessageType.YellowWarning, true); - PageNo = 2; - pnlProceed.Visible = false; + strMessage = string.Format(Localization.GetString("PasswordExpired", this.LocalResourceFile), expiryDate.ToLongDateString()); + this.AddLocalizedModuleMessage(strMessage, ModuleMessage.ModuleMessageType.YellowWarning, true); + this.PageNo = 2; + this.pnlProceed.Visible = false; break; case UserValidStatus.PASSWORDEXPIRING: - strMessage = string.Format(Localization.GetString("PasswordExpiring", LocalResourceFile), expiryDate.ToLongDateString()); - AddLocalizedModuleMessage(strMessage, ModuleMessage.ModuleMessageType.YellowWarning, true); - PageNo = 2; - pnlProceed.Visible = true; + strMessage = string.Format(Localization.GetString("PasswordExpiring", this.LocalResourceFile), expiryDate.ToLongDateString()); + this.AddLocalizedModuleMessage(strMessage, ModuleMessage.ModuleMessageType.YellowWarning, true); + this.PageNo = 2; + this.pnlProceed.Visible = true; break; case UserValidStatus.UPDATEPASSWORD: - var portalAlias = Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias); + var portalAlias = Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias); if (MembershipProviderConfig.PasswordRetrievalEnabled || MembershipProviderConfig.PasswordResetEnabled) { - UserController.ResetPasswordToken(User); + UserController.ResetPasswordToken(this.User); objUser = UserController.GetUserById(objUser.PortalID, objUser.UserID); } var redirTo = string.Format("{0}/default.aspx?ctl=PasswordReset&resetToken={1}&forced=true", portalAlias, objUser.PasswordResetToken); - Response.Redirect(redirTo); + this.Response.Redirect(redirTo); break; case UserValidStatus.UPDATEPROFILE: //Save UserID in ViewState so that can update profile later. - UserId = objUser.UserID; + this.UserId = objUser.UserID; //When the user need update its profile to complete login, we need clear the login status because if the logrin is from //3rd party login provider, it may call UserController.UserLogin because they doesn't check this situation. PortalSecurity.Instance.SignOut(); //Admin has forced profile update - AddModuleMessage("ProfileUpdate", ModuleMessage.ModuleMessageType.YellowWarning, true); - PageNo = 3; + this.AddModuleMessage("ProfileUpdate", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.PageNo = 3; break; case UserValidStatus.MUSTAGREETOTERMS: - if (PortalSettings.DataConsentConsentRedirect == -1) + if (this.PortalSettings.DataConsentConsentRedirect == -1) { - UserId = objUser.UserID; - AddModuleMessage("MustConsent", ModuleMessage.ModuleMessageType.YellowWarning, true); - PageNo = 4; + this.UserId = objUser.UserID; + this.AddModuleMessage("MustConsent", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.PageNo = 4; } else { // Use the reset password token to identify the user during the redirect UserController.ResetPasswordToken(objUser); objUser = UserController.GetUserById(objUser.PortalID, objUser.UserID); - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.DataConsentConsentRedirect, "", string.Format("token={0}", objUser.PasswordResetToken))); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.DataConsentConsentRedirect, "", string.Format("token={0}", objUser.PasswordResetToken))); } break; } if (okToShowPanel) { - ShowPanel(); + this.ShowPanel(); } } @@ -979,13 +979,13 @@ private bool UserNeedsVerification() var userInfo = UserController.Instance.GetCurrentUserInfo(); return !userInfo.IsSuperUser && userInfo.IsInRole("Unverified Users") && - PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.VerifiedRegistration && - !string.IsNullOrEmpty(Request.QueryString["verificationcode"]); + this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.VerifiedRegistration && + !string.IsNullOrEmpty(this.Request.QueryString["verificationcode"]); } private bool LocaleEnabled(string locale) { - return LocaleController.Instance.GetLocales(PortalSettings.PortalId).ContainsKey(locale); + return LocaleController.Instance.GetLocales(this.PortalSettings.PortalId).ContainsKey(locale); } #endregion @@ -1001,32 +1001,32 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - ctlPassword.PasswordUpdated += PasswordUpdated; - ctlProfile.ProfileUpdated += ProfileUpdated; - ctlUser.UserCreateCompleted += UserCreateCompleted; - ctlDataConsent.DataConsentCompleted += DataConsentCompleted; + this.ctlPassword.PasswordUpdated += this.PasswordUpdated; + this.ctlProfile.ProfileUpdated += this.ProfileUpdated; + this.ctlUser.UserCreateCompleted += this.UserCreateCompleted; + this.ctlDataConsent.DataConsentCompleted += this.DataConsentCompleted; //Set the User Control Properties - ctlUser.ID = "User"; + this.ctlUser.ID = "User"; //Set the Password Control Properties - ctlPassword.ID = "Password"; + this.ctlPassword.ID = "Password"; //Set the Profile Control Properties - ctlProfile.ID = "Profile"; + this.ctlProfile.ID = "Profile"; //Set the Data Consent Control Properties - ctlDataConsent.ID = "DataConsent"; + this.ctlDataConsent.ID = "DataConsent"; //Override the redirected page title if page has loaded with ctl=Login - if (Request.QueryString["ctl"] != null) + if (this.Request.QueryString["ctl"] != null) { - if (Request.QueryString["ctl"].ToLowerInvariant() == "login") + if (this.Request.QueryString["ctl"].ToLowerInvariant() == "login") { - var myPage = (CDefault)Page; - if (myPage.PortalSettings.LoginTabId == TabId || myPage.PortalSettings.LoginTabId == -1) + var myPage = (CDefault)this.Page; + if (myPage.PortalSettings.LoginTabId == this.TabId || myPage.PortalSettings.LoginTabId == -1) { - myPage.Title = Localization.GetString("ControlTitle_login", LocalResourceFile); + myPage.Title = Localization.GetString("ControlTitle_login", this.LocalResourceFile); } } } @@ -1041,37 +1041,37 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdAssociate.Click += cmdAssociate_Click; - cmdCreateUser.Click += cmdCreateUser_Click; - cmdProceed.Click += cmdProceed_Click; + this.cmdAssociate.Click += this.cmdAssociate_Click; + this.cmdCreateUser.Click += this.cmdCreateUser_Click; + this.cmdProceed.Click += this.cmdProceed_Click; //Verify if portal has a customized login page - if (!Null.IsNull(PortalSettings.LoginTabId) && Globals.IsAdminControl()) + if (!Null.IsNull(this.PortalSettings.LoginTabId) && Globals.IsAdminControl()) { - if (Globals.ValidateLoginTabID(PortalSettings.LoginTabId)) + if (Globals.ValidateLoginTabID(this.PortalSettings.LoginTabId)) { //login page exists and trying to access this control directly with url param -> not allowed var parameters = new string[3]; - if (!string.IsNullOrEmpty(Request.QueryString["returnUrl"])) + if (!string.IsNullOrEmpty(this.Request.QueryString["returnUrl"])) { - parameters[0] = "returnUrl=" + HttpUtility.UrlEncode(Request.QueryString["returnUrl"]); + parameters[0] = "returnUrl=" + HttpUtility.UrlEncode(this.Request.QueryString["returnUrl"]); } - if (!string.IsNullOrEmpty(Request.QueryString["username"])) + if (!string.IsNullOrEmpty(this.Request.QueryString["username"])) { - parameters[1] = "username=" + HttpUtility.UrlEncode(Request.QueryString["username"]); + parameters[1] = "username=" + HttpUtility.UrlEncode(this.Request.QueryString["username"]); } - if (!string.IsNullOrEmpty(Request.QueryString["verificationcode"])) + if (!string.IsNullOrEmpty(this.Request.QueryString["verificationcode"])) { - parameters[2] = "verificationcode=" + HttpUtility.UrlEncode(Request.QueryString["verificationcode"]); + parameters[2] = "verificationcode=" + HttpUtility.UrlEncode(this.Request.QueryString["verificationcode"]); } - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.LoginTabId, "", parameters)); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.LoginTabId, "", parameters)); } } - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { try { - PageNo = 0; + this.PageNo = 0; } catch (Exception ex) { @@ -1079,9 +1079,9 @@ protected override void OnLoad(EventArgs e) Logger.Error(ex); } } - if (!Request.IsAuthenticated || UserNeedsVerification()) + if (!this.Request.IsAuthenticated || this.UserNeedsVerification()) { - ShowPanel(); + this.ShowPanel(); } else //user is already authenticated { @@ -1089,32 +1089,32 @@ protected override void OnLoad(EventArgs e) if (Globals.IsAdminControl()) { //redirect browser - Response.Redirect(RedirectURL, true); + this.Response.Redirect(this.RedirectURL, true); } else //make module container invisible if user is not a page admin { - var path = RedirectURL.Split('?')[0]; - if (NeedRedirectAfterLogin && path != _navigationManager.NavigateURL() && path != _navigationManager.NavigateURL(PortalSettings.HomeTabId)) + var path = this.RedirectURL.Split('?')[0]; + if (this.NeedRedirectAfterLogin && path != this._navigationManager.NavigateURL() && path != this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId)) { - Response.Redirect(RedirectURL, true); + this.Response.Redirect(this.RedirectURL, true); } if (TabPermissionController.CanAdminPage()) { - ShowPanel(); + this.ShowPanel(); } else { - ContainerControl.Visible = false; + this.ContainerControl.Visible = false; } } } - divCaptcha.Visible = UseCaptcha; + this.divCaptcha.Visible = this.UseCaptcha; - if (UseCaptcha) + if (this.UseCaptcha) { - ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", Localization.SharedResourceFile); - ctlCaptcha.Text = Localization.GetString("CaptchaText", Localization.SharedResourceFile); + this.ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", Localization.SharedResourceFile); + this.ctlCaptcha.Text = Localization.GetString("CaptchaText", Localization.SharedResourceFile); } } @@ -1126,32 +1126,32 @@ protected override void OnLoad(EventArgs e) /// protected void cmdAssociate_Click(object sender, EventArgs e) { - if ((UseCaptcha && ctlCaptcha.IsValid) || (!UseCaptcha)) + if ((this.UseCaptcha && this.ctlCaptcha.IsValid) || (!this.UseCaptcha)) { UserLoginStatus loginStatus = UserLoginStatus.LOGIN_FAILURE; var userRequestIpAddressController = UserRequestIPAddressController.Instance; - var ipAddress = userRequestIpAddressController.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); - UserInfo objUser = UserController.ValidateUser(PortalId, - txtUsername.Text, - txtPassword.Text, + var ipAddress = userRequestIpAddressController.GetUserRequestIPAddress(new HttpRequestWrapper(this.Request)); + UserInfo objUser = UserController.ValidateUser(this.PortalId, + this.txtUsername.Text, + this.txtPassword.Text, "DNN", "", - PortalSettings.PortalName, + this.PortalSettings.PortalName, ipAddress, ref loginStatus); if (loginStatus == UserLoginStatus.LOGIN_SUCCESS) { //Assocate alternate Login with User and proceed with Login - AuthenticationController.AddUserAuthentication(objUser.UserID, AuthenticationType, UserToken); + AuthenticationController.AddUserAuthentication(objUser.UserID, this.AuthenticationType, this.UserToken); if (objUser != null) { - UpdateProfile(objUser, true); + this.UpdateProfile(objUser, true); } - ValidateUser(objUser, true); + this.ValidateUser(objUser, true); } else { - AddModuleMessage("AssociationFailed", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("AssociationFailed", ModuleMessage.ModuleMessageType.RedError, true); } } } @@ -1163,23 +1163,23 @@ protected void cmdAssociate_Click(object sender, EventArgs e) /// protected void cmdCreateUser_Click(object sender, EventArgs e) { - User.Membership.Password = UserController.GeneratePassword(); + this.User.Membership.Password = UserController.GeneratePassword(); - if (AutoRegister) + if (this.AutoRegister) { - ctlUser.User = User; + this.ctlUser.User = this.User; //Call the Create User method of the User control so that it can create //the user and raise the appropriate event(s) - ctlUser.CreateUser(); + this.ctlUser.CreateUser(); } else { - if (ctlUser.IsValid) + if (this.ctlUser.IsValid) { //Call the Create User method of the User control so that it can create //the user and raise the appropriate event(s) - ctlUser.CreateUser(); + this.ctlUser.CreateUser(); } } } @@ -1191,8 +1191,8 @@ protected void cmdCreateUser_Click(object sender, EventArgs e) /// protected void cmdProceed_Click(object sender, EventArgs e) { - var user = ctlPassword.User; - ValidateUser(user, true); + var user = this.ctlPassword.User; + this.ValidateUser(user, true); } /// @@ -1205,19 +1205,19 @@ protected void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs PasswordUpdateStatus status = e.UpdateStatus; if (status == PasswordUpdateStatus.Success) { - AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); - var user = ctlPassword.User; + this.AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); + var user = this.ctlPassword.User; user.Membership.LastPasswordChangeDate = DateTime.Now; user.Membership.UpdatePassword = false; - LoginStatus = user.IsSuperUser ? UserLoginStatus.LOGIN_SUPERUSER : UserLoginStatus.LOGIN_SUCCESS; + this.LoginStatus = user.IsSuperUser ? UserLoginStatus.LOGIN_SUPERUSER : UserLoginStatus.LOGIN_SUCCESS; UserLoginStatus userstatus = UserLoginStatus.LOGIN_FAILURE; UserController.CheckInsecurePassword(user.Username, user.Membership.Password, ref userstatus); - LoginStatus = userstatus; - ValidateUser(user, true); + this.LoginStatus = userstatus; + this.ValidateUser(user, true); } else { - AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); } } @@ -1231,14 +1231,14 @@ protected void DataConsentCompleted(object sender, DataConsent.DataConsentEventA switch (e.Status) { case DataConsent.DataConsentStatus.Consented: - ValidateUser(ctlDataConsent.User, true); + this.ValidateUser(this.ctlDataConsent.User, true); break; case DataConsent.DataConsentStatus.Cancelled: case DataConsent.DataConsentStatus.RemovedAccount: - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.HomeTabId), true); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId), true); break; case DataConsent.DataConsentStatus.FailedToRemoveAccount: - AddModuleMessage("FailedToRemoveAccount", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("FailedToRemoveAccount", ModuleMessage.ModuleMessageType.RedError, true); break; } } @@ -1249,7 +1249,7 @@ protected void DataConsentCompleted(object sender, DataConsent.DataConsentEventA protected void ProfileUpdated(object sender, EventArgs e) { //Authorize User - ValidateUser(ctlProfile.User, true); + this.ValidateUser(this.ctlProfile.User, true); } /// @@ -1258,10 +1258,10 @@ protected void ProfileUpdated(object sender, EventArgs e) /// protected void UserAuthenticated(object sender, UserAuthenticatedEventArgs e) { - LoginStatus = e.LoginStatus; + this.LoginStatus = e.LoginStatus; //Check the Login Status - switch (LoginStatus) + switch (this.LoginStatus) { case UserLoginStatus.LOGIN_USERNOTAPPROVED: switch (e.Message) @@ -1270,48 +1270,48 @@ protected void UserAuthenticated(object sender, UserAuthenticatedEventArgs e) if (e.User != null) { //First update the profile (if any properties have been passed) - AuthenticationType = e.AuthenticationType; - ProfileProperties = e.Profile; - RememberMe = e.RememberMe; - UpdateProfile(e.User, true); - ValidateUser(e.User, false); + this.AuthenticationType = e.AuthenticationType; + this.ProfileProperties = e.Profile; + this.RememberMe = e.RememberMe; + this.UpdateProfile(e.User, true); + this.ValidateUser(e.User, false); } break; case "EnterCode": - AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.YellowWarning, true); + this.AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.YellowWarning, true); break; case "InvalidCode": case "UserNotAuthorized": - AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); break; default: - AddLocalizedModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); break; } break; case UserLoginStatus.LOGIN_USERLOCKEDOUT: if (Host.AutoAccountUnlockDuration > 0) { - AddLocalizedModuleMessage(string.Format(Localization.GetString("UserLockedOut", LocalResourceFile), Host.AutoAccountUnlockDuration), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(string.Format(Localization.GetString("UserLockedOut", this.LocalResourceFile), Host.AutoAccountUnlockDuration), ModuleMessage.ModuleMessageType.RedError, true); } else { - AddLocalizedModuleMessage(Localization.GetString("UserLockedOut_ContactAdmin", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(Localization.GetString("UserLockedOut_ContactAdmin", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError, true); } //notify administrator about account lockout ( possible hack attempt ) var Custom = new ArrayList { e.UserToken }; var message = new Message { - FromUserID = PortalSettings.AdministratorId, - ToUserID = PortalSettings.AdministratorId, - Subject = Localization.GetSystemMessage(PortalSettings, "EMAIL_USER_LOCKOUT_SUBJECT", Localization.GlobalResourceFile, Custom), - Body = Localization.GetSystemMessage(PortalSettings, "EMAIL_USER_LOCKOUT_BODY", Localization.GlobalResourceFile, Custom), + FromUserID = this.PortalSettings.AdministratorId, + ToUserID = this.PortalSettings.AdministratorId, + Subject = Localization.GetSystemMessage(this.PortalSettings, "EMAIL_USER_LOCKOUT_SUBJECT", Localization.GlobalResourceFile, Custom), + Body = Localization.GetSystemMessage(this.PortalSettings, "EMAIL_USER_LOCKOUT_BODY", Localization.GlobalResourceFile, Custom), Status = MessageStatusType.Unread }; //_messagingController.SaveMessage(_message); - Mail.SendEmail(PortalSettings.Email, PortalSettings.Email, message.Subject, message.Body); + Mail.SendEmail(this.PortalSettings.Email, this.PortalSettings.Email, message.Subject, message.Body); break; case UserLoginStatus.LOGIN_FAILURE: //A Login Failure can mean one of two things: @@ -1319,37 +1319,37 @@ protected void UserAuthenticated(object sender, UserAuthenticatedEventArgs e) // 2 - User was not authenticated if (e.Authenticated) { - AutoRegister = e.AutoRegister; - AuthenticationType = e.AuthenticationType; - ProfileProperties = e.Profile; - UserToken = e.UserToken; - UserName = e.UserName; - if (AutoRegister) + this.AutoRegister = e.AutoRegister; + this.AuthenticationType = e.AuthenticationType; + this.ProfileProperties = e.Profile; + this.UserToken = e.UserToken; + this.UserName = e.UserName; + if (this.AutoRegister) { - InitialiseUser(); - User.Membership.Password = UserController.GeneratePassword(); + this.InitialiseUser(); + this.User.Membership.Password = UserController.GeneratePassword(); - ctlUser.User = User; + this.ctlUser.User = this.User; //Call the Create User method of the User control so that it can create //the user and raise the appropriate event(s) - ctlUser.CreateUser(); + this.ctlUser.CreateUser(); } else { - PageNo = 1; - ShowPanel(); + this.PageNo = 1; + this.ShowPanel(); } } else { if (string.IsNullOrEmpty(e.Message)) { - AddModuleMessage("LoginFailed", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("LoginFailed", ModuleMessage.ModuleMessageType.RedError, true); } else { - AddLocalizedModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); } } break; @@ -1357,11 +1357,11 @@ protected void UserAuthenticated(object sender, UserAuthenticatedEventArgs e) if (e.User != null) { //First update the profile (if any properties have been passed) - AuthenticationType = e.AuthenticationType; - ProfileProperties = e.Profile; - RememberMe = e.RememberMe; - UpdateProfile(e.User, true); - ValidateUser(e.User, (e.AuthenticationType != "DNN")); + this.AuthenticationType = e.AuthenticationType; + this.ProfileProperties = e.Profile; + this.RememberMe = e.RememberMe; + this.UpdateProfile(e.User, true); + this.ValidateUser(e.User, (e.AuthenticationType != "DNN")); } break; } @@ -1380,20 +1380,20 @@ protected void UserCreateCompleted(object sender, UserUserControlBase.UserCreate if (e.CreateStatus == UserCreateStatus.Success) { //Assocate alternate Login with User and proceed with Login - AuthenticationController.AddUserAuthentication(e.NewUser.UserID, AuthenticationType, UserToken); + AuthenticationController.AddUserAuthentication(e.NewUser.UserID, this.AuthenticationType, this.UserToken); - strMessage = CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, true); + strMessage = this.CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, true); if ((string.IsNullOrEmpty(strMessage))) { //First update the profile (if any properties have been passed) - UpdateProfile(e.NewUser, true); + this.UpdateProfile(e.NewUser, true); - ValidateUser(e.NewUser, true); + this.ValidateUser(e.NewUser, true); } } else { - AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); } } catch (Exception exc) //Module failed to load diff --git a/DNN Platform/Website/DesktopModules/Admin/Authentication/Logoff.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Authentication/Logoff.ascx.cs index d31de7ad12c..4da2d016f5a 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Authentication/Logoff.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Authentication/Logoff.ascx.cs @@ -32,7 +32,7 @@ public partial class Logoff : UserModuleBase private void Redirect() { //Redirect browser back to portal - Response.Redirect(AuthenticationController.GetLogoffRedirectURL(PortalSettings, Request), true); + this.Response.Redirect(AuthenticationController.GetLogoffRedirectURL(this.PortalSettings, this.Request), true); } private void DoLogoff() @@ -40,9 +40,9 @@ private void DoLogoff() try { //Remove user from cache - if (User != null) + if (this.User != null) { - DataCache.ClearUserCache(PortalSettings.PortalId, Context.User.Identity.Name); + DataCache.ClearUserCache(this.PortalSettings.PortalId, this.Context.User.Identity.Name); } var objPortalSecurity = PortalSecurity.Instance; objPortalSecurity.SignOut(); @@ -72,7 +72,7 @@ protected override void OnLoad(EventArgs e) if (authSystem != null && !string.IsNullOrEmpty(authSystem.LogoffControlSrc)) { - var authLogoffControl = (AuthenticationLogoffBase) LoadControl("~/" + authSystem.LogoffControlSrc); + var authLogoffControl = (AuthenticationLogoffBase) this.LoadControl("~/" + authSystem.LogoffControlSrc); //set the control ID to the resource file name ( ie. controlname.ascx = controlname ) //this is necessary for the Localization in PageBase @@ -80,19 +80,19 @@ protected override void OnLoad(EventArgs e) authLogoffControl.ID = Path.GetFileNameWithoutExtension(authSystem.LogoffControlSrc) + "_" + authSystem.AuthenticationType; authLogoffControl.LocalResourceFile = authLogoffControl.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + Path.GetFileNameWithoutExtension(authSystem.LogoffControlSrc); - authLogoffControl.ModuleConfiguration = ModuleConfiguration; + authLogoffControl.ModuleConfiguration = this.ModuleConfiguration; - authLogoffControl.LogOff += UserLogOff; - authLogoffControl.Redirect += UserRedirect; + authLogoffControl.LogOff += this.UserLogOff; + authLogoffControl.Redirect += this.UserRedirect; //Add Login Control to Control - pnlLogoffContainer.Controls.Add(authLogoffControl); + this.pnlLogoffContainer.Controls.Add(authLogoffControl); } else { //The current auth system has no custom logoff control so LogOff - DoLogoff(); - Redirect(); + this.DoLogoff(); + this.Redirect(); } } catch (ThreadAbortException) @@ -107,12 +107,12 @@ protected override void OnLoad(EventArgs e) protected void UserLogOff(Object sender, EventArgs e) { - DoLogoff(); + this.DoLogoff(); } protected void UserRedirect(Object sender, EventArgs e) { - Redirect(); + this.Redirect(); } #endregion diff --git a/DNN Platform/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs index 13ca2526373..4e094db6191 100644 --- a/DNN Platform/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/EditExtension/AuthenticationEditor.ascx.cs @@ -30,7 +30,7 @@ public partial class AuthenticationEditor : PackageEditorBase public AuthenticationEditor() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region "Private Members" @@ -46,11 +46,11 @@ protected AuthenticationInfo AuthSystem { get { - if (_AuthSystem == null) + if (this._AuthSystem == null) { - _AuthSystem = AuthenticationController.GetAuthenticationServiceByPackageID(PackageID); + this._AuthSystem = AuthenticationController.GetAuthenticationServiceByPackageID(this.PackageID); } - return _AuthSystem; + return this._AuthSystem; } } @@ -66,11 +66,11 @@ protected AuthenticationSettingsBase SettingsControl { get { - if (_SettingsControl == null && !string.IsNullOrEmpty(AuthSystem.SettingsControlSrc)) + if (this._SettingsControl == null && !string.IsNullOrEmpty(this.AuthSystem.SettingsControlSrc)) { - _SettingsControl = (AuthenticationSettingsBase) LoadControl("~/" + AuthSystem.SettingsControlSrc); + this._SettingsControl = (AuthenticationSettingsBase) this.LoadControl("~/" + this.AuthSystem.SettingsControlSrc); } - return _SettingsControl; + return this._SettingsControl; } } @@ -85,34 +85,34 @@ protected AuthenticationSettingsBase SettingsControl /// ----------------------------------------------------------------------------- private void BindAuthentication() { - if (AuthSystem != null) + if (this.AuthSystem != null) { - if (AuthSystem.AuthenticationType == "DNN") + if (this.AuthSystem.AuthenticationType == "DNN") { - authenticationFormReadOnly.DataSource = AuthSystem; - authenticationFormReadOnly.DataBind(); + this.authenticationFormReadOnly.DataSource = this.AuthSystem; + this.authenticationFormReadOnly.DataBind(); } else { - authenticationForm.DataSource = AuthSystem; - authenticationForm.DataBind(); + this.authenticationForm.DataSource = this.AuthSystem; + this.authenticationForm.DataBind(); } - authenticationFormReadOnly.Visible = IsSuperTab && (AuthSystem.AuthenticationType == "DNN"); - authenticationForm.Visible = IsSuperTab && AuthSystem.AuthenticationType != "DNN"; + this.authenticationFormReadOnly.Visible = this.IsSuperTab && (this.AuthSystem.AuthenticationType == "DNN"); + this.authenticationForm.Visible = this.IsSuperTab && this.AuthSystem.AuthenticationType != "DNN"; - if (SettingsControl != null) + if (this.SettingsControl != null) { //set the control ID to the resource file name ( ie. controlname.ascx = controlname ) //this is necessary for the Localization in PageBase - SettingsControl.ID = Path.GetFileNameWithoutExtension(AuthSystem.SettingsControlSrc); + this.SettingsControl.ID = Path.GetFileNameWithoutExtension(this.AuthSystem.SettingsControlSrc); //Add Container to Controls - pnlSettings.Controls.AddAt(0, SettingsControl); + this.pnlSettings.Controls.AddAt(0, this.SettingsControl); } else { - cmdUpdate.Visible = false; + this.cmdUpdate.Visible = false; } } } @@ -123,30 +123,30 @@ private void BindAuthentication() public override void Initialize() { - pnlSettings.Visible = !IsSuperTab; - if (IsSuperTab) + this.pnlSettings.Visible = !this.IsSuperTab; + if (this.IsSuperTab) { - lblHelp.Text = Localization.GetString("HostHelp", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("HostHelp", this.LocalResourceFile); } else { - if (SettingsControl == null) + if (this.SettingsControl == null) { - lblHelp.Text = Localization.GetString("NoSettings", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("NoSettings", this.LocalResourceFile); } else { - lblHelp.Text = Localization.GetString("AdminHelp", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("AdminHelp", this.LocalResourceFile); } } - BindAuthentication(); + this.BindAuthentication(); } public override void UpdatePackage() { - if (authenticationForm.IsValid) + if (this.authenticationForm.IsValid) { - var authInfo = authenticationForm.DataSource as AuthenticationInfo; + var authInfo = this.authenticationForm.DataSource as AuthenticationInfo; if (authInfo != null) { AuthenticationController.UpdateAuthentication(authInfo); @@ -161,21 +161,21 @@ public override void UpdatePackage() protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdUpdate.Click += cmdUpdate_Click; - var displayMode = DisplayMode; + this.cmdUpdate.Click += this.cmdUpdate_Click; + var displayMode = this.DisplayMode; if (displayMode == "editor" || displayMode == "settings") { - AuthEditorHead.Visible = AuthEditorHead.EnableViewState = false; + this.AuthEditorHead.Visible = this.AuthEditorHead.EnableViewState = false; } } protected void cmdUpdate_Click(object sender, EventArgs e) { - SettingsControl?.UpdateSettings(); + this.SettingsControl?.UpdateSettings(); - var displayMode = DisplayMode; + var displayMode = this.DisplayMode; if (displayMode != "editor" && displayMode != "settings") - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } #endregion diff --git a/DNN Platform/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs index cef3d9b2602..fc5c0412b3f 100644 --- a/DNN Platform/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/EditExtension/EditExtension.ascx.cs @@ -45,38 +45,38 @@ public partial class EditExtension : ModuleUserControlBase public EditExtension() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } protected bool IsSuperTab { get { - return (ModuleContext.PortalSettings.ActiveTab.IsSuperTab); + return (this.ModuleContext.PortalSettings.ActiveTab.IsSuperTab); } } protected string ReturnUrl { - get { return (string)ViewState["ReturnUrl"]; } - set { ViewState["ReturnUrl"] = value; } + get { return (string)this.ViewState["ReturnUrl"]; } + set { this.ViewState["ReturnUrl"] = value; } } public string Mode { get { - return Convert.ToString(ModuleContext.Settings["Extensions_Mode"]); + return Convert.ToString(this.ModuleContext.Settings["Extensions_Mode"]); } } - protected string DisplayMode => (Request.QueryString["Display"] ?? "").ToLowerInvariant(); + protected string DisplayMode => (this.Request.QueryString["Display"] ?? "").ToLowerInvariant(); protected PackageInfo Package { get { - return _package ?? (_package = PackageID == Null.NullInteger ? new PackageInfo() : PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == PackageID, true)); + return this._package ?? (this._package = this.PackageID == Null.NullInteger ? new PackageInfo() : PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == this.PackageID, true)); } } @@ -84,18 +84,18 @@ protected IPackageEditor PackageEditor { get { - if (_control == null) + if (this._control == null) { - if (Package != null) + if (this.Package != null) { - var pkgType = PackageController.Instance.GetExtensionPackageType(t => t.PackageType.Equals(Package.PackageType, StringComparison.OrdinalIgnoreCase)); + var pkgType = PackageController.Instance.GetExtensionPackageType(t => t.PackageType.Equals(this.Package.PackageType, StringComparison.OrdinalIgnoreCase)); if ((pkgType != null) && (!string.IsNullOrEmpty(pkgType.EditorControlSrc))) { - _control = ControlUtilities.LoadControl(this, pkgType.EditorControlSrc); + this._control = ControlUtilities.LoadControl(this, pkgType.EditorControlSrc); } } } - return _control as IPackageEditor; + return this._control as IPackageEditor; } } @@ -104,9 +104,9 @@ public int PackageID get { var packageID = Null.NullInteger; - if ((Request.QueryString["PackageID"] != null)) + if ((this.Request.QueryString["PackageID"] != null)) { - packageID = Int32.Parse(Request.QueryString["PackageID"]); + packageID = Int32.Parse(this.Request.QueryString["PackageID"]); } return packageID; } @@ -117,7 +117,7 @@ protected PropertyEditorMode ViewMode get { var viewMode = PropertyEditorMode.View; - if (Request.IsLocal && IsSuperTab) + if (this.Request.IsLocal && this.IsSuperTab) { viewMode = PropertyEditorMode.Edit; } @@ -127,96 +127,96 @@ protected PropertyEditorMode ViewMode private void BindData() { - email.ValidationExpression = Globals.glbEmailRegEx; - trLanguagePackType.Visible = false; - switch (Mode) + this.email.ValidationExpression = Globals.glbEmailRegEx; + this.trLanguagePackType.Visible = false; + switch (this.Mode) { case "All": - lblHelp.Text = Localization.GetString("EditHelp", LocalResourceFile); - cmdUpdate.Text = Localization.GetString("cmdUpdate", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("EditHelp", this.LocalResourceFile); + this.cmdUpdate.Text = Localization.GetString("cmdUpdate", this.LocalResourceFile); break; case "LanguagePack": - lblHelp.Text = Localization.GetString("EditLanguageHelp", LocalResourceFile); - cmdUpdate.Text = Localization.GetString("cmdUpdateLanguage", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("EditLanguageHelp", this.LocalResourceFile); + this.cmdUpdate.Text = Localization.GetString("cmdUpdateLanguage", this.LocalResourceFile); break; case "Module": - lblHelp.Text = Localization.GetString("EditModuleHelp", LocalResourceFile); - cmdUpdate.Text = Localization.GetString("cmdUpdateModule", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("EditModuleHelp", this.LocalResourceFile); + this.cmdUpdate.Text = Localization.GetString("cmdUpdateModule", this.LocalResourceFile); break; case "Skin": - lblHelp.Text = Localization.GetString("EditSkinHelp", LocalResourceFile); - cmdUpdate.Text = Localization.GetString("cmdUpdateSkin", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("EditSkinHelp", this.LocalResourceFile); + this.cmdUpdate.Text = Localization.GetString("cmdUpdateSkin", this.LocalResourceFile); break; } - cmdPackage.Visible = IsSuperTab; - cmdUpdate.Visible = IsSuperTab; - if (Package != null) + this.cmdPackage.Visible = this.IsSuperTab; + this.cmdUpdate.Visible = this.IsSuperTab; + if (this.Package != null) { - if (PackageEditor == null || PackageID == Null.NullInteger) + if (this.PackageEditor == null || this.PackageID == Null.NullInteger) { - extensionSection.Visible = false; + this.extensionSection.Visible = false; } else { - phEditor.Controls.Clear(); - phEditor.Controls.Add(PackageEditor as Control); - var moduleControl = PackageEditor as IModuleControl; + this.phEditor.Controls.Clear(); + this.phEditor.Controls.Add(this.PackageEditor as Control); + var moduleControl = this.PackageEditor as IModuleControl; if (moduleControl != null) { - moduleControl.ModuleContext.Configuration = ModuleContext.Configuration; + moduleControl.ModuleContext.Configuration = this.ModuleContext.Configuration; } - PackageEditor.PackageID = PackageID; - PackageEditor.Initialize(); + this.PackageEditor.PackageID = this.PackageID; + this.PackageEditor.Initialize(); - Package.IconFile = Util.ParsePackageIconFileName(Package); + this.Package.IconFile = Util.ParsePackageIconFileName(this.Package); } - switch (Package.PackageType) + switch (this.Package.PackageType) { case "Auth_System": case "Container": case "Module": case "Skin": - iconFile.Enabled = true; - Package.IconFile = Util.ParsePackageIconFileName(Package); + this.iconFile.Enabled = true; + this.Package.IconFile = Util.ParsePackageIconFileName(this.Package); break; default: - iconFile.Enabled = false; - Package.IconFile = "Not Available"; + this.iconFile.Enabled = false; + this.Package.IconFile = "Not Available"; break; } - if (Mode != "All") + if (this.Mode != "All") { - packageType.Visible = false; + this.packageType.Visible = false; } //Determine if Package is ready for packaging - PackageWriterBase writer = PackageWriterFactory.GetWriter(Package); - cmdPackage.Visible = IsSuperTab && writer != null && Directory.Exists(Path.Combine(Globals.ApplicationMapPath, writer.BasePath)); + PackageWriterBase writer = PackageWriterFactory.GetWriter(this.Package); + this.cmdPackage.Visible = this.IsSuperTab && writer != null && Directory.Exists(Path.Combine(Globals.ApplicationMapPath, writer.BasePath)); - cmdDelete.Visible = IsSuperTab && (!Package.IsSystemPackage) && (PackageController.CanDeletePackage(Package, ModuleContext.PortalSettings)); - ctlAudit.Entity = Package; + this.cmdDelete.Visible = this.IsSuperTab && (!this.Package.IsSystemPackage) && (PackageController.CanDeletePackage(this.Package, this.ModuleContext.PortalSettings)); + this.ctlAudit.Entity = this.Package; - packageForm.DataSource = Package; - packageFormReadOnly.DataSource = Package; - if(!Page.IsPostBack) + this.packageForm.DataSource = this.Package; + this.packageFormReadOnly.DataSource = this.Package; + if(!this.Page.IsPostBack) { - packageForm.DataBind(); - packageFormReadOnly.DataBind(); + this.packageForm.DataBind(); + this.packageFormReadOnly.DataBind(); } - packageForm.Visible = IsSuperTab; - packageFormReadOnly.Visible = !IsSuperTab; + this.packageForm.Visible = this.IsSuperTab; + this.packageFormReadOnly.Visible = !this.IsSuperTab; } } private void UpdatePackage(bool displayMessage) { - if (packageForm.IsValid) + if (this.packageForm.IsValid) { - var package = packageForm.DataSource as PackageInfo; + var package = this.packageForm.DataSource as PackageInfo; if (package != null) { var pkgIconFile = Util.ParsePackageIconFileName(package); @@ -225,12 +225,12 @@ private void UpdatePackage(bool displayMessage) } if (displayMessage) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PackageUpdated", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("PackageUpdated", this.LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); } } - if (PackageEditor != null) + if (this.PackageEditor != null) { - PackageEditor.UpdatePackage(); + this.PackageEditor.UpdatePackage(); } } @@ -250,65 +250,65 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdCancel.Click += OnCancelClick; - cmdDelete.Click += OnDeleteClick; - cmdPackage.Click += OnPackageClick; - cmdUpdate.Click += OnUpdateClick; - Page.PreRenderComplete += (sender, args) => + this.cmdCancel.Click += this.OnCancelClick; + this.cmdDelete.Click += this.OnDeleteClick; + this.cmdPackage.Click += this.OnPackageClick; + this.cmdUpdate.Click += this.OnUpdateClick; + this.Page.PreRenderComplete += (sender, args) => { if (UrlUtils.InPopUp()) { - var title = string.Format("{0} > {1}", Page.Title, Package.FriendlyName); - Page.Title = title; + var title = string.Format("{0} > {1}", this.Page.Title, this.Package.FriendlyName); + this.Page.Title = title; } }; - BindData(); + this.BindData(); - if (!IsPostBack) + if (!this.IsPostBack) { - ReturnUrl = Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : _navigationManager.NavigateURL(); - switch (DisplayMode) + this.ReturnUrl = this.Request.UrlReferrer != null ? this.Request.UrlReferrer.ToString() : this._navigationManager.NavigateURL(); + switch (this.DisplayMode) { case "editor": - packageSettingsSection.Visible = false; + this.packageSettingsSection.Visible = false; break; case "settings": - extensionSection.Visible = false; + this.extensionSection.Visible = false; break; } } - switch (DisplayMode) + switch (this.DisplayMode) { case "editor": - cmdCancel.Visible = cmdCancel.Enabled = false; - cmdUpdate.Visible = cmdUpdate.Enabled = false; - cmdPackage.Visible = cmdPackage.Enabled = false; - cmdDelete.Visible = cmdDelete.Enabled = false; + this.cmdCancel.Visible = this.cmdCancel.Enabled = false; + this.cmdUpdate.Visible = this.cmdUpdate.Enabled = false; + this.cmdPackage.Visible = this.cmdPackage.Enabled = false; + this.cmdDelete.Visible = this.cmdDelete.Enabled = false; break; case "settings": - cmdCancel.Visible = cmdCancel.Enabled = false; + this.cmdCancel.Visible = this.cmdCancel.Enabled = false; break; } } protected void OnCancelClick(object sender, EventArgs e) { - Response.Redirect(ReturnUrl); + this.Response.Redirect(this.ReturnUrl); } protected void OnDeleteClick(object sender, EventArgs e) { - Response.Redirect(Util.UnInstallURL(ModuleContext.TabId, PackageID)); + this.Response.Redirect(Util.UnInstallURL(this.ModuleContext.TabId, this.PackageID)); } protected void OnPackageClick(object sender, EventArgs e) { try { - UpdatePackage(false); - Response.Redirect(Util.PackageWriterURL(ModuleContext, PackageID)); + this.UpdatePackage(false); + this.Response.Redirect(Util.PackageWriterURL(this.ModuleContext, this.PackageID)); } catch (Exception ex) { @@ -320,7 +320,7 @@ protected void OnUpdateClick(object sender, EventArgs e) { try { - UpdatePackage(true); + this.UpdatePackage(true); } catch (Exception ex) { diff --git a/DNN Platform/Website/DesktopModules/Admin/SearchResults/ResultsSettings.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/SearchResults/ResultsSettings.ascx.cs index 0bbfa7f9155..aa0ec75e298 100644 --- a/DNN Platform/Website/DesktopModules/Admin/SearchResults/ResultsSettings.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/SearchResults/ResultsSettings.ascx.cs @@ -30,89 +30,89 @@ public override void LoadSettings() { try { - if ((Page.IsPostBack == false)) + if ((this.Page.IsPostBack == false)) { - if (!String.IsNullOrEmpty(Convert.ToString(Settings["LinkTarget"]))) + if (!String.IsNullOrEmpty(Convert.ToString(this.Settings["LinkTarget"]))) { - comboBoxLinkTarget.SelectedValue = Convert.ToString(Settings["LinkTarget"]); + this.comboBoxLinkTarget.SelectedValue = Convert.ToString(this.Settings["LinkTarget"]); } - if (!string.IsNullOrEmpty(Convert.ToString(Settings["ScopeForPortals"]))) + if (!string.IsNullOrEmpty(Convert.ToString(this.Settings["ScopeForPortals"]))) { - var list = Convert.ToString(Settings["ScopeForPortals"]).Split('|').ToList(); - var portalList = LoadPortalsList().ToList(); + var list = Convert.ToString(this.Settings["ScopeForPortals"]).Split('|').ToList(); + var portalList = this.LoadPortalsList().ToList(); if (portalList.Any()) { foreach (var portal in portalList) { var item = new ListItem(portal[0], portal[1]) {Selected = list.Contains(portal[1])}; - comboBoxPortals.Items.Add(item); + this.comboBoxPortals.Items.Add(item); } } else { - divPortalGroup.Visible = false; + this.divPortalGroup.Visible = false; } } else { - var portalList = LoadPortalsList().ToList(); + var portalList = this.LoadPortalsList().ToList(); if (portalList.Any()) { foreach (var portal in portalList) { - var item = new ListItem(portal[0], portal[1]) { Selected = PortalId.ToString() == portal[1] }; - comboBoxPortals.Items.Add(item); + var item = new ListItem(portal[0], portal[1]) { Selected = this.PortalId.ToString() == portal[1] }; + this.comboBoxPortals.Items.Add(item); } } else { - divPortalGroup.Visible = false; + this.divPortalGroup.Visible = false; } } - if (!string.IsNullOrEmpty(Convert.ToString(Settings["ScopeForFilters"]))) + if (!string.IsNullOrEmpty(Convert.ToString(this.Settings["ScopeForFilters"]))) { - var list = Convert.ToString(Settings["ScopeForFilters"]).Split('|').ToList(); - var filterList = LoadSeachContentSourcesList(); + var list = Convert.ToString(this.Settings["ScopeForFilters"]).Split('|').ToList(); + var filterList = this.LoadSeachContentSourcesList(); foreach (var filter in filterList) { var item = new ListItem(filter, filter) {Selected = list.Contains(filter)}; - comboBoxFilters.Items.Add(item); + this.comboBoxFilters.Items.Add(item); } } else { - var filterList = LoadSeachContentSourcesList(); + var filterList = this.LoadSeachContentSourcesList(); foreach (var filter in filterList) { var item = new ListItem(filter, filter) {Selected = true}; - comboBoxFilters.Items.Add(item); + this.comboBoxFilters.Items.Add(item); } } var scopeForRoles = - PortalController.GetPortalSetting("SearchResult_ScopeForRoles", PortalId, string.Empty) + PortalController.GetPortalSetting("SearchResult_ScopeForRoles", this.PortalId, string.Empty) .Split(new []{','}, StringSplitOptions.RemoveEmptyEntries); - var roles = RoleController.Instance.GetRoles(PortalId, r => !r.IsSystemRole || r.RoleName == "Registered Users"); + var roles = RoleController.Instance.GetRoles(this.PortalId, r => !r.IsSystemRole || r.RoleName == "Registered Users"); roles.Insert(0, new RoleInfo(){RoleName = "Superusers" }); foreach (var role in roles) { var item = new ListItem(role.RoleName, role.RoleName) { Selected = scopeForRoles.Length == 0 || scopeForRoles.Contains(role.RoleName) }; - comboBoxRoles.Items.Add(item); + this.comboBoxRoles.Items.Add(item); } - chkEnableWildSearch.Checked = GetBooleanSetting("EnableWildSearch", true); - chkShowDescription.Checked = GetBooleanSetting("ShowDescription", true); - chkShowFriendlyTitle.Checked = GetBooleanSetting("ShowFriendlyTitle", true); - chkShowSnippet.Checked = GetBooleanSetting("ShowSnippet", true); - chkShowLastUpdated.Checked = GetBooleanSetting("ShowLastUpdated", true); - chkShowSource.Checked = GetBooleanSetting("ShowSource", true); - chkShowTags.Checked = GetBooleanSetting("ShowTags", true); + this.chkEnableWildSearch.Checked = this.GetBooleanSetting("EnableWildSearch", true); + this.chkShowDescription.Checked = this.GetBooleanSetting("ShowDescription", true); + this.chkShowFriendlyTitle.Checked = this.GetBooleanSetting("ShowFriendlyTitle", true); + this.chkShowSnippet.Checked = this.GetBooleanSetting("ShowSnippet", true); + this.chkShowLastUpdated.Checked = this.GetBooleanSetting("ShowLastUpdated", true); + this.chkShowSource.Checked = this.GetBooleanSetting("ShowSource", true); + this.chkShowTags.Checked = this.GetBooleanSetting("ShowTags", true); - txtMaxDescriptionLength.Text = GetStringSetting("MaxDescriptionLength", "100"); + this.txtMaxDescriptionLength.Text = this.GetStringSetting("MaxDescriptionLength", "100"); } } catch (Exception exc) //Module failed to load @@ -125,35 +125,35 @@ public override void UpdateSettings() { try { - if (Page.IsValid) + if (this.Page.IsValid) { - ModuleController.Instance.UpdateModuleSetting(ModuleId, "LinkTarget", comboBoxLinkTarget.SelectedValue); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "LinkTarget", this.comboBoxLinkTarget.SelectedValue); - var selectedPortals = comboBoxPortals.Value.Replace(",", "|"); + var selectedPortals = this.comboBoxPortals.Value.Replace(",", "|"); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ScopeForPortals", selectedPortals); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ScopeForPortals", selectedPortals); - var selectedFilters = comboBoxFilters.Value.Replace(",", "|"); + var selectedFilters = this.comboBoxFilters.Value.Replace(",", "|"); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ScopeForFilters", selectedFilters.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ScopeForFilters", selectedFilters.ToString()); - var selectedRoles = comboBoxRoles.Value; - PortalController.UpdatePortalSetting(PortalId, "SearchResult_ScopeForRoles", selectedRoles); + var selectedRoles = this.comboBoxRoles.Value; + PortalController.UpdatePortalSetting(this.PortalId, "SearchResult_ScopeForRoles", selectedRoles); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "EnableWildSearch", chkEnableWildSearch.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowDescription", chkShowDescription.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowFriendlyTitle", chkShowFriendlyTitle.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowSnippet", chkShowSnippet.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowLastUpdated", chkShowLastUpdated.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowSource", chkShowSource.Checked.ToString()); - ModuleController.Instance.UpdateModuleSetting(ModuleId, "ShowTags", chkShowTags.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "EnableWildSearch", this.chkEnableWildSearch.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowDescription", this.chkShowDescription.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowFriendlyTitle", this.chkShowFriendlyTitle.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowSnippet", this.chkShowSnippet.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowLastUpdated", this.chkShowLastUpdated.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowSource", this.chkShowSource.Checked.ToString()); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "ShowTags", this.chkShowTags.Checked.ToString()); - var maxDescriptionLength = txtMaxDescriptionLength.Text; + var maxDescriptionLength = this.txtMaxDescriptionLength.Text; if (string.IsNullOrEmpty(maxDescriptionLength) || !Regex.IsMatch(maxDescriptionLength, "^\\d+$")) { maxDescriptionLength = "100"; } - ModuleController.Instance.UpdateModuleSetting(ModuleId, "MaxDescriptionLength", maxDescriptionLength); + ModuleController.Instance.UpdateModuleSetting(this.ModuleId, "MaxDescriptionLength", maxDescriptionLength); } } catch (Exception exc) @@ -161,7 +161,7 @@ public override void UpdateSettings() Exceptions.ProcessModuleLoadException(this, exc); } - DataCache.RemoveCache(string.Format("ModuleInfos{0}", PortalSettings.PortalId)); + DataCache.RemoveCache(string.Format("ModuleInfos{0}", this.PortalSettings.PortalId)); } #endregion @@ -211,9 +211,9 @@ protected IEnumerable LoadSeachContentSourcesList() private bool GetBooleanSetting(string settingName, bool defaultValue) { - if (!string.IsNullOrEmpty(Convert.ToString(Settings[settingName]))) + if (!string.IsNullOrEmpty(Convert.ToString(this.Settings[settingName]))) { - return Convert.ToBoolean(Settings[settingName]); + return Convert.ToBoolean(this.Settings[settingName]); } return defaultValue; @@ -221,9 +221,9 @@ private bool GetBooleanSetting(string settingName, bool defaultValue) private string GetStringSetting(string settingName, string defaultValue) { - if (!string.IsNullOrEmpty(Convert.ToString(Settings[settingName]))) + if (!string.IsNullOrEmpty(Convert.ToString(this.Settings[settingName]))) { - return Convert.ToString(Settings[settingName]); + return Convert.ToString(this.Settings[settingName]); } return defaultValue; diff --git a/DNN Platform/Website/DesktopModules/Admin/SearchResults/SearchResults.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/SearchResults/SearchResults.ascx.cs index b69870eeadc..1fce0dfce6e 100644 --- a/DNN Platform/Website/DesktopModules/Admin/SearchResults/SearchResults.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/SearchResults/SearchResults.ascx.cs @@ -34,44 +34,44 @@ public partial class SearchResults : PortalModuleBase protected string SearchTerm { - get { return Request.QueryString["Search"] ?? string.Empty; } + get { return this.Request.QueryString["Search"] ?? string.Empty; } } protected string TagsQuery { - get { return Request.QueryString["Tag"] ?? string.Empty; } + get { return this.Request.QueryString["Tag"] ?? string.Empty; } } protected string SearchScopeParam { - get { return Request.QueryString["Scope"] ?? string.Empty; } + get { return this.Request.QueryString["Scope"] ?? string.Empty; } } protected string [] SearchScope { get { - var searchScopeParam = SearchScopeParam; + var searchScopeParam = this.SearchScopeParam; return string.IsNullOrEmpty(searchScopeParam) ? new string[0] : searchScopeParam.Split(','); } } protected string LastModifiedParam { - get { return Request.QueryString["LastModified"] ?? string.Empty; } + get { return this.Request.QueryString["LastModified"] ?? string.Empty; } } protected int PageIndex { get { - if (string.IsNullOrEmpty(Request.QueryString["Page"])) + if (string.IsNullOrEmpty(this.Request.QueryString["Page"])) { return DefaultPageIndex; } int pageIndex; - if (Int32.TryParse(Request.QueryString["Page"], out pageIndex)) + if (Int32.TryParse(this.Request.QueryString["Page"], out pageIndex)) { return pageIndex; } @@ -84,13 +84,13 @@ protected int PageSize { get { - if (string.IsNullOrEmpty(Request.QueryString["Size"])) + if (string.IsNullOrEmpty(this.Request.QueryString["Size"])) { return DefaultPageSize; } int pageSize; - if (Int32.TryParse(Request.QueryString["Size"], out pageSize)) + if (Int32.TryParse(this.Request.QueryString["Size"], out pageSize)) { return pageSize; } @@ -103,13 +103,13 @@ protected int SortOption { get { - if (string.IsNullOrEmpty(Request.QueryString["Sort"])) + if (string.IsNullOrEmpty(this.Request.QueryString["Sort"])) { return DefaultSortOption; } int sortOption; - if (Int32.TryParse(Request.QueryString["Sort"], out sortOption)) + if (Int32.TryParse(this.Request.QueryString["Sort"], out sortOption)) { return sortOption; } @@ -122,7 +122,7 @@ protected string CheckedExactSearch { get { - var paramExactSearch = Request.QueryString["ExactSearch"]; + var paramExactSearch = this.Request.QueryString["ExactSearch"]; if (!string.IsNullOrEmpty(paramExactSearch) && paramExactSearch.ToLowerInvariant() == "y") { @@ -136,42 +136,42 @@ protected string LinkTarget { get { - string settings = Convert.ToString(Settings["LinkTarget"]); + string settings = Convert.ToString(this.Settings["LinkTarget"]); return string.IsNullOrEmpty(settings) || settings == "0" ? string.Empty : " target=\"_blank\" "; } } - protected string ShowDescription => GetBooleanSetting("ShowDescription", true).ToString().ToLowerInvariant(); + protected string ShowDescription => this.GetBooleanSetting("ShowDescription", true).ToString().ToLowerInvariant(); - protected string ShowSnippet => GetBooleanSetting("ShowSnippet", true).ToString().ToLowerInvariant(); + protected string ShowSnippet => this.GetBooleanSetting("ShowSnippet", true).ToString().ToLowerInvariant(); - protected string ShowSource => GetBooleanSetting("ShowSource", true).ToString().ToLowerInvariant(); + protected string ShowSource => this.GetBooleanSetting("ShowSource", true).ToString().ToLowerInvariant(); - protected string ShowLastUpdated => GetBooleanSetting("ShowLastUpdated", true).ToString().ToLowerInvariant(); + protected string ShowLastUpdated => this.GetBooleanSetting("ShowLastUpdated", true).ToString().ToLowerInvariant(); - protected string ShowTags => GetBooleanSetting("ShowTags", true).ToString().ToLowerInvariant(); + protected string ShowTags => this.GetBooleanSetting("ShowTags", true).ToString().ToLowerInvariant(); - protected string MaxDescriptionLength => GetIntegerSetting("MaxDescriptionLength", 100).ToString(); + protected string MaxDescriptionLength => this.GetIntegerSetting("MaxDescriptionLength", 100).ToString(); private IList SearchPortalIds { get { - if (_searchPortalIds == null) + if (this._searchPortalIds == null) { - _searchPortalIds = new List(); - if (!string.IsNullOrEmpty(Convert.ToString(Settings["ScopeForPortals"]))) + this._searchPortalIds = new List(); + if (!string.IsNullOrEmpty(Convert.ToString(this.Settings["ScopeForPortals"]))) { - List list = Convert.ToString(Settings["ScopeForPortals"]).Split('|').ToList(); - foreach (string l in list) _searchPortalIds.Add(Convert.ToInt32(l)); + List list = Convert.ToString(this.Settings["ScopeForPortals"]).Split('|').ToList(); + foreach (string l in list) this._searchPortalIds.Add(Convert.ToInt32(l)); } else { - _searchPortalIds.Add(PortalId); // no setting, just search current portal by default + this._searchPortalIds.Add(this.PortalId); // no setting, just search current portal by default } } - return _searchPortalIds; + return this._searchPortalIds; } } @@ -179,9 +179,9 @@ protected IList SearchContentSources { get { - if (_searchContentSources == null) + if (this._searchContentSources == null) { - IList portalIds = SearchPortalIds; + IList portalIds = this.SearchPortalIds; var list = new List(); foreach (int portalId in portalIds) { @@ -199,12 +199,12 @@ protected IList SearchContentSources List configuredList = null; - if (!string.IsNullOrEmpty(Convert.ToString(Settings["ScopeForFilters"]))) + if (!string.IsNullOrEmpty(Convert.ToString(this.Settings["ScopeForFilters"]))) { - configuredList = Convert.ToString(Settings["ScopeForFilters"]).Split('|').ToList(); + configuredList = Convert.ToString(this.Settings["ScopeForFilters"]).Split('|').ToList(); } - _searchContentSources = new List(); + this._searchContentSources = new List(); // add other searchable module defs foreach (SearchContentSource contentSource in list) @@ -212,15 +212,15 @@ protected IList SearchContentSources if (configuredList == null || configuredList.Any(l => l.Equals(contentSource.LocalizedName))) { - if (!_searchContentSources.Equals(contentSource.LocalizedName)) + if (!this._searchContentSources.Equals(contentSource.LocalizedName)) { - _searchContentSources.Add(contentSource.LocalizedName); + this._searchContentSources.Add(contentSource.LocalizedName); } } } } - return _searchContentSources; + return this._searchContentSources; } } @@ -342,43 +342,43 @@ protected override void OnLoad(EventArgs e) ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.searchBox.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/stylesheets/dnn.searchBox.css", FileOrder.Css.ModuleCss); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/admin/SearchResults/dnn.searchResult.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.searchBox.js"); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnn.searchBox.css", FileOrder.Css.ModuleCss); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/admin/SearchResults/dnn.searchResult.js"); - CultureCode = Thread.CurrentThread.CurrentCulture.ToString(); + this.CultureCode = Thread.CurrentThread.CurrentCulture.ToString(); - foreach (string o in SearchContentSources) + foreach (string o in this.SearchContentSources) { - var item = new ListItem(o, o) {Selected = CheckedScopeItem(o)}; - SearchScopeList.Items.Add(item); + var item = new ListItem(o, o) {Selected = this.CheckedScopeItem(o)}; + this.SearchScopeList.Items.Add(item); } - SearchScopeList.Options.Localization["AllItemsChecked"] = Localization.GetString("AllFeaturesSelected", + this.SearchScopeList.Options.Localization["AllItemsChecked"] = Localization.GetString("AllFeaturesSelected", Localization.GetResourceFile(this, MyFileName)); - var pageSizeItem = ResultsPerPageList.FindItemByValue(PageSize.ToString()); + var pageSizeItem = this.ResultsPerPageList.FindItemByValue(this.PageSize.ToString()); if (pageSizeItem != null) { pageSizeItem.Selected = true; } - SetLastModifiedFilter(); + this.SetLastModifiedFilter(); } private bool CheckedScopeItem(string scopeItemName) { - var searchScope = SearchScope; + var searchScope = this.SearchScope; return searchScope.Length == 0 || searchScope.Any(x => x == scopeItemName); } private void SetLastModifiedFilter() { - var lastModifiedParam = LastModifiedParam; + var lastModifiedParam = this.LastModifiedParam; if (!string.IsNullOrEmpty(lastModifiedParam)) { - var item = AdvnacedDatesList.Items.Cast().FirstOrDefault(x => x.Value == lastModifiedParam); + var item = this.AdvnacedDatesList.Items.Cast().FirstOrDefault(x => x.Value == lastModifiedParam); if (item != null) { item.Selected = true; @@ -388,9 +388,9 @@ private void SetLastModifiedFilter() private bool GetBooleanSetting(string settingName, bool defaultValue) { - if (Settings.ContainsKey(settingName) && !string.IsNullOrEmpty(Convert.ToString(Settings[settingName]))) + if (this.Settings.ContainsKey(settingName) && !string.IsNullOrEmpty(Convert.ToString(this.Settings[settingName]))) { - return Convert.ToBoolean(Settings[settingName]); + return Convert.ToBoolean(this.Settings[settingName]); } return defaultValue; @@ -398,7 +398,7 @@ private bool GetBooleanSetting(string settingName, bool defaultValue) private int GetIntegerSetting(string settingName, int defaultValue) { - var settingValue = Convert.ToString(Settings[settingName]); + var settingValue = Convert.ToString(this.Settings[settingName]); if (!string.IsNullOrEmpty(settingValue) && Regex.IsMatch(settingValue, "^\\d+$")) { return Convert.ToInt32(settingValue); diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/DataConsent.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/DataConsent.ascx.cs index 4731475511a..c5d387612be 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/DataConsent.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/DataConsent.ascx.cs @@ -22,14 +22,14 @@ public string DeleteMeConfirmString { get { - switch (PortalSettings.DataConsentUserDeleteAction) + switch (this.PortalSettings.DataConsentUserDeleteAction) { case PortalSettings.UserDeleteAction.Manual: - return LocalizeString("ManualDelete.Confirm"); + return this.LocalizeString("ManualDelete.Confirm"); case PortalSettings.UserDeleteAction.DelayedHardDelete: - return LocalizeString("DelayedHardDelete.Confirm"); + return this.LocalizeString("DelayedHardDelete.Confirm"); case PortalSettings.UserDeleteAction.HardDelete: - return LocalizeString("HardDelete.Confirm"); + return this.LocalizeString("HardDelete.Confirm"); } return ""; } @@ -41,7 +41,7 @@ public string DeleteMeConfirmString public event DataConsentEventHandler DataConsentCompleted; public void OnDataConsentComplete(DataConsentEventArgs e) { - DataConsentCompleted?.Invoke(this, e); + this.DataConsentCompleted?.Invoke(this, e); } #endregion @@ -49,62 +49,62 @@ public void OnDataConsentComplete(DataConsentEventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdCancel.Click += cmdCancel_Click; - cmdSubmit.Click += cmdSubmit_Click; - cmdDeleteMe.Click += cmdDeleteMe_Click; - cmdDeleteMe.Visible = PortalSettings.DataConsentUserDeleteAction != PortalSettings.UserDeleteAction.Off; - if (!Page.IsPostBack) + this.cmdCancel.Click += this.cmdCancel_Click; + this.cmdSubmit.Click += this.cmdSubmit_Click; + this.cmdDeleteMe.Click += this.cmdDeleteMe_Click; + this.cmdDeleteMe.Visible = this.PortalSettings.DataConsentUserDeleteAction != PortalSettings.UserDeleteAction.Off; + if (!this.Page.IsPostBack) { - chkAgree.Checked = false; - cmdSubmit.Enabled = false; - pnlNoAgreement.Visible = false; + this.chkAgree.Checked = false; + this.cmdSubmit.Enabled = false; + this.pnlNoAgreement.Visible = false; } - chkAgree.Attributes.Add("onclick", string.Format("document.getElementById('{0}').disabled = !this.checked;", cmdSubmit.ClientID)); - cmdDeleteMe.Attributes.Add("onclick", string.Format("if (!confirm('{0}')) this.preventDefault();", DeleteMeConfirmString)); + this.chkAgree.Attributes.Add("onclick", string.Format("document.getElementById('{0}').disabled = !this.checked;", this.cmdSubmit.ClientID)); + this.cmdDeleteMe.Attributes.Add("onclick", string.Format("if (!confirm('{0}')) this.preventDefault();", this.DeleteMeConfirmString)); } private void cmdCancel_Click(object sender, EventArgs e) { - OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.Cancelled)); + this.OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.Cancelled)); } private void cmdSubmit_Click(object sender, EventArgs e) { - if (chkAgree.Checked) + if (this.chkAgree.Checked) { - UserController.UserAgreedToTerms(User); - User.HasAgreedToTerms = true; - OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.Consented)); + UserController.UserAgreedToTerms(this.User); + this.User.HasAgreedToTerms = true; + this.OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.Consented)); } } private void cmdDeleteMe_Click(object sender, EventArgs e) { var success = false; - switch (PortalSettings.DataConsentUserDeleteAction) + switch (this.PortalSettings.DataConsentUserDeleteAction) { case PortalSettings.UserDeleteAction.Manual: - User.Membership.Approved = false; - UserController.UpdateUser(PortalSettings.PortalId, User); - UserController.UserRequestsRemoval(User, true); + this.User.Membership.Approved = false; + UserController.UpdateUser(this.PortalSettings.PortalId, this.User); + UserController.UserRequestsRemoval(this.User, true); success = true; break; case PortalSettings.UserDeleteAction.DelayedHardDelete: - var user = User; + var user = this.User; success = UserController.DeleteUser(ref user, true, false); - UserController.UserRequestsRemoval(User, true); + UserController.UserRequestsRemoval(this.User, true); break; case PortalSettings.UserDeleteAction.HardDelete: - success = UserController.RemoveUser(User); + success = UserController.RemoveUser(this.User); break; } if (success) { PortalSecurity.Instance.SignOut(); - OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.RemovedAccount)); + this.OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.RemovedAccount)); } else { - OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.FailedToRemoveAccount)); + this.OnDataConsentComplete(new DataConsentEventArgs(DataConsentStatus.FailedToRemoveAccount)); } } @@ -124,7 +124,7 @@ public class DataConsentEventArgs /// The Data Consent Status public DataConsentEventArgs(DataConsentStatus status) { - Status = status; + this.Status = status; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs index 932575df4c4..a679206464f 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/EditUser.ascx.cs @@ -45,7 +45,7 @@ public partial class EditUser : UserModuleBase public EditUser() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Protected Members @@ -58,8 +58,8 @@ protected bool DisplayServices { get { - object setting = GetSetting(PortalId, "Profile_ManageServices"); - return Convert.ToBoolean(setting) && !(IsEdit || User.IsSuperUser); + object setting = GetSetting(this.PortalId, "Profile_ManageServices"); + return Convert.ToBoolean(setting) && !(this.IsEdit || this.User.IsSuperUser); } } @@ -73,12 +73,12 @@ protected string RedirectURL { string _RedirectURL = ""; - if (PortalSettings.Registration.RedirectAfterRegistration == Null.NullInteger) + if (this.PortalSettings.Registration.RedirectAfterRegistration == Null.NullInteger) { - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to register - _RedirectURL = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + _RedirectURL = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. _RedirectURL = UrlUtils.ValidReturnUrl(_RedirectURL); @@ -94,12 +94,12 @@ protected string RedirectURL if (String.IsNullOrEmpty(_RedirectURL)) { //redirect to current page - _RedirectURL = _navigationManager.NavigateURL(); + _RedirectURL = this._navigationManager.NavigateURL(); } } else //redirect to after registration page { - _RedirectURL = _navigationManager.NavigateURL(PortalSettings.Registration.RedirectAfterRegistration); + _RedirectURL = this._navigationManager.NavigateURL(this.PortalSettings.Registration.RedirectAfterRegistration); } return _RedirectURL; } @@ -113,7 +113,7 @@ protected string ReturnUrl { get { - return _navigationManager.NavigateURL(TabId, "", !String.IsNullOrEmpty(UserFilter) ? UserFilter : ""); + return this._navigationManager.NavigateURL(this.TabId, "", !String.IsNullOrEmpty(this.UserFilter) ? this.UserFilter : ""); } } @@ -125,9 +125,9 @@ protected string UserFilter { get { - string filterString = !string.IsNullOrEmpty(Request["filter"]) ? "filter=" + Request["filter"] : ""; - string filterProperty = !string.IsNullOrEmpty(Request["filterproperty"]) ? "filterproperty=" + Request["filterproperty"] : ""; - string page = !string.IsNullOrEmpty(Request["currentpage"]) ? "currentpage=" + Request["currentpage"] : ""; + string filterString = !string.IsNullOrEmpty(this.Request["filter"]) ? "filter=" + this.Request["filter"] : ""; + string filterProperty = !string.IsNullOrEmpty(this.Request["filterproperty"]) ? "filterproperty=" + this.Request["filterproperty"] : ""; + string page = !string.IsNullOrEmpty(this.Request["currentpage"]) ? "currentpage=" + this.Request["currentpage"] : ""; if (!string.IsNullOrEmpty(filterString)) { @@ -158,15 +158,15 @@ public int PageNo get { int _PageNo = 0; - if (ViewState["PageNo"] != null && !IsPostBack) + if (this.ViewState["PageNo"] != null && !this.IsPostBack) { - _PageNo = Convert.ToInt32(ViewState["PageNo"]); + _PageNo = Convert.ToInt32(this.ViewState["PageNo"]); } return _PageNo; } set { - ViewState["PageNo"] = value; + this.ViewState["PageNo"] = value; } } @@ -178,142 +178,142 @@ public int PageNo private void BindData() { - if (User != null) + if (this.User != null) { //If trying to add a SuperUser - check that user is a SuperUser - if (VerifyUserPermissions() == false) + if (this.VerifyUserPermissions() == false) { return; } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - if ((Request.QueryString["pageno"] != null)) + if ((this.Request.QueryString["pageno"] != null)) { - PageNo = int.Parse(Request.QueryString["pageno"]); + this.PageNo = int.Parse(this.Request.QueryString["pageno"]); } else { - PageNo = 0; + this.PageNo = 0; } } - userForm.DataSource = User; + this.userForm.DataSource = this.User; // hide username field in UseEmailAsUserName mode - bool disableUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); + bool disableUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false); if (disableUsername) { - userForm.Items[0].Visible = false; + this.userForm.Items[0].Visible = false; } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - userForm.DataBind(); + this.userForm.DataBind(); } - ctlPassword.User = User; - ctlPassword.DataBind(); + this.ctlPassword.User = this.User; + this.ctlPassword.DataBind(); - if ((!DisplayServices)) + if ((!this.DisplayServices)) { - servicesTab.Visible = false; + this.servicesTab.Visible = false; } else { - ctlServices.User = User; - ctlServices.DataBind(); + this.ctlServices.User = this.User; + this.ctlServices.DataBind(); } - BindUser(); - ctlProfile.User = User; - ctlProfile.DataBind(); + this.BindUser(); + this.ctlProfile.User = this.User; + this.ctlProfile.DataBind(); - dnnServicesDetails.Visible = DisplayServices; + this.dnnServicesDetails.Visible = this.DisplayServices; - var urlSettings = new DotNetNuke.Entities.Urls.FriendlyUrlSettings(PortalSettings.PortalId); - var showVanityUrl = (Config.GetFriendlyUrlProvider() == "advanced") && !User.IsSuperUser; + var urlSettings = new DotNetNuke.Entities.Urls.FriendlyUrlSettings(this.PortalSettings.PortalId); + var showVanityUrl = (Config.GetFriendlyUrlProvider() == "advanced") && !this.User.IsSuperUser; if (showVanityUrl) { - VanityUrlRow.Visible = true; - if (String.IsNullOrEmpty(User.VanityUrl)) + this.VanityUrlRow.Visible = true; + if (String.IsNullOrEmpty(this.User.VanityUrl)) { //Clean Display Name bool modified; var options = UrlRewriterUtils.GetOptionsFromSettings(urlSettings); - var cleanUrl = FriendlyUrlController.CleanNameForUrl(User.DisplayName, options, out modified); - var uniqueUrl = FriendlyUrlController.ValidateUrl(cleanUrl, -1, PortalSettings, out modified).ToLowerInvariant(); + var cleanUrl = FriendlyUrlController.CleanNameForUrl(this.User.DisplayName, options, out modified); + var uniqueUrl = FriendlyUrlController.ValidateUrl(cleanUrl, -1, this.PortalSettings, out modified).ToLowerInvariant(); - VanityUrlAlias.Text = String.Format("{0}/{1}/", PortalSettings.PortalAlias.HTTPAlias, urlSettings.VanityUrlPrefix); - VanityUrlTextBox.Text = uniqueUrl; - ShowVanityUrl = true; + this.VanityUrlAlias.Text = String.Format("{0}/{1}/", this.PortalSettings.PortalAlias.HTTPAlias, urlSettings.VanityUrlPrefix); + this.VanityUrlTextBox.Text = uniqueUrl; + this.ShowVanityUrl = true; } else { - VanityUrl.Text = String.Format("{0}/{1}/{2}", PortalSettings.PortalAlias.HTTPAlias, urlSettings.VanityUrlPrefix, User.VanityUrl); - ShowVanityUrl = false; + this.VanityUrl.Text = String.Format("{0}/{1}/{2}", this.PortalSettings.PortalAlias.HTTPAlias, urlSettings.VanityUrlPrefix, this.User.VanityUrl); + this.ShowVanityUrl = false; } } } else { - AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); } } private bool VerifyUserPermissions() { - if (IsHostMenu && !UserInfo.IsSuperUser) + if (this.IsHostMenu && !this.UserInfo.IsSuperUser) { - AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } //Check if User is a member of the Current Portal (or a member of the MasterPortal if PortalGroups enabled) - if (User.PortalID != Null.NullInteger && User.PortalID != PortalId) + if (this.User.PortalID != Null.NullInteger && this.User.PortalID != this.PortalId) { - AddModuleMessage("InvalidUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("InvalidUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } //Check if User is a SuperUser and that the current User is a SuperUser - if (User.IsSuperUser && !UserInfo.IsSuperUser) + if (this.User.IsSuperUser && !this.UserInfo.IsSuperUser) { - AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } - if (IsEdit) + if (this.IsEdit) { //Check if user has admin rights - if (!IsAdmin || (User.IsInRole(PortalSettings.AdministratorRoleName) && !PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName))) + if (!this.IsAdmin || (this.User.IsInRole(this.PortalSettings.AdministratorRoleName) && !PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName))) { - AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } } else { - if (!IsUser) + if (!this.IsUser) { - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - if (!PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName)) + if (!PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName)) { //Display current user's profile - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.UserTabId, "", "UserID=" + UserInfo.UserID), true); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.UserTabId, "", "UserID=" + this.UserInfo.UserID), true); } } else { - if ((User.UserID > Null.NullInteger)) + if ((this.User.UserID > Null.NullInteger)) { - AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } } @@ -324,32 +324,32 @@ private bool VerifyUserPermissions() private void BindMembership() { - ctlMembership.User = User; - ctlMembership.DataBind(); - AddModuleMessage("UserLockedOut", ModuleMessage.ModuleMessageType.YellowWarning, ctlMembership.UserMembership.LockedOut && (!Page.IsPostBack)); + this.ctlMembership.User = this.User; + this.ctlMembership.DataBind(); + this.AddModuleMessage("UserLockedOut", ModuleMessage.ModuleMessageType.YellowWarning, this.ctlMembership.UserMembership.LockedOut && (!this.Page.IsPostBack)); } private void BindUser() { - BindMembership(); + this.BindMembership(); } private void DisableForm() { - adminTabNav.Visible = false; - dnnProfileDetails.Visible = false; - dnnServicesDetails.Visible = false; - actionsRow.Visible = false; - ctlMembership.Visible = false; + this.adminTabNav.Visible = false; + this.dnnProfileDetails.Visible = false; + this.dnnServicesDetails.Visible = false; + this.actionsRow.Visible = false; + this.ctlMembership.Visible = false; } private void UpdateDisplayName() { //Update DisplayName to conform to Format - if (!string.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - User.UpdateDisplayName(PortalSettings.Registration.DisplayNameFormat); + this.User.UpdateDisplayName(this.PortalSettings.Registration.DisplayNameFormat); } } @@ -368,45 +368,45 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - cmdDelete.Click += cmdDelete_Click; - cmdUpdate.Click += cmdUpdate_Click; + this.cmdDelete.Click += this.cmdDelete_Click; + this.cmdUpdate.Click += this.cmdUpdate_Click; - ctlServices.SubscriptionUpdated += SubscriptionUpdated; - ctlProfile.ProfileUpdateCompleted += ProfileUpdateCompleted; - ctlPassword.PasswordUpdated += PasswordUpdated; - ctlPassword.PasswordQuestionAnswerUpdated += PasswordQuestionAnswerUpdated; + this.ctlServices.SubscriptionUpdated += this.SubscriptionUpdated; + this.ctlProfile.ProfileUpdateCompleted += this.ProfileUpdateCompleted; + this.ctlPassword.PasswordUpdated += this.PasswordUpdated; + this.ctlPassword.PasswordQuestionAnswerUpdated += this.PasswordQuestionAnswerUpdated; - email.ValidationExpression = PortalSettings.Registration.EmailValidator; + this.email.ValidationExpression = this.PortalSettings.Registration.EmailValidator; JavaScript.RequestRegistration(CommonJs.DnnPlugins); JavaScript.RequestRegistration(CommonJs.Knockout); //Set the Membership Control Properties - ctlMembership.ID = "Membership"; - ctlMembership.ModuleConfiguration = ModuleConfiguration; - ctlMembership.UserId = UserId; + this.ctlMembership.ID = "Membership"; + this.ctlMembership.ModuleConfiguration = this.ModuleConfiguration; + this.ctlMembership.UserId = this.UserId; //Set the Password Control Properties - ctlPassword.ID = "Password"; - ctlPassword.ModuleConfiguration = ModuleConfiguration; - ctlPassword.UserId = UserId; + this.ctlPassword.ID = "Password"; + this.ctlPassword.ModuleConfiguration = this.ModuleConfiguration; + this.ctlPassword.UserId = this.UserId; //Set the Profile Control Properties - ctlProfile.ID = "Profile"; - ctlProfile.ModuleConfiguration = ModuleConfiguration; - ctlProfile.UserId = UserId; + this.ctlProfile.ID = "Profile"; + this.ctlProfile.ModuleConfiguration = this.ModuleConfiguration; + this.ctlProfile.UserId = this.UserId; //Set the Services Control Properties - ctlServices.ID = "MemberServices"; - ctlServices.ModuleConfiguration = ModuleConfiguration; - ctlServices.UserId = UserId; + this.ctlServices.ID = "MemberServices"; + this.ctlServices.ModuleConfiguration = this.ModuleConfiguration; + this.ctlServices.UserId = this.UserId; //Define DisplayName filed Enabled Property: - object setting = GetSetting(UserPortalID, "Security_DisplayNameFormat"); + object setting = GetSetting(this.UserPortalID, "Security_DisplayNameFormat"); if ((setting != null) && (!string.IsNullOrEmpty(Convert.ToString(setting)))) { - displayName.Enabled = false; + this.displayName.Enabled = false; } } @@ -423,7 +423,7 @@ protected override void OnLoad(EventArgs e) try { //Bind the User information to the controls - BindData(); + this.BindData(); } catch (Exception exc) //Module failed to load { @@ -433,15 +433,15 @@ protected override void OnLoad(EventArgs e) protected void cmdDelete_Click(object sender, EventArgs e) { - UserInfo user = User; + UserInfo user = this.User; var success = false; - if (PortalSettings.DataConsentActive && user.UserID == UserInfo.UserID) + if (this.PortalSettings.DataConsentActive && user.UserID == this.UserInfo.UserID) { - switch (PortalSettings.DataConsentUserDeleteAction) + switch (this.PortalSettings.DataConsentUserDeleteAction) { case PortalSettings.UserDeleteAction.Manual: user.Membership.Approved = false; - UserController.UpdateUser(PortalSettings.PortalId, user); + UserController.UpdateUser(this.PortalSettings.PortalId, user); UserController.UserRequestsRemoval(user, true); success = true; break; @@ -463,67 +463,67 @@ protected void cmdDelete_Click(object sender, EventArgs e) } if (!success) { - AddModuleMessage("UserDeleteError", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("UserDeleteError", ModuleMessage.ModuleMessageType.RedError, true); } //DNN-26777 PortalSecurity.Instance.SignOut(); - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.HomeTabId)); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId)); } protected void cmdUpdate_Click(object sender, EventArgs e) { - if (userForm.IsValid && (User != null)) + if (this.userForm.IsValid && (this.User != null)) { - if (User.UserID == PortalSettings.AdministratorId) + if (this.User.UserID == this.PortalSettings.AdministratorId) { //Clear the Portal Cache - DataCache.ClearPortalCache(UserPortalID, true); + DataCache.ClearPortalCache(this.UserPortalID, true); } try { //Update DisplayName to conform to Format - UpdateDisplayName(); + this.UpdateDisplayName(); //DNN-5874 Check if unique display name is required - if (PortalSettings.Registration.RequireUniqueDisplayName) + if (this.PortalSettings.Registration.RequireUniqueDisplayName) { - var usersWithSameDisplayName = (List)MembershipProvider.Instance().GetUsersBasicSearch(PortalId, 0, 2, "DisplayName", true, "DisplayName", User.DisplayName); - if (usersWithSameDisplayName.Any(user => user.UserID != User.UserID)) + var usersWithSameDisplayName = (List)MembershipProvider.Instance().GetUsersBasicSearch(this.PortalId, 0, 2, "DisplayName", true, "DisplayName", this.User.DisplayName); + if (usersWithSameDisplayName.Any(user => user.UserID != this.User.UserID)) { throw new Exception("Display Name must be unique"); } } - UserController.UpdateUser(UserPortalID, User); + UserController.UpdateUser(this.UserPortalID, this.User); // make sure username matches possibly changed email address - if (PortalSettings.Registration.UseEmailAsUserName) + if (this.PortalSettings.Registration.UseEmailAsUserName) { - if (User.Username.ToLower() != User.Email.ToLower()) + if (this.User.Username.ToLower() != this.User.Email.ToLower()) { - UserController.ChangeUsername(User.UserID, User.Email); + UserController.ChangeUsername(this.User.UserID, this.User.Email); //after username changed, should redirect to login page to let user authenticate again. - var loginUrl = Globals.LoginURL(HttpUtility.UrlEncode(Request.RawUrl), false); + var loginUrl = Globals.LoginURL(HttpUtility.UrlEncode(this.Request.RawUrl), false); var spliter = loginUrl.Contains("?") ? "&" : "?"; - loginUrl = $"{loginUrl}{spliter}username={User.Email}&usernameChanged=true"; - Response.Redirect(loginUrl, true); + loginUrl = $"{loginUrl}{spliter}username={this.User.Email}&usernameChanged=true"; + this.Response.Redirect(loginUrl, true); } } - Response.Redirect(Request.RawUrl); + this.Response.Redirect(this.Request.RawUrl); } catch (Exception exc) { Logger.Error(exc); if (exc.Message == "Display Name must be unique") { - AddModuleMessage("DisplayNameNotUnique", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("DisplayNameNotUnique", ModuleMessage.ModuleMessageType.RedError, true); } else { - AddModuleMessage("UserUpdatedError", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("UserUpdatedError", ModuleMessage.ModuleMessageType.RedError, true); } } } @@ -538,18 +538,18 @@ protected void cmdUpdate_Click(object sender, EventArgs e) /// private void PasswordQuestionAnswerUpdated(object sender, Password.PasswordUpdatedEventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } PasswordUpdateStatus status = e.UpdateStatus; if (status == PasswordUpdateStatus.Success) { - AddModuleMessage("PasswordQAChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("PasswordQAChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); } else { - AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); } } @@ -561,7 +561,7 @@ private void PasswordQuestionAnswerUpdated(object sender, Password.PasswordUpdat /// private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } @@ -573,28 +573,28 @@ private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) try { var accessingUser = (UserInfo)HttpContext.Current.Items["UserInfo"]; - if (accessingUser.UserID != User.UserID) + if (accessingUser.UserID != this.User.UserID) { //The password was changed by someone else - Mail.SendMail(User, MessageType.PasswordReminder, PortalSettings); + Mail.SendMail(this.User, MessageType.PasswordReminder, this.PortalSettings); } else { //The User changed his own password - Mail.SendMail(User, MessageType.UserUpdatedOwnPassword, PortalSettings); - PortalSecurity.Instance.SignIn(User, false); + Mail.SendMail(this.User, MessageType.UserUpdatedOwnPassword, this.PortalSettings); + PortalSecurity.Instance.SignIn(this.User, false); } - AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); } catch (Exception ex) { - AddModuleMessage("PasswordMailError", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.AddModuleMessage("PasswordMailError", ModuleMessage.ModuleMessageType.YellowWarning, true); Exceptions.LogException(ex); } } else { - AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); } } @@ -606,33 +606,33 @@ private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) /// private void ProfileUpdateCompleted(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (IsUser) + if (this.IsUser) { //Notify the user that his/her profile was updated - Mail.SendMail(User, MessageType.ProfileUpdated, PortalSettings); + Mail.SendMail(this.User, MessageType.ProfileUpdated, this.PortalSettings); - ProfilePropertyDefinition localeProperty = User.Profile.GetProperty("PreferredLocale"); + ProfilePropertyDefinition localeProperty = this.User.Profile.GetProperty("PreferredLocale"); if (localeProperty.IsDirty) { //store preferredlocale in cookie, if none specified set to portal default. - if (User.Profile.PreferredLocale == string.Empty) + if (this.User.Profile.PreferredLocale == string.Empty) { - Localization.SetLanguage(PortalController.GetPortalDefaultLanguage(User.PortalID)); + Localization.SetLanguage(PortalController.GetPortalDefaultLanguage(this.User.PortalID)); } else { - Localization.SetLanguage(User.Profile.PreferredLocale); + Localization.SetLanguage(this.User.Profile.PreferredLocale); } } } //Redirect to same page (this will update all controls for any changes to profile //and leave us at Page 0 (User Credentials) - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void SubscriptionUpdated(object sender, MemberServices.SubscriptionUpdatedEventArgs e) @@ -640,13 +640,13 @@ private void SubscriptionUpdated(object sender, MemberServices.SubscriptionUpdat string message; if (e.Cancel) { - message = string.Format(Localization.GetString("UserUnSubscribed", LocalResourceFile), e.RoleName); + message = string.Format(Localization.GetString("UserUnSubscribed", this.LocalResourceFile), e.RoleName); } else { - message = string.Format(Localization.GetString("UserSubscribed", LocalResourceFile), e.RoleName); + message = string.Format(Localization.GetString("UserSubscribed", this.LocalResourceFile), e.RoleName); } - AddLocalizedModuleMessage(message, ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddLocalizedModuleMessage(message, ModuleMessage.ModuleMessageType.GreenSuccess, true); } #endregion diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs index de3b828b42e..73d988ffc23 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/ManageUsers.ascx.cs @@ -43,7 +43,7 @@ public partial class ManageUsers : UserModuleBase, IActionable private readonly INavigationManager _navigationManager; public ManageUsers() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Protected Members @@ -56,8 +56,8 @@ protected bool DisplayServices { get { - object setting = GetSetting(PortalId, "Profile_ManageServices"); - return Convert.ToBoolean(setting) && !(IsEdit || User.IsSuperUser); + object setting = GetSetting(this.PortalId, "Profile_ManageServices"); + return Convert.ToBoolean(setting) && !(this.IsEdit || this.User.IsSuperUser); } } @@ -71,12 +71,12 @@ protected string RedirectURL { string _RedirectURL = ""; - if (PortalSettings.Registration.RedirectAfterRegistration == Null.NullInteger) + if (this.PortalSettings.Registration.RedirectAfterRegistration == Null.NullInteger) { - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to register - _RedirectURL = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + _RedirectURL = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. _RedirectURL = UrlUtils.ValidReturnUrl(_RedirectURL); @@ -92,12 +92,12 @@ protected string RedirectURL if (String.IsNullOrEmpty(_RedirectURL)) { //redirect to current page - _RedirectURL = _navigationManager.NavigateURL(); + _RedirectURL = this._navigationManager.NavigateURL(); } } else //redirect to after registration page { - _RedirectURL = _navigationManager.NavigateURL(PortalSettings.Registration.RedirectAfterRegistration); + _RedirectURL = this._navigationManager.NavigateURL(this.PortalSettings.Registration.RedirectAfterRegistration); } return _RedirectURL; } @@ -111,7 +111,7 @@ protected string ReturnUrl { get { - return _navigationManager.NavigateURL(TabId, "", !String.IsNullOrEmpty(UserFilter) ? UserFilter : ""); + return this._navigationManager.NavigateURL(this.TabId, "", !String.IsNullOrEmpty(this.UserFilter) ? this.UserFilter : ""); } } @@ -123,9 +123,9 @@ protected string UserFilter { get { - string filterString = !string.IsNullOrEmpty(Request["filter"]) ? "filter=" + Request["filter"] : ""; - string filterProperty = !string.IsNullOrEmpty(Request["filterproperty"]) ? "filterproperty=" + Request["filterproperty"] : ""; - string page = !string.IsNullOrEmpty(Request["currentpage"]) ? "currentpage=" + Request["currentpage"] : ""; + string filterString = !string.IsNullOrEmpty(this.Request["filter"]) ? "filter=" + this.Request["filter"] : ""; + string filterProperty = !string.IsNullOrEmpty(this.Request["filterproperty"]) ? "filterproperty=" + this.Request["filterproperty"] : ""; + string page = !string.IsNullOrEmpty(this.Request["currentpage"]) ? "currentpage=" + this.Request["currentpage"] : ""; if (!string.IsNullOrEmpty(filterString)) { @@ -152,8 +152,8 @@ protected bool EditProfileMode { bool editProfile; - return !string.IsNullOrEmpty(Request.QueryString["editProfile"]) - && bool.TryParse(Request["editProfile"], out editProfile) + return !string.IsNullOrEmpty(this.Request.QueryString["editProfile"]) + && bool.TryParse(this.Request["editProfile"], out editProfile) && editProfile; } } @@ -171,15 +171,15 @@ public int PageNo get { int _PageNo = 0; - if (ViewState["PageNo"] != null && !IsPostBack) + if (this.ViewState["PageNo"] != null && !this.IsPostBack) { - _PageNo = Convert.ToInt32(ViewState["PageNo"]); + _PageNo = Convert.ToInt32(this.ViewState["PageNo"]); } return _PageNo; } set { - ViewState["PageNo"] = value; + this.ViewState["PageNo"] = value; } } @@ -192,39 +192,39 @@ public ModuleActionCollection ModuleActions get { var Actions = new ModuleActionCollection(); - if (!IsProfile) + if (!this.IsProfile) { - if (!AddUser && !IsEdit) + if (!this.AddUser && !this.IsEdit) { - Actions.Add(GetNextActionID(), - Localization.GetString(ModuleActionType.AddContent, LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "add.gif", - EditUrl(), + this.EditUrl(), false, SecurityAccessLevel.Admin, true, false); if (ProfileProviderConfig.CanEditProviderProperties) { - Actions.Add(GetNextActionID(), - Localization.GetString("ManageProfile.Action", LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString("ManageProfile.Action", this.LocalResourceFile), ModuleActionType.AddContent, "", "icon_profile_16px.gif", - EditUrl("ManageProfile"), + this.EditUrl("ManageProfile"), false, SecurityAccessLevel.Admin, true, false); } - Actions.Add(GetNextActionID(), - Localization.GetString("Cancel.Action", LocalResourceFile), + Actions.Add(this.GetNextActionID(), + Localization.GetString("Cancel.Action", this.LocalResourceFile), ModuleActionType.AddContent, "", "lt.gif", - ReturnUrl, + this.ReturnUrl, false, SecurityAccessLevel.Admin, true, @@ -241,110 +241,110 @@ public ModuleActionCollection ModuleActions private void BindData() { - if (User != null) + if (this.User != null) { //If trying to add a SuperUser - check that user is a SuperUser - if (VerifyUserPermissions()==false) + if (this.VerifyUserPermissions()==false) { return; } - if (AddUser) + if (this.AddUser) { - cmdAdd.Text = Localization.GetString("AddUser", LocalResourceFile); - lblTitle.Text = Localization.GetString("AddUser", LocalResourceFile); + this.cmdAdd.Text = Localization.GetString("AddUser", this.LocalResourceFile); + this.lblTitle.Text = Localization.GetString("AddUser", this.LocalResourceFile); } else { - if (!Request.IsAuthenticated) + if (!this.Request.IsAuthenticated) { - titleRow.Visible = false; + this.titleRow.Visible = false; } else { - if (IsProfile) + if (this.IsProfile) { - titleRow.Visible = false; + this.titleRow.Visible = false; } else { - lblTitle.Text = string.Format(Localization.GetString("UserTitle", LocalResourceFile), User.Username, User.UserID); + this.lblTitle.Text = string.Format(Localization.GetString("UserTitle", this.LocalResourceFile), this.User.Username, this.User.UserID); } } } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - if ((Request.QueryString["pageno"] != null)) + if ((this.Request.QueryString["pageno"] != null)) { - PageNo = int.Parse(Request.QueryString["pageno"]); + this.PageNo = int.Parse(this.Request.QueryString["pageno"]); } else { - PageNo = 0; + this.PageNo = 0; } } - ShowPanel(); + this.ShowPanel(); } else { - AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); } } private bool VerifyUserPermissions() { - if (AddUser && IsHostMenu && !UserInfo.IsSuperUser) + if (this.AddUser && this.IsHostMenu && !this.UserInfo.IsSuperUser) { - AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } //Check if User is a member of the Current Portal (or a member of the MasterPortal if PortalGroups enabled) - if (User.PortalID != Null.NullInteger && User.PortalID != PortalId) + if (this.User.PortalID != Null.NullInteger && this.User.PortalID != this.PortalId) { - AddModuleMessage("InvalidUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("InvalidUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } //Check if User is a SuperUser and that the current User is a SuperUser - if (User.IsSuperUser && !UserInfo.IsSuperUser) + if (this.User.IsSuperUser && !this.UserInfo.IsSuperUser) { - AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NoUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } - if (IsEdit) + if (this.IsEdit) { //Check if user has admin rights - if (!IsAdmin || (User.IsInRole(PortalSettings.AdministratorRoleName) && !PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName))) + if (!this.IsAdmin || (this.User.IsInRole(this.PortalSettings.AdministratorRoleName) && !PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName))) { - AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } } else { - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - if (!PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) ) + if (!PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName) ) { - if (HasManageUsersModulePermission() == false) + if (this.HasManageUsersModulePermission() == false) { //Display current user's profile - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.UserTabId, "", "UserID=" + UserInfo.UserID), true); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.UserTabId, "", "UserID=" + this.UserInfo.UserID), true); } } } else { - if ((User.UserID > Null.NullInteger)) + if ((this.User.UserID > Null.NullInteger)) { - AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); - DisableForm(); + this.AddModuleMessage("NotAuthorized", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.DisableForm(); return false; } } @@ -354,113 +354,113 @@ private bool VerifyUserPermissions() private void BindMembership() { - ctlMembership.User = User; - ctlMembership.DataBind(); - AddModuleMessage("UserLockedOut", ModuleMessage.ModuleMessageType.YellowWarning, ctlMembership.UserMembership.LockedOut && (!Page.IsPostBack)); - imgLockedOut.Visible = ctlMembership.UserMembership.LockedOut; - imgOnline.Visible = ctlMembership.UserMembership.IsOnLine; + this.ctlMembership.User = this.User; + this.ctlMembership.DataBind(); + this.AddModuleMessage("UserLockedOut", ModuleMessage.ModuleMessageType.YellowWarning, this.ctlMembership.UserMembership.LockedOut && (!this.Page.IsPostBack)); + this.imgLockedOut.Visible = this.ctlMembership.UserMembership.LockedOut; + this.imgOnline.Visible = this.ctlMembership.UserMembership.IsOnLine; } private void BindUser() { - if (AddUser) + if (this.AddUser) { - ctlUser.ShowUpdate = false; - CheckQuota(); + this.ctlUser.ShowUpdate = false; + this.CheckQuota(); } - ctlUser.User = User; - ctlUser.DataBind(); + this.ctlUser.User = this.User; + this.ctlUser.DataBind(); //Bind the Membership - if (AddUser || (!IsAdmin)) + if (this.AddUser || (!this.IsAdmin)) { - membershipRow.Visible = false; + this.membershipRow.Visible = false; } else { - BindMembership(); + this.BindMembership(); } } private void CheckQuota() { - if (PortalSettings.Users < PortalSettings.UserQuota || UserInfo.IsSuperUser || PortalSettings.UserQuota == 0) + if (this.PortalSettings.Users < this.PortalSettings.UserQuota || this.UserInfo.IsSuperUser || this.PortalSettings.UserQuota == 0) { - cmdAdd.Enabled = true; + this.cmdAdd.Enabled = true; } else { - cmdAdd.Enabled = false; - AddModuleMessage("ExceededUserQuota", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.cmdAdd.Enabled = false; + this.AddModuleMessage("ExceededUserQuota", ModuleMessage.ModuleMessageType.YellowWarning, true); } } private void DisableForm() { - adminTabNav.Visible = false; - dnnRoleDetails.Visible = false; - dnnPasswordDetails.Visible = false; - dnnProfileDetails.Visible = false; - actionsRow.Visible = false; - ctlMembership.Visible = false; - ctlUser.Visible = false; + this.adminTabNav.Visible = false; + this.dnnRoleDetails.Visible = false; + this.dnnPasswordDetails.Visible = false; + this.dnnProfileDetails.Visible = false; + this.actionsRow.Visible = false; + this.ctlMembership.Visible = false; + this.ctlUser.Visible = false; } private void ShowPanel() { - if (AddUser) + if (this.AddUser) { - adminTabNav.Visible = false; - if (Request.IsAuthenticated && MembershipProviderConfig.RequiresQuestionAndAnswer) + this.adminTabNav.Visible = false; + if (this.Request.IsAuthenticated && MembershipProviderConfig.RequiresQuestionAndAnswer) { //Admin adding user - dnnManageUsers.Visible = false; - actionsRow.Visible = false; - AddModuleMessage("CannotAddUser", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.dnnManageUsers.Visible = false; + this.actionsRow.Visible = false; + this.AddModuleMessage("CannotAddUser", ModuleMessage.ModuleMessageType.YellowWarning, true); } else { - dnnManageUsers.Visible = true; - actionsRow.Visible = true; + this.dnnManageUsers.Visible = true; + this.actionsRow.Visible = true; } - BindUser(); - dnnProfileDetails.Visible = false; + this.BindUser(); + this.dnnProfileDetails.Visible = false; } else { - if ((!IsAdmin)) + if ((!this.IsAdmin)) { - passwordTab.Visible = false; + this.passwordTab.Visible = false; } else { - ctlPassword.User = User; - ctlPassword.DataBind(); + this.ctlPassword.User = this.User; + this.ctlPassword.DataBind(); } - if ((!IsEdit || User.IsSuperUser)) + if ((!this.IsEdit || this.User.IsSuperUser)) { - rolesTab.Visible = false; + this.rolesTab.Visible = false; } else { - ctlRoles.DataBind(); + this.ctlRoles.DataBind(); } - BindUser(); - ctlProfile.User = User; - ctlProfile.DataBind(); + this.BindUser(); + this.ctlProfile.User = this.User; + this.ctlProfile.DataBind(); } - dnnRoleDetails.Visible = IsEdit && !User.IsSuperUser && !AddUser; - dnnPasswordDetails.Visible = (IsAdmin) && !AddUser; + this.dnnRoleDetails.Visible = this.IsEdit && !this.User.IsSuperUser && !this.AddUser; + this.dnnPasswordDetails.Visible = (this.IsAdmin) && !this.AddUser; - if(EditProfileMode) + if(this.EditProfileMode) { - adminTabNav.Visible = - dnnUserDetails.Visible = - dnnRoleDetails.Visible = - dnnPasswordDetails.Visible = - actionsRow.Visible = false; + this.adminTabNav.Visible = + this.dnnUserDetails.Visible = + this.dnnRoleDetails.Visible = + this.dnnPasswordDetails.Visible = + this.actionsRow.Visible = false; } } @@ -478,68 +478,68 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - cmdCancel.Click += cmdCancel_Click; - cmdAdd.Click += cmdAdd_Click; - - ctlUser.UserCreateCompleted += UserCreateCompleted; - ctlUser.UserDeleted += UserDeleted; - ctlUser.UserRemoved += UserRemoved; - ctlUser.UserRestored += UserRestored; - ctlUser.UserUpdateCompleted += UserUpdateCompleted; - ctlUser.UserUpdateError += UserUpdateError; - - ctlProfile.ProfileUpdateCompleted += ProfileUpdateCompleted; - ctlPassword.PasswordUpdated += PasswordUpdated; - ctlPassword.PasswordQuestionAnswerUpdated += PasswordQuestionAnswerUpdated; - ctlMembership.MembershipAuthorized += MembershipAuthorized; - ctlMembership.MembershipPasswordUpdateChanged += MembershipPasswordUpdateChanged; - ctlMembership.MembershipUnAuthorized += MembershipUnAuthorized; - ctlMembership.MembershipUnLocked += MembershipUnLocked; - ctlMembership.MembershipDemoteFromSuperuser += MembershipDemoteFromSuperuser; - ctlMembership.MembershipPromoteToSuperuser += MembershipPromoteToSuperuser; + this.cmdCancel.Click += this.cmdCancel_Click; + this.cmdAdd.Click += this.cmdAdd_Click; + + this.ctlUser.UserCreateCompleted += this.UserCreateCompleted; + this.ctlUser.UserDeleted += this.UserDeleted; + this.ctlUser.UserRemoved += this.UserRemoved; + this.ctlUser.UserRestored += this.UserRestored; + this.ctlUser.UserUpdateCompleted += this.UserUpdateCompleted; + this.ctlUser.UserUpdateError += this.UserUpdateError; + + this.ctlProfile.ProfileUpdateCompleted += this.ProfileUpdateCompleted; + this.ctlPassword.PasswordUpdated += this.PasswordUpdated; + this.ctlPassword.PasswordQuestionAnswerUpdated += this.PasswordQuestionAnswerUpdated; + this.ctlMembership.MembershipAuthorized += this.MembershipAuthorized; + this.ctlMembership.MembershipPasswordUpdateChanged += this.MembershipPasswordUpdateChanged; + this.ctlMembership.MembershipUnAuthorized += this.MembershipUnAuthorized; + this.ctlMembership.MembershipUnLocked += this.MembershipUnLocked; + this.ctlMembership.MembershipDemoteFromSuperuser += this.MembershipDemoteFromSuperuser; + this.ctlMembership.MembershipPromoteToSuperuser += this.MembershipPromoteToSuperuser; JavaScript.RequestRegistration(CommonJs.DnnPlugins); //Set the Membership Control Properties - ctlMembership.ID = "Membership"; - ctlMembership.ModuleConfiguration = ModuleConfiguration; - ctlMembership.UserId = UserId; + this.ctlMembership.ID = "Membership"; + this.ctlMembership.ModuleConfiguration = this.ModuleConfiguration; + this.ctlMembership.UserId = this.UserId; //Set the User Control Properties - ctlUser.ID = "User"; - ctlUser.ModuleConfiguration = ModuleConfiguration; - ctlUser.UserId = UserId; + this.ctlUser.ID = "User"; + this.ctlUser.ModuleConfiguration = this.ModuleConfiguration; + this.ctlUser.UserId = this.UserId; //Set the Roles Control Properties - ctlRoles.ID = "SecurityRoles"; - ctlRoles.ModuleConfiguration = ModuleConfiguration; - ctlRoles.ParentModule = this; + this.ctlRoles.ID = "SecurityRoles"; + this.ctlRoles.ModuleConfiguration = this.ModuleConfiguration; + this.ctlRoles.ParentModule = this; //Set the Password Control Properties - ctlPassword.ID = "Password"; - ctlPassword.ModuleConfiguration = ModuleConfiguration; - ctlPassword.UserId = UserId; + this.ctlPassword.ID = "Password"; + this.ctlPassword.ModuleConfiguration = this.ModuleConfiguration; + this.ctlPassword.UserId = this.UserId; //Set the Profile Control Properties - ctlProfile.ID = "Profile"; - ctlProfile.ModuleConfiguration = ModuleConfiguration; - ctlProfile.UserId = UserId; + this.ctlProfile.ID = "Profile"; + this.ctlProfile.ModuleConfiguration = this.ModuleConfiguration; + this.ctlProfile.UserId = this.UserId; //Customise the Control Title - if (AddUser) + if (this.AddUser) { - if (!Request.IsAuthenticated) + if (!this.Request.IsAuthenticated) { //Register - ModuleConfiguration.ModuleTitle = Localization.GetString("Register.Title", LocalResourceFile); + this.ModuleConfiguration.ModuleTitle = Localization.GetString("Register.Title", this.LocalResourceFile); } else { //Add User - ModuleConfiguration.ModuleTitle = Localization.GetString("AddUser.Title", LocalResourceFile); + this.ModuleConfiguration.ModuleTitle = Localization.GetString("AddUser.Title", this.LocalResourceFile); } - userContainer.CssClass += " register"; + this.userContainer.CssClass += " register"; } } @@ -556,16 +556,16 @@ protected override void OnLoad(EventArgs e) try { //Add an Action Event Handler to the Skin - AddActionHandler(ModuleAction_Click); + this.AddActionHandler(this.ModuleAction_Click); //Bind the User information to the controls - BindData(); + this.BindData(); - loginLink.NavigateUrl = Globals.LoginURL(RedirectURL, (Request.QueryString["override"] != null)); + this.loginLink.NavigateUrl = Globals.LoginURL(this.RedirectURL, (this.Request.QueryString["override"] != null)); - if (PortalSettings.EnablePopUps) + if (this.PortalSettings.EnablePopUps) { - loginLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(loginLink.NavigateUrl, this, PortalSettings, true, false, 300, 650)); + this.loginLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(this.loginLink.NavigateUrl, this, this.PortalSettings, true, false, 300, 650)); } } catch (Exception exc) //Module failed to load @@ -576,12 +576,12 @@ protected override void OnLoad(EventArgs e) protected void cmdCancel_Click(object sender, EventArgs e) { - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } private bool HasManageUsersModulePermission() { - return ModulePermissionController.HasModulePermission(ModuleConfiguration.ModulePermissions, "MANAGEUSER"); + return ModulePermissionController.HasModulePermission(this.ModuleConfiguration.ModulePermissions, "MANAGEUSER"); } /// ----------------------------------------------------------------------------- @@ -592,19 +592,19 @@ private bool HasManageUsersModulePermission() /// protected void cmdAdd_Click(object sender, EventArgs e) { - if (IsAdmin == false && HasManageUsersModulePermission() == false) + if (this.IsAdmin == false && this.HasManageUsersModulePermission() == false) { return; } - if (ctlUser.IsValid && (ctlProfile.IsValid)) + if (this.ctlUser.IsValid && (this.ctlProfile.IsValid)) { - ctlUser.CreateUser(); + this.ctlUser.CreateUser(); } else { - if (ctlUser.CreateStatus != UserCreateStatus.AddUser) + if (this.ctlUser.CreateStatus != UserCreateStatus.AddUser) { - AddLocalizedModuleMessage(UserController.GetUserCreateStatus(ctlUser.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(UserController.GetUserCreateStatus(this.ctlUser.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); } } } @@ -646,22 +646,22 @@ private void ModuleAction_Click(object sender, ActionEventArgs e) /// private void MembershipAuthorized(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } try { - AddModuleMessage("UserAuthorized", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("UserAuthorized", ModuleMessage.ModuleMessageType.GreenSuccess, true); //Send Notification to User - if (string.IsNullOrEmpty(User.Membership.Password) && !MembershipProviderConfig.RequiresQuestionAndAnswer && MembershipProviderConfig.PasswordRetrievalEnabled) + if (string.IsNullOrEmpty(this.User.Membership.Password) && !MembershipProviderConfig.RequiresQuestionAndAnswer && MembershipProviderConfig.PasswordRetrievalEnabled) { - UserInfo user = User; - User.Membership.Password = UserController.GetPassword(ref user, ""); + UserInfo user = this.User; + this.User.Membership.Password = UserController.GetPassword(ref user, ""); } - BindMembership(); + this.BindMembership(); } catch (Exception exc) //Module failed to load { @@ -677,15 +677,15 @@ private void MembershipAuthorized(object sender, EventArgs e) /// protected void MembershipPasswordUpdateChanged(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } try { - AddModuleMessage("UserPasswordUpdateChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("UserPasswordUpdateChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); - BindMembership(); + this.BindMembership(); } catch (Exception exc) //Module failed to load { @@ -704,15 +704,15 @@ protected void MembershipPasswordUpdateChanged(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void MembershipPromoteToSuperuser(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } try { - AddModuleMessage("UserPromotedToSuperuser", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("UserPromotedToSuperuser", ModuleMessage.ModuleMessageType.GreenSuccess, true); - BindMembership(); + this.BindMembership(); } catch (Exception exc) //Module failed to load { @@ -729,15 +729,15 @@ private void MembershipPromoteToSuperuser(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void MembershipDemoteFromSuperuser(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } try { - AddModuleMessage("UserDemotedFromSuperuser", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("UserDemotedFromSuperuser", ModuleMessage.ModuleMessageType.GreenSuccess, true); - BindMembership(); + this.BindMembership(); } catch (Exception exc) //Module failed to load { @@ -753,15 +753,15 @@ private void MembershipDemoteFromSuperuser(object sender, EventArgs e) /// private void MembershipUnAuthorized(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } try { - AddModuleMessage("UserUnAuthorized", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("UserUnAuthorized", ModuleMessage.ModuleMessageType.GreenSuccess, true); - BindMembership(); + this.BindMembership(); } catch (Exception exc) //Module failed to load { @@ -777,14 +777,14 @@ private void MembershipUnAuthorized(object sender, EventArgs e) /// private void MembershipUnLocked(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } try { - AddModuleMessage("UserUnLocked", ModuleMessage.ModuleMessageType.GreenSuccess, true); - BindMembership(); + this.AddModuleMessage("UserUnLocked", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.BindMembership(); } catch (Exception exc) //Module failed to load { @@ -800,18 +800,18 @@ private void MembershipUnLocked(object sender, EventArgs e) /// private void PasswordQuestionAnswerUpdated(object sender, Password.PasswordUpdatedEventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } PasswordUpdateStatus status = e.UpdateStatus; if (status == PasswordUpdateStatus.Success) { - AddModuleMessage("PasswordQAChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("PasswordQAChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); } else { - AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); } } @@ -823,7 +823,7 @@ private void PasswordQuestionAnswerUpdated(object sender, Password.PasswordUpdat /// private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } @@ -835,27 +835,27 @@ private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) try { var accessingUser = (UserInfo) HttpContext.Current.Items["UserInfo"]; - if (accessingUser.UserID != User.UserID) + if (accessingUser.UserID != this.User.UserID) { //The password was changed by someone else - Mail.SendMail(User, MessageType.PasswordUpdated, PortalSettings); + Mail.SendMail(this.User, MessageType.PasswordUpdated, this.PortalSettings); } else { //The User changed his own password - Mail.SendMail(User, MessageType.UserUpdatedOwnPassword, PortalSettings); + Mail.SendMail(this.User, MessageType.UserUpdatedOwnPassword, this.PortalSettings); } - AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true); } catch (Exception ex) { - AddModuleMessage("PasswordMailError", ModuleMessage.ModuleMessageType.YellowWarning, true); + this.AddModuleMessage("PasswordMailError", ModuleMessage.ModuleMessageType.YellowWarning, true); Exceptions.LogException(ex); } } else { - AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true); } } @@ -867,14 +867,14 @@ private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e) /// private void ProfileUpdateCompleted(object sender, EventArgs e) { - if (IsAdmin == false) + if (this.IsAdmin == false) { return; } //Redirect to same page (this will update all controls for any changes to profile //and leave us at Page 0 (User Credentials) - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } private void SubscriptionUpdated(object sender, MemberServices.SubscriptionUpdatedEventArgs e) @@ -882,13 +882,13 @@ private void SubscriptionUpdated(object sender, MemberServices.SubscriptionUpdat string message = Null.NullString; if (e.Cancel) { - message = string.Format(Localization.GetString("UserUnSubscribed", LocalResourceFile), e.RoleName); + message = string.Format(Localization.GetString("UserUnSubscribed", this.LocalResourceFile), e.RoleName); } else { - message = string.Format(Localization.GetString("UserSubscribed", LocalResourceFile), e.RoleName); + message = string.Format(Localization.GetString("UserSubscribed", this.LocalResourceFile), e.RoleName); } - AddLocalizedModuleMessage(message, ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.AddLocalizedModuleMessage(message, ModuleMessage.ModuleMessageType.GreenSuccess, true); } /// ----------------------------------------------------------------------------- @@ -903,12 +903,12 @@ private void UserCreateCompleted(object sender, UserUserControlBase.UserCreatedE { if (e.CreateStatus == UserCreateStatus.Success) { - CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, false); - Response.Redirect(ReturnUrl, true); + this.CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, false); + this.Response.Redirect(this.ReturnUrl, true); } else { - AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); } } catch (Exception exc) //Module failed to load @@ -927,7 +927,7 @@ private void UserDeleted(object sender, UserUserControlBase.UserDeletedEventArgs { try { - Response.Redirect(ReturnUrl, true); + this.Response.Redirect(this.ReturnUrl, true); } catch (Exception exc) //Module failed to load { @@ -945,7 +945,7 @@ private void UserRestored(object sender, UserUserControlBase.UserRestoredEventAr { try { - Response.Redirect(ReturnUrl, true); + this.Response.Redirect(this.ReturnUrl, true); //Module failed to load } catch (Exception exc) @@ -958,7 +958,7 @@ private void UserRemoved(object sender, UserUserControlBase.UserRemovedEventArgs { try { - Response.Redirect(ReturnUrl, true); + this.Response.Redirect(this.ReturnUrl, true); //Module failed to load } catch (Exception exc) @@ -969,7 +969,7 @@ private void UserRemoved(object sender, UserUserControlBase.UserRemovedEventArgs private void UserUpdateCompleted(object sender, EventArgs e) { - Response.Redirect(Request.RawUrl, false); + this.Response.Redirect(this.Request.RawUrl, false); HttpContext.Current.ApplicationInstance.CompleteRequest(); } @@ -981,7 +981,7 @@ private void UserUpdateCompleted(object sender, EventArgs e) /// private void UserUpdateError(object sender, UserUserControlBase.UserUpdateErrorArgs e) { - AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true); } #endregion diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/MemberServices.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/MemberServices.ascx.cs index f56b1b2077d..3a0ac56c419 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/MemberServices.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/MemberServices.ascx.cs @@ -77,42 +77,42 @@ private string FormatPrice(float price) private void Subscribe(int roleID, bool cancel) { - RoleInfo objRole = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == roleID); + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == roleID); if (objRole.IsPublic && objRole.ServiceFee == 0.0) { - RoleController.Instance.UpdateUserRole(PortalId, UserInfo.UserID, roleID, RoleStatus.Approved, false, cancel); + RoleController.Instance.UpdateUserRole(this.PortalId, this.UserInfo.UserID, roleID, RoleStatus.Approved, false, cancel); //Raise SubscriptionUpdated Event - OnSubscriptionUpdated(new SubscriptionUpdatedEventArgs(cancel, objRole.RoleName)); + this.OnSubscriptionUpdated(new SubscriptionUpdatedEventArgs(cancel, objRole.RoleName)); } else { if (!cancel) { - Response.Redirect("~/admin/Sales/PayPalSubscription.aspx?tabid=" + TabId + "&RoleID=" + roleID, true); + this.Response.Redirect("~/admin/Sales/PayPalSubscription.aspx?tabid=" + this.TabId + "&RoleID=" + roleID, true); } else { - Response.Redirect("~/admin/Sales/PayPalSubscription.aspx?tabid=" + TabId + "&RoleID=" + roleID + "&cancel=1", true); + this.Response.Redirect("~/admin/Sales/PayPalSubscription.aspx?tabid=" + this.TabId + "&RoleID=" + roleID + "&cancel=1", true); } } } private void UseTrial(int roleID) { - RoleInfo objRole = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == roleID); ; + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == roleID); ; if (objRole.IsPublic && objRole.TrialFee == 0.0) { - RoleController.Instance.UpdateUserRole(PortalId, UserInfo.UserID, roleID, RoleStatus.Approved, false, false); + RoleController.Instance.UpdateUserRole(this.PortalId, this.UserInfo.UserID, roleID, RoleStatus.Approved, false, false); //Raise SubscriptionUpdated Event - OnSubscriptionUpdated(new SubscriptionUpdatedEventArgs(false, objRole.RoleName)); + this.OnSubscriptionUpdated(new SubscriptionUpdatedEventArgs(false, objRole.RoleName)); } else { - Response.Redirect("~/admin/Sales/PayPalSubscription.aspx?tabid=" + TabId + "&RoleID=" + roleID, true); + this.Response.Redirect("~/admin/Sales/PayPalSubscription.aspx?tabid=" + this.TabId + "&RoleID=" + roleID, true); } } @@ -142,7 +142,7 @@ protected string FormatExpiryDate(DateTime expiryDate) } else { - formatExpiryDate = Localization.GetString("Expired", LocalResourceFile); + formatExpiryDate = Localization.GetString("Expired", this.LocalResourceFile); } } } @@ -173,13 +173,13 @@ protected string FormatPrice(float price, int period, string frequency) { case "N": case "": - formatPrice = Localization.GetString("NoFee", LocalResourceFile); + formatPrice = Localization.GetString("NoFee", this.LocalResourceFile); break; case "O": - formatPrice = FormatPrice(price); + formatPrice = this.FormatPrice(price); break; default: - formatPrice = string.Format(Localization.GetString("Fee", LocalResourceFile), FormatPrice(price), period, Localization.GetString("Frequency_" + frequency, LocalResourceFile)); + formatPrice = string.Format(Localization.GetString("Fee", this.LocalResourceFile), this.FormatPrice(price), period, Localization.GetString("Frequency_" + frequency, this.LocalResourceFile)); break; } } @@ -210,16 +210,16 @@ protected string FormatTrial(float price, int period, string frequency) { case "N": case "": - formatTrial = Localization.GetString("NoFee", LocalResourceFile); + formatTrial = Localization.GetString("NoFee", this.LocalResourceFile); break; case "O": - formatTrial = FormatPrice(price); + formatTrial = this.FormatPrice(price); break; default: - formatTrial = string.Format(Localization.GetString("TrialFee", LocalResourceFile), - FormatPrice(price), + formatTrial = string.Format(Localization.GetString("TrialFee", this.LocalResourceFile), + this.FormatPrice(price), period, - Localization.GetString("Frequency_" + frequency, LocalResourceFile)); + Localization.GetString("Frequency_" + frequency, this.LocalResourceFile)); break; } } @@ -243,12 +243,12 @@ protected string FormatURL() string formatURL = Null.NullString; try { - string serverPath = Request.ApplicationPath; + string serverPath = this.Request.ApplicationPath; if (!serverPath.EndsWith("/")) { serverPath += "/"; } - formatURL = serverPath + "Register.aspx?tabid=" + TabId; + formatURL = serverPath + "Register.aspx?tabid=" + this.TabId; } catch (Exception exc) //Module failed to load { @@ -274,16 +274,16 @@ protected string ServiceText(bool subscribed, DateTime expiryDate) { if (!subscribed) { - serviceText = Localization.GetString("Subscribe", LocalResourceFile); + serviceText = Localization.GetString("Subscribe", this.LocalResourceFile); } else { - serviceText = Localization.GetString("Unsubscribe", LocalResourceFile); + serviceText = Localization.GetString("Unsubscribe", this.LocalResourceFile); if (!Null.IsNull(expiryDate)) { if (expiryDate < DateTime.Today) { - serviceText = Localization.GetString("Renew", LocalResourceFile); + serviceText = Localization.GetString("Renew", this.LocalResourceFile); } } } @@ -298,10 +298,10 @@ protected string ServiceText(bool subscribed, DateTime expiryDate) protected bool ShowSubscribe(int roleID) { bool showSubscribe = Null.NullBoolean; - RoleInfo objRole = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == roleID); ; + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == roleID); ; if (objRole.IsPublic) { - PortalInfo objPortal = PortalController.Instance.GetPortal(PortalSettings.PortalId); + PortalInfo objPortal = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); if (objRole.ServiceFee == 0.0) { showSubscribe = true; @@ -317,7 +317,7 @@ protected bool ShowSubscribe(int roleID) protected bool ShowTrial(int roleID) { bool showTrial = Null.NullBoolean; - RoleInfo objRole = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == roleID); ; + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == roleID); ; if (string.IsNullOrEmpty(objRole.TrialFrequency) || objRole.TrialFrequency == "N" || (objRole.IsPublic && objRole.ServiceFee == 0.0)) { showTrial = Null.NullBoolean; @@ -325,7 +325,7 @@ protected bool ShowTrial(int roleID) else if (objRole.IsPublic && objRole.TrialFee == 0.0) { //Use Trial? - UserRoleInfo objUserRole = RoleController.Instance.GetUserRole(PortalId, UserInfo.UserID, roleID); + UserRoleInfo objUserRole = RoleController.Instance.GetUserRole(this.PortalId, this.UserInfo.UserID, roleID); if ((objUserRole == null) || (!objUserRole.IsTrialUsed)) { showTrial = true; @@ -345,14 +345,14 @@ protected bool ShowTrial(int roleID) /// ----------------------------------------------------------------------------- public override void DataBind() { - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - Localization.LocalizeDataGrid(ref grdServices, LocalResourceFile); - grdServices.DataSource = RoleController.Instance.GetUserRoles(UserInfo, false); - grdServices.DataBind(); + Localization.LocalizeDataGrid(ref this.grdServices, this.LocalResourceFile); + this.grdServices.DataSource = RoleController.Instance.GetUserRoles(this.UserInfo, false); + this.grdServices.DataBind(); //if no service available then hide options - ServicesRow.Visible = (grdServices.Items.Count > 0); + this.ServicesRow.Visible = (this.grdServices.Items.Count > 0); } } @@ -367,13 +367,13 @@ public override void DataBind() /// ----------------------------------------------------------------------------- public void OnSubscriptionUpdated(SubscriptionUpdatedEventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (SubscriptionUpdated != null) + if (this.SubscriptionUpdated != null) { - SubscriptionUpdated(this, e); + this.SubscriptionUpdated(this, e); } } @@ -392,9 +392,9 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdRSVP.Click += cmdRSVP_Click; - grdServices.ItemCommand += grdServices_ItemCommand; - lblRSVP.Text = ""; + this.cmdRSVP.Click += this.cmdRSVP_Click; + this.grdServices.ItemCommand += this.grdServices_ItemCommand; + this.lblRSVP.Text = ""; } /// ----------------------------------------------------------------------------- @@ -406,63 +406,63 @@ protected override void OnLoad(EventArgs e) /// ----------------------------------------------------------------------------- private void cmdRSVP_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } //Get the RSVP code - string code = txtRSVPCode.Text; + string code = this.txtRSVPCode.Text; bool rsvpCodeExists = false; if (!String.IsNullOrEmpty(code)) { //Parse the roles - foreach (RoleInfo objRole in RoleController.Instance.GetRoles(PortalSettings.PortalId)) + foreach (RoleInfo objRole in RoleController.Instance.GetRoles(this.PortalSettings.PortalId)) { if (objRole.RSVPCode == code) { - RoleController.Instance.UpdateUserRole(PortalId, UserInfo.UserID, objRole.RoleID, RoleStatus.Approved, false, false); + RoleController.Instance.UpdateUserRole(this.PortalId, this.UserInfo.UserID, objRole.RoleID, RoleStatus.Approved, false, false); rsvpCodeExists = true; //Raise SubscriptionUpdated Event - OnSubscriptionUpdated(new SubscriptionUpdatedEventArgs(false, objRole.RoleName)); + this.OnSubscriptionUpdated(new SubscriptionUpdatedEventArgs(false, objRole.RoleName)); } } if (rsvpCodeExists) { - lblRSVP.Text = Localization.GetString("RSVPSuccess", LocalResourceFile); + this.lblRSVP.Text = Localization.GetString("RSVPSuccess", this.LocalResourceFile); //Reset RSVP Code field - txtRSVPCode.Text = ""; + this.txtRSVPCode.Text = ""; } else { - lblRSVP.Text = Localization.GetString("RSVPFailure", LocalResourceFile); + this.lblRSVP.Text = Localization.GetString("RSVPFailure", this.LocalResourceFile); } } - DataBind(); + this.DataBind(); } protected void grdServices_ItemCommand(object source, DataGridCommandEventArgs e) { string commandName = e.CommandName; int roleID = Convert.ToInt32(e.CommandArgument); - if (commandName == Localization.GetString("Subscribe", LocalResourceFile) || commandName == Localization.GetString("Renew", LocalResourceFile)) + if (commandName == Localization.GetString("Subscribe", this.LocalResourceFile) || commandName == Localization.GetString("Renew", this.LocalResourceFile)) { //Subscribe - Subscribe(roleID, false); + this.Subscribe(roleID, false); } - else if (commandName == Localization.GetString("Unsubscribe", LocalResourceFile)) + else if (commandName == Localization.GetString("Unsubscribe", this.LocalResourceFile)) { //Unsubscribe - Subscribe(roleID, true); + this.Subscribe(roleID, true); } else if (commandName == "UseTrial") { //Use Trial - UseTrial(roleID); + this.UseTrial(roleID); } //Rebind Grid - DataBind(); + this.DataBind(); } #endregion @@ -486,8 +486,8 @@ public class SubscriptionUpdatedEventArgs /// ----------------------------------------------------------------------------- public SubscriptionUpdatedEventArgs(bool cancel, string roleName) { - Cancel = cancel; - RoleName = roleName; + this.Cancel = cancel; + this.RoleName = roleName; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/Membership.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/Membership.ascx.cs index 21110c4f586..50938d8a438 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/Membership.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/Membership.ascx.cs @@ -38,7 +38,7 @@ public partial class Membership : UserModuleBase private readonly INavigationManager _navigationManager; public Membership() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region "Public Properties" @@ -53,9 +53,9 @@ public UserMembership UserMembership get { UserMembership membership = null; - if (User != null) + if (this.User != null) { - membership = User.Membership; + membership = this.User.Membership; } return membership; } @@ -89,14 +89,14 @@ public UserMembership UserMembership /// ----------------------------------------------------------------------------- public void OnMembershipPromoteToSuperuser(EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (MembershipPromoteToSuperuser != null) + if (this.MembershipPromoteToSuperuser != null) { - MembershipPromoteToSuperuser(this, e); - Response.Redirect(_navigationManager.NavigateURL(), true); + this.MembershipPromoteToSuperuser(this, e); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } @@ -107,14 +107,14 @@ public void OnMembershipPromoteToSuperuser(EventArgs e) /// ----------------------------------------------------------------------------- public void OnMembershipDemoteFromSuperuser(EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (MembershipDemoteFromSuperuser != null) + if (this.MembershipDemoteFromSuperuser != null) { - MembershipDemoteFromSuperuser(this, e); - Response.Redirect(_navigationManager.NavigateURL(), true); + this.MembershipDemoteFromSuperuser(this, e); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } @@ -126,13 +126,13 @@ public void OnMembershipDemoteFromSuperuser(EventArgs e) /// ----------------------------------------------------------------------------- public void OnMembershipAuthorized(EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (MembershipAuthorized != null) + if (this.MembershipAuthorized != null) { - MembershipAuthorized(this, e); + this.MembershipAuthorized(this, e); } } @@ -143,13 +143,13 @@ public void OnMembershipAuthorized(EventArgs e) /// ----------------------------------------------------------------------------- public void OnMembershipPasswordUpdateChanged(EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (MembershipPasswordUpdateChanged != null) + if (this.MembershipPasswordUpdateChanged != null) { - MembershipPasswordUpdateChanged(this, e); + this.MembershipPasswordUpdateChanged(this, e); } } @@ -160,13 +160,13 @@ public void OnMembershipPasswordUpdateChanged(EventArgs e) /// ----------------------------------------------------------------------------- public void OnMembershipUnAuthorized(EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (MembershipUnAuthorized != null) + if (this.MembershipUnAuthorized != null) { - MembershipUnAuthorized(this, e); + this.MembershipUnAuthorized(this, e); } } @@ -177,13 +177,13 @@ public void OnMembershipUnAuthorized(EventArgs e) /// ----------------------------------------------------------------------------- public void OnMembershipUnLocked(EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (MembershipUnLocked != null) + if (this.MembershipUnLocked != null) { - MembershipUnLocked(this, e); + this.MembershipUnLocked(this, e); } } @@ -199,58 +199,58 @@ public void OnMembershipUnLocked(EventArgs e) public override void DataBind() { //disable/enable buttons - if (UserInfo.UserID == User.UserID) + if (this.UserInfo.UserID == this.User.UserID) { - cmdAuthorize.Visible = false; - cmdUnAuthorize.Visible = false; - cmdUnLock.Visible = false; - cmdPassword.Visible = false; + this.cmdAuthorize.Visible = false; + this.cmdUnAuthorize.Visible = false; + this.cmdUnLock.Visible = false; + this.cmdPassword.Visible = false; } else { - cmdUnLock.Visible = UserMembership.LockedOut; - cmdUnAuthorize.Visible = UserMembership.Approved && !User.IsInRole("Unverified Users"); - cmdAuthorize.Visible = !UserMembership.Approved || User.IsInRole("Unverified Users"); - cmdPassword.Visible = !UserMembership.UpdatePassword; + this.cmdUnLock.Visible = this.UserMembership.LockedOut; + this.cmdUnAuthorize.Visible = this.UserMembership.Approved && !this.User.IsInRole("Unverified Users"); + this.cmdAuthorize.Visible = !this.UserMembership.Approved || this.User.IsInRole("Unverified Users"); + this.cmdPassword.Visible = !this.UserMembership.UpdatePassword; } - if (UserController.Instance.GetCurrentUserInfo().IsSuperUser && UserController.Instance.GetCurrentUserInfo().UserID!=User.UserID) + if (UserController.Instance.GetCurrentUserInfo().IsSuperUser && UserController.Instance.GetCurrentUserInfo().UserID!=this.User.UserID) { - cmdToggleSuperuser.Visible = true; + this.cmdToggleSuperuser.Visible = true; - if (User.IsSuperUser) + if (this.User.IsSuperUser) { - cmdToggleSuperuser.Text = Localization.GetString("DemoteFromSuperUser", LocalResourceFile); + this.cmdToggleSuperuser.Text = Localization.GetString("DemoteFromSuperUser", this.LocalResourceFile); } else { - cmdToggleSuperuser.Text = Localization.GetString("PromoteToSuperUser", LocalResourceFile); + this.cmdToggleSuperuser.Text = Localization.GetString("PromoteToSuperUser", this.LocalResourceFile); } - if (PortalController.GetPortalsByUser(User.UserID).Count == 0) + if (PortalController.GetPortalsByUser(this.User.UserID).Count == 0) { - cmdToggleSuperuser.Visible = false; + this.cmdToggleSuperuser.Visible = false; } } - lastLockoutDate.Value = UserMembership.LastLockoutDate.Year > 2000 - ? (object) UserMembership.LastLockoutDate - : LocalizeString("Never"); + this.lastLockoutDate.Value = this.UserMembership.LastLockoutDate.Year > 2000 + ? (object) this.UserMembership.LastLockoutDate + : this.LocalizeString("Never"); // ReSharper disable SpecifyACultureInStringConversionExplicitly - isOnLine.Value = LocalizeString(UserMembership.IsOnLine.ToString()); - lockedOut.Value = LocalizeString(UserMembership.LockedOut.ToString()); - approved.Value = LocalizeString(UserMembership.Approved.ToString()); - updatePassword.Value = LocalizeString(UserMembership.UpdatePassword.ToString()); - isDeleted.Value = LocalizeString(UserMembership.IsDeleted.ToString()); + this.isOnLine.Value = this.LocalizeString(this.UserMembership.IsOnLine.ToString()); + this.lockedOut.Value = this.LocalizeString(this.UserMembership.LockedOut.ToString()); + this.approved.Value = this.LocalizeString(this.UserMembership.Approved.ToString()); + this.updatePassword.Value = this.LocalizeString(this.UserMembership.UpdatePassword.ToString()); + this.isDeleted.Value = this.LocalizeString(this.UserMembership.IsDeleted.ToString()); //show the user folder path without default parent folder, and only visible to admin. - userFolder.Visible = UserInfo.IsInRole(PortalSettings.AdministratorRoleName); - if (userFolder.Visible) + this.userFolder.Visible = this.UserInfo.IsInRole(this.PortalSettings.AdministratorRoleName); + if (this.userFolder.Visible) { - userFolder.Value = FolderManager.Instance.GetUserFolder(User).FolderPath.Substring(6); + this.userFolder.Value = FolderManager.Instance.GetUserFolder(this.User).FolderPath.Substring(6); } // ReSharper restore SpecifyACultureInStringConversionExplicitly - membershipForm.DataSource = UserMembership; - membershipForm.DataBind(); + this.membershipForm.DataSource = this.UserMembership; + this.membershipForm.DataBind(); } #endregion @@ -268,11 +268,11 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdAuthorize.Click += cmdAuthorize_Click; - cmdPassword.Click += cmdPassword_Click; - cmdUnAuthorize.Click += cmdUnAuthorize_Click; - cmdUnLock.Click += cmdUnLock_Click; - cmdToggleSuperuser.Click+=cmdToggleSuperuser_Click; + this.cmdAuthorize.Click += this.cmdAuthorize_Click; + this.cmdPassword.Click += this.cmdPassword_Click; + this.cmdUnAuthorize.Click += this.cmdUnAuthorize_Click; + this.cmdUnLock.Click += this.cmdUnLock_Click; + this.cmdToggleSuperuser.Click+=this.cmdToggleSuperuser_Click; } @@ -283,29 +283,29 @@ protected override void OnLoad(EventArgs e) /// ----------------------------------------------------------------------------- private void cmdAuthorize_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (Request.IsAuthenticated != true) return; + if (this.Request.IsAuthenticated != true) return; //Get the Membership Information from the property editors - User.Membership = (UserMembership)membershipForm.DataSource; + this.User.Membership = (UserMembership)this.membershipForm.DataSource; - User.Membership.Approved = true; + this.User.Membership.Approved = true; //Update User - UserController.UpdateUser(PortalId, User); + UserController.UpdateUser(this.PortalId, this.User); //Update User Roles if needed - if (!User.IsSuperUser && User.IsInRole("Unverified Users") && PortalSettings.UserRegistration == (int)Common.Globals.PortalRegistrationType.VerifiedRegistration) + if (!this.User.IsSuperUser && this.User.IsInRole("Unverified Users") && this.PortalSettings.UserRegistration == (int)Common.Globals.PortalRegistrationType.VerifiedRegistration) { - UserController.ApproveUser(User); + UserController.ApproveUser(this.User); } - Mail.SendMail(User, MessageType.UserAuthorized, PortalSettings); + Mail.SendMail(this.User, MessageType.UserAuthorized, this.PortalSettings); - OnMembershipAuthorized(EventArgs.Empty); + this.OnMembershipAuthorized(EventArgs.Empty); } /// ----------------------------------------------------------------------------- @@ -315,29 +315,29 @@ private void cmdAuthorize_Click(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cmdPassword_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (Request.IsAuthenticated != true) return; + if (this.Request.IsAuthenticated != true) return; - bool canSend = Mail.SendMail(User, MessageType.PasswordReminder, PortalSettings) == string.Empty; + bool canSend = Mail.SendMail(this.User, MessageType.PasswordReminder, this.PortalSettings) == string.Empty; var message = String.Empty; if (canSend) { //Get the Membership Information from the property editors - User.Membership = (UserMembership)membershipForm.DataSource; + this.User.Membership = (UserMembership)this.membershipForm.DataSource; - User.Membership.UpdatePassword = true; + this.User.Membership.UpdatePassword = true; //Update User - UserController.UpdateUser(PortalId, User); + UserController.UpdateUser(this.PortalId, this.User); - OnMembershipPasswordUpdateChanged(EventArgs.Empty); + this.OnMembershipPasswordUpdateChanged(EventArgs.Empty); } else { - message = Localization.GetString("OptionUnavailable", LocalResourceFile); + message = Localization.GetString("OptionUnavailable", this.LocalResourceFile); UI.Skins.Skin.AddModuleMessage(this, message, ModuleMessage.ModuleMessageType.YellowWarning); } @@ -350,21 +350,21 @@ private void cmdPassword_Click(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cmdUnAuthorize_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (Request.IsAuthenticated != true) return; + if (this.Request.IsAuthenticated != true) return; //Get the Membership Information from the property editors - User.Membership = (UserMembership)membershipForm.DataSource; + this.User.Membership = (UserMembership)this.membershipForm.DataSource; - User.Membership.Approved = false; + this.User.Membership.Approved = false; //Update User - UserController.UpdateUser(PortalId, User); + UserController.UpdateUser(this.PortalId, this.User); - OnMembershipUnAuthorized(EventArgs.Empty); + this.OnMembershipUnAuthorized(EventArgs.Empty); } /// /// cmdToggleSuperuser_Click runs when the toggle superuser button is clicked @@ -373,27 +373,27 @@ private void cmdUnAuthorize_Click(object sender, EventArgs e) /// private void cmdToggleSuperuser_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (Request.IsAuthenticated != true) return; + if (this.Request.IsAuthenticated != true) return; ////ensure only superusers can change user superuser state if (UserController.Instance.GetCurrentUserInfo().IsSuperUser != true) return; - var currentSuperUserState = User.IsSuperUser; - User.IsSuperUser = !currentSuperUserState; + var currentSuperUserState = this.User.IsSuperUser; + this.User.IsSuperUser = !currentSuperUserState; //Update User - UserController.UpdateUser(PortalId, User); + UserController.UpdateUser(this.PortalId, this.User); DataCache.ClearCache(); if (currentSuperUserState) { - OnMembershipDemoteFromSuperuser(EventArgs.Empty); + this.OnMembershipDemoteFromSuperuser(EventArgs.Empty); } else { - OnMembershipPromoteToSuperuser(EventArgs.Empty); + this.OnMembershipPromoteToSuperuser(EventArgs.Empty); } } @@ -404,20 +404,20 @@ private void cmdToggleSuperuser_Click(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cmdUnLock_Click(Object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (Request.IsAuthenticated != true) return; + if (this.Request.IsAuthenticated != true) return; //update the user record in the database - bool isUnLocked = UserController.UnLockUser(User); + bool isUnLocked = UserController.UnLockUser(this.User); if (isUnLocked) { - User.Membership.LockedOut = false; + this.User.Membership.LockedOut = false; - OnMembershipUnLocked(EventArgs.Empty); + this.OnMembershipUnLocked(EventArgs.Empty); } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/Password.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/Password.ascx.cs index 1c57ca0333e..956e5051cb3 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/Password.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/Password.ascx.cs @@ -48,7 +48,7 @@ protected bool UseCaptcha { get { - return Convert.ToBoolean(GetSetting(PortalId, "Security_CaptchaChangePassword")); + return Convert.ToBoolean(GetSetting(this.PortalId, "Security_CaptchaChangePassword")); } } #region Delegates @@ -68,9 +68,9 @@ public UserMembership Membership get { UserMembership _Membership = null; - if (User != null) + if (this.User != null) { - _Membership = User.Membership; + _Membership = this.User.Membership; } return _Membership; } @@ -95,13 +95,13 @@ public UserMembership Membership /// public void OnPasswordUpdated(PasswordUpdatedEventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (PasswordUpdated != null) + if (this.PasswordUpdated != null) { - PasswordUpdated(this, e); + this.PasswordUpdated(this, e); } } @@ -111,13 +111,13 @@ public void OnPasswordUpdated(PasswordUpdatedEventArgs e) /// public void OnPasswordQuestionAnswerUpdated(PasswordUpdatedEventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (PasswordQuestionAnswerUpdated != null) + if (this.PasswordQuestionAnswerUpdated != null) { - PasswordQuestionAnswerUpdated(this, e); + this.PasswordQuestionAnswerUpdated(this, e); } } @@ -131,50 +131,50 @@ public void OnPasswordQuestionAnswerUpdated(PasswordUpdatedEventArgs e) ///
    public override void DataBind() { - lblLastChanged.Text = User.Membership.LastPasswordChangeDate.ToLongDateString(); + this.lblLastChanged.Text = this.User.Membership.LastPasswordChangeDate.ToLongDateString(); //Set Password Expiry Label - if (User.Membership.UpdatePassword) + if (this.User.Membership.UpdatePassword) { - lblExpires.Text = Localization.GetString("ForcedExpiry", LocalResourceFile); + this.lblExpires.Text = Localization.GetString("ForcedExpiry", this.LocalResourceFile); } else { - lblExpires.Text = PasswordConfig.PasswordExpiry > 0 ? User.Membership.LastPasswordChangeDate.AddDays(PasswordConfig.PasswordExpiry).ToLongDateString() : Localization.GetString("NoExpiry", LocalResourceFile); + this.lblExpires.Text = PasswordConfig.PasswordExpiry > 0 ? this.User.Membership.LastPasswordChangeDate.AddDays(PasswordConfig.PasswordExpiry).ToLongDateString() : Localization.GetString("NoExpiry", this.LocalResourceFile); } - if (((!MembershipProviderConfig.PasswordRetrievalEnabled) && IsAdmin && (!IsUser))) + if (((!MembershipProviderConfig.PasswordRetrievalEnabled) && this.IsAdmin && (!this.IsUser))) { - pnlChange.Visible = true; - cmdUpdate.Visible = true; - oldPasswordRow.Visible = false; - lblChangeHelp.Text = Localization.GetString("AdminChangeHelp", LocalResourceFile); + this.pnlChange.Visible = true; + this.cmdUpdate.Visible = true; + this.oldPasswordRow.Visible = false; + this.lblChangeHelp.Text = Localization.GetString("AdminChangeHelp", this.LocalResourceFile); } else { - pnlChange.Visible = true; - cmdUpdate.Visible = true; + this.pnlChange.Visible = true; + this.cmdUpdate.Visible = true; //Set up Change Password - if (IsAdmin && !IsUser) + if (this.IsAdmin && !this.IsUser) { - lblChangeHelp.Text = Localization.GetString("AdminChangeHelp", LocalResourceFile); - oldPasswordRow.Visible = false; + this.lblChangeHelp.Text = Localization.GetString("AdminChangeHelp", this.LocalResourceFile); + this.oldPasswordRow.Visible = false; } else { - lblChangeHelp.Text = Localization.GetString("UserChangeHelp", LocalResourceFile); - if (Request.IsAuthenticated) + this.lblChangeHelp.Text = Localization.GetString("UserChangeHelp", this.LocalResourceFile); + if (this.Request.IsAuthenticated) { - pnlChange.Visible = true; - cmdUserReset.Visible = false; - cmdUpdate.Visible = true; + this.pnlChange.Visible = true; + this.cmdUserReset.Visible = false; + this.cmdUpdate.Visible = true; } else { - pnlChange.Visible = false; - cmdUserReset.Visible = true; - cmdUpdate.Visible = false; + this.pnlChange.Visible = false; + this.cmdUserReset.Visible = true; + this.cmdUpdate.Visible = false; } } } @@ -183,56 +183,56 @@ public override void DataBind() //Password, a User must Update if (!MembershipProviderConfig.PasswordResetEnabled) { - pnlReset.Visible = false; - cmdReset.Visible = false; + this.pnlReset.Visible = false; + this.cmdReset.Visible = false; } else { - pnlReset.Visible = true; - cmdReset.Visible = true; + this.pnlReset.Visible = true; + this.cmdReset.Visible = true; //Set up Reset Password - if (IsAdmin && !IsUser) + if (this.IsAdmin && !this.IsUser) { if (MembershipProviderConfig.RequiresQuestionAndAnswer) { - pnlReset.Visible = false; - cmdReset.Visible = false; + this.pnlReset.Visible = false; + this.cmdReset.Visible = false; } else { - lblResetHelp.Text = Localization.GetString("AdminResetHelp", LocalResourceFile); + this.lblResetHelp.Text = Localization.GetString("AdminResetHelp", this.LocalResourceFile); } - questionRow.Visible = false; - answerRow.Visible = false; + this.questionRow.Visible = false; + this.answerRow.Visible = false; } else { - if (MembershipProviderConfig.RequiresQuestionAndAnswer && IsUser) + if (MembershipProviderConfig.RequiresQuestionAndAnswer && this.IsUser) { - lblResetHelp.Text = Localization.GetString("UserResetHelp", LocalResourceFile); - lblQuestion.Text = User.Membership.PasswordQuestion; - questionRow.Visible = true; - answerRow.Visible = true; + this.lblResetHelp.Text = Localization.GetString("UserResetHelp", this.LocalResourceFile); + this.lblQuestion.Text = this.User.Membership.PasswordQuestion; + this.questionRow.Visible = true; + this.answerRow.Visible = true; } else { - pnlReset.Visible = false; - cmdReset.Visible = false; + this.pnlReset.Visible = false; + this.cmdReset.Visible = false; } } } //Set up Edit Question and Answer area - if (MembershipProviderConfig.RequiresQuestionAndAnswer && IsUser) + if (MembershipProviderConfig.RequiresQuestionAndAnswer && this.IsUser) { - pnlQA.Visible = true; - cmdUpdateQA.Visible = true; + this.pnlQA.Visible = true; + this.cmdUpdateQA.Visible = true; } else { - pnlQA.Visible = false; - cmdUpdateQA.Visible = false; + this.pnlQA.Visible = false; + this.cmdUpdateQA.Visible = false; } } @@ -243,23 +243,23 @@ public override void DataBind() protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdReset.Click += cmdReset_Click; - cmdUserReset.Click += cmdUserReset_Click; - cmdUpdate.Click += cmdUpdate_Click; - cmdUpdateQA.Click += cmdUpdateQA_Click; + this.cmdReset.Click += this.cmdReset_Click; + this.cmdUserReset.Click += this.cmdUserReset_Click; + this.cmdUpdate.Click += this.cmdUpdate_Click; + this.cmdUpdateQA.Click += this.cmdUpdateQA_Click; - if (MembershipProviderConfig.RequiresQuestionAndAnswer && User.UserID != UserController.Instance.GetCurrentUserInfo().UserID) + if (MembershipProviderConfig.RequiresQuestionAndAnswer && this.User.UserID != UserController.Instance.GetCurrentUserInfo().UserID) { - pnlChange.Visible = false; - cmdUpdate.Visible = false; - CannotChangePasswordMessage.Visible = true; + this.pnlChange.Visible = false; + this.cmdUpdate.Visible = false; + this.CannotChangePasswordMessage.Visible = true; } - if (UseCaptcha) + if (this.UseCaptcha) { - captchaRow.Visible = true; - ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", LocalResourceFile); - ctlCaptcha.Text = Localization.GetString("CaptchaText", LocalResourceFile); + this.captchaRow.Visible = true; + this.ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", this.LocalResourceFile); + this.ctlCaptcha.Text = Localization.GetString("CaptchaText", this.LocalResourceFile); } } @@ -267,12 +267,12 @@ protected override void OnLoad(EventArgs e) protected override void OnPreRender(EventArgs e) { - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); JavaScript.RequestRegistration(CommonJs.DnnPlugins); @@ -280,27 +280,27 @@ protected override void OnPreRender(EventArgs e) if (Host.EnableStrengthMeter) { - passwordContainer.CssClass = "password-strength-container"; - txtNewPassword.CssClass = "password-strength"; + this.passwordContainer.CssClass = "password-strength-container"; + this.txtNewPassword.CssClass = "password-strength"; var options = new DnnPaswordStrengthOptions(); var optionsAsJsonString = Json.Serialize(options); var script = string.Format("dnn.initializePasswordStrength('.{0}', {1});{2}", "password-strength", optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "PasswordStrength", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "PasswordStrength", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "PasswordStrength", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "PasswordStrength", script, true); } } var confirmPasswordOptions = new DnnConfirmPasswordOptions() { - FirstElementSelector = "#" + passwordContainer.ClientID + " input[type=password]", + FirstElementSelector = "#" + this.passwordContainer.ClientID + " input[type=password]", SecondElementSelector = ".password-confirm", ContainerSelector = ".dnnPassword", UnmatchedCssClass = "unmatched", @@ -310,52 +310,52 @@ protected override void OnPreRender(EventArgs e) var confirmOptionsAsJsonString = Json.Serialize(confirmPasswordOptions); var confirmScript = string.Format("dnn.initializePasswordComparer({0});{1}", confirmOptionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "ConfirmPassword", confirmScript, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ConfirmPassword", confirmScript, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "ConfirmPassword", confirmScript, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ConfirmPassword", confirmScript, true); } } private void cmdReset_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } string answer = ""; - if (MembershipProviderConfig.RequiresQuestionAndAnswer && !IsAdmin) + if (MembershipProviderConfig.RequiresQuestionAndAnswer && !this.IsAdmin) { - if (String.IsNullOrEmpty(txtAnswer.Text)) + if (String.IsNullOrEmpty(this.txtAnswer.Text)) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); return; } - answer = txtAnswer.Text; + answer = this.txtAnswer.Text; } try { //create resettoken - UserController.ResetPasswordToken(User, Entities.Host.Host.AdminMembershipResetLinkValidity); + UserController.ResetPasswordToken(this.User, Entities.Host.Host.AdminMembershipResetLinkValidity); - bool canSend = Mail.SendMail(User, MessageType.PasswordReminder, PortalSettings) == string.Empty; + bool canSend = Mail.SendMail(this.User, MessageType.PasswordReminder, this.PortalSettings) == string.Empty; var message = String.Empty; var moduleMessageType = ModuleMessage.ModuleMessageType.GreenSuccess; if (canSend) { - message = Localization.GetString("PasswordSent", LocalResourceFile); - LogSuccess(); + message = Localization.GetString("PasswordSent", this.LocalResourceFile); + this.LogSuccess(); } else { - message = Localization.GetString("OptionUnavailable", LocalResourceFile); + message = Localization.GetString("OptionUnavailable", this.LocalResourceFile); moduleMessageType=ModuleMessage.ModuleMessageType.RedError; - LogFailure(message); + this.LogFailure(message); } @@ -364,12 +364,12 @@ private void cmdReset_Click(object sender, EventArgs e) catch (ArgumentException exc) { Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); } catch (Exception exc) { Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } } @@ -378,20 +378,20 @@ private void cmdUserReset_Click(object sender, EventArgs e) try { //send fresh resettoken copy - bool canSend = UserController.ResetPasswordToken(User,true); + bool canSend = UserController.ResetPasswordToken(this.User,true); var message = String.Empty; var moduleMessageType = ModuleMessage.ModuleMessageType.GreenSuccess; if (canSend) { - message = Localization.GetString("PasswordSent", LocalResourceFile); - LogSuccess(); + message = Localization.GetString("PasswordSent", this.LocalResourceFile); + this.LogSuccess(); } else { - message = Localization.GetString("OptionUnavailable", LocalResourceFile); + message = Localization.GetString("OptionUnavailable", this.LocalResourceFile); moduleMessageType = ModuleMessage.ModuleMessageType.RedError; - LogFailure(message); + this.LogFailure(message); } @@ -400,23 +400,23 @@ private void cmdUserReset_Click(object sender, EventArgs e) catch (ArgumentException exc) { Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); } catch (Exception exc) { Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } } private void LogSuccess() { - LogResult(string.Empty); + this.LogResult(string.Empty); } private void LogFailure(string reason) { - LogResult(reason); + this.LogResult(reason); } private void LogResult(string message) @@ -425,10 +425,10 @@ private void LogResult(string message) var log = new LogInfo { - LogPortalID = PortalSettings.PortalId, - LogPortalName = PortalSettings.PortalName, - LogUserID = UserId, - LogUserName = portalSecurity.InputFilter(User.Username, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup) + LogPortalID = this.PortalSettings.PortalId, + LogPortalName = this.PortalSettings.PortalName, + LogUserID = this.UserId, + LogUserName = portalSecurity.InputFilter(this.User.Username, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup) }; if (string.IsNullOrEmpty(message)) @@ -446,71 +446,71 @@ private void LogResult(string message) private void cmdUpdate_Click(Object sender, EventArgs e) { - if ((UseCaptcha && ctlCaptcha.IsValid) || !UseCaptcha) + if ((this.UseCaptcha && this.ctlCaptcha.IsValid) || !this.UseCaptcha) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } //1. Check New Password and Confirm are the same - if (txtNewPassword.Text != txtNewConfirm.Text) + if (this.txtNewPassword.Text != this.txtNewConfirm.Text) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordMismatch)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordMismatch)); return; } //2. Check New Password is Valid - if (!UserController.ValidatePassword(txtNewPassword.Text)) + if (!UserController.ValidatePassword(this.txtNewPassword.Text)) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordInvalid)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordInvalid)); return; } //3. Check old Password is Provided - if (!IsAdmin && String.IsNullOrEmpty(txtOldPassword.Text)) + if (!this.IsAdmin && String.IsNullOrEmpty(this.txtOldPassword.Text)) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordMissing)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordMissing)); return; } //4. Check New Password is ddifferent - if (!IsAdmin && txtNewPassword.Text == txtOldPassword.Text) + if (!this.IsAdmin && this.txtNewPassword.Text == this.txtOldPassword.Text) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordNotDifferent)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordNotDifferent)); return; } //5. Check New Password is not same as username or banned var membershipPasswordController = new MembershipPasswordController(); - var settings = new MembershipPasswordSettings(User.PortalID); + var settings = new MembershipPasswordSettings(this.User.PortalID); if (settings.EnableBannedList) { - if (membershipPasswordController.FoundBannedPassword(txtNewPassword.Text) || User.Username == txtNewPassword.Text) + if (membershipPasswordController.FoundBannedPassword(this.txtNewPassword.Text) || this.User.Username == this.txtNewPassword.Text) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.BannedPasswordUsed)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.BannedPasswordUsed)); return; } } //check new password is not in history - if (membershipPasswordController.IsPasswordInHistory(User.UserID, User.PortalID, txtNewPassword.Text, false)) + if (membershipPasswordController.IsPasswordInHistory(this.User.UserID, this.User.PortalID, this.txtNewPassword.Text, false)) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); return; } - if (!IsAdmin && txtNewPassword.Text == txtOldPassword.Text) + if (!this.IsAdmin && this.txtNewPassword.Text == this.txtOldPassword.Text) { - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordNotDifferent)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordNotDifferent)); return; } - if (!IsAdmin) + if (!this.IsAdmin) { try { - OnPasswordUpdated(UserController.ChangePassword(User, txtOldPassword.Text, txtNewPassword.Text) + this.OnPasswordUpdated(UserController.ChangePassword(this.User, this.txtOldPassword.Text, this.txtNewPassword.Text) ? new PasswordUpdatedEventArgs(PasswordUpdateStatus.Success) : new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } @@ -519,7 +519,7 @@ private void cmdUpdate_Click(Object sender, EventArgs e) //Password Answer missing Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); } catch (ThreadAbortException) { @@ -530,14 +530,14 @@ private void cmdUpdate_Click(Object sender, EventArgs e) //Fail Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } } else { try { - OnPasswordUpdated(UserController.ResetAndChangePassword(User, txtNewPassword.Text) + this.OnPasswordUpdated(UserController.ResetAndChangePassword(this.User, this.txtNewPassword.Text) ? new PasswordUpdatedEventArgs(PasswordUpdateStatus.Success) : new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } @@ -546,7 +546,7 @@ private void cmdUpdate_Click(Object sender, EventArgs e) //Password Answer missing Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); } catch (ThreadAbortException) { @@ -557,7 +557,7 @@ private void cmdUpdate_Click(Object sender, EventArgs e) //Fail Logger.Error(exc); - OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); + this.OnPasswordUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } } } @@ -571,29 +571,29 @@ private void cmdUpdate_Click(Object sender, EventArgs e) /// private void cmdUpdateQA_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (String.IsNullOrEmpty(txtQAPassword.Text)) + if (String.IsNullOrEmpty(this.txtQAPassword.Text)) { - OnPasswordQuestionAnswerUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordInvalid)); + this.OnPasswordQuestionAnswerUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordInvalid)); return; } - if (String.IsNullOrEmpty(txtEditQuestion.Text)) + if (String.IsNullOrEmpty(this.txtEditQuestion.Text)) { - OnPasswordQuestionAnswerUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordQuestion)); + this.OnPasswordQuestionAnswerUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordQuestion)); return; } - if (String.IsNullOrEmpty(txtEditAnswer.Text)) + if (String.IsNullOrEmpty(this.txtEditAnswer.Text)) { - OnPasswordQuestionAnswerUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); + this.OnPasswordQuestionAnswerUpdated(new PasswordUpdatedEventArgs(PasswordUpdateStatus.InvalidPasswordAnswer)); return; } //Try and set password Q and A - UserInfo objUser = UserController.GetUserById(PortalId, UserId); - OnPasswordQuestionAnswerUpdated(UserController.ChangePasswordQuestionAndAnswer(objUser, txtQAPassword.Text, txtEditQuestion.Text, txtEditAnswer.Text) + UserInfo objUser = UserController.GetUserById(this.PortalId, this.UserId); + this.OnPasswordQuestionAnswerUpdated(UserController.ChangePasswordQuestionAndAnswer(objUser, this.txtQAPassword.Text, this.txtEditQuestion.Text, this.txtEditAnswer.Text) ? new PasswordUpdatedEventArgs(PasswordUpdateStatus.Success) : new PasswordUpdatedEventArgs(PasswordUpdateStatus.PasswordResetFailed)); } @@ -616,7 +616,7 @@ public class PasswordUpdatedEventArgs /// The Password Update Status public PasswordUpdatedEventArgs(PasswordUpdateStatus status) { - UpdateStatus = status; + this.UpdateStatus = status; } /// ----------------------------------------------------------------------------- diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/Profile.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/Profile.ascx.cs index 22b25ffeb7f..26ec07f3c24 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/Profile.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/Profile.ascx.cs @@ -41,8 +41,8 @@ protected bool ShowVisibility { get { - object setting = GetSetting(PortalId, "Profile_DisplayVisibility"); - return Convert.ToBoolean(setting) && IsUser; + object setting = GetSetting(this.PortalId, "Profile_DisplayVisibility"); + return Convert.ToBoolean(setting) && this.IsUser; } } @@ -59,11 +59,11 @@ public PropertyEditorMode EditorMode { get { - return ProfileProperties.EditMode; + return this.ProfileProperties.EditMode; } set { - ProfileProperties.EditMode = value; + this.ProfileProperties.EditMode = value; } } @@ -76,7 +76,7 @@ public bool IsValid { get { - return ProfileProperties.IsValid || IsAdmin; + return this.ProfileProperties.IsValid || this.IsAdmin; } } @@ -89,11 +89,11 @@ public bool ShowUpdate { get { - return actionsRow.Visible; + return this.actionsRow.Visible; } set { - actionsRow.Visible = value; + this.actionsRow.Visible = value; } } @@ -107,9 +107,9 @@ public UserProfile UserProfile get { UserProfile _Profile = null; - if (User != null) + if (this.User != null) { - _Profile = User.Profile; + _Profile = this.User.Profile; } return _Profile; } @@ -130,23 +130,23 @@ public override void DataBind() //Before we bind the Profile to the editor we need to "update" the visible data var properties = new ProfilePropertyDefinitionCollection(); var imageType = new ListController().GetListEntryInfo("DataType", "Image"); - foreach (ProfilePropertyDefinition profProperty in UserProfile.ProfileProperties) + foreach (ProfilePropertyDefinition profProperty in this.UserProfile.ProfileProperties) { - if (IsAdmin && !IsProfile) + if (this.IsAdmin && !this.IsProfile) { profProperty.Visible = true; } - if (!profProperty.Deleted && (Request.IsAuthenticated || profProperty.DataType != imageType.EntryID)) + if (!profProperty.Deleted && (this.Request.IsAuthenticated || profProperty.DataType != imageType.EntryID)) { properties.Add(profProperty); } } - ProfileProperties.User = User; - ProfileProperties.ShowVisibility = ShowVisibility; - ProfileProperties.DataSource = properties; - ProfileProperties.DataBind(); + this.ProfileProperties.User = this.User; + this.ProfileProperties.ShowVisibility = this.ShowVisibility; + this.ProfileProperties.DataSource = properties; + this.ProfileProperties.DataBind(); } #endregion @@ -163,16 +163,16 @@ public override void DataBind() protected override void OnInit(EventArgs e) { base.OnInit(e); - ID = "Profile.ascx"; + this.ID = "Profile.ascx"; //Get the base Page - var basePage = Page as PageBase; + var basePage = this.Page as PageBase; if (basePage != null) { //Check if culture is RTL - ProfileProperties.LabelMode = basePage.PageCulture.TextInfo.IsRightToLeft ? LabelMode.Right : LabelMode.Left; + this.ProfileProperties.LabelMode = basePage.PageCulture.TextInfo.IsRightToLeft ? LabelMode.Right : LabelMode.Left; } - ProfileProperties.LocalResourceFile = LocalResourceFile; + this.ProfileProperties.LocalResourceFile = this.LocalResourceFile; } /// ----------------------------------------------------------------------------- @@ -185,7 +185,7 @@ protected override void OnInit(EventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdUpdate.Click += cmdUpdate_Click; + this.cmdUpdate.Click += this.cmdUpdate_Click; } /// ----------------------------------------------------------------------------- @@ -197,47 +197,47 @@ protected override void OnLoad(EventArgs e) /// ----------------------------------------------------------------------------- private void cmdUpdate_Click(object sender, EventArgs e) { - if (IsUserOrAdmin == false && UserId == Null.NullInteger) + if (this.IsUserOrAdmin == false && this.UserId == Null.NullInteger) { return; } - if (IsValid) + if (this.IsValid) { - if (User.UserID == PortalSettings.AdministratorId) + if (this.User.UserID == this.PortalSettings.AdministratorId) { //Clear the Portal Cache - DataCache.ClearPortalCache(UserPortalID, true); + DataCache.ClearPortalCache(this.UserPortalID, true); } //Update DisplayName to conform to Format - UpdateDisplayName(); + this.UpdateDisplayName(); - if (PortalSettings.Registration.RequireUniqueDisplayName) + if (this.PortalSettings.Registration.RequireUniqueDisplayName) { - var usersWithSameDisplayName = (List)MembershipProvider.Instance().GetUsersBasicSearch(PortalId, 0, 2, "DisplayName", true, "DisplayName", User.DisplayName); - if (usersWithSameDisplayName.Any(user => user.UserID != User.UserID)) + var usersWithSameDisplayName = (List)MembershipProvider.Instance().GetUsersBasicSearch(this.PortalId, 0, 2, "DisplayName", true, "DisplayName", this.User.DisplayName); + if (usersWithSameDisplayName.Any(user => user.UserID != this.User.UserID)) { - AddModuleMessage("DisplayNameNotUnique", ModuleMessage.ModuleMessageType.RedError, true); + this.AddModuleMessage("DisplayNameNotUnique", ModuleMessage.ModuleMessageType.RedError, true); return; } } - var properties = (ProfilePropertyDefinitionCollection)ProfileProperties.DataSource; + var properties = (ProfilePropertyDefinitionCollection)this.ProfileProperties.DataSource; //Update User's profile - User = ProfileController.UpdateUserProfile(User, properties); + this.User = ProfileController.UpdateUserProfile(this.User, properties); - OnProfileUpdated(EventArgs.Empty); - OnProfileUpdateCompleted(EventArgs.Empty); + this.OnProfileUpdated(EventArgs.Empty); + this.OnProfileUpdateCompleted(EventArgs.Empty); } } private void UpdateDisplayName() { - if (!string.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - User.UpdateDisplayName(PortalSettings.Registration.DisplayNameFormat); + this.User.UpdateDisplayName(this.PortalSettings.Registration.DisplayNameFormat); } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs index 5b9e22704a9..ff073e4d8ef 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/ProfileDefinitions.ascx.cs @@ -39,7 +39,7 @@ public partial class ProfileDefinitions : PortalModuleBase, IActionable private readonly INavigationManager _navigationManager; public ProfileDefinitions() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Constants @@ -69,7 +69,7 @@ protected bool IsSuperUser { get { - return Globals.IsHostTab(PortalSettings.ActiveTab.TabID); + return Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID); } } @@ -82,7 +82,7 @@ protected ProfilePropertyDefinitionCollection ProfileProperties { get { - return _profileProperties ?? (_profileProperties = ProfileController.GetPropertyDefinitionsByPortal(UsersPortalId, false, false)); + return this._profileProperties ?? (this._profileProperties = ProfileController.GetPropertyDefinitionsByPortal(this.UsersPortalId, false, false)); } } @@ -96,24 +96,24 @@ public string ReturnUrl get { string returnURL; - var filterParams = new string[String.IsNullOrEmpty(Request.QueryString["filterproperty"]) ? 1 : 2]; + var filterParams = new string[String.IsNullOrEmpty(this.Request.QueryString["filterproperty"]) ? 1 : 2]; - if (String.IsNullOrEmpty(Request.QueryString["filterProperty"])) + if (String.IsNullOrEmpty(this.Request.QueryString["filterProperty"])) { - filterParams.SetValue("filter=" + Request.QueryString["filter"], 0); + filterParams.SetValue("filter=" + this.Request.QueryString["filter"], 0); } else { - filterParams.SetValue("filter=" + Request.QueryString["filter"], 0); - filterParams.SetValue("filterProperty=" + Request.QueryString["filterProperty"], 1); + filterParams.SetValue("filter=" + this.Request.QueryString["filter"], 0); + filterParams.SetValue("filterProperty=" + this.Request.QueryString["filterProperty"], 1); } - if (string.IsNullOrEmpty(Request.QueryString["filter"])) + if (string.IsNullOrEmpty(this.Request.QueryString["filter"])) { - returnURL = _navigationManager.NavigateURL(TabId); + returnURL = this._navigationManager.NavigateURL(this.TabId); } else { - returnURL = _navigationManager.NavigateURL(TabId, "", filterParams); + returnURL = this._navigationManager.NavigateURL(this.TabId, "", filterParams); } return returnURL; } @@ -128,8 +128,8 @@ protected int UsersPortalId { get { - int intPortalId = PortalId; - if (IsSuperUser) + int intPortalId = this.PortalId; + if (this.IsSuperUser) { intPortalId = Null.NullInteger; } @@ -146,22 +146,22 @@ public ModuleActionCollection ModuleActions get { var actions = new ModuleActionCollection(); - actions.Add(GetNextActionID(), - Localization.GetString(ModuleActionType.AddContent, LocalResourceFile), + actions.Add(this.GetNextActionID(), + Localization.GetString(ModuleActionType.AddContent, this.LocalResourceFile), ModuleActionType.AddContent, "", "add.gif", - EditUrl("EditProfileProperty"), + this.EditUrl("EditProfileProperty"), false, SecurityAccessLevel.Admin, true, false); - actions.Add(GetNextActionID(), - Localization.GetString("Cancel.Action", LocalResourceFile), + actions.Add(this.GetNextActionID(), + Localization.GetString("Cancel.Action", this.LocalResourceFile), ModuleActionType.AddContent, "", "lt.gif", - ReturnUrl, + this.ReturnUrl, false, SecurityAccessLevel.Admin, true, @@ -192,9 +192,9 @@ private bool SupportsRichClient() /// ----------------------------------------------------------------------------- private void DeleteProperty(int index) { - ProfileController.DeletePropertyDefinition(ProfileProperties[index]); + ProfileController.DeletePropertyDefinition(this.ProfileProperties[index]); - RefreshGrid(); + this.RefreshGrid(); } /// ----------------------------------------------------------------------------- @@ -206,8 +206,8 @@ private void DeleteProperty(int index) /// ----------------------------------------------------------------------------- private void MoveProperty(int index, int destIndex) { - ProfilePropertyDefinition profileProperty = ProfileProperties[index]; - ProfilePropertyDefinition nextProfileProperty = ProfileProperties[destIndex]; + ProfilePropertyDefinition profileProperty = this.ProfileProperties[index]; + ProfilePropertyDefinition nextProfileProperty = this.ProfileProperties[destIndex]; int currentOrder = profileProperty.ViewOrder; int nextOrder = nextProfileProperty.ViewOrder; @@ -217,8 +217,8 @@ private void MoveProperty(int index, int destIndex) nextProfileProperty.ViewOrder = currentOrder; //Refresh Grid - ProfileProperties.Sort(); - BindGrid(); + this.ProfileProperties.Sort(); + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -229,7 +229,7 @@ private void MoveProperty(int index, int destIndex) /// ----------------------------------------------------------------------------- private void MovePropertyDown(int index) { - MoveProperty(index, index + 1); + this.MoveProperty(index, index + 1); } /// ----------------------------------------------------------------------------- @@ -240,7 +240,7 @@ private void MovePropertyDown(int index) /// ----------------------------------------------------------------------------- private void MovePropertyUp(int index) { - MoveProperty(index, index - 1); + this.MoveProperty(index, index - 1); } /// ----------------------------------------------------------------------------- @@ -254,7 +254,7 @@ private void BindGrid() bool allVisible = true; //Check whether the checkbox column headers are true or false - foreach (ProfilePropertyDefinition profProperty in ProfileProperties) + foreach (ProfilePropertyDefinition profProperty in this.ProfileProperties) { if (profProperty.Required == false) { @@ -269,7 +269,7 @@ private void BindGrid() break; } } - foreach (DataGridColumn column in grdProfileProperties.Columns) + foreach (DataGridColumn column in this.grdProfileProperties.Columns) { if (ReferenceEquals(column.GetType(), typeof(CheckBoxColumn))) { @@ -285,8 +285,8 @@ private void BindGrid() } } } - grdProfileProperties.DataSource = ProfileProperties; - grdProfileProperties.DataBind(); + this.grdProfileProperties.DataSource = this.ProfileProperties; + this.grdProfileProperties.DataBind(); } /// ----------------------------------------------------------------------------- @@ -296,8 +296,8 @@ private void BindGrid() /// ----------------------------------------------------------------------------- private void RefreshGrid() { - _profileProperties = null; - BindGrid(); + this._profileProperties = null; + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -307,12 +307,12 @@ private void RefreshGrid() /// ----------------------------------------------------------------------------- private void UpdateProperties() { - ProcessPostBack(); - foreach (ProfilePropertyDefinition property in ProfileProperties) + this.ProcessPostBack(); + foreach (ProfilePropertyDefinition property in this.ProfileProperties) { if (property.IsDirty) { - if (UsersPortalId == Null.NullInteger) + if (this.UsersPortalId == Null.NullInteger) { property.Required = false; } @@ -330,11 +330,11 @@ private void UpdateProperties() private void ProcessPostBack() { - string[] newOrder = ClientAPI.GetClientSideReorder(grdProfileProperties.ClientID, Page); - for (int i = 0; i <= grdProfileProperties.Items.Count - 1; i++) + string[] newOrder = ClientAPI.GetClientSideReorder(this.grdProfileProperties.ClientID, this.Page); + for (int i = 0; i <= this.grdProfileProperties.Items.Count - 1; i++) { - DataGridItem dataGridItem = grdProfileProperties.Items[i]; - ProfilePropertyDefinition profileProperty = ProfileProperties[i]; + DataGridItem dataGridItem = this.grdProfileProperties.Items[i]; + ProfilePropertyDefinition profileProperty = this.ProfileProperties[i]; CheckBox checkBox = (CheckBox)dataGridItem.Cells[COLUMN_REQUIRED].Controls[0]; profileProperty.Required = checkBox.Checked; checkBox = (CheckBox)dataGridItem.Cells[COLUMN_VISIBLE].Controls[0]; @@ -344,9 +344,9 @@ private void ProcessPostBack() //assign vieworder for (int i = 0; i <= newOrder.Length - 1; i++) { - ProfileProperties[Convert.ToInt32(newOrder[i])].ViewOrder = i; + this.ProfileProperties[Convert.ToInt32(newOrder[i])].ViewOrder = i; } - ProfileProperties.Sort(); + this.ProfileProperties.Sort(); } #endregion @@ -369,7 +369,7 @@ protected override void LoadViewState(object savedState) //Load ModuleID if (myState[1] != null) { - _profileProperties = (ProfilePropertyDefinitionCollection)myState[1]; + this._profileProperties = (ProfilePropertyDefinitionCollection)myState[1]; } } } @@ -380,7 +380,7 @@ protected override object SaveViewState() //Save the Base Controls ViewState allStates[0] = base.SaveViewState(); - allStates[1] = ProfileProperties; + allStates[1] = this.ProfileProperties; return allStates; } @@ -406,7 +406,7 @@ public string DisplayDefaultVisibility(ProfilePropertyDefinition definition) string retValue = Null.NullString; if (!String.IsNullOrEmpty(definition.DefaultVisibility.ToString())) { - retValue = LocalizeString(definition.DefaultVisibility.ToString()) ?? definition.DefaultVisibility.ToString(); + retValue = this.LocalizeString(definition.DefaultVisibility.ToString()) ?? definition.DefaultVisibility.ToString(); } return retValue; } @@ -415,10 +415,10 @@ public void Update() { try { - UpdateProperties(); + this.UpdateProperties(); //Redirect to upadte page - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } catch (Exception exc) //Module failed to load { @@ -441,19 +441,19 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - foreach (DataGridColumn column in grdProfileProperties.Columns) + foreach (DataGridColumn column in this.grdProfileProperties.Columns) { if (ReferenceEquals(column.GetType(), typeof(CheckBoxColumn))) { var checkBoxColumn = (CheckBoxColumn)column; - if (checkBoxColumn.DataField == "Required" && UsersPortalId == Null.NullInteger) + if (checkBoxColumn.DataField == "Required" && this.UsersPortalId == Null.NullInteger) { checkBoxColumn.Visible = false; - _requiredColumnHidden = true; + this._requiredColumnHidden = true; } - if (SupportsRichClient() == false) + if (this.SupportsRichClient() == false) { - checkBoxColumn.CheckedChanged += grdProfileProperties_ItemCheckedChanged; + checkBoxColumn.CheckedChanged += this.grdProfileProperties_ItemCheckedChanged; } } else if (ReferenceEquals(column.GetType(), typeof(ImageCommandColumn))) @@ -464,22 +464,22 @@ protected override void OnInit(EventArgs e) { case "Delete": imageColumn.OnClickJS = Localization.GetString("DeleteItem"); - imageColumn.Text = Localization.GetString("Delete", LocalResourceFile); + imageColumn.Text = Localization.GetString("Delete", this.LocalResourceFile); break; case "Edit": //The Friendly URL parser does not like non-alphanumeric characters //so first create the format string with a dummy value and then //replace the dummy value with the FormatString place holder - string formatString = EditUrl("PropertyDefinitionID", "KEYFIELD", "EditProfileProperty"); + string formatString = this.EditUrl("PropertyDefinitionID", "KEYFIELD", "EditProfileProperty"); formatString = formatString.Replace("KEYFIELD", "{0}"); imageColumn.NavigateURLFormatString = formatString; - imageColumn.Text = Localization.GetString("Edit", LocalResourceFile); + imageColumn.Text = Localization.GetString("Edit", this.LocalResourceFile); break; case "MoveUp": - imageColumn.Text = Localization.GetString("MoveUp", LocalResourceFile); + imageColumn.Text = Localization.GetString("MoveUp", this.LocalResourceFile); break; case "MoveDown": - imageColumn.Text = Localization.GetString("MoveDown", LocalResourceFile); + imageColumn.Text = Localization.GetString("MoveDown", this.LocalResourceFile); break; } } @@ -490,19 +490,19 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdRefresh.Click += cmdRefresh_Click; - grdProfileProperties.ItemCommand += grdProfileProperties_ItemCommand; - grdProfileProperties.ItemCreated += grdProfileProperties_ItemCreated; - grdProfileProperties.ItemDataBound += grdProfileProperties_ItemDataBound; + this.cmdRefresh.Click += this.cmdRefresh_Click; + this.grdProfileProperties.ItemCommand += this.grdProfileProperties_ItemCommand; + this.grdProfileProperties.ItemCreated += this.grdProfileProperties_ItemCreated; + this.grdProfileProperties.ItemDataBound += this.grdProfileProperties_ItemDataBound; - cmdAdd.NavigateUrl = EditUrl("EditProfileProperty"); + this.cmdAdd.NavigateUrl = this.EditUrl("EditProfileProperty"); try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - Localization.LocalizeDataGrid(ref grdProfileProperties, LocalResourceFile); - BindGrid(); + Localization.LocalizeDataGrid(ref this.grdProfileProperties, this.LocalResourceFile); + this.BindGrid(); } } catch (Exception exc) //Module failed to load @@ -520,7 +520,7 @@ protected override void OnLoad(EventArgs e) /// ----------------------------------------------------------------------------- private void cmdRefresh_Click(object sender, EventArgs e) { - RefreshGrid(); + this.RefreshGrid(); } /// ----------------------------------------------------------------------------- @@ -539,7 +539,7 @@ private void grdProfileProperties_ItemCheckedChanged(object sender, DNNDataGridC if (e.IsAll) { //Update All the properties - foreach (ProfilePropertyDefinition profProperty in ProfileProperties) + foreach (ProfilePropertyDefinition profProperty in this.ProfileProperties) { switch (propertyName) { @@ -555,7 +555,7 @@ private void grdProfileProperties_ItemCheckedChanged(object sender, DNNDataGridC else { //Update the indexed property - ProfilePropertyDefinition profileProperty = ProfileProperties[e.Item.ItemIndex]; + ProfilePropertyDefinition profileProperty = this.ProfileProperties[e.Item.ItemIndex]; switch (propertyName) { case "Required": @@ -566,7 +566,7 @@ private void grdProfileProperties_ItemCheckedChanged(object sender, DNNDataGridC break; } } - BindGrid(); + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -584,13 +584,13 @@ private void grdProfileProperties_ItemCommand(object source, DataGridCommandEven switch (e.CommandName) { case "Delete": - DeleteProperty(index); + this.DeleteProperty(index); break; case "MoveUp": - MovePropertyUp(index); + this.MovePropertyUp(index); break; case "MoveDown": - MovePropertyDown(index); + this.MovePropertyDown(index); break; } } @@ -606,7 +606,7 @@ private void grdProfileProperties_ItemCommand(object source, DataGridCommandEven /// ----------------------------------------------------------------------------- private void grdProfileProperties_ItemCreated(object sender, DataGridItemEventArgs e) { - if (SupportsRichClient()) + if (this.SupportsRichClient()) { switch (e.Item.ItemType) { @@ -615,7 +615,7 @@ private void grdProfileProperties_ItemCreated(object sender, DataGridItemEventAr ((WebControl)e.Item.Cells[COLUMN_REQUIRED].Controls[1]).Attributes.Add("onclick", "dnn.util.checkallChecked(this," + COLUMN_REQUIRED + ");"); ((CheckBox)e.Item.Cells[COLUMN_REQUIRED].Controls[1]).AutoPostBack = false; - int column_visible = _requiredColumnHidden ? COLUMN_VISIBLE - 1 : COLUMN_VISIBLE; + int column_visible = this._requiredColumnHidden ? COLUMN_VISIBLE - 1 : COLUMN_VISIBLE; ((WebControl)e.Item.Cells[COLUMN_VISIBLE].Controls[1]).Attributes.Add("onclick", "dnn.util.checkallChecked(this," + column_visible + ");"); ((CheckBox)e.Item.Cells[COLUMN_VISIBLE].Controls[1]).AutoPostBack = false; break; @@ -623,8 +623,8 @@ private void grdProfileProperties_ItemCreated(object sender, DataGridItemEventAr case ListItemType.Item: ((CheckBox)e.Item.Cells[COLUMN_REQUIRED].Controls[0]).AutoPostBack = false; ((CheckBox)e.Item.Cells[COLUMN_VISIBLE].Controls[0]).AutoPostBack = false; - ClientAPI.EnableClientSideReorder(e.Item.Cells[COLUMN_MOVE_DOWN].Controls[0], Page, false, grdProfileProperties.ClientID); - ClientAPI.EnableClientSideReorder(e.Item.Cells[COLUMN_MOVE_UP].Controls[0], Page, true, grdProfileProperties.ClientID); + ClientAPI.EnableClientSideReorder(e.Item.Cells[COLUMN_MOVE_DOWN].Controls[0], this.Page, false, this.grdProfileProperties.ClientID); + ClientAPI.EnableClientSideReorder(e.Item.Cells[COLUMN_MOVE_UP].Controls[0], this.Page, true, this.grdProfileProperties.ClientID); break; } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/Register.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/Register.ascx.cs index e44d3d947eb..b52a783ff73 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/Register.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/Register.ascx.cs @@ -52,7 +52,7 @@ public partial class Register : UserUserControlBase public Register() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -61,11 +61,11 @@ protected string AuthenticationType { get { - return ViewState.GetValue("AuthenticationType", Null.NullString); + return this.ViewState.GetValue("AuthenticationType", Null.NullString); } set { - ViewState.SetValue("AuthenticationType", value, Null.NullString); + this.ViewState.SetValue("AuthenticationType", value, Null.NullString); } } @@ -76,9 +76,9 @@ protected string ExcludeTerms get { string regex = String.Empty; - if (!String.IsNullOrEmpty(PortalSettings.Registration.ExcludeTerms)) + if (!String.IsNullOrEmpty(this.PortalSettings.Registration.ExcludeTerms)) { - regex = @"^(?:(?!" + PortalSettings.Registration.ExcludeTerms.Replace(" ", "").Replace(",", "|") + @").)*$\r?\n?"; + regex = @"^(?:(?!" + this.PortalSettings.Registration.ExcludeTerms.Replace(" ", "").Replace(",", "|") + @").)*$\r?\n?"; } return regex; } @@ -88,7 +88,7 @@ protected bool IsValid { get { - return Validate(); + return this.Validate(); } } @@ -96,11 +96,11 @@ protected string UserToken { get { - return ViewState.GetValue("UserToken", string.Empty); + return this.ViewState.GetValue("UserToken", string.Empty); } set { - ViewState.SetValue("UserToken", value, string.Empty); + this.ViewState.SetValue("UserToken", value, string.Empty); } } @@ -116,67 +116,67 @@ protected override void OnInit(EventArgs e) JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); - if (PortalSettings.Registration.RegistrationFormType == 0) + if (this.PortalSettings.Registration.RegistrationFormType == 0) { //DisplayName - if (String.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (String.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - AddField("DisplayName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); + this.AddField("DisplayName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); } else { - AddField("FirstName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); - AddField("LastName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); + this.AddField("FirstName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); + this.AddField("LastName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); } //Email - AddField("Email", String.Empty, true, PortalSettings.Registration.EmailValidator, TextBoxMode.SingleLine); + this.AddField("Email", String.Empty, true, this.PortalSettings.Registration.EmailValidator, TextBoxMode.SingleLine); //UserName - if (!PortalSettings.Registration.UseEmailAsUserName) + if (!this.PortalSettings.Registration.UseEmailAsUserName) { - AddField("Username", String.Empty, true, - String.IsNullOrEmpty(PortalSettings.Registration.UserNameValidator) ? ExcludeTerms : PortalSettings.Registration.UserNameValidator, + this.AddField("Username", String.Empty, true, + String.IsNullOrEmpty(this.PortalSettings.Registration.UserNameValidator) ? this.ExcludeTerms : this.PortalSettings.Registration.UserNameValidator, TextBoxMode.SingleLine); } //Password - if (!PortalSettings.Registration.RandomPassword) + if (!this.PortalSettings.Registration.RandomPassword) { - AddPasswordStrengthField("Password", "Membership", true); + this.AddPasswordStrengthField("Password", "Membership", true); - if (PortalSettings.Registration.RequirePasswordConfirm) + if (this.PortalSettings.Registration.RequirePasswordConfirm) { - AddPasswordConfirmField("PasswordConfirm", "Membership", true); + this.AddPasswordConfirmField("PasswordConfirm", "Membership", true); } } //Password Q&A if (MembershipProviderConfig.RequiresQuestionAndAnswer) { - AddField("PasswordQuestion", "Membership", true, String.Empty, TextBoxMode.SingleLine); - AddField("PasswordAnswer", "Membership", true, String.Empty, TextBoxMode.SingleLine); + this.AddField("PasswordQuestion", "Membership", true, String.Empty, TextBoxMode.SingleLine); + this.AddField("PasswordAnswer", "Membership", true, String.Empty, TextBoxMode.SingleLine); } - if (PortalSettings.Registration.RequireValidProfile) + if (this.PortalSettings.Registration.RequireValidProfile) { - foreach (ProfilePropertyDefinition property in User.Profile.ProfileProperties) + foreach (ProfilePropertyDefinition property in this.User.Profile.ProfileProperties) { if (property.Required) { - AddProperty(property); + this.AddProperty(property); } } } } else { - var fields = PortalSettings.Registration.RegistrationFields.Split(',').ToList(); + var fields = this.PortalSettings.Registration.RegistrationFields.Split(',').ToList(); //append question/answer field when RequiresQuestionAndAnswer is enabled in config. if (MembershipProviderConfig.RequiresQuestionAndAnswer) { @@ -196,31 +196,31 @@ protected override void OnInit(EventArgs e) switch (trimmedField) { case "Username": - AddField("Username", String.Empty, true, String.IsNullOrEmpty(PortalSettings.Registration.UserNameValidator) - ? ExcludeTerms : PortalSettings.Registration.UserNameValidator, + this.AddField("Username", String.Empty, true, String.IsNullOrEmpty(this.PortalSettings.Registration.UserNameValidator) + ? this.ExcludeTerms : this.PortalSettings.Registration.UserNameValidator, TextBoxMode.SingleLine); break; case "DisplayName": - AddField(trimmedField, String.Empty, true, ExcludeTerms, TextBoxMode.SingleLine); + this.AddField(trimmedField, String.Empty, true, this.ExcludeTerms, TextBoxMode.SingleLine); break; case "Email": - AddField("Email", String.Empty, true, PortalSettings.Registration.EmailValidator, TextBoxMode.SingleLine); + this.AddField("Email", String.Empty, true, this.PortalSettings.Registration.EmailValidator, TextBoxMode.SingleLine); break; case "Password": - AddPasswordStrengthField(trimmedField, "Membership", true); + this.AddPasswordStrengthField(trimmedField, "Membership", true); break; case "PasswordConfirm": - AddPasswordConfirmField(trimmedField, "Membership", true); + this.AddPasswordConfirmField(trimmedField, "Membership", true); break; case "PasswordQuestion": case "PasswordAnswer": - AddField(trimmedField, "Membership", true, String.Empty, TextBoxMode.SingleLine); + this.AddField(trimmedField, "Membership", true, String.Empty, TextBoxMode.SingleLine); break; default: - ProfilePropertyDefinition property = User.Profile.GetProperty(trimmedField); + ProfilePropertyDefinition property = this.User.Profile.GetProperty(trimmedField); if (property != null) { - AddProperty(property); + this.AddProperty(property); } break; } @@ -228,11 +228,11 @@ protected override void OnInit(EventArgs e) } //Verify that the current user has access to this page - if (PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration && Request.IsAuthenticated == false) + if (this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration && this.Request.IsAuthenticated == false) { try { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } catch (ThreadAbortException) { @@ -240,27 +240,27 @@ protected override void OnInit(EventArgs e) } } - cancelLink.NavigateUrl = closeLink.NavigateUrl = GetRedirectUrl(false); - registerButton.Click += registerButton_Click; + this.cancelLink.NavigateUrl = this.closeLink.NavigateUrl = this.GetRedirectUrl(false); + this.registerButton.Click += this.registerButton_Click; - if (PortalSettings.Registration.UseAuthProviders) + if (this.PortalSettings.Registration.UseAuthProviders) { List authSystems = AuthenticationController.GetEnabledAuthenticationServices(); foreach (AuthenticationInfo authSystem in authSystems) { try { - var authLoginControl = (AuthenticationLoginBase)LoadControl("~/" + authSystem.LoginControlSrc); + var authLoginControl = (AuthenticationLoginBase)this.LoadControl("~/" + authSystem.LoginControlSrc); if (authSystem.AuthenticationType != "DNN") { - BindLoginControl(authLoginControl, authSystem); + this.BindLoginControl(authLoginControl, authSystem); //Check if AuthSystem is Enabled if (authLoginControl.Enabled && authLoginControl.SupportsRegistration) { authLoginControl.Mode = AuthMode.Register; //Add Login Control to List - _loginControls.Add(authLoginControl); + this._loginControls.Add(authLoginControl); } } } @@ -276,59 +276,59 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { //if a Login Page has not been specified for the portal if (Globals.IsAdminControl()) { //redirect to current page - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } else //make module container invisible if user is not a page admin { if (!TabPermissionController.CanAdminPage()) { - ContainerControl.Visible = false; + this.ContainerControl.Visible = false; } } } - if (PortalSettings.Registration.UseCaptcha) + if (this.PortalSettings.Registration.UseCaptcha) { - captchaRow.Visible = true; - ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", LocalResourceFile); - ctlCaptcha.Text = Localization.GetString("CaptchaText", LocalResourceFile); + this.captchaRow.Visible = true; + this.ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", this.LocalResourceFile); + this.ctlCaptcha.Text = Localization.GetString("CaptchaText", this.LocalResourceFile); } - if (PortalSettings.Registration.UseAuthProviders && String.IsNullOrEmpty(AuthenticationType)) + if (this.PortalSettings.Registration.UseAuthProviders && String.IsNullOrEmpty(this.AuthenticationType)) { - foreach (AuthenticationLoginBase authLoginControl in _loginControls) + foreach (AuthenticationLoginBase authLoginControl in this._loginControls) { - socialLoginControls.Controls.Add(authLoginControl); + this.socialLoginControls.Controls.Add(authLoginControl); } } //Display relevant message - userHelpLabel.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_REGISTRATION_INSTRUCTIONS"); - switch (PortalSettings.UserRegistration) + this.userHelpLabel.Text = Localization.GetSystemMessage(this.PortalSettings, "MESSAGE_REGISTRATION_INSTRUCTIONS"); + switch (this.PortalSettings.UserRegistration) { case (int)Globals.PortalRegistrationType.PrivateRegistration: - userHelpLabel.Text += Localization.GetString("PrivateMembership", Localization.SharedResourceFile); + this.userHelpLabel.Text += Localization.GetString("PrivateMembership", Localization.SharedResourceFile); break; case (int)Globals.PortalRegistrationType.PublicRegistration: - userHelpLabel.Text += Localization.GetString("PublicMembership", Localization.SharedResourceFile); + this.userHelpLabel.Text += Localization.GetString("PublicMembership", Localization.SharedResourceFile); break; case (int)Globals.PortalRegistrationType.VerifiedRegistration: - userHelpLabel.Text += Localization.GetString("VerifiedMembership", Localization.SharedResourceFile); + this.userHelpLabel.Text += Localization.GetString("VerifiedMembership", Localization.SharedResourceFile); break; } - userHelpLabel.Text += Localization.GetString("Required", LocalResourceFile); - userHelpLabel.Text += Localization.GetString("RegisterWarning", LocalResourceFile); + this.userHelpLabel.Text += Localization.GetString("Required", this.LocalResourceFile); + this.userHelpLabel.Text += Localization.GetString("RegisterWarning", this.LocalResourceFile); - userForm.DataSource = User; - if (!Page.IsPostBack) + this.userForm.DataSource = this.User; + if (!this.Page.IsPostBack) { - userForm.DataBind(); + this.userForm.DataBind(); } } @@ -348,14 +348,14 @@ protected override void OnPreRender(EventArgs e) var optionsAsJsonString = Json.Serialize(confirmPasswordOptions); var script = string.Format("dnn.initializePasswordComparer({0});{1}", optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "ConfirmPassword", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ConfirmPassword", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "ConfirmPassword", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ConfirmPassword", script, true); } } @@ -366,7 +366,7 @@ protected override void OnPreRender(EventArgs e) private void AddField(string dataField, string dataMember, bool required, string regexValidator, TextBoxMode textMode) { - if (userForm.Items.Any(i => i.ID == dataField)) + if (this.userForm.Items.Any(i => i.ID == dataField)) { return; } @@ -384,7 +384,7 @@ private void AddField(string dataField, string dataMember, bool required, string { formItem.ValidationExpression = regexValidator; } - userForm.Items.Add(formItem); + this.userForm.Items.Add(formItem); } private void AddPasswordStrengthField(string dataField, string dataMember, bool required) @@ -414,7 +414,7 @@ private void AddPasswordStrengthField(string dataField, string dataMember, bool formItem.Visible = true; formItem.Required = required; - userForm.Items.Add(formItem); + this.userForm.Items.Add(formItem); } @@ -433,13 +433,13 @@ private void AddPasswordConfirmField(string dataField, string dataMember, bool r ClearContentInPasswordMode = true, MaxLength = 39 }; - userForm.Items.Add(formItem); + this.userForm.Items.Add(formItem); } private void AddProperty(ProfilePropertyDefinition property) { - if (userForm.Items.Any(i => i.ID == property.PropertyName)) + if (this.userForm.Items.Any(i => i.ID == property.PropertyName)) { return; } @@ -469,7 +469,7 @@ private void AddProperty(ProfilePropertyDefinition property) { formItem.ValidationExpression = property.ValidationExpression; } - userForm.Items.Add(formItem); + this.userForm.Items.Add(formItem); } } @@ -482,52 +482,52 @@ private void BindLoginControl(AuthenticationLoginBase authLoginControl, Authenti authLoginControl.ID = Path.GetFileNameWithoutExtension(authSystem.LoginControlSrc) + "_" + authSystem.AuthenticationType; authLoginControl.LocalResourceFile = authLoginControl.TemplateSourceDirectory + "/" + Localization.LocalResourceDirectory + "/" + Path.GetFileNameWithoutExtension(authSystem.LoginControlSrc); - authLoginControl.RedirectURL = GetRedirectUrl(); - authLoginControl.ModuleConfiguration = ModuleConfiguration; + authLoginControl.RedirectURL = this.GetRedirectUrl(); + authLoginControl.ModuleConfiguration = this.ModuleConfiguration; - authLoginControl.UserAuthenticated += UserAuthenticated; + authLoginControl.UserAuthenticated += this.UserAuthenticated; } private void CreateUser() { //Update DisplayName to conform to Format - UpdateDisplayName(); + this.UpdateDisplayName(); - User.Membership.Approved = PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.PublicRegistration; - var user = User; - CreateStatus = UserController.CreateUser(ref user); + this.User.Membership.Approved = this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.PublicRegistration; + var user = this.User; + this.CreateStatus = UserController.CreateUser(ref user); - DataCache.ClearPortalUserCountCache(PortalId); + DataCache.ClearPortalUserCountCache(this.PortalId); try { - if (CreateStatus == UserCreateStatus.Success) + if (this.CreateStatus == UserCreateStatus.Success) { //hide the succesful captcha - captchaRow.Visible = false; + this.captchaRow.Visible = false; //Assocate alternate Login with User and proceed with Login - if (!String.IsNullOrEmpty(AuthenticationType)) + if (!String.IsNullOrEmpty(this.AuthenticationType)) { - AuthenticationController.AddUserAuthentication(User.UserID, AuthenticationType, UserToken); + AuthenticationController.AddUserAuthentication(this.User.UserID, this.AuthenticationType, this.UserToken); } - string strMessage = CompleteUserCreation(CreateStatus, user, true, IsRegister); + string strMessage = this.CompleteUserCreation(this.CreateStatus, user, true, this.IsRegister); if ((string.IsNullOrEmpty(strMessage))) { - Response.Redirect(GetRedirectUrl(), true); + this.Response.Redirect(this.GetRedirectUrl(), true); } else { - RegistrationForm.Visible = false; - registerButton.Visible = false; - closeLink.Visible = true; + this.RegistrationForm.Visible = false; + this.registerButton.Visible = false; + this.closeLink.Visible = true; } } else { - AddLocalizedModuleMessage(UserController.GetUserCreateStatus(CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(UserController.GetUserCreateStatus(this.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); } } catch (Exception exc) //Module failed to load @@ -539,227 +539,227 @@ private void CreateUser() private void UpdateDisplayName() { //Update DisplayName to conform to Format - if (!string.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - User.UpdateDisplayName(PortalSettings.Registration.DisplayNameFormat); + this.User.UpdateDisplayName(this.PortalSettings.Registration.DisplayNameFormat); } } private bool Validate() { - if (!string.IsNullOrEmpty(gotcha.Value)) + if (!string.IsNullOrEmpty(this.gotcha.Value)) { return false; } - CreateStatus = UserCreateStatus.AddUser; + this.CreateStatus = UserCreateStatus.AddUser; var portalSecurity = PortalSecurity.Instance; //Check User Editor - bool _IsValid = userForm.IsValid; + bool _IsValid = this.userForm.IsValid; if (_IsValid) { var filterFlags = PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup; - var name = User.Username ?? User.Email; + var name = this.User.Username ?? this.User.Email; var cleanUsername = PortalSecurity.Instance.InputFilter(name, filterFlags); if (!cleanUsername.Equals(name)) { - CreateStatus = UserCreateStatus.InvalidUserName; + this.CreateStatus = UserCreateStatus.InvalidUserName; } var valid = UserController.Instance.IsValidUserName(name); if (!valid) { - CreateStatus = UserCreateStatus.InvalidUserName; + this.CreateStatus = UserCreateStatus.InvalidUserName; } - var cleanEmail = PortalSecurity.Instance.InputFilter(User.Email, filterFlags); - if (!cleanEmail.Equals(User.Email)) + var cleanEmail = PortalSecurity.Instance.InputFilter(this.User.Email, filterFlags); + if (!cleanEmail.Equals(this.User.Email)) { - CreateStatus = UserCreateStatus.InvalidEmail; + this.CreateStatus = UserCreateStatus.InvalidEmail; } - var cleanFirstName = PortalSecurity.Instance.InputFilter(User.FirstName, filterFlags); - if (!cleanFirstName.Equals(User.FirstName)) + var cleanFirstName = PortalSecurity.Instance.InputFilter(this.User.FirstName, filterFlags); + if (!cleanFirstName.Equals(this.User.FirstName)) { - CreateStatus = UserCreateStatus.InvalidFirstName; + this.CreateStatus = UserCreateStatus.InvalidFirstName; } - var cleanLastName = PortalSecurity.Instance.InputFilter(User.LastName, filterFlags); - if (!cleanLastName.Equals(User.LastName)) + var cleanLastName = PortalSecurity.Instance.InputFilter(this.User.LastName, filterFlags); + if (!cleanLastName.Equals(this.User.LastName)) { - CreateStatus = UserCreateStatus.InvalidLastName; + this.CreateStatus = UserCreateStatus.InvalidLastName; } - if (string.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (string.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - var cleanDisplayName = PortalSecurity.Instance.InputFilter(User.DisplayName, filterFlags); - if (!cleanDisplayName.Equals(User.DisplayName)) + var cleanDisplayName = PortalSecurity.Instance.InputFilter(this.User.DisplayName, filterFlags); + if (!cleanDisplayName.Equals(this.User.DisplayName)) { - CreateStatus = UserCreateStatus.InvalidDisplayName; + this.CreateStatus = UserCreateStatus.InvalidDisplayName; } } } - if (PortalSettings.Registration.RegistrationFormType == 0) + if (this.PortalSettings.Registration.RegistrationFormType == 0) { //Update UserName - if (PortalSettings.Registration.UseEmailAsUserName) + if (this.PortalSettings.Registration.UseEmailAsUserName) { - User.Username = User.Email; - if (String.IsNullOrEmpty(User.DisplayName)) + this.User.Username = this.User.Email; + if (String.IsNullOrEmpty(this.User.DisplayName)) { - User.DisplayName = User.Email.Substring(0, User.Email.IndexOf("@", StringComparison.Ordinal)); + this.User.DisplayName = this.User.Email.Substring(0, this.User.Email.IndexOf("@", StringComparison.Ordinal)); } } //Check Password is valid - if (!PortalSettings.Registration.RandomPassword) + if (!this.PortalSettings.Registration.RandomPassword) { //Check Password is Valid - if (CreateStatus == UserCreateStatus.AddUser && !UserController.ValidatePassword(User.Membership.Password)) + if (this.CreateStatus == UserCreateStatus.AddUser && !UserController.ValidatePassword(this.User.Membership.Password)) { - CreateStatus = UserCreateStatus.InvalidPassword; + this.CreateStatus = UserCreateStatus.InvalidPassword; } - if (PortalSettings.Registration.RequirePasswordConfirm && String.IsNullOrEmpty(AuthenticationType)) + if (this.PortalSettings.Registration.RequirePasswordConfirm && String.IsNullOrEmpty(this.AuthenticationType)) { - if (User.Membership.Password != User.Membership.PasswordConfirm) + if (this.User.Membership.Password != this.User.Membership.PasswordConfirm) { - CreateStatus = UserCreateStatus.PasswordMismatch; + this.CreateStatus = UserCreateStatus.PasswordMismatch; } } } else { //Generate a random password for the user - User.Membership.Password = UserController.GeneratePassword(); - User.Membership.PasswordConfirm = User.Membership.Password; + this.User.Membership.Password = UserController.GeneratePassword(); + this.User.Membership.PasswordConfirm = this.User.Membership.Password; } } else { //Set Username to Email - if (String.IsNullOrEmpty(User.Username)) + if (String.IsNullOrEmpty(this.User.Username)) { - User.Username = User.Email; + this.User.Username = this.User.Email; } //Set DisplayName - if (String.IsNullOrEmpty(User.DisplayName)) + if (String.IsNullOrEmpty(this.User.DisplayName)) { - User.DisplayName = String.IsNullOrEmpty(User.FirstName + " " + User.LastName) - ? User.Email.Substring(0, User.Email.IndexOf("@", StringComparison.Ordinal)) - : User.FirstName + " " + User.LastName; + this.User.DisplayName = String.IsNullOrEmpty(this.User.FirstName + " " + this.User.LastName) + ? this.User.Email.Substring(0, this.User.Email.IndexOf("@", StringComparison.Ordinal)) + : this.User.FirstName + " " + this.User.LastName; } //Random Password - if (String.IsNullOrEmpty(User.Membership.Password)) + if (String.IsNullOrEmpty(this.User.Membership.Password)) { //Generate a random password for the user - User.Membership.Password = UserController.GeneratePassword(); + this.User.Membership.Password = UserController.GeneratePassword(); } //Password Confirm - if (!String.IsNullOrEmpty(User.Membership.PasswordConfirm)) + if (!String.IsNullOrEmpty(this.User.Membership.PasswordConfirm)) { - if (User.Membership.Password != User.Membership.PasswordConfirm) + if (this.User.Membership.Password != this.User.Membership.PasswordConfirm) { - CreateStatus = UserCreateStatus.PasswordMismatch; + this.CreateStatus = UserCreateStatus.PasswordMismatch; } } } //Validate banned password - var settings = new MembershipPasswordSettings(User.PortalID); + var settings = new MembershipPasswordSettings(this.User.PortalID); if (settings.EnableBannedList) { var m = new MembershipPasswordController(); - if (m.FoundBannedPassword(User.Membership.Password) || User.Username == User.Membership.Password) + if (m.FoundBannedPassword(this.User.Membership.Password) || this.User.Username == this.User.Membership.Password) { - CreateStatus = UserCreateStatus.BannedPasswordUsed; + this.CreateStatus = UserCreateStatus.BannedPasswordUsed; } } //Validate Profanity - if (PortalSettings.Registration.UseProfanityFilter) + if (this.PortalSettings.Registration.UseProfanityFilter) { - if (!portalSecurity.ValidateInput(User.Username, PortalSecurity.FilterFlag.NoProfanity)) + if (!portalSecurity.ValidateInput(this.User.Username, PortalSecurity.FilterFlag.NoProfanity)) { - CreateStatus = UserCreateStatus.InvalidUserName; + this.CreateStatus = UserCreateStatus.InvalidUserName; } - if (!String.IsNullOrEmpty(User.DisplayName)) + if (!String.IsNullOrEmpty(this.User.DisplayName)) { - if (!portalSecurity.ValidateInput(User.DisplayName, PortalSecurity.FilterFlag.NoProfanity)) + if (!portalSecurity.ValidateInput(this.User.DisplayName, PortalSecurity.FilterFlag.NoProfanity)) { - CreateStatus = UserCreateStatus.InvalidDisplayName; + this.CreateStatus = UserCreateStatus.InvalidDisplayName; } } } //Validate Unique User Name - UserInfo user = UserController.GetUserByName(PortalId, User.Username); + UserInfo user = UserController.GetUserByName(this.PortalId, this.User.Username); if (user != null) { - if (PortalSettings.Registration.UseEmailAsUserName) + if (this.PortalSettings.Registration.UseEmailAsUserName) { - CreateStatus = UserCreateStatus.DuplicateEmail; + this.CreateStatus = UserCreateStatus.DuplicateEmail; } else { - CreateStatus = UserCreateStatus.DuplicateUserName; + this.CreateStatus = UserCreateStatus.DuplicateUserName; int i = 1; string userName = null; while (user != null) { - userName = User.Username + "0" + i.ToString(CultureInfo.InvariantCulture); - user = UserController.GetUserByName(PortalId, userName); + userName = this.User.Username + "0" + i.ToString(CultureInfo.InvariantCulture); + user = UserController.GetUserByName(this.PortalId, userName); i++; } - User.Username = userName; + this.User.Username = userName; } } //Validate Unique Display Name - if (CreateStatus == UserCreateStatus.AddUser && PortalSettings.Registration.RequireUniqueDisplayName) + if (this.CreateStatus == UserCreateStatus.AddUser && this.PortalSettings.Registration.RequireUniqueDisplayName) { - user = UserController.Instance.GetUserByDisplayname(PortalId, User.DisplayName); + user = UserController.Instance.GetUserByDisplayname(this.PortalId, this.User.DisplayName); if (user != null) { - CreateStatus = UserCreateStatus.DuplicateDisplayName; + this.CreateStatus = UserCreateStatus.DuplicateDisplayName; int i = 1; string displayName = null; while (user != null) { - displayName = User.DisplayName + " 0" + i.ToString(CultureInfo.InvariantCulture); - user = UserController.Instance.GetUserByDisplayname(PortalId, displayName); + displayName = this.User.DisplayName + " 0" + i.ToString(CultureInfo.InvariantCulture); + user = UserController.Instance.GetUserByDisplayname(this.PortalId, displayName); i++; } - User.DisplayName = displayName; + this.User.DisplayName = displayName; } } //Check Question/Answer - if (CreateStatus == UserCreateStatus.AddUser && MembershipProviderConfig.RequiresQuestionAndAnswer) + if (this.CreateStatus == UserCreateStatus.AddUser && MembershipProviderConfig.RequiresQuestionAndAnswer) { - if (string.IsNullOrEmpty(User.Membership.PasswordQuestion)) + if (string.IsNullOrEmpty(this.User.Membership.PasswordQuestion)) { //Invalid Question - CreateStatus = UserCreateStatus.InvalidQuestion; + this.CreateStatus = UserCreateStatus.InvalidQuestion; } - if (CreateStatus == UserCreateStatus.AddUser) + if (this.CreateStatus == UserCreateStatus.AddUser) { - if (string.IsNullOrEmpty(User.Membership.PasswordAnswer)) + if (string.IsNullOrEmpty(this.User.Membership.PasswordAnswer)) { //Invalid Question - CreateStatus = UserCreateStatus.InvalidAnswer; + this.CreateStatus = UserCreateStatus.InvalidAnswer; } } } - if (CreateStatus != UserCreateStatus.AddUser) + if (this.CreateStatus != UserCreateStatus.AddUser) { _IsValid = false; } @@ -769,17 +769,17 @@ private bool Validate() private string GetRedirectUrl(bool checkSetting = true) { var redirectUrl = ""; - var redirectAfterRegistration = PortalSettings.Registration.RedirectAfterRegistration; + var redirectAfterRegistration = this.PortalSettings.Registration.RedirectAfterRegistration; if (checkSetting && redirectAfterRegistration > 0) //redirect to after registration page { - redirectUrl = _navigationManager.NavigateURL(redirectAfterRegistration); + redirectUrl = this._navigationManager.NavigateURL(redirectAfterRegistration); } else { - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to register - redirectUrl = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + redirectUrl = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. redirectUrl = UrlUtils.ValidReturnUrl(redirectUrl); @@ -797,7 +797,7 @@ private string GetRedirectUrl(bool checkSetting = true) if (String.IsNullOrEmpty(redirectUrl)) { //redirect to current page - redirectUrl = _navigationManager.NavigateURL(); + redirectUrl = this._navigationManager.NavigateURL(); } } @@ -806,21 +806,21 @@ private string GetRedirectUrl(bool checkSetting = true) private void registerButton_Click(object sender, EventArgs e) { - if ((PortalSettings.Registration.UseCaptcha && ctlCaptcha.IsValid) || !PortalSettings.Registration.UseCaptcha) + if ((this.PortalSettings.Registration.UseCaptcha && this.ctlCaptcha.IsValid) || !this.PortalSettings.Registration.UseCaptcha) { - if (IsValid) + if (this.IsValid) { - if (PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) + if (this.PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { - CreateUser(); + this.CreateUser(); } } else { - if (CreateStatus != UserCreateStatus.AddUser) + if (this.CreateStatus != UserCreateStatus.AddUser) { - AddLocalizedModuleMessage(UserController.GetUserCreateStatus(CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); + this.AddLocalizedModuleMessage(UserController.GetUserCreateStatus(this.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true); } } } @@ -830,47 +830,47 @@ private void UserAuthenticated(object sender, UserAuthenticatedEventArgs e) { NameValueCollection profileProperties = e.Profile; - User.Username = e.UserToken; - AuthenticationType = e.AuthenticationType; - UserToken = e.UserToken; + this.User.Username = e.UserToken; + this.AuthenticationType = e.AuthenticationType; + this.UserToken = e.UserToken; foreach (string key in profileProperties) { switch (key) { case "FirstName": - User.FirstName = profileProperties[key]; + this.User.FirstName = profileProperties[key]; break; case "LastName": - User.LastName = profileProperties[key]; + this.User.LastName = profileProperties[key]; break; case "Email": - User.Email = profileProperties[key]; + this.User.Email = profileProperties[key]; break; case "DisplayName": - User.DisplayName = profileProperties[key]; + this.User.DisplayName = profileProperties[key]; break; default: - User.Profile.SetProfileProperty(key, profileProperties[key]); + this.User.Profile.SetProfileProperty(key, profileProperties[key]); break; } } //Generate a random password for the user - User.Membership.Password = UserController.GeneratePassword(); + this.User.Membership.Password = UserController.GeneratePassword(); - if (!String.IsNullOrEmpty(User.Email)) + if (!String.IsNullOrEmpty(this.User.Email)) { - CreateUser(); + this.CreateUser(); } else { - AddLocalizedModuleMessage(LocalizeString("NoEmail"), ModuleMessage.ModuleMessageType.RedError, true); - foreach (DnnFormItemBase formItem in userForm.Items) + this.AddLocalizedModuleMessage(this.LocalizeString("NoEmail"), ModuleMessage.ModuleMessageType.RedError, true); + foreach (DnnFormItemBase formItem in this.userForm.Items) { formItem.Visible = formItem.DataField == "Email"; } - userForm.DataBind(); + this.userForm.DataBind(); } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs index 1972684cb0a..97c2f9a1e7a 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/SecurityRoles.ascx.cs @@ -61,7 +61,7 @@ public partial class SecurityRoles : PortalModuleBase, IActionable public SecurityRoles() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region "Protected Members" @@ -76,26 +76,26 @@ protected string ReturnUrl get { string _ReturnURL; - var FilterParams = new string[String.IsNullOrEmpty(Request.QueryString["filterproperty"]) ? 2 : 3]; + var FilterParams = new string[String.IsNullOrEmpty(this.Request.QueryString["filterproperty"]) ? 2 : 3]; - if (String.IsNullOrEmpty(Request.QueryString["filterProperty"])) + if (String.IsNullOrEmpty(this.Request.QueryString["filterProperty"])) { - FilterParams.SetValue("filter=" + Request.QueryString["filter"], 0); - FilterParams.SetValue("currentpage=" + Request.QueryString["currentpage"], 1); + FilterParams.SetValue("filter=" + this.Request.QueryString["filter"], 0); + FilterParams.SetValue("currentpage=" + this.Request.QueryString["currentpage"], 1); } else { - FilterParams.SetValue("filter=" + Request.QueryString["filter"], 0); - FilterParams.SetValue("filterProperty=" + Request.QueryString["filterProperty"], 1); - FilterParams.SetValue("currentpage=" + Request.QueryString["currentpage"], 2); + FilterParams.SetValue("filter=" + this.Request.QueryString["filter"], 0); + FilterParams.SetValue("filterProperty=" + this.Request.QueryString["filterProperty"], 1); + FilterParams.SetValue("currentpage=" + this.Request.QueryString["currentpage"], 2); } - if (string.IsNullOrEmpty(Request.QueryString["filter"])) + if (string.IsNullOrEmpty(this.Request.QueryString["filter"])) { - _ReturnURL = _navigationManager.NavigateURL(TabId); + _ReturnURL = this._navigationManager.NavigateURL(this.TabId); } else { - _ReturnURL = _navigationManager.NavigateURL(TabId, "", FilterParams); + _ReturnURL = this._navigationManager.NavigateURL(this.TabId, "", FilterParams); } return _ReturnURL; } @@ -105,18 +105,18 @@ protected RoleInfo Role { get { - if (_Role == null) + if (this._Role == null) { - if (RoleId != Null.NullInteger) + if (this.RoleId != Null.NullInteger) { - _Role = RoleController.Instance.GetRole(PortalId, r => r.RoleID == RoleId); ; + this._Role = RoleController.Instance.GetRole(this.PortalId, r => r.RoleID == this.RoleId); ; } - else if (cboRoles.SelectedItem != null) + else if (this.cboRoles.SelectedItem != null) { - _Role = RoleController.Instance.GetRole(PortalId, r => r.RoleID == Convert.ToInt32(cboRoles.SelectedItem.Value)); + this._Role = RoleController.Instance.GetRole(this.PortalId, r => r.RoleID == Convert.ToInt32(this.cboRoles.SelectedItem.Value)); } } - return _Role; + return this._Role; } } @@ -124,22 +124,22 @@ protected UserInfo User { get { - if (_User == null) + if (this._User == null) { - if (UserId != Null.NullInteger) + if (this.UserId != Null.NullInteger) { - _User = UserController.GetUserById(PortalId, UserId); + this._User = UserController.GetUserById(this.PortalId, this.UserId); } - else if (UsersControl == UsersControl.TextBox && !String.IsNullOrEmpty(txtUsers.Text)) + else if (this.UsersControl == UsersControl.TextBox && !String.IsNullOrEmpty(this.txtUsers.Text)) { - _User = UserController.GetUserByName(PortalId, txtUsers.Text); + this._User = UserController.GetUserByName(this.PortalId, this.txtUsers.Text); } - else if (UsersControl == UsersControl.Combo && (cboUsers.SelectedItem != null)) + else if (this.UsersControl == UsersControl.Combo && (this.cboUsers.SelectedItem != null)) { - _User = UserController.GetUserById(PortalId, Convert.ToInt32(cboUsers.SelectedItem.Value)); + this._User = UserController.GetUserById(this.PortalId, Convert.ToInt32(this.cboUsers.SelectedItem.Value)); } } - return _User; + return this._User; } } @@ -147,11 +147,11 @@ protected int SelectedUserID { get { - return _SelectedUserID; + return this._SelectedUserID; } set { - _SelectedUserID = value; + this._SelectedUserID = value; } } @@ -164,7 +164,7 @@ protected UsersControl UsersControl { get { - var setting = UserModuleBase.GetSetting(PortalId, "Security_UsersControl"); + var setting = UserModuleBase.GetSetting(this.PortalId, "Security_UsersControl"); return (UsersControl)setting; } } @@ -175,7 +175,7 @@ protected int PageSize { get { - var setting = UserModuleBase.GetSetting(PortalId, "Records_PerPage"); + var setting = UserModuleBase.GetSetting(this.PortalId, "Records_PerPage"); return Convert.ToInt32(setting); } } @@ -219,19 +219,19 @@ public ModuleActionCollection ModuleActions private void BindData() { //bind all portal roles to dropdownlist - if (RoleId == Null.NullInteger) + if (this.RoleId == Null.NullInteger) { - if (cboRoles.Items.Count == 0) + if (this.cboRoles.Items.Count == 0) { - var roles = RoleController.Instance.GetRoles(PortalId, x => x.Status == RoleStatus.Approved); + var roles = RoleController.Instance.GetRoles(this.PortalId, x => x.Status == RoleStatus.Approved); //Remove access to Admin Role if use is not a member of the role int roleIndex = Null.NullInteger; foreach (RoleInfo tmpRole in roles) { - if (tmpRole.RoleName == PortalSettings.AdministratorRoleName) + if (tmpRole.RoleName == this.PortalSettings.AdministratorRoleName) { - if (!PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName)) + if (!PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName)) { roleIndex = roles.IndexOf(tmpRole); } @@ -242,70 +242,70 @@ private void BindData() { roles.RemoveAt(roleIndex); } - cboRoles.DataSource = roles; - cboRoles.DataBind(); + this.cboRoles.DataSource = roles; + this.cboRoles.DataBind(); } } else { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - if (Role != null) + if (this.Role != null) { //cboRoles.Items.Add(new ListItem(Role.RoleName, Role.RoleID.ToString())); - cboRoles.AddItem(Role.RoleName, Role.RoleID.ToString()); - cboRoles.Items[0].Selected = true; - lblTitle.Text = string.Format(Localization.GetString("RoleTitle.Text", LocalResourceFile), Role.RoleName, Role.RoleID); + this.cboRoles.AddItem(this.Role.RoleName, this.Role.RoleID.ToString()); + this.cboRoles.Items[0].Selected = true; + this.lblTitle.Text = string.Format(Localization.GetString("RoleTitle.Text", this.LocalResourceFile), this.Role.RoleName, this.Role.RoleID); } - cboRoles.Visible = false; - plRoles.Visible = false; + this.cboRoles.Visible = false; + this.plRoles.Visible = false; } } //bind all portal users to dropdownlist - if (UserId == -1) + if (this.UserId == -1) { //Make sure user has enough permissions - if (Role.RoleName == PortalSettings.AdministratorRoleName && !PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName)) + if (this.Role.RoleName == this.PortalSettings.AdministratorRoleName && !PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName)) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NotAuthorized", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); - pnlRoles.Visible = false; - pnlUserRoles.Visible = false; - chkNotify.Visible = false; + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NotAuthorized", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + this.pnlRoles.Visible = false; + this.pnlUserRoles.Visible = false; + this.chkNotify.Visible = false; return; } - if (UsersControl == UsersControl.Combo) + if (this.UsersControl == UsersControl.Combo) { - if (cboUsers.Items.Count == 0) + if (this.cboUsers.Items.Count == 0) { - foreach (UserInfo objUser in UserController.GetUsers(PortalId)) + foreach (UserInfo objUser in UserController.GetUsers(this.PortalId)) { //cboUsers.Items.Add(new ListItem(objUser.DisplayName + " (" + objUser.Username + ")", objUser.UserID.ToString())); - cboUsers.AddItem(objUser.DisplayName + " (" + objUser.Username + ")", objUser.UserID.ToString()); + this.cboUsers.AddItem(objUser.DisplayName + " (" + objUser.Username + ")", objUser.UserID.ToString()); } } - txtUsers.Visible = false; - cboUsers.Visible = true; - cmdValidate.Visible = false; + this.txtUsers.Visible = false; + this.cboUsers.Visible = true; + this.cmdValidate.Visible = false; } else { - txtUsers.Visible = true; - cboUsers.Visible = false; - cmdValidate.Visible = true; + this.txtUsers.Visible = true; + this.cboUsers.Visible = false; + this.cmdValidate.Visible = true; } } else { - if (User != null) + if (this.User != null) { - txtUsers.Text = User.UserID.ToString(); - lblTitle.Text = string.Format(Localization.GetString("UserTitle.Text", LocalResourceFile), User.Username, User.UserID); + this.txtUsers.Text = this.User.UserID.ToString(); + this.lblTitle.Text = string.Format(Localization.GetString("UserTitle.Text", this.LocalResourceFile), this.User.Username, this.User.UserID); } - txtUsers.Visible = false; - cboUsers.Visible = false; - cmdValidate.Visible = false; - plUsers.Visible = false; + this.txtUsers.Visible = false; + this.cboUsers.Visible = false; + this.cmdValidate.Visible = false; + this.plUsers.Visible = false; } } @@ -320,27 +320,27 @@ private void BindGrid() { - if (RoleId != Null.NullInteger) + if (this.RoleId != Null.NullInteger) { - cmdAdd.Text = Localization.GetString("AddUser.Text", LocalResourceFile); - grdUserRoles.DataKeyField = "UserId"; - grdUserRoles.Columns[2].Visible = false; + this.cmdAdd.Text = Localization.GetString("AddUser.Text", this.LocalResourceFile); + this.grdUserRoles.DataKeyField = "UserId"; + this.grdUserRoles.Columns[2].Visible = false; } - if (UserId != Null.NullInteger) + if (this.UserId != Null.NullInteger) { - cmdAdd.Text = Localization.GetString("AddRole.Text", LocalResourceFile); - grdUserRoles.DataKeyField = "RoleId"; - grdUserRoles.Columns[1].Visible = false; + this.cmdAdd.Text = Localization.GetString("AddRole.Text", this.LocalResourceFile); + this.grdUserRoles.DataKeyField = "RoleId"; + this.grdUserRoles.Columns[1].Visible = false; } - grdUserRoles.DataSource = GetPagedDataSource(); - grdUserRoles.DataBind(); + this.grdUserRoles.DataSource = this.GetPagedDataSource(); + this.grdUserRoles.DataBind(); - ctlPagingControl.TotalRecords = _totalRecords; - ctlPagingControl.PageSize = PageSize; - ctlPagingControl.CurrentPage = CurrentPage; - ctlPagingControl.TabID = TabId; - ctlPagingControl.QuerystringParams = System.Web.HttpUtility.UrlDecode(string.Join("&", Request.QueryString.ToString().Split('&'). + this.ctlPagingControl.TotalRecords = this._totalRecords; + this.ctlPagingControl.PageSize = this.PageSize; + this.ctlPagingControl.CurrentPage = this.CurrentPage; + this.ctlPagingControl.TabID = this.TabId; + this.ctlPagingControl.QuerystringParams = System.Web.HttpUtility.UrlDecode(string.Join("&", this.Request.QueryString.ToString().Split('&'). ToList(). Where(s => s.StartsWith("ctl", StringComparison.OrdinalIgnoreCase) || s.StartsWith("mid", StringComparison.OrdinalIgnoreCase) @@ -352,14 +352,14 @@ private void BindGrid() private IList GetPagedDataSource() { - var roleName = RoleId != Null.NullInteger ? Role.RoleName : Null.NullString; - var userName = UserId != Null.NullInteger ? User.Username : Null.NullString; + var roleName = this.RoleId != Null.NullInteger ? this.Role.RoleName : Null.NullString; + var userName = this.UserId != Null.NullInteger ? this.User.Username : Null.NullString; - var userList = RoleController.Instance.GetUserRoles(PortalId, userName, roleName); - _totalRecords = userList.Count; - _totalPages = _totalRecords%PageSize == 0 ? _totalRecords/PageSize : _totalRecords/PageSize + 1; + var userList = RoleController.Instance.GetUserRoles(this.PortalId, userName, roleName); + this._totalRecords = userList.Count; + this._totalPages = this._totalRecords%this.PageSize == 0 ? this._totalRecords/this.PageSize : this._totalRecords/this.PageSize + 1; - return userList.Skip((CurrentPage - 1 )*PageSize).Take(PageSize).ToList(); + return userList.Skip((this.CurrentPage - 1 )*this.PageSize).Take(this.PageSize).ToList(); } /// ----------------------------------------------------------------------------- @@ -376,7 +376,7 @@ private void GetDates(int UserId, int RoleId) DateTime? expiryDate = null; DateTime? effectiveDate = null; - UserRoleInfo objUserRole = RoleController.Instance.GetUserRole(PortalId, UserId, RoleId); + UserRoleInfo objUserRole = RoleController.Instance.GetUserRole(this.PortalId, UserId, RoleId); if (objUserRole != null) { if (Null.IsNull(objUserRole.EffectiveDate) == false) @@ -390,7 +390,7 @@ private void GetDates(int UserId, int RoleId) } else //new role assignment { - RoleInfo objRole = RoleController.Instance.GetRole(PortalId, r => r.RoleID == RoleId); + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalId, r => r.RoleID == RoleId); if (objRole.BillingPeriod > 0) { @@ -411,8 +411,8 @@ private void GetDates(int UserId, int RoleId) } } } - effectiveDatePicker.SelectedDate = effectiveDate; - expiryDatePicker.SelectedDate = expiryDate; + this.effectiveDatePicker.SelectedDate = effectiveDate; + this.expiryDatePicker.SelectedDate = expiryDate; } #endregion @@ -426,19 +426,19 @@ private void GetDates(int UserId, int RoleId) /// ----------------------------------------------------------------------------- public override void DataBind() { - if (!ModulePermissionController.CanEditModuleContent(ModuleConfiguration)) + if (!ModulePermissionController.CanEditModuleContent(this.ModuleConfiguration)) { - Response.Redirect(_navigationManager.NavigateURL("Access Denied"), true); + this.Response.Redirect(this._navigationManager.NavigateURL("Access Denied"), true); } base.DataBind(); //Localize Headers - Localization.LocalizeDataGrid(ref grdUserRoles, LocalResourceFile); + Localization.LocalizeDataGrid(ref this.grdUserRoles, this.LocalResourceFile); //Bind the role data to the datalist - BindData(); + this.BindData(); - BindGrid(); + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -454,11 +454,11 @@ public override void DataBind() public bool DeleteButtonVisible(int UserID, int RoleID) { //[DNN-4285] Check if the role can be removed (only handles case of Administrator and Administrator Role - bool canDelete = RoleController.CanRemoveUserFromRole(PortalSettings, UserID, RoleID); - if (RoleID == PortalSettings.AdministratorRoleId && canDelete) + bool canDelete = RoleController.CanRemoveUserFromRole(this.PortalSettings, UserID, RoleID); + if (RoleID == this.PortalSettings.AdministratorRoleId && canDelete) { //User can only delete if in Admin role - canDelete = PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); + canDelete = PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); } return canDelete; } @@ -490,7 +490,7 @@ public string FormatDate(DateTime DateTime) /// ----------------------------------------------------------------------------- public string FormatUser(int UserID, string DisplayName) { - return "" + DisplayName + ""; + return "" + DisplayName + ""; } #endregion @@ -508,38 +508,38 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if ((Request.QueryString["RoleId"] != null)) + if ((this.Request.QueryString["RoleId"] != null)) { - RoleId = Int32.Parse(Request.QueryString["RoleId"]); + this.RoleId = Int32.Parse(this.Request.QueryString["RoleId"]); } - if ((Request.QueryString["UserId"] != null)) + if ((this.Request.QueryString["UserId"] != null)) { int userId; // Use Int32.MaxValue as invalid UserId - UserId = Int32.TryParse(Request.QueryString["UserId"], out userId) ? userId : Int32.MaxValue; + this.UserId = Int32.TryParse(this.Request.QueryString["UserId"], out userId) ? userId : Int32.MaxValue; } - CurrentPage = 1; - if (Request.QueryString["CurrentPage"] != null) + this.CurrentPage = 1; + if (this.Request.QueryString["CurrentPage"] != null) { var currentPage = 0; - if (int.TryParse(Request.QueryString["CurrentPage"], out currentPage) + if (int.TryParse(this.Request.QueryString["CurrentPage"], out currentPage) && currentPage > 0) { - CurrentPage = currentPage; + this.CurrentPage = currentPage; } else { - CurrentPage = 1; + this.CurrentPage = 1; } } - cboRoles.SelectedIndexChanged += cboRoles_SelectedIndexChanged; - cboUsers.SelectedIndexChanged += cboUsers_SelectedIndexChanged; - cmdAdd.Click += cmdAdd_Click; - cmdValidate.Click += cmdValidate_Click; - grdUserRoles.ItemCreated += grdUserRoles_ItemCreated; - grdUserRoles.ItemDataBound += grdUserRoles_ItemDataBound; + this.cboRoles.SelectedIndexChanged += this.cboRoles_SelectedIndexChanged; + this.cboUsers.SelectedIndexChanged += this.cboUsers_SelectedIndexChanged; + this.cmdAdd.Click += this.cmdAdd_Click; + this.cmdValidate.Click += this.cmdValidate_Click; + this.grdUserRoles.ItemCreated += this.grdUserRoles_ItemCreated; + this.grdUserRoles.ItemDataBound += this.grdUserRoles_ItemDataBound; } /// ----------------------------------------------------------------------------- @@ -555,17 +555,17 @@ protected override void OnLoad(EventArgs e) try { - cmdCancel.NavigateUrl = ReturnUrl; - if (ParentModule == null) + this.cmdCancel.NavigateUrl = this.ReturnUrl; + if (this.ParentModule == null) { - DataBind(); + this.DataBind(); } - if (Role == null) + if (this.Role == null) return; - placeIsOwner.Visible = ((Role.SecurityMode == SecurityMode.SocialGroup) || (Role.SecurityMode == SecurityMode.Both)); - placeIsOwnerHeader.Visible = ((Role.SecurityMode == SecurityMode.SocialGroup) || (Role.SecurityMode == SecurityMode.Both)); + this.placeIsOwner.Visible = ((this.Role.SecurityMode == SecurityMode.SocialGroup) || (this.Role.SecurityMode == SecurityMode.Both)); + this.placeIsOwnerHeader.Visible = ((this.Role.SecurityMode == SecurityMode.SocialGroup) || (this.Role.SecurityMode == SecurityMode.Both)); } catch (ThreadAbortException exc) //Do nothing if ThreadAbort as this is caused by a redirect { @@ -588,12 +588,12 @@ protected override void OnLoad(EventArgs e) /// ----------------------------------------------------------------------------- private void cboUsers_SelectedIndexChanged(object sender, EventArgs e) { - if ((cboUsers.SelectedItem != null) && (cboRoles.SelectedItem != null)) + if ((this.cboUsers.SelectedItem != null) && (this.cboRoles.SelectedItem != null)) { - SelectedUserID = Int32.Parse(cboUsers.SelectedItem.Value); - GetDates(SelectedUserID, Int32.Parse(cboRoles.SelectedItem.Value)); + this.SelectedUserID = Int32.Parse(this.cboUsers.SelectedItem.Value); + this.GetDates(this.SelectedUserID, Int32.Parse(this.cboRoles.SelectedItem.Value)); } - BindGrid(); + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -605,26 +605,26 @@ private void cboUsers_SelectedIndexChanged(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cmdValidate_Click(object sender, EventArgs e) { - if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) == false) + if (PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName) == false) { return; } - if (!String.IsNullOrEmpty(txtUsers.Text)) + if (!String.IsNullOrEmpty(this.txtUsers.Text)) { //validate username - UserInfo objUser = UserController.GetUserByName(PortalId, txtUsers.Text); + UserInfo objUser = UserController.GetUserByName(this.PortalId, this.txtUsers.Text); if (objUser != null) { - GetDates(objUser.UserID, RoleId); - SelectedUserID = objUser.UserID; + this.GetDates(objUser.UserID, this.RoleId); + this.SelectedUserID = objUser.UserID; } else { - txtUsers.Text = ""; + this.txtUsers.Text = ""; } } - BindGrid(); + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -637,8 +637,8 @@ private void cmdValidate_Click(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cboRoles_SelectedIndexChanged(object sender, EventArgs e) { - GetDates(UserId, Int32.Parse(cboRoles.SelectedItem.Value)); - BindGrid(); + this.GetDates(this.UserId, Int32.Parse(this.cboRoles.SelectedItem.Value)); + this.BindGrid(); } /// ----------------------------------------------------------------------------- @@ -650,27 +650,27 @@ private void cboRoles_SelectedIndexChanged(object sender, EventArgs e) /// ----------------------------------------------------------------------------- private void cmdAdd_Click(Object sender, EventArgs e) { - if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) == false) + if (PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName) == false) { return; } try { - if (Page.IsValid) + if (this.Page.IsValid) { - if ((Role != null) && (User != null)) + if ((this.Role != null) && (this.User != null)) { //do not modify the portal Administrator account dates - if (User.UserID == PortalSettings.AdministratorId && Role.RoleID == PortalSettings.AdministratorRoleId) + if (this.User.UserID == this.PortalSettings.AdministratorId && this.Role.RoleID == this.PortalSettings.AdministratorRoleId) { - effectiveDatePicker.SelectedDate = null; - expiryDatePicker.SelectedDate = null; + this.effectiveDatePicker.SelectedDate = null; + this.expiryDatePicker.SelectedDate = null; } DateTime datEffectiveDate; - if (effectiveDatePicker.SelectedDate != null) + if (this.effectiveDatePicker.SelectedDate != null) { - datEffectiveDate = effectiveDatePicker.SelectedDate.Value; + datEffectiveDate = this.effectiveDatePicker.SelectedDate.Value; } else { @@ -678,9 +678,9 @@ private void cmdAdd_Click(Object sender, EventArgs e) } DateTime datExpiryDate; - if (expiryDatePicker.SelectedDate != null) + if (this.expiryDatePicker.SelectedDate != null) { - datExpiryDate = expiryDatePicker.SelectedDate.Value; + datExpiryDate = this.expiryDatePicker.SelectedDate.Value; } else { @@ -690,14 +690,14 @@ private void cmdAdd_Click(Object sender, EventArgs e) //Add User to Role var isOwner = false; - if(((Role.SecurityMode == SecurityMode.SocialGroup) || (Role.SecurityMode == SecurityMode.Both))) - isOwner = chkIsOwner.Checked; + if(((this.Role.SecurityMode == SecurityMode.SocialGroup) || (this.Role.SecurityMode == SecurityMode.Both))) + isOwner = this.chkIsOwner.Checked; - RoleController.AddUserRole(User, Role, PortalSettings, RoleStatus.Approved, datEffectiveDate, datExpiryDate, chkNotify.Checked, isOwner); - chkIsOwner.Checked = false; //reset the checkbox + RoleController.AddUserRole(this.User, this.Role, this.PortalSettings, RoleStatus.Approved, datEffectiveDate, datExpiryDate, this.chkNotify.Checked, isOwner); + this.chkIsOwner.Checked = false; //reset the checkbox } } - BindGrid(); + this.BindGrid(); } catch (Exception exc) //Module failed to load { @@ -707,7 +707,7 @@ private void cmdAdd_Click(Object sender, EventArgs e) public void cmdDeleteUserRole_click(object sender, ImageClickEventArgs e) { - if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) == false) + if (PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName) == false) { return; } @@ -717,17 +717,17 @@ public void cmdDeleteUserRole_click(object sender, ImageClickEventArgs e) int roleId = Convert.ToInt32(cmdDeleteUserRole.Attributes["roleId"]); int userId = Convert.ToInt32(cmdDeleteUserRole.Attributes["userId"]); - RoleInfo role = RoleController.Instance.GetRole(PortalId, r => r.RoleID == roleId); - if (!RoleController.DeleteUserRole(UserController.GetUserById(PortalId, userId), role, PortalSettings, chkNotify.Checked)) + RoleInfo role = RoleController.Instance.GetRole(this.PortalId, r => r.RoleID == roleId); + if (!RoleController.DeleteUserRole(UserController.GetUserById(this.PortalId, userId), role, this.PortalSettings, this.chkNotify.Checked)) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("RoleRemoveError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("RoleRemoveError", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } - BindGrid(); + this.BindGrid(); } catch (Exception exc) { Exceptions.LogException(exc); - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("RoleRemoveError", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("RoleRemoveError", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } } @@ -749,19 +749,19 @@ private void grdUserRoles_ItemCreated(object sender, DataGridItemEventArgs e) if (cmdDeleteUserRole != null) { - if (RoleId == Null.NullInteger) + if (this.RoleId == Null.NullInteger) { - ClientAPI.AddButtonConfirm(cmdDeleteUserRole, String.Format(Localization.GetString("DeleteRoleFromUser.Text", LocalResourceFile), role.FullName, role.RoleName)); + ClientAPI.AddButtonConfirm(cmdDeleteUserRole, String.Format(Localization.GetString("DeleteRoleFromUser.Text", this.LocalResourceFile), role.FullName, role.RoleName)); } else { - ClientAPI.AddButtonConfirm(cmdDeleteUserRole, String.Format(Localization.GetString("DeleteUsersFromRole.Text", LocalResourceFile), role.FullName, role.RoleName)); + ClientAPI.AddButtonConfirm(cmdDeleteUserRole, String.Format(Localization.GetString("DeleteUsersFromRole.Text", this.LocalResourceFile), role.FullName, role.RoleName)); } cmdDeleteUserRole.Attributes.Add("roleId", role.RoleID.ToString()); cmdDeleteUserRole.Attributes.Add("userId", role.UserID.ToString()); } - item.Cells[5].Visible = ((Role.SecurityMode == SecurityMode.SocialGroup) || (Role.SecurityMode == SecurityMode.Both)); + item.Cells[5].Visible = ((this.Role.SecurityMode == SecurityMode.SocialGroup) || (this.Role.SecurityMode == SecurityMode.Both)); } catch (Exception exc) //Module failed to load @@ -776,18 +776,18 @@ protected void grdUserRoles_ItemDataBound(object sender, DataGridItemEventArgs e if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem || item.ItemType == ListItemType.SelectedItem) { var userRole = (UserRoleInfo) item.DataItem; - if (RoleId == Null.NullInteger) + if (this.RoleId == Null.NullInteger) { - if (userRole.RoleID == Convert.ToInt32(cboRoles.SelectedValue)) + if (userRole.RoleID == Convert.ToInt32(this.cboRoles.SelectedValue)) { - cmdAdd.Text = Localization.GetString("UpdateRole.Text", LocalResourceFile); + this.cmdAdd.Text = Localization.GetString("UpdateRole.Text", this.LocalResourceFile); } } - if (UserId == Null.NullInteger) + if (this.UserId == Null.NullInteger) { - if (userRole.UserID == SelectedUserID) + if (userRole.UserID == this.SelectedUserID) { - cmdAdd.Text = Localization.GetString("UpdateRole.Text", LocalResourceFile); + this.cmdAdd.Text = Localization.GetString("UpdateRole.Text", this.LocalResourceFile); } } } diff --git a/DNN Platform/Website/DesktopModules/Admin/Security/User.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/Security/User.ascx.cs index 499283fa308..948671690ab 100644 --- a/DNN Platform/Website/DesktopModules/Admin/Security/User.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/Security/User.ascx.cs @@ -60,7 +60,7 @@ public bool IsValid { get { - return Validate(); + return this.Validate(); } } @@ -72,11 +72,11 @@ public bool ShowPassword { get { - return Password.Visible; + return this.Password.Visible; } set { - Password.Visible = value; + this.Password.Visible = value; } } @@ -88,11 +88,11 @@ public bool ShowUpdate { get { - return actionsRow.Visible; + return this.actionsRow.Visible; } set { - actionsRow.Visible = value; + this.actionsRow.Visible = value; } } @@ -103,12 +103,12 @@ public string CssClass { get { - return pnlAddUser.CssClass; + return this.pnlAddUser.CssClass; } set { - userForm.CssClass = string.IsNullOrEmpty(userForm.CssClass) ? value : string.Format("{0} {1}", userForm.CssClass, value); - pnlAddUser.CssClass = string.IsNullOrEmpty(pnlAddUser.CssClass) ? value : string.Format("{0} {1}", pnlAddUser.CssClass, value); ; + this.userForm.CssClass = string.IsNullOrEmpty(this.userForm.CssClass) ? value : string.Format("{0} {1}", this.userForm.CssClass, value); + this.pnlAddUser.CssClass = string.IsNullOrEmpty(this.pnlAddUser.CssClass) ? value : string.Format("{0} {1}", this.pnlAddUser.CssClass, value); ; } } @@ -124,7 +124,7 @@ public string CssClass private bool CanUpdateUsername() { //do not allow for non-logged in users - if (Request.IsAuthenticated==false || AddUser) + if (this.Request.IsAuthenticated==false || this.AddUser) { return false; } @@ -133,21 +133,21 @@ private bool CanUpdateUsername() if (UserController.Instance.GetCurrentUserInfo().IsSuperUser) { //only allow updates for non-superuser accounts - if (User.IsSuperUser==false) + if (this.User.IsSuperUser==false) { return true; } } //if an admin, check if the user is only within this portal - if (UserController.Instance.GetCurrentUserInfo().IsInRole(PortalSettings.AdministratorRoleName)) + if (UserController.Instance.GetCurrentUserInfo().IsInRole(this.PortalSettings.AdministratorRoleName)) { //only allow updates for non-superuser accounts - if (User.IsSuperUser) + if (this.User.IsSuperUser) { return false; } - if (PortalController.GetPortalsByUser(User.UserID).Count == 1) return true; + if (PortalController.GetPortalsByUser(this.User.UserID).Count == 1) return true; } return false; @@ -156,9 +156,9 @@ private bool CanUpdateUsername() private void UpdateDisplayName() { //Update DisplayName to conform to Format - if (!string.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - User.UpdateDisplayName(PortalSettings.Registration.DisplayNameFormat); + this.User.UpdateDisplayName(this.PortalSettings.Registration.DisplayNameFormat); } } @@ -169,56 +169,56 @@ private void UpdateDisplayName() private bool Validate() { //Check User Editor - bool _IsValid = userForm.IsValid; + bool _IsValid = this.userForm.IsValid; //Check Password is valid - if (AddUser && ShowPassword) + if (this.AddUser && this.ShowPassword) { - CreateStatus = UserCreateStatus.AddUser; - if (!chkRandom.Checked) + this.CreateStatus = UserCreateStatus.AddUser; + if (!this.chkRandom.Checked) { //1. Check Password is Valid - if (CreateStatus == UserCreateStatus.AddUser && !UserController.ValidatePassword(txtPassword.Text)) + if (this.CreateStatus == UserCreateStatus.AddUser && !UserController.ValidatePassword(this.txtPassword.Text)) { - CreateStatus = UserCreateStatus.InvalidPassword; + this.CreateStatus = UserCreateStatus.InvalidPassword; } - if (CreateStatus == UserCreateStatus.AddUser) + if (this.CreateStatus == UserCreateStatus.AddUser) { - User.Membership.Password = txtPassword.Text; + this.User.Membership.Password = this.txtPassword.Text; } } else { //Generate a random password for the user - User.Membership.Password = UserController.GeneratePassword(); + this.User.Membership.Password = UserController.GeneratePassword(); } //Check Question/Answer - if (CreateStatus == UserCreateStatus.AddUser && MembershipProviderConfig.RequiresQuestionAndAnswer) + if (this.CreateStatus == UserCreateStatus.AddUser && MembershipProviderConfig.RequiresQuestionAndAnswer) { - if (string.IsNullOrEmpty(txtQuestion.Text)) + if (string.IsNullOrEmpty(this.txtQuestion.Text)) { //Invalid Question - CreateStatus = UserCreateStatus.InvalidQuestion; + this.CreateStatus = UserCreateStatus.InvalidQuestion; } else { - User.Membership.PasswordQuestion = txtQuestion.Text; + this.User.Membership.PasswordQuestion = this.txtQuestion.Text; } - if (CreateStatus == UserCreateStatus.AddUser) + if (this.CreateStatus == UserCreateStatus.AddUser) { - if (string.IsNullOrEmpty(txtAnswer.Text)) + if (string.IsNullOrEmpty(this.txtAnswer.Text)) { //Invalid Question - CreateStatus = UserCreateStatus.InvalidAnswer; + this.CreateStatus = UserCreateStatus.InvalidAnswer; } else { - User.Membership.PasswordAnswer = txtAnswer.Text; + this.User.Membership.PasswordAnswer = this.txtAnswer.Text; } } } - if (CreateStatus != UserCreateStatus.AddUser) + if (this.CreateStatus != UserCreateStatus.AddUser) { _IsValid = false; } @@ -237,34 +237,34 @@ private bool Validate() public void CreateUser() { //Update DisplayName to conform to Format - UpdateDisplayName(); + this.UpdateDisplayName(); - if (IsRegister) + if (this.IsRegister) { - User.Membership.Approved = PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.PublicRegistration; + this.User.Membership.Approved = this.PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.PublicRegistration; } else { //Set the Approved status from the value in the Authorized checkbox - User.Membership.Approved = chkAuthorize.Checked; + this.User.Membership.Approved = this.chkAuthorize.Checked; } - var user = User; + var user = this.User; // make sure username is set in UseEmailAsUserName" mode - if (PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false)) + if (PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false)) { - user.Username = User.Email; - User.Username = User.Email; + user.Username = this.User.Email; + this.User.Username = this.User.Email; } var createStatus = UserController.CreateUser(ref user); var args = (createStatus == UserCreateStatus.Success) - ? new UserCreatedEventArgs(User) {Notify = chkNotify.Checked} + ? new UserCreatedEventArgs(this.User) {Notify = this.chkNotify.Checked} : new UserCreatedEventArgs(null); args.CreateStatus = createStatus; - OnUserCreated(args); - OnUserCreateCompleted(args); + this.OnUserCreated(args); + this.OnUserCreateCompleted(args); } /// ----------------------------------------------------------------------------- @@ -273,135 +273,135 @@ public void CreateUser() ///
    public override void DataBind() { - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { string confirmString = Localization.GetString("DeleteItem"); - if (IsUser) + if (this.IsUser) { - confirmString = Localization.GetString("ConfirmUnRegister", LocalResourceFile); + confirmString = Localization.GetString("ConfirmUnRegister", this.LocalResourceFile); } - ClientAPI.AddButtonConfirm(cmdDelete, confirmString); - chkRandom.Checked = false; + ClientAPI.AddButtonConfirm(this.cmdDelete, confirmString); + this.chkRandom.Checked = false; } - cmdDelete.Visible = false; - cmdRemove.Visible = false; - cmdRestore.Visible = false; - if (!AddUser) + this.cmdDelete.Visible = false; + this.cmdRemove.Visible = false; + this.cmdRestore.Visible = false; + if (!this.AddUser) { - var deletePermitted = (User.UserID != PortalSettings.AdministratorId) && !(IsUser && User.IsSuperUser); + var deletePermitted = (this.User.UserID != this.PortalSettings.AdministratorId) && !(this.IsUser && this.User.IsSuperUser); if ((deletePermitted)) { - if ((User.IsDeleted)) + if ((this.User.IsDeleted)) { - cmdRemove.Visible = true; - cmdRestore.Visible = true; + this.cmdRemove.Visible = true; + this.cmdRestore.Visible = true; } else { - cmdDelete.Visible = true; + this.cmdDelete.Visible = true; } } } - cmdUpdate.Text = Localization.GetString(IsUser ? "Register" : "CreateUser", LocalResourceFile); - cmdDelete.Text = Localization.GetString(IsUser ? "UnRegister" : "Delete", LocalResourceFile); - if (AddUser) + this.cmdUpdate.Text = Localization.GetString(this.IsUser ? "Register" : "CreateUser", this.LocalResourceFile); + this.cmdDelete.Text = Localization.GetString(this.IsUser ? "UnRegister" : "Delete", this.LocalResourceFile); + if (this.AddUser) { - pnlAddUser.Visible = true; - if (IsRegister) + this.pnlAddUser.Visible = true; + if (this.IsRegister) { - AuthorizeNotify.Visible = false; - randomRow.Visible = false; - if (ShowPassword) + this.AuthorizeNotify.Visible = false; + this.randomRow.Visible = false; + if (this.ShowPassword) { - questionRow.Visible = MembershipProviderConfig.RequiresQuestionAndAnswer; - answerRow.Visible = MembershipProviderConfig.RequiresQuestionAndAnswer; - lblPasswordHelp.Text = Localization.GetString("PasswordHelpUser", LocalResourceFile); + this.questionRow.Visible = MembershipProviderConfig.RequiresQuestionAndAnswer; + this.answerRow.Visible = MembershipProviderConfig.RequiresQuestionAndAnswer; + this.lblPasswordHelp.Text = Localization.GetString("PasswordHelpUser", this.LocalResourceFile); } } else { - lblPasswordHelp.Text = Localization.GetString("PasswordHelpAdmin", LocalResourceFile); + this.lblPasswordHelp.Text = Localization.GetString("PasswordHelpAdmin", this.LocalResourceFile); } - txtConfirm.Attributes.Add("value", txtConfirm.Text); - txtPassword.Attributes.Add("value", txtPassword.Text); + this.txtConfirm.Attributes.Add("value", this.txtConfirm.Text); + this.txtPassword.Attributes.Add("value", this.txtPassword.Text); } - bool disableUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); + bool disableUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false); //only show username row once UseEmailAsUserName is disabled in site settings if (disableUsername) { - userNameReadOnly.Visible = false; - userName.Visible = false; + this.userNameReadOnly.Visible = false; + this.userName.Visible = false; } else { - userNameReadOnly.Visible = !AddUser; - userName.Visible = AddUser; + this.userNameReadOnly.Visible = !this.AddUser; + this.userName.Visible = this.AddUser; } - if (CanUpdateUsername() && !disableUsername) + if (this.CanUpdateUsername() && !disableUsername) { - renameUserName.Visible = true; + this.renameUserName.Visible = true; - userName.Visible = false; - userNameReadOnly.Visible = false; + this.userName.Visible = false; + this.userNameReadOnly.Visible = false; - ArrayList portals = PortalController.GetPortalsByUser(User.UserID); + ArrayList portals = PortalController.GetPortalsByUser(this.User.UserID); if (portals.Count>1) { - numSites.Text=String.Format(Localization.GetString("UpdateUserName", LocalResourceFile), portals.Count.ToString()); - cboSites.Visible = true; - cboSites.DataSource = portals; - cboSites.DataTextField = "PortalName"; - cboSites.DataBind(); + this.numSites.Text=String.Format(Localization.GetString("UpdateUserName", this.LocalResourceFile), portals.Count.ToString()); + this.cboSites.Visible = true; + this.cboSites.DataSource = portals; + this.cboSites.DataTextField = "PortalName"; + this.cboSites.DataBind(); - renameUserPortals.Visible = true; + this.renameUserPortals.Visible = true; } } - if (!string.IsNullOrEmpty(PortalSettings.Registration.UserNameValidator)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.UserNameValidator)) { - userName.ValidationExpression = PortalSettings.Registration.UserNameValidator; + this.userName.ValidationExpression = this.PortalSettings.Registration.UserNameValidator; } - if (!string.IsNullOrEmpty(PortalSettings.Registration.EmailValidator)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.EmailValidator)) { - email.ValidationExpression = PortalSettings.Registration.EmailValidator; + this.email.ValidationExpression = this.PortalSettings.Registration.EmailValidator; } - if (!string.IsNullOrEmpty(PortalSettings.Registration.DisplayNameFormat)) + if (!string.IsNullOrEmpty(this.PortalSettings.Registration.DisplayNameFormat)) { - if (AddUser) + if (this.AddUser) { - displayNameReadOnly.Visible = false; - displayName.Visible = false; + this.displayNameReadOnly.Visible = false; + this.displayName.Visible = false; } else { - displayNameReadOnly.Visible = true; - displayName.Visible = false; + this.displayNameReadOnly.Visible = true; + this.displayName.Visible = false; } - firstName.Visible = true; - lastName.Visible = true; + this.firstName.Visible = true; + this.lastName.Visible = true; } else { - displayNameReadOnly.Visible = false; - displayName.Visible = true; - firstName.Visible = false; - lastName.Visible = false; + this.displayNameReadOnly.Visible = false; + this.displayName.Visible = true; + this.firstName.Visible = false; + this.lastName.Visible = false; } - userForm.DataSource = User; - if (!Page.IsPostBack) + this.userForm.DataSource = this.User; + if (!this.Page.IsPostBack) { - userForm.DataBind(); - renameUserName.Value = User.Username; + this.userForm.DataBind(); + this.renameUserName.Value = this.User.Username; } } @@ -418,20 +418,20 @@ public override void DataBind() protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdDelete.Click += cmdDelete_Click; - cmdUpdate.Click += cmdUpdate_Click; - cmdRemove.Click += cmdRemove_Click; - cmdRestore.Click += cmdRestore_Click; + this.cmdDelete.Click += this.cmdDelete_Click; + this.cmdUpdate.Click += this.cmdUpdate_Click; + this.cmdRemove.Click += this.cmdRemove_Click; + this.cmdRestore.Click += this.cmdRestore_Click; } protected override void OnPreRender(EventArgs e) { - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); JavaScript.RequestRegistration(CommonJs.DnnPlugins); @@ -440,29 +440,29 @@ protected override void OnPreRender(EventArgs e) if (Host.EnableStrengthMeter) { - passwordContainer.CssClass = "password-strength-container"; - txtPassword.CssClass = "password-strength"; - txtConfirm.CssClass = string.Format("{0} checkStength", txtConfirm.CssClass); + this.passwordContainer.CssClass = "password-strength-container"; + this.txtPassword.CssClass = "password-strength"; + this.txtConfirm.CssClass = string.Format("{0} checkStength", this.txtConfirm.CssClass); var options = new DnnPaswordStrengthOptions(); var optionsAsJsonString = Json.Serialize(options); var passwordScript = string.Format("dnn.initializePasswordStrength('.{0}', {1});{2}", "password-strength", optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "PasswordStrength", passwordScript, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "PasswordStrength", passwordScript, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "PasswordStrength", passwordScript, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "PasswordStrength", passwordScript, true); } } var confirmPasswordOptions = new DnnConfirmPasswordOptions() { - FirstElementSelector = "#" + passwordContainer.ClientID + " input[type=password]", + FirstElementSelector = "#" + this.passwordContainer.ClientID + " input[type=password]", SecondElementSelector = ".password-confirm", ContainerSelector = ".dnnFormPassword", UnmatchedCssClass = "unmatched", @@ -472,14 +472,14 @@ protected override void OnPreRender(EventArgs e) var confirmOptionsAsJsonString = Json.Serialize(confirmPasswordOptions); var confirmScript = string.Format("dnn.initializePasswordComparer({0});{1}", confirmOptionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "ConfirmPassword", confirmScript, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ConfirmPassword", confirmScript, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "ConfirmPassword", confirmScript, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ConfirmPassword", confirmScript, true); } } @@ -490,59 +490,59 @@ protected override void OnPreRender(EventArgs e) ///
    private void cmdDelete_Click(Object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - string name = User.Username; - int id = UserId; - UserInfo user = User; + string name = this.User.Username; + int id = this.UserId; + UserInfo user = this.User; if (UserController.DeleteUser(ref user, true, false)) { - OnUserDeleted(new UserDeletedEventArgs(id, name)); + this.OnUserDeleted(new UserDeletedEventArgs(id, name)); } else { - OnUserDeleteError(new UserUpdateErrorArgs(id, name, "UserDeleteError")); + this.OnUserDeleteError(new UserUpdateErrorArgs(id, name, "UserDeleteError")); } } private void cmdRestore_Click(Object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - var name = User.Username; - var id = UserId; + var name = this.User.Username; + var id = this.UserId; - var userInfo = User; + var userInfo = this.User; if (UserController.RestoreUser(ref userInfo)) { - OnUserRestored(new UserRestoredEventArgs(id, name)); + this.OnUserRestored(new UserRestoredEventArgs(id, name)); } else { - OnUserRestoreError(new UserUpdateErrorArgs(id, name, "UserRestoreError")); + this.OnUserRestoreError(new UserUpdateErrorArgs(id, name, "UserRestoreError")); } } private void cmdRemove_Click(Object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - var name = User.Username; - var id = UserId; + var name = this.User.Username; + var id = this.UserId; - if (UserController.RemoveUser(User)) + if (UserController.RemoveUser(this.User)) { - OnUserRemoved(new UserRemovedEventArgs(id, name)); + this.OnUserRemoved(new UserRemovedEventArgs(id, name)); } else { - OnUserRemoveError(new UserUpdateErrorArgs(id, name, "UserRemoveError")); + this.OnUserRemoveError(new UserUpdateErrorArgs(id, name, "UserRemoveError")); } } @@ -552,66 +552,66 @@ private void cmdRemove_Click(Object sender, EventArgs e) ///
    private void cmdUpdate_Click(Object sender, EventArgs e) { - if (IsUserOrAdmin == false) + if (this.IsUserOrAdmin == false) { return; } - if (AddUser) + if (this.AddUser) { - if (IsValid) + if (this.IsValid) { - CreateUser(); - DataCache.ClearPortalUserCountCache(PortalId); + this.CreateUser(); + DataCache.ClearPortalUserCountCache(this.PortalId); } } else { - if (userForm.IsValid && (User != null)) + if (this.userForm.IsValid && (this.User != null)) { - if (User.UserID == PortalSettings.AdministratorId) + if (this.User.UserID == this.PortalSettings.AdministratorId) { //Clear the Portal Cache - DataCache.ClearPortalUserCountCache(UserPortalID); + DataCache.ClearPortalUserCountCache(this.UserPortalID); } try { //Update DisplayName to conform to Format - UpdateDisplayName(); + this.UpdateDisplayName(); //either update the username or update the user details - if (CanUpdateUsername() && !PortalSettings.Registration.UseEmailAsUserName) + if (this.CanUpdateUsername() && !this.PortalSettings.Registration.UseEmailAsUserName) { - UserController.ChangeUsername(User.UserID, renameUserName.Value.ToString()); + UserController.ChangeUsername(this.User.UserID, this.renameUserName.Value.ToString()); } //DNN-5874 Check if unique display name is required - if (PortalSettings.Registration.RequireUniqueDisplayName) + if (this.PortalSettings.Registration.RequireUniqueDisplayName) { - var usersWithSameDisplayName = (System.Collections.Generic.List)MembershipProvider.Instance().GetUsersBasicSearch(PortalId, 0, 2, "DisplayName", true, "DisplayName", User.DisplayName); - if (usersWithSameDisplayName.Any(user => user.UserID != User.UserID)) + var usersWithSameDisplayName = (System.Collections.Generic.List)MembershipProvider.Instance().GetUsersBasicSearch(this.PortalId, 0, 2, "DisplayName", true, "DisplayName", this.User.DisplayName); + if (usersWithSameDisplayName.Any(user => user.UserID != this.User.UserID)) { - UI.Skins.Skin.AddModuleMessage(this, LocalizeString("DisplayNameNotUnique"), UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, this.LocalizeString("DisplayNameNotUnique"), UI.Skins.Controls.ModuleMessage.ModuleMessageType.RedError); return; } } - UserController.UpdateUser(UserPortalID, User); + UserController.UpdateUser(this.UserPortalID, this.User); - if (PortalSettings.Registration.UseEmailAsUserName && (User.Username.ToLower() != User.Email.ToLower())) + if (this.PortalSettings.Registration.UseEmailAsUserName && (this.User.Username.ToLower() != this.User.Email.ToLower())) { - UserController.ChangeUsername(User.UserID, User.Email); + UserController.ChangeUsername(this.User.UserID, this.User.Email); } - OnUserUpdated(EventArgs.Empty); - OnUserUpdateCompleted(EventArgs.Empty); + this.OnUserUpdated(EventArgs.Empty); + this.OnUserUpdateCompleted(EventArgs.Empty); } catch (Exception exc) { Logger.Error(exc); - var args = new UserUpdateErrorArgs(User.UserID, User.Username, "EmailError"); - OnUserUpdateError(args); + var args = new UserUpdateErrorArgs(this.User.UserID, this.User.Username, "EmailError"); + this.OnUserUpdateError(args); } } } diff --git a/DNN Platform/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs index e17717259fb..9e0316ee67e 100644 --- a/DNN Platform/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/UrlManagement/UrlProviderSettings.ascx.cs @@ -17,40 +17,40 @@ public partial class ProviderSettings : ModuleUserControlBase { private int _providerId; private IExtensionUrlProviderSettingsControl _providerSettingsControl; - private string DisplayMode => (Request.QueryString["Display"] ?? "").ToLowerInvariant(); + private string DisplayMode => (this.Request.QueryString["Display"] ?? "").ToLowerInvariant(); private readonly INavigationManager _navigationManager; public ProviderSettings() { - _navigationManager = Globals.DependencyProvider.GetService(); + this._navigationManager = Globals.DependencyProvider.GetService(); } protected override void OnInit(EventArgs e) { base.OnInit(e); - cmdUpdate.Click += cmdUpdate_Click; - cmdCancel.Click += cmdCancel_Click; + this.cmdUpdate.Click += this.cmdUpdate_Click; + this.cmdCancel.Click += this.cmdCancel_Click; - _providerId = Convert.ToInt32(Request.Params["ProviderId"]); + this._providerId = Convert.ToInt32(this.Request.Params["ProviderId"]); - var provider = ExtensionUrlProviderController.GetModuleProviders(ModuleContext.PortalId) - .SingleOrDefault(p => p.ProviderConfig.ExtensionUrlProviderId == _providerId); + var provider = ExtensionUrlProviderController.GetModuleProviders(this.ModuleContext.PortalId) + .SingleOrDefault(p => p.ProviderConfig.ExtensionUrlProviderId == this._providerId); if (provider != null) { var settingsControlSrc = provider.ProviderConfig.SettingsControlSrc; - var settingsControl = Page.LoadControl(settingsControlSrc); + var settingsControl = this.Page.LoadControl(settingsControlSrc); - providerSettingsPlaceHolder.Controls.Add(settingsControl); + this.providerSettingsPlaceHolder.Controls.Add(settingsControl); // ReSharper disable SuspiciousTypeConversion.Global - _providerSettingsControl = settingsControl as IExtensionUrlProviderSettingsControl; + this._providerSettingsControl = settingsControl as IExtensionUrlProviderSettingsControl; // ReSharper restore SuspiciousTypeConversion.Global - if (_providerSettingsControl != null) + if (this._providerSettingsControl != null) { - _providerSettingsControl.Provider = provider.ProviderConfig; + this._providerSettingsControl.Provider = provider.ProviderConfig; } } } @@ -58,20 +58,20 @@ protected override void OnInit(EventArgs e) protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (_providerSettingsControl != null) + if (this._providerSettingsControl != null) { - _providerSettingsControl.LoadSettings(); + this._providerSettingsControl.LoadSettings(); } - if (DisplayMode == "editor" || DisplayMode == "settings") + if (this.DisplayMode == "editor" || this.DisplayMode == "settings") { - cmdCancel.Visible = false; + this.cmdCancel.Visible = false; } } void cmdCancel_Click(object sender, EventArgs e) { - Response.Redirect(_navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID)); + this.Response.Redirect(this._navigationManager.NavigateURL(this.ModuleContext.PortalSettings.ActiveTab.TabID)); } void cmdUpdate_Click(object sender, EventArgs e) @@ -81,18 +81,18 @@ void cmdUpdate_Click(object sender, EventArgs e) return; } - if (_providerSettingsControl != null) + if (this._providerSettingsControl != null) { - var settings = _providerSettingsControl.SaveSettings(); + var settings = this._providerSettingsControl.SaveSettings(); foreach (var setting in settings) { - ExtensionUrlProviderController.SaveSetting(_providerId, ModuleContext.PortalId, setting.Key, setting.Value); + ExtensionUrlProviderController.SaveSetting(this._providerId, this.ModuleContext.PortalId, setting.Key, setting.Value); } } - if (DisplayMode != "editor" && DisplayMode != "settings") + if (this.DisplayMode != "editor" && this.DisplayMode != "settings") { - Response.Redirect(_navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID)); + this.Response.Redirect(this._navigationManager.NavigateURL(this.ModuleContext.PortalSettings.ActiveTab.TabID)); } } } diff --git a/DNN Platform/Website/DesktopModules/Admin/ViewProfile/Settings.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/ViewProfile/Settings.ascx.cs index eb32f9cca06..503b92f1400 100644 --- a/DNN Platform/Website/DesktopModules/Admin/ViewProfile/Settings.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/ViewProfile/Settings.ascx.cs @@ -24,18 +24,18 @@ public override void LoadSettings() { try { - ClientAPI.AddButtonConfirm(cmdLoadDefault, Localization.GetString("LoadDefault.Confirm", LocalResourceFile)); - cmdLoadDefault.ToolTip = Localization.GetString("LoadDefault.Help", LocalResourceFile); + ClientAPI.AddButtonConfirm(this.cmdLoadDefault, Localization.GetString("LoadDefault.Confirm", this.LocalResourceFile)); + this.cmdLoadDefault.ToolTip = Localization.GetString("LoadDefault.Help", this.LocalResourceFile); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - if (!string.IsNullOrEmpty((string) TabModuleSettings["ProfileTemplate"])) + if (!string.IsNullOrEmpty((string) this.TabModuleSettings["ProfileTemplate"])) { - txtTemplate.Text = (string) TabModuleSettings["ProfileTemplate"]; + this.txtTemplate.Text = (string) this.TabModuleSettings["ProfileTemplate"]; } - if (Settings.ContainsKey("IncludeButton")) + if (this.Settings.ContainsKey("IncludeButton")) { - IncludeButton.Checked = Convert.ToBoolean(Settings["IncludeButton"]); + this.IncludeButton.Checked = Convert.ToBoolean(this.Settings["IncludeButton"]); } } } @@ -49,15 +49,15 @@ public override void LoadSettings() protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdLoadDefault.Click += cmdLoadDefault_Click; + this.cmdLoadDefault.Click += this.cmdLoadDefault_Click; } public override void UpdateSettings() { try { - ModuleController.Instance.UpdateTabModuleSetting(TabModuleId, "ProfileTemplate", txtTemplate.Text); - ModuleController.Instance.UpdateTabModuleSetting(TabModuleId, "IncludeButton", IncludeButton.Checked.ToString(CultureInfo.InvariantCulture)); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, "ProfileTemplate", this.txtTemplate.Text); + ModuleController.Instance.UpdateTabModuleSetting(this.TabModuleId, "IncludeButton", this.IncludeButton.Checked.ToString(CultureInfo.InvariantCulture)); } catch (Exception exc) { @@ -70,7 +70,7 @@ public override void UpdateSettings() protected void cmdLoadDefault_Click(object sender, EventArgs e) { - txtTemplate.Text = Localization.GetString("DefaultTemplate", LocalResourceFile); + this.txtTemplate.Text = Localization.GetString("DefaultTemplate", this.LocalResourceFile); } } } diff --git a/DNN Platform/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs b/DNN Platform/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs index fa10aa6d313..82b063c1735 100644 --- a/DNN Platform/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs +++ b/DNN Platform/Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx.cs @@ -36,7 +36,7 @@ public partial class ViewProfile : ProfileModuleUserControlBase private readonly INavigationManager _navigationManager; public ViewProfile() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } public override bool DisplayModule @@ -52,9 +52,9 @@ public bool IncludeButton get { var includeButton = true; - if (ModuleContext.Settings.ContainsKey("IncludeButton")) + if (this.ModuleContext.Settings.ContainsKey("IncludeButton")) { - includeButton = Convert.ToBoolean(ModuleContext.Settings["IncludeButton"]); + includeButton = Convert.ToBoolean(this.ModuleContext.Settings["IncludeButton"]); } return includeButton; } @@ -69,12 +69,12 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //throw 404 so that deleted profile is not reindexed - if(ProfileUser == null || ProfileUser.IsDeleted) + if(this.ProfileUser == null || this.ProfileUser.IsDeleted) { - UrlUtils.Handle404Exception(Response, PortalSettings.Current); + UrlUtils.Handle404Exception(this.Response, PortalSettings.Current); } - ProcessQuerystring(); + this.ProcessQuerystring(); JavaScript.RequestRegistration(CommonJs.jQuery); JavaScript.RequestRegistration(CommonJs.jQueryMigrate); @@ -92,89 +92,89 @@ protected override void OnLoad(EventArgs e) try { - if(Null.IsNull(ProfileUserId)) + if(Null.IsNull(this.ProfileUserId)) { - Visible = false; + this.Visible = false; return; } - var template = Convert.ToString(ModuleContext.Settings["ProfileTemplate"]); + var template = Convert.ToString(this.ModuleContext.Settings["ProfileTemplate"]); if(string.IsNullOrEmpty(template)) { - template = Localization.GetString("DefaultTemplate", LocalResourceFile); + template = Localization.GetString("DefaultTemplate", this.LocalResourceFile); } - var editUrl = _navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + ProfileUserId, "pageno=1"); - var profileUrl = _navigationManager.NavigateURL(ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + ProfileUserId, "pageno=2"); + var editUrl = this._navigationManager.NavigateURL(this.ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + this.ProfileUserId, "pageno=1"); + var profileUrl = this._navigationManager.NavigateURL(this.ModuleContext.PortalSettings.ActiveTab.TabID, "Profile", "userId=" + this.ProfileUserId, "pageno=2"); if (template.Contains("[BUTTON:EDITPROFILE]")) { - if (IncludeButton && IsUser) + if (this.IncludeButton && this.IsUser) { - string editHyperLink = String.Format("{1}", profileUrl, LocalizeString("Edit")); + string editHyperLink = String.Format("{1}", profileUrl, this.LocalizeString("Edit")); template = template.Replace("[BUTTON:EDITPROFILE]", editHyperLink); } - buttonPanel.Visible = false; + this.buttonPanel.Visible = false; } else { - buttonPanel.Visible = IncludeButton; - editLink.NavigateUrl = editUrl; + this.buttonPanel.Visible = this.IncludeButton; + this.editLink.NavigateUrl = editUrl; } if (template.Contains("[HYPERLINK:EDITPROFILE]")) { - if (IsUser) + if (this.IsUser) { - string editHyperLink = String.Format("{1}", profileUrl, LocalizeString("Edit")); + string editHyperLink = String.Format("{1}", profileUrl, this.LocalizeString("Edit")); template = template.Replace("[HYPERLINK:EDITPROFILE]", editHyperLink); } } if (template.Contains("[HYPERLINK:MYACCOUNT]")) { - if (IsUser) + if (this.IsUser) { - string editHyperLink = String.Format("{1}", editUrl, LocalizeString("MyAccount")); + string editHyperLink = String.Format("{1}", editUrl, this.LocalizeString("MyAccount")); template = template.Replace("[HYPERLINK:MYACCOUNT]", editHyperLink); } - buttonPanel.Visible = false; + this.buttonPanel.Visible = false; } - if (!IsUser && buttonPanel.Visible) + if (!this.IsUser && this.buttonPanel.Visible) { - buttonPanel.Visible = false; + this.buttonPanel.Visible = false; } - if (ProfileUser.Profile.ProfileProperties.Cast().Count(profProperty => profProperty.Visible) == 0) + if (this.ProfileUser.Profile.ProfileProperties.Cast().Count(profProperty => profProperty.Visible) == 0) { - noPropertiesLabel.Visible = true; - profileOutput.Visible = false; - pnlScripts.Visible = false; + this.noPropertiesLabel.Visible = true; + this.profileOutput.Visible = false; + this.pnlScripts.Visible = false; } else { if (template.IndexOf("[PROFILE:PHOTO]") > -1) { var profileImageHandlerBasedURL = - UserController.Instance?.GetUserProfilePictureUrl(ProfileUserId, 120, 120); + UserController.Instance?.GetUserProfilePictureUrl(this.ProfileUserId, 120, 120); template = template.Replace("[PROFILE:PHOTO]", profileImageHandlerBasedURL); } - var token = new TokenReplace { User = ProfileUser, AccessingUser = ModuleContext.PortalSettings.UserInfo }; - profileOutput.InnerHtml = token.ReplaceEnvironmentTokens(template); - noPropertiesLabel.Visible = false; - profileOutput.Visible = true; + var token = new TokenReplace { User = this.ProfileUser, AccessingUser = this.ModuleContext.PortalSettings.UserInfo }; + this.profileOutput.InnerHtml = token.ReplaceEnvironmentTokens(template); + this.noPropertiesLabel.Visible = false; + this.profileOutput.Visible = true; } - var propertyAccess = new ProfilePropertyAccess(ProfileUser); + var propertyAccess = new ProfilePropertyAccess(this.ProfileUser); StringBuilder sb = new StringBuilder(); bool propertyNotFound = false; - foreach (ProfilePropertyDefinition property in ProfileUser.Profile.ProfileProperties) + foreach (ProfilePropertyDefinition property in this.ProfileUser.Profile.ProfileProperties) { var displayDataType = ProfilePropertyAccess.DisplayDataType(property).ToLowerInvariant(); string value = propertyAccess.GetProperty(property.PropertyName, String.Empty, Thread.CurrentThread.CurrentUICulture, - ModuleContext.PortalSettings.UserInfo, + this.ModuleContext.PortalSettings.UserInfo, Scope.DefaultSettings, ref propertyNotFound); @@ -184,7 +184,7 @@ protected override void OnLoad(EventArgs e) sb.Append("\""); if (!string.IsNullOrEmpty(value)) { - value = Localization.GetSafeJSString(displayDataType == "richtext" ? value : Server.HtmlDecode(value)); + value = Localization.GetSafeJSString(displayDataType == "richtext" ? value : this.Server.HtmlDecode(value)); value = value .Replace("\r", string.Empty) .Replace("\n", " ") @@ -200,22 +200,22 @@ protected override void OnLoad(EventArgs e) sb.Append('\n'); } - string email = (ProfileUserId == ModuleContext.PortalSettings.UserId - || ModuleContext.PortalSettings.UserInfo.IsInRole(ModuleContext.PortalSettings.AdministratorRoleName)) - ? ProfileUser.Email + string email = (this.ProfileUserId == this.ModuleContext.PortalSettings.UserId + || this.ModuleContext.PortalSettings.UserInfo.IsInRole(this.ModuleContext.PortalSettings.AdministratorRoleName)) + ? this.ProfileUser.Email : String.Empty; sb.Append("self.Email = ko.observable('"); - email = Localization.GetSafeJSString(Server.HtmlDecode(email)); + email = Localization.GetSafeJSString(this.Server.HtmlDecode(email)); email = email.Replace(";", string.Empty).Replace("//", string.Empty); sb.Append(email + "');"); sb.Append('\n'); sb.Append("self.EmailText = '"); - sb.Append(LocalizeString("Email") + "';"); + sb.Append(this.LocalizeString("Email") + "';"); sb.Append('\n'); - ProfileProperties = sb.ToString(); + this.ProfileProperties = sb.ToString(); } @@ -233,16 +233,16 @@ protected override void OnLoad(EventArgs e) private string GetRedirectUrl() { //redirect user to default page if not specific the home tab, do this action to prevent loop redirect. - var homeTabId = ModuleContext.PortalSettings.HomeTabId; + var homeTabId = this.ModuleContext.PortalSettings.HomeTabId; string redirectUrl; if (homeTabId > Null.NullInteger) { - redirectUrl = _navigationManager.NavigateURL(homeTabId); + redirectUrl = this._navigationManager.NavigateURL(homeTabId); } else { - redirectUrl = Globals.GetPortalDomainName(PortalSettings.Current.PortalAlias.HTTPAlias, Request, true) + + redirectUrl = Globals.GetPortalDomainName(PortalSettings.Current.PortalAlias.HTTPAlias, this.Request, true) + "/" + Globals.glbDefaultPage; } @@ -253,20 +253,20 @@ private void ProcessQuerystring() { //in case someone is being redirected to here from an e-mail link action we need to process that here - var action = Request.QueryString["action"]; + var action = this.Request.QueryString["action"]; - if (!Request.IsAuthenticated && !string.IsNullOrEmpty(action)) //action requested but not logged in. + if (!this.Request.IsAuthenticated && !string.IsNullOrEmpty(action)) //action requested but not logged in. { - string loginUrl = Common.Globals.LoginURL(Request.RawUrl, false); - Response.Redirect(loginUrl); + string loginUrl = Common.Globals.LoginURL(this.Request.RawUrl, false); + this.Response.Redirect(loginUrl); } - if (Request.IsAuthenticated && !string.IsNullOrEmpty(action) ) // only process this for authenticated requests + if (this.Request.IsAuthenticated && !string.IsNullOrEmpty(action) ) // only process this for authenticated requests { //current user, i.e. the one that the request was for var currentUser = UserController.Instance.GetCurrentUserInfo(); // the initiating user,i.e. the one who wanted to be friend // note that in this case here currentUser is visiting the profile of initiatingUser, most likely from a link in the notification e-mail - var initiatingUser = UserController.Instance.GetUserById(PortalSettings.Current.PortalId, Convert.ToInt32(Request.QueryString["UserID"])); + var initiatingUser = UserController.Instance.GetUserById(PortalSettings.Current.PortalId, Convert.ToInt32(this.Request.QueryString["UserID"])); if (initiatingUser.UserID == currentUser.UserID) { @@ -302,7 +302,7 @@ private void ProcessQuerystring() } } - Response.Redirect(Common.Globals.UserProfileURL(initiatingUser.UserID)); + this.Response.Redirect(Common.Globals.UserProfileURL(initiatingUser.UserID)); } } diff --git a/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs b/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs index 0aebc853063..8b537dc5b4b 100644 --- a/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs +++ b/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Login.ascx.cs @@ -39,7 +39,7 @@ public partial class Login : AuthenticationLoginBase public Login() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Protected Properties @@ -51,7 +51,7 @@ protected bool UseCaptcha { get { - return AuthenticationConfig.GetConfig(PortalId).UseCaptcha; + return AuthenticationConfig.GetConfig(this.PortalId).UseCaptcha; } } @@ -67,7 +67,7 @@ public override bool Enabled { get { - return AuthenticationConfig.GetConfig(PortalId).Enabled; + return AuthenticationConfig.GetConfig(this.PortalId).Enabled; } } @@ -79,131 +79,131 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdLogin.Click += OnLoginClick; + this.cmdLogin.Click += this.OnLoginClick; - cancelLink.NavigateUrl = GetRedirectUrl(false); + this.cancelLink.NavigateUrl = this.GetRedirectUrl(false); - if (PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration) + if (this.PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration) { - liRegister.Visible = false; + this.liRegister.Visible = false; } - lblLogin.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_LOGIN_INSTRUCTIONS"); - if (string.IsNullOrEmpty(lblLogin.Text)) + this.lblLogin.Text = Localization.GetSystemMessage(this.PortalSettings, "MESSAGE_LOGIN_INSTRUCTIONS"); + if (string.IsNullOrEmpty(this.lblLogin.Text)) { - lblLogin.AssociatedControlID = string.Empty; + this.lblLogin.AssociatedControlID = string.Empty; } - if (Request.QueryString["usernameChanged"] == "true") + if (this.Request.QueryString["usernameChanged"] == "true") { - DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetSystemMessage(PortalSettings, "MESSAGE_USERNAME_CHANGED_INSTRUCTIONS"), ModuleMessage.ModuleMessageType.BlueInfo); + DotNetNuke.UI.Skins.Skin.AddModuleMessage(this, Localization.GetSystemMessage(this.PortalSettings, "MESSAGE_USERNAME_CHANGED_INSTRUCTIONS"), ModuleMessage.ModuleMessageType.BlueInfo); } - var returnUrl = _navigationManager.NavigateURL(); + var returnUrl = this._navigationManager.NavigateURL(); string url; - if (PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) + if (this.PortalSettings.UserRegistration != (int)Globals.PortalRegistrationType.NoRegistration) { - if (!string.IsNullOrEmpty(UrlUtils.ValidReturnUrl(Request.QueryString["returnurl"]))) + if (!string.IsNullOrEmpty(UrlUtils.ValidReturnUrl(this.Request.QueryString["returnurl"]))) { - returnUrl = Request.QueryString["returnurl"]; + returnUrl = this.Request.QueryString["returnurl"]; } returnUrl = HttpUtility.UrlEncode(returnUrl); url = Globals.RegisterURL(returnUrl, Null.NullString); - registerLink.NavigateUrl = url; - if (PortalSettings.EnablePopUps && PortalSettings.RegisterTabId == Null.NullInteger + this.registerLink.NavigateUrl = url; + if (this.PortalSettings.EnablePopUps && this.PortalSettings.RegisterTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this)) { - registerLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(url, this, PortalSettings, true, false, 600, 950)); + this.registerLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(url, this, this.PortalSettings, true, false, 600, 950)); } } else { - registerLink.Visible = false; + this.registerLink.Visible = false; } //see if the portal supports persistant cookies - chkCookie.Visible = Host.RememberCheckbox; + this.chkCookie.Visible = Host.RememberCheckbox; // no need to show password link if feature is disabled, let's check this first if (MembershipProviderConfig.PasswordRetrievalEnabled || MembershipProviderConfig.PasswordResetEnabled) { - url = _navigationManager.NavigateURL("SendPassword", "returnurl=" + returnUrl); - passwordLink.NavigateUrl = url; - if (PortalSettings.EnablePopUps) + url = this._navigationManager.NavigateURL("SendPassword", "returnurl=" + returnUrl); + this.passwordLink.NavigateUrl = url; + if (this.PortalSettings.EnablePopUps) { - passwordLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(url, this, PortalSettings, true, false, 300, 650)); + this.passwordLink.Attributes.Add("onclick", "return " + UrlUtils.PopUpUrl(url, this, this.PortalSettings, true, false, 300, 650)); } } else { - passwordLink.Visible = false; + this.passwordLink.Visible = false; } - if (!IsPostBack) + if (!this.IsPostBack) { - if (!string.IsNullOrEmpty(Request.QueryString["verificationcode"]) && PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.VerifiedRegistration) + if (!string.IsNullOrEmpty(this.Request.QueryString["verificationcode"]) && this.PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.VerifiedRegistration) { - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - Controls.Clear(); + this.Controls.Clear(); } - var verificationCode = Request.QueryString["verificationcode"]; + var verificationCode = this.Request.QueryString["verificationcode"]; try { UserController.VerifyUser(verificationCode.Replace(".", "+").Replace("-", "/").Replace("_", "=")); - var redirectTabId = PortalSettings.Registration.RedirectAfterRegistration; + var redirectTabId = this.PortalSettings.Registration.RedirectAfterRegistration; - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - Response.Redirect(_navigationManager.NavigateURL(redirectTabId > 0 ? redirectTabId : PortalSettings.HomeTabId, string.Empty, "VerificationSuccess=true"), true); + this.Response.Redirect(this._navigationManager.NavigateURL(redirectTabId > 0 ? redirectTabId : this.PortalSettings.HomeTabId, string.Empty, "VerificationSuccess=true"), true); } else { if (redirectTabId > 0) { - var redirectUrl = _navigationManager.NavigateURL(redirectTabId, string.Empty, "VerificationSuccess=true"); - redirectUrl = redirectUrl.Replace(Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias), string.Empty); - Response.Cookies.Add(new HttpCookie("returnurl", redirectUrl) { Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }); + var redirectUrl = this._navigationManager.NavigateURL(redirectTabId, string.Empty, "VerificationSuccess=true"); + redirectUrl = redirectUrl.Replace(Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias), string.Empty); + this.Response.Cookies.Add(new HttpCookie("returnurl", redirectUrl) { Path = (!string.IsNullOrEmpty(Globals.ApplicationPath) ? Globals.ApplicationPath : "/") }); } - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("VerificationSuccess", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("VerificationSuccess", this.LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess); } } catch (UserAlreadyVerifiedException) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("UserAlreadyVerified", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("UserAlreadyVerified", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } catch (InvalidVerificationCodeException) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InvalidVerificationCode", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InvalidVerificationCode", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } catch (UserDoesNotExistException) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("UserDoesNotExist", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("UserDoesNotExist", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } catch (Exception) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InvalidVerificationCode", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("InvalidVerificationCode", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } } } - if (!Request.IsAuthenticated) + if (!this.Request.IsAuthenticated) { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { try { - if (Request.QueryString["username"] != null) + if (this.Request.QueryString["username"] != null) { - txtUsername.Text = Request.QueryString["username"]; + this.txtUsername.Text = this.Request.QueryString["username"]; } } catch (Exception ex) @@ -214,7 +214,7 @@ protected override void OnLoad(EventArgs e) } try { - Globals.SetFormFocus(string.IsNullOrEmpty(txtUsername.Text) ? txtUsername : txtPassword); + Globals.SetFormFocus(string.IsNullOrEmpty(this.txtUsername.Text) ? this.txtUsername : this.txtPassword); } catch (Exception ex) { @@ -224,29 +224,29 @@ protected override void OnLoad(EventArgs e) } } - var registrationType = PortalSettings.Registration.RegistrationFormType; + var registrationType = this.PortalSettings.Registration.RegistrationFormType; bool useEmailAsUserName; if (registrationType == 0) { - useEmailAsUserName = PortalSettings.Registration.UseEmailAsUserName; + useEmailAsUserName = this.PortalSettings.Registration.UseEmailAsUserName; } else { - var registrationFields = PortalSettings.Registration.RegistrationFields; + var registrationFields = this.PortalSettings.Registration.RegistrationFields; useEmailAsUserName = !registrationFields.Contains("Username"); } - plUsername.Text = LocalizeString(useEmailAsUserName ? "Email" : "Username"); - divCaptcha1.Visible = UseCaptcha; - divCaptcha2.Visible = UseCaptcha; + this.plUsername.Text = this.LocalizeString(useEmailAsUserName ? "Email" : "Username"); + this.divCaptcha1.Visible = this.UseCaptcha; + this.divCaptcha2.Visible = this.UseCaptcha; } private void OnLoginClick(object sender, EventArgs e) { - if ((UseCaptcha && ctlCaptcha.IsValid) || !UseCaptcha) + if ((this.UseCaptcha && this.ctlCaptcha.IsValid) || !this.UseCaptcha) { var loginStatus = UserLoginStatus.LOGIN_FAILURE; - string userName = PortalSecurity.Instance.InputFilter(txtUsername.Text, + string userName = PortalSecurity.Instance.InputFilter(this.txtUsername.Text, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup); @@ -254,12 +254,12 @@ private void OnLoginClick(object sender, EventArgs e) //DNN-6093 //check if we use email address here rather than username UserInfo userByEmail = null; - var emailUsedAsUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); + var emailUsedAsUsername = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false); if (emailUsedAsUsername) { // one additonal call to db to see if an account with that email actually exists - userByEmail = UserController.GetUserByEmail(PortalController.GetEffectivePortalId(PortalId), userName); + userByEmail = UserController.GetUserByEmail(PortalController.GetEffectivePortalId(this.PortalId), userName); if (userByEmail != null) { @@ -272,7 +272,7 @@ private void OnLoginClick(object sender, EventArgs e) if (!emailUsedAsUsername || userByEmail != null) { - objUser = UserController.ValidateUser(PortalId, userName, txtPassword.Text, "DNN", string.Empty, PortalSettings.PortalName, IPAddress, ref loginStatus); + objUser = UserController.ValidateUser(this.PortalId, userName, this.txtPassword.Text, "DNN", string.Empty, this.PortalSettings.PortalName, this.IPAddress, ref loginStatus); } var authenticated = Null.NullBoolean; @@ -291,9 +291,9 @@ private void OnLoginClick(object sender, EventArgs e) { Authenticated = authenticated, Message = message, - RememberMe = chkCookie.Checked + RememberMe = this.chkCookie.Checked }; - OnUserAuthenticated(eventArgs); + this.OnUserAuthenticated(eventArgs); } } @@ -304,17 +304,17 @@ private void OnLoginClick(object sender, EventArgs e) protected string GetRedirectUrl(bool checkSettings = true) { var redirectUrl = ""; - var redirectAfterLogin = PortalSettings.Registration.RedirectAfterLogin; + var redirectAfterLogin = this.PortalSettings.Registration.RedirectAfterLogin; if (checkSettings && redirectAfterLogin > 0) //redirect to after registration page { - redirectUrl = _navigationManager.NavigateURL(redirectAfterLogin); + redirectUrl = this._navigationManager.NavigateURL(redirectAfterLogin); } else { - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to register - redirectUrl = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + redirectUrl = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. redirectUrl = UrlUtils.ValidReturnUrl(redirectUrl); @@ -332,7 +332,7 @@ protected string GetRedirectUrl(bool checkSettings = true) if (String.IsNullOrEmpty(redirectUrl)) { //redirect to current page - redirectUrl = _navigationManager.NavigateURL(); + redirectUrl = this._navigationManager.NavigateURL(); } } diff --git a/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Settings.ascx.cs b/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Settings.ascx.cs index 4a4b7a6e47c..a88c7e26540 100644 --- a/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Settings.ascx.cs +++ b/DNN Platform/Website/DesktopModules/AuthenticationServices/DNN/Settings.ascx.cs @@ -17,9 +17,9 @@ public partial class Settings : AuthenticationSettingsBase { public override void UpdateSettings() { - if (SettingsEditor.IsValid && SettingsEditor.IsDirty) + if (this.SettingsEditor.IsValid && this.SettingsEditor.IsDirty) { - var config = (AuthenticationConfig) SettingsEditor.DataSource; + var config = (AuthenticationConfig) this.SettingsEditor.DataSource; AuthenticationConfig.UpdateConfig(config); } } @@ -30,9 +30,9 @@ protected override void OnLoad(EventArgs e) try { - AuthenticationConfig config = AuthenticationConfig.GetConfig(PortalId); - SettingsEditor.DataSource = config; - SettingsEditor.DataBind(); + AuthenticationConfig config = AuthenticationConfig.GetConfig(this.PortalId); + this.SettingsEditor.DataSource = config; + this.SettingsEditor.DataBind(); } catch (Exception exc) { diff --git a/DNN Platform/Website/Documentation/Contributors.txt b/DNN Platform/Website/Documentation/Contributors.txt deleted file mode 100644 index e994c54f02b..00000000000 --- a/DNN Platform/Website/Documentation/Contributors.txt +++ /dev/null @@ -1,77 +0,0 @@ -Third Party Acknowledgements -============================================================================== - -Brian Bilbro ( bbilbro@hotmail.com ) -- Module Communicator code and architecture (http://aspalliance.com/bbilbro/DesktopDefault.aspx?tabindex=1&tabid=7&ArticleID=6 ) - -Atif Aziz -- SQLCommandGenerator - -Daniel Willmott -- Unauthenticated user - -Fredi Gertsch ( fredi@gerts.ch ) -- Tab Administrator - -Jon Henning - Solution Partners - (http://www.solpart.com) -- Solpart Menu - -John Dyer - Revjon Studios (http://www.revjon.com) -- FreeTextBox - -Robin Lilly, Vanessa Monzon, Mike Hernandez -- UTEP ADA Code Base - -Tom Trefz && Scott Willhite -- PopupCalendar.js (original by Tom, localization && Netscape by Scott) - -Richard Cox ( http://www.bydesignwebsights.com ) -- Search engine optimization at the Tab level ( Description, KeyWords, Title ) - -Dino Esposito ( http://weblogs.asp.net/despos ) -- Personalization architecture from MSDN magazine ( Cutting Edge - March 2004 ) - -Jeff Martin ( http://www.jeffmartin.com ) -- move ViewState to bottom of page for better search engine spidering - -Jonathan de Halleux ( http://www.dotnetwiki.org ) -- PA Installer - -David Haggard ( http://www.newcovenant.com ) -- function to obfuscate sensitive data to prevent collection by robots and spiders and crawlers - -Vicen?Masanas ( http://lacolla.europe.webmatrixhosting.net ) -- SMTP authentication - -Bert Corderman -- Several base classes for Exception Management in DNN 2.0 - -Joe Brinkman ( http://www.tag-software.net ) -- Module Action Menu concept - -Patrick Santry ( http://www.wwwcoder.com ) -- PayPal price checking and account checking - -M. Murali Dharan ( http://www.phpbuilder.com/columns/dhar20040217.php3 ) -- Search Engine Concepts - -Craig Dunn ( http://users.bigpond.com/conceptdevelopment/ ) -- Search Engine Concepts ( Searcharoo ) - -Stan Schultes ( http://www.csnetexpert.com ) -- RSS Generator ( Visual Studio Magazine - April 2004 ) - -James Clarkson ( http://www.blogolith.com ) -- Favicon per portal - -Scott Mitchell ( http://4guysfromrolla.com ) -- URL Rewriting - -Scott Stokes ( http://www.adverageous.com ) -- File Manager UI ( based on DNNExplorer ) - -Michael Beller ( http://www.lightshippartners.com ) -- Database model for abstraction and refactoring of the core database - -Sebastian Leupold ( http://www.gamma-concept.de ) -- German resource files diff --git a/DNN Platform/Website/Documentation/License.txt b/DNN Platform/Website/Documentation/License.txt deleted file mode 100644 index d12b262792a..00000000000 --- a/DNN Platform/Website/Documentation/License.txt +++ /dev/null @@ -1,9 +0,0 @@ -DotNetNuke - http://www.dnnsoftware.com -Copyright (c) 2002-2018 -by DNN Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/DNN Platform/Website/Documentation/Readme.txt b/DNN Platform/Website/Documentation/Readme.txt deleted file mode 100644 index 89f4f1b2919..00000000000 --- a/DNN Platform/Website/Documentation/Readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -About DNN Platform -The DNN Platform Installation Guide can be found here: https://dnndocs.com/ -For DNN Community Help and Support visit https://dnncommunity.org/ diff --git a/DNN Platform/Website/Documentation/StarterKit/Documents.css b/DNN Platform/Website/Documentation/StarterKit/Documents.css deleted file mode 100644 index 62d028ea436..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/Documents.css +++ /dev/null @@ -1,82 +0,0 @@ - -Body, A -{ - font-family: Verdana, Arial, Helvetica, Sans Serif; - font-size: 10pt; - font-weight: normal; - color: black; -} - -Body -{ - background-color: white; - margin-left:25px; -} - -H1 -{ - font-size: 2.0em; - font-weight: bold; - color: #75808A; - text-decoration: underline; -} - -H2 { - font-size: 1.6em; - font-weight: bold; - color: #75808A; -} - -H3 { - font-size: 1.4em; - font-weight: bold; - color: #75808A; -} - -H4 { - font-size: 1.2em; - font-weight: bold; - color: #75808A; -} - -H5 { - font-size: 1.1em; - font-weight: bold; - color: #75808A; -} - -H6 { - font-size: 1.0em; - font-weight: bold; - color: #75808A; -} - -A:link { - font-size: 1.0em; - text-decoration: underline; - color: #0000cc; -} - -A:visited { - font-size: 1.0em; - text-decoration: underline; - color: #0000cc; -} - -A:active { - font-size: 1.0em; - text-decoration: underline; - color: #0000cc; -} - -A:hover { - font-size: 1.0em; - text-decoration: underline; - color: #cc0000; -} - -HR { - color: dimgrey; - height:1pt; - text-align:left -} diff --git a/DNN Platform/Website/Documentation/StarterKit/NTFSConfig.html b/DNN Platform/Website/Documentation/StarterKit/NTFSConfig.html deleted file mode 100644 index 9e1da57c967..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/NTFSConfig.html +++ /dev/null @@ -1,26 +0,0 @@ - - - DotNetNuke - - - - -

    Configuring NTFS File Permissions for DotNetNuke

    -

    This section includes more detailed information on how to configure NTFS - File permissions for use with DotNetNuke.

    -

    1. There are two ways in which you can configure the NTFS File permissions.  - In Internet Information Services (IIS) Manager, choose the website and select Permissions.

    -

    -

    or in File Explorer select the Physical Directory for the Website and .

    -

    -

    2. In the Security dialog select the account (NETWORK SERVICE in Windows 2003, ASPNET - in Windows 2000), and give the account Read,Write and Change permissions to the - folder..

    -

    - -

    -

    Back to Welcome page.

    -
    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/SQLServer2005Config.html b/DNN Platform/Website/Documentation/StarterKit/SQLServer2005Config.html deleted file mode 100644 index 81e758adf62..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/SQLServer2005Config.html +++ /dev/null @@ -1,33 +0,0 @@ - - - DotNetNuke - - - - -

    Configuring SQL Server 2005 for DotNetNuke

    -

    This section includes more detailed information on how to create and configure a SQL Server 2005 database for use with DotNetNuke.

    -

    1. In SQL Server Management Studio, in the Object Explorer, Select Databases for - the SQL Server instance you wish to use, right-click and select the New Database - option.

    -

    -

    2. In the New Database dialog give the Database a name (in the example below the - Databse is called Website), and click OK.

    -

    -

    3. If you decide to use SQL Server Authorization then you will need to use a SQL - Server Login.  If you do not already have one created then you can create one - by selecting Logins under Security, right click and select New Login.

    -

    -

    4. Once you have created a Login you need to add that "Login" as a User for your new Database.  To do this select the Database you just created, select the - Users section, right click on Users and select the New Database User option.  - In the example shown below we are using the Database - DotNetNuke.

    -

    -

    5. Enter the Login name in the text box, or choose the login name by clicking the - elipsis button (...), make sure that the db_owner role, and Schema are selected, and click OK

    -

    -

    Your database is now ready to be installed.

    -

    Back to Welcome page.

    -
    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/SQLServerConfig.html b/DNN Platform/Website/Documentation/StarterKit/SQLServerConfig.html deleted file mode 100644 index 23ee89caab9..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/SQLServerConfig.html +++ /dev/null @@ -1,31 +0,0 @@ - - - DotNetNuke - - - - -

    Configuring SQL Server 2000 for DotNetNuke

    -

    This section includes more detailed information on how to create and configure a SQL Server 2000 database for use with DotNetNuke.

    -

    1. In Enterprise Manager, Select Databases, right-click and select the New Database - option.

    -

    -

    2. In the Database Properties give the Database a name (in the example below the - Databse is called Website), and click OK.

    -

    -

    3. If you decide to use SQL Server Authorization then you will need to use a SQL - Server Login.  If you do not already have one created then you can create one - by selecting Logins under Security, right click and select New Login.

    -

    -

    4. Once you have created a Login you need to add that "Login" as a User for your new Database.  To do this select the Database you just created, select the - Users section, right click on Users and select the New Database User option.

    -

    -

    5. Select the Login name from the combo box - this will automatically populate the - User name field, make sure that the db_owner role is selected, and click OK

    -

    -

    Your database is now ready to be installed.

    -

    Back to Welcome page.

    -
    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/SQLServerXpressConfig.html b/DNN Platform/Website/Documentation/StarterKit/SQLServerXpressConfig.html deleted file mode 100644 index beaf9e31970..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/SQLServerXpressConfig.html +++ /dev/null @@ -1,22 +0,0 @@ - - - DotNetNuke - - - - -

    Configuring SQL Server 2005 Express for DotNetNuke

    -

    This section includes more detailed information on how to create a SQL Server 2005 Express Database file for use with DotNetNuke.

    -

    1. In Solution Explorer select the App_Data folder, right-click on the folder and select Add New Item....

    -

    -

    2. In the Add New Item Dialog, select SQL Database, and click Add

    -

    -

    - The default database name is Database.mdf. If you decide to use a - different filename you will have to edit the connection string in web.config. -

    -

    Back to Welcome page.

    -
    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/TemplateConfig.html b/DNN Platform/Website/Documentation/StarterKit/TemplateConfig.html deleted file mode 100644 index 90191ac127d..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/TemplateConfig.html +++ /dev/null @@ -1,16 +0,0 @@ - - - DotNetNuke - - - - -

    Configuring the Install Template for DotNetNuke

    -

    This section includes more detailed information on how to configure the install template - for  DotNetNuke.

    -

    1. .

    -

    Back to Welcome page.

    -
    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/WebServerConfig.html b/DNN Platform/Website/Documentation/StarterKit/WebServerConfig.html deleted file mode 100644 index 7bdca84b169..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/WebServerConfig.html +++ /dev/null @@ -1,28 +0,0 @@ - - - DotNetNuke - - - - -

    Configuring Internet Information Server (IIS)

    -

    When creating a DotNetNuke website, for the most part you can use the default configuration - options.  However, if you wish to modify the configuration, this section includes more detailed information on how to configure Internet Information - Server (IIS) - for use with DotNetNuke.

    -

    1. In Internet Information Services (IIS) Manager, select Websites, right-click on - the site you wish to configure and select the Properties - option.

    -

    -

    2. In the Properties dialog, you can configure the physical directory used for this - wesbite, as well as the Application settings

    -

    -

    3. On the ASp.NET tab of the Properties dialog, you can choose the version of ASP.NET - you wish to use, as well as edit some of the web.config properties (using the Edit - Configuration button).

    -

    -

    Back to Welcome page.

    -
    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/Welcome.html b/DNN Platform/Website/Documentation/StarterKit/Welcome.html deleted file mode 100644 index f97cde1693f..00000000000 --- a/DNN Platform/Website/Documentation/StarterKit/Welcome.html +++ /dev/null @@ -1,104 +0,0 @@ - - - DotNetNuke - - - - -

    DotNetNuke?Web Application Framework ($safeprojectname$)

    -

    Introduction

    -

    Congratulations! You have created your own DotNetNuke project.  Please - take a few minutes to read this document, as it will help you install and configure - your new website.

    -

    Quick Installation

    -

    In order to make your experience with DotNetNuke as productive as possible, we have optimized the number of installation steps required for web developers.

    -

    - As long as you selected the default options for creating a web project in Visual Studio 2005 - ( selected "File System" as the Location: for your website ) and want to use the default SQL Server 2005 Express database included with the application, - you simpy need to press Ctrl-F5 (ie. hold the Ctrl key down while clicking on the F5 function key) in order to complete your installation. - The application may take a few minutes to build and you may find it useful to monitor the build progress output - ( select View / Output or CTRL-ALT-O within Visual Studio 2005 ). When your web browser loads the initial Installation screen, you must choose the Auto Installation option to successfully complete the process. -

    -
    -

    Advanced Installation

    -

    For those developers are not satisfied with the default options used in the Quick Installation option above - or perhaps want a little more control over the installation process, - we have included Advanced Installation instrustions to cover the most common customizations. -

    - -

    1. Create/Configure Database

    -

    DotNetNuke is a dynamic web application; therefore, you must create/configure a Database.  The default - connection string provided assumes that you will be using a SQL Server - 2005 Express database file called Database.mdf.

    -

    Data Source=.\SQLExpress;
    - Integrated Security=True;
    - User Instance=True;
    - AttachDBFilename=|DataDirectory|Database.mdf;  

    -

    If you would like instructions on creating a SQL Server Express 2005 Database file with a different name then see SQL Server 2005 Express Configuration.

    -

    If you would like to use a standard SQL Server 2000 or SQL Server 2005 Database then - you will need to create and configure one before proceeding.  You will also need to decide on the credentials used to access the Database you created.  - You can use Integrated Security (credentials based on your Windows User Account), - or you can use SQL Server's own security.  Again, the default connection string - assumes the latter.  For more information, on setting up a SQL Server Database - see SQL Server 2000 Configuration or SQL Server 2005 Configuration.

    -

    2. Edit the Connection String in web.config

    -

    Once you have created your database you will need to hook up the connection string in - web.config. There are TWO places in web.config where you need to verify the connection string.  - In the <connectionStrings> node:

    -

     

    -

    and under the <appSettings> node

    -

     

    -

    (Note that the connection string attributes includes line-breaks to make them - more readable - the - actual string must be on one line.)

    -

    The examples shown above are for the default SQL Server 2005 Express database file - "Database.mdf".  If you used - a different filename for the database file, you need to change the AttachDBFilename=|DataDirectory|Database.mdf; section.

    -

    To use a SQL Server 2000 or 2005 database replace the whole connection string by - something similar to

    -

    Server=(local);Database=DatabaseName;uid=LoginName;pwd=LoginPassword;

    -

    3. Configure the Web Server

    -

    For the most part, you should not need to configure your web server.  It does - not matter whether you selected the File System (default) or HTTP (IIS) as the Location: for your web server. - In either case the default configurations should work.  - In fact the File System web server has no configuration options.  However, - if you would like further information on configuring IIS please see Configuring Internet Information Server (IIS).

    -

    4. Configure NTFS File Permissions

    -

    If you created your new project using the HTTP option (IIS) then you need to set - the permissions for the System Account used by ASP.NET.  This step is not neccessary - if you used the File System (default) option to create your new site.

    -

    The NETWORK SERVICE account (Windows 2003) or the ASPNET account (Windows 2000) must - be given Full Control on the Virtual Directory you are using.  For more information - see NTFS Permissions Configuration.

    -

    5. Choose a Site Template

    -

    DotNetNuke installations use a template to determine what content gets loaded when the site is first created.  - There are 4 templates available

    -
      -
    • DotNetNuke (default)
    • -
    • Personal
    • -
    • Club
    • -
    • Small Business
    • -
    -

    Under normal circumstances you do not need to do anything ( the site will install using the default template ), - but if you would like to install based on one of the alternate templates, or would - like more information on templates see Configuring the Install Template.

    -

    6. Install DotNetNuke

    -

    If you have completed the steps above, you are now ready to install your new - DotNetNuke site.  To install the site press Ctrl-F5 (ie hold the Ctrl key down while clicking on the F5 function key). The application may take a few minutes to build if this - is your first installation. In order to view the build progress you should select - View / Output ( CTRL- ALT-O ) from Visual Studio 2005.
    -   -

    -
    -

    Further Resources

    -

    The information in this page is only an overview of the DotNetNuke?Web Application Framework. For more information, visit www.dotnetnuke.com. -

    - - diff --git a/DNN Platform/Website/Documentation/StarterKit/images/AddDatabase.jpg b/DNN Platform/Website/Documentation/StarterKit/images/AddDatabase.jpg deleted file mode 100644 index b72d26d0ad5..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/AddDatabase.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/AppSetting.gif b/DNN Platform/Website/Documentation/StarterKit/images/AppSetting.gif deleted file mode 100644 index 11a1e496b0a..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/AppSetting.gif and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/App_Data.jpg b/DNN Platform/Website/Documentation/StarterKit/images/App_Data.jpg deleted file mode 100644 index 303bb4e4781..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/App_Data.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/ConnectionString.gif b/DNN Platform/Website/Documentation/StarterKit/images/ConnectionString.gif deleted file mode 100644 index 3c7f395559e..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/ConnectionString.gif and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/Database2005Properties.jpg b/DNN Platform/Website/Documentation/StarterKit/images/Database2005Properties.jpg deleted file mode 100644 index 668f2d6ee6c..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/Database2005Properties.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/DatabaseProperties.jpg b/DNN Platform/Website/Documentation/StarterKit/images/DatabaseProperties.jpg deleted file mode 100644 index a527107975c..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/DatabaseProperties.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/EditWeb.jpg b/DNN Platform/Website/Documentation/StarterKit/images/EditWeb.jpg deleted file mode 100644 index 6ba663d8690..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/EditWeb.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/FileSecurity.jpg b/DNN Platform/Website/Documentation/StarterKit/images/FileSecurity.jpg deleted file mode 100644 index f63f2130dbc..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/FileSecurity.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/IISPermissions.jpg b/DNN Platform/Website/Documentation/StarterKit/images/IISPermissions.jpg deleted file mode 100644 index c0338eb198a..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/IISPermissions.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/NTFSPermissions.jpg b/DNN Platform/Website/Documentation/StarterKit/images/NTFSPermissions.jpg deleted file mode 100644 index 6e57db9444f..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/NTFSPermissions.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/New2005Database.jpg b/DNN Platform/Website/Documentation/StarterKit/images/New2005Database.jpg deleted file mode 100644 index 23428417e9f..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/New2005Database.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/New2005Login.jpg b/DNN Platform/Website/Documentation/StarterKit/images/New2005Login.jpg deleted file mode 100644 index 28deb6bf299..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/New2005Login.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/New2005User.jpg b/DNN Platform/Website/Documentation/StarterKit/images/New2005User.jpg deleted file mode 100644 index 9a9db8484e8..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/New2005User.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/NewDatabase.jpg b/DNN Platform/Website/Documentation/StarterKit/images/NewDatabase.jpg deleted file mode 100644 index e7f1ec269a6..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/NewDatabase.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/NewLogin.jpg b/DNN Platform/Website/Documentation/StarterKit/images/NewLogin.jpg deleted file mode 100644 index 68a0296c1ac..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/NewLogin.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/NewUser.jpg b/DNN Platform/Website/Documentation/StarterKit/images/NewUser.jpg deleted file mode 100644 index 3d57b53ac75..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/NewUser.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/User2005Properties.jpg b/DNN Platform/Website/Documentation/StarterKit/images/User2005Properties.jpg deleted file mode 100644 index 3fdb954f5e7..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/User2005Properties.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/UserProperties.jpg b/DNN Platform/Website/Documentation/StarterKit/images/UserProperties.jpg deleted file mode 100644 index f7f14ec7974..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/UserProperties.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/WebProperties1.jpg b/DNN Platform/Website/Documentation/StarterKit/images/WebProperties1.jpg deleted file mode 100644 index 7f88bfb76c9..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/WebProperties1.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/WebProperties2.jpg b/DNN Platform/Website/Documentation/StarterKit/images/WebProperties2.jpg deleted file mode 100644 index 3f742d63ff8..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/WebProperties2.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/images/webconfig.jpg b/DNN Platform/Website/Documentation/StarterKit/images/webconfig.jpg deleted file mode 100644 index 50eaaa44ed2..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/images/webconfig.jpg and /dev/null differ diff --git a/DNN Platform/Website/Documentation/StarterKit/logo.gif b/DNN Platform/Website/Documentation/StarterKit/logo.gif deleted file mode 100644 index 64ab1765b65..00000000000 Binary files a/DNN Platform/Website/Documentation/StarterKit/logo.gif and /dev/null differ diff --git a/DNN Platform/Website/Documentation/TELERIK_EULA.pdf b/DNN Platform/Website/Documentation/TELERIK_EULA.pdf deleted file mode 100644 index 199299d26b2..00000000000 Binary files a/DNN Platform/Website/Documentation/TELERIK_EULA.pdf and /dev/null differ diff --git a/DNN Platform/Website/DotNetNuke.Website.csproj b/DNN Platform/Website/DotNetNuke.Website.csproj index 8b86892b3d4..741482e3919 100644 --- a/DNN Platform/Website/DotNetNuke.Website.csproj +++ b/DNN Platform/Website/DotNetNuke.Website.csproj @@ -626,6 +626,9 @@ + + stylecop.json + AuthenticationEditor.ascx @@ -3401,6 +3404,10 @@ + + + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/DNN Platform/Website/ErrorPage.aspx.cs b/DNN Platform/Website/ErrorPage.aspx.cs index 200524496f8..8285763aeef 100644 --- a/DNN Platform/Website/ErrorPage.aspx.cs +++ b/DNN Platform/Website/ErrorPage.aspx.cs @@ -41,20 +41,20 @@ private void ManageError(string status) { string errorMode = Config.GetCustomErrorMode(); - string errorMessage = HttpUtility.HtmlEncode(Request.QueryString["error"]); - string errorMessage2 = HttpUtility.HtmlEncode(Request.QueryString["error2"]); + string errorMessage = HttpUtility.HtmlEncode(this.Request.QueryString["error"]); + string errorMessage2 = HttpUtility.HtmlEncode(this.Request.QueryString["error2"]); string localizedMessage = Localization.Localization.GetString(status + ".Error", Localization.Localization.GlobalResourceFile); if (localizedMessage != null) { - localizedMessage = localizedMessage.Replace("src=\"images/403-3.gif\"", "src=\"" + ResolveUrl("~/images/403-3.gif") + "\""); + localizedMessage = localizedMessage.Replace("src=\"images/403-3.gif\"", "src=\"" + this.ResolveUrl("~/images/403-3.gif") + "\""); - if (!string.IsNullOrEmpty(errorMessage2) && ( (errorMode=="Off") || ( (errorMode=="RemoteOnly") && (Request.IsLocal) ) )) + if (!string.IsNullOrEmpty(errorMessage2) && ( (errorMode=="Off") || ( (errorMode=="RemoteOnly") && (this.Request.IsLocal) ) )) { - ErrorPlaceHolder.Controls.Add(new LiteralControl(string.Format(localizedMessage, errorMessage2))); + this.ErrorPlaceHolder.Controls.Add(new LiteralControl(string.Format(localizedMessage, errorMessage2))); } else { - ErrorPlaceHolder.Controls.Add(new LiteralControl(string.Format(localizedMessage, errorMessage))); + this.ErrorPlaceHolder.Controls.Add(new LiteralControl(string.Format(localizedMessage, errorMessage))); } } @@ -63,15 +63,15 @@ private void ManageError(string status) if (statusCode > -1) { - Response.StatusCode = statusCode; + this.Response.StatusCode = statusCode; } } protected override void OnInit(EventArgs e) { base.OnInit(e); - DefaultStylesheet.Attributes["href"] = ResolveUrl("~/Portals/_default/default.css"); - InstallStylesheet.Attributes["href"] = ResolveUrl("~/Install/install.css"); + this.DefaultStylesheet.Attributes["href"] = this.ResolveUrl("~/Portals/_default/default.css"); + this.InstallStylesheet.Attributes["href"] = this.ResolveUrl("~/Install/install.css"); } protected override void OnLoad(EventArgs e) @@ -84,36 +84,36 @@ protected override void OnLoad(EventArgs e) IFileInfo fileInfo = FileManager.Instance.GetFile(portalSettings.PortalId, portalSettings.LogoFile); if (fileInfo != null) { - headerImage.ImageUrl = FileManager.Instance.GetUrl(fileInfo); + this.headerImage.ImageUrl = FileManager.Instance.GetUrl(fileInfo); } } - headerImage.Visible = !string.IsNullOrEmpty(headerImage.ImageUrl); + this.headerImage.Visible = !string.IsNullOrEmpty(this.headerImage.ImageUrl); string localizedMessage; var security = PortalSecurity.Instance; - var status = security.InputFilter(Request.QueryString["status"], + var status = security.InputFilter(this.Request.QueryString["status"], PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoMarkup); if (!string.IsNullOrEmpty(status)) { - ManageError(status); + this.ManageError(status); } else { //get the last server error - var exc = Server.GetLastError(); + var exc = this.Server.GetLastError(); try { - if (Request.Url.LocalPath.ToLowerInvariant().EndsWith("installwizard.aspx")) + if (this.Request.Url.LocalPath.ToLowerInvariant().EndsWith("installwizard.aspx")) { - ErrorPlaceHolder.Controls.Add(new LiteralControl(HttpUtility.HtmlEncode(exc.ToString()))); + this.ErrorPlaceHolder.Controls.Add(new LiteralControl(HttpUtility.HtmlEncode(exc.ToString()))); } else { var lex = new PageLoadException(exc.Message, exc); Exceptions.LogException(lex); localizedMessage = Localization.Localization.GetString("Error.Text", Localization.Localization.GlobalResourceFile); - ErrorPlaceHolder.Controls.Add(new ErrorContainer(portalSettings, localizedMessage, lex).Container); + this.ErrorPlaceHolder.Controls.Add(new ErrorContainer(portalSettings, localizedMessage, lex).Container); } } catch @@ -121,14 +121,14 @@ protected override void OnLoad(EventArgs e) //No exception was found...you shouldn't end up here //unless you go to this aspx page URL directly localizedMessage = Localization.Localization.GetString("UnhandledError.Text", Localization.Localization.GlobalResourceFile); - ErrorPlaceHolder.Controls.Add(new LiteralControl(localizedMessage)); + this.ErrorPlaceHolder.Controls.Add(new LiteralControl(localizedMessage)); } - Response.StatusCode = 500; + this.Response.StatusCode = 500; } localizedMessage = Localization.Localization.GetString("Return.Text", Localization.Localization.GlobalResourceFile); - hypReturn.Text = localizedMessage; + this.hypReturn.Text = localizedMessage; } } } diff --git a/DNN Platform/Website/Install/App_LocalResources/Installwizard.aspx.resx b/DNN Platform/Website/Install/App_LocalResources/Installwizard.aspx.resx index b97cb2ae796..cadc7ee08be 100644 --- a/DNN Platform/Website/Install/App_LocalResources/Installwizard.aspx.resx +++ b/DNN Platform/Website/Install/App_LocalResources/Installwizard.aspx.resx @@ -210,7 +210,7 @@ for people using the product. All of the data is anonymous and for internal use Installation - <a class="videoLink" href="https://www.dnnsoftware.com/Resources/Training/Training-Videos/Installation.aspx" target="new">View Installation Video</a> + <a class="videoLink" href="https://dnncommunity.org/How-To/-Download-and-Install" target="new">Check DNN Comunity website</a> Checking database user has ability to perform necessary actions diff --git a/DNN Platform/Website/Install/Install.aspx.cs b/DNN Platform/Website/Install/Install.aspx.cs index b2055d04c3a..14992874059 100644 --- a/DNN Platform/Website/Install/Install.aspx.cs +++ b/DNN Platform/Website/Install/Install.aspx.cs @@ -44,21 +44,21 @@ private void ExecuteScripts() Upgrade.Upgrade.StartTimer(); //Write out Header - HtmlUtils.WriteHeader(Response, "executeScripts"); + HtmlUtils.WriteHeader(this.Response, "executeScripts"); - Response.Write("

    Execute Scripts Status Report

    "); - Response.Flush(); + this.Response.Write("

    Execute Scripts Status Report

    "); + this.Response.Flush(); string strProviderPath = DataProvider.Instance().GetProviderPath(); if (!strProviderPath.StartsWith("ERROR:")) { Upgrade.Upgrade.ExecuteScripts(strProviderPath); } - Response.Write("

    Execution Complete

    "); - Response.Flush(); + this.Response.Write("

    Execution Complete

    "); + this.Response.Flush(); //Write out Footer - HtmlUtils.WriteFooter(Response); + HtmlUtils.WriteFooter(this.Response); } private void InstallApplication() @@ -75,7 +75,7 @@ private void InstallApplication() if (String.IsNullOrEmpty(strError)) { //send a new request to the application to initiate step 2 - Response.Redirect(HttpContext.Current.Request.RawUrl, true); + this.Response.Redirect(HttpContext.Current.Request.RawUrl, true); } else { @@ -96,20 +96,20 @@ private void InstallApplication() if (synchConnectionString.Status == StepStatus.AppRestart) { //send a new request to the application to initiate step 2 - Response.Redirect(HttpContext.Current.Request.RawUrl, true); + this.Response.Redirect(HttpContext.Current.Request.RawUrl, true); } //Start Timer Upgrade.Upgrade.StartTimer(); //Write out Header - HtmlUtils.WriteHeader(Response, "install"); + HtmlUtils.WriteHeader(this.Response, "install"); //get path to script files string strProviderPath = DataProvider.Instance().GetProviderPath(); if (!strProviderPath.StartsWith("ERROR:")) { - if (!CheckPermissions()) + if (!this.CheckPermissions()) { return; } @@ -118,8 +118,8 @@ private void InstallApplication() { if (InstallBlocker.Instance.IsInstallInProgress()) { - WriteInstallationHeader(); - WriteInstallationInProgress(); + this.WriteInstallationHeader(); + this.WriteInstallationInProgress(); return; } RegisterInstallBegining(); @@ -164,9 +164,9 @@ private void InstallApplication() Logger.Error(strError); } - Response.Write("

    Installation Complete

    "); - Response.Write("

    Click Here To Access Your Site



    "); - Response.Flush(); + this.Response.Write("

    Installation Complete

    "); + this.Response.Write("

    Click Here To Access Your Site



    "); + this.Response.Flush(); //remove installwizard files Upgrade.Upgrade.DeleteInstallerFiles(); @@ -180,12 +180,12 @@ private void InstallApplication() else { //upgrade error - Response.Write("

    Upgrade Error: " + strProviderPath + "

    "); - Response.Flush(); + this.Response.Write("

    Upgrade Error: " + strProviderPath + "

    "); + this.Response.Flush(); } //Write out Footer - HtmlUtils.WriteFooter(Response); + HtmlUtils.WriteFooter(this.Response); } finally { @@ -206,12 +206,12 @@ private static void RegisterInstallEnd() private void WriteInstallationHeader() { - Response.Write("

    Version: " + Globals.FormatVersion(DotNetNukeContext.Current.Application.Version) + "

    "); - Response.Flush(); + this.Response.Write("

    Version: " + Globals.FormatVersion(DotNetNukeContext.Current.Application.Version) + "

    "); + this.Response.Flush(); - Response.Write("

    "); - Response.Write("

    Installation Status Report

    "); - Response.Flush(); + this.Response.Write("

    "); + this.Response.Write("

    Installation Status Report

    "); + this.Response.Flush(); } private void WriteInstallationInProgress() @@ -219,16 +219,16 @@ private void WriteInstallationInProgress() HtmlUtils.WriteFeedback(HttpContext.Current.Response, 0, Localization.Localization.GetString("ThereIsAInstallationCurrentlyInProgress.Error", Localization.Localization.GlobalResourceFile) + "
    "); - Response.Flush(); + this.Response.Flush(); } private bool CheckPermissions() { - bool verified = new FileSystemPermissionVerifier(Server.MapPath("~")).VerifyAll(); + bool verified = new FileSystemPermissionVerifier(this.Server.MapPath("~")).VerifyAll(); HtmlUtils.WriteFeedback(HttpContext.Current.Response, 0, "Checking File and Folder permissions " + (verified ? "Success" : "Error!") + "
    "); - Response.Flush(); + this.Response.Flush(); return verified; } @@ -239,7 +239,7 @@ private void UpgradeApplication() { if (Upgrade.Upgrade.RemoveInvalidAntiForgeryCookie()) { - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } var databaseVersion = DataProvider.Instance().GetVersion(); @@ -248,22 +248,22 @@ private void UpgradeApplication() Upgrade.Upgrade.StartTimer(); //Write out Header - HtmlUtils.WriteHeader(Response, "upgrade"); + HtmlUtils.WriteHeader(this.Response, "upgrade"); //There could be an installation in progress lock (installLocker) { if (InstallBlocker.Instance.IsInstallInProgress()) { - WriteInstallationHeader(); - WriteInstallationInProgress(); + this.WriteInstallationHeader(); + this.WriteInstallationInProgress(); return; } RegisterInstallBegining(); } - Response.Write("

    Current Assembly Version: " + Globals.FormatVersion(DotNetNukeContext.Current.Application.Version) + "

    "); - Response.Flush(); + this.Response.Write("

    Current Assembly Version: " + Globals.FormatVersion(DotNetNukeContext.Current.Application.Version) + "

    "); + this.Response.Flush(); //get path to script files string strProviderPath = DataProvider.Instance().GetProviderPath(); @@ -272,8 +272,8 @@ private void UpgradeApplication() //get current database version var strDatabaseVersion = Globals.FormatVersion(databaseVersion); - Response.Write("

    Current Database Version: " + strDatabaseVersion + "

    "); - Response.Flush(); + this.Response.Write("

    Current Database Version: " + strDatabaseVersion + "

    "); + this.Response.Flush(); string ignoreWarning = Null.NullString; string strWarning = Null.NullString; @@ -286,9 +286,9 @@ private void UpgradeApplication() //Execute Special Script Upgrade.Upgrade.ExecuteScript(strProviderPath + "Upgrade." + objProviderConfiguration.DefaultProvider); - if ((Request.QueryString["ignoreWarning"] != null)) + if ((this.Request.QueryString["ignoreWarning"] != null)) { - ignoreWarning = Request.QueryString["ignoreWarning"].ToLowerInvariant(); + ignoreWarning = this.Request.QueryString["ignoreWarning"].ToLowerInvariant(); } strWarning = Upgrade.Upgrade.CheckUpgrade(); } @@ -300,9 +300,9 @@ private void UpgradeApplication() //Check whether Upgrade is ok if (strWarning == Null.NullString || ignoreWarning == "true") { - Response.Write("

    "); - Response.Write("

    Upgrade Status Report

    "); - Response.Flush(); + this.Response.Write("

    "); + this.Response.Write("

    Upgrade Status Report

    "); + this.Response.Flush(); //stop scheduler SchedulingProvider.Instance().Halt("Stopped by Upgrade Process"); @@ -326,28 +326,28 @@ private void UpgradeApplication() { Logger.Error(strError); } - Response.Write("

    Upgrade Complete

    "); - Response.Write("

    Click Here To Access Your Site



    "); + this.Response.Write("

    Upgrade Complete

    "); + this.Response.Write("

    Click Here To Access Your Site



    "); //remove installwizard files Upgrade.Upgrade.DeleteInstallerFiles(); } else { - Response.Write("

    Warning:

    " + strWarning.Replace(Environment.NewLine, "
    ")); + this.Response.Write("

    Warning:

    " + strWarning.Replace(Environment.NewLine, "
    ")); - Response.Write("

    Click Here To Proceed With The Upgrade."); + this.Response.Write("

    Click Here To Proceed With The Upgrade."); } - Response.Flush(); + this.Response.Flush(); } else { - Response.Write("

    Upgrade Error: " + strProviderPath + "

    "); - Response.Flush(); + this.Response.Write("

    Upgrade Error: " + strProviderPath + "

    "); + this.Response.Flush(); } //Write out Footer - HtmlUtils.WriteFooter(Response); + HtmlUtils.WriteFooter(this.Response); } finally { @@ -361,9 +361,9 @@ private void AddPortal() Upgrade.Upgrade.StartTimer(); //Write out Header - HtmlUtils.WriteHeader(Response, "addPortal"); - Response.Write("

    Add Site Status Report

    "); - Response.Flush(); + HtmlUtils.WriteHeader(this.Response, "addPortal"); + this.Response.Write("

    Add Site Status Report

    "); + this.Response.Flush(); //install new portal(s) string strNewFile = Globals.ApplicationMapPath + "\\Install\\Portal\\Portals.resources"; @@ -397,13 +397,13 @@ private void AddPortal() Logger.Error(ex); } - Response.Write("

    Installation Complete

    "); - Response.Write("

    Click Here To Access Your Site



    "); - Response.Flush(); + this.Response.Write("

    Installation Complete

    "); + this.Response.Write("

    Click Here To Access Your Site



    "); + this.Response.Flush(); } //Write out Footer - HtmlUtils.WriteFooter(Response); + HtmlUtils.WriteFooter(this.Response); } private void InstallResources() @@ -412,10 +412,10 @@ private void InstallResources() Upgrade.Upgrade.StartTimer(); //Write out Header - HtmlUtils.WriteHeader(Response, "installResources"); + HtmlUtils.WriteHeader(this.Response, "installResources"); - Response.Write("

    Install Resources Status Report

    "); - Response.Flush(); + this.Response.Write("

    Install Resources Status Report

    "); + this.Response.Flush(); //install new resources(s) var packages = Upgrade.Upgrade.GetInstallPackages(); @@ -424,12 +424,12 @@ private void InstallResources() Upgrade.Upgrade.InstallPackage(package.Key, package.Value.PackageType, true); } - Response.Write("

    Installation Complete

    "); - Response.Write("

    Click Here To Access Your Site



    "); - Response.Flush(); + this.Response.Write("

    Installation Complete

    "); + this.Response.Write("

    Click Here To Access Your Site



    "); + this.Response.Flush(); //Write out Footer - HtmlUtils.WriteFooter(Response); + HtmlUtils.WriteFooter(this.Response); } private void NoUpgrade() @@ -446,35 +446,35 @@ private void NoUpgrade() if (dr.Read()) { //Write out Header - HtmlUtils.WriteHeader(Response, "none"); + HtmlUtils.WriteHeader(this.Response, "none"); string currentAssembly = DotNetNukeContext.Current.Application.Version.ToString(3); string currentDatabase = dr["Major"] + "." + dr["Minor"] + "." + dr["Build"]; //do not show versions if the same to stop information leakage if (currentAssembly == currentDatabase) { - Response.Write("

    Current Assembly Version && current Database Version are identical.

    "); + this.Response.Write("

    Current Assembly Version && current Database Version are identical.

    "); } else { - Response.Write("

    Current Assembly Version: " + currentAssembly + "

    "); + this.Response.Write("

    Current Assembly Version: " + currentAssembly + "

    "); //Call Upgrade with the current DB Version to upgrade an //existing DNN installation var strDatabaseVersion = ((int)dr["Major"]).ToString("00") + "." + ((int)dr["Minor"]).ToString("00") + "." + ((int)dr["Build"]).ToString("00"); - Response.Write("

    Current Database Version: " + strDatabaseVersion + "

    "); + this.Response.Write("

    Current Database Version: " + strDatabaseVersion + "

    "); } - Response.Write("

    Click Here To Upgrade DotNetNuke"); - Response.Flush(); + this.Response.Write("

    Click Here To Upgrade DotNetNuke"); + this.Response.Flush(); } else { //Write out Header - HtmlUtils.WriteHeader(Response, "noDBVersion"); - Response.Write("

    Current Assembly Version: " + DotNetNukeContext.Current.Application.Version.ToString(3) + "

    "); + HtmlUtils.WriteHeader(this.Response, "noDBVersion"); + this.Response.Write("

    Current Assembly Version: " + DotNetNukeContext.Current.Application.Version.ToString(3) + "

    "); - Response.Write("

    Current Database Version: N/A

    "); - Response.Write("

    Click Here To Install DotNetNuke

    "); - Response.Flush(); + this.Response.Write("

    Current Database Version: N/A

    "); + this.Response.Write("

    Click Here To Install DotNetNuke

    "); + this.Response.Flush(); } dr.Close(); } @@ -483,25 +483,25 @@ private void NoUpgrade() { //Write out Header Logger.Error(ex); - HtmlUtils.WriteHeader(Response, "error"); - Response.Write("

    Current Assembly Version: " + DotNetNukeContext.Current.Application.Version.ToString(3) + "

    "); + HtmlUtils.WriteHeader(this.Response, "error"); + this.Response.Write("

    Current Assembly Version: " + DotNetNukeContext.Current.Application.Version.ToString(3) + "

    "); - Response.Write("

    " + ex.Message + "

    "); - Response.Flush(); + this.Response.Write("

    " + ex.Message + "

    "); + this.Response.Flush(); } } else { //Write out Header - HtmlUtils.WriteHeader(Response, "error"); - Response.Write("

    Current Assembly Version: " + DotNetNukeContext.Current.Application.Version.ToString(3) + "

    "); + HtmlUtils.WriteHeader(this.Response, "error"); + this.Response.Write("

    Current Assembly Version: " + DotNetNukeContext.Current.Application.Version.ToString(3) + "

    "); - Response.Write("

    " + strProviderPath + "

    "); - Response.Flush(); + this.Response.Write("

    " + strProviderPath + "

    "); + this.Response.Flush(); } //Write out Footer - HtmlUtils.WriteFooter(Response); + HtmlUtils.WriteFooter(this.Response); } #endregion @@ -514,7 +514,7 @@ protected override void OnInit(EventArgs e) if (Upgrade.Upgrade.UpdateNewtonsoftVersion()) { - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } //if previous config deleted create new empty one @@ -530,37 +530,37 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); Config.AddFCNMode(Config.FcnMode.Single); //Get current Script time-out - int scriptTimeOut = Server.ScriptTimeout; + int scriptTimeOut = this.Server.ScriptTimeout; string mode = ""; - if ((Request.QueryString["mode"] != null)) + if ((this.Request.QueryString["mode"] != null)) { - mode = Request.QueryString["mode"].ToLowerInvariant(); + mode = this.Request.QueryString["mode"].ToLowerInvariant(); } //Disable Client side caching - Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); + this.Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); //Check mode is not Nothing if (mode == "none") { - NoUpgrade(); + this.NoUpgrade(); } else { //Set Script timeout to MAX value - Server.ScriptTimeout = int.MaxValue; + this.Server.ScriptTimeout = int.MaxValue; switch (Globals.Status) { case Globals.UpgradeStatus.Install: - InstallApplication(); + this.InstallApplication(); //Force an App Restart Config.Touch(); break; case Globals.UpgradeStatus.Upgrade: - UpgradeApplication(); + this.UpgradeApplication(); //Force an App Restart Config.Touch(); @@ -570,23 +570,23 @@ protected override void OnLoad(EventArgs e) switch (mode) { case "addportal": - AddPortal(); + this.AddPortal(); break; case "installresources": - InstallResources(); + this.InstallResources(); break; case "executescripts": - ExecuteScripts(); + this.ExecuteScripts(); break; } break; case Globals.UpgradeStatus.Error: - NoUpgrade(); + this.NoUpgrade(); break; } //restore Script timeout - Server.ScriptTimeout = scriptTimeOut; + this.Server.ScriptTimeout = scriptTimeOut; } } #endregion diff --git a/DNN Platform/Website/Install/UpgradeWizard.aspx.cs b/DNN Platform/Website/Install/UpgradeWizard.aspx.cs index bac2a618fc5..e154935c789 100644 --- a/DNN Platform/Website/Install/UpgradeWizard.aspx.cs +++ b/DNN Platform/Website/Install/UpgradeWizard.aspx.cs @@ -97,22 +97,22 @@ private static string StatusFile private void LocalizePage() { - SetBrowserLanguage(); - Page.Title = LocalizeString("Title"); - if (Globals.FormatVersion(ApplicationVersion) == Globals.FormatVersion(CurrentVersion)) + this.SetBrowserLanguage(); + this.Page.Title = this.LocalizeString("Title"); + if (Globals.FormatVersion(this.ApplicationVersion) == Globals.FormatVersion(this.CurrentVersion)) { - versionLabel.Visible = false; - currentVersionLabel.Visible = false; - versionsMatch.Text = LocalizeString("VersionsMatch"); - if (Globals.IncrementalVersionExists(CurrentVersion)) + this.versionLabel.Visible = false; + this.currentVersionLabel.Visible = false; + this.versionsMatch.Text = this.LocalizeString("VersionsMatch"); + if (Globals.IncrementalVersionExists(this.CurrentVersion)) { - versionsMatch.Text = LocalizeString("VersionsMatchButIncrementalExists"); + this.versionsMatch.Text = this.LocalizeString("VersionsMatchButIncrementalExists"); } } else { - versionLabel.Text = string.Format(LocalizeString("Version"), Globals.FormatVersion(ApplicationVersion)); - currentVersionLabel.Text = string.Format(LocalizeString("CurrentVersion"), Globals.FormatVersion(CurrentVersion)); + this.versionLabel.Text = string.Format(this.LocalizeString("Version"), Globals.FormatVersion(this.ApplicationVersion)); + this.currentVersionLabel.Text = string.Format(this.LocalizeString("CurrentVersion"), Globals.FormatVersion(this.CurrentVersion)); } } @@ -154,20 +154,20 @@ private static void GetInstallerLocales() private void SetBrowserLanguage() { string cultureCode; - if (string.IsNullOrEmpty(PageLocale.Value) && string.IsNullOrEmpty(_culture)) + if (string.IsNullOrEmpty(this.PageLocale.Value) && string.IsNullOrEmpty(_culture)) { cultureCode = TestableLocalization.Instance.BestCultureCodeBasedOnBrowserLanguages(_supportedLanguages); } - else if (string.IsNullOrEmpty(PageLocale.Value) && !string.IsNullOrEmpty(_culture)) + else if (string.IsNullOrEmpty(this.PageLocale.Value) && !string.IsNullOrEmpty(_culture)) { cultureCode = _culture; } else { - cultureCode = PageLocale.Value; + cultureCode = this.PageLocale.Value; } - PageLocale.Value = cultureCode; + this.PageLocale.Value = cultureCode; _culture = cultureCode; Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureCode); @@ -295,17 +295,17 @@ private void CompleteUpgrade() Upgrade.Upgrade.DeleteInstallerFiles(); Config.Touch(); - Response.Redirect("../Default.aspx", true); + this.Response.Redirect("../Default.aspx", true); } private void SslRequiredCheck() { - if (Entities.Host.Host.UpgradeForceSsl && !Request.IsSecureConnection) + if (Entities.Host.Host.UpgradeForceSsl && !this.Request.IsSecureConnection) { var sslDomain = Entities.Host.Host.SslDomain; if (string.IsNullOrEmpty(sslDomain)) { - sslDomain = Request.Url.Host; + sslDomain = this.Request.Url.Host; } else if (sslDomain.Contains("://")) { @@ -313,9 +313,9 @@ private void SslRequiredCheck() } var sslUrl = string.Format("https://{0}{1}", - sslDomain, Request.RawUrl); + sslDomain, this.Request.RawUrl); - Response.Redirect(sslUrl, true); + this.Response.Redirect(sslUrl, true); } } @@ -348,10 +348,10 @@ protected override void OnInit(EventArgs e) if (Upgrade.Upgrade.UpdateNewtonsoftVersion()) { - Response.Redirect(Request.RawUrl, true); + this.Response.Redirect(this.Request.RawUrl, true); } - SslRequiredCheck(); + this.SslRequiredCheck(); GetInstallerLocales(); } @@ -366,21 +366,21 @@ protected override void OnLoad(EventArgs e) { if (InstallBlocker.Instance.IsInstallInProgress()) { - Response.Redirect("Install.aspx", true); + this.Response.Redirect("Install.aspx", true); } base.OnLoad(e); - pnlAcceptTerms.Visible = NeedAcceptTerms; - LocalizePage(); + this.pnlAcceptTerms.Visible = this.NeedAcceptTerms; + this.LocalizePage(); - if (Request.RawUrl.EndsWith("?complete")) + if (this.Request.RawUrl.EndsWith("?complete")) { - CompleteUpgrade(); + this.CompleteUpgrade(); } //Create Status Files - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { //Reset the accept terms flag HostController.Instance.Update("AcceptDnnTerms", "N"); diff --git a/DNN Platform/Website/Install/WizardUser.ascx.cs b/DNN Platform/Website/Install/WizardUser.ascx.cs index 986e39d99ef..f1019a16654 100644 --- a/DNN Platform/Website/Install/WizardUser.ascx.cs +++ b/DNN Platform/Website/Install/WizardUser.ascx.cs @@ -22,11 +22,11 @@ public string FirstName { get { - return txtFirstName.Text; + return this.txtFirstName.Text; } set { - txtFirstName.Text = value; + this.txtFirstName.Text = value; } } @@ -34,11 +34,11 @@ public string LastName { get { - return txtLastName.Text; + return this.txtLastName.Text; } set { - txtLastName.Text = value; + this.txtLastName.Text = value; } } @@ -46,11 +46,11 @@ public string UserName { get { - return txtUserName.Text; + return this.txtUserName.Text; } set { - txtUserName.Text = value; + this.txtUserName.Text = value; } } @@ -58,11 +58,11 @@ public string Password { get { - return txtPassword.Text; + return this.txtPassword.Text; } set { - txtPassword.Text = value; + this.txtPassword.Text = value; } } @@ -70,11 +70,11 @@ public string Confirm { get { - return txtConfirm.Text; + return this.txtConfirm.Text; } set { - txtConfirm.Text = value; + this.txtConfirm.Text = value; } } @@ -82,11 +82,11 @@ public string Email { get { - return txtEmail.Text; + return this.txtEmail.Text; } set { - txtEmail.Text = value; + this.txtEmail.Text = value; } } @@ -94,11 +94,11 @@ public string FirstNameLabel { get { - return lblFirstName.Text; + return this.lblFirstName.Text; } set { - lblFirstName.Text = value; + this.lblFirstName.Text = value; } } @@ -106,11 +106,11 @@ public string LastNameLabel { get { - return lblLastName.Text; + return this.lblLastName.Text; } set { - lblLastName.Text = value; + this.lblLastName.Text = value; } } @@ -118,11 +118,11 @@ public string UserNameLabel { get { - return lblUserName.Text; + return this.lblUserName.Text; } set { - lblUserName.Text = value; + this.lblUserName.Text = value; } } @@ -130,11 +130,11 @@ public string PasswordLabel { get { - return lblPassword.Text; + return this.lblPassword.Text; } set { - lblPassword.Text = value; + this.lblPassword.Text = value; } } @@ -142,11 +142,11 @@ public string ConfirmLabel { get { - return lblConfirm.Text; + return this.lblConfirm.Text; } set { - lblConfirm.Text = value; + this.lblConfirm.Text = value; } } @@ -154,38 +154,38 @@ public string EmailLabel { get { - return lblEmail.Text; + return this.lblEmail.Text; } set { - lblEmail.Text = value; + this.lblEmail.Text = value; } } public string Validate() { string strErrorMessage = Null.NullString; - if (txtUserName.Text.Length < 4) + if (this.txtUserName.Text.Length < 4) { strErrorMessage = "MinUserNamelength"; } - else if (string.IsNullOrEmpty(txtPassword.Text)) + else if (string.IsNullOrEmpty(this.txtPassword.Text)) { strErrorMessage = "NoPassword"; } - else if (txtUserName.Text == txtPassword.Text) + else if (this.txtUserName.Text == this.txtPassword.Text) { strErrorMessage = "PasswordUser"; } - else if (txtPassword.Text.Length < MembershipProviderConfig.MinPasswordLength) + else if (this.txtPassword.Text.Length < MembershipProviderConfig.MinPasswordLength) { strErrorMessage = "PasswordLength"; } - else if (txtPassword.Text != txtConfirm.Text) + else if (this.txtPassword.Text != this.txtConfirm.Text) { strErrorMessage = "ConfirmPassword"; } - else if (!Globals.EmailValidatorRegex.IsMatch(txtEmail.Text)) + else if (!Globals.EmailValidatorRegex.IsMatch(this.txtEmail.Text)) { strErrorMessage = "InValidEmail"; } @@ -203,24 +203,24 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if(IsPostBack) + if(this.IsPostBack) { - if(!string.IsNullOrEmpty(txtPassword.Text)) + if(!string.IsNullOrEmpty(this.txtPassword.Text)) { - ViewState["Password"] = txtPassword.Text; + this.ViewState["Password"] = this.txtPassword.Text; } - else if(ViewState["Password"] != null) + else if(this.ViewState["Password"] != null) { - txtPassword.Text = ViewState["Password"].ToString(); + this.txtPassword.Text = this.ViewState["Password"].ToString(); } - if (!string.IsNullOrEmpty(txtConfirm.Text)) + if (!string.IsNullOrEmpty(this.txtConfirm.Text)) { - ViewState["Confirm"] = txtConfirm.Text; + this.ViewState["Confirm"] = this.txtConfirm.Text; } - else if (ViewState["Confirm"] != null) + else if (this.ViewState["Confirm"] != null) { - txtConfirm.Text = ViewState["Confirm"].ToString(); + this.txtConfirm.Text = this.ViewState["Confirm"].ToString(); } } } @@ -237,8 +237,8 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); //Make sure that the password is not cleared on pastback - txtConfirm.Attributes["value"] = txtConfirm.Text; - txtPassword.Attributes["value"] = txtPassword.Text; + this.txtConfirm.Attributes["value"] = this.txtConfirm.Text; + this.txtPassword.Attributes["value"] = this.txtPassword.Text; } } } diff --git a/DNN Platform/Website/KeepAlive.aspx.cs b/DNN Platform/Website/KeepAlive.aspx.cs index 87515a0964e..7a350cb7091 100644 --- a/DNN Platform/Website/KeepAlive.aspx.cs +++ b/DNN Platform/Website/KeepAlive.aspx.cs @@ -24,7 +24,7 @@ protected override void OnInit(EventArgs e) //CODEGEN: This method call is required by the Web Form Designer //Do not modify it using the code editor. - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) diff --git a/DNN Platform/Website/Portals/_default/Blank Website.template.en-US.resx b/DNN Platform/Website/Portals/_default/Blank Website.template.en-US.resx index 2c7480489bc..80d7511177d 100644 --- a/DNN Platform/Website/Portals/_default/Blank Website.template.en-US.resx +++ b/DNN Platform/Website/Portals/_default/Blank Website.template.en-US.resx @@ -124,7 +124,7 @@ en-US
    - Copyright [year] by DNN Corp + Copyright [year] by My Website Blank Template diff --git a/DNN Platform/Website/Portals/_default/Default Website.template.en-US.resx b/DNN Platform/Website/Portals/_default/Default Website.template.en-US.resx index ba588631e5f..1d15bae9cea 100644 --- a/DNN Platform/Website/Portals/_default/Default Website.template.en-US.resx +++ b/DNN Platform/Website/Portals/_default/Default Website.template.en-US.resx @@ -130,7 +130,7 @@ en-US - Copyright [year] by DNN Corp + Copyright [year] by My Website Sorry, the page you are looking for cannot be found and might have been removed, had its name changed, or is temporarily unavailable. It is recommended that you start again from the homepage. Feel free to contact us if the problem persists or if you definitely cannot find what you’re looking for. diff --git a/DNN Platform/Website/Resources/Shared/scripts/jquery/jquery.hoverIntent.min.js b/DNN Platform/Website/Resources/Shared/scripts/jquery/jquery.hoverIntent.min.js index 75c22ca3547..8626550abd7 100644 --- a/DNN Platform/Website/Resources/Shared/scripts/jquery/jquery.hoverIntent.min.js +++ b/DNN Platform/Website/Resources/Shared/scripts/jquery/jquery.hoverIntent.min.js @@ -1,9 +1,9 @@ -/** -* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+ -* -* -* @param f onMouseOver function || An object with configuration options -* @param g onMouseOut function || Nothing (use configuration options object) -* @author Brian Cherne brian(at)cherne(dot)net -*/ -(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY)) 0) + if (this.Controls.Count > 0) { - Controls.Clear(); + this.Controls.Clear(); } - var PreSpacer = new LiteralControl(ItemSeparator); - Controls.Add(PreSpacer); + var PreSpacer = new LiteralControl(this.ItemSeparator); + this.Controls.Add(PreSpacer); //Add Menu Items - foreach (ModuleAction action in ActionRoot.Actions) + foreach (ModuleAction action in this.ActionRoot.Actions) { if (action.Title == "~") { @@ -60,7 +60,7 @@ protected override void OnLoad(EventArgs e) { if (action.Visible) { - if ((ModuleControl.ModuleContext.EditMode && Globals.IsAdminControl() == false) || + if ((this.ModuleControl.ModuleContext.EditMode && Globals.IsAdminControl() == false) || (action.Secure != SecurityAccessLevel.Anonymous && action.Secure != SecurityAccessLevel.View)) { var ModuleActionLink = new LinkButton(); @@ -68,11 +68,11 @@ protected override void OnLoad(EventArgs e) ModuleActionLink.CssClass = "CommandButton"; ModuleActionLink.ID = "lnk" + action.ID; - ModuleActionLink.Click += LinkAction_Click; + ModuleActionLink.Click += this.LinkAction_Click; - Controls.Add(ModuleActionLink); - var Spacer = new LiteralControl(ItemSeparator); - Controls.Add(Spacer); + this.Controls.Add(ModuleActionLink); + var Spacer = new LiteralControl(this.ItemSeparator); + this.Controls.Add(Spacer); } } } @@ -81,13 +81,13 @@ protected override void OnLoad(EventArgs e) } //Need to determine if this action list actually has any items. - if (Controls.Count > 0) + if (this.Controls.Count > 0) { - Visible = true; + this.Visible = true; } else { - Visible = false; + this.Visible = false; } } catch (Exception exc) //Module failed to load @@ -99,9 +99,9 @@ protected override void OnLoad(EventArgs e) protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (String.IsNullOrEmpty(_itemSeparator)) + if (String.IsNullOrEmpty(this._itemSeparator)) { - _itemSeparator = "  "; + this._itemSeparator = "  "; } } @@ -109,7 +109,7 @@ private void LinkAction_Click(object sender, EventArgs e) { try { - ProcessAction(((LinkButton) sender).ID.Substring(3)); + this.ProcessAction(((LinkButton) sender).ID.Substring(3)); } catch (Exception exc) //Module failed to load { diff --git a/DNN Platform/Website/admin/Containers/PrintModule.ascx.cs b/DNN Platform/Website/admin/Containers/PrintModule.ascx.cs index 824c7de087e..48251e53556 100644 --- a/DNN Platform/Website/admin/Containers/PrintModule.ascx.cs +++ b/DNN Platform/Website/admin/Containers/PrintModule.ascx.cs @@ -44,19 +44,19 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - foreach (ModuleAction action in Actions) + foreach (ModuleAction action in this.Actions) { - DisplayAction(action); + this.DisplayAction(action); } //set visibility - if (Controls.Count > 0) + if (this.Controls.Count > 0) { - Visible = true; + this.Visible = true; } else { - Visible = false; + this.Visible = false; } } catch (Exception exc) //Module failed to load @@ -71,14 +71,14 @@ private void DisplayAction(ModuleAction action) { if (action.Visible) { - if ((PortalSettings.UserMode == PortalSettings.Mode.Edit) || (action.Secure == SecurityAccessLevel.Anonymous || action.Secure == SecurityAccessLevel.View)) + if ((this.PortalSettings.UserMode == PortalSettings.Mode.Edit) || (action.Secure == SecurityAccessLevel.Anonymous || action.Secure == SecurityAccessLevel.View)) { - if (ModuleContext.Configuration.DisplayPrint) + if (this.ModuleContext.Configuration.DisplayPrint) { var ModuleActionIcon = new ImageButton(); - if (!String.IsNullOrEmpty(PrintIcon)) + if (!String.IsNullOrEmpty(this.PrintIcon)) { - ModuleActionIcon.ImageUrl = ModuleContext.Configuration.ContainerPath.Substring(0, ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1) + PrintIcon; + ModuleActionIcon.ImageUrl = this.ModuleContext.Configuration.ContainerPath.Substring(0, this.ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1) + this.PrintIcon; } else { @@ -88,9 +88,9 @@ private void DisplayAction(ModuleAction action) ModuleActionIcon.ID = "ico" + action.ID; ModuleActionIcon.CausesValidation = false; - ModuleActionIcon.Click += IconAction_Click; + ModuleActionIcon.Click += this.IconAction_Click; - Controls.Add(ModuleActionIcon); + this.Controls.Add(ModuleActionIcon); } } } @@ -98,7 +98,7 @@ private void DisplayAction(ModuleAction action) foreach (ModuleAction subAction in action.Actions) { - DisplayAction(subAction); + this.DisplayAction(subAction); } } @@ -106,7 +106,7 @@ private void IconAction_Click(object sender, ImageClickEventArgs e) { try { - ProcessAction(((ImageButton) sender).ID.Substring(3)); + this.ProcessAction(((ImageButton) sender).ID.Substring(3)); } catch (Exception exc) //Module failed to load { diff --git a/DNN Platform/Website/admin/Containers/Title.ascx.cs b/DNN Platform/Website/admin/Containers/Title.ascx.cs index d707d8aeab6..0c6bd003625 100644 --- a/DNN Platform/Website/admin/Containers/Title.ascx.cs +++ b/DNN Platform/Website/admin/Containers/Title.ascx.cs @@ -36,9 +36,9 @@ public partial class Title : SkinObjectBase private bool CanEditModule() { var canEdit = false; - if (ModuleControl != null && ModuleControl.ModuleContext.ModuleId > Null.NullInteger) + if (this.ModuleControl != null && this.ModuleControl.ModuleContext.ModuleId > Null.NullInteger) { - canEdit = (PortalSettings.UserMode == PortalSettings.Mode.Edit) && TabPermissionController.CanAdminPage() && !Globals.IsAdminControl(); + canEdit = (this.PortalSettings.UserMode == PortalSettings.Mode.Edit) && TabPermissionController.CanAdminPage() && !Globals.IsAdminControl(); } return canEdit; } @@ -47,7 +47,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - titleLabel.UpdateLabel += UpdateTitle; + this.titleLabel.UpdateLabel += this.UpdateTitle; } @@ -56,37 +56,37 @@ protected override void OnPreRender(EventArgs e) base.OnPreRender(e); //public attributes - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - titleLabel.CssClass = CssClass; + this.titleLabel.CssClass = this.CssClass; } string moduleTitle = Null.NullString; - if (ModuleControl != null) + if (this.ModuleControl != null) { - moduleTitle = Localization.LocalizeControlTitle(ModuleControl); + moduleTitle = Localization.LocalizeControlTitle(this.ModuleControl); } if (moduleTitle == Null.NullString) { moduleTitle = " "; } - titleLabel.Text = moduleTitle; - titleLabel.EditEnabled = false; - titleToolbar.Visible = false; + this.titleLabel.Text = moduleTitle; + this.titleLabel.EditEnabled = false; + this.titleToolbar.Visible = false; - if (CanEditModule() && PortalSettings.InlineEditorEnabled) + if (this.CanEditModule() && this.PortalSettings.InlineEditorEnabled) { - titleLabel.EditEnabled = true; - titleToolbar.Visible = true; + this.titleLabel.EditEnabled = true; + this.titleToolbar.Visible = true; } } private void UpdateTitle(object source, DNNLabelEditEventArgs e) { - if (CanEditModule()) + if (this.CanEditModule()) { - ModuleInfo moduleInfo = ModuleController.Instance.GetModule(ModuleControl.ModuleContext.ModuleId, ModuleControl.ModuleContext.TabId, false); + ModuleInfo moduleInfo = ModuleController.Instance.GetModule(this.ModuleControl.ModuleContext.ModuleId, this.ModuleControl.ModuleContext.TabId, false); var ps = PortalSecurity.Instance; var mt = ps.InputFilter(e.Text, PortalSecurity.FilterFlag.NoScripting); diff --git a/DNN Platform/Website/admin/Containers/Toggle.ascx.cs b/DNN Platform/Website/admin/Containers/Toggle.ascx.cs index e992b654647..2cfc69b312d 100644 --- a/DNN Platform/Website/admin/Containers/Toggle.ascx.cs +++ b/DNN Platform/Website/admin/Containers/Toggle.ascx.cs @@ -38,12 +38,12 @@ public string Target { get { - if(this.Parent == null || string.IsNullOrEmpty(_target)) + if(this.Parent == null || string.IsNullOrEmpty(this._target)) { return string.Empty; } - var targetControl = this.Parent.FindControl(_target); + var targetControl = this.Parent.FindControl(this._target); if(targetControl == null) { return string.Empty; @@ -56,7 +56,7 @@ public string Target } set { - _target = value; + this._target = value; } } @@ -70,22 +70,22 @@ protected override void OnPreRender(EventArgs e) JavaScript.RequestRegistration(CommonJs.jQueryMigrate); var toggleScript = string.Format("", - ClientID, - Target); - Page.ClientScript.RegisterStartupScript(GetType(), ClientID, toggleScript); + this.ClientID, + this.Target); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), this.ClientID, toggleScript); } protected override void Render(HtmlTextWriter writer) { - writer.AddAttribute("id", ClientID); - writer.AddAttribute("class", Class); + writer.AddAttribute("id", this.ClientID); + writer.AddAttribute("class", this.Class); writer.RenderBeginTag("h2"); writer.AddAttribute("href", "#"); writer.AddAttribute("class", "toggleHandler"); writer.RenderBeginTag("a"); - RenderChildren(writer); + this.RenderChildren(writer); writer.RenderEndTag(); writer.RenderEndTag(); diff --git a/DNN Platform/Website/admin/Containers/Visibility.ascx.cs b/DNN Platform/Website/admin/Containers/Visibility.ascx.cs index f63fcaf9a76..47ca87f7fe5 100644 --- a/DNN Platform/Website/admin/Containers/Visibility.ascx.cs +++ b/DNN Platform/Website/admin/Containers/Visibility.ascx.cs @@ -44,9 +44,9 @@ private string MinIconLoc { get { - if (!String.IsNullOrEmpty(minIcon)) + if (!String.IsNullOrEmpty(this.minIcon)) { - return ModulePath + minIcon; + return this.ModulePath + this.minIcon; } return Globals.ApplicationPath + "/images/min.gif"; //is ~/ the same as ApplicationPath in all cases? @@ -57,9 +57,9 @@ private string MaxIconLoc { get { - if (!String.IsNullOrEmpty(MaxIcon)) + if (!String.IsNullOrEmpty(this.MaxIcon)) { - return ModulePath + MaxIcon; + return this.ModulePath + this.MaxIcon; } return Globals.ApplicationPath + "/images/max.gif"; //is ~/ the same as ApplicationPath in all cases? @@ -70,15 +70,15 @@ private Panel ModuleContent { get { - if (_pnlModuleContent == null) + if (this._pnlModuleContent == null) { - Control objCtl = Parent.FindControl("ModuleContent"); + Control objCtl = this.Parent.FindControl("ModuleContent"); if (objCtl != null) { - _pnlModuleContent = (Panel) objCtl; + this._pnlModuleContent = (Panel) objCtl; } } - return _pnlModuleContent; + return this._pnlModuleContent; } } @@ -86,7 +86,7 @@ private string ModulePath { get { - return ModuleControl.ModuleContext.Configuration.ContainerPath.Substring(0, ModuleControl.ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1); + return this.ModuleControl.ModuleContext.Configuration.ContainerPath.Substring(0, this.ModuleControl.ModuleContext.Configuration.ContainerPath.LastIndexOf("/") + 1); } } @@ -99,11 +99,11 @@ public int AnimationFrames { get { - return _animationFrames; + return this._animationFrames; } set { - _animationFrames = value; + this._animationFrames = value; } } @@ -113,13 +113,13 @@ public bool ContentVisible { get { - switch (ModuleControl.ModuleContext.Configuration.Visibility) + switch (this.ModuleControl.ModuleContext.Configuration.Visibility) { case VisibilityState.Maximized: case VisibilityState.Minimized: - return DNNClientAPI.MinMaxContentVisibile(cmdVisibility, - ModuleControl.ModuleContext.ModuleId, - ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized, + return DNNClientAPI.MinMaxContentVisibile(this.cmdVisibility, + this.ModuleControl.ModuleContext.ModuleId, + this.ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized, DNNClientAPI.MinMaxPersistanceType.Cookie); default: return true; @@ -127,9 +127,9 @@ public bool ContentVisible } set { - DNNClientAPI.MinMaxContentVisibile(cmdVisibility, - ModuleControl.ModuleContext.ModuleId, - ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized, + DNNClientAPI.MinMaxContentVisibile(this.cmdVisibility, + this.ModuleControl.ModuleContext.ModuleId, + this.ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized, DNNClientAPI.MinMaxPersistanceType.Cookie, value); } @@ -154,64 +154,64 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdVisibility.Click += cmdVisibility_Click; + this.cmdVisibility.Click += this.cmdVisibility_Click; try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { //public attributes - if (!String.IsNullOrEmpty(BorderWidth)) + if (!String.IsNullOrEmpty(this.BorderWidth)) { - cmdVisibility.BorderWidth = Unit.Parse(BorderWidth); + this.cmdVisibility.BorderWidth = Unit.Parse(this.BorderWidth); } - if (ModuleControl.ModuleContext.Configuration != null) + if (this.ModuleControl.ModuleContext.Configuration != null) { //check if Personalization is allowed - if (ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.None) + if (this.ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.None) { - cmdVisibility.Enabled = false; - cmdVisibility.Visible = false; + this.cmdVisibility.Enabled = false; + this.cmdVisibility.Visible = false; } - if (ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized) + if (this.ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized) { //if visibility is set to minimized, then the client needs to set the cookie for maximized only and delete the cookie for minimized, //instead of the opposite. We need to notify the client of this - ClientAPI.RegisterClientVariable(Page, "__dnn_" + ModuleControl.ModuleContext.ModuleId + ":defminimized", "true", true); + ClientAPI.RegisterClientVariable(this.Page, "__dnn_" + this.ModuleControl.ModuleContext.ModuleId + ":defminimized", "true", true); } if (!Globals.IsAdminControl()) { - if (cmdVisibility.Enabled) + if (this.cmdVisibility.Enabled) { - if (ModuleContent != null) + if (this.ModuleContent != null) { //EnableMinMax now done in prerender } else { - Visible = false; + this.Visible = false; } } } else { - Visible = false; + this.Visible = false; } } else { - Visible = false; + this.Visible = false; } } else { //since we disabled viewstate on the cmdVisibility control we need to check to see if we need hide this on postbacks as well - if (ModuleControl.ModuleContext.Configuration != null) + if (this.ModuleControl.ModuleContext.Configuration != null) { - if (ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.None) + if (this.ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.None) { - cmdVisibility.Enabled = false; - cmdVisibility.Visible = false; + this.cmdVisibility.Enabled = false; + this.cmdVisibility.Visible = false; } } } @@ -225,20 +225,20 @@ protected override void OnLoad(EventArgs e) protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (ModuleContent != null && ModuleControl != null && !Globals.IsAdminControl()) + if (this.ModuleContent != null && this.ModuleControl != null && !Globals.IsAdminControl()) { - switch (ModuleControl.ModuleContext.Configuration.Visibility) + switch (this.ModuleControl.ModuleContext.Configuration.Visibility) { case VisibilityState.Maximized: case VisibilityState.Minimized: - DNNClientAPI.EnableMinMax(cmdVisibility, - ModuleContent, - ModuleControl.ModuleContext.ModuleId, - ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized, - MinIconLoc, - MaxIconLoc, + DNNClientAPI.EnableMinMax(this.cmdVisibility, + this.ModuleContent, + this.ModuleControl.ModuleContext.ModuleId, + this.ModuleControl.ModuleContext.Configuration.Visibility == VisibilityState.Minimized, + this.MinIconLoc, + this.MaxIconLoc, DNNClientAPI.MinMaxPersistanceType.Cookie, - AnimationFrames); + this.AnimationFrames); break; } } @@ -248,15 +248,15 @@ private void cmdVisibility_Click(Object sender, EventArgs e) { try { - if (ModuleContent != null) + if (this.ModuleContent != null) { - if (ModuleContent.Visible) + if (this.ModuleContent.Visible) { - ContentVisible = false; + this.ContentVisible = false; } else { - ContentVisible = true; + this.ContentVisible = true; } } } diff --git a/DNN Platform/Website/admin/Menus/ModuleActions/ModuleActions.ascx.cs b/DNN Platform/Website/admin/Menus/ModuleActions/ModuleActions.ascx.cs index aef4440fd5b..a9b41b64dd7 100644 --- a/DNN Platform/Website/admin/Menus/ModuleActions/ModuleActions.ascx.cs +++ b/DNN Platform/Website/admin/Menus/ModuleActions/ModuleActions.ascx.cs @@ -73,56 +73,56 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - ID = "ModuleActions"; + this.ID = "ModuleActions"; - actionButton.Click += actionButton_Click; + this.actionButton.Click += this.actionButton_Click; JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ClientResourceManager.RegisterStyleSheet(Page, "~/admin/menus/ModuleActions/ModuleActions.css", FileOrder.Css.ModuleCss); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/stylesheets/dnnicons/css/dnnicon.min.css", FileOrder.Css.ModuleCss); - ClientResourceManager.RegisterScript(Page, "~/admin/menus/ModuleActions/ModuleActions.js"); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/admin/menus/ModuleActions/ModuleActions.css", FileOrder.Css.ModuleCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnnicons/css/dnnicon.min.css", FileOrder.Css.ModuleCss); + ClientResourceManager.RegisterScript(this.Page, "~/admin/menus/ModuleActions/ModuleActions.js"); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); } void actionButton_Click(object sender, EventArgs e) { - ProcessAction(Request.Params["__EVENTARGUMENT"]); + this.ProcessAction(this.Request.Params["__EVENTARGUMENT"]); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - AdminActionsJSON = "[]"; - CustomActionsJSON = "[]"; - Panes = "[]"; + this.AdminActionsJSON = "[]"; + this.CustomActionsJSON = "[]"; + this.Panes = "[]"; try { - SupportsQuickSettings = false; - DisplayQuickSettings = false; - ModuleTitle = ModuleContext.Configuration.ModuleTitle; - var moduleDefinitionId = ModuleContext.Configuration.ModuleDefID; + this.SupportsQuickSettings = false; + this.DisplayQuickSettings = false; + this.ModuleTitle = this.ModuleContext.Configuration.ModuleTitle; + var moduleDefinitionId = this.ModuleContext.Configuration.ModuleDefID; var quickSettingsControl = ModuleControlController.GetModuleControlByControlKey("QuickSettings", moduleDefinitionId); if (quickSettingsControl != null) { - SupportsQuickSettings = true; - var control = ModuleControlFactory.LoadModuleControl(Page, ModuleContext.Configuration, "QuickSettings", quickSettingsControl.ControlSrc); - control.ID += ModuleContext.ModuleId; - quickSettings.Controls.Add(control); + this.SupportsQuickSettings = true; + var control = ModuleControlFactory.LoadModuleControl(this.Page, this.ModuleContext.Configuration, "QuickSettings", quickSettingsControl.ControlSrc); + control.ID += this.ModuleContext.ModuleId; + this.quickSettings.Controls.Add(control); - DisplayQuickSettings = ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("QS_FirstLoad", true); - ModuleController.Instance.UpdateModuleSetting(ModuleContext.ModuleId, "QS_FirstLoad", "False"); + this.DisplayQuickSettings = this.ModuleContext.Configuration.ModuleSettings.GetValueOrDefault("QS_FirstLoad", true); + ModuleController.Instance.UpdateModuleSetting(this.ModuleContext.ModuleId, "QS_FirstLoad", "False"); - ClientResourceManager.RegisterScript(Page, "~/admin/menus/ModuleActions/dnnQuickSettings.js"); + ClientResourceManager.RegisterScript(this.Page, "~/admin/menus/ModuleActions/dnnQuickSettings.js"); } - if (ActionRoot.Visible) + if (this.ActionRoot.Visible) { //Add Menu Items - foreach (ModuleAction rootAction in ActionRoot.Actions) + foreach (ModuleAction rootAction in this.ActionRoot.Actions) { //Process Children var actions = new List(); @@ -130,7 +130,7 @@ protected override void OnLoad(EventArgs e) { if (action.Visible) { - if ((EditMode && Globals.IsAdminControl() == false) || + if ((this.EditMode && Globals.IsAdminControl() == false) || (action.Secure != SecurityAccessLevel.Anonymous && action.Secure != SecurityAccessLevel.View)) { if (!action.Icon.Contains("://") @@ -148,7 +148,7 @@ protected override void OnLoad(EventArgs e) if(String.IsNullOrEmpty(action.Url)) { - validIDs.Add(action.ID); + this.validIDs.Add(action.ID); } } } @@ -158,24 +158,24 @@ protected override void OnLoad(EventArgs e) var oSerializer = new JavaScriptSerializer(); if (rootAction.Title == Localization.GetString("ModuleGenericActions.Action", Localization.GlobalResourceFile)) { - AdminActionsJSON = oSerializer.Serialize(actions); + this.AdminActionsJSON = oSerializer.Serialize(actions); } else { if (rootAction.Title == Localization.GetString("ModuleSpecificActions.Action", Localization.GlobalResourceFile)) { - CustomActionsJSON = oSerializer.Serialize(actions); + this.CustomActionsJSON = oSerializer.Serialize(actions); } else { - SupportsMove = (actions.Count > 0); - Panes = oSerializer.Serialize(PortalSettings.ActiveTab.Panes); + this.SupportsMove = (actions.Count > 0); + this.Panes = oSerializer.Serialize(this.PortalSettings.ActiveTab.Panes); } } } - IsShared = ModuleContext.Configuration.AllTabs - || PortalGroupController.Instance.IsModuleShared(ModuleContext.ModuleId, PortalController.Instance.GetPortal(PortalSettings.PortalId)) - || TabController.Instance.GetTabsByModuleID(ModuleContext.ModuleId).Count > 1; + this.IsShared = this.ModuleContext.Configuration.AllTabs + || PortalGroupController.Instance.IsModuleShared(this.ModuleContext.ModuleId, PortalController.Instance.GetPortal(this.PortalSettings.PortalId)) + || TabController.Instance.GetTabsByModuleID(this.ModuleContext.ModuleId).Count > 1; } } catch (Exception exc) //Module failed to load @@ -188,9 +188,9 @@ protected override void Render(HtmlTextWriter writer) { base.Render(writer); - foreach(int id in validIDs) + foreach(int id in this.validIDs) { - Page.ClientScript.RegisterForEventValidation(actionButton.UniqueID, id.ToString()); + this.Page.ClientScript.RegisterForEventValidation(this.actionButton.UniqueID, id.ToString()); } } } diff --git a/DNN Platform/Website/admin/Modules/Export.ascx.cs b/DNN Platform/Website/admin/Modules/Export.ascx.cs index d8644d9c908..f7fd2be0bdd 100644 --- a/DNN Platform/Website/admin/Modules/Export.ascx.cs +++ b/DNN Platform/Website/admin/Modules/Export.ascx.cs @@ -43,7 +43,7 @@ public partial class Export : PortalModuleBase private readonly INavigationManager _navigationManager; public Export() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -55,7 +55,7 @@ private ModuleInfo Module { get { - return _module ?? (_module = ModuleController.Instance.GetModule(ModuleId, TabId, false)); + return this._module ?? (this._module = ModuleController.Instance.GetModule(this.ModuleId, this.TabId, false)); } } @@ -63,7 +63,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(this.Request.Params["ReturnURL"]) ?? this._navigationManager.NavigateURL(); } } @@ -74,27 +74,27 @@ private string ReturnURL private string ExportModule(int moduleID, string fileName, IFolderInfo folder) { var strMessage = ""; - if (Module != null) + if (this.Module != null) { - if (!String.IsNullOrEmpty(Module.DesktopModule.BusinessControllerClass) && Module.DesktopModule.IsPortable) + if (!String.IsNullOrEmpty(this.Module.DesktopModule.BusinessControllerClass) && this.Module.DesktopModule.IsPortable) { try { - var objObject = Reflection.CreateObject(Module.DesktopModule.BusinessControllerClass, Module.DesktopModule.BusinessControllerClass); + var objObject = Reflection.CreateObject(this.Module.DesktopModule.BusinessControllerClass, this.Module.DesktopModule.BusinessControllerClass); //Double-check if (objObject is IPortable) { XmlDocument moduleXml = new XmlDocument { XmlResolver = null }; - XmlNode moduleNode = ModuleController.SerializeModule(moduleXml, Module, true); + XmlNode moduleNode = ModuleController.SerializeModule(moduleXml, this.Module, true); //add attributes to XML document XmlAttribute typeAttribute = moduleXml.CreateAttribute("type"); - typeAttribute.Value = CleanName(Module.DesktopModule.ModuleName); + typeAttribute.Value = CleanName(this.Module.DesktopModule.ModuleName); moduleNode.Attributes.Append(typeAttribute); XmlAttribute versionAttribute = moduleXml.CreateAttribute("version"); - versionAttribute.Value = Module.DesktopModule.Version; + versionAttribute.Value = this.Module.DesktopModule.Version; moduleNode.Attributes.Append(versionAttribute); // Create content from XmlNode @@ -111,7 +111,7 @@ private string ExportModule(int moduleID, string fileName, IFolderInfo folder) // Module.DesktopModule.Version + "\">" + content + "
    "; //First check the Portal limits will not be exceeded (this is approximate) - if (PortalController.Instance.HasSpaceAvailable(PortalId, content.Length)) + if (PortalController.Instance.HasSpaceAvailable(this.PortalId, content.Length)) { //add file to Files table using (var fileContent = new MemoryStream(Encoding.UTF8.GetBytes(content))) @@ -126,12 +126,12 @@ private string ExportModule(int moduleID, string fileName, IFolderInfo folder) } else { - strMessage = Localization.GetString("NoContent", LocalResourceFile); + strMessage = Localization.GetString("NoContent", this.LocalResourceFile); } } else { - strMessage = Localization.GetString("ExportNotSupported", LocalResourceFile); + strMessage = Localization.GetString("ExportNotSupported", this.LocalResourceFile); } } catch (Exception ex) @@ -142,13 +142,13 @@ private string ExportModule(int moduleID, string fileName, IFolderInfo folder) } else { - strMessage = Localization.GetString("Error", LocalResourceFile); + strMessage = Localization.GetString("Error", this.LocalResourceFile); } } } else { - strMessage = Localization.GetString("ExportNotSupported", LocalResourceFile); + strMessage = Localization.GetString("ExportNotSupported", this.LocalResourceFile); } } return strMessage; @@ -175,13 +175,13 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (Request.QueryString["moduleid"] != null) + if (this.Request.QueryString["moduleid"] != null) { - Int32.TryParse(Request.QueryString["moduleid"], out ModuleId); + Int32.TryParse(this.Request.QueryString["moduleid"], out this.ModuleId); } - if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "EXPORT", Module)) + if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "EXPORT", this.Module)) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } @@ -189,23 +189,23 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdExport.Click += OnExportClick; + this.cmdExport.Click += this.OnExportClick; try { - if (Request.QueryString["moduleid"] != null) + if (this.Request.QueryString["moduleid"] != null) { - Int32.TryParse(Request.QueryString["moduleid"], out ModuleId); + Int32.TryParse(this.Request.QueryString["moduleid"], out this.ModuleId); } - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - cmdCancel.NavigateUrl = ReturnURL; + this.cmdCancel.NavigateUrl = this.ReturnURL; - cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); - cboFolders.Services.Parameters.Add("permission", "ADD"); - if (Module != null) + this.cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); + this.cboFolders.Services.Parameters.Add("permission", "ADD"); + if (this.Module != null) { - txtFile.Text = CleanName(Module.ModuleTitle); + this.txtFile.Text = CleanName(this.Module.ModuleTitle); } } } @@ -220,18 +220,18 @@ protected void OnExportClick(object sender, EventArgs e) try { IFolderInfo folder = null; - if (cboFolders.SelectedItem != null && !String.IsNullOrEmpty(txtFile.Text)) + if (this.cboFolders.SelectedItem != null && !String.IsNullOrEmpty(this.txtFile.Text)) { - folder = FolderManager.Instance.GetFolder(cboFolders.SelectedItemValueAsInt); + folder = FolderManager.Instance.GetFolder(this.cboFolders.SelectedItemValueAsInt); } if (folder != null) { - var strFile = "content." + CleanName(Module.DesktopModule.ModuleName) + "." + CleanName(txtFile.Text) + ".export"; - var strMessage = ExportModule(ModuleId, strFile, folder); + var strFile = "content." + CleanName(this.Module.DesktopModule.ModuleName) + "." + CleanName(this.txtFile.Text) + ".export"; + var strMessage = this.ExportModule(this.ModuleId, strFile, folder); if (String.IsNullOrEmpty(strMessage)) { - Response.Redirect(ReturnURL, true); + this.Response.Redirect(this.ReturnURL, true); } else { @@ -240,7 +240,7 @@ protected void OnExportClick(object sender, EventArgs e) } else { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Validation", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Validation", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } } catch (Exception exc) diff --git a/DNN Platform/Website/admin/Modules/Import.ascx.cs b/DNN Platform/Website/admin/Modules/Import.ascx.cs index 15e3d419572..dd9ef22230f 100644 --- a/DNN Platform/Website/admin/Modules/Import.ascx.cs +++ b/DNN Platform/Website/admin/Modules/Import.ascx.cs @@ -34,7 +34,7 @@ public partial class Import : PortalModuleBase private readonly INavigationManager _navigationManager; public Import() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -46,7 +46,7 @@ private ModuleInfo Module { get { - return _module ?? (_module = ModuleController.Instance.GetModule(ModuleId, TabId, false)); + return this._module ?? (this._module = ModuleController.Instance.GetModule(this.ModuleId, this.TabId, false)); } } @@ -54,7 +54,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(this.Request.Params["ReturnURL"]) ?? this._navigationManager.NavigateURL(); } } @@ -65,62 +65,62 @@ private string ReturnURL private string ImportModule() { var strMessage = ""; - if (Module != null) + if (this.Module != null) { - if (!String.IsNullOrEmpty(Module.DesktopModule.BusinessControllerClass) && Module.DesktopModule.IsPortable) + if (!String.IsNullOrEmpty(this.Module.DesktopModule.BusinessControllerClass) && this.Module.DesktopModule.IsPortable) { try { - var objObject = Reflection.CreateObject(Module.DesktopModule.BusinessControllerClass, Module.DesktopModule.BusinessControllerClass); + var objObject = Reflection.CreateObject(this.Module.DesktopModule.BusinessControllerClass, this.Module.DesktopModule.BusinessControllerClass); if (objObject is IPortable) { var xmlDoc = new XmlDocument { XmlResolver = null }; try { - var content = XmlUtils.RemoveInvalidXmlCharacters(txtContent.Text); + var content = XmlUtils.RemoveInvalidXmlCharacters(this.txtContent.Text); xmlDoc.LoadXml(content); } catch { - strMessage = Localization.GetString("NotValidXml", LocalResourceFile); + strMessage = Localization.GetString("NotValidXml", this.LocalResourceFile); } if (String.IsNullOrEmpty(strMessage)) { var strType = xmlDoc.DocumentElement.GetAttribute("type"); - if (strType == Globals.CleanName(Module.DesktopModule.ModuleName) || strType == Globals.CleanName(Module.DesktopModule.FriendlyName)) + if (strType == Globals.CleanName(this.Module.DesktopModule.ModuleName) || strType == Globals.CleanName(this.Module.DesktopModule.FriendlyName)) { var strVersion = xmlDoc.DocumentElement.GetAttribute("version"); // DNN26810 if rootnode = "content", import only content(the old way) if (xmlDoc.DocumentElement.Name.ToLowerInvariant() == "content" ) { - ((IPortable)objObject).ImportModule(ModuleId, xmlDoc.DocumentElement.InnerXml, strVersion, UserInfo.UserID); + ((IPortable)objObject).ImportModule(this.ModuleId, xmlDoc.DocumentElement.InnerXml, strVersion, this.UserInfo.UserID); } // otherwise (="module") import the new way else { - ModuleController.DeserializeModule(xmlDoc.DocumentElement, Module, PortalId, TabId); + ModuleController.DeserializeModule(xmlDoc.DocumentElement, this.Module, this.PortalId, this.TabId); } - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } else { - strMessage = Localization.GetString("NotCorrectType", LocalResourceFile); + strMessage = Localization.GetString("NotCorrectType", this.LocalResourceFile); } } } else { - strMessage = Localization.GetString("ImportNotSupported", LocalResourceFile); + strMessage = Localization.GetString("ImportNotSupported", this.LocalResourceFile); } } catch { - strMessage = Localization.GetString("Error", LocalResourceFile); + strMessage = Localization.GetString("Error", this.LocalResourceFile); } } else { - strMessage = Localization.GetString("ImportNotSupported", LocalResourceFile); + strMessage = Localization.GetString("ImportNotSupported", this.LocalResourceFile); } } return strMessage; @@ -134,15 +134,15 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - if (Request.QueryString["moduleid"] != null) + if (this.Request.QueryString["moduleid"] != null) { - Int32.TryParse(Request.QueryString["moduleid"], out ModuleId); + Int32.TryParse(this.Request.QueryString["moduleid"], out this.ModuleId); } //Verify that the current user has access to edit this module - if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "IMPORT", Module)) + if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "IMPORT", this.Module)) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } @@ -150,17 +150,17 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cboFolders.SelectionChanged += OnFoldersIndexChanged; - cboFiles.SelectedIndexChanged += OnFilesIndexChanged; - cmdImport.Click += OnImportClick; + this.cboFolders.SelectionChanged += this.OnFoldersIndexChanged; + this.cboFiles.SelectedIndexChanged += this.OnFilesIndexChanged; + this.cmdImport.Click += this.OnImportClick; try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - cmdCancel.NavigateUrl = ReturnURL; - cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); - cboFolders.Services.Parameters.Add("permission", "ADD"); + this.cmdCancel.NavigateUrl = this.ReturnURL; + this.cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); + this.cboFolders.Services.Parameters.Add("permission", "ADD"); } } catch (Exception exc) @@ -171,65 +171,65 @@ protected override void OnLoad(EventArgs e) protected void OnFoldersIndexChanged(object sender, EventArgs e) { - cboFiles.Items.Clear(); - cboFiles.InsertItem(0, "<" + Localization.GetString("None_Specified") + ">", "-"); - if (cboFolders.SelectedItem == null) + this.cboFiles.Items.Clear(); + this.cboFiles.InsertItem(0, "<" + Localization.GetString("None_Specified") + ">", "-"); + if (this.cboFolders.SelectedItem == null) { return; } - if (Module == null) + if (this.Module == null) { return; } - var folder = FolderManager.Instance.GetFolder(cboFolders.SelectedItemValueAsInt); + var folder = FolderManager.Instance.GetFolder(this.cboFolders.SelectedItemValueAsInt); if (folder == null) return; - var files = Globals.GetFileList(PortalId, "export", false, folder.FolderPath); - files.AddRange(Globals.GetFileList(PortalId, "xml", false, folder.FolderPath)); + var files = Globals.GetFileList(this.PortalId, "export", false, folder.FolderPath); + files.AddRange(Globals.GetFileList(this.PortalId, "xml", false, folder.FolderPath)); foreach (FileItem file in files) { - if (file.Text.IndexOf("content." + Globals.CleanName(Module.DesktopModule.ModuleName) + ".", System.StringComparison.Ordinal) != -1) + if (file.Text.IndexOf("content." + Globals.CleanName(this.Module.DesktopModule.ModuleName) + ".", System.StringComparison.Ordinal) != -1) { - cboFiles.AddItem(file.Text.Replace("content." + Globals.CleanName(Module.DesktopModule.ModuleName) + ".", ""), file.Value); + this.cboFiles.AddItem(file.Text.Replace("content." + Globals.CleanName(this.Module.DesktopModule.ModuleName) + ".", ""), file.Value); } //legacy support for files which used the FriendlyName - if (Globals.CleanName(Module.DesktopModule.ModuleName) == Globals.CleanName(Module.DesktopModule.FriendlyName)) + if (Globals.CleanName(this.Module.DesktopModule.ModuleName) == Globals.CleanName(this.Module.DesktopModule.FriendlyName)) { continue; } - if (file.Text.IndexOf("content." + Globals.CleanName(Module.DesktopModule.FriendlyName) + ".", System.StringComparison.Ordinal) != -1) + if (file.Text.IndexOf("content." + Globals.CleanName(this.Module.DesktopModule.FriendlyName) + ".", System.StringComparison.Ordinal) != -1) { - cboFiles.AddItem(file.Text.Replace("content." + Globals.CleanName(Module.DesktopModule.FriendlyName) + ".", ""), file.Value); + this.cboFiles.AddItem(file.Text.Replace("content." + Globals.CleanName(this.Module.DesktopModule.FriendlyName) + ".", ""), file.Value); } } } protected void OnFilesIndexChanged(object sender, EventArgs e) { - if (cboFolders.SelectedItem == null) return; - var folder = FolderManager.Instance.GetFolder(cboFolders.SelectedItemValueAsInt); + if (this.cboFolders.SelectedItem == null) return; + var folder = FolderManager.Instance.GetFolder(this.cboFolders.SelectedItemValueAsInt); if (folder == null) return; - if (string.IsNullOrEmpty(cboFiles.SelectedValue) || cboFiles.SelectedValue == "-") + if (string.IsNullOrEmpty(this.cboFiles.SelectedValue) || this.cboFiles.SelectedValue == "-") { - txtContent.Text = string.Empty; + this.txtContent.Text = string.Empty; return; } try { - var fileId = Convert.ToInt32(cboFiles.SelectedValue); + var fileId = Convert.ToInt32(this.cboFiles.SelectedValue); var file = DotNetNuke.Services.FileSystem.FileManager.Instance.GetFile(fileId); using (var streamReader = new StreamReader(DotNetNuke.Services.FileSystem.FileManager.Instance.GetFileContent(file))) { - txtContent.Text = streamReader.ReadToEnd(); + this.txtContent.Text = streamReader.ReadToEnd(); } } catch (Exception) { - txtContent.Text = string.Empty; + this.txtContent.Text = string.Empty; } } @@ -237,12 +237,12 @@ protected void OnImportClick(object sender, EventArgs e) { try { - if (Module != null) + if (this.Module != null) { - var strMessage = ImportModule(); + var strMessage = this.ImportModule(); if (String.IsNullOrEmpty(strMessage)) { - Response.Redirect(ReturnURL, true); + this.Response.Redirect(this.ReturnURL, true); } else { diff --git a/DNN Platform/Website/admin/Modules/ModulePermissions.ascx.cs b/DNN Platform/Website/admin/Modules/ModulePermissions.ascx.cs index 362f805d271..ccd90610f08 100644 --- a/DNN Platform/Website/admin/Modules/ModulePermissions.ascx.cs +++ b/DNN Platform/Website/admin/Modules/ModulePermissions.ascx.cs @@ -35,7 +35,7 @@ public partial class ModulePermissions : PortalModuleBase private readonly INavigationManager _navigationManager; public ModulePermissions() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -45,14 +45,14 @@ public ModulePermissions() private ModuleInfo Module { - get { return _module ?? (_module = ModuleController.Instance.GetModule(_moduleId, TabId, false)); } + get { return this._module ?? (this._module = ModuleController.Instance.GetModule(this._moduleId, this.TabId, false)); } } private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(this.Request.Params["ReturnURL"]) ?? this._navigationManager.NavigateURL(); } } @@ -65,15 +65,15 @@ protected override void OnInit(EventArgs e) base.OnInit(e); //get ModuleId - if ((Request.QueryString["ModuleId"] != null)) + if ((this.Request.QueryString["ModuleId"] != null)) { - _moduleId = Int32.Parse(Request.QueryString["ModuleId"]); + this._moduleId = Int32.Parse(this.Request.QueryString["ModuleId"]); } //Verify that the current user has access to edit this module - if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.ViewPermissions, String.Empty, Module)) + if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.ViewPermissions, String.Empty, this.Module)) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } @@ -81,21 +81,21 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdUpdate.Click += OnUpdateClick; + this.cmdUpdate.Click += this.OnUpdateClick; try { - cancelHyperLink.NavigateUrl = ReturnURL; + this.cancelHyperLink.NavigateUrl = this.ReturnURL; - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - dgPermissions.TabId = PortalSettings.ActiveTab.TabID; - dgPermissions.ModuleID = _moduleId; + this.dgPermissions.TabId = this.PortalSettings.ActiveTab.TabID; + this.dgPermissions.ModuleID = this._moduleId; - if (Module != null) + if (this.Module != null) { - cmdUpdate.Visible = ModulePermissionController.HasModulePermission(Module.ModulePermissions, "EDIT,MANAGE") || TabPermissionController.CanAddContentToPage(); - permissionsRow.Visible = ModulePermissionController.CanAdminModule(Module) || TabPermissionController.CanAddContentToPage(); + this.cmdUpdate.Visible = ModulePermissionController.HasModulePermission(this.Module.ModulePermissions, "EDIT,MANAGE") || TabPermissionController.CanAddContentToPage(); + this.permissionsRow.Visible = ModulePermissionController.CanAdminModule(this.Module) || TabPermissionController.CanAddContentToPage(); } } } @@ -109,15 +109,15 @@ protected void OnUpdateClick(object sender, EventArgs e) { try { - if (Page.IsValid) + if (this.Page.IsValid) { - Module.ModulePermissions.Clear(); - Module.ModulePermissions.AddRange(dgPermissions.Permissions); + this.Module.ModulePermissions.Clear(); + this.Module.ModulePermissions.AddRange(this.dgPermissions.Permissions); - ModulePermissionController.SaveModulePermissions(Module); + ModulePermissionController.SaveModulePermissions(this.Module); //Navigate back to admin page - Response.Redirect(ReturnURL, true); + this.Response.Redirect(this.ReturnURL, true); } } catch (Exception exc) diff --git a/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs b/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs index 4978fa5cd36..f4f57e3a258 100644 --- a/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs +++ b/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs @@ -50,7 +50,7 @@ public partial class ModuleSettingsPage : PortalModuleBase private readonly INavigationManager _navigationManager; public ModuleSettingsPage() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -59,20 +59,20 @@ public ModuleSettingsPage() private Control _control; private ModuleInfo _module; - private bool HideDeleteButton => Request.QueryString["HideDelete"] == "true"; - private bool HideCancelButton => Request.QueryString["HideCancel"] == "true"; - private bool DoNotRedirectOnUpdate => Request.QueryString["NoRedirectOnUpdate"] == "true"; + private bool HideDeleteButton => this.Request.QueryString["HideDelete"] == "true"; + private bool HideCancelButton => this.Request.QueryString["HideCancel"] == "true"; + private bool DoNotRedirectOnUpdate => this.Request.QueryString["NoRedirectOnUpdate"] == "true"; private ModuleInfo Module { - get { return _module ?? (_module = ModuleController.Instance.GetModule(_moduleId, TabId, false)); } + get { return this._module ?? (this._module = ModuleController.Instance.GetModule(this._moduleId, this.TabId, false)); } } private ISettingsControl SettingsControl { get { - return _control as ISettingsControl; + return this._control as ISettingsControl; } } @@ -80,7 +80,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(this.Request.Params["ReturnURL"]) ?? this._navigationManager.NavigateURL(); } } @@ -90,141 +90,141 @@ private string ReturnURL private void BindData() { - if (Module != null) + if (this.Module != null) { - var desktopModule = DesktopModuleController.GetDesktopModule(Module.DesktopModuleID, PortalId); - dgPermissions.ResourceFile = Globals.ApplicationPath + "/DesktopModules/" + desktopModule.FolderName + "/" + Localization.LocalResourceDirectory + "/" + + var desktopModule = DesktopModuleController.GetDesktopModule(this.Module.DesktopModuleID, this.PortalId); + this.dgPermissions.ResourceFile = Globals.ApplicationPath + "/DesktopModules/" + desktopModule.FolderName + "/" + Localization.LocalResourceDirectory + "/" + Localization.LocalSharedResourceFile; - if (!Module.IsShared) + if (!this.Module.IsShared) { - chkInheritPermissions.Checked = Module.InheritViewPermissions; - dgPermissions.InheritViewPermissionsFromTab = Module.InheritViewPermissions; + this.chkInheritPermissions.Checked = this.Module.InheritViewPermissions; + this.dgPermissions.InheritViewPermissionsFromTab = this.Module.InheritViewPermissions; } - txtFriendlyName.Text = Module.DesktopModule.FriendlyName; - txtTitle.Text = Module.ModuleTitle; - ctlIcon.Url = Module.IconFile; + this.txtFriendlyName.Text = this.Module.DesktopModule.FriendlyName; + this.txtTitle.Text = this.Module.ModuleTitle; + this.ctlIcon.Url = this.Module.IconFile; - if (cboTab.FindItemByValue(Module.TabID.ToString()) != null) + if (this.cboTab.FindItemByValue(this.Module.TabID.ToString()) != null) { - cboTab.FindItemByValue(Module.TabID.ToString()).Selected = true; + this.cboTab.FindItemByValue(this.Module.TabID.ToString()).Selected = true; } - rowTab.Visible = cboTab.Items.Count != 1; - chkAllTabs.Checked = Module.AllTabs; - trnewPages.Visible = chkAllTabs.Checked; - allowIndexRow.Visible = desktopModule.IsSearchable; - chkAllowIndex.Checked = GetBooleanSetting("AllowIndex", true); - txtMoniker.Text = (string)Settings["Moniker"] ?? ""; + this.rowTab.Visible = this.cboTab.Items.Count != 1; + this.chkAllTabs.Checked = this.Module.AllTabs; + this.trnewPages.Visible = this.chkAllTabs.Checked; + this.allowIndexRow.Visible = desktopModule.IsSearchable; + this.chkAllowIndex.Checked = this.GetBooleanSetting("AllowIndex", true); + this.txtMoniker.Text = (string)this.Settings["Moniker"] ?? ""; - cboVisibility.SelectedIndex = (int)Module.Visibility; - chkAdminBorder.Checked = Settings["hideadminborder"] != null && bool.Parse(Settings["hideadminborder"].ToString()); + this.cboVisibility.SelectedIndex = (int)this.Module.Visibility; + this.chkAdminBorder.Checked = this.Settings["hideadminborder"] != null && bool.Parse(this.Settings["hideadminborder"].ToString()); - var objModuleDef = ModuleDefinitionController.GetModuleDefinitionByID(Module.ModuleDefID); + var objModuleDef = ModuleDefinitionController.GetModuleDefinitionByID(this.Module.ModuleDefID); if (objModuleDef.DefaultCacheTime == Null.NullInteger) { - cacheWarningRow.Visible = true; - txtCacheDuration.Text = Module.CacheTime.ToString(); + this.cacheWarningRow.Visible = true; + this.txtCacheDuration.Text = this.Module.CacheTime.ToString(); } else { - cacheWarningRow.Visible = false; - txtCacheDuration.Text = Module.CacheTime.ToString(); + this.cacheWarningRow.Visible = false; + this.txtCacheDuration.Text = this.Module.CacheTime.ToString(); } - BindModuleCacheProviderList(); + this.BindModuleCacheProviderList(); - ShowCacheRows(); + this.ShowCacheRows(); - cboAlign.Items.FindByValue(Module.Alignment).Selected = true; - txtColor.Text = Module.Color; - txtBorder.Text = Module.Border; + this.cboAlign.Items.FindByValue(this.Module.Alignment).Selected = true; + this.txtColor.Text = this.Module.Color; + this.txtBorder.Text = this.Module.Border; - txtHeader.Text = Module.Header; - txtFooter.Text = Module.Footer; + this.txtHeader.Text = this.Module.Header; + this.txtFooter.Text = this.Module.Footer; - if (!Null.IsNull(Module.StartDate)) + if (!Null.IsNull(this.Module.StartDate)) { - startDatePicker.SelectedDate = Module.StartDate; + this.startDatePicker.SelectedDate = this.Module.StartDate; } - if (!Null.IsNull(Module.EndDate) && Module.EndDate <= endDatePicker.MaxDate) + if (!Null.IsNull(this.Module.EndDate) && this.Module.EndDate <= this.endDatePicker.MaxDate) { - endDatePicker.SelectedDate = Module.EndDate; + this.endDatePicker.SelectedDate = this.Module.EndDate; } - BindContainers(); + this.BindContainers(); - chkDisplayTitle.Checked = Module.DisplayTitle; - chkDisplayPrint.Checked = Module.DisplayPrint; - chkDisplaySyndicate.Checked = Module.DisplaySyndicate; + this.chkDisplayTitle.Checked = this.Module.DisplayTitle; + this.chkDisplayPrint.Checked = this.Module.DisplayPrint; + this.chkDisplaySyndicate.Checked = this.Module.DisplaySyndicate; - chkWebSlice.Checked = Module.IsWebSlice; - webSliceTitle.Visible = Module.IsWebSlice; - webSliceExpiry.Visible = Module.IsWebSlice; - webSliceTTL.Visible = Module.IsWebSlice; + this.chkWebSlice.Checked = this.Module.IsWebSlice; + this.webSliceTitle.Visible = this.Module.IsWebSlice; + this.webSliceExpiry.Visible = this.Module.IsWebSlice; + this.webSliceTTL.Visible = this.Module.IsWebSlice; - txtWebSliceTitle.Text = Module.WebSliceTitle; - if (!Null.IsNull(Module.WebSliceExpiryDate)) + this.txtWebSliceTitle.Text = this.Module.WebSliceTitle; + if (!Null.IsNull(this.Module.WebSliceExpiryDate)) { - diWebSliceExpiry.SelectedDate = Module.WebSliceExpiryDate; + this.diWebSliceExpiry.SelectedDate = this.Module.WebSliceExpiryDate; } - if (!Null.IsNull(Module.WebSliceTTL)) + if (!Null.IsNull(this.Module.WebSliceTTL)) { - txtWebSliceTTL.Text = Module.WebSliceTTL.ToString(); + this.txtWebSliceTTL.Text = this.Module.WebSliceTTL.ToString(); } - if (Module.ModuleID == PortalSettings.Current.DefaultModuleId && Module.TabID == PortalSettings.Current.DefaultTabId) + if (this.Module.ModuleID == PortalSettings.Current.DefaultModuleId && this.Module.TabID == PortalSettings.Current.DefaultTabId) { - chkDefault.Checked = true; + this.chkDefault.Checked = true; } - if (!Module.IsShared && Module.DesktopModule.Shareable != ModuleSharing.Unsupported) + if (!this.Module.IsShared && this.Module.DesktopModule.Shareable != ModuleSharing.Unsupported) { - isShareableCheckBox.Checked = Module.IsShareable; - isShareableViewOnlyCheckBox.Checked = Module.IsShareableViewOnly; - isShareableRow.Visible = true; + this.isShareableCheckBox.Checked = this.Module.IsShareable; + this.isShareableViewOnlyCheckBox.Checked = this.Module.IsShareableViewOnly; + this.isShareableRow.Visible = true; - chkInheritPermissions.Visible = true; + this.chkInheritPermissions.Visible = true; } } } private void BindContainers() { - moduleContainerCombo.PortalId = PortalId; - moduleContainerCombo.RootPath = SkinController.RootContainer; - moduleContainerCombo.Scope = SkinScope.All; - moduleContainerCombo.IncludeNoneSpecificItem = true; - moduleContainerCombo.NoneSpecificText = "<" + Localization.GetString("None_Specified") + ">"; - moduleContainerCombo.SelectedValue = Module.ContainerSrc; + this.moduleContainerCombo.PortalId = this.PortalId; + this.moduleContainerCombo.RootPath = SkinController.RootContainer; + this.moduleContainerCombo.Scope = SkinScope.All; + this.moduleContainerCombo.IncludeNoneSpecificItem = true; + this.moduleContainerCombo.NoneSpecificText = "<" + Localization.GetString("None_Specified") + ">"; + this.moduleContainerCombo.SelectedValue = this.Module.ContainerSrc; } private void BindModulePages() { - var tabsByModule = TabController.Instance.GetTabsByModuleID(_moduleId); - tabsByModule.Remove(TabId); - dgOnTabs.DataSource = tabsByModule.Values; - dgOnTabs.DataBind(); + var tabsByModule = TabController.Instance.GetTabsByModuleID(this._moduleId); + tabsByModule.Remove(this.TabId); + this.dgOnTabs.DataSource = tabsByModule.Values; + this.dgOnTabs.DataBind(); } private void BindModuleCacheProviderList() { - cboCacheProvider.DataSource = GetFilteredProviders(ModuleCachingProvider.GetProviderList(), "ModuleCachingProvider"); - cboCacheProvider.DataBind(); + this.cboCacheProvider.DataSource = this.GetFilteredProviders(ModuleCachingProvider.GetProviderList(), "ModuleCachingProvider"); + this.cboCacheProvider.DataBind(); //cboCacheProvider.Items.Insert(0, new ListItem(Localization.GetString("None_Specified"), "")); - cboCacheProvider.InsertItem(0, Localization.GetString("None_Specified"), ""); + this.cboCacheProvider.InsertItem(0, Localization.GetString("None_Specified"), ""); //if (!string.IsNullOrEmpty(Module.GetEffectiveCacheMethod()) && cboCacheProvider.Items.FindByValue(Module.GetEffectiveCacheMethod()) != null) - if (!string.IsNullOrEmpty(Module.GetEffectiveCacheMethod()) && cboCacheProvider.FindItemByValue(Module.GetEffectiveCacheMethod()) != null) + if (!string.IsNullOrEmpty(this.Module.GetEffectiveCacheMethod()) && this.cboCacheProvider.FindItemByValue(this.Module.GetEffectiveCacheMethod()) != null) { //cboCacheProvider.Items.FindByValue(Module.GetEffectiveCacheMethod()).Selected = true; - cboCacheProvider.FindItemByValue(Module.GetEffectiveCacheMethod()).Selected = true; + this.cboCacheProvider.FindItemByValue(this.Module.GetEffectiveCacheMethod()).Selected = true; } else { //select the None Specified value - cboCacheProvider.Items[0].Selected = true; + this.cboCacheProvider.Items[0].Selected = true; } - lblCacheInherited.Visible = Module.CacheMethod != Module.GetEffectiveCacheMethod(); + this.lblCacheInherited.Visible = this.Module.CacheMethod != this.Module.GetEffectiveCacheMethod(); } private IEnumerable GetFilteredProviders(Dictionary providerList, string keyFilter) @@ -236,12 +236,12 @@ private IEnumerable GetFilteredProviders(Dictionary providerList, private void ShowCacheRows() { - divCacheDuration.Visible = !string.IsNullOrEmpty(cboCacheProvider.SelectedValue); + this.divCacheDuration.Visible = !string.IsNullOrEmpty(this.cboCacheProvider.SelectedValue); } private bool GetBooleanSetting(string settingName, bool defaultValue) { - var value = Settings[settingName]; + var value = this.Settings[settingName]; return value == null ? defaultValue @@ -268,7 +268,7 @@ protected string GetInstalledOnLink(object dataItem) PortalAlias = defaultAlias }; - var tabUrl = _navigationManager.NavigateURL(tab.TabID, portalSettings, string.Empty); + var tabUrl = this._navigationManager.NavigateURL(tab.TabID, portalSettings, string.Empty); foreach (TabInfo t in tab.BreadCrumbs) { @@ -307,7 +307,7 @@ protected string GetInstalledOnSite(object dataItem) protected bool IsSharedViewOnly() { - return ModuleContext.Configuration.IsShared && ModuleContext.Configuration.IsShareableViewOnly; + return this.ModuleContext.Configuration.IsShared && this.ModuleContext.Configuration.IsShareableViewOnly; } #endregion @@ -319,61 +319,61 @@ protected override void OnInit(EventArgs e) base.OnInit(e); try { - chkAllTabs.CheckedChanged += OnAllTabsCheckChanged; - chkInheritPermissions.CheckedChanged += OnInheritPermissionsChanged; - chkWebSlice.CheckedChanged += OnWebSliceCheckChanged; - cboCacheProvider.TextChanged += OnCacheProviderIndexChanged; - cmdDelete.Click += OnDeleteClick; - cmdUpdate.Click += OnUpdateClick; + this.chkAllTabs.CheckedChanged += this.OnAllTabsCheckChanged; + this.chkInheritPermissions.CheckedChanged += this.OnInheritPermissionsChanged; + this.chkWebSlice.CheckedChanged += this.OnWebSliceCheckChanged; + this.cboCacheProvider.TextChanged += this.OnCacheProviderIndexChanged; + this.cmdDelete.Click += this.OnDeleteClick; + this.cmdUpdate.Click += this.OnUpdateClick; JavaScript.RequestRegistration(CommonJs.DnnPlugins); //get ModuleId - if ((Request.QueryString["ModuleId"] != null)) + if ((this.Request.QueryString["ModuleId"] != null)) { - _moduleId = Int32.Parse(Request.QueryString["ModuleId"]); + this._moduleId = Int32.Parse(this.Request.QueryString["ModuleId"]); } - if (Module.ContentItemId == Null.NullInteger && Module.ModuleID != Null.NullInteger) + if (this.Module.ContentItemId == Null.NullInteger && this.Module.ModuleID != Null.NullInteger) { //This tab does not have a valid ContentItem - ModuleController.Instance.CreateContentItem(Module); + ModuleController.Instance.CreateContentItem(this.Module); - ModuleController.Instance.UpdateModule(Module); + ModuleController.Instance.UpdateModule(this.Module); } //Verify that the current user has access to edit this module - if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", Module)) + if (!ModulePermissionController.HasModuleAccess(SecurityAccessLevel.Edit, "MANAGE", this.Module)) { - if (!(IsSharedViewOnly() && TabPermissionController.CanAddContentToPage())) + if (!(this.IsSharedViewOnly() && TabPermissionController.CanAddContentToPage())) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } - if (Module != null) + if (this.Module != null) { //get module - TabModuleId = Module.TabModuleID; + this.TabModuleId = this.Module.TabModuleID; //get Settings Control - ModuleControlInfo moduleControlInfo = ModuleControlController.GetModuleControlByControlKey("Settings", Module.ModuleDefID); + ModuleControlInfo moduleControlInfo = ModuleControlController.GetModuleControlByControlKey("Settings", this.Module.ModuleDefID); if (moduleControlInfo != null) { - _control = ModuleControlFactory.LoadSettingsControl(Page, Module, moduleControlInfo.ControlSrc); + this._control = ModuleControlFactory.LoadSettingsControl(this.Page, this.Module, moduleControlInfo.ControlSrc); - var settingsControl = _control as ISettingsControl; + var settingsControl = this._control as ISettingsControl; if (settingsControl != null) { - hlSpecificSettings.Text = Localization.GetString("ControlTitle_settings", + this.hlSpecificSettings.Text = Localization.GetString("ControlTitle_settings", settingsControl.LocalResourceFile); - if (String.IsNullOrEmpty(hlSpecificSettings.Text)) + if (String.IsNullOrEmpty(this.hlSpecificSettings.Text)) { - hlSpecificSettings.Text = - String.Format(Localization.GetString("ControlTitle_settings", LocalResourceFile), - Module.DesktopModule.FriendlyName); + this.hlSpecificSettings.Text = + String.Format(Localization.GetString("ControlTitle_settings", this.LocalResourceFile), + this.Module.DesktopModule.FriendlyName); } - pnlSpecific.Controls.Add(_control); + this.pnlSpecific.Controls.Add(this._control); } } } @@ -390,104 +390,104 @@ protected override void OnLoad(EventArgs e) try { - cancelHyperLink.NavigateUrl = ReturnURL; + this.cancelHyperLink.NavigateUrl = this.ReturnURL; - if (_moduleId != -1) + if (this._moduleId != -1) { - ctlAudit.Entity = Module; + this.ctlAudit.Entity = this.Module; } - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - ctlIcon.FileFilter = Globals.glbImageFileTypes; + this.ctlIcon.FileFilter = Globals.glbImageFileTypes; - dgPermissions.TabId = PortalSettings.ActiveTab.TabID; - dgPermissions.ModuleID = _moduleId; + this.dgPermissions.TabId = this.PortalSettings.ActiveTab.TabID; + this.dgPermissions.ModuleID = this._moduleId; - BindModulePages(); + this.BindModulePages(); - cboTab.DataSource = TabController.GetPortalTabs(PortalId, -1, false, Null.NullString, true, false, true, false, true); - cboTab.DataBind(); + this.cboTab.DataSource = TabController.GetPortalTabs(this.PortalId, -1, false, Null.NullString, true, false, true, false, true); + this.cboTab.DataBind(); //if tab is a host tab, then add current tab - if (Globals.IsHostTab(PortalSettings.ActiveTab.TabID)) + if (Globals.IsHostTab(this.PortalSettings.ActiveTab.TabID)) { - cboTab.InsertItem(0, PortalSettings.ActiveTab.LocalizedTabName, PortalSettings.ActiveTab.TabID.ToString()); + this.cboTab.InsertItem(0, this.PortalSettings.ActiveTab.LocalizedTabName, this.PortalSettings.ActiveTab.TabID.ToString()); } - if (Module != null) + if (this.Module != null) { - if (cboTab.FindItemByValue(Module.TabID.ToString()) == null) + if (this.cboTab.FindItemByValue(this.Module.TabID.ToString()) == null) { - var objTab = TabController.Instance.GetTab(Module.TabID, Module.PortalID, false); - cboTab.AddItem(objTab.LocalizedTabName, objTab.TabID.ToString()); + var objTab = TabController.Instance.GetTab(this.Module.TabID, this.Module.PortalID, false); + this.cboTab.AddItem(objTab.LocalizedTabName, objTab.TabID.ToString()); } } //only Portal Administrators can manage the visibility on all Tabs var isAdmin = PermissionProvider.Instance().IsPortalEditor(); - rowAllTabs.Visible = isAdmin; - chkAllModules.Enabled = isAdmin; + this.rowAllTabs.Visible = isAdmin; + this.chkAllModules.Enabled = isAdmin; - if (HideCancelButton) + if (this.HideCancelButton) { - cancelHyperLink.Visible = false; + this.cancelHyperLink.Visible = false; } //tab administrators can only manage their own tab if (!TabPermissionController.CanAdminPage()) { - chkNewTabs.Enabled = false; - chkDefault.Enabled = false; - chkAllowIndex.Enabled = false; - cboTab.Enabled = false; + this.chkNewTabs.Enabled = false; + this.chkDefault.Enabled = false; + this.chkAllowIndex.Enabled = false; + this.cboTab.Enabled = false; } - if (_moduleId != -1) + if (this._moduleId != -1) { - BindData(); - cmdDelete.Visible = (ModulePermissionController.CanDeleteModule(Module) || - TabPermissionController.CanAddContentToPage()) && !HideDeleteButton; + this.BindData(); + this.cmdDelete.Visible = (ModulePermissionController.CanDeleteModule(this.Module) || + TabPermissionController.CanAddContentToPage()) && !this.HideDeleteButton; } else { - isShareableCheckBox.Checked = true; - isShareableViewOnlyCheckBox.Checked = true; - isShareableRow.Visible = true; + this.isShareableCheckBox.Checked = true; + this.isShareableViewOnlyCheckBox.Checked = true; + this.isShareableRow.Visible = true; - cboVisibility.SelectedIndex = 0; //maximized - chkAllTabs.Checked = false; - cmdDelete.Visible = false; + this.cboVisibility.SelectedIndex = 0; //maximized + this.chkAllTabs.Checked = false; + this.cmdDelete.Visible = false; } - if (Module != null) + if (this.Module != null) { - cmdUpdate.Visible = ModulePermissionController.HasModulePermission(Module.ModulePermissions, "EDIT,MANAGE") || TabPermissionController.CanAddContentToPage(); - permissionsRow.Visible = ModulePermissionController.CanAdminModule(Module) || TabPermissionController.CanAddContentToPage(); + this.cmdUpdate.Visible = ModulePermissionController.HasModulePermission(this.Module.ModulePermissions, "EDIT,MANAGE") || TabPermissionController.CanAddContentToPage(); + this.permissionsRow.Visible = ModulePermissionController.CanAdminModule(this.Module) || TabPermissionController.CanAddContentToPage(); } //Set visibility of Specific Settings - if (SettingsControl == null == false) + if (this.SettingsControl == null == false) { //Get the module settings from the PortalSettings and pass the //two settings hashtables to the sub control to process - SettingsControl.LoadSettings(); - specificSettingsTab.Visible = true; - fsSpecific.Visible = true; + this.SettingsControl.LoadSettings(); + this.specificSettingsTab.Visible = true; + this.fsSpecific.Visible = true; } else { - specificSettingsTab.Visible = false; - fsSpecific.Visible = false; + this.specificSettingsTab.Visible = false; + this.fsSpecific.Visible = false; } - if (Module != null) + if (this.Module != null) { - termsSelector.PortalId = Module.PortalID; - termsSelector.Terms = Module.Terms; + this.termsSelector.PortalId = this.Module.PortalID; + this.termsSelector.Terms = this.Module.Terms; } - termsSelector.DataBind(); + this.termsSelector.DataBind(); } - if (Module != null) + if (this.Module != null) { - cultureLanguageLabel.Language = Module.CultureCode; + this.cultureLanguageLabel.Language = this.Module.CultureCode; } } catch (Exception exc) @@ -498,20 +498,20 @@ protected override void OnLoad(EventArgs e) protected void OnAllTabsCheckChanged(object sender, EventArgs e) { - trnewPages.Visible = chkAllTabs.Checked; + this.trnewPages.Visible = this.chkAllTabs.Checked; } protected void OnCacheProviderIndexChanged(object sender, EventArgs e) { - ShowCacheRows(); + this.ShowCacheRows(); } protected void OnDeleteClick(Object sender, EventArgs e) { try { - ModuleController.Instance.DeleteTabModule(TabId, _moduleId, true); - Response.Redirect(ReturnURL, true); + ModuleController.Instance.DeleteTabModule(this.TabId, this._moduleId, true); + this.Response.Redirect(this.ReturnURL, true); } catch (Exception exc) { @@ -521,138 +521,138 @@ protected void OnDeleteClick(Object sender, EventArgs e) protected void OnInheritPermissionsChanged(Object sender, EventArgs e) { - dgPermissions.InheritViewPermissionsFromTab = chkInheritPermissions.Checked; + this.dgPermissions.InheritViewPermissionsFromTab = this.chkInheritPermissions.Checked; } protected void OnUpdateClick(object sender, EventArgs e) { try { - if (Page.IsValid) + if (this.Page.IsValid) { var allTabsChanged = false; //only Portal Administrators can manage the visibility on all Tabs - var isAdmin = PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName); - chkAllModules.Enabled = isAdmin; + var isAdmin = PortalSecurity.IsInRole(this.PortalSettings.AdministratorRoleName); + this.chkAllModules.Enabled = isAdmin; //tab administrators can only manage their own tab if (!TabPermissionController.CanAdminPage()) { - chkAllTabs.Enabled = false; - chkNewTabs.Enabled = false; - chkDefault.Enabled = false; - chkAllowIndex.Enabled = false; - cboTab.Enabled = false; + this.chkAllTabs.Enabled = false; + this.chkNewTabs.Enabled = false; + this.chkDefault.Enabled = false; + this.chkAllowIndex.Enabled = false; + this.cboTab.Enabled = false; } - Module.ModuleID = _moduleId; - Module.ModuleTitle = txtTitle.Text; - Module.Alignment = cboAlign.SelectedItem.Value; - Module.Color = txtColor.Text; - Module.Border = txtBorder.Text; - Module.IconFile = ctlIcon.Url; - Module.CacheTime = !String.IsNullOrEmpty(txtCacheDuration.Text) - ? Int32.Parse(txtCacheDuration.Text) + this.Module.ModuleID = this._moduleId; + this.Module.ModuleTitle = this.txtTitle.Text; + this.Module.Alignment = this.cboAlign.SelectedItem.Value; + this.Module.Color = this.txtColor.Text; + this.Module.Border = this.txtBorder.Text; + this.Module.IconFile = this.ctlIcon.Url; + this.Module.CacheTime = !String.IsNullOrEmpty(this.txtCacheDuration.Text) + ? Int32.Parse(this.txtCacheDuration.Text) : 0; - Module.CacheMethod = cboCacheProvider.SelectedValue; - Module.TabID = TabId; - if (Module.AllTabs != chkAllTabs.Checked) + this.Module.CacheMethod = this.cboCacheProvider.SelectedValue; + this.Module.TabID = this.TabId; + if (this.Module.AllTabs != this.chkAllTabs.Checked) { allTabsChanged = true; } - Module.AllTabs = chkAllTabs.Checked; + this.Module.AllTabs = this.chkAllTabs.Checked; // collect these first as any settings update will clear the cache - var originalChecked = Settings["hideadminborder"] != null && bool.Parse(Settings["hideadminborder"].ToString()); - var allowIndex = GetBooleanSetting("AllowIndex", true); - var oldMoniker = ((string)Settings["Moniker"] ?? "").TrimToLength(100); - var newMoniker = txtMoniker.Text.TrimToLength(100); - if (!oldMoniker.Equals(txtMoniker.Text)) + var originalChecked = this.Settings["hideadminborder"] != null && bool.Parse(this.Settings["hideadminborder"].ToString()); + var allowIndex = this.GetBooleanSetting("AllowIndex", true); + var oldMoniker = ((string)this.Settings["Moniker"] ?? "").TrimToLength(100); + var newMoniker = this.txtMoniker.Text.TrimToLength(100); + if (!oldMoniker.Equals(this.txtMoniker.Text)) { var ids = TabModulesController.Instance.GetTabModuleIdsBySetting("Moniker", newMoniker); if (ids != null && ids.Count > 0) { //Warn user - duplicate moniker value - Skin.AddModuleMessage(this, Localization.GetString("MonikerExists", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + Skin.AddModuleMessage(this, Localization.GetString("MonikerExists", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } - ModuleController.Instance.UpdateTabModuleSetting(Module.TabModuleID, "Moniker", newMoniker); + ModuleController.Instance.UpdateTabModuleSetting(this.Module.TabModuleID, "Moniker", newMoniker); } - if (originalChecked != chkAdminBorder.Checked) + if (originalChecked != this.chkAdminBorder.Checked) { - ModuleController.Instance.UpdateTabModuleSetting(Module.TabModuleID, "hideadminborder", chkAdminBorder.Checked.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.Module.TabModuleID, "hideadminborder", this.chkAdminBorder.Checked.ToString()); } //check whether allow index value is changed - if (allowIndex != chkAllowIndex.Checked) + if (allowIndex != this.chkAllowIndex.Checked) { - ModuleController.Instance.UpdateTabModuleSetting(Module.TabModuleID, "AllowIndex", chkAllowIndex.Checked.ToString()); + ModuleController.Instance.UpdateTabModuleSetting(this.Module.TabModuleID, "AllowIndex", this.chkAllowIndex.Checked.ToString()); } - switch (Int32.Parse(cboVisibility.SelectedItem.Value)) + switch (Int32.Parse(this.cboVisibility.SelectedItem.Value)) { case 0: - Module.Visibility = VisibilityState.Maximized; + this.Module.Visibility = VisibilityState.Maximized; break; case 1: - Module.Visibility = VisibilityState.Minimized; + this.Module.Visibility = VisibilityState.Minimized; break; //case 2: default: - Module.Visibility = VisibilityState.None; + this.Module.Visibility = VisibilityState.None; break; } - Module.IsDeleted = false; - Module.Header = txtHeader.Text; - Module.Footer = txtFooter.Text; + this.Module.IsDeleted = false; + this.Module.Header = this.txtHeader.Text; + this.Module.Footer = this.txtFooter.Text; - Module.StartDate = startDatePicker.SelectedDate != null - ? startDatePicker.SelectedDate.Value + this.Module.StartDate = this.startDatePicker.SelectedDate != null + ? this.startDatePicker.SelectedDate.Value : Null.NullDate; - Module.EndDate = endDatePicker.SelectedDate != null - ? endDatePicker.SelectedDate.Value + this.Module.EndDate = this.endDatePicker.SelectedDate != null + ? this.endDatePicker.SelectedDate.Value : Null.NullDate; - Module.ContainerSrc = moduleContainerCombo.SelectedValue; - Module.ModulePermissions.Clear(); - Module.ModulePermissions.AddRange(dgPermissions.Permissions); - Module.Terms.Clear(); - Module.Terms.AddRange(termsSelector.Terms); + this.Module.ContainerSrc = this.moduleContainerCombo.SelectedValue; + this.Module.ModulePermissions.Clear(); + this.Module.ModulePermissions.AddRange(this.dgPermissions.Permissions); + this.Module.Terms.Clear(); + this.Module.Terms.AddRange(this.termsSelector.Terms); - if (!Module.IsShared) + if (!this.Module.IsShared) { - Module.InheritViewPermissions = chkInheritPermissions.Checked; - Module.IsShareable = isShareableCheckBox.Checked; - Module.IsShareableViewOnly = isShareableViewOnlyCheckBox.Checked; + this.Module.InheritViewPermissions = this.chkInheritPermissions.Checked; + this.Module.IsShareable = this.isShareableCheckBox.Checked; + this.Module.IsShareableViewOnly = this.isShareableViewOnlyCheckBox.Checked; } - Module.DisplayTitle = chkDisplayTitle.Checked; - Module.DisplayPrint = chkDisplayPrint.Checked; - Module.DisplaySyndicate = chkDisplaySyndicate.Checked; - Module.IsWebSlice = chkWebSlice.Checked; - Module.WebSliceTitle = txtWebSliceTitle.Text; + this.Module.DisplayTitle = this.chkDisplayTitle.Checked; + this.Module.DisplayPrint = this.chkDisplayPrint.Checked; + this.Module.DisplaySyndicate = this.chkDisplaySyndicate.Checked; + this.Module.IsWebSlice = this.chkWebSlice.Checked; + this.Module.WebSliceTitle = this.txtWebSliceTitle.Text; - Module.WebSliceExpiryDate = diWebSliceExpiry.SelectedDate != null - ? diWebSliceExpiry.SelectedDate.Value + this.Module.WebSliceExpiryDate = this.diWebSliceExpiry.SelectedDate != null + ? this.diWebSliceExpiry.SelectedDate.Value : Null.NullDate; - if (!string.IsNullOrEmpty(txtWebSliceTTL.Text)) + if (!string.IsNullOrEmpty(this.txtWebSliceTTL.Text)) { - Module.WebSliceTTL = Convert.ToInt32(txtWebSliceTTL.Text); + this.Module.WebSliceTTL = Convert.ToInt32(this.txtWebSliceTTL.Text); } - Module.IsDefaultModule = chkDefault.Checked; - Module.AllModules = chkAllModules.Checked; - ModuleController.Instance.UpdateModule(Module); + this.Module.IsDefaultModule = this.chkDefault.Checked; + this.Module.AllModules = this.chkAllModules.Checked; + ModuleController.Instance.UpdateModule(this.Module); //Update Custom Settings - if (SettingsControl != null) + if (this.SettingsControl != null) { try { - SettingsControl.UpdateSettings(); + this.SettingsControl.UpdateSettings(); } catch (ThreadAbortException exc) { @@ -671,22 +671,22 @@ protected void OnUpdateClick(object sender, EventArgs e) //Updates to the Module have been carried out. //Check if the Module is to be Moved to a new Tab - if (!chkAllTabs.Checked) + if (!this.chkAllTabs.Checked) { - var newTabId = Int32.Parse(cboTab.SelectedValue); - if (TabId != newTabId) + var newTabId = Int32.Parse(this.cboTab.SelectedValue); + if (this.TabId != newTabId) { //First check if there already is an instance of the module on the target page - var tmpModule = ModuleController.Instance.GetModule(_moduleId, newTabId, false); + var tmpModule = ModuleController.Instance.GetModule(this._moduleId, newTabId, false); if (tmpModule == null) { //Move module - ModuleController.Instance.MoveModule(_moduleId, TabId, newTabId, Globals.glbDefaultPane); + ModuleController.Instance.MoveModule(this._moduleId, this.TabId, newTabId, Globals.glbDefaultPane); } else { //Warn user - Skin.AddModuleMessage(this, Localization.GetString("ModuleExists", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + Skin.AddModuleMessage(this, Localization.GetString("ModuleExists", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } } @@ -695,14 +695,14 @@ protected void OnUpdateClick(object sender, EventArgs e) //Check if Module is to be Added/Removed from all Tabs if (allTabsChanged) { - var listTabs = TabController.GetPortalTabs(PortalSettings.PortalId, Null.NullInteger, false, true); - if (chkAllTabs.Checked) + var listTabs = TabController.GetPortalTabs(this.PortalSettings.PortalId, Null.NullInteger, false, true); + if (this.chkAllTabs.Checked) { - if (!chkNewTabs.Checked) + if (!this.chkNewTabs.Checked) { foreach (var destinationTab in listTabs) { - var module = ModuleController.Instance.GetModule(_moduleId, destinationTab.TabID, false); + var module = ModuleController.Instance.GetModule(this._moduleId, destinationTab.TabID, false); if (module != null) { if (module.IsDeleted) @@ -712,9 +712,9 @@ protected void OnUpdateClick(object sender, EventArgs e) } else { - if (!PortalSettings.ContentLocalizationEnabled || (Module.CultureCode == destinationTab.CultureCode)) + if (!this.PortalSettings.ContentLocalizationEnabled || (this.Module.CultureCode == destinationTab.CultureCode)) { - ModuleController.Instance.CopyModule(Module, destinationTab, Module.PaneName, true); + ModuleController.Instance.CopyModule(this.Module, destinationTab, this.Module.PaneName, true); } } } @@ -722,14 +722,14 @@ protected void OnUpdateClick(object sender, EventArgs e) } else { - ModuleController.Instance.DeleteAllModules(_moduleId, TabId, listTabs, true, false, false); + ModuleController.Instance.DeleteAllModules(this._moduleId, this.TabId, listTabs, true, false, false); } } - if (!DoNotRedirectOnUpdate) + if (!this.DoNotRedirectOnUpdate) { //Navigate back to admin page - Response.Redirect(ReturnURL, true); + this.Response.Redirect(this.ReturnURL, true); } } } @@ -741,15 +741,15 @@ protected void OnUpdateClick(object sender, EventArgs e) protected void OnWebSliceCheckChanged(object sender, EventArgs e) { - webSliceTitle.Visible = chkWebSlice.Checked; - webSliceExpiry.Visible = chkWebSlice.Checked; - webSliceTTL.Visible = chkWebSlice.Checked; + this.webSliceTitle.Visible = this.chkWebSlice.Checked; + this.webSliceExpiry.Visible = this.chkWebSlice.Checked; + this.webSliceTTL.Visible = this.chkWebSlice.Checked; } protected void dgOnTabs_PageIndexChanging(object sender, System.Web.UI.WebControls.GridViewPageEventArgs e) { - dgOnTabs.PageIndex = e.NewPageIndex; - BindModulePages(); + this.dgOnTabs.PageIndex = e.NewPageIndex; + this.BindModulePages(); } #endregion diff --git a/DNN Platform/Website/admin/Modules/viewsource.ascx.cs b/DNN Platform/Website/admin/Modules/viewsource.ascx.cs index 48473cdf066..2b428e84f1a 100644 --- a/DNN Platform/Website/admin/Modules/viewsource.ascx.cs +++ b/DNN Platform/Website/admin/Modules/viewsource.ascx.cs @@ -25,7 +25,7 @@ public partial class ViewSource : PortalModuleBase private readonly INavigationManager _navigationManager; public ViewSource() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -34,7 +34,7 @@ protected bool CanEditSource { get { - return Request.IsLocal; + return this.Request.IsLocal; } } @@ -43,9 +43,9 @@ protected int ModuleControlId get { var moduleControlId = Null.NullInteger; - if ((Request.QueryString["ctlid"] != null)) + if ((this.Request.QueryString["ctlid"] != null)) { - moduleControlId = Int32.Parse(Request.QueryString["ctlid"]); + moduleControlId = Int32.Parse(this.Request.QueryString["ctlid"]); } return moduleControlId; } @@ -55,7 +55,7 @@ private string ReturnURL { get { - return UrlUtils.ValidReturnUrl(Request.Params["ReturnURL"]) ?? _navigationManager.NavigateURL(); + return UrlUtils.ValidReturnUrl(this.Request.Params["ReturnURL"]) ?? this._navigationManager.NavigateURL(); } } @@ -65,32 +65,32 @@ private string ReturnURL private void BindFiles(string controlSrc) { - cboFile.Items.Clear(); + this.cboFile.Items.Clear(); //cboFile.Items.Add(new ListItem(Localization.GetString("None_Specified"), "None")); //cboFile.Items.Add(new ListItem("User Control", "UserControl")); - cboFile.AddItem(Localization.GetString("None_Specified"), "None"); - cboFile.AddItem("User Control", "UserControl"); + this.cboFile.AddItem(Localization.GetString("None_Specified"), "None"); + this.cboFile.AddItem("User Control", "UserControl"); - var srcPhysicalPath = Server.MapPath(controlSrc); + var srcPhysicalPath = this.Server.MapPath(controlSrc); if (File.Exists(srcPhysicalPath + ".vb") || File.Exists(srcPhysicalPath + ".cs")) { //cboFile.Items.Add(new ListItem("Code File", "CodeFile")); - cboFile.AddItem("Code File", "CodeFile"); + this.cboFile.AddItem("Code File", "CodeFile"); } var fileName = Path.GetFileName(srcPhysicalPath); var folder = Path.GetDirectoryName(srcPhysicalPath); if (File.Exists(folder + "\\App_LocalResources\\" + fileName + ".resx")) { //cboFile.Items.Add(new ListItem("Resource File", "ResourceFile")); - cboFile.AddItem("Resource File", "ResourceFile"); + this.cboFile.AddItem("Resource File", "ResourceFile"); } } private string GetSourceFileName(string controlSrc) { - var srcPhysicalPath = Server.MapPath(controlSrc); + var srcPhysicalPath = this.Server.MapPath(controlSrc); var srcFile = Null.NullString; - switch (cboFile.SelectedValue) + switch (this.cboFile.SelectedValue) { case "UserControl": srcFile = srcPhysicalPath; @@ -116,24 +116,24 @@ private string GetSourceFileName(string controlSrc) private void DisplayFile() { - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); if (objModuleControl != null) { var srcVirtualPath = objModuleControl.ControlSrc; var srcFile = Null.NullString; - var displaySource = cboFile.SelectedValue != "None"; + var displaySource = this.cboFile.SelectedValue != "None"; if (displaySource) { - srcFile = GetSourceFileName(srcVirtualPath); - lblSourceFile.Text = string.Format(Localization.GetString("SourceFile", LocalResourceFile), srcFile); + srcFile = this.GetSourceFileName(srcVirtualPath); + this.lblSourceFile.Text = string.Format(Localization.GetString("SourceFile", this.LocalResourceFile), srcFile); var objStreamReader = File.OpenText(srcFile); - txtSource.Text = objStreamReader.ReadToEnd(); + this.txtSource.Text = objStreamReader.ReadToEnd(); objStreamReader.Close(); } - lblSourceFile.Visible = displaySource; - trSource.Visible = displaySource; + this.lblSourceFile.Visible = displaySource; + this.trSource.Visible = displaySource; } } @@ -145,61 +145,61 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cboFile.SelectedIndexChanged += OnFileIndexChanged; - cmdUpdate.Click += OnUpdateClick; + this.cboFile.SelectedIndexChanged += this.OnFileIndexChanged; + this.cmdUpdate.Click += this.OnUpdateClick; - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - cmdCancel.NavigateUrl = ReturnURL; + this.cmdCancel.NavigateUrl = this.ReturnURL; - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); if (objModuleControl != null) { - BindFiles(objModuleControl.ControlSrc); + this.BindFiles(objModuleControl.ControlSrc); } - if (Request.UrlReferrer != null) + if (this.Request.UrlReferrer != null) { - ViewState["UrlReferrer"] = Convert.ToString(Request.UrlReferrer); + this.ViewState["UrlReferrer"] = Convert.ToString(this.Request.UrlReferrer); } else { - ViewState["UrlReferrer"] = ""; + this.ViewState["UrlReferrer"] = ""; } } - cmdUpdate.Visible = CanEditSource; - txtSource.Enabled = CanEditSource; + this.cmdUpdate.Visible = this.CanEditSource; + this.txtSource.Enabled = this.CanEditSource; } protected void OnFileIndexChanged(object sender, EventArgs e) { - DisplayFile(); + this.DisplayFile(); } private void OnUpdateClick(object sender, EventArgs e) { try { - if (cboFile.SelectedValue == "None") + if (this.cboFile.SelectedValue == "None") { //No file type selected - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NoFileTypeSelected", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NoFileTypeSelected", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } else { - var objModuleControl = ModuleControlController.GetModuleControl(ModuleControlId); + var objModuleControl = ModuleControlController.GetModuleControl(this.ModuleControlId); if (objModuleControl != null) { var srcVirtualPath = objModuleControl.ControlSrc; - var srcPhysicalPath = GetSourceFileName(srcVirtualPath); + var srcPhysicalPath = this.GetSourceFileName(srcVirtualPath); if (File.Exists(srcPhysicalPath)) { File.SetAttributes(srcPhysicalPath, FileAttributes.Normal); var objStream = File.CreateText(srcPhysicalPath); - objStream.WriteLine(txtSource.Text); + objStream.WriteLine(this.txtSource.Text); objStream.Close(); } } - Response.Redirect(ReturnURL, true); + this.Response.Redirect(this.ReturnURL, true); } } catch (Exception exc) //Module failed to load diff --git a/DNN Platform/Website/admin/Portal/Message.ascx.cs b/DNN Platform/Website/admin/Portal/Message.ascx.cs index 61b4df1d966..9ff0392103f 100644 --- a/DNN Platform/Website/admin/Portal/Message.ascx.cs +++ b/DNN Platform/Website/admin/Portal/Message.ascx.cs @@ -16,13 +16,13 @@ public partial class Message : PortalModuleBase { private void InitializeComponent() { - ID = "Message"; + this.ID = "Message"; } protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } } } diff --git a/DNN Platform/Website/admin/Portal/NoContent.ascx.cs b/DNN Platform/Website/admin/Portal/NoContent.ascx.cs index 7059d6ef122..09c65af1d48 100644 --- a/DNN Platform/Website/admin/Portal/NoContent.ascx.cs +++ b/DNN Platform/Website/admin/Portal/NoContent.ascx.cs @@ -22,7 +22,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } } } diff --git a/DNN Platform/Website/admin/Portal/Privacy.ascx.cs b/DNN Platform/Website/admin/Portal/Privacy.ascx.cs index 76ec9c133c0..bbe66b72c01 100644 --- a/DNN Platform/Website/admin/Portal/Privacy.ascx.cs +++ b/DNN Platform/Website/admin/Portal/Privacy.ascx.cs @@ -40,7 +40,7 @@ protected override void OnInit(EventArgs e) //CODEGEN: This method call is required by the Web Form Designer //Do not modify it using the code editor. - InitializeComponent(); + this.InitializeComponent(); } /// ----------------------------------------------------------------------------- @@ -56,9 +56,9 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - lblPrivacy.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_PORTAL_PRIVACY"); + this.lblPrivacy.Text = Localization.GetSystemMessage(this.PortalSettings, "MESSAGE_PORTAL_PRIVACY"); } } catch (Exception exc) //Module failed to load diff --git a/DNN Platform/Website/admin/Portal/Terms.ascx.cs b/DNN Platform/Website/admin/Portal/Terms.ascx.cs index e26374ddb5d..48ce1cb4922 100644 --- a/DNN Platform/Website/admin/Portal/Terms.ascx.cs +++ b/DNN Platform/Website/admin/Portal/Terms.ascx.cs @@ -32,7 +32,7 @@ protected override void OnInit(EventArgs e) //CODEGEN: This method call is required by the Web Form Designer //Do not modify it using the code editor. - InitializeComponent(); + this.InitializeComponent(); } /// The Page_Load server event handler on this page is used to populate the role information for the page @@ -41,9 +41,9 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - lblTerms.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_PORTAL_TERMS"); + this.lblTerms.Text = Localization.GetSystemMessage(this.PortalSettings, "MESSAGE_PORTAL_TERMS"); } } catch (Exception exc) //Module failed to load diff --git a/DNN Platform/Website/admin/Sales/PayPalIPN.aspx.cs b/DNN Platform/Website/admin/Sales/PayPalIPN.aspx.cs index b0b9d4ba489..324fd807dc6 100644 --- a/DNN Platform/Website/admin/Sales/PayPalIPN.aspx.cs +++ b/DNN Platform/Website/admin/Sales/PayPalIPN.aspx.cs @@ -37,7 +37,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) @@ -48,7 +48,7 @@ protected override void OnLoad(EventArgs e) bool blnValid = true; // string strTransactionID; int intRoleID = 0; - int intPortalID = PortalSettings.PortalId; + int intPortalID = this.PortalSettings.PortalId; int intUserID = 0; // string strDescription; double dblAmount = 0; @@ -56,9 +56,9 @@ protected override void OnLoad(EventArgs e) bool blnCancel = false; string strPayPalID = Null.NullString; string strPost = "cmd=_notify-validate"; - foreach (string strName in Request.Form) + foreach (string strName in this.Request.Form) { - string strValue = Request.Form[strName]; + string strValue = this.Request.Form[strName]; switch (strName) { case "txn_type": //get the transaction type @@ -114,7 +114,7 @@ protected override void OnLoad(EventArgs e) //postback to verify the source if (blnValid) { - Dictionary settings = PortalController.Instance.GetPortalSettings(PortalSettings.PortalId); + Dictionary settings = PortalController.Instance.GetPortalSettings(this.PortalSettings.PortalId); string strPayPalURL; // Sandbox mode @@ -178,7 +178,7 @@ protected override void OnLoad(EventArgs e) var log = new LogInfo { LogPortalID = intPortalID, - LogPortalName = PortalSettings.PortalName, + LogPortalName = this.PortalSettings.PortalName, LogUserID = intUserID, LogTypeKey = EventLogController.EventLogType.POTENTIAL_PAYPAL_PAYMENT_FRAUD.ToString() }; @@ -200,7 +200,7 @@ protected override void OnLoad(EventArgs e) var log = new LogInfo { LogPortalID = intPortalID, - LogPortalName = PortalSettings.PortalName, + LogPortalName = this.PortalSettings.PortalName, LogUserID = intUserID, LogTypeKey = EventLogController.EventLogType.POTENTIAL_PAYPAL_PAYMENT_FRAUD.ToString() }; diff --git a/DNN Platform/Website/admin/Sales/PayPalSubscription.aspx.cs b/DNN Platform/Website/admin/Sales/PayPalSubscription.aspx.cs index 3c65f9a790a..a4942c9a4c8 100644 --- a/DNN Platform/Website/admin/Sales/PayPalSubscription.aspx.cs +++ b/DNN Platform/Website/admin/Sales/PayPalSubscription.aspx.cs @@ -33,7 +33,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) @@ -43,7 +43,7 @@ protected override void OnLoad(EventArgs e) { UserInfo objUserInfo = null; int intUserID = -1; - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { objUserInfo = UserController.Instance.GetCurrentUserInfo(); if (objUserInfo != null) @@ -52,17 +52,17 @@ protected override void OnLoad(EventArgs e) } } int intRoleId = -1; - if (Request.QueryString["roleid"] != null) + if (this.Request.QueryString["roleid"] != null) { - intRoleId = int.Parse(Request.QueryString["roleid"]); + intRoleId = int.Parse(this.Request.QueryString["roleid"]); } string strProcessorUserId = ""; - PortalInfo objPortalInfo = PortalController.Instance.GetPortal(PortalSettings.PortalId); + PortalInfo objPortalInfo = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); if (objPortalInfo != null) { strProcessorUserId = objPortalInfo.ProcessorUserId; } - Dictionary settings = PortalController.Instance.GetPortalSettings(PortalSettings.PortalId); + Dictionary settings = PortalController.Instance.GetPortalSettings(this.PortalSettings.PortalId); string strPayPalURL; if (intUserID != -1 && intRoleId != -1 && !String.IsNullOrEmpty(strProcessorUserId)) { @@ -76,7 +76,7 @@ protected override void OnLoad(EventArgs e) strPayPalURL = "https://www.paypal.com/cgi-bin/webscr?"; } - if (Request.QueryString["cancel"] != null) + if (this.Request.QueryString["cancel"] != null) { //build the cancellation PayPal URL strPayPalURL += "cmd=_subscr-find&alias=" + Globals.HTTPPOSTEncode(strProcessorUserId); @@ -84,7 +84,7 @@ protected override void OnLoad(EventArgs e) else { strPayPalURL += "cmd=_ext-enter"; - RoleInfo objRole = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == intRoleId); + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == intRoleId); if (objRole.RoleID != -1) { int intTrialPeriod = 1; @@ -107,21 +107,21 @@ protected override void OnLoad(EventArgs e) //build the payment PayPal URL strPayPalURL += "&redirect_cmd=_xclick&business=" + Globals.HTTPPOSTEncode(strProcessorUserId); strPayPalURL += "&item_name=" + - Globals.HTTPPOSTEncode(PortalSettings.PortalName + " - " + objRole.RoleName + " ( " + objRole.ServiceFee.ToString("#.##") + " " + - PortalSettings.Currency + " )"); + Globals.HTTPPOSTEncode(this.PortalSettings.PortalName + " - " + objRole.RoleName + " ( " + objRole.ServiceFee.ToString("#.##") + " " + + this.PortalSettings.Currency + " )"); strPayPalURL += "&item_number=" + Globals.HTTPPOSTEncode(intRoleId.ToString()); strPayPalURL += "&no_shipping=1&no_note=1"; strPayPalURL += "&quantity=1"; strPayPalURL += "&amount=" + Globals.HTTPPOSTEncode(strService); - strPayPalURL += "¤cy_code=" + Globals.HTTPPOSTEncode(PortalSettings.Currency); + strPayPalURL += "¤cy_code=" + Globals.HTTPPOSTEncode(this.PortalSettings.Currency); } else //recurring payments { //build the subscription PayPal URL strPayPalURL += "&redirect_cmd=_xclick-subscriptions&business=" + Globals.HTTPPOSTEncode(strProcessorUserId); strPayPalURL += "&item_name=" + - Globals.HTTPPOSTEncode(PortalSettings.PortalName + " - " + objRole.RoleName + " ( " + objRole.ServiceFee.ToString("#.##") + " " + - PortalSettings.Currency + " every " + intBillingPeriod + " " + GetBillingFrequencyText(objRole.BillingFrequency) + " )"); + Globals.HTTPPOSTEncode(this.PortalSettings.PortalName + " - " + objRole.RoleName + " ( " + objRole.ServiceFee.ToString("#.##") + " " + + this.PortalSettings.Currency + " every " + intBillingPeriod + " " + this.GetBillingFrequencyText(objRole.BillingFrequency) + " )"); strPayPalURL += "&item_number=" + Globals.HTTPPOSTEncode(intRoleId.ToString()); strPayPalURL += "&no_shipping=1&no_note=1"; if (objRole.TrialFrequency != "N") @@ -134,7 +134,7 @@ protected override void OnLoad(EventArgs e) strPayPalURL += "&p3=" + Globals.HTTPPOSTEncode(intBillingPeriod.ToString()); strPayPalURL += "&t3=" + Globals.HTTPPOSTEncode(objRole.BillingFrequency); strPayPalURL += "&src=1"; - strPayPalURL += "¤cy_code=" + Globals.HTTPPOSTEncode(PortalSettings.Currency); + strPayPalURL += "¤cy_code=" + Globals.HTTPPOSTEncode(this.PortalSettings.Currency); } } var ctlList = new ListController(); @@ -168,7 +168,7 @@ protected override void OnLoad(EventArgs e) } else { - strPayPalURL += "&return=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request))); + strPayPalURL += "&return=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(this.Request))); } //Cancellation URL @@ -178,7 +178,7 @@ protected override void OnLoad(EventArgs e) } else { - strPayPalURL += "&cancel_return=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request))); + strPayPalURL += "&cancel_return=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(this.Request))); } //Instant Payment Notification URL @@ -188,13 +188,13 @@ protected override void OnLoad(EventArgs e) } else { - strPayPalURL += "¬ify_url=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request)) + "/admin/Sales/PayPalIPN.aspx"); + strPayPalURL += "¬ify_url=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(this.Request)) + "/admin/Sales/PayPalIPN.aspx"); } strPayPalURL += "&sra=1"; //reattempt on failure } //redirect to PayPal - Response.Redirect(strPayPalURL, true); + this.Response.Redirect(strPayPalURL, true); } else { @@ -204,11 +204,11 @@ protected override void OnLoad(EventArgs e) } else { - strPayPalURL = Globals.AddHTTP(Globals.GetDomainName(Request)); + strPayPalURL = Globals.AddHTTP(Globals.GetDomainName(this.Request)); } //redirect to PayPal - Response.Redirect(strPayPalURL, true); + this.Response.Redirect(strPayPalURL, true); } } catch (Exception exc) //Page failed to load diff --git a/DNN Platform/Website/admin/Sales/Purchase.ascx.cs b/DNN Platform/Website/admin/Sales/Purchase.ascx.cs index 60e77541774..da64815414e 100644 --- a/DNN Platform/Website/admin/Sales/Purchase.ascx.cs +++ b/DNN Platform/Website/admin/Sales/Purchase.ascx.cs @@ -33,7 +33,7 @@ public partial class Purchase : PortalModuleBase public Purchase() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -44,93 +44,93 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdPurchase.Click += cmdPurchase_Click; - cmdCancel.Click += cmdCancel_Click; + this.cmdPurchase.Click += this.cmdPurchase_Click; + this.cmdCancel.Click += this.cmdCancel_Click; try { double dblTotal; string strCurrency; - if ((Request.QueryString["RoleID"] != null)) + if ((this.Request.QueryString["RoleID"] != null)) { - RoleID = Int32.Parse(Request.QueryString["RoleID"]); + this.RoleID = Int32.Parse(this.Request.QueryString["RoleID"]); } - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - if (RoleID != -1) + if (this.RoleID != -1) { - RoleInfo objRole = RoleController.Instance.GetRole(PortalSettings.PortalId, r => r.RoleID == RoleID); + RoleInfo objRole = RoleController.Instance.GetRole(this.PortalSettings.PortalId, r => r.RoleID == this.RoleID); if (objRole.RoleID != -1) { - lblServiceName.Text = objRole.RoleName; + this.lblServiceName.Text = objRole.RoleName; if (!Null.IsNull(objRole.Description)) { - lblDescription.Text = objRole.Description; + this.lblDescription.Text = objRole.Description; } - if (RoleID == PortalSettings.AdministratorRoleId) + if (this.RoleID == this.PortalSettings.AdministratorRoleId) { - if (!Null.IsNull(PortalSettings.HostFee)) + if (!Null.IsNull(this.PortalSettings.HostFee)) { - lblFee.Text = PortalSettings.HostFee.ToString("#,##0.00"); + this.lblFee.Text = this.PortalSettings.HostFee.ToString("#,##0.00"); } } else { if (!Null.IsNull(objRole.ServiceFee)) { - lblFee.Text = objRole.ServiceFee.ToString("#,##0.00"); + this.lblFee.Text = objRole.ServiceFee.ToString("#,##0.00"); } } if (!Null.IsNull(objRole.BillingFrequency)) { var ctlEntry = new ListController(); ListEntryInfo entry = ctlEntry.GetListEntryInfo("Frequency", objRole.BillingFrequency); - lblFrequency.Text = entry.Text; + this.lblFrequency.Text = entry.Text; } - txtUnits.Text = "1"; + this.txtUnits.Text = "1"; if (objRole.BillingFrequency == "O") //one-time fee { - txtUnits.Enabled = false; + this.txtUnits.Enabled = false; } } else //security violation attempt to access item not related to this Module { - Response.Redirect(_navigationManager.NavigateURL(), true); + this.Response.Redirect(this._navigationManager.NavigateURL(), true); } } //Store URL Referrer to return to portal - if (Request.UrlReferrer != null) + if (this.Request.UrlReferrer != null) { - ViewState["UrlReferrer"] = Convert.ToString(Request.UrlReferrer); + this.ViewState["UrlReferrer"] = Convert.ToString(this.Request.UrlReferrer); } else { - ViewState["UrlReferrer"] = ""; + this.ViewState["UrlReferrer"] = ""; } } - if (RoleID == PortalSettings.AdministratorRoleId) + if (this.RoleID == this.PortalSettings.AdministratorRoleId) { strCurrency = Host.HostCurrency; } else { - strCurrency = PortalSettings.Currency; + strCurrency = this.PortalSettings.Currency; } - dblTotal = Convert.ToDouble(lblFee.Text)*Convert.ToDouble(txtUnits.Text); - lblTotal.Text = dblTotal.ToString("#.##"); + dblTotal = Convert.ToDouble(this.lblFee.Text)*Convert.ToDouble(this.txtUnits.Text); + this.lblTotal.Text = dblTotal.ToString("#.##"); - lblFeeCurrency.Text = strCurrency; - lblTotalCurrency.Text = strCurrency; + this.lblFeeCurrency.Text = strCurrency; + this.lblTotalCurrency.Text = strCurrency; } catch (Exception exc) //Module failed to load { @@ -146,9 +146,9 @@ private void cmdPurchase_Click(Object sender, EventArgs e) string strProcessorUserId = ""; string strProcessorPassword = ""; - if (Page.IsValid) + if (this.Page.IsValid) { - PortalInfo objPortalInfo = PortalController.Instance.GetPortal(PortalSettings.PortalId); + PortalInfo objPortalInfo = PortalController.Instance.GetPortal(this.PortalSettings.PortalId); if (objPortalInfo != null) { strPaymentProcessor = objPortalInfo.PaymentProcessor; @@ -161,20 +161,20 @@ private void cmdPurchase_Click(Object sender, EventArgs e) string strPayPalURL = ""; strPayPalURL = "https://www.paypal.com/xclick/business=" + Globals.HTTPPOSTEncode(strProcessorUserId); strPayPalURL = strPayPalURL + "&item_name=" + - Globals.HTTPPOSTEncode(PortalSettings.PortalName + " - " + lblDescription.Text + " ( " + txtUnits.Text + " units @ " + lblFee.Text + " " + lblFeeCurrency.Text + - " per " + lblFrequency.Text + " )"); - strPayPalURL = strPayPalURL + "&item_number=" + Globals.HTTPPOSTEncode(Convert.ToString(RoleID)); + Globals.HTTPPOSTEncode(this.PortalSettings.PortalName + " - " + this.lblDescription.Text + " ( " + this.txtUnits.Text + " units @ " + this.lblFee.Text + " " + this.lblFeeCurrency.Text + + " per " + this.lblFrequency.Text + " )"); + strPayPalURL = strPayPalURL + "&item_number=" + Globals.HTTPPOSTEncode(Convert.ToString(this.RoleID)); strPayPalURL = strPayPalURL + "&quantity=1"; - strPayPalURL = strPayPalURL + "&custom=" + Globals.HTTPPOSTEncode(UserInfo.UserID.ToString()); - strPayPalURL = strPayPalURL + "&amount=" + Globals.HTTPPOSTEncode(lblTotal.Text); - strPayPalURL = strPayPalURL + "¤cy_code=" + Globals.HTTPPOSTEncode(lblTotalCurrency.Text); - strPayPalURL = strPayPalURL + "&return=" + Globals.HTTPPOSTEncode("http://" + Globals.GetDomainName(Request)); - strPayPalURL = strPayPalURL + "&cancel_return=" + Globals.HTTPPOSTEncode("http://" + Globals.GetDomainName(Request)); - strPayPalURL = strPayPalURL + "¬ify_url=" + Globals.HTTPPOSTEncode("http://" + Globals.GetDomainName(Request) + "/admin/Sales/PayPalIPN.aspx"); + strPayPalURL = strPayPalURL + "&custom=" + Globals.HTTPPOSTEncode(this.UserInfo.UserID.ToString()); + strPayPalURL = strPayPalURL + "&amount=" + Globals.HTTPPOSTEncode(this.lblTotal.Text); + strPayPalURL = strPayPalURL + "¤cy_code=" + Globals.HTTPPOSTEncode(this.lblTotalCurrency.Text); + strPayPalURL = strPayPalURL + "&return=" + Globals.HTTPPOSTEncode("http://" + Globals.GetDomainName(this.Request)); + strPayPalURL = strPayPalURL + "&cancel_return=" + Globals.HTTPPOSTEncode("http://" + Globals.GetDomainName(this.Request)); + strPayPalURL = strPayPalURL + "¬ify_url=" + Globals.HTTPPOSTEncode("http://" + Globals.GetDomainName(this.Request) + "/admin/Sales/PayPalIPN.aspx"); strPayPalURL = strPayPalURL + "&undefined_quantity=&no_note=1&no_shipping=1"; //redirect to PayPal - Response.Redirect(strPayPalURL, true); + this.Response.Redirect(strPayPalURL, true); } } } @@ -188,7 +188,7 @@ private void cmdCancel_Click(Object sender, EventArgs e) { try { - Response.Redirect(Convert.ToString(ViewState["UrlReferrer"]), true); + this.Response.Redirect(Convert.ToString(this.ViewState["UrlReferrer"]), true); } catch (Exception exc) //Module failed to load { diff --git a/DNN Platform/Website/admin/Security/AccessDenied.ascx.cs b/DNN Platform/Website/admin/Security/AccessDenied.ascx.cs index 9ac1eecabed..78f0ab0b07e 100644 --- a/DNN Platform/Website/admin/Security/AccessDenied.ascx.cs +++ b/DNN Platform/Website/admin/Security/AccessDenied.ascx.cs @@ -22,14 +22,14 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); string message = null; Guid messageGuid; - var guidText = Request.QueryString["message"]; + var guidText = this.Request.QueryString["message"]; if (!string.IsNullOrEmpty(guidText) && Guid.TryParse(guidText, out messageGuid)) { message = HttpUtility.HtmlEncode(DataProvider.Instance().GetRedirectMessage(messageGuid)); } UI.Skins.Skin.AddModuleMessage(this, - !string.IsNullOrEmpty(message) ? message : Localization.GetString("AccessDenied", LocalResourceFile), + !string.IsNullOrEmpty(message) ? message : Localization.GetString("AccessDenied", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } } diff --git a/DNN Platform/Website/admin/Security/PasswordReset.ascx.cs b/DNN Platform/Website/admin/Security/PasswordReset.ascx.cs index f8d2e685b56..1669c37a301 100644 --- a/DNN Platform/Website/admin/Security/PasswordReset.ascx.cs +++ b/DNN Platform/Website/admin/Security/PasswordReset.ascx.cs @@ -38,7 +38,7 @@ public partial class PasswordReset : UserModuleBase private readonly INavigationManager _navigationManager; public PasswordReset() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -50,11 +50,11 @@ private string ResetToken { get { - return ViewState["ResetToken"] != null ? Request.QueryString["resetToken"] : String.Empty; + return this.ViewState["ResetToken"] != null ? this.Request.QueryString["resetToken"] : String.Empty; } set { - ViewState.Add("ResetToken", value); + this.ViewState.Add("ResetToken", value); } } @@ -65,96 +65,96 @@ private string ResetToken protected override void OnLoad(EventArgs e) { base.OnLoad(e); - _ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); + this._ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(this.Request)); JavaScript.RequestRegistration(CommonJs.DnnPlugins); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); - ClientResourceManager.RegisterScript(Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.extensions.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.jquery.tooltip.js"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/scripts/dnn.PasswordStrength.js"); + ClientResourceManager.RegisterScript(this.Page, "~/DesktopModules/Admin/Security/Scripts/dnn.PasswordComparer.js"); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/stylesheets/dnn.PasswordStrength.css", FileOrder.Css.ResourceCss); - if (PortalSettings.LoginTabId != -1 && PortalSettings.ActiveTab.TabID != PortalSettings.LoginTabId) + if (this.PortalSettings.LoginTabId != -1 && this.PortalSettings.ActiveTab.TabID != this.PortalSettings.LoginTabId) { - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.LoginTabId) + Request.Url.Query); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.LoginTabId) + this.Request.Url.Query); } - cmdChangePassword.Click +=cmdChangePassword_Click; + this.cmdChangePassword.Click +=this.cmdChangePassword_Click; - hlCancel.NavigateUrl = _navigationManager.NavigateURL(); + this.hlCancel.NavigateUrl = this._navigationManager.NavigateURL(); - if (Request.QueryString["resetToken"] != null) + if (this.Request.QueryString["resetToken"] != null) { - ResetToken = Request.QueryString["resetToken"]; - txtUsername.Enabled = false; + this.ResetToken = this.Request.QueryString["resetToken"]; + this.txtUsername.Enabled = false; } - var useEmailAsUserName = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); + var useEmailAsUserName = PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false); if (useEmailAsUserName) { - valUsername.Text = Localization.GetString("Email.Required", LocalResourceFile); + this.valUsername.Text = Localization.GetString("Email.Required", this.LocalResourceFile); } else { - valUsername.Text = Localization.GetString("Username.Required", LocalResourceFile); + this.valUsername.Text = Localization.GetString("Username.Required", this.LocalResourceFile); } - if (Request.QueryString["forced"] == "true") + if (this.Request.QueryString["forced"] == "true") { - lblInfo.Text = Localization.GetString("ForcedResetInfo", LocalResourceFile); + this.lblInfo.Text = Localization.GetString("ForcedResetInfo", this.LocalResourceFile); } - txtUsername.Attributes.Add("data-default",useEmailAsUserName ? LocalizeString("Email") : LocalizeString("Username")); - txtPassword.Attributes.Add("data-default", LocalizeString("Password")); - txtConfirmPassword.Attributes.Add("data-default", LocalizeString("Confirm")); - txtAnswer.Attributes.Add("data-default", LocalizeString("Answer")); + this.txtUsername.Attributes.Add("data-default",useEmailAsUserName ? this.LocalizeString("Email") : this.LocalizeString("Username")); + this.txtPassword.Attributes.Add("data-default", this.LocalizeString("Password")); + this.txtConfirmPassword.Attributes.Add("data-default", this.LocalizeString("Confirm")); + this.txtAnswer.Attributes.Add("data-default", this.LocalizeString("Answer")); - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - LoadUserInfo(); + this.LoadUserInfo(); } } private void LoadUserInfo() { - var user = UserController.GetUserByPasswordResetToken(PortalId, ResetToken); + var user = UserController.GetUserByPasswordResetToken(this.PortalId, this.ResetToken); if (user == null || user.PasswordResetExpiration < DateTime.Now) { - divPassword.Visible = false; - resetMessages.Visible = true; - lblHelp.Text = Localization.GetString("ResetLinkExpired", LocalResourceFile); + this.divPassword.Visible = false; + this.resetMessages.Visible = true; + this.lblHelp.Text = Localization.GetString("ResetLinkExpired", this.LocalResourceFile); return; } - txtUsername.Text = user.Username; + this.txtUsername.Text = user.Username; if (MembershipProviderConfig.RequiresQuestionAndAnswer) { - lblQuestion.Text = user.Membership.PasswordQuestion; - divQA.Visible = true; + this.lblQuestion.Text = user.Membership.PasswordQuestion; + this.divQA.Visible = true; } } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - if (!string.IsNullOrEmpty(lblHelp.Text) || !string.IsNullOrEmpty(lblInfo.Text)) - resetMessages.Visible = true; + if (!string.IsNullOrEmpty(this.lblHelp.Text) || !string.IsNullOrEmpty(this.lblInfo.Text)) + this.resetMessages.Visible = true; var options = new DnnPaswordStrengthOptions(); var optionsAsJsonString = Json.Serialize(options); var script = string.Format("dnn.initializePasswordStrength('.{0}', {1});{2}", "password-strength", optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "PasswordStrength", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "PasswordStrength", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "PasswordStrength", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "PasswordStrength", script, true); } var confirmPasswordOptions = new DnnConfirmPasswordOptions() @@ -169,65 +169,65 @@ protected override void OnPreRender(EventArgs e) optionsAsJsonString = Json.Serialize(confirmPasswordOptions); script = string.Format("dnn.initializePasswordComparer({0});{1}", optionsAsJsonString, Environment.NewLine); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "ConfirmPassword", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ConfirmPassword", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "ConfirmPassword", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ConfirmPassword", script, true); } } private void cmdChangePassword_Click(object sender, EventArgs e) { - string username = txtUsername.Text; + string username = this.txtUsername.Text; - if (MembershipProviderConfig.RequiresQuestionAndAnswer && string.IsNullOrEmpty(txtAnswer.Text)) + if (MembershipProviderConfig.RequiresQuestionAndAnswer && string.IsNullOrEmpty(this.txtAnswer.Text)) { return; } //1. Check New Password and Confirm are the same - if (txtPassword.Text != txtConfirmPassword.Text) + if (this.txtPassword.Text != this.txtConfirmPassword.Text) { - resetMessages.Visible = true; + this.resetMessages.Visible = true; var failed = Localization.GetString("PasswordMismatch"); - LogFailure(failed); - lblHelp.Text = failed; + this.LogFailure(failed); + this.lblHelp.Text = failed; return; } - var newPassword = txtPassword.Text.Trim(); + var newPassword = this.txtPassword.Text.Trim(); if (UserController.ValidatePassword(newPassword) ==false) { - resetMessages.Visible = true; + this.resetMessages.Visible = true; var failed = Localization.GetString("PasswordResetFailed"); - LogFailure(failed); - lblHelp.Text = failed; + this.LogFailure(failed); + this.lblHelp.Text = failed; return; } //Check New Password is not same as username or banned - var settings = new MembershipPasswordSettings(User.PortalID); + var settings = new MembershipPasswordSettings(this.User.PortalID); if (settings.EnableBannedList) { var m = new MembershipPasswordController(); - if (m.FoundBannedPassword(newPassword) || txtUsername.Text == newPassword) + if (m.FoundBannedPassword(newPassword) || this.txtUsername.Text == newPassword) { - resetMessages.Visible = true; + this.resetMessages.Visible = true; var failed = Localization.GetString("PasswordResetFailed"); - LogFailure(failed); - lblHelp.Text = failed; + this.LogFailure(failed); + this.lblHelp.Text = failed; return; } } - if (PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false)) + if (PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false)) { - var testUser = UserController.GetUserByEmail(PortalId, username); // one additonal call to db to see if an account with that email actually exists + var testUser = UserController.GetUserByEmail(this.PortalId, username); // one additonal call to db to see if an account with that email actually exists if (testUser != null) { username = testUser.Username; //we need the username of the account in order to change the password in the next step @@ -237,34 +237,34 @@ private void cmdChangePassword_Click(object sender, EventArgs e) string answer = String.Empty; if (MembershipProviderConfig.RequiresQuestionAndAnswer) { - answer = txtAnswer.Text; + answer = this.txtAnswer.Text; } - if (UserController.ChangePasswordByToken(PortalSettings.PortalId, username, newPassword, answer, ResetToken, out errorMessage) == false) + if (UserController.ChangePasswordByToken(this.PortalSettings.PortalId, username, newPassword, answer, this.ResetToken, out errorMessage) == false) { - resetMessages.Visible = true; + this.resetMessages.Visible = true; var failed = errorMessage; - LogFailure(failed); - lblHelp.Text = failed; + this.LogFailure(failed); + this.lblHelp.Text = failed; } else { //check user has a valid profile - var user = UserController.GetUserByName(PortalSettings.PortalId, username); - var validStatus = UserController.ValidateUser(user, PortalSettings.PortalId, false); + var user = UserController.GetUserByName(this.PortalSettings.PortalId, username); + var validStatus = UserController.ValidateUser(user, this.PortalSettings.PortalId, false); if (validStatus == UserValidStatus.UPDATEPROFILE) { - LogSuccess(); - ViewState.Add("PageNo", 3); - Response.Redirect(_navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Login")); + this.LogSuccess(); + this.ViewState.Add("PageNo", 3); + this.Response.Redirect(this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Login")); } else { //Log user in to site - LogSuccess(); + this.LogSuccess(); var loginStatus = UserLoginStatus.LOGIN_FAILURE; - UserController.UserLogin(PortalSettings.PortalId, username, txtPassword.Text, "", "", "", ref loginStatus, false); - RedirectAfterLogin(); + UserController.UserLogin(this.PortalSettings.PortalId, username, this.txtPassword.Text, "", "", "", ref loginStatus, false); + this.RedirectAfterLogin(); } } } @@ -273,80 +273,80 @@ protected void RedirectAfterLogin() { var redirectURL = ""; - var setting = GetSetting(PortalId, "Redirect_AfterLogin"); + var setting = GetSetting(this.PortalId, "Redirect_AfterLogin"); if (Convert.ToInt32(setting) == Null.NullInteger) { - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to signin - redirectURL = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + redirectURL = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. redirectURL = UrlUtils.ValidReturnUrl(redirectURL); } - if (Request.Cookies["returnurl"] != null) + if (this.Request.Cookies["returnurl"] != null) { //return to the url passed to signin - redirectURL = HttpUtility.UrlDecode(Request.Cookies["returnurl"].Value); + redirectURL = HttpUtility.UrlDecode(this.Request.Cookies["returnurl"].Value); //clean the return url to avoid possible XSS attack. redirectURL = UrlUtils.ValidReturnUrl(redirectURL); } if (String.IsNullOrEmpty(redirectURL)) { - if (PortalSettings.RegisterTabId != -1 && PortalSettings.HomeTabId != -1) + if (this.PortalSettings.RegisterTabId != -1 && this.PortalSettings.HomeTabId != -1) { //redirect to portal home page specified - redirectURL = _navigationManager.NavigateURL(PortalSettings.HomeTabId); + redirectURL = this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId); } else { //redirect to current page - redirectURL = _navigationManager.NavigateURL(); + redirectURL = this._navigationManager.NavigateURL(); } } } else //redirect to after login page { - redirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); + redirectURL = this._navigationManager.NavigateURL(Convert.ToInt32(setting)); } - AddModuleMessage("ChangeSuccessful", ModuleMessage.ModuleMessageType.GreenSuccess, true); - resetMessages.Visible = divPassword.Visible = false; - lblHelp.Text = lblInfo.Text = string.Empty; + this.AddModuleMessage("ChangeSuccessful", ModuleMessage.ModuleMessageType.GreenSuccess, true); + this.resetMessages.Visible = this.divPassword.Visible = false; + this.lblHelp.Text = this.lblInfo.Text = string.Empty; //redirect page after 5 seconds var script = string.Format("setTimeout(function(){{location.href = '{0}';}}, {1});", redirectURL, RedirectTimeout); - if (ScriptManager.GetCurrent(Page) != null) + if (ScriptManager.GetCurrent(this.Page) != null) { // respect MS AJAX - ScriptManager.RegisterStartupScript(Page, GetType(), "ChangePasswordSuccessful", script, true); + ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ChangePasswordSuccessful", script, true); } else { - Page.ClientScript.RegisterStartupScript(GetType(), "ChangePasswordSuccessful", script, true); + this.Page.ClientScript.RegisterStartupScript(this.GetType(), "ChangePasswordSuccessful", script, true); } } private void LogSuccess() { - LogResult(string.Empty); + this.LogResult(string.Empty); } private void LogFailure(string reason) { - LogResult(reason); + this.LogResult(reason); } private void LogResult(string message) { var log = new LogInfo { - LogPortalID = PortalSettings.PortalId, - LogPortalName = PortalSettings.PortalName, - LogUserID = UserId + LogPortalID = this.PortalSettings.PortalId, + LogPortalName = this.PortalSettings.PortalName, + LogUserID = this.UserId }; if (string.IsNullOrEmpty(message)) @@ -358,7 +358,7 @@ private void LogResult(string message) log.LogTypeKey = "PASSWORD_SENT_FAILURE"; log.LogProperties.Add(new LogDetailInfo("Cause", message)); } - log.AddProperty("IP", _ipAddress); + log.AddProperty("IP", this._ipAddress); LogController.Instance.AddLog(log); } diff --git a/DNN Platform/Website/admin/Security/SendPassword.ascx.cs b/DNN Platform/Website/admin/Security/SendPassword.ascx.cs index aef2c5083d0..4c44530fdb7 100644 --- a/DNN Platform/Website/admin/Security/SendPassword.ascx.cs +++ b/DNN Platform/Website/admin/Security/SendPassword.ascx.cs @@ -44,7 +44,7 @@ public partial class SendPassword : UserModuleBase private readonly INavigationManager _navigationManager; public SendPassword() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } #region Private Members @@ -66,21 +66,21 @@ protected string RedirectURL { var _RedirectURL = ""; - object setting = GetSetting(PortalId, "Redirect_AfterRegistration"); + object setting = GetSetting(this.PortalId, "Redirect_AfterRegistration"); if (Convert.ToInt32(setting) > 0) //redirect to after registration page { - _RedirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); + _RedirectURL = this._navigationManager.NavigateURL(Convert.ToInt32(setting)); } else { if (Convert.ToInt32(setting) <= 0) { - if (Request.QueryString["returnurl"] != null) + if (this.Request.QueryString["returnurl"] != null) { //return to the url passed to register - _RedirectURL = HttpUtility.UrlDecode(Request.QueryString["returnurl"]); + _RedirectURL = HttpUtility.UrlDecode(this.Request.QueryString["returnurl"]); //clean the return url to avoid possible XSS attack. _RedirectURL = UrlUtils.ValidReturnUrl(_RedirectURL); @@ -98,12 +98,12 @@ protected string RedirectURL if (String.IsNullOrEmpty(_RedirectURL)) { //redirect to current page - _RedirectURL = _navigationManager.NavigateURL(); + _RedirectURL = this._navigationManager.NavigateURL(); } } else //redirect to after registration page { - _RedirectURL = _navigationManager.NavigateURL(Convert.ToInt32(setting)); + _RedirectURL = this._navigationManager.NavigateURL(Convert.ToInt32(setting)); } } @@ -119,7 +119,7 @@ protected bool UseCaptcha { get { - var setting = GetSetting(PortalId, "Security_CaptchaRetrivePassword"); + var setting = GetSetting(this.PortalId, "Security_CaptchaRetrivePassword"); return Convert.ToBoolean(setting); } } @@ -128,7 +128,7 @@ protected bool UsernameDisabled { get { - return PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false); + return PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false); } } @@ -136,7 +136,7 @@ private bool ShowEmailField { get { - return MembershipProviderConfig.RequiresUniqueEmail || UsernameDisabled; + return MembershipProviderConfig.RequiresUniqueEmail || this.UsernameDisabled; } } @@ -147,17 +147,17 @@ private bool ShowEmailField private void GetUser() { ArrayList arrUsers; - if (ShowEmailField && !String.IsNullOrEmpty(txtEmail.Text.Trim()) && (String.IsNullOrEmpty(txtUsername.Text.Trim()) || divUsername.Visible == false)) + if (this.ShowEmailField && !String.IsNullOrEmpty(this.txtEmail.Text.Trim()) && (String.IsNullOrEmpty(this.txtUsername.Text.Trim()) || this.divUsername.Visible == false)) { - arrUsers = UserController.GetUsersByEmail(PortalSettings.PortalId, txtEmail.Text, 0, Int32.MaxValue, ref _userCount); + arrUsers = UserController.GetUsersByEmail(this.PortalSettings.PortalId, this.txtEmail.Text, 0, Int32.MaxValue, ref this._userCount); if (arrUsers != null && arrUsers.Count == 1) { - _user = (UserInfo)arrUsers[0]; + this._user = (UserInfo)arrUsers[0]; } } else { - _user = UserController.GetUserByName(PortalSettings.PortalId, txtUsername.Text); + this._user = UserController.GetUserByName(this.PortalSettings.PortalId, this.txtUsername.Text); } } @@ -174,31 +174,31 @@ protected override void OnInit(EventArgs e) //both retrieval and reset now use password token resets if (MembershipProviderConfig.PasswordRetrievalEnabled || MembershipProviderConfig.PasswordResetEnabled) { - lblHelp.Text = Localization.GetString("ResetTokenHelp", LocalResourceFile); - cmdSendPassword.Text = Localization.GetString("ResetToken", LocalResourceFile); + this.lblHelp.Text = Localization.GetString("ResetTokenHelp", this.LocalResourceFile); + this.cmdSendPassword.Text = Localization.GetString("ResetToken", this.LocalResourceFile); } else { isEnabled = false; - lblHelp.Text = Localization.GetString("DisabledPasswordHelp", LocalResourceFile); - divPassword.Visible = false; + this.lblHelp.Text = Localization.GetString("DisabledPasswordHelp", this.LocalResourceFile); + this.divPassword.Visible = false; } if (!MembershipProviderConfig.PasswordResetEnabled) { isEnabled = false; - lblHelp.Text = Localization.GetString("DisabledPasswordHelp", LocalResourceFile); - divPassword.Visible = false; + this.lblHelp.Text = Localization.GetString("DisabledPasswordHelp", this.LocalResourceFile); + this.divPassword.Visible = false; } - if (MembershipProviderConfig.RequiresUniqueEmail && isEnabled && !PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", PortalId, false)) + if (MembershipProviderConfig.RequiresUniqueEmail && isEnabled && !PortalController.GetPortalSettingAsBoolean("Registration_UseEmailAsUserName", this.PortalId, false)) { - lblHelp.Text += Localization.GetString("RequiresUniqueEmail", LocalResourceFile); + this.lblHelp.Text += Localization.GetString("RequiresUniqueEmail", this.LocalResourceFile); } if (MembershipProviderConfig.RequiresQuestionAndAnswer && isEnabled) { - lblHelp.Text += Localization.GetString("RequiresQuestionAndAnswer", LocalResourceFile); + this.lblHelp.Text += Localization.GetString("RequiresQuestionAndAnswer", this.LocalResourceFile); } @@ -213,19 +213,19 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdSendPassword.Click += OnSendPasswordClick; - lnkCancel.NavigateUrl = _navigationManager.NavigateURL(); + this.cmdSendPassword.Click += this.OnSendPasswordClick; + this.lnkCancel.NavigateUrl = this._navigationManager.NavigateURL(); - _ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(Request)); + this._ipAddress = UserRequestIPAddressController.Instance.GetUserRequestIPAddress(new HttpRequestWrapper(this.Request)); - divEmail.Visible = ShowEmailField; - divUsername.Visible = !UsernameDisabled; - divCaptcha.Visible = UseCaptcha; + this.divEmail.Visible = this.ShowEmailField; + this.divUsername.Visible = !this.UsernameDisabled; + this.divCaptcha.Visible = this.UseCaptcha; - if (UseCaptcha) + if (this.UseCaptcha) { - ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", LocalResourceFile); - ctlCaptcha.Text = Localization.GetString("CaptchaText", LocalResourceFile); + this.ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", this.LocalResourceFile); + this.ctlCaptcha.Text = Localization.GetString("CaptchaText", this.LocalResourceFile); } } @@ -237,22 +237,22 @@ protected override void OnLoad(EventArgs e) protected void OnSendPasswordClick(Object sender, EventArgs e) { //pretty much alwasy display the same message to avoid hinting on the existance of a user name - var message = Localization.GetString("PasswordSent", LocalResourceFile); + var message = Localization.GetString("PasswordSent", this.LocalResourceFile); var moduleMessageType = ModuleMessage.ModuleMessageType.GreenSuccess; var canSend = true; - if ((UseCaptcha && ctlCaptcha.IsValid) || (!UseCaptcha)) + if ((this.UseCaptcha && this.ctlCaptcha.IsValid) || (!this.UseCaptcha)) { - if (String.IsNullOrEmpty(txtUsername.Text.Trim())) + if (String.IsNullOrEmpty(this.txtUsername.Text.Trim())) { //No UserName provided - if (ShowEmailField) + if (this.ShowEmailField) { - if (String.IsNullOrEmpty(txtEmail.Text.Trim())) + if (String.IsNullOrEmpty(this.txtEmail.Text.Trim())) { //No email address either (cannot retrieve password) canSend = false; - message = Localization.GetString("EnterUsernameEmail", LocalResourceFile); + message = Localization.GetString("EnterUsernameEmail", this.LocalResourceFile); moduleMessageType = ModuleMessage.ModuleMessageType.RedError; } } @@ -260,7 +260,7 @@ protected void OnSendPasswordClick(Object sender, EventArgs e) { //Cannot retrieve password canSend = false; - message = Localization.GetString("EnterUsername", LocalResourceFile); + message = Localization.GetString("EnterUsername", this.LocalResourceFile); moduleMessageType = ModuleMessage.ModuleMessageType.RedError; } } @@ -269,37 +269,37 @@ protected void OnSendPasswordClick(Object sender, EventArgs e) { //SMTP Server is not configured canSend = false; - message = Localization.GetString("OptionUnavailable", LocalResourceFile); + message = Localization.GetString("OptionUnavailable", this.LocalResourceFile); moduleMessageType = ModuleMessage.ModuleMessageType.YellowWarning; - var logMessage = Localization.GetString("SMTPNotConfigured", LocalResourceFile); + var logMessage = Localization.GetString("SMTPNotConfigured", this.LocalResourceFile); - LogResult(logMessage); + this.LogResult(logMessage); } if (canSend) { - GetUser(); - if (_user != null) + this.GetUser(); + if (this._user != null) { - if (_user.IsDeleted) + if (this._user.IsDeleted) { canSend = false; } else { - if (_user.Membership.Approved == false) + if (this._user.Membership.Approved == false) { - Mail.SendMail(_user, MessageType.PasswordReminderUserIsNotApproved, PortalSettings); + Mail.SendMail(this._user, MessageType.PasswordReminderUserIsNotApproved, this.PortalSettings); canSend = false; } if (MembershipProviderConfig.PasswordRetrievalEnabled || MembershipProviderConfig.PasswordResetEnabled) { - UserController.ResetPasswordToken(_user); + UserController.ResetPasswordToken(this._user); } if (canSend) { - if (Mail.SendMail(_user, MessageType.PasswordReminder, PortalSettings) != string.Empty) + if (Mail.SendMail(this._user, MessageType.PasswordReminder, this.PortalSettings) != string.Empty) { canSend = false; } @@ -308,9 +308,9 @@ protected void OnSendPasswordClick(Object sender, EventArgs e) } else { - if (_userCount > 1) + if (this._userCount > 1) { - message = Localization.GetString("MultipleUsers", LocalResourceFile); + message = Localization.GetString("MultipleUsers", this.LocalResourceFile); } canSend = false; @@ -318,19 +318,19 @@ protected void OnSendPasswordClick(Object sender, EventArgs e) if (canSend) { - LogSuccess(); - lnkCancel.Attributes["resourcekey"] = "cmdClose"; + this.LogSuccess(); + this.lnkCancel.Attributes["resourcekey"] = "cmdClose"; } else { - LogFailure(message); + this.LogFailure(message); } //always hide panel so as to not reveal if username exists. - pnlRecover.Visible = false; + this.pnlRecover.Visible = false; UI.Skins.Skin.AddModuleMessage(this, message, moduleMessageType); - liSend.Visible = false; - liCancel.Visible = true; + this.liSend.Visible = false; + this.liCancel.Visible = true; } else { @@ -341,12 +341,12 @@ protected void OnSendPasswordClick(Object sender, EventArgs e) private void LogSuccess() { - LogResult(string.Empty); + this.LogResult(string.Empty); } private void LogFailure(string reason) { - LogResult(reason); + this.LogResult(reason); } private void LogResult(string message) @@ -355,10 +355,10 @@ private void LogResult(string message) var log = new LogInfo { - LogPortalID = PortalSettings.PortalId, - LogPortalName = PortalSettings.PortalName, - LogUserID = UserId, - LogUserName = portalSecurity.InputFilter(txtUsername.Text, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup) + LogPortalID = this.PortalSettings.PortalId, + LogPortalName = this.PortalSettings.PortalName, + LogUserID = this.UserId, + LogUserName = portalSecurity.InputFilter(this.txtUsername.Text, PortalSecurity.FilterFlag.NoScripting | PortalSecurity.FilterFlag.NoAngleBrackets | PortalSecurity.FilterFlag.NoMarkup) }; if (string.IsNullOrEmpty(message)) @@ -371,7 +371,7 @@ private void LogResult(string message) log.LogProperties.Add(new LogDetailInfo("Cause", message)); } - log.AddProperty("IP", _ipAddress); + log.AddProperty("IP", this._ipAddress); LogController.Instance.AddLog(log); diff --git a/DNN Platform/Website/admin/Skins/BreadCrumb.ascx.cs b/DNN Platform/Website/admin/Skins/BreadCrumb.ascx.cs index 1bd6983d9b9..e653e9b41a5 100644 --- a/DNN Platform/Website/admin/Skins/BreadCrumb.ascx.cs +++ b/DNN Platform/Website/admin/Skins/BreadCrumb.ascx.cs @@ -34,35 +34,35 @@ public partial class BreadCrumb : SkinObjectBase private readonly INavigationManager _navigationManager; public BreadCrumb() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } // Separator between breadcrumb elements public string Separator { - get { return _separator; } - set { _separator = value; } + get { return this._separator; } + set { this._separator = value; } } public string CssClass { - get { return _cssClass; } - set { _cssClass = value; } + get { return this._cssClass; } + set { this._cssClass = value; } } // Level to begin processing breadcrumb at. // -1 means show root breadcrumb public string RootLevel { - get { return _rootLevel.ToString(); } + get { return this._rootLevel.ToString(); } set { - _rootLevel = int.Parse(value); + this._rootLevel = int.Parse(value); - if (_rootLevel < 0) + if (this._rootLevel < 0) { - _showRoot = true; - _rootLevel = 0; + this._showRoot = true; + this._rootLevel = 0; } } } @@ -77,9 +77,9 @@ public int ProfileUserId { get { - return string.IsNullOrEmpty(Request.Params["UserId"]) + return string.IsNullOrEmpty(this.Request.Params["UserId"]) ? Null.NullInteger - : int.Parse(Request.Params["UserId"]); + : int.Parse(this.Request.Params["UserId"]); } } @@ -87,9 +87,9 @@ public int GroupId { get { - return string.IsNullOrEmpty(Request.Params["GroupId"]) + return string.IsNullOrEmpty(this.Request.Params["GroupId"]) ? Null.NullInteger - : int.Parse(Request.Params["GroupId"]); + : int.Parse(this.Request.Params["GroupId"]); } } @@ -101,62 +101,62 @@ protected override void OnLoad(EventArgs e) var position = 1; //resolve image path in separator content - ResolveSeparatorPaths(); + this.ResolveSeparatorPaths(); // If we have enabled hiding when there are no breadcrumbs, simply return - if (HideWithNoBreadCrumb && PortalSettings.ActiveTab.BreadCrumbs.Count == (_rootLevel + 1)) + if (this.HideWithNoBreadCrumb && this.PortalSettings.ActiveTab.BreadCrumbs.Count == (this._rootLevel + 1)) { return; } // Without checking if the current tab is the home tab, we would duplicate the root tab - if (_showRoot && PortalSettings.ActiveTab.TabID != PortalSettings.HomeTabId) + if (this._showRoot && this.PortalSettings.ActiveTab.TabID != this.PortalSettings.HomeTabId) { // Add the current protocal to the current URL - _homeUrl = Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias); + this._homeUrl = Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias); // Make sure we have a home tab ID set - if (PortalSettings.HomeTabId != -1) + if (this.PortalSettings.HomeTabId != -1) { - _homeUrl = _navigationManager.NavigateURL(PortalSettings.HomeTabId); + this._homeUrl = this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId); var tc = new TabController(); - var homeTab = tc.GetTab(PortalSettings.HomeTabId, PortalSettings.PortalId, false); - _homeTabName = homeTab.LocalizedTabName; + var homeTab = tc.GetTab(this.PortalSettings.HomeTabId, this.PortalSettings.PortalId, false); + this._homeTabName = homeTab.LocalizedTabName; // Check if we should use the tab's title instead - if (UseTitle && !string.IsNullOrEmpty(homeTab.Title)) + if (this.UseTitle && !string.IsNullOrEmpty(homeTab.Title)) { - _homeTabName = homeTab.Title; + this._homeTabName = homeTab.Title; } } // Append all of the HTML for the root breadcrumb - _breadcrumb.Append(""); - _breadcrumb.Append("" + _homeTabName + ""); - _breadcrumb.Append(""); // Notice we post-increment the position variable - _breadcrumb.Append(""); + this._breadcrumb.Append(""); + this._breadcrumb.Append("" + this._homeTabName + ""); + this._breadcrumb.Append(""); // Notice we post-increment the position variable + this._breadcrumb.Append(""); // Add a separator - _breadcrumb.Append(_separator); + this._breadcrumb.Append(this._separator); } //process bread crumbs - for (var i = _rootLevel; i < PortalSettings.ActiveTab.BreadCrumbs.Count; ++i) + for (var i = this._rootLevel; i < this.PortalSettings.ActiveTab.BreadCrumbs.Count; ++i) { // Only add separators if we're past the root level - if (i > _rootLevel) + if (i > this._rootLevel) { - _breadcrumb.Append(_separator); + this._breadcrumb.Append(this._separator); } // Grab the current tab - var tab = (TabInfo)PortalSettings.ActiveTab.BreadCrumbs[i]; + var tab = (TabInfo)this.PortalSettings.ActiveTab.BreadCrumbs[i]; var tabName = tab.LocalizedTabName; // Determine if we should use the tab's title instead of tab name - if (UseTitle && !string.IsNullOrEmpty(tab.Title)) + if (this.UseTitle && !string.IsNullOrEmpty(tab.Title)) { tabName = tab.Title; } @@ -165,47 +165,47 @@ protected override void OnLoad(EventArgs e) var tabUrl = tab.FullUrl; // - if (ProfileUserId > -1) + if (this.ProfileUserId > -1) { - tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId); + tabUrl = this._navigationManager.NavigateURL(tab.TabID, "", "UserId=" + this.ProfileUserId); } // - if (GroupId > -1) + if (this.GroupId > -1) { - tabUrl = _navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + GroupId); + tabUrl = this._navigationManager.NavigateURL(tab.TabID, "", "GroupId=" + this.GroupId); } // Begin breadcrumb - _breadcrumb.Append(""); + this._breadcrumb.Append(""); // Is this tab disabled? If so, only render the text if (tab.DisableLink) { - _breadcrumb.Append("" + tabName + ""); + this._breadcrumb.Append("" + tabName + ""); } else { - _breadcrumb.Append("" + tabName + ""); + this._breadcrumb.Append("" + tabName + ""); } - _breadcrumb.Append(""); // Notice we post-increment the position variable - _breadcrumb.Append(""); + this._breadcrumb.Append(""); // Notice we post-increment the position variable + this._breadcrumb.Append(""); } - _breadcrumb.Append(""); //End of BreadcrumbList + this._breadcrumb.Append(""); //End of BreadcrumbList - lblBreadCrumb.Text = _breadcrumb.ToString(); + this.lblBreadCrumb.Text = this._breadcrumb.ToString(); } private void ResolveSeparatorPaths() { - if (string.IsNullOrEmpty(_separator)) + if (string.IsNullOrEmpty(this._separator)) { return; } - var urlMatches = Regex.Matches(_separator, UrlRegex, RegexOptions.IgnoreCase); + var urlMatches = Regex.Matches(this._separator, UrlRegex, RegexOptions.IgnoreCase); if (urlMatches.Count > 0) { foreach (Match match in urlMatches) @@ -228,7 +228,7 @@ private void ResolveSeparatorPaths() } else { - url = string.Format("{0}{1}", PortalSettings.ActiveTab.SkinPath, url); + url = string.Format("{0}{1}", this.PortalSettings.ActiveTab.SkinPath, url); changed = true; } @@ -240,7 +240,7 @@ private void ResolveSeparatorPaths() url, match.Groups[4].Value); - _separator = _separator.Replace(match.Value, newMatch); + this._separator = this._separator.Replace(match.Value, newMatch); } } diff --git a/DNN Platform/Website/admin/Skins/Copyright.ascx.cs b/DNN Platform/Website/admin/Skins/Copyright.ascx.cs index ae526bf1dba..1862956cb22 100644 --- a/DNN Platform/Website/admin/Skins/Copyright.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Copyright.ascx.cs @@ -25,17 +25,17 @@ public partial class Copyright : SkinObjectBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - lblCopyright.CssClass = CssClass; + this.lblCopyright.CssClass = this.CssClass; } - if (!String.IsNullOrEmpty(PortalSettings.FooterText)) + if (!String.IsNullOrEmpty(this.PortalSettings.FooterText)) { - lblCopyright.Text = PortalSettings.FooterText.Replace("[year]", DateTime.Now.ToString("yyyy")); + this.lblCopyright.Text = this.PortalSettings.FooterText.Replace("[year]", DateTime.Now.ToString("yyyy")); } else { - lblCopyright.Text = string.Format(Localization.GetString("Copyright", Localization.GetResourceFile(this, MyFileName)), DateTime.Now.Year, PortalSettings.PortalName); + this.lblCopyright.Text = string.Format(Localization.GetString("Copyright", Localization.GetResourceFile(this, MyFileName)), DateTime.Now.Year, this.PortalSettings.PortalName); } } } diff --git a/DNN Platform/Website/admin/Skins/CurrentDate.ascx.cs b/DNN Platform/Website/admin/Skins/CurrentDate.ascx.cs index 77a4c74f0e5..cea6ec0ea60 100644 --- a/DNN Platform/Website/admin/Skins/CurrentDate.ascx.cs +++ b/DNN Platform/Website/admin/Skins/CurrentDate.ascx.cs @@ -31,18 +31,18 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - lblDate.CssClass = CssClass; + this.lblDate.CssClass = this.CssClass; } var user = UserController.Instance.GetCurrentUserInfo(); - lblDate.Text = !String.IsNullOrEmpty(DateFormat) ? user.LocalTime().ToString(DateFormat) : user.LocalTime().ToLongDateString(); + this.lblDate.Text = !String.IsNullOrEmpty(this.DateFormat) ? user.LocalTime().ToString(this.DateFormat) : user.LocalTime().ToLongDateString(); } } } diff --git a/DNN Platform/Website/admin/Skins/DnnCssExclude.ascx.cs b/DNN Platform/Website/admin/Skins/DnnCssExclude.ascx.cs index d5ba4c64e7e..371915e60c6 100644 --- a/DNN Platform/Website/admin/Skins/DnnCssExclude.ascx.cs +++ b/DNN Platform/Website/admin/Skins/DnnCssExclude.ascx.cs @@ -17,7 +17,7 @@ public partial class DnnCssExclude : SkinObjectBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - ctlExclude.Name = Name; + this.ctlExclude.Name = this.Name; } } } diff --git a/DNN Platform/Website/admin/Skins/DnnCssInclude.ascx.cs b/DNN Platform/Website/admin/Skins/DnnCssInclude.ascx.cs index 8c255c40a0e..de7c10e8ddc 100644 --- a/DNN Platform/Website/admin/Skins/DnnCssInclude.ascx.cs +++ b/DNN Platform/Website/admin/Skins/DnnCssInclude.ascx.cs @@ -26,16 +26,16 @@ public partial class DnnCssInclude : SkinObjectBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - ctlInclude.AddTag = AddTag; - ctlInclude.CssMedia = CssMedia; - ctlInclude.FilePath = FilePath; - ctlInclude.ForceBundle = ForceBundle; - ctlInclude.ForceProvider = ForceProvider; - ctlInclude.ForceVersion = ForceVersion; - ctlInclude.Name = Name; - ctlInclude.PathNameAlias = PathNameAlias; - ctlInclude.Priority = Priority; - ctlInclude.Version = Version; + this.ctlInclude.AddTag = this.AddTag; + this.ctlInclude.CssMedia = this.CssMedia; + this.ctlInclude.FilePath = this.FilePath; + this.ctlInclude.ForceBundle = this.ForceBundle; + this.ctlInclude.ForceProvider = this.ForceProvider; + this.ctlInclude.ForceVersion = this.ForceVersion; + this.ctlInclude.Name = this.Name; + this.ctlInclude.PathNameAlias = this.PathNameAlias; + this.ctlInclude.Priority = this.Priority; + this.ctlInclude.Version = this.Version; } } } diff --git a/DNN Platform/Website/admin/Skins/DnnJsExclude.ascx.cs b/DNN Platform/Website/admin/Skins/DnnJsExclude.ascx.cs index 80d4e0c916d..83c5204f592 100644 --- a/DNN Platform/Website/admin/Skins/DnnJsExclude.ascx.cs +++ b/DNN Platform/Website/admin/Skins/DnnJsExclude.ascx.cs @@ -17,7 +17,7 @@ public partial class DnnJsExclude : SkinObjectBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - ctlExclude.Name = Name; + this.ctlExclude.Name = this.Name; } } } diff --git a/DNN Platform/Website/admin/Skins/DnnJsInclude.ascx.cs b/DNN Platform/Website/admin/Skins/DnnJsInclude.ascx.cs index 4d78d0906f1..103c85be932 100644 --- a/DNN Platform/Website/admin/Skins/DnnJsInclude.ascx.cs +++ b/DNN Platform/Website/admin/Skins/DnnJsInclude.ascx.cs @@ -25,15 +25,15 @@ public partial class DnnJsInclude : SkinObjectBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - ctlInclude.AddTag = AddTag; - ctlInclude.FilePath = FilePath; - ctlInclude.ForceBundle = ForceBundle; - ctlInclude.ForceProvider = ForceProvider; - ctlInclude.ForceVersion = ForceVersion; - ctlInclude.Name = Name; - ctlInclude.PathNameAlias = PathNameAlias; - ctlInclude.Priority = Priority; - ctlInclude.Version = Version; + this.ctlInclude.AddTag = this.AddTag; + this.ctlInclude.FilePath = this.FilePath; + this.ctlInclude.ForceBundle = this.ForceBundle; + this.ctlInclude.ForceProvider = this.ForceProvider; + this.ctlInclude.ForceVersion = this.ForceVersion; + this.ctlInclude.Name = this.Name; + this.ctlInclude.PathNameAlias = this.PathNameAlias; + this.ctlInclude.Priority = this.Priority; + this.ctlInclude.Version = this.Version; } } } diff --git a/DNN Platform/Website/admin/Skins/DnnLink.ascx.cs b/DNN Platform/Website/admin/Skins/DnnLink.ascx.cs index 5dd99b63b5c..9ac0546f285 100644 --- a/DNN Platform/Website/admin/Skins/DnnLink.ascx.cs +++ b/DNN Platform/Website/admin/Skins/DnnLink.ascx.cs @@ -26,10 +26,10 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!string.IsNullOrEmpty(this.CssClass)) - aDnnLink.Attributes.Add("class",this.CssClass); + this.aDnnLink.Attributes.Add("class",this.CssClass); - if (!string.IsNullOrEmpty(Target)) - aDnnLink.Target = this.Target; + if (!string.IsNullOrEmpty(this.Target)) + this.aDnnLink.Target = this.Target; //set home page link to community URL string url = "http://www.dnnsoftware.com/community?utm_source=dnn-install&utm_medium=web-link&utm_content=gravity-skin-link&utm_campaign=dnn-install"; @@ -72,8 +72,8 @@ protected override void OnLoad(EventArgs e) } - aDnnLink.InnerText = linkText; - aDnnLink.HRef = HttpUtility.HtmlEncode(url + utmTerm); + this.aDnnLink.InnerText = linkText; + this.aDnnLink.HRef = HttpUtility.HtmlEncode(url + utmTerm); } } diff --git a/DNN Platform/Website/admin/Skins/DotNetNuke.ascx.cs b/DNN Platform/Website/admin/Skins/DotNetNuke.ascx.cs index 6aec3451713..e95d579aef9 100644 --- a/DNN Platform/Website/admin/Skins/DotNetNuke.ascx.cs +++ b/DNN Platform/Website/admin/Skins/DotNetNuke.ascx.cs @@ -29,23 +29,23 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - hypDotNetNuke.CssClass = CssClass; + this.hypDotNetNuke.CssClass = this.CssClass; } //get Product Name and Legal Copyright from constants (Medium Trust) - hypDotNetNuke.Text = DotNetNukeContext.Current.Application.LegalCopyright; - hypDotNetNuke.NavigateUrl = DotNetNukeContext.Current.Application.Url; + this.hypDotNetNuke.Text = DotNetNukeContext.Current.Application.LegalCopyright; + this.hypDotNetNuke.NavigateUrl = DotNetNukeContext.Current.Application.Url; //show copyright credits? - Visible = Host.DisplayCopyright; + this.Visible = Host.DisplayCopyright; } } } diff --git a/DNN Platform/Website/admin/Skins/Help.ascx.cs b/DNN Platform/Website/admin/Skins/Help.ascx.cs index 66c85f0304c..ecceb9e5ea7 100644 --- a/DNN Platform/Website/admin/Skins/Help.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Help.ascx.cs @@ -32,7 +32,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) @@ -40,23 +40,23 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - hypHelp.CssClass = CssClass; + this.hypHelp.CssClass = this.CssClass; } - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { if (TabPermissionController.CanAdminPage()) { - hypHelp.Text = Localization.GetString("Help"); - hypHelp.NavigateUrl = "mailto:" + Host.HostEmail + "?subject=" + PortalSettings.PortalName + " Support Request"; - hypHelp.Visible = true; + this.hypHelp.Text = Localization.GetString("Help"); + this.hypHelp.NavigateUrl = "mailto:" + Host.HostEmail + "?subject=" + this.PortalSettings.PortalName + " Support Request"; + this.hypHelp.Visible = true; } else { - hypHelp.Text = Localization.GetString("Help"); - hypHelp.NavigateUrl = "mailto:" + PortalSettings.Email + "?subject=" + PortalSettings.PortalName + " Support Request"; - hypHelp.Visible = true; + this.hypHelp.Text = Localization.GetString("Help"); + this.hypHelp.NavigateUrl = "mailto:" + this.PortalSettings.Email + "?subject=" + this.PortalSettings.PortalName + " Support Request"; + this.hypHelp.Visible = true; } } } diff --git a/DNN Platform/Website/admin/Skins/HostName.ascx.cs b/DNN Platform/Website/admin/Skins/HostName.ascx.cs index 5d3611e6258..8fdc9df8d1e 100644 --- a/DNN Platform/Website/admin/Skins/HostName.ascx.cs +++ b/DNN Platform/Website/admin/Skins/HostName.ascx.cs @@ -31,7 +31,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) @@ -39,12 +39,12 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - hypHostName.CssClass = CssClass; + this.hypHostName.CssClass = this.CssClass; } - hypHostName.Text = Host.HostTitle; - hypHostName.NavigateUrl = Globals.AddHTTP(Host.HostURL); + this.hypHostName.Text = Host.HostTitle; + this.hypHostName.NavigateUrl = Globals.AddHTTP(Host.HostURL); } catch (Exception exc) { diff --git a/DNN Platform/Website/admin/Skins/Language.ascx.cs b/DNN Platform/Website/admin/Skins/Language.ascx.cs index b561e30be35..fce6bb14a05 100644 --- a/DNN Platform/Website/admin/Skins/Language.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Language.ascx.cs @@ -51,15 +51,15 @@ public string AlternateTemplate { get { - if (string.IsNullOrEmpty(_alternateTemplate)) + if (string.IsNullOrEmpty(this._alternateTemplate)) { - _alternateTemplate = Localization.GetString("AlternateTemplate.Default", LocalResourceFile, TemplateCulture); + this._alternateTemplate = Localization.GetString("AlternateTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _alternateTemplate; + return this._alternateTemplate; } set { - _alternateTemplate = value; + this._alternateTemplate = value; } } @@ -67,15 +67,15 @@ public string CommonFooterTemplate { get { - if (string.IsNullOrEmpty(_commonFooterTemplate)) + if (string.IsNullOrEmpty(this._commonFooterTemplate)) { - _commonFooterTemplate = Localization.GetString("CommonFooterTemplate.Default", LocalResourceFile, TemplateCulture); + this._commonFooterTemplate = Localization.GetString("CommonFooterTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _commonFooterTemplate; + return this._commonFooterTemplate; } set { - _commonFooterTemplate = value; + this._commonFooterTemplate = value; } } @@ -83,15 +83,15 @@ public string CommonHeaderTemplate { get { - if (string.IsNullOrEmpty(_commonHeaderTemplate)) + if (string.IsNullOrEmpty(this._commonHeaderTemplate)) { - _commonHeaderTemplate = Localization.GetString("CommonHeaderTemplate.Default", LocalResourceFile, TemplateCulture); + this._commonHeaderTemplate = Localization.GetString("CommonHeaderTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _commonHeaderTemplate; + return this._commonHeaderTemplate; } set { - _commonHeaderTemplate = value; + this._commonHeaderTemplate = value; } } @@ -101,15 +101,15 @@ public string FooterTemplate { get { - if (string.IsNullOrEmpty(_footerTemplate)) + if (string.IsNullOrEmpty(this._footerTemplate)) { - _footerTemplate = Localization.GetString("FooterTemplate.Default", LocalResourceFile, TemplateCulture); + this._footerTemplate = Localization.GetString("FooterTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _footerTemplate; + return this._footerTemplate; } set { - _footerTemplate = value; + this._footerTemplate = value; } } @@ -117,15 +117,15 @@ public string HeaderTemplate { get { - if (string.IsNullOrEmpty(_headerTemplate)) + if (string.IsNullOrEmpty(this._headerTemplate)) { - _headerTemplate = Localization.GetString("HeaderTemplate.Default", LocalResourceFile, TemplateCulture); + this._headerTemplate = Localization.GetString("HeaderTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _headerTemplate; + return this._headerTemplate; } set { - _headerTemplate = value; + this._headerTemplate = value; } } @@ -133,15 +133,15 @@ public string ItemTemplate { get { - if (string.IsNullOrEmpty(_itemTemplate)) + if (string.IsNullOrEmpty(this._itemTemplate)) { - _itemTemplate = Localization.GetString("ItemTemplate.Default", LocalResourceFile, TemplateCulture); + this._itemTemplate = Localization.GetString("ItemTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _itemTemplate; + return this._itemTemplate; } set { - _itemTemplate = value; + this._itemTemplate = value; } } @@ -149,15 +149,15 @@ public string SelectedItemTemplate { get { - if (string.IsNullOrEmpty(_SelectedItemTemplate)) + if (string.IsNullOrEmpty(this._SelectedItemTemplate)) { - _SelectedItemTemplate = Localization.GetString("SelectedItemTemplate.Default", LocalResourceFile, TemplateCulture); + this._SelectedItemTemplate = Localization.GetString("SelectedItemTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _SelectedItemTemplate; + return this._SelectedItemTemplate; } set { - _SelectedItemTemplate = value; + this._SelectedItemTemplate = value; } } @@ -165,15 +165,15 @@ public string SeparatorTemplate { get { - if (string.IsNullOrEmpty(_separatorTemplate)) + if (string.IsNullOrEmpty(this._separatorTemplate)) { - _separatorTemplate = Localization.GetString("SeparatorTemplate.Default", LocalResourceFile, TemplateCulture); + this._separatorTemplate = Localization.GetString("SeparatorTemplate.Default", this.LocalResourceFile, this.TemplateCulture); } - return _separatorTemplate; + return this._separatorTemplate; } set { - _separatorTemplate = value; + this._separatorTemplate = value; } } @@ -183,16 +183,16 @@ public bool ShowMenu { get { - if ((_showMenu == false) && (ShowLinks == false)) + if ((this._showMenu == false) && (this.ShowLinks == false)) { //this is to make sure that at least one type of selector will be visible if multiple languages are enabled - _showMenu = true; + this._showMenu = true; } - return _showMenu; + return this._showMenu; } set { - _showMenu = value; + this._showMenu = value; } } @@ -214,7 +214,7 @@ protected string TemplateCulture { get { - return (UseCurrentCultureForTemplate) ? CurrentCulture : "en-US"; + return (this.UseCurrentCultureForTemplate) ? this.CurrentCulture : "en-US"; } } @@ -223,11 +223,11 @@ protected string LocalResourceFile { get { - if (string.IsNullOrEmpty(_localResourceFile)) + if (string.IsNullOrEmpty(this._localResourceFile)) { - _localResourceFile = Localization.GetResourceFile(this, MyFileName); + this._localResourceFile = Localization.GetResourceFile(this, MyFileName); } - return _localResourceFile; + return this._localResourceFile; } } @@ -235,11 +235,11 @@ protected LanguageTokenReplace LocalTokenReplace { get { - if (_localTokenReplace == null) + if (this._localTokenReplace == null) { - _localTokenReplace = new LanguageTokenReplace {resourceFile = LocalResourceFile}; + this._localTokenReplace = new LanguageTokenReplace {resourceFile = this.LocalResourceFile}; } - return _localTokenReplace; + return this._localTokenReplace; } } @@ -255,47 +255,47 @@ private string parseTemplate(string template, string locale) if (!string.IsNullOrEmpty(locale)) { //for non data items use locale - LocalTokenReplace.Language = locale; + this.LocalTokenReplace.Language = locale; } else { //for non data items use page culture - LocalTokenReplace.Language = CurrentCulture; + this.LocalTokenReplace.Language = this.CurrentCulture; } //perform token replacements - strReturnValue = LocalTokenReplace.ReplaceEnvironmentTokens(strReturnValue); + strReturnValue = this.LocalTokenReplace.ReplaceEnvironmentTokens(strReturnValue); } catch (Exception ex) { - Exceptions.ProcessPageLoadException(ex, Request.RawUrl); + Exceptions.ProcessPageLoadException(ex, this.Request.RawUrl); } return strReturnValue; } private void handleCommonTemplates() { - if (string.IsNullOrEmpty(CommonHeaderTemplate)) + if (string.IsNullOrEmpty(this.CommonHeaderTemplate)) { - litCommonHeaderTemplate.Visible = false; + this.litCommonHeaderTemplate.Visible = false; } else { - litCommonHeaderTemplate.Text = parseTemplate(CommonHeaderTemplate, CurrentCulture); + this.litCommonHeaderTemplate.Text = this.parseTemplate(this.CommonHeaderTemplate, this.CurrentCulture); } - if (string.IsNullOrEmpty(CommonFooterTemplate)) + if (string.IsNullOrEmpty(this.CommonFooterTemplate)) { - litCommonFooterTemplate.Visible = false; + this.litCommonFooterTemplate.Visible = false; } else { - litCommonFooterTemplate.Text = parseTemplate(CommonFooterTemplate, CurrentCulture); + this.litCommonFooterTemplate.Text = this.parseTemplate(this.CommonFooterTemplate, this.CurrentCulture); } } private bool LocaleIsAvailable(Locale locale) { - var tab = PortalSettings.ActiveTab; + var tab = this.PortalSettings.ActiveTab; if (tab.DefaultLanguageTab != null) { tab = tab.DefaultLanguageTab; @@ -314,86 +314,86 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - selectCulture.SelectedIndexChanged += selectCulture_SelectedIndexChanged; - rptLanguages.ItemDataBound += rptLanguages_ItemDataBound; + this.selectCulture.SelectedIndexChanged += this.selectCulture_SelectedIndexChanged; + this.rptLanguages.ItemDataBound += this.rptLanguages_ItemDataBound; try { var locales = new Dictionary(); - IEnumerable cultureListItems = DotNetNuke.Services.Localization.Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, CurrentCulture, "", false); - foreach (Locale loc in LocaleController.Instance.GetLocales(PortalSettings.PortalId).Values) + IEnumerable cultureListItems = DotNetNuke.Services.Localization.Localization.LoadCultureInListItems(CultureDropDownTypes.NativeName, this.CurrentCulture, "", false); + foreach (Locale loc in LocaleController.Instance.GetLocales(this.PortalSettings.PortalId).Values) { - string defaultRoles = PortalController.GetPortalSetting(string.Format("DefaultTranslatorRoles-{0}", loc.Code), PortalSettings.PortalId, "Administrators"); - if (!PortalSettings.ContentLocalizationEnabled || - (LocaleIsAvailable(loc) && - (PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) || loc.IsPublished || PortalSecurity.IsInRoles(defaultRoles)))) + string defaultRoles = PortalController.GetPortalSetting(string.Format("DefaultTranslatorRoles-{0}", loc.Code), this.PortalSettings.PortalId, "Administrators"); + if (!this.PortalSettings.ContentLocalizationEnabled || + (this.LocaleIsAvailable(loc) && + (PortalSecurity.IsInRoles(this.PortalSettings.AdministratorRoleName) || loc.IsPublished || PortalSecurity.IsInRoles(defaultRoles)))) { locales.Add(loc.Code, loc); foreach (var cultureItem in cultureListItems) { if (cultureItem.Value == loc.Code) { - selectCulture.Items.Add(cultureItem); + this.selectCulture.Items.Add(cultureItem); } } } } - if (ShowLinks) + if (this.ShowLinks) { if (locales.Count > 1) { - rptLanguages.DataSource = locales.Values; - rptLanguages.DataBind(); + this.rptLanguages.DataSource = locales.Values; + this.rptLanguages.DataBind(); } else { - rptLanguages.Visible = false; + this.rptLanguages.Visible = false; } } - if (ShowMenu) + if (this.ShowMenu) { - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - selectCulture.CssClass = CssClass; + this.selectCulture.CssClass = this.CssClass; } - if (!IsPostBack) + if (!this.IsPostBack) { //select the default item - if (CurrentCulture != null) + if (this.CurrentCulture != null) { - ListItem item = selectCulture.Items.FindByValue(CurrentCulture); + ListItem item = this.selectCulture.Items.FindByValue(this.CurrentCulture); if (item != null) { - selectCulture.SelectedIndex = -1; + this.selectCulture.SelectedIndex = -1; item.Selected = true; } } } //only show language selector if more than one language - if (selectCulture.Items.Count <= 1) + if (this.selectCulture.Items.Count <= 1) { - selectCulture.Visible = false; + this.selectCulture.Visible = false; } } else { - selectCulture.Visible = false; + this.selectCulture.Visible = false; } - handleCommonTemplates(); + this.handleCommonTemplates(); } catch (Exception ex) { - Exceptions.ProcessPageLoadException(ex, Request.RawUrl); + Exceptions.ProcessPageLoadException(ex, this.Request.RawUrl); } } private void selectCulture_SelectedIndexChanged(object sender, EventArgs e) { //Redirect to same page to update all controls for newly selected culture - LocalTokenReplace.Language = selectCulture.SelectedItem.Value; + this.LocalTokenReplace.Language = this.selectCulture.SelectedItem.Value; //DNN-6170 ensure skin value is culture specific in case of static localization - DataCache.RemoveCache(string.Format(DataCache.PortalSettingsCacheKey, PortalSettings.PortalId, Null.NullString)); - Response.Redirect(LocalTokenReplace.ReplaceEnvironmentTokens("[URL]")); + DataCache.RemoveCache(string.Format(DataCache.PortalSettingsCacheKey, this.PortalSettings.PortalId, Null.NullString)); + this.Response.Redirect(this.LocalTokenReplace.ReplaceEnvironmentTokens("[URL]")); } /// @@ -413,26 +413,26 @@ protected void rptLanguages_ItemDataBound(object sender, RepeaterItemEventArgs e switch (e.Item.ItemType) { case ListItemType.Item: - strTemplate = ItemTemplate; + strTemplate = this.ItemTemplate; break; case ListItemType.AlternatingItem: - if (!string.IsNullOrEmpty(AlternateTemplate)) + if (!string.IsNullOrEmpty(this.AlternateTemplate)) { - strTemplate = AlternateTemplate; + strTemplate = this.AlternateTemplate; } else { - strTemplate = ItemTemplate; + strTemplate = this.ItemTemplate; } break; case ListItemType.Header: - strTemplate = HeaderTemplate; + strTemplate = this.HeaderTemplate; break; case ListItemType.Footer: - strTemplate = FooterTemplate; + strTemplate = this.FooterTemplate; break; case ListItemType.Separator: - strTemplate = SeparatorTemplate; + strTemplate = this.SeparatorTemplate; break; } if (string.IsNullOrEmpty(strTemplate)) @@ -446,24 +446,24 @@ protected void rptLanguages_ItemDataBound(object sender, RepeaterItemEventArgs e var locale = e.Item.DataItem as Locale; if (locale != null && (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)) { - if (locale.Code == CurrentCulture && !string.IsNullOrEmpty(SelectedItemTemplate)) + if (locale.Code == this.CurrentCulture && !string.IsNullOrEmpty(this.SelectedItemTemplate)) { - strTemplate = SelectedItemTemplate; + strTemplate = this.SelectedItemTemplate; } - litTemplate.Text = parseTemplate(strTemplate, locale.Code); + litTemplate.Text = this.parseTemplate(strTemplate, locale.Code); } } else { //for non data items use page culture - litTemplate.Text = parseTemplate(strTemplate, CurrentCulture); + litTemplate.Text = this.parseTemplate(strTemplate, this.CurrentCulture); } } } } catch (Exception ex) { - Exceptions.ProcessPageLoadException(ex, Request.RawUrl); + Exceptions.ProcessPageLoadException(ex, this.Request.RawUrl); } } diff --git a/DNN Platform/Website/admin/Skins/LinkToFullSite.ascx.cs b/DNN Platform/Website/admin/Skins/LinkToFullSite.ascx.cs index 49e6afd7e8e..e02cfbcbed3 100644 --- a/DNN Platform/Website/admin/Skins/LinkToFullSite.ascx.cs +++ b/DNN Platform/Website/admin/Skins/LinkToFullSite.ascx.cs @@ -34,12 +34,12 @@ private string LocalResourcesFile { get { - if(string.IsNullOrEmpty(_localResourcesFile)) + if(string.IsNullOrEmpty(this._localResourcesFile)) { - _localResourcesFile = Localization.GetResourceFile(this, MyFileName); + this._localResourcesFile = Localization.GetResourceFile(this, MyFileName); } - return _localResourcesFile; + return this._localResourcesFile; } } @@ -52,8 +52,8 @@ protected override void OnLoad(EventArgs e) var redirectUrl = redirectionController.GetFullSiteUrl(); if (!string.IsNullOrEmpty(redirectUrl)) { - lnkPortal.NavigateUrl = redirectUrl; - lnkPortal.Text = Localization.GetString("lnkPortal", LocalResourcesFile); + this.lnkPortal.NavigateUrl = redirectUrl; + this.lnkPortal.Text = Localization.GetString("lnkPortal", this.LocalResourcesFile); } else { diff --git a/DNN Platform/Website/admin/Skins/LinkToMobileSite.ascx.cs b/DNN Platform/Website/admin/Skins/LinkToMobileSite.ascx.cs index a81cea67931..7a097ff80b0 100644 --- a/DNN Platform/Website/admin/Skins/LinkToMobileSite.ascx.cs +++ b/DNN Platform/Website/admin/Skins/LinkToMobileSite.ascx.cs @@ -34,12 +34,12 @@ private string LocalResourcesFile { get { - if(string.IsNullOrEmpty(_localResourcesFile)) + if(string.IsNullOrEmpty(this._localResourcesFile)) { - _localResourcesFile = Localization.GetResourceFile(this, MyFileName); + this._localResourcesFile = Localization.GetResourceFile(this, MyFileName); } - return _localResourcesFile; + return this._localResourcesFile; } } @@ -52,8 +52,8 @@ protected override void OnLoad(EventArgs e) var redirectUrl = redirectionController.GetMobileSiteUrl(); if (!string.IsNullOrEmpty(redirectUrl)) { - lnkPortal.NavigateUrl = redirectUrl; - lnkPortal.Text = Localization.GetString("lnkPortal", LocalResourcesFile); + this.lnkPortal.NavigateUrl = redirectUrl; + this.lnkPortal.Text = Localization.GetString("lnkPortal", this.LocalResourcesFile); } else { diff --git a/DNN Platform/Website/admin/Skins/Links.ascx.cs b/DNN Platform/Website/admin/Skins/Links.ascx.cs index cb04bfccef2..d32ca766bad 100644 --- a/DNN Platform/Website/admin/Skins/Links.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Links.ascx.cs @@ -39,11 +39,11 @@ public string Alignment { get { - return _alignment; + return this._alignment; } set { - _alignment = value.ToLowerInvariant(); + this._alignment = value.ToLowerInvariant(); } } @@ -53,11 +53,11 @@ public string Level { get { - return _level; + return this._level; } set { - _level = value.ToLowerInvariant(); + this._level = value.ToLowerInvariant(); } } @@ -69,11 +69,11 @@ public bool ForceLinks { get { - return _forceLinks; + return this._forceLinks; } set { - _forceLinks = value; + this._forceLinks = value; } } @@ -81,11 +81,11 @@ public bool IncludeActiveTab { get { - return _includeActiveTab; + return this._includeActiveTab; } set { - _includeActiveTab = value; + this._includeActiveTab = value; } } @@ -97,42 +97,42 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); string strCssClass; - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - strCssClass = CssClass; + strCssClass = this.CssClass; } else { strCssClass = "SkinObject"; } string strSeparator = string.Empty; - if (!String.IsNullOrEmpty(Separator)) + if (!String.IsNullOrEmpty(this.Separator)) { - if (Separator.IndexOf("src=", StringComparison.Ordinal) != -1) + if (this.Separator.IndexOf("src=", StringComparison.Ordinal) != -1) { //Add the skinpath to image paths - Separator = SrcRegex.Replace(Separator, "$&" + PortalSettings.ActiveTab.SkinPath); + this.Separator = SrcRegex.Replace(this.Separator, "$&" + this.PortalSettings.ActiveTab.SkinPath); } //Wrap in a span - Separator = string.Format("{1}", strCssClass, Separator); + this.Separator = string.Format("{1}", strCssClass, this.Separator); } else { - Separator = " "; + this.Separator = " "; } //build links string strLinks = ""; - strLinks = BuildLinks(Level, strSeparator, strCssClass); + strLinks = this.BuildLinks(this.Level, strSeparator, strCssClass); //Render links, even if nothing is returned with the currently set level - if (String.IsNullOrEmpty(strLinks) && ForceLinks) + if (String.IsNullOrEmpty(strLinks) && this.ForceLinks) { - strLinks = BuildLinks("", strSeparator, strCssClass); + strLinks = this.BuildLinks("", strSeparator, strCssClass); } - lblLinks.Text = strLinks; + this.lblLinks.Text = strLinks; } #endregion @@ -143,52 +143,52 @@ private string BuildLinks(string strLevel, string strSeparator, string strCssCla { var sbLinks = new StringBuilder(); - List portalTabs = TabController.GetTabsBySortOrder(PortalSettings.PortalId); + List portalTabs = TabController.GetTabsBySortOrder(this.PortalSettings.PortalId); List hostTabs = TabController.GetTabsBySortOrder(Null.NullInteger); foreach (TabInfo objTab in portalTabs) { - sbLinks.Append(ProcessLink(ProcessTab(objTab, strLevel, strCssClass), sbLinks.ToString().Length)); + sbLinks.Append(this.ProcessLink(this.ProcessTab(objTab, strLevel, strCssClass), sbLinks.ToString().Length)); } foreach (TabInfo objTab in hostTabs) { - sbLinks.Append(ProcessLink(ProcessTab(objTab, strLevel, strCssClass), sbLinks.ToString().Length)); + sbLinks.Append(this.ProcessLink(this.ProcessTab(objTab, strLevel, strCssClass), sbLinks.ToString().Length)); } return sbLinks.ToString(); } private string ProcessTab(TabInfo objTab, string strLevel, string strCssClass) { - if (Navigation.CanShowTab(objTab, AdminMode, ShowDisabled)) + if (Navigation.CanShowTab(objTab, this.AdminMode, this.ShowDisabled)) { switch (strLevel) { case "same": //Render tabs on the same level as the current tab case "": - if (objTab.ParentId == PortalSettings.ActiveTab.ParentId) + if (objTab.ParentId == this.PortalSettings.ActiveTab.ParentId) { - if (IncludeActiveTab || objTab.TabID != PortalSettings.ActiveTab.TabID) + if (this.IncludeActiveTab || objTab.TabID != this.PortalSettings.ActiveTab.TabID) { - return AddLink(objTab.TabName, objTab.FullUrl, strCssClass); + return this.AddLink(objTab.TabName, objTab.FullUrl, strCssClass); } } break; case "child": //Render the current tabs child tabs - if (objTab.ParentId == PortalSettings.ActiveTab.TabID) + if (objTab.ParentId == this.PortalSettings.ActiveTab.TabID) { - return AddLink(objTab.TabName, objTab.FullUrl, strCssClass); + return this.AddLink(objTab.TabName, objTab.FullUrl, strCssClass); } break; case "parent": //Render the current tabs parenttab - if (objTab.TabID == PortalSettings.ActiveTab.ParentId) + if (objTab.TabID == this.PortalSettings.ActiveTab.ParentId) { - return AddLink(objTab.TabName, objTab.FullUrl, strCssClass); + return this.AddLink(objTab.TabName, objTab.FullUrl, strCssClass); } break; case "root": //Render Root tabs if (objTab.Level == 0) { - return AddLink(objTab.TabName, objTab.FullUrl, strCssClass); + return this.AddLink(objTab.TabName, objTab.FullUrl, strCssClass); } break; } @@ -203,14 +203,14 @@ private string ProcessLink(string sLink, int iLinksLength) { return ""; } - if (Alignment == "vertical") + if (this.Alignment == "vertical") { - sLink = string.Concat("
    ", Separator, sLink, "
    "); + sLink = string.Concat("
    ", this.Separator, sLink, "
    "); } - else if (!String.IsNullOrEmpty(Separator) && iLinksLength > 0) + else if (!String.IsNullOrEmpty(this.Separator) && iLinksLength > 0) { //If not vertical, then render the separator - sLink = string.Concat(Separator, sLink); + sLink = string.Concat(this.Separator, sLink); } return sLink; } diff --git a/DNN Platform/Website/admin/Skins/Login.ascx.cs b/DNN Platform/Website/admin/Skins/Login.ascx.cs index 14918f0ca8d..9beae2333c7 100644 --- a/DNN Platform/Website/admin/Skins/Login.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Login.ascx.cs @@ -29,8 +29,8 @@ public partial class Login : SkinObjectBase private readonly INavigationManager _navigationManager; public Login() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - LegacyMode = true; + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); + this.LegacyMode = true; } #region Private Members @@ -64,73 +64,73 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - Visible = (!PortalSettings.HideLoginControl || Request.IsAuthenticated) - && (!PortalSettings.InErrorPageRequest() || ShowInErrorPage); + this.Visible = (!this.PortalSettings.HideLoginControl || this.Request.IsAuthenticated) + && (!this.PortalSettings.InErrorPageRequest() || this.ShowInErrorPage); } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (Visible) + if (this.Visible) { try { - if (LegacyMode) + if (this.LegacyMode) { - loginLink.Visible = true; - loginGroup.Visible = false; + this.loginLink.Visible = true; + this.loginGroup.Visible = false; } else { - loginLink.Visible = false; - loginGroup.Visible = true; + this.loginLink.Visible = false; + this.loginGroup.Visible = true; } - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - loginLink.CssClass = CssClass; - enhancedLoginLink.CssClass = CssClass; + this.loginLink.CssClass = this.CssClass; + this.enhancedLoginLink.CssClass = this.CssClass; } - if (Request.IsAuthenticated) + if (this.Request.IsAuthenticated) { - if (!String.IsNullOrEmpty(LogoffText)) + if (!String.IsNullOrEmpty(this.LogoffText)) { - if (LogoffText.IndexOf("src=") != -1) + if (this.LogoffText.IndexOf("src=") != -1) { - LogoffText = LogoffText.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); + this.LogoffText = this.LogoffText.Replace("src=\"", "src=\"" + this.PortalSettings.ActiveTab.SkinPath); } - loginLink.Text = LogoffText; - enhancedLoginLink.Text = LogoffText; + this.loginLink.Text = this.LogoffText; + this.enhancedLoginLink.Text = this.LogoffText; } else { - loginLink.Text = Localization.GetString("Logout", Localization.GetResourceFile(this, MyFileName)); - enhancedLoginLink.Text = loginLink.Text; - loginLink.ToolTip = loginLink.Text; - enhancedLoginLink.ToolTip = loginLink.Text; + this.loginLink.Text = Localization.GetString("Logout", Localization.GetResourceFile(this, MyFileName)); + this.enhancedLoginLink.Text = this.loginLink.Text; + this.loginLink.ToolTip = this.loginLink.Text; + this.enhancedLoginLink.ToolTip = this.loginLink.Text; } - loginLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); - enhancedLoginLink.NavigateUrl = loginLink.NavigateUrl; + this.loginLink.NavigateUrl = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Logoff"); + this.enhancedLoginLink.NavigateUrl = this.loginLink.NavigateUrl; } else { - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - if (Text.IndexOf("src=") != -1) + if (this.Text.IndexOf("src=") != -1) { - Text = Text.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); + this.Text = this.Text.Replace("src=\"", "src=\"" + this.PortalSettings.ActiveTab.SkinPath); } - loginLink.Text = Text; - enhancedLoginLink.Text = Text; + this.loginLink.Text = this.Text; + this.enhancedLoginLink.Text = this.Text; } else { - loginLink.Text = Localization.GetString("Login", Localization.GetResourceFile(this, MyFileName)); - enhancedLoginLink.Text = loginLink.Text; - loginLink.ToolTip = loginLink.Text; - enhancedLoginLink.ToolTip = loginLink.Text; + this.loginLink.Text = Localization.GetString("Login", Localization.GetResourceFile(this, MyFileName)); + this.enhancedLoginLink.Text = this.loginLink.Text; + this.loginLink.ToolTip = this.loginLink.Text; + this.enhancedLoginLink.ToolTip = this.loginLink.Text; } string returnUrl = HttpContext.Current.Request.RawUrl; @@ -140,23 +140,23 @@ protected override void OnLoad(EventArgs e) } returnUrl = HttpUtility.UrlEncode(returnUrl); - loginLink.NavigateUrl = Globals.LoginURL(returnUrl, (Request.QueryString["override"] != null)); - enhancedLoginLink.NavigateUrl = loginLink.NavigateUrl; + this.loginLink.NavigateUrl = Globals.LoginURL(returnUrl, (this.Request.QueryString["override"] != null)); + this.enhancedLoginLink.NavigateUrl = this.loginLink.NavigateUrl; //avoid issues caused by multiple clicks of login link var oneclick = "this.disabled=true;"; - if (Request.UserAgent != null && Request.UserAgent.Contains("MSIE 8.0")==false) + if (this.Request.UserAgent != null && this.Request.UserAgent.Contains("MSIE 8.0")==false) { - loginLink.Attributes.Add("onclick", oneclick); - enhancedLoginLink.Attributes.Add("onclick", oneclick); + this.loginLink.Attributes.Add("onclick", oneclick); + this.enhancedLoginLink.Attributes.Add("onclick", oneclick); } - if (PortalSettings.EnablePopUps && PortalSettings.LoginTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this)) + if (this.PortalSettings.EnablePopUps && this.PortalSettings.LoginTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this)) { //To avoid duplicated encodes of URL - var clickEvent = "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(loginLink.NavigateUrl), this, PortalSettings, true, false, 300, 650); - loginLink.Attributes.Add("onclick", clickEvent); - enhancedLoginLink.Attributes.Add("onclick", clickEvent); + var clickEvent = "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(this.loginLink.NavigateUrl), this, this.PortalSettings, true, false, 300, 650); + this.loginLink.Attributes.Add("onclick", clickEvent); + this.enhancedLoginLink.Attributes.Add("onclick", clickEvent); } } } diff --git a/DNN Platform/Website/admin/Skins/Logo.ascx.cs b/DNN Platform/Website/admin/Skins/Logo.ascx.cs index 7cf7186d122..a8b39cba9c3 100644 --- a/DNN Platform/Website/admin/Skins/Logo.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Logo.ascx.cs @@ -32,7 +32,7 @@ public partial class Logo : SkinObjectBase public Logo() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } protected override void OnLoad(EventArgs e) @@ -40,43 +40,43 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!String.IsNullOrEmpty(BorderWidth)) + if (!String.IsNullOrEmpty(this.BorderWidth)) { - imgLogo.BorderWidth = Unit.Parse(BorderWidth); + this.imgLogo.BorderWidth = Unit.Parse(this.BorderWidth); } - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - imgLogo.CssClass = CssClass; + this.imgLogo.CssClass = this.CssClass; } bool logoVisible = false; - if (!String.IsNullOrEmpty(PortalSettings.LogoFile)) + if (!String.IsNullOrEmpty(this.PortalSettings.LogoFile)) { - var fileInfo = GetLogoFileInfo(); + var fileInfo = this.GetLogoFileInfo(); if (fileInfo != null) { string imageUrl = FileManager.Instance.GetUrl(fileInfo); if (!String.IsNullOrEmpty(imageUrl)) { - imgLogo.ImageUrl = imageUrl; + this.imgLogo.ImageUrl = imageUrl; logoVisible = true; } } } - imgLogo.Visible = logoVisible; - imgLogo.AlternateText = PortalSettings.PortalName; - hypLogo.ToolTip = PortalSettings.PortalName; + this.imgLogo.Visible = logoVisible; + this.imgLogo.AlternateText = this.PortalSettings.PortalName; + this.hypLogo.ToolTip = this.PortalSettings.PortalName; - if (!imgLogo.Visible) + if (!this.imgLogo.Visible) { - hypLogo.Attributes.Add("aria-label", PortalSettings.PortalName); + this.hypLogo.Attributes.Add("aria-label", this.PortalSettings.PortalName); } - if (PortalSettings.HomeTabId != -1) + if (this.PortalSettings.HomeTabId != -1) { - hypLogo.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.HomeTabId); + this.hypLogo.NavigateUrl = this._navigationManager.NavigateURL(this.PortalSettings.HomeTabId); } else { - hypLogo.NavigateUrl = Globals.AddHTTP(PortalSettings.PortalAlias.HTTPAlias); + this.hypLogo.NavigateUrl = Globals.AddHTTP(this.PortalSettings.PortalAlias.HTTPAlias); } } catch (Exception exc) @@ -87,16 +87,16 @@ protected override void OnLoad(EventArgs e) private IFileInfo GetLogoFileInfo() { - string cacheKey = String.Format(DataCache.PortalCacheKey, PortalSettings.PortalId, PortalSettings.CultureCode) + "LogoFile"; + string cacheKey = String.Format(DataCache.PortalCacheKey, this.PortalSettings.PortalId, this.PortalSettings.CultureCode) + "LogoFile"; var file = CBO.GetCachedObject(new CacheItemArgs(cacheKey, DataCache.PortalCacheTimeOut, DataCache.PortalCachePriority), - GetLogoFileInfoCallBack); + this.GetLogoFileInfoCallBack); return file; } private IFileInfo GetLogoFileInfoCallBack(CacheItemArgs itemArgs) { - return FileManager.Instance.GetFile(PortalSettings.PortalId, PortalSettings.LogoFile); + return FileManager.Instance.GetFile(this.PortalSettings.PortalId, this.PortalSettings.LogoFile); } } } diff --git a/DNN Platform/Website/admin/Skins/Meta.ascx.cs b/DNN Platform/Website/admin/Skins/Meta.ascx.cs index b87ec9682f7..6160fef3893 100644 --- a/DNN Platform/Website/admin/Skins/Meta.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Meta.ascx.cs @@ -66,21 +66,21 @@ protected override void OnPreRender(EventArgs e) // Page.Header.Controls.Add(metaTag); //} - if ((!string.IsNullOrEmpty(Name) || !string.IsNullOrEmpty(HttpEquiv)) && !string.IsNullOrEmpty(Content)) + if ((!string.IsNullOrEmpty(this.Name) || !string.IsNullOrEmpty(this.HttpEquiv)) && !string.IsNullOrEmpty(this.Content)) { var metaTag = new HtmlMeta(); - if (!string.IsNullOrEmpty(HttpEquiv)) - metaTag.HttpEquiv = HttpEquiv; - if (!string.IsNullOrEmpty(Name)) - metaTag.Name = Name; + if (!string.IsNullOrEmpty(this.HttpEquiv)) + metaTag.HttpEquiv = this.HttpEquiv; + if (!string.IsNullOrEmpty(this.Name)) + metaTag.Name = this.Name; - metaTag.Content = Content; + metaTag.Content = this.Content; - if (InsertFirst) - Page.Header.Controls.AddAt(0, metaTag); + if (this.InsertFirst) + this.Page.Header.Controls.AddAt(0, metaTag); else - Page.Header.Controls.Add(metaTag); + this.Page.Header.Controls.Add(metaTag); } } diff --git a/DNN Platform/Website/admin/Skins/Nav.ascx.cs b/DNN Platform/Website/admin/Skins/Nav.ascx.cs index 4e1136f069b..eb0ffdf5aa6 100644 --- a/DNN Platform/Website/admin/Skins/Nav.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Nav.ascx.cs @@ -27,15 +27,15 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - bool blnIndicateChildren = bool.Parse(GetValue(IndicateChildren, "True")); + bool blnIndicateChildren = bool.Parse(this.GetValue(this.IndicateChildren, "True")); string strRightArrow; string strDownArrow; var objSkins = new SkinController(); //image for right facing arrow - if (!String.IsNullOrEmpty(IndicateChildImageSub)) + if (!String.IsNullOrEmpty(this.IndicateChildImageSub)) { - strRightArrow = IndicateChildImageSub; + strRightArrow = this.IndicateChildImageSub; } else { @@ -43,9 +43,9 @@ protected override void OnLoad(EventArgs e) } //image for down facing arrow - if (!String.IsNullOrEmpty(IndicateChildImageRoot)) + if (!String.IsNullOrEmpty(this.IndicateChildImageRoot)) { - strDownArrow = IndicateChildImageRoot; + strDownArrow = this.IndicateChildImageRoot; } else { @@ -53,105 +53,105 @@ protected override void OnLoad(EventArgs e) } //Set correct image path for all separator images - if (!String.IsNullOrEmpty(SeparatorHTML)) + if (!String.IsNullOrEmpty(this.SeparatorHTML)) { - SeparatorHTML = FixImagePath(SeparatorHTML); + this.SeparatorHTML = this.FixImagePath(this.SeparatorHTML); } - if (!String.IsNullOrEmpty(SeparatorLeftHTML)) + if (!String.IsNullOrEmpty(this.SeparatorLeftHTML)) { - SeparatorLeftHTML = FixImagePath(SeparatorLeftHTML); + this.SeparatorLeftHTML = this.FixImagePath(this.SeparatorLeftHTML); } - if (!String.IsNullOrEmpty(SeparatorRightHTML)) + if (!String.IsNullOrEmpty(this.SeparatorRightHTML)) { - SeparatorRightHTML = FixImagePath(SeparatorRightHTML); + this.SeparatorRightHTML = this.FixImagePath(this.SeparatorRightHTML); } - if (!String.IsNullOrEmpty(SeparatorLeftHTMLBreadCrumb)) + if (!String.IsNullOrEmpty(this.SeparatorLeftHTMLBreadCrumb)) { - SeparatorLeftHTMLBreadCrumb = FixImagePath(SeparatorLeftHTMLBreadCrumb); + this.SeparatorLeftHTMLBreadCrumb = this.FixImagePath(this.SeparatorLeftHTMLBreadCrumb); } - if (!String.IsNullOrEmpty(SeparatorRightHTMLBreadCrumb)) + if (!String.IsNullOrEmpty(this.SeparatorRightHTMLBreadCrumb)) { - SeparatorRightHTMLBreadCrumb = FixImagePath(SeparatorRightHTMLBreadCrumb); + this.SeparatorRightHTMLBreadCrumb = this.FixImagePath(this.SeparatorRightHTMLBreadCrumb); } - if (!String.IsNullOrEmpty(SeparatorLeftHTMLActive)) + if (!String.IsNullOrEmpty(this.SeparatorLeftHTMLActive)) { - SeparatorLeftHTMLActive = FixImagePath(SeparatorLeftHTMLActive); + this.SeparatorLeftHTMLActive = this.FixImagePath(this.SeparatorLeftHTMLActive); } - if (!String.IsNullOrEmpty(SeparatorRightHTMLActive)) + if (!String.IsNullOrEmpty(this.SeparatorRightHTMLActive)) { - SeparatorRightHTMLActive = FixImagePath(SeparatorRightHTMLActive); + this.SeparatorRightHTMLActive = this.FixImagePath(this.SeparatorRightHTMLActive); } - if (!String.IsNullOrEmpty(NodeLeftHTMLBreadCrumbRoot)) + if (!String.IsNullOrEmpty(this.NodeLeftHTMLBreadCrumbRoot)) { - NodeLeftHTMLBreadCrumbRoot = FixImagePath(NodeLeftHTMLBreadCrumbRoot); + this.NodeLeftHTMLBreadCrumbRoot = this.FixImagePath(this.NodeLeftHTMLBreadCrumbRoot); } - if (!String.IsNullOrEmpty(NodeRightHTMLBreadCrumbRoot)) + if (!String.IsNullOrEmpty(this.NodeRightHTMLBreadCrumbRoot)) { - NodeRightHTMLBreadCrumbRoot = FixImagePath(NodeRightHTMLBreadCrumbRoot); + this.NodeRightHTMLBreadCrumbRoot = this.FixImagePath(this.NodeRightHTMLBreadCrumbRoot); } - if (!String.IsNullOrEmpty(NodeLeftHTMLBreadCrumbSub)) + if (!String.IsNullOrEmpty(this.NodeLeftHTMLBreadCrumbSub)) { - NodeLeftHTMLBreadCrumbSub = FixImagePath(NodeLeftHTMLBreadCrumbSub); + this.NodeLeftHTMLBreadCrumbSub = this.FixImagePath(this.NodeLeftHTMLBreadCrumbSub); } - if (!String.IsNullOrEmpty(NodeRightHTMLBreadCrumbSub)) + if (!String.IsNullOrEmpty(this.NodeRightHTMLBreadCrumbSub)) { - NodeRightHTMLBreadCrumbSub = FixImagePath(NodeRightHTMLBreadCrumbSub); + this.NodeRightHTMLBreadCrumbSub = this.FixImagePath(this.NodeRightHTMLBreadCrumbSub); } - if (!String.IsNullOrEmpty(NodeLeftHTMLRoot)) + if (!String.IsNullOrEmpty(this.NodeLeftHTMLRoot)) { - NodeLeftHTMLRoot = FixImagePath(NodeLeftHTMLRoot); + this.NodeLeftHTMLRoot = this.FixImagePath(this.NodeLeftHTMLRoot); } - if (!String.IsNullOrEmpty(NodeRightHTMLRoot)) + if (!String.IsNullOrEmpty(this.NodeRightHTMLRoot)) { - NodeRightHTMLRoot = FixImagePath(NodeRightHTMLRoot); + this.NodeRightHTMLRoot = this.FixImagePath(this.NodeRightHTMLRoot); } - if (!String.IsNullOrEmpty(NodeLeftHTMLSub)) + if (!String.IsNullOrEmpty(this.NodeLeftHTMLSub)) { - NodeLeftHTMLSub = FixImagePath(NodeLeftHTMLSub); + this.NodeLeftHTMLSub = this.FixImagePath(this.NodeLeftHTMLSub); } - if (!String.IsNullOrEmpty(NodeRightHTMLSub)) + if (!String.IsNullOrEmpty(this.NodeRightHTMLSub)) { - NodeRightHTMLSub = FixImagePath(NodeRightHTMLSub); + this.NodeRightHTMLSub = this.FixImagePath(this.NodeRightHTMLSub); } - if (String.IsNullOrEmpty(PathImage)) + if (String.IsNullOrEmpty(this.PathImage)) { - PathImage = PortalSettings.HomeDirectory; + this.PathImage = this.PortalSettings.HomeDirectory; } if (blnIndicateChildren) { - IndicateChildImageSub = strRightArrow; - if (ControlOrientation.ToLowerInvariant() == "vertical") + this.IndicateChildImageSub = strRightArrow; + if (this.ControlOrientation.ToLowerInvariant() == "vertical") { - IndicateChildImageRoot = strRightArrow; + this.IndicateChildImageRoot = strRightArrow; } else { - IndicateChildImageRoot = strDownArrow; + this.IndicateChildImageRoot = strDownArrow; } } else { - IndicateChildImageSub = "[APPIMAGEPATH]spacer.gif"; + this.IndicateChildImageSub = "[APPIMAGEPATH]spacer.gif"; } - PathSystemScript = Globals.ApplicationPath + "/controls/SolpartMenu/"; - PathSystemImage = "[APPIMAGEPATH]"; - BuildNodes(null); + this.PathSystemScript = Globals.ApplicationPath + "/controls/SolpartMenu/"; + this.PathSystemImage = "[APPIMAGEPATH]"; + this.BuildNodes(null); } catch (Exception exc) { @@ -174,37 +174,37 @@ private string FixImagePath(string strPath) private void BuildNodes(DNNNode objNode) { DNNNodeCollection objNodes; - objNodes = GetNavigationNodes(objNode); - Control.ClearNodes(); //since we always bind we need to clear the nodes for providers that maintain their state - Bind(objNodes); + objNodes = this.GetNavigationNodes(objNode); + this.Control.ClearNodes(); //since we always bind we need to clear the nodes for providers that maintain their state + this.Bind(objNodes); } protected override void OnInit(EventArgs e) { - InitializeNavControl(this, "SolpartMenuNavigationProvider"); - Control.NodeClick += Control_NodeClick; - Control.PopulateOnDemand += Control_PopulateOnDemand; + this.InitializeNavControl(this, "SolpartMenuNavigationProvider"); + this.Control.NodeClick += this.Control_NodeClick; + this.Control.PopulateOnDemand += this.Control_PopulateOnDemand; base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } private void Control_NodeClick(NavigationEventArgs args) { if (args.Node == null) { - args.Node = Navigation.GetNavigationNode(args.ID, Control.ID); + args.Node = Navigation.GetNavigationNode(args.ID, this.Control.ID); } - Response.Redirect(Globals.ApplicationURL(int.Parse(args.Node.Key)), true); + this.Response.Redirect(Globals.ApplicationURL(int.Parse(args.Node.Key)), true); } private void Control_PopulateOnDemand(NavigationEventArgs args) { if (args.Node == null) { - args.Node = Navigation.GetNavigationNode(args.ID, Control.ID); + args.Node = Navigation.GetNavigationNode(args.ID, this.Control.ID); } - BuildNodes(args.Node); + this.BuildNodes(args.Node); } } } diff --git a/DNN Platform/Website/admin/Skins/Privacy.ascx.cs b/DNN Platform/Website/admin/Skins/Privacy.ascx.cs index 332ed1654d6..3566313f2df 100644 --- a/DNN Platform/Website/admin/Skins/Privacy.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Privacy.ascx.cs @@ -31,7 +31,7 @@ public partial class Privacy : SkinObjectBase public Privacy() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -42,7 +42,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) @@ -50,20 +50,20 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - hypPrivacy.CssClass = CssClass; + this.hypPrivacy.CssClass = this.CssClass; } - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - hypPrivacy.Text = Text; + this.hypPrivacy.Text = this.Text; } else { - hypPrivacy.Text = Localization.GetString("Privacy", Localization.GetResourceFile(this, MyFileName)); + this.hypPrivacy.Text = Localization.GetString("Privacy", Localization.GetResourceFile(this, MyFileName)); } - hypPrivacy.NavigateUrl = PortalSettings.PrivacyTabId == Null.NullInteger ? _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Privacy") : _navigationManager.NavigateURL(PortalSettings.PrivacyTabId); - hypPrivacy.Attributes["rel"] = "nofollow"; + this.hypPrivacy.NavigateUrl = this.PortalSettings.PrivacyTabId == Null.NullInteger ? this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Privacy") : this._navigationManager.NavigateURL(this.PortalSettings.PrivacyTabId); + this.hypPrivacy.Attributes["rel"] = "nofollow"; } catch (Exception exc) { diff --git a/DNN Platform/Website/admin/Skins/Search.ascx.cs b/DNN Platform/Website/admin/Skins/Search.ascx.cs index 8155410b0af..753302b996d 100644 --- a/DNN Platform/Website/admin/Skins/Search.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Search.ascx.cs @@ -26,7 +26,7 @@ public partial class Search : SkinObjectBase private readonly INavigationManager _navigationManager; public Search() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } #region Private Members @@ -63,11 +63,11 @@ public bool ShowSite { get { - return _showSite; + return this._showSite; } set { - _showSite = value; + this._showSite = value; } } @@ -80,11 +80,11 @@ public bool ShowWeb { get { - return _showWeb; + return this._showWeb; } set { - _showWeb = value; + this._showWeb = value; } } @@ -99,15 +99,15 @@ public string SiteIconURL { get { - if (string.IsNullOrEmpty(_siteIconURL)) + if (string.IsNullOrEmpty(this._siteIconURL)) { return IconController.IconURL("DnnSearch"); } - return _siteIconURL; + return this._siteIconURL; } set { - _siteIconURL = value; + this._siteIconURL = value; } } @@ -153,15 +153,15 @@ public string SiteText { get { - if (string.IsNullOrEmpty(_siteText)) + if (string.IsNullOrEmpty(this._siteText)) { return Localization.GetString("Site", Localization.GetResourceFile(this, MyFileName)); } - return _siteText; + return this._siteText; } set { - _siteText = value; + this._siteText = value; } } @@ -175,15 +175,15 @@ public string SiteToolTip { get { - if (string.IsNullOrEmpty(_siteToolTip)) + if (string.IsNullOrEmpty(this._siteToolTip)) { return Localization.GetString("Site.ToolTip", Localization.GetResourceFile(this, MyFileName)); } - return _siteToolTip; + return this._siteToolTip; } set { - _siteToolTip = value; + this._siteToolTip = value; } } @@ -199,15 +199,15 @@ public string SiteURL { get { - if (string.IsNullOrEmpty(_siteURL)) + if (string.IsNullOrEmpty(this._siteURL)) { return Localization.GetString("URL", Localization.GetResourceFile(this, MyFileName)); } - return _siteURL; + return this._siteURL; } set { - _siteURL = value; + this._siteURL = value; } } @@ -245,15 +245,15 @@ public string WebIconURL { get { - if (string.IsNullOrEmpty(_webIconURL)) + if (string.IsNullOrEmpty(this._webIconURL)) { return IconController.IconURL("GoogleSearch"); } - return _webIconURL; + return this._webIconURL; } set { - _webIconURL = value; + this._webIconURL = value; } } @@ -267,15 +267,15 @@ public string WebText { get { - if (string.IsNullOrEmpty(_webText)) + if (string.IsNullOrEmpty(this._webText)) { return Localization.GetString("Web", Localization.GetResourceFile(this, MyFileName)); } - return _webText; + return this._webText; } set { - _webText = value; + this._webText = value; } } @@ -289,15 +289,15 @@ public string WebToolTip { get { - if (string.IsNullOrEmpty(_webToolTip)) + if (string.IsNullOrEmpty(this._webToolTip)) { return Localization.GetString("Web.ToolTip", Localization.GetResourceFile(this, MyFileName)); } - return _webToolTip; + return this._webToolTip; } set { - _webToolTip = value; + this._webToolTip = value; } } @@ -314,15 +314,15 @@ public string WebURL { get { - if (string.IsNullOrEmpty(_webURL)) + if (string.IsNullOrEmpty(this._webURL)) { return Localization.GetString("URL", Localization.GetResourceFile(this, MyFileName)); } - return _webURL; + return this._webURL; } set { - _webURL = value; + this._webURL = value; } } @@ -340,7 +340,7 @@ public string WebURL /// /// Disable the wild search /// - public bool EnableWildSearch { get { return _enableWildSearch; } set { _enableWildSearch = value; } } + public bool EnableWildSearch { get { return this._enableWildSearch; } set { this._enableWildSearch = value; } } protected int PortalId { get; set; } @@ -354,15 +354,15 @@ public string WebURL private int GetSearchTabId() { - int searchTabId = PortalSettings.SearchTabId; + int searchTabId = this.PortalSettings.SearchTabId; if (searchTabId == Null.NullInteger) { - ArrayList arrModules = ModuleController.Instance.GetModulesByDefinition(PortalSettings.PortalId, "Search Results"); + ArrayList arrModules = ModuleController.Instance.GetModulesByDefinition(this.PortalSettings.PortalId, "Search Results"); if (arrModules.Count > 1) { foreach (ModuleInfo SearchModule in arrModules) { - if (SearchModule.CultureCode == PortalSettings.CultureCode) + if (SearchModule.CultureCode == this.PortalSettings.CultureCode) { searchTabId = SearchModule.TabID; } @@ -388,7 +388,7 @@ private int GetSearchTabId() /// protected void ExecuteSearch(string searchText, string searchType) { - int searchTabId = GetSearchTabId(); + int searchTabId = this.GetSearchTabId(); if (searchTabId == Null.NullInteger) { @@ -401,36 +401,36 @@ protected void ExecuteSearch(string searchText, string searchType) { case "S": // site - if (UseWebForSite) + if (this.UseWebForSite) { - strURL = SiteURL; + strURL = this.SiteURL; if (!string.IsNullOrEmpty(strURL)) { - strURL = strURL.Replace("[TEXT]", Server.UrlEncode(searchText)); - strURL = strURL.Replace("[DOMAIN]", Request.Url.Host); - UrlUtils.OpenNewWindow(Page, GetType(), strURL); + strURL = strURL.Replace("[TEXT]", this.Server.UrlEncode(searchText)); + strURL = strURL.Replace("[DOMAIN]", this.Request.Url.Host); + UrlUtils.OpenNewWindow(this.Page, this.GetType(), strURL); } } else { if (Host.UseFriendlyUrls) { - Response.Redirect(_navigationManager.NavigateURL(searchTabId) + "?Search=" + Server.UrlEncode(searchText)); + this.Response.Redirect(this._navigationManager.NavigateURL(searchTabId) + "?Search=" + this.Server.UrlEncode(searchText)); } else { - Response.Redirect(_navigationManager.NavigateURL(searchTabId) + "&Search=" + Server.UrlEncode(searchText)); + this.Response.Redirect(this._navigationManager.NavigateURL(searchTabId) + "&Search=" + this.Server.UrlEncode(searchText)); } } break; case "W": // web - strURL = WebURL; + strURL = this.WebURL; if (!string.IsNullOrEmpty(strURL)) { - strURL = strURL.Replace("[TEXT]", Server.UrlEncode(searchText)); + strURL = strURL.Replace("[TEXT]", this.Server.UrlEncode(searchText)); strURL = strURL.Replace("[DOMAIN]", ""); - UrlUtils.OpenNewWindow(Page, GetType(), strURL); + UrlUtils.OpenNewWindow(this.Page, this.GetType(), strURL); } break; } @@ -439,11 +439,11 @@ protected void ExecuteSearch(string searchText, string searchType) { if (Host.UseFriendlyUrls) { - Response.Redirect(_navigationManager.NavigateURL(searchTabId)); + this.Response.Redirect(this._navigationManager.NavigateURL(searchTabId)); } else { - Response.Redirect(_navigationManager.NavigateURL(searchTabId)); + this.Response.Redirect(this._navigationManager.NavigateURL(searchTabId)); } } } @@ -461,37 +461,37 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); Framework.ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Search/SearchSkinObjectPreview.css", FileOrder.Css.ModuleCss); - ClientResourceManager.RegisterScript(Page, "~/Resources/Search/SearchSkinObjectPreview.js"); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Search/SearchSkinObjectPreview.css", FileOrder.Css.ModuleCss); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Search/SearchSkinObjectPreview.js"); - cmdSearch.Click += CmdSearchClick; - cmdSearchNew.Click += CmdSearchNewClick; + this.cmdSearch.Click += this.CmdSearchClick; + this.cmdSearchNew.Click += this.CmdSearchNewClick; - if (MinCharRequired == 0) MinCharRequired = 2; - if (AutoSearchDelayInMilliSecond == 0) AutoSearchDelayInMilliSecond = 400; - PortalId = PortalSettings.ActiveTab.IsSuperTab ? PortalSettings.PortalId : -1; + if (this.MinCharRequired == 0) this.MinCharRequired = 2; + if (this.AutoSearchDelayInMilliSecond == 0) this.AutoSearchDelayInMilliSecond = 400; + this.PortalId = this.PortalSettings.ActiveTab.IsSuperTab ? this.PortalSettings.PortalId : -1; - if (!String.IsNullOrEmpty(Submit)) + if (!String.IsNullOrEmpty(this.Submit)) { - if (Submit.IndexOf("src=", StringComparison.Ordinal) != -1) + if (this.Submit.IndexOf("src=", StringComparison.Ordinal) != -1) { - Submit = Submit.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); - Submit = Submit.Replace("src='", "src='" + PortalSettings.ActiveTab.SkinPath); + this.Submit = this.Submit.Replace("src=\"", "src=\"" + this.PortalSettings.ActiveTab.SkinPath); + this.Submit = this.Submit.Replace("src='", "src='" + this.PortalSettings.ActiveTab.SkinPath); } } else { - Submit = Localization.GetString("Search", Localization.GetResourceFile(this, MyFileName)); + this.Submit = Localization.GetString("Search", Localization.GetResourceFile(this, MyFileName)); } - cmdSearch.Text = Submit; - cmdSearchNew.Text = Submit; - if (!String.IsNullOrEmpty(CssClass)) + this.cmdSearch.Text = this.Submit; + this.cmdSearchNew.Text = this.Submit; + if (!String.IsNullOrEmpty(this.CssClass)) { - WebRadioButton.CssClass = CssClass; - SiteRadioButton.CssClass = CssClass; - cmdSearch.CssClass = CssClass; - cmdSearchNew.CssClass = CssClass; + this.WebRadioButton.CssClass = this.CssClass; + this.SiteRadioButton.CssClass = this.CssClass; + this.cmdSearch.CssClass = this.CssClass; + this.cmdSearchNew.CssClass = this.CssClass; } } @@ -503,15 +503,15 @@ protected override void OnLoad(EventArgs e) /// This event is only used when UseDropDownList is false. private void CmdSearchClick(object sender, EventArgs e) { - SearchType = "S"; - if (WebRadioButton.Visible) + this.SearchType = "S"; + if (this.WebRadioButton.Visible) { - if (WebRadioButton.Checked) + if (this.WebRadioButton.Checked) { - SearchType = "W"; + this.SearchType = "W"; } } - ExecuteSearch(txtSearch.Text.Trim(), SearchType); + this.ExecuteSearch(this.txtSearch.Text.Trim(), this.SearchType); } /// @@ -522,8 +522,8 @@ private void CmdSearchClick(object sender, EventArgs e) /// This event is only used when UseDropDownList is true. protected void CmdSearchNewClick(object sender, EventArgs e) { - SearchType = ClientAPI.GetClientVariable(Page, "SearchIconSelected"); - ExecuteSearch(txtSearchNew.Text.Trim(), SearchType); + this.SearchType = ClientAPI.GetClientVariable(this.Page, "SearchIconSelected"); + this.ExecuteSearch(this.txtSearchNew.Text.Trim(), this.SearchType); } /// @@ -535,54 +535,54 @@ protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); - ClassicSearch.Visible = !UseDropDownList; - DropDownSearch.Visible = UseDropDownList; - CultureCode = System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); + this.ClassicSearch.Visible = !this.UseDropDownList; + this.DropDownSearch.Visible = this.UseDropDownList; + this.CultureCode = System.Threading.Thread.CurrentThread.CurrentCulture.ToString(); - if (UseDropDownList) + if (this.UseDropDownList) { //Client Variables will survive a postback so there is no reason to register them. - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - downArrow.AlternateText = Localization.GetString("DropDownGlyph.AltText", Localization.GetResourceFile(this, MyFileName)); - downArrow.ToolTip = downArrow.AlternateText; + this.downArrow.AlternateText = Localization.GetString("DropDownGlyph.AltText", Localization.GetResourceFile(this, MyFileName)); + this.downArrow.ToolTip = this.downArrow.AlternateText; - ClientAPI.RegisterClientVariable(Page, "SearchIconWebUrl", string.Format("url({0})", ResolveUrl(WebIconURL)), true); - ClientAPI.RegisterClientVariable(Page, "SearchIconSiteUrl", string.Format("url({0})", ResolveUrl(SiteIconURL)), true); + ClientAPI.RegisterClientVariable(this.Page, "SearchIconWebUrl", string.Format("url({0})", this.ResolveUrl(this.WebIconURL)), true); + ClientAPI.RegisterClientVariable(this.Page, "SearchIconSiteUrl", string.Format("url({0})", this.ResolveUrl(this.SiteIconURL)), true); //We are going to use a dnn client variable to store which search option (web/site) is selected. - ClientAPI.RegisterClientVariable(Page, "SearchIconSelected", "S", true); - SearchType = "S"; + ClientAPI.RegisterClientVariable(this.Page, "SearchIconSelected", "S", true); + this.SearchType = "S"; } JavaScript.RegisterClientReference(this.Page, ClientAPI.ClientNamespaceReferences.dnn); - ClientResourceManager.RegisterScript(Page, "~/Resources/Search/Search.js", FileOrder.Js.DefaultPriority, "DnnFormBottomProvider"); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Search/Search.js", FileOrder.Js.DefaultPriority, "DnnFormBottomProvider"); - txtSearchNew.Attributes.Add("autocomplete", "off"); - txtSearchNew.Attributes.Add("placeholder", PlaceHolderText); + this.txtSearchNew.Attributes.Add("autocomplete", "off"); + this.txtSearchNew.Attributes.Add("placeholder", this.PlaceHolderText); } else { - WebRadioButton.Visible = ShowWeb; - SiteRadioButton.Visible = ShowSite; + this.WebRadioButton.Visible = this.ShowWeb; + this.SiteRadioButton.Visible = this.ShowSite; - if (WebRadioButton.Visible) + if (this.WebRadioButton.Visible) { - WebRadioButton.Checked = true; - WebRadioButton.Text = WebText; - WebRadioButton.ToolTip = WebToolTip; + this.WebRadioButton.Checked = true; + this.WebRadioButton.Text = this.WebText; + this.WebRadioButton.ToolTip = this.WebToolTip; } - if (SiteRadioButton.Visible) + if (this.SiteRadioButton.Visible) { - SiteRadioButton.Checked = true; - SiteRadioButton.Text = SiteText; - SiteRadioButton.ToolTip = SiteToolTip; + this.SiteRadioButton.Checked = true; + this.SiteRadioButton.Text = this.SiteText; + this.SiteRadioButton.ToolTip = this.SiteToolTip; } - SearchType = "S"; - txtSearch.Attributes.Add("autocomplete", "off"); - txtSearch.Attributes.Add("placeholder", PlaceHolderText); + this.SearchType = "S"; + this.txtSearch.Attributes.Add("autocomplete", "off"); + this.txtSearch.Attributes.Add("placeholder", this.PlaceHolderText); } } diff --git a/DNN Platform/Website/admin/Skins/Styles.ascx.cs b/DNN Platform/Website/admin/Skins/Styles.ascx.cs index 545ba22c714..e721ad71e0e 100644 --- a/DNN Platform/Website/admin/Skins/Styles.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Styles.ascx.cs @@ -31,11 +31,11 @@ public bool UseSkinPath { get { - return _useSkinPath; + return this._useSkinPath; } set { - _useSkinPath = value; + this._useSkinPath = value; } } @@ -44,34 +44,34 @@ public bool UseSkinPath protected override void OnLoad(EventArgs e) { base.OnLoad(e); - AddStyleSheet(); + this.AddStyleSheet(); } protected void AddStyleSheet() { //Find the placeholder control - Control objCSS = Page.FindControl("CSS"); + Control objCSS = this.Page.FindControl("CSS"); if (objCSS != null) { //First see if we have already added the control - Control objCtrl = Page.Header.FindControl(ID); + Control objCtrl = this.Page.Header.FindControl(this.ID); if (objCtrl == null) { string skinpath = string.Empty; - if (UseSkinPath) + if (this.UseSkinPath) { - skinpath = ((Skin) Parent).SkinPath; + skinpath = ((Skin) this.Parent).SkinPath; } var objLink = new HtmlLink(); - objLink.ID = Globals.CreateValidID(Name); + objLink.ID = Globals.CreateValidID(this.Name); objLink.Attributes["rel"] = "stylesheet"; objLink.Attributes["type"] = "text/css"; - objLink.Href = skinpath + StyleSheet; - if (Media != "") + objLink.Href = skinpath + this.StyleSheet; + if (this.Media != "") { - objLink.Attributes["media"] = Media; //NWS: add support for "media" attribute + objLink.Attributes["media"] = this.Media; //NWS: add support for "media" attribute } - if (IsFirst) + if (this.IsFirst) { //Find the first HtmlLink int iLink; @@ -82,11 +82,11 @@ protected void AddStyleSheet() break; } } - AddLink(objCSS, iLink, objLink); + this.AddLink(objCSS, iLink, objLink); } else { - AddLink(objCSS, -1, objLink); + this.AddLink(objCSS, -1, objLink); } } } @@ -94,7 +94,7 @@ protected void AddStyleSheet() protected void AddLink(Control cssRoot, int InsertAt, HtmlLink link) { - if (string.IsNullOrEmpty(Condition)) + if (string.IsNullOrEmpty(this.Condition)) { if (InsertAt == -1) { @@ -108,7 +108,7 @@ protected void AddLink(Control cssRoot, int InsertAt, HtmlLink link) else { var openif = new Literal(); - openif.Text = string.Format(""; if (InsertAt == -1) diff --git a/DNN Platform/Website/admin/Skins/Terms.ascx.cs b/DNN Platform/Website/admin/Skins/Terms.ascx.cs index 80954bda431..0c49d255504 100644 --- a/DNN Platform/Website/admin/Skins/Terms.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Terms.ascx.cs @@ -31,7 +31,7 @@ public partial class Terms : SkinObjectBase public Terms() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } private void InitializeComponent() @@ -42,7 +42,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } protected override void OnLoad(EventArgs e) @@ -50,21 +50,21 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - hypTerms.CssClass = CssClass; + this.hypTerms.CssClass = this.CssClass; } - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - hypTerms.Text = Text; + this.hypTerms.Text = this.Text; } else { - hypTerms.Text = Localization.GetString("Terms", Localization.GetResourceFile(this, MyFileName)); + this.hypTerms.Text = Localization.GetString("Terms", Localization.GetResourceFile(this, MyFileName)); } - hypTerms.NavigateUrl = PortalSettings.TermsTabId == Null.NullInteger ? _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Terms") : _navigationManager.NavigateURL(PortalSettings.TermsTabId); + this.hypTerms.NavigateUrl = this.PortalSettings.TermsTabId == Null.NullInteger ? this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Terms") : this._navigationManager.NavigateURL(this.PortalSettings.TermsTabId); - hypTerms.Attributes["rel"] = "nofollow"; + this.hypTerms.Attributes["rel"] = "nofollow"; } catch (Exception exc) { diff --git a/DNN Platform/Website/admin/Skins/Text.ascx.cs b/DNN Platform/Website/admin/Skins/Text.ascx.cs index fcd28db2b0c..9d0106f9ea2 100644 --- a/DNN Platform/Website/admin/Skins/Text.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Text.ascx.cs @@ -27,15 +27,15 @@ public partial class Text : SkinObjectBase protected override void OnLoad(EventArgs e) { base.OnLoad(e); - string strText = ShowText; + string strText = this.ShowText; //load resources - if (!String.IsNullOrEmpty(ResourceKey)) + if (!String.IsNullOrEmpty(this.ResourceKey)) { //localization - string strFile = Path.GetFileName(Server.MapPath(PortalSettings.ActiveTab.SkinSrc)); - strFile = PortalSettings.ActiveTab.SkinPath + Localization.LocalResourceDirectory + "/" + strFile; - string strLocalization = Localization.GetString(ResourceKey, strFile); + string strFile = Path.GetFileName(this.Server.MapPath(this.PortalSettings.ActiveTab.SkinSrc)); + strFile = this.PortalSettings.ActiveTab.SkinPath + Localization.LocalResourceDirectory + "/" + strFile; + string strLocalization = Localization.GetString(this.ResourceKey, strFile); if (!String.IsNullOrEmpty(strLocalization)) { strText = strLocalization; @@ -45,20 +45,20 @@ protected override void OnLoad(EventArgs e) //If no value is found then use the value set the the Text attribute if (string.IsNullOrEmpty(strText)) { - strText = ShowText; + strText = this.ShowText; } //token replace - if (ReplaceTokens) + if (this.ReplaceTokens) { var tr = new TokenReplace(); - tr.AccessingUser = PortalSettings.UserInfo; + tr.AccessingUser = this.PortalSettings.UserInfo; strText = tr.ReplaceEnvironmentTokens(strText); } - lblText.Text = strText; - if (!String.IsNullOrEmpty(CssClass)) + this.lblText.Text = strText; + if (!String.IsNullOrEmpty(this.CssClass)) { - lblText.CssClass = CssClass; + this.lblText.CssClass = this.CssClass; } } } diff --git a/DNN Platform/Website/admin/Skins/Toast.ascx.cs b/DNN Platform/Website/admin/Skins/Toast.ascx.cs index 8b49a7f4c58..ba82e7d7e53 100644 --- a/DNN Platform/Website/admin/Skins/Toast.ascx.cs +++ b/DNN Platform/Website/admin/Skins/Toast.ascx.cs @@ -39,7 +39,7 @@ public partial class Toast : SkinObjectBase public Toast() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } public bool IsOnline() @@ -50,12 +50,12 @@ public bool IsOnline() public string GetNotificationLink() { - return GetMessageLink() + "?view=notifications&action=notifications"; + return this.GetMessageLink() + "?view=notifications&action=notifications"; } public string GetMessageLink() { - return _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId)); + return this._navigationManager.NavigateURL(this.GetMessageTab(), "", string.Format("userId={0}", this.PortalSettings.UserId)); } public string GetMessageLabel() @@ -71,13 +71,13 @@ public string GetNotificationLabel() //This method is copied from user skin object private int GetMessageTab() { - var cacheKey = string.Format("MessageCenterTab:{0}:{1}", PortalSettings.PortalId, PortalSettings.CultureCode); + var cacheKey = string.Format("MessageCenterTab:{0}:{1}", this.PortalSettings.PortalId, this.PortalSettings.CultureCode); var messageTabId = DataCache.GetCache(cacheKey); if (messageTabId > 0) return messageTabId; //Find the Message Tab - messageTabId = FindMessageTab(); + messageTabId = this.FindMessageTab(); //save in cache //NOTE - This cache is not being cleared. There is no easy way to clear this, except Tools->Clear Cache @@ -91,7 +91,7 @@ private int FindMessageTab() { //On brand new install the new Message Center Module is on the child page of User Profile Page //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page - var profileTab = TabController.Instance.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false); + var profileTab = TabController.Instance.GetTab(this.PortalSettings.UserTabId, this.PortalSettings.PortalId, false); if (profileTab != null) { var childTabs = TabController.Instance.GetTabsByPortal(profileTab.PortalID).DescendentsOf(profileTab.TabID); @@ -109,7 +109,7 @@ private int FindMessageTab() } //default to User Profile Page - return PortalSettings.UserTabId; + return this.PortalSettings.UserTabId; } protected override void OnLoad(EventArgs e) @@ -119,23 +119,23 @@ protected override void OnLoad(EventArgs e) JavaScript.RequestRegistration(CommonJs.jQueryUI); ServicesFramework.Instance.RequestAjaxAntiForgerySupport(); - ClientResourceManager.RegisterScript(Page, "~/Resources/Shared/components/Toast/jquery.toastmessage.js", DotNetNuke.Web.Client.FileOrder.Js.jQuery); - ClientResourceManager.RegisterStyleSheet(Page, "~/Resources/Shared/components/Toast/jquery.toastmessage.css", DotNetNuke.Web.Client.FileOrder.Css.DefaultCss); + ClientResourceManager.RegisterScript(this.Page, "~/Resources/Shared/components/Toast/jquery.toastmessage.js", DotNetNuke.Web.Client.FileOrder.Js.jQuery); + ClientResourceManager.RegisterStyleSheet(this.Page, "~/Resources/Shared/components/Toast/jquery.toastmessage.css", DotNetNuke.Web.Client.FileOrder.Css.DefaultCss); - InitializeConfig(); + this.InitializeConfig(); } private void InitializeConfig() { - ServiceModuleName = "InternalServices"; - ServiceAction = "NotificationsService/GetToasts"; + this.ServiceModuleName = "InternalServices"; + this.ServiceAction = "NotificationsService/GetToasts"; try { var toastConfig = DataCache.GetCache>(ToastCacheKey); if (toastConfig == null) { - var configFile = Server.MapPath(Path.Combine(TemplateSourceDirectory, "Toast.config")); + var configFile = this.Server.MapPath(Path.Combine(this.TemplateSourceDirectory, "Toast.config")); if (File.Exists(configFile)) { @@ -147,26 +147,26 @@ private void InitializeConfig() if (moduleNameNode != null && !string.IsNullOrEmpty(moduleNameNode.InnerText)) { - ServiceModuleName = moduleNameNode.InnerText; + this.ServiceModuleName = moduleNameNode.InnerText; } if (actionNode != null && !string.IsNullOrEmpty(actionNode.InnerText)) { - ServiceAction = actionNode.InnerText; + this.ServiceAction = actionNode.InnerText; } if (scriptsNode != null && !string.IsNullOrEmpty(scriptsNode.InnerText)) { - addtionalScripts.Text = scriptsNode.InnerText; - addtionalScripts.Visible = true; + this.addtionalScripts.Text = scriptsNode.InnerText; + this.addtionalScripts.Visible = true; } } var config = new Dictionary() { - {"ServiceModuleName", ServiceModuleName }, - {"ServiceAction", ServiceAction }, - {"AddtionalScripts", addtionalScripts.Text }, + {"ServiceModuleName", this.ServiceModuleName }, + {"ServiceAction", this.ServiceAction }, + {"AddtionalScripts", this.addtionalScripts.Text }, }; DataCache.SetCache(ToastCacheKey, config); } @@ -174,18 +174,18 @@ private void InitializeConfig() { if (!string.IsNullOrEmpty(toastConfig["ServiceModuleName"])) { - ServiceModuleName = toastConfig["ServiceModuleName"]; + this.ServiceModuleName = toastConfig["ServiceModuleName"]; } if (!string.IsNullOrEmpty(toastConfig["ServiceAction"])) { - ServiceAction = toastConfig["ServiceAction"]; + this.ServiceAction = toastConfig["ServiceAction"]; } if (!string.IsNullOrEmpty(toastConfig["AddtionalScripts"])) { - addtionalScripts.Text = toastConfig["AddtionalScripts"]; - addtionalScripts.Visible = true; + this.addtionalScripts.Text = toastConfig["AddtionalScripts"]; + this.addtionalScripts.Visible = true; } } } diff --git a/DNN Platform/Website/admin/Skins/TreeViewMenu.ascx.cs b/DNN Platform/Website/admin/Skins/TreeViewMenu.ascx.cs index f8c696c4783..0b04c622968 100644 --- a/DNN Platform/Website/admin/Skins/TreeViewMenu.ascx.cs +++ b/DNN Platform/Website/admin/Skins/TreeViewMenu.ascx.cs @@ -60,11 +60,11 @@ public string BodyCssClass { get { - return _bodyCssClass; + return this._bodyCssClass; } set { - _bodyCssClass = value; + this._bodyCssClass = value; } } @@ -72,11 +72,11 @@ public string CssClass { get { - return _cssClass; + return this._cssClass; } set { - _cssClass = value; + this._cssClass = value; } } @@ -84,11 +84,11 @@ public string HeaderCssClass { get { - return _headerCssClass; + return this._headerCssClass; } set { - _headerCssClass = value; + this._headerCssClass = value; } } @@ -96,11 +96,11 @@ public string HeaderTextCssClass { get { - return _headerTextCssClass; + return this._headerTextCssClass; } set { - _headerTextCssClass = value; + this._headerTextCssClass = value; } } @@ -108,11 +108,11 @@ public string HeaderText { get { - return _headerText; + return this._headerText; } set { - _headerText = value; + this._headerText = value; } } @@ -120,11 +120,11 @@ public bool IncludeHeader { get { - return _includeHeader; + return this._includeHeader; } set { - _includeHeader = value; + this._includeHeader = value; } } @@ -132,11 +132,11 @@ public string NodeChildCssClass { get { - return _nodeChildCssClass; + return this._nodeChildCssClass; } set { - _nodeChildCssClass = value; + this._nodeChildCssClass = value; } } @@ -144,11 +144,11 @@ public string NodeClosedImage { get { - return _nodeClosedImage; + return this._nodeClosedImage; } set { - _nodeClosedImage = value; + this._nodeClosedImage = value; } } @@ -156,11 +156,11 @@ public string NodeCollapseImage { get { - return _nodeCollapseImage; + return this._nodeCollapseImage; } set { - _nodeCollapseImage = value; + this._nodeCollapseImage = value; } } @@ -168,11 +168,11 @@ public string NodeCssClass { get { - return _nodeCssClass; + return this._nodeCssClass; } set { - _nodeCssClass = value; + this._nodeCssClass = value; } } @@ -180,11 +180,11 @@ public string NodeExpandImage { get { - return _nodeExpandImage; + return this._nodeExpandImage; } set { - _nodeExpandImage = value; + this._nodeExpandImage = value; } } @@ -192,11 +192,11 @@ public string NodeLeafImage { get { - return _nodeLeafImage; + return this._nodeLeafImage; } set { - _nodeLeafImage = value; + this._nodeLeafImage = value; } } @@ -204,11 +204,11 @@ public string NodeOpenImage { get { - return _nodeOpenImage; + return this._nodeOpenImage; } set { - _nodeOpenImage = value; + this._nodeOpenImage = value; } } @@ -216,11 +216,11 @@ public string NodeOverCssClass { get { - return _nodeOverCssClass; + return this._nodeOverCssClass; } set { - _nodeOverCssClass = value; + this._nodeOverCssClass = value; } } @@ -228,11 +228,11 @@ public string NodeSelectedCssClass { get { - return _nodeSelectedCssClass; + return this._nodeSelectedCssClass; } set { - _nodeSelectedCssClass = value; + this._nodeSelectedCssClass = value; } } @@ -242,11 +242,11 @@ public string ResourceKey { get { - return _resourceKey; + return this._resourceKey; } set { - _resourceKey = value; + this._resourceKey = value; } } @@ -254,11 +254,11 @@ public string TreeCssClass { get { - return _treeCssClass; + return this._treeCssClass; } set { - _treeCssClass = value; + this._treeCssClass = value; } } @@ -266,11 +266,11 @@ public string TreeGoUpImage { get { - return _treeGoUpImage; + return this._treeGoUpImage; } set { - _treeGoUpImage = value; + this._treeGoUpImage = value; } } @@ -278,11 +278,11 @@ public int TreeIndentWidth { get { - return _treeIndentWidth; + return this._treeIndentWidth; } set { - _treeIndentWidth = value; + this._treeIndentWidth = value; } } @@ -290,11 +290,11 @@ public string Width { get { - return _width; + return this._width; } set { - _width = value; + this._width = value; } } @@ -317,13 +317,13 @@ private void BuildTree(DNNNode objNode, bool blnPODRequest) { bool blnAddUpNode = false; DNNNodeCollection objNodes; - objNodes = GetNavigationNodes(objNode); + objNodes = this.GetNavigationNodes(objNode); if (blnPODRequest == false) { - if (!string.IsNullOrEmpty(Level)) + if (!string.IsNullOrEmpty(this.Level)) { - switch (Level.ToLowerInvariant()) + switch (this.Level.ToLowerInvariant()) { case "root": break; @@ -331,7 +331,7 @@ private void BuildTree(DNNNode objNode, bool blnPODRequest) blnAddUpNode = true; break; default: - if (Level.ToLowerInvariant() != "root" && PortalSettings.ActiveTab.BreadCrumbs.Count > 1) + if (this.Level.ToLowerInvariant() != "root" && this.PortalSettings.ActiveTab.BreadCrumbs.Count > 1) { blnAddUpNode = true; } @@ -344,25 +344,25 @@ private void BuildTree(DNNNode objNode, bool blnPODRequest) if (blnAddUpNode) { var objParentNode = new DNNNode(); - objParentNode.ID = PortalSettings.ActiveTab.ParentId.ToString(); + objParentNode.ID = this.PortalSettings.ActiveTab.ParentId.ToString(); objParentNode.Key = objParentNode.ID; objParentNode.Text = Localization.GetString("Parent", Localization.GetResourceFile(this, MyFileName)); objParentNode.ToolTip = Localization.GetString("GoUp", Localization.GetResourceFile(this, MyFileName)); - objParentNode.CSSClass = NodeCssClass; - objParentNode.Image = ResolveUrl(TreeGoUpImage); + objParentNode.CSSClass = this.NodeCssClass; + objParentNode.Image = this.ResolveUrl(this.TreeGoUpImage); objParentNode.ClickAction = eClickAction.PostBack; objNodes.InsertBefore(0, objParentNode); } foreach (DNNNode objPNode in objNodes) //clean up to do in processnodes??? { - ProcessNodes(objPNode); + this.ProcessNodes(objPNode); } - Bind(objNodes); + this.Bind(objNodes); //technically this should always be a dnntree. If using dynamic controls Nav.ascx should be used. just being safe. - if (Control.NavigationControl is DnnTree) + if (this.Control.NavigationControl is DnnTree) { - var objTree = (DnnTree) Control.NavigationControl; + var objTree = (DnnTree) this.Control.NavigationControl; if (objTree.SelectedTreeNodes.Count > 0) { var objTNode = (TreeNode) objTree.SelectedTreeNodes[1]; @@ -381,15 +381,15 @@ private void ProcessNodes(DNNNode objParent) } else if (objParent.HasNodes) //imagepath applied in provider... { - objParent.Image = ResolveUrl(NodeClosedImage); + objParent.Image = this.ResolveUrl(this.NodeClosedImage); } else { - objParent.Image = ResolveUrl(NodeLeafImage); + objParent.Image = this.ResolveUrl(this.NodeLeafImage); } foreach (DNNNode objNode in objParent.DNNNodes) { - ProcessNodes(objNode); + this.ProcessNodes(objNode); } } @@ -402,53 +402,53 @@ private void ProcessNodes(DNNNode objParent) /// ----------------------------------------------------------------------------- private void InitializeTree() { - if (String.IsNullOrEmpty(PathImage)) + if (String.IsNullOrEmpty(this.PathImage)) { - PathImage = PortalSettings.HomeDirectory; + this.PathImage = this.PortalSettings.HomeDirectory; } - if (String.IsNullOrEmpty(PathSystemImage)) + if (String.IsNullOrEmpty(this.PathSystemImage)) { - PathSystemImage = ResolveUrl("~/images/"); + this.PathSystemImage = this.ResolveUrl("~/images/"); } - if (String.IsNullOrEmpty(IndicateChildImageRoot)) + if (String.IsNullOrEmpty(this.IndicateChildImageRoot)) { - IndicateChildImageRoot = ResolveUrl(NodeExpandImage); + this.IndicateChildImageRoot = this.ResolveUrl(this.NodeExpandImage); } - if (String.IsNullOrEmpty(IndicateChildImageSub)) + if (String.IsNullOrEmpty(this.IndicateChildImageSub)) { - IndicateChildImageSub = ResolveUrl(NodeExpandImage); + this.IndicateChildImageSub = this.ResolveUrl(this.NodeExpandImage); } - if (String.IsNullOrEmpty(IndicateChildImageExpandedRoot)) + if (String.IsNullOrEmpty(this.IndicateChildImageExpandedRoot)) { - IndicateChildImageExpandedRoot = ResolveUrl(NodeCollapseImage); + this.IndicateChildImageExpandedRoot = this.ResolveUrl(this.NodeCollapseImage); } - if (String.IsNullOrEmpty(IndicateChildImageExpandedSub)) + if (String.IsNullOrEmpty(this.IndicateChildImageExpandedSub)) { - IndicateChildImageExpandedSub = ResolveUrl(NodeCollapseImage); + this.IndicateChildImageExpandedSub = this.ResolveUrl(this.NodeCollapseImage); } - if (String.IsNullOrEmpty(CSSNode)) + if (String.IsNullOrEmpty(this.CSSNode)) { - CSSNode = NodeChildCssClass; + this.CSSNode = this.NodeChildCssClass; } - if (String.IsNullOrEmpty(CSSNodeRoot)) + if (String.IsNullOrEmpty(this.CSSNodeRoot)) { - CSSNodeRoot = NodeCssClass; + this.CSSNodeRoot = this.NodeCssClass; } - if (String.IsNullOrEmpty(CSSNodeHover)) + if (String.IsNullOrEmpty(this.CSSNodeHover)) { - CSSNodeHover = NodeOverCssClass; + this.CSSNodeHover = this.NodeOverCssClass; } - if (String.IsNullOrEmpty(CSSNodeSelectedRoot)) + if (String.IsNullOrEmpty(this.CSSNodeSelectedRoot)) { - CSSNodeSelectedRoot = NodeSelectedCssClass; + this.CSSNodeSelectedRoot = this.NodeSelectedCssClass; } - if (String.IsNullOrEmpty(CSSNodeSelectedSub)) + if (String.IsNullOrEmpty(this.CSSNodeSelectedSub)) { - CSSNodeSelectedSub = NodeSelectedCssClass; + this.CSSNodeSelectedSub = this.NodeSelectedCssClass; } - if (String.IsNullOrEmpty(CSSControl)) + if (String.IsNullOrEmpty(this.CSSControl)) { - CSSControl = TreeCssClass; + this.CSSControl = this.TreeCssClass; } } @@ -470,69 +470,69 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (Page.IsPostBack == false) + if (this.Page.IsPostBack == false) { - BuildTree(null, false); + this.BuildTree(null, false); //Main Table Properties - if (!String.IsNullOrEmpty(Width)) + if (!String.IsNullOrEmpty(this.Width)) { - tblMain.Width = Width; + this.tblMain.Width = this.Width; } - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - tblMain.Attributes.Add("class", CssClass); + this.tblMain.Attributes.Add("class", this.CssClass); } //Header Properties - if (!String.IsNullOrEmpty(HeaderCssClass)) + if (!String.IsNullOrEmpty(this.HeaderCssClass)) { - cellHeader.Attributes.Add("class", HeaderCssClass); + this.cellHeader.Attributes.Add("class", this.HeaderCssClass); } - if (!String.IsNullOrEmpty(HeaderTextCssClass)) + if (!String.IsNullOrEmpty(this.HeaderTextCssClass)) { - lblHeader.CssClass = HeaderTextCssClass; + this.lblHeader.CssClass = this.HeaderTextCssClass; } //Header Text (if set) - if (!String.IsNullOrEmpty(HeaderText)) + if (!String.IsNullOrEmpty(this.HeaderText)) { - lblHeader.Text = HeaderText; + this.lblHeader.Text = this.HeaderText; } //ResourceKey overrides if found - if (!String.IsNullOrEmpty(ResourceKey)) + if (!String.IsNullOrEmpty(this.ResourceKey)) { - string strHeader = Localization.GetString(ResourceKey, Localization.GetResourceFile(this, MyFileName)); + string strHeader = Localization.GetString(this.ResourceKey, Localization.GetResourceFile(this, MyFileName)); if (!String.IsNullOrEmpty(strHeader)) { - lblHeader.Text = Localization.GetString(ResourceKey, Localization.GetResourceFile(this, MyFileName)); + this.lblHeader.Text = Localization.GetString(this.ResourceKey, Localization.GetResourceFile(this, MyFileName)); } } //If still not set get default key - if (String.IsNullOrEmpty(lblHeader.Text)) + if (String.IsNullOrEmpty(this.lblHeader.Text)) { string strHeader = Localization.GetString("Title", Localization.GetResourceFile(this, MyFileName)); if (!String.IsNullOrEmpty(strHeader)) { - lblHeader.Text = Localization.GetString("Title", Localization.GetResourceFile(this, MyFileName)); + this.lblHeader.Text = Localization.GetString("Title", Localization.GetResourceFile(this, MyFileName)); } else { - lblHeader.Text = "Site Navigation"; + this.lblHeader.Text = "Site Navigation"; } } - tblHeader.Visible = IncludeHeader; + this.tblHeader.Visible = this.IncludeHeader; //Main Panel Properties - if (!String.IsNullOrEmpty(BodyCssClass)) + if (!String.IsNullOrEmpty(this.BodyCssClass)) { - cellBody.Attributes.Add("class", BodyCssClass); + this.cellBody.Attributes.Add("class", this.BodyCssClass); } - cellBody.NoWrap = NoWrap; + this.cellBody.NoWrap = this.NoWrap; } } catch (Exception exc) @@ -554,28 +554,28 @@ private void DNNTree_NodeClick(NavigationEventArgs args) { if (args.Node == null) { - args.Node = Navigation.GetNavigationNode(args.ID, Control.ID); + args.Node = Navigation.GetNavigationNode(args.ID, this.Control.ID); } - Response.Redirect(Globals.ApplicationURL(int.Parse(args.Node.Key)), true); + this.Response.Redirect(Globals.ApplicationURL(int.Parse(args.Node.Key)), true); } private void DNNTree_PopulateOnDemand(NavigationEventArgs args) { if (args.Node == null) { - args.Node = Navigation.GetNavigationNode(args.ID, Control.ID); + args.Node = Navigation.GetNavigationNode(args.ID, this.Control.ID); } - BuildTree(args.Node, true); + this.BuildTree(args.Node, true); } protected override void OnInit(EventArgs e) { - InitializeTree(); - InitializeNavControl(cellBody, "DNNTreeNavigationProvider"); - Control.NodeClick += DNNTree_NodeClick; - Control.PopulateOnDemand += DNNTree_PopulateOnDemand; + this.InitializeTree(); + this.InitializeNavControl(this.cellBody, "DNNTreeNavigationProvider"); + this.Control.NodeClick += this.DNNTree_NodeClick; + this.Control.PopulateOnDemand += this.DNNTree_PopulateOnDemand; base.OnInit(e); - InitializeComponent(); + this.InitializeComponent(); } #endregion diff --git a/DNN Platform/Website/admin/Skins/User.ascx.cs b/DNN Platform/Website/admin/Skins/User.ascx.cs index a29cda3a8e7..6d1524c10bb 100644 --- a/DNN Platform/Website/admin/Skins/User.ascx.cs +++ b/DNN Platform/Website/admin/Skins/User.ascx.cs @@ -41,10 +41,10 @@ public partial class User : SkinObjectBase public User() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); - ShowUnreadMessages = true; - ShowAvatar = true; - LegacyMode = true; + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); + this.ShowUnreadMessages = true; + this.ShowAvatar = true; + this.LegacyMode = true; } public string CssClass { get; set; } @@ -71,7 +71,7 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - Visible = !PortalSettings.InErrorPageRequest() || ShowInErrorPage; + this.Visible = !this.PortalSettings.InErrorPageRequest() || this.ShowInErrorPage; } protected override void OnLoad(EventArgs e) @@ -80,70 +80,70 @@ protected override void OnLoad(EventArgs e) try { - if (LegacyMode) - registerGroup.Visible = false; + if (this.LegacyMode) + this.registerGroup.Visible = false; else - registerLink.Visible = false; + this.registerLink.Visible = false; - if (!String.IsNullOrEmpty(CssClass)) + if (!String.IsNullOrEmpty(this.CssClass)) { - registerLink.CssClass = CssClass; - enhancedRegisterLink.CssClass = CssClass; + this.registerLink.CssClass = this.CssClass; + this.enhancedRegisterLink.CssClass = this.CssClass; } - if (Request.IsAuthenticated == false) + if (this.Request.IsAuthenticated == false) { - messageGroup.Visible = false; - notificationGroup.Visible = false; - avatarGroup.Visible = false; + this.messageGroup.Visible = false; + this.notificationGroup.Visible = false; + this.avatarGroup.Visible = false; - if (PortalSettings.UserRegistration != (int) Globals.PortalRegistrationType.NoRegistration) + if (this.PortalSettings.UserRegistration != (int) Globals.PortalRegistrationType.NoRegistration) { - if (!String.IsNullOrEmpty(Text)) + if (!String.IsNullOrEmpty(this.Text)) { - if (Text.IndexOf("src=") != -1) + if (this.Text.IndexOf("src=") != -1) { - Text = Text.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); + this.Text = this.Text.Replace("src=\"", "src=\"" + this.PortalSettings.ActiveTab.SkinPath); } - registerLink.Text = Text; - enhancedRegisterLink.Text = Text; + this.registerLink.Text = this.Text; + this.enhancedRegisterLink.Text = this.Text; } else { - registerLink.Text = Localization.GetString("Register", Localization.GetResourceFile(this, MyFileName)); - enhancedRegisterLink.Text = registerLink.Text; - registerLink.ToolTip = registerLink.Text; - enhancedRegisterLink.ToolTip = registerLink.Text; + this.registerLink.Text = Localization.GetString("Register", Localization.GetResourceFile(this, MyFileName)); + this.enhancedRegisterLink.Text = this.registerLink.Text; + this.registerLink.ToolTip = this.registerLink.Text; + this.enhancedRegisterLink.ToolTip = this.registerLink.Text; } - if (PortalSettings.Users < PortalSettings.UserQuota || PortalSettings.UserQuota == 0) + if (this.PortalSettings.Users < this.PortalSettings.UserQuota || this.PortalSettings.UserQuota == 0) { - if (LegacyMode) registerLink.Visible = true; - else enhancedRegisterLink.Visible = true; + if (this.LegacyMode) this.registerLink.Visible = true; + else this.enhancedRegisterLink.Visible = true; } else { - registerGroup.Visible = false; - registerLink.Visible = false; + this.registerGroup.Visible = false; + this.registerLink.Visible = false; } - registerLink.NavigateUrl = !String.IsNullOrEmpty(URL) - ? URL - : Globals.RegisterURL(HttpUtility.UrlEncode(_navigationManager.NavigateURL()), Null.NullString); - enhancedRegisterLink.NavigateUrl = registerLink.NavigateUrl; + this.registerLink.NavigateUrl = !String.IsNullOrEmpty(this.URL) + ? this.URL + : Globals.RegisterURL(HttpUtility.UrlEncode(this._navigationManager.NavigateURL()), Null.NullString); + this.enhancedRegisterLink.NavigateUrl = this.registerLink.NavigateUrl; - if (PortalSettings.EnablePopUps && PortalSettings.RegisterTabId == Null.NullInteger + if (this.PortalSettings.EnablePopUps && this.PortalSettings.RegisterTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this)) { - var clickEvent = "return " + UrlUtils.PopUpUrl(registerLink.NavigateUrl, this, PortalSettings, true, false, 600, 950); - registerLink.Attributes.Add("onclick", clickEvent); - enhancedRegisterLink.Attributes.Add("onclick", clickEvent); + var clickEvent = "return " + UrlUtils.PopUpUrl(this.registerLink.NavigateUrl, this, this.PortalSettings, true, false, 600, 950); + this.registerLink.Attributes.Add("onclick", clickEvent); + this.enhancedRegisterLink.Attributes.Add("onclick", clickEvent); } } else { - registerGroup.Visible = false; - registerLink.Visible = false; + this.registerGroup.Visible = false; + this.registerLink.Visible = false; } } else @@ -151,50 +151,50 @@ protected override void OnLoad(EventArgs e) var userInfo = UserController.Instance.GetCurrentUserInfo(); if (userInfo.UserID != -1) { - registerLink.Text = userInfo.DisplayName; - registerLink.NavigateUrl = Globals.UserProfileURL(userInfo.UserID); - registerLink.ToolTip = Localization.GetString("VisitMyProfile", Localization.GetResourceFile(this, MyFileName)); + this.registerLink.Text = userInfo.DisplayName; + this.registerLink.NavigateUrl = Globals.UserProfileURL(userInfo.UserID); + this.registerLink.ToolTip = Localization.GetString("VisitMyProfile", Localization.GetResourceFile(this, MyFileName)); - enhancedRegisterLink.Text = registerLink.Text; - enhancedRegisterLink.NavigateUrl = registerLink.NavigateUrl; - enhancedRegisterLink.ToolTip = registerLink.ToolTip; + this.enhancedRegisterLink.Text = this.registerLink.Text; + this.enhancedRegisterLink.NavigateUrl = this.registerLink.NavigateUrl; + this.enhancedRegisterLink.ToolTip = this.registerLink.ToolTip; - if (ShowUnreadMessages) + if (this.ShowUnreadMessages) { var unreadMessages = InternalMessagingController.Instance.CountUnreadMessages(userInfo.UserID, PortalController.GetEffectivePortalId(userInfo.PortalID)); var unreadAlerts = NotificationsController.Instance.CountNotifications(userInfo.UserID, PortalController.GetEffectivePortalId(userInfo.PortalID)); - messageLink.Text = unreadMessages > 0 ? string.Format(Localization.GetString("Messages", Localization.GetResourceFile(this, MyFileName)), unreadMessages) : Localization.GetString("NoMessages", Localization.GetResourceFile(this, MyFileName)); - notificationLink.Text = unreadAlerts > 0 ? string.Format(Localization.GetString("Notifications", Localization.GetResourceFile(this, MyFileName)), unreadAlerts) : Localization.GetString("NoNotifications", Localization.GetResourceFile(this, MyFileName)); + this.messageLink.Text = unreadMessages > 0 ? string.Format(Localization.GetString("Messages", Localization.GetResourceFile(this, MyFileName)), unreadMessages) : Localization.GetString("NoMessages", Localization.GetResourceFile(this, MyFileName)); + this.notificationLink.Text = unreadAlerts > 0 ? string.Format(Localization.GetString("Notifications", Localization.GetResourceFile(this, MyFileName)), unreadAlerts) : Localization.GetString("NoNotifications", Localization.GetResourceFile(this, MyFileName)); - messageLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID)); - notificationLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID),"view=notifications","action=notifications"); - notificationLink.ToolTip = Localization.GetString("CheckNotifications", Localization.GetResourceFile(this, MyFileName)); - messageLink.ToolTip = Localization.GetString("CheckMessages", Localization.GetResourceFile(this, MyFileName)); - messageGroup.Visible = true; - notificationGroup.Visible = true; + this.messageLink.NavigateUrl = this._navigationManager.NavigateURL(this.GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID)); + this.notificationLink.NavigateUrl = this._navigationManager.NavigateURL(this.GetMessageTab(), "", string.Format("userId={0}", userInfo.UserID),"view=notifications","action=notifications"); + this.notificationLink.ToolTip = Localization.GetString("CheckNotifications", Localization.GetResourceFile(this, MyFileName)); + this.messageLink.ToolTip = Localization.GetString("CheckMessages", Localization.GetResourceFile(this, MyFileName)); + this.messageGroup.Visible = true; + this.notificationGroup.Visible = true; - if (LegacyMode && unreadMessages > 0) + if (this.LegacyMode && unreadMessages > 0) { - registerLink.Text = registerLink.Text + string.Format(Localization.GetString("NewMessages", Localization.GetResourceFile(this, MyFileName)), unreadMessages); + this.registerLink.Text = this.registerLink.Text + string.Format(Localization.GetString("NewMessages", Localization.GetResourceFile(this, MyFileName)), unreadMessages); } } else { - messageGroup.Visible = false; - notificationGroup.Visible = false; + this.messageGroup.Visible = false; + this.notificationGroup.Visible = false; } - if (ShowAvatar) + if (this.ShowAvatar) { - avatar.ImageUrl = GetAvatarUrl(userInfo); - avatar.NavigateUrl = enhancedRegisterLink.NavigateUrl; - avatar.ToolTip = avatar.Text = Localization.GetString("ProfileAvatar", Localization.GetResourceFile(this, MyFileName)); - avatarGroup.Visible = true; + this.avatar.ImageUrl = this.GetAvatarUrl(userInfo); + this.avatar.NavigateUrl = this.enhancedRegisterLink.NavigateUrl; + this.avatar.ToolTip = this.avatar.Text = Localization.GetString("ProfileAvatar", Localization.GetResourceFile(this, MyFileName)); + this.avatarGroup.Visible = true; } else { - avatarGroup.Visible = false; + this.avatarGroup.Visible = false; } } } @@ -212,13 +212,13 @@ private string GetAvatarUrl(UserInfo userInfo) private int GetMessageTab() { - var cacheKey = string.Format("MessageCenterTab:{0}:{1}", PortalSettings.PortalId, PortalSettings.CultureCode); + var cacheKey = string.Format("MessageCenterTab:{0}:{1}", this.PortalSettings.PortalId, this.PortalSettings.CultureCode); var messageTabId = DataCache.GetCache(cacheKey); if (messageTabId > 0) return messageTabId; //Find the Message Tab - messageTabId = FindMessageTab(); + messageTabId = this.FindMessageTab(); //save in cache //NOTE - This cache is not being cleared. There is no easy way to clear this, except Tools->Clear Cache @@ -231,7 +231,7 @@ private int FindMessageTab() { //On brand new install the new Message Center Module is on the child page of User Profile Page //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page - var profileTab = TabController.Instance.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false); + var profileTab = TabController.Instance.GetTab(this.PortalSettings.UserTabId, this.PortalSettings.PortalId, false); if (profileTab != null) { var childTabs = TabController.Instance.GetTabsByPortal(profileTab.PortalID).DescendentsOf(profileTab.TabID); @@ -249,7 +249,7 @@ private int FindMessageTab() } //default to User Profile Page - return PortalSettings.UserTabId; + return this.PortalSettings.UserTabId; } } } diff --git a/DNN Platform/Website/admin/Skins/UserAndLogin.ascx.cs b/DNN Platform/Website/admin/Skins/UserAndLogin.ascx.cs index a3d4b519c45..8dd7bc209c8 100644 --- a/DNN Platform/Website/admin/Skins/UserAndLogin.ascx.cs +++ b/DNN Platform/Website/admin/Skins/UserAndLogin.ascx.cs @@ -31,19 +31,19 @@ public partial class UserAndLogin : SkinObjectBase private const string MyFileName = "UserAndLogin.ascx"; private readonly INavigationManager _navigationManager; - protected string AvatarImageUrl => UserController.Instance.GetUserProfilePictureUrl(PortalSettings.UserId, 32, 32); + protected string AvatarImageUrl => UserController.Instance.GetUserProfilePictureUrl(this.PortalSettings.UserId, 32, 32); public UserAndLogin() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } protected bool CanRegister { get { - return ((PortalSettings.UserRegistration != (int) Globals.PortalRegistrationType.NoRegistration) - && (PortalSettings.Users < PortalSettings.UserQuota || PortalSettings.UserQuota == 0)); + return ((this.PortalSettings.UserRegistration != (int) Globals.PortalRegistrationType.NoRegistration) + && (this.PortalSettings.Users < this.PortalSettings.UserQuota || this.PortalSettings.UserQuota == 0)); } } @@ -51,7 +51,7 @@ protected string DisplayName { get { - return PortalSettings.UserInfo.DisplayName; + return this.PortalSettings.UserInfo.DisplayName; } } @@ -59,7 +59,7 @@ protected bool IsAuthenticated { get { - return Request.IsAuthenticated; + return this.Request.IsAuthenticated; } } @@ -74,7 +74,7 @@ protected string LoginUrl } returnUrl = HttpUtility.UrlEncode(returnUrl); - return Globals.LoginURL(returnUrl, (Request.QueryString["override"] != null)); + return Globals.LoginURL(returnUrl, (this.Request.QueryString["override"] != null)); } } @@ -82,11 +82,11 @@ protected string LoginUrlForClickEvent { get { - var url = LoginUrl; + var url = this.LoginUrl; - if (UsePopUp) + if (this.UsePopUp) { - return "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(LoginUrl), this, PortalSettings, true, false, 300, 650); + return "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(this.LoginUrl), this, this.PortalSettings, true, false, 300, 650); } return string.Empty; @@ -97,8 +97,8 @@ protected bool UsePopUp { get { - return PortalSettings.EnablePopUps - && PortalSettings.LoginTabId == Null.NullInteger + return this.PortalSettings.EnablePopUps + && this.PortalSettings.LoginTabId == Null.NullInteger && !AuthenticationController.HasSocialAuthenticationEnabled(this); } } @@ -107,7 +107,7 @@ protected string RegisterUrl { get { - return Globals.RegisterURL(HttpUtility.UrlEncode(_navigationManager.NavigateURL()), Null.NullString); + return Globals.RegisterURL(HttpUtility.UrlEncode(this._navigationManager.NavigateURL()), Null.NullString); } } @@ -115,9 +115,9 @@ protected string RegisterUrlForClickEvent { get { - if (UsePopUp) + if (this.UsePopUp) { - return "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(RegisterUrl), this, PortalSettings, true, false, 600, 950); + return "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(this.RegisterUrl), this, this.PortalSettings, true, false, 600, 950); } return string.Empty; @@ -128,7 +128,7 @@ protected string UserProfileUrl { get { - return Globals.UserProfileURL(PortalSettings.UserInfo.UserID); ; + return Globals.UserProfileURL(this.PortalSettings.UserInfo.UserID); ; } } @@ -146,73 +146,73 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - Visible = !PortalSettings.InErrorPageRequest() || ShowInErrorPage; + this.Visible = !this.PortalSettings.InErrorPageRequest() || this.ShowInErrorPage; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); - registerLink.NavigateUrl = RegisterUrl; - loginLink.NavigateUrl = LoginUrl; + this.registerLink.NavigateUrl = this.RegisterUrl; + this.loginLink.NavigateUrl = this.LoginUrl; - if (PortalSettings.UserId > 0) + if (this.PortalSettings.UserId > 0) { - viewProfileLink.NavigateUrl = Globals.UserProfileURL(PortalSettings.UserId); - viewProfileImageLink.NavigateUrl = Globals.UserProfileURL(PortalSettings.UserId); - logoffLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); - editProfileLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.UserTabId, "Profile", "userId=" + PortalSettings.UserId, "pageno=2"); - accountLink.NavigateUrl = _navigationManager.NavigateURL(PortalSettings.UserTabId, "Profile", "userId=" + PortalSettings.UserId, "pageno=1"); - messagesLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId)); - notificationsLink.NavigateUrl = _navigationManager.NavigateURL(GetMessageTab(), "", string.Format("userId={0}", PortalSettings.UserId), "view=notifications", "action=notifications"); + this.viewProfileLink.NavigateUrl = Globals.UserProfileURL(this.PortalSettings.UserId); + this.viewProfileImageLink.NavigateUrl = Globals.UserProfileURL(this.PortalSettings.UserId); + this.logoffLink.NavigateUrl = this._navigationManager.NavigateURL(this.PortalSettings.ActiveTab.TabID, "Logoff"); + this.editProfileLink.NavigateUrl = this._navigationManager.NavigateURL(this.PortalSettings.UserTabId, "Profile", "userId=" + this.PortalSettings.UserId, "pageno=2"); + this.accountLink.NavigateUrl = this._navigationManager.NavigateURL(this.PortalSettings.UserTabId, "Profile", "userId=" + this.PortalSettings.UserId, "pageno=1"); + this.messagesLink.NavigateUrl = this._navigationManager.NavigateURL(this.GetMessageTab(), "", string.Format("userId={0}", this.PortalSettings.UserId)); + this.notificationsLink.NavigateUrl = this._navigationManager.NavigateURL(this.GetMessageTab(), "", string.Format("userId={0}", this.PortalSettings.UserId), "view=notifications", "action=notifications"); - var unreadMessages = InternalMessagingController.Instance.CountUnreadMessages(PortalSettings.UserId, PortalSettings.PortalId); - var unreadAlerts = NotificationsController.Instance.CountNotifications(PortalSettings.UserId, PortalSettings.PortalId); + var unreadMessages = InternalMessagingController.Instance.CountUnreadMessages(this.PortalSettings.UserId, this.PortalSettings.PortalId); + var unreadAlerts = NotificationsController.Instance.CountNotifications(this.PortalSettings.UserId, this.PortalSettings.PortalId); if (unreadMessages > 0) { - messageCount.Text = unreadMessages.ToString(CultureInfo.InvariantCulture); - messageCount.Visible = true; - - messages.Text = unreadMessages.ToString(CultureInfo.InvariantCulture); - messages.ToolTip = unreadMessages == 1 - ? LocalizeString("OneMessage") - : String.Format(LocalizeString("MessageCount"), unreadMessages); - messages.Visible = true; + this.messageCount.Text = unreadMessages.ToString(CultureInfo.InvariantCulture); + this.messageCount.Visible = true; + + this.messages.Text = unreadMessages.ToString(CultureInfo.InvariantCulture); + this.messages.ToolTip = unreadMessages == 1 + ? this.LocalizeString("OneMessage") + : String.Format(this.LocalizeString("MessageCount"), unreadMessages); + this.messages.Visible = true; } if (unreadAlerts > 0) { - notificationCount.Text = unreadAlerts.ToString(CultureInfo.InvariantCulture); - notificationCount.Visible = true; + this.notificationCount.Text = unreadAlerts.ToString(CultureInfo.InvariantCulture); + this.notificationCount.Visible = true; } - profilePicture.ImageUrl = AvatarImageUrl; - profilePicture.AlternateText = Localization.GetString("ProfilePicture", Localization.GetResourceFile(this, MyFileName)); + this.profilePicture.ImageUrl = this.AvatarImageUrl; + this.profilePicture.AlternateText = Localization.GetString("ProfilePicture", Localization.GetResourceFile(this, MyFileName)); - if (AlwaysShowCount()) + if (this.AlwaysShowCount()) { - messageCount.Visible = notificationCount.Visible = true; + this.messageCount.Visible = this.notificationCount.Visible = true; } } - if (UsePopUp) + if (this.UsePopUp) { - registerLink.Attributes.Add("onclick", RegisterUrlForClickEvent); - loginLink.Attributes.Add("onclick", LoginUrlForClickEvent); + this.registerLink.Attributes.Add("onclick", this.RegisterUrlForClickEvent); + this.loginLink.Attributes.Add("onclick", this.LoginUrlForClickEvent); } } private int GetMessageTab() { - var cacheKey = string.Format("MessageCenterTab:{0}:{1}", PortalSettings.PortalId, PortalSettings.CultureCode); + var cacheKey = string.Format("MessageCenterTab:{0}:{1}", this.PortalSettings.PortalId, this.PortalSettings.CultureCode); var messageTabId = DataCache.GetCache(cacheKey); if (messageTabId > 0) return messageTabId; //Find the Message Tab - messageTabId = FindMessageTab(); + messageTabId = this.FindMessageTab(); //save in cache //NOTE - This cache is not being cleared. There is no easy way to clear this, except Tools->Clear Cache @@ -225,7 +225,7 @@ private int FindMessageTab() { //On brand new install the new Message Center Module is on the child page of User Profile Page //On Upgrade to 6.2.0, the Message Center module is on the User Profile Page - var profileTab = TabController.Instance.GetTab(PortalSettings.UserTabId, PortalSettings.PortalId, false); + var profileTab = TabController.Instance.GetTab(this.PortalSettings.UserTabId, this.PortalSettings.PortalId, false); if (profileTab != null) { var childTabs = TabController.Instance.GetTabsByPortal(profileTab.PortalID).DescendentsOf(profileTab.TabID); @@ -243,7 +243,7 @@ private int FindMessageTab() } //default to User Profile Page - return PortalSettings.UserTabId; + return this.PortalSettings.UserTabId; } private bool AlwaysShowCount() @@ -251,7 +251,7 @@ private bool AlwaysShowCount() const string SettingKey = "UserAndLogin_AlwaysShowCount"; var alwaysShowCount = false; - var portalSetting = PortalController.GetPortalSetting(SettingKey, PortalSettings.PortalId, string.Empty); + var portalSetting = PortalController.GetPortalSetting(SettingKey, this.PortalSettings.PortalId, string.Empty); if (!string.IsNullOrEmpty(portalSetting) && bool.TryParse(portalSetting, out alwaysShowCount)) { return alwaysShowCount; diff --git a/DNN Platform/Website/admin/Skins/jQuery.ascx.cs b/DNN Platform/Website/admin/Skins/jQuery.ascx.cs index b89bca45ea8..544fcf3cd8b 100644 --- a/DNN Platform/Website/admin/Skins/jQuery.ascx.cs +++ b/DNN Platform/Website/admin/Skins/jQuery.ascx.cs @@ -19,17 +19,17 @@ protected override void OnInit(EventArgs e) JavaScript.RequestRegistration(CommonJs.jQuery); JavaScript.RequestRegistration(CommonJs.jQueryMigrate); - if (jQueryUI) + if (this.jQueryUI) { JavaScript.RequestRegistration(CommonJs.jQueryUI); } - if (DnnjQueryPlugins) + if (this.DnnjQueryPlugins) { JavaScript.RequestRegistration(CommonJs.DnnPlugins); } - if (jQueryHoverIntent) + if (this.jQueryHoverIntent) { JavaScript.RequestRegistration(CommonJs.HoverIntent); } diff --git a/DNN Platform/Website/admin/Skins/tags.ascx.cs b/DNN Platform/Website/admin/Skins/tags.ascx.cs index af0ddd442a3..0acf202e4ef 100644 --- a/DNN Platform/Website/admin/Skins/tags.ascx.cs +++ b/DNN Platform/Website/admin/Skins/tags.ascx.cs @@ -30,18 +30,18 @@ public partial class Tags : SkinObjectBase public Tags() { - _navigationManager = Globals.DependencyProvider.GetRequiredService(); + this._navigationManager = Globals.DependencyProvider.GetRequiredService(); } public string AddImageUrl { get { - return _AddImageUrl; + return this._AddImageUrl; } set { - _AddImageUrl = value; + this._AddImageUrl = value; } } @@ -49,11 +49,11 @@ public bool AllowTagging { get { - return _AllowTagging; + return this._AllowTagging; } set { - _AllowTagging = value; + this._AllowTagging = value; } } @@ -61,11 +61,11 @@ public string CancelImageUrl { get { - return _CancelImageUrl; + return this._CancelImageUrl; } set { - _CancelImageUrl = value; + this._CancelImageUrl = value; } } @@ -75,11 +75,11 @@ public string ObjectType { get { - return _ObjectType; + return this._ObjectType; } set { - _ObjectType = value; + this._ObjectType = value; } } @@ -87,11 +87,11 @@ public string RepeatDirection { get { - return _RepeatDirection; + return this._RepeatDirection; } set { - _RepeatDirection = value; + this._RepeatDirection = value; } } @@ -99,11 +99,11 @@ public string SaveImageUrl { get { - return _SaveImageUrl; + return this._SaveImageUrl; } set { - _SaveImageUrl = value; + this._SaveImageUrl = value; } } @@ -111,11 +111,11 @@ public string Separator { get { - return _Separator; + return this._Separator; } set { - _Separator = value; + this._Separator = value; } } @@ -123,11 +123,11 @@ public bool ShowCategories { get { - return _ShowCategories; + return this._ShowCategories; } set { - _ShowCategories = value; + this._ShowCategories = value; } } @@ -135,11 +135,11 @@ public bool ShowTags { get { - return _ShowTags; + return this._ShowTags; } set { - _ShowTags = value; + this._ShowTags = value; } } @@ -147,27 +147,27 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - if (ObjectType == "Page") + if (this.ObjectType == "Page") { - tagsControl.ContentItem = PortalSettings.ActiveTab; + this.tagsControl.ContentItem = this.PortalSettings.ActiveTab; } else { - tagsControl.ContentItem = ModuleControl.ModuleContext.Configuration; + this.tagsControl.ContentItem = this.ModuleControl.ModuleContext.Configuration; } - tagsControl.AddImageUrl = AddImageUrl; - tagsControl.CancelImageUrl = CancelImageUrl; - tagsControl.SaveImageUrl = SaveImageUrl; + this.tagsControl.AddImageUrl = this.AddImageUrl; + this.tagsControl.CancelImageUrl = this.CancelImageUrl; + this.tagsControl.SaveImageUrl = this.SaveImageUrl; - tagsControl.CssClass = CssClass; + this.tagsControl.CssClass = this.CssClass; - tagsControl.AllowTagging = AllowTagging && Request.IsAuthenticated; - tagsControl.NavigateUrlFormatString = _navigationManager.NavigateURL(PortalSettings.SearchTabId, "", "Tag={0}"); - tagsControl.RepeatDirection = RepeatDirection; - tagsControl.Separator = Separator; - tagsControl.ShowCategories = ShowCategories; - tagsControl.ShowTags = ShowTags; + this.tagsControl.AllowTagging = this.AllowTagging && this.Request.IsAuthenticated; + this.tagsControl.NavigateUrlFormatString = this._navigationManager.NavigateURL(this.PortalSettings.SearchTabId, "", "Tag={0}"); + this.tagsControl.RepeatDirection = this.RepeatDirection; + this.tagsControl.Separator = this.Separator; + this.tagsControl.ShowCategories = this.ShowCategories; + this.tagsControl.ShowTags = this.ShowTags; } } } diff --git a/DNN Platform/Website/admin/Tabs/Export.ascx.cs b/DNN Platform/Website/admin/Tabs/Export.ascx.cs index 16f958ecffa..58f0f4cd0b1 100644 --- a/DNN Platform/Website/admin/Tabs/Export.ascx.cs +++ b/DNN Platform/Website/admin/Tabs/Export.ascx.cs @@ -34,18 +34,18 @@ public partial class Export : PortalModuleBase public Export() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } public TabInfo Tab { get { - if (_tab == null) + if (this._tab == null) { - _tab = TabController.Instance.GetTab(TabId, PortalId, false); + this._tab = TabController.Instance.GetTab(this.TabId, this.PortalId, false); } - return _tab; + return this._tab; } } @@ -59,7 +59,7 @@ public TabInfo Tab private void SerializeTab(XmlDocument xmlTemplate, XmlNode nodeTabs) { var xmlTab = new XmlDocument { XmlResolver = null }; - var nodeTab = TabController.SerializeTab(xmlTab, Tab, chkContent.Checked); + var nodeTab = TabController.SerializeTab(xmlTab, this.Tab, this.chkContent.Checked); nodeTabs.AppendChild(xmlTemplate.ImportNode(nodeTab, true)); } @@ -71,7 +71,7 @@ protected override void OnInit(EventArgs e) if (!TabPermissionController.CanExportPage()) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } @@ -79,24 +79,24 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cmdExport.Click += OnExportClick; + this.cmdExport.Click += this.OnExportClick; try { - if (Page.IsPostBack) return; - cmdCancel.NavigateUrl = _navigationManager.NavigateURL(); + if (this.Page.IsPostBack) return; + this.cmdCancel.NavigateUrl = this._navigationManager.NavigateURL(); var folderPath = "Templates/"; - var templateFolder = FolderManager.Instance.GetFolder(UserInfo.PortalID, folderPath); - cboFolders.Services.Parameters.Add("permission", "ADD"); + var templateFolder = FolderManager.Instance.GetFolder(this.UserInfo.PortalID, folderPath); + this.cboFolders.Services.Parameters.Add("permission", "ADD"); - if (templateFolder != null && IsAccessibleByUser(templateFolder)) + if (templateFolder != null && this.IsAccessibleByUser(templateFolder)) { - cboFolders.SelectedFolder = templateFolder; + this.cboFolders.SelectedFolder = templateFolder; } - if (Tab != null) + if (this.Tab != null) { - txtFile.Text = Globals.CleanName(Tab.TabName); + this.txtFile.Text = Globals.CleanName(this.Tab.TabName); } } catch (Exception exc) @@ -114,17 +114,17 @@ protected void OnExportClick(Object sender, EventArgs e) { try { - if (!Page.IsValid) + if (!this.Page.IsValid) { return; } - if (cboFolders.SelectedItem != null) + if (this.cboFolders.SelectedItem != null) { - var folder = FolderManager.Instance.GetFolder(cboFolders.SelectedItemValueAsInt); + var folder = FolderManager.Instance.GetFolder(this.cboFolders.SelectedItemValueAsInt); if (folder != null) { - var filename = folder.FolderPath + txtFile.Text + ".page.template"; + var filename = folder.FolderPath + this.txtFile.Text + ".page.template"; filename = filename.Replace("/", "\\"); var xmlTemplate = new XmlDocument { XmlResolver = null }; @@ -136,19 +136,19 @@ protected void OnExportClick(Object sender, EventArgs e) //Add template description XmlElement node = xmlTemplate.CreateElement("description"); - node.InnerXml = Server.HtmlEncode(txtDescription.Text); + node.InnerXml = this.Server.HtmlEncode(this.txtDescription.Text); nodePortal.AppendChild(node); //Serialize tabs XmlNode nodeTabs = nodePortal.AppendChild(xmlTemplate.CreateElement("tabs")); - SerializeTab(xmlTemplate, nodeTabs); + this.SerializeTab(xmlTemplate, nodeTabs); - UI.Skins.Skin.AddModuleMessage(this, "", string.Format(Localization.GetString("ExportedMessage", LocalResourceFile), filename), ModuleMessage.ModuleMessageType.BlueInfo); + UI.Skins.Skin.AddModuleMessage(this, "", string.Format(Localization.GetString("ExportedMessage", this.LocalResourceFile), filename), ModuleMessage.ModuleMessageType.BlueInfo); //add file to Files table using (var fileContent = new MemoryStream(Encoding.UTF8.GetBytes(xmlTemplate.OuterXml))) { - Services.FileSystem.FileManager.Instance.AddFile(folder, txtFile.Text + ".page.template", fileContent, true, true, "application/octet-stream"); + Services.FileSystem.FileManager.Instance.AddFile(folder, this.txtFile.Text + ".page.template", fileContent, true, true, "application/octet-stream"); } } diff --git a/DNN Platform/Website/admin/Tabs/Import.ascx.cs b/DNN Platform/Website/admin/Tabs/Import.ascx.cs index c39829039dd..d36c6fb1570 100644 --- a/DNN Platform/Website/admin/Tabs/Import.ascx.cs +++ b/DNN Platform/Website/admin/Tabs/Import.ascx.cs @@ -35,7 +35,7 @@ public partial class Import : PortalModuleBase public Import() { - _navigationManager = DependencyProvider.GetRequiredService(); + this._navigationManager = this.DependencyProvider.GetRequiredService(); } private TabInfo _tab; @@ -44,47 +44,47 @@ public TabInfo Tab { get { - if (_tab == null) + if (this._tab == null) { - _tab = TabController.Instance.GetTab(TabId, PortalId, false); + this._tab = TabController.Instance.GetTab(this.TabId, this.PortalId, false); } - return _tab; + return this._tab; } } private void BindBeforeAfterTabControls() { var noneSpecified = "<" + Localization.GetString("None_Specified") + ">"; - cboParentTab.UndefinedItem = new ListItem(noneSpecified, string.Empty); - var parentTab = cboParentTab.SelectedPage; + this.cboParentTab.UndefinedItem = new ListItem(noneSpecified, string.Empty); + var parentTab = this.cboParentTab.SelectedPage; - List listTabs = parentTab != null ? TabController.Instance.GetTabsByPortal(parentTab.PortalID).WithParentId(parentTab.TabID) : TabController.Instance.GetTabsByPortal(PortalId).WithParentId(Null.NullInteger); + List listTabs = parentTab != null ? TabController.Instance.GetTabsByPortal(parentTab.PortalID).WithParentId(parentTab.TabID) : TabController.Instance.GetTabsByPortal(this.PortalId).WithParentId(Null.NullInteger); listTabs = TabController.GetPortalTabs(listTabs, Null.NullInteger, true, noneSpecified, false, false, false, false, true); - cboPositionTab.DataSource = listTabs; - cboPositionTab.DataBind(); - rbInsertPosition.Items.Clear(); - rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertBefore", LocalResourceFile), "Before")); - rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertAfter", LocalResourceFile), "After")); - rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertAtEnd", LocalResourceFile), "AtEnd")); - rbInsertPosition.SelectedValue = "After"; + this.cboPositionTab.DataSource = listTabs; + this.cboPositionTab.DataBind(); + this.rbInsertPosition.Items.Clear(); + this.rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertBefore", this.LocalResourceFile), "Before")); + this.rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertAfter", this.LocalResourceFile), "After")); + this.rbInsertPosition.Items.Add(new ListItem(Localization.GetString("InsertAtEnd", this.LocalResourceFile), "AtEnd")); + this.rbInsertPosition.SelectedValue = "After"; } private void BindFiles() { - cboTemplate.Items.Clear(); - if (cboFolders.SelectedItem != null) + this.cboTemplate.Items.Clear(); + if (this.cboFolders.SelectedItem != null) { - var folder = FolderManager.Instance.GetFolder(cboFolders.SelectedItemValueAsInt); + var folder = FolderManager.Instance.GetFolder(this.cboFolders.SelectedItemValueAsInt); if (folder != null) { //var files = Directory.GetFiles(PortalSettings.HomeDirectoryMapPath + folder.FolderPath, "*.page.template"); - var files = Globals.GetFileList(PortalId, "page.template", false, folder.FolderPath); + var files = Globals.GetFileList(this.PortalId, "page.template", false, folder.FolderPath); foreach (FileItem file in files) { - cboTemplate.AddItem(file.Text.Replace(".page.template", ""), file.Value); + this.cboTemplate.AddItem(file.Text.Replace(".page.template", ""), file.Value); } - cboTemplate.InsertItem(0, "<" + Localization.GetString("None_Specified") + ">", "None_Specified"); - cboTemplate.SelectedIndex = 0; + this.cboTemplate.InsertItem(0, "<" + Localization.GetString("None_Specified") + ">", "None_Specified"); + this.cboTemplate.SelectedIndex = 0; } } @@ -92,22 +92,22 @@ private void BindFiles() private void BindTabControls() { - BindBeforeAfterTabControls(); - divInsertPositionRow.Visible = cboPositionTab.Items.Count > 0; - cboParentTab.AutoPostBack = true; - if (cboPositionTab.FindItemByValue(TabId.ToString(CultureInfo.InvariantCulture)) != null) + this.BindBeforeAfterTabControls(); + this.divInsertPositionRow.Visible = this.cboPositionTab.Items.Count > 0; + this.cboParentTab.AutoPostBack = true; + if (this.cboPositionTab.FindItemByValue(this.TabId.ToString(CultureInfo.InvariantCulture)) != null) { - cboPositionTab.ClearSelection(); - cboPositionTab.FindItemByValue(TabId.ToString(CultureInfo.InvariantCulture)).Selected = true; + this.cboPositionTab.ClearSelection(); + this.cboPositionTab.FindItemByValue(this.TabId.ToString(CultureInfo.InvariantCulture)).Selected = true; } } private void DisplayNewRows() { - divTabName.Visible = (optMode.SelectedIndex == 0); - divParentTab.Visible = (optMode.SelectedIndex == 0); - divInsertPositionRow.Visible = (optMode.SelectedIndex == 0); - divInsertPositionRow.Visible = (optMode.SelectedIndex == 0); + this.divTabName.Visible = (this.optMode.SelectedIndex == 0); + this.divParentTab.Visible = (this.optMode.SelectedIndex == 0); + this.divInsertPositionRow.Visible = (this.optMode.SelectedIndex == 0); + this.divInsertPositionRow.Visible = (this.optMode.SelectedIndex == 0); } protected override void OnInit(EventArgs e) @@ -116,7 +116,7 @@ protected override void OnInit(EventArgs e) if (!TabPermissionController.CanImportPage()) { - Response.Redirect(Globals.AccessDeniedURL(), true); + this.Response.Redirect(Globals.AccessDeniedURL(), true); } } @@ -124,25 +124,25 @@ protected override void OnLoad(EventArgs e) { base.OnLoad(e); - cboFolders.SelectionChanged += OnFolderIndexChanged; - cmdImport.Click += OnImportClick; - cboParentTab.SelectionChanged += OnParentTabIndexChanged; - cboTemplate.SelectedIndexChanged += OnTemplateIndexChanged; - optMode.SelectedIndexChanged += OptModeSelectedIndexChanged; + this.cboFolders.SelectionChanged += this.OnFolderIndexChanged; + this.cmdImport.Click += this.OnImportClick; + this.cboParentTab.SelectionChanged += this.OnParentTabIndexChanged; + this.cboTemplate.SelectedIndexChanged += this.OnTemplateIndexChanged; + this.optMode.SelectedIndexChanged += this.OptModeSelectedIndexChanged; try { - if (!Page.IsPostBack) + if (!this.Page.IsPostBack) { - cmdCancel.NavigateUrl = _navigationManager.NavigateURL(); - cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); - var folders = FolderManager.Instance.GetFolders(UserInfo, "BROWSE, ADD"); + this.cmdCancel.NavigateUrl = this._navigationManager.NavigateURL(); + this.cboFolders.UndefinedItem = new ListItem("<" + Localization.GetString("None_Specified") + ">", string.Empty); + var folders = FolderManager.Instance.GetFolders(this.UserInfo, "BROWSE, ADD"); var templateFolder = folders.SingleOrDefault(f => f.FolderPath == "Templates/"); - if (templateFolder != null) cboFolders.SelectedFolder = templateFolder; + if (templateFolder != null) this.cboFolders.SelectedFolder = templateFolder; - BindFiles(); - BindTabControls(); - DisplayNewRows(); + this.BindFiles(); + this.BindTabControls(); + this.DisplayNewRows(); } } catch (Exception exc) @@ -153,28 +153,28 @@ protected override void OnLoad(EventArgs e) protected void OnFolderIndexChanged(object sender, EventArgs e) { - BindFiles(); + this.BindFiles(); } protected void OnImportClick(object sender, EventArgs e) { try { - if (cboTemplate.SelectedItem == null || cboTemplate.SelectedValue == "None_Specified") + if (this.cboTemplate.SelectedItem == null || this.cboTemplate.SelectedValue == "None_Specified") { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("SpecifyFile", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("SpecifyFile", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } - if (optMode.SelectedIndex == -1) + if (this.optMode.SelectedIndex == -1) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("SpecifyMode", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("SpecifyMode", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } - if (cboFolders.SelectedItem == null) return; - var selectedFolder = FolderManager.Instance.GetFolder(cboFolders.SelectedItemValueAsInt); + if (this.cboFolders.SelectedItem == null) return; + var selectedFolder = FolderManager.Instance.GetFolder(this.cboFolders.SelectedItemValueAsInt); if (selectedFolder == null) return; - var selectedFile = Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(cboTemplate.SelectedValue)); + var selectedFile = Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(this.cboTemplate.SelectedValue)); var xmlDoc = new XmlDocument { XmlResolver = null }; using (var content = Services.FileSystem.FileManager.Instance.GetFileContent(selectedFile)) { @@ -189,25 +189,25 @@ protected void OnImportClick(object sender, EventArgs e) } if (tabNodes.Count == 0) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NoTabsInTemplate", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("NoTabsInTemplate", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); return; } TabInfo objTab; - if (optMode.SelectedValue == "ADD") + if (this.optMode.SelectedValue == "ADD") { //Check for invalid string invalidType; - if (!TabController.IsValidTabName(txtTabName.Text, out invalidType)) + if (!TabController.IsValidTabName(this.txtTabName.Text, out invalidType)) { - var warningMessage = string.Format(Localization.GetString(invalidType, LocalResourceFile), txtTabName.Text); + var warningMessage = string.Format(Localization.GetString(invalidType, this.LocalResourceFile), this.txtTabName.Text); UI.Skins.Skin.AddModuleMessage(this, warningMessage, ModuleMessage.ModuleMessageType.RedError); return; } //New Tab - objTab = new TabInfo { PortalID = PortalId, TabName = txtTabName.Text, IsVisible = true }; - var parentId = cboParentTab.SelectedItemValueAsInt; + objTab = new TabInfo { PortalID = this.PortalId, TabName = this.txtTabName.Text, IsVisible = true }; + var parentId = this.cboParentTab.SelectedItemValueAsInt; if (parentId != Null.NullInteger) { objTab.ParentId = parentId; @@ -218,25 +218,25 @@ protected void OnImportClick(object sender, EventArgs e) //Check if tab exists if (tabId != Null.NullInteger) { - TabInfo existingTab = TabController.Instance.GetTab(tabId, PortalId, false); + TabInfo existingTab = TabController.Instance.GetTab(tabId, this.PortalId, false); if (existingTab != null && existingTab.IsDeleted) { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TabRecycled", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TabRecycled", this.LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); } else { - UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TabExists", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); + UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("TabExists", this.LocalResourceFile), ModuleMessage.ModuleMessageType.RedError); } return; } - var positionTabId = Int32.Parse(cboPositionTab.SelectedItem.Value); + var positionTabId = Int32.Parse(this.cboPositionTab.SelectedItem.Value); - if (rbInsertPosition.SelectedValue == "After" && positionTabId > Null.NullInteger) + if (this.rbInsertPosition.SelectedValue == "After" && positionTabId > Null.NullInteger) { objTab.TabID = TabController.Instance.AddTabAfter(objTab, positionTabId); } - else if (rbInsertPosition.SelectedValue == "Before" && positionTabId > Null.NullInteger) + else if (this.rbInsertPosition.SelectedValue == "Before" && positionTabId > Null.NullInteger) { objTab.TabID = TabController.Instance.AddTabBefore(objTab, positionTabId); } @@ -244,9 +244,9 @@ protected void OnImportClick(object sender, EventArgs e) { objTab.TabID = TabController.Instance.AddTab(objTab); } - EventLogController.Instance.AddLog(objTab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_CREATED); + EventLogController.Instance.AddLog(objTab, this.PortalSettings, this.UserId, "", EventLogController.EventLogType.TAB_CREATED); - objTab = TabController.DeserializeTab(tabNodes[0], objTab, PortalId, PortalTemplateModuleAction.Replace); + objTab = TabController.DeserializeTab(tabNodes[0], objTab, this.PortalId, PortalTemplateModuleAction.Replace); var exceptions = string.Empty; //Create second tabs onwards. For firs tab, we like to use tab details from text box, for rest it'll come from template @@ -254,7 +254,7 @@ protected void OnImportClick(object sender, EventArgs e) { try { - TabController.DeserializeTab(tabNodes[tab], null, PortalId, PortalTemplateModuleAction.Replace); + TabController.DeserializeTab(tabNodes[tab], null, this.PortalId, PortalTemplateModuleAction.Replace); } catch (Exception ex) { @@ -271,15 +271,15 @@ protected void OnImportClick(object sender, EventArgs e) else { //Replace Existing Tab - objTab = TabController.DeserializeTab(tabNodes[0], Tab, PortalId, PortalTemplateModuleAction.Replace); + objTab = TabController.DeserializeTab(tabNodes[0], this.Tab, this.PortalId, PortalTemplateModuleAction.Replace); } - switch (optRedirect.SelectedValue) + switch (this.optRedirect.SelectedValue) { case "VIEW": - Response.Redirect(_navigationManager.NavigateURL(objTab.TabID), true); + this.Response.Redirect(this._navigationManager.NavigateURL(objTab.TabID), true); break; default: - Response.Redirect(_navigationManager.NavigateURL(objTab.TabID, "Tab", "action=edit"), true); + this.Response.Redirect(this._navigationManager.NavigateURL(objTab.TabID, "Tab", "action=edit"), true); break; } } @@ -291,16 +291,16 @@ protected void OnImportClick(object sender, EventArgs e) protected void OnParentTabIndexChanged(object sender, EventArgs e) { - BindBeforeAfterTabControls(); + this.BindBeforeAfterTabControls(); } protected void OnTemplateIndexChanged(Object sender, EventArgs e) { try { - if (cboTemplate.SelectedIndex > 0 && cboFolders.SelectedItem != null) + if (this.cboTemplate.SelectedIndex > 0 && this.cboFolders.SelectedItem != null) { - var selectedFile = Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(cboTemplate.SelectedValue)); + var selectedFile = Services.FileSystem.FileManager.Instance.GetFile(Convert.ToInt32(this.cboTemplate.SelectedValue)); var xmldoc = new XmlDocument { XmlResolver = null }; using (var fileContent = Services.FileSystem.FileManager.Instance.GetFileContent(selectedFile)) { @@ -308,19 +308,19 @@ protected void OnTemplateIndexChanged(Object sender, EventArgs e) var node = xmldoc.SelectSingleNode("//portal/description"); if (node != null && !String.IsNullOrEmpty(node.InnerXml)) { - lblTemplateDescription.Visible = true; - lblTemplateDescription.Text = Server.HtmlDecode(node.InnerXml); - txtTabName.Text = cboTemplate.SelectedItem.Text; + this.lblTemplateDescription.Visible = true; + this.lblTemplateDescription.Text = this.Server.HtmlDecode(node.InnerXml); + this.txtTabName.Text = this.cboTemplate.SelectedItem.Text; } else { - lblTemplateDescription.Visible = false; + this.lblTemplateDescription.Visible = false; } } } else { - lblTemplateDescription.Visible = false; + this.lblTemplateDescription.Visible = false; } } catch (Exception exc) @@ -331,7 +331,7 @@ protected void OnTemplateIndexChanged(Object sender, EventArgs e) protected void OptModeSelectedIndexChanged(object sender, EventArgs e) { - DisplayNewRows(); + this.DisplayNewRows(); } } diff --git a/DNN Platform/Website/admin/Users/ViewProfile.ascx.cs b/DNN Platform/Website/admin/Users/ViewProfile.ascx.cs index 4c72717085d..86ba1527542 100644 --- a/DNN Platform/Website/admin/Users/ViewProfile.ascx.cs +++ b/DNN Platform/Website/admin/Users/ViewProfile.ascx.cs @@ -23,13 +23,13 @@ protected override void OnInit(EventArgs e) { base.OnInit(e); - UserId = Null.NullInteger; - if (Context.Request.QueryString["userticket"] != null) + this.UserId = Null.NullInteger; + if (this.Context.Request.QueryString["userticket"] != null) { - UserId = Int32.Parse(UrlUtils.DecryptParameter(Context.Request.QueryString["userticket"])); + this.UserId = Int32.Parse(UrlUtils.DecryptParameter(this.Context.Request.QueryString["userticket"])); } - ctlProfile.ID = "Profile"; - ctlProfile.UserId = UserId; + this.ctlProfile.ID = "Profile"; + this.ctlProfile.UserId = this.UserId; } protected override void OnLoad(EventArgs e) @@ -37,15 +37,15 @@ protected override void OnLoad(EventArgs e) base.OnLoad(e); try { - if (ctlProfile.UserProfile == null) + if (this.ctlProfile.UserProfile == null) { - lblNoProperties.Visible = true; + this.lblNoProperties.Visible = true; return; } - ctlProfile.DataBind(); - if (ctlProfile.UserProfile.ProfileProperties.Cast().Count(profProperty => profProperty.Visible) == 0) + this.ctlProfile.DataBind(); + if (this.ctlProfile.UserProfile.ProfileProperties.Cast().Count(profProperty => profProperty.Visible) == 0) { - lblNoProperties.Visible = true; + this.lblNoProperties.Visible = true; } } catch (Exception exc) diff --git a/DNN Platform/Website/packages.config b/DNN Platform/Website/packages.config index 2a88191ad8c..06423a378eb 100644 --- a/DNN Platform/Website/packages.config +++ b/DNN Platform/Website/packages.config @@ -10,4 +10,5 @@ + \ No newline at end of file diff --git a/DNN_Platform.sln b/DNN_Platform.sln index 0cffbf15bfa..e2fb7515dc7 100644 --- a/DNN_Platform.sln +++ b/DNN_Platform.sln @@ -121,6 +121,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md Packages\repositories.config = Packages\repositories.config SolutionInfo.cs = SolutionInfo.cs + stylecop.json = stylecop.json EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DotNetNuke.Tests.Integration", "DNN Platform\Tests\DotNetNuke.Tests.Integration\DotNetNuke.Tests.Integration.csproj", "{6629A64D-58B9-48B9-B932-15AF193C2212}" diff --git a/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/index.jsx b/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/index.jsx index 74b114b2d8a..c7d1b3b857d 100644 --- a/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/index.jsx +++ b/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/index.jsx @@ -55,8 +55,8 @@ class ExtensionDetailRow extends Component { {this.getInUseDisplay(props._package.friendlyName, props._package.packageId)} - - Update + + Update diff --git a/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/style.less b/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/style.less index bea5c486fc2..9d4a19f545b 100644 --- a/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/style.less +++ b/Dnn.AdminExperience/ClientSide/Extensions.Web/src/components/Body/InstalledExtensions/common/ExtensionDetailRow/style.less @@ -21,7 +21,7 @@ font-weight: bold; margin-bottom: 3px; } - .in-use{ + .in-use { color: @curiousBlue; cursor: pointer; } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Common/ControllerBase.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Common/ControllerBase.cs index a59c0f4e8be..e30ace9de1b 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Common/ControllerBase.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Common/ControllerBase.cs @@ -15,7 +15,7 @@ public abstract class ControllerBase : PersonaBarApiController protected HttpResponseMessage OkResponse(string msg, object data = null) { - return Request.CreateResponse(HttpStatusCode.OK, new ResponseModel(false, msg, data?.ToString() ?? "")); + return this.Request.CreateResponse(HttpStatusCode.OK, new ResponseModel(false, msg, data?.ToString() ?? "")); } protected HttpResponseMessage UnauthorizedResponse(string msg = "", object data = null) @@ -28,7 +28,7 @@ protected HttpResponseMessage UnauthorizedResponse(string msg = "", object data { msg += " " + Localization.GetString("Prompt_SessionTimedOut", Components.Constants.LocalResourcesFile, true); } - return Request.CreateResponse(HttpStatusCode.Unauthorized, new ResponseModel(true, msg, data?.ToString() ?? "")); + return this.Request.CreateResponse(HttpStatusCode.Unauthorized, new ResponseModel(true, msg, data?.ToString() ?? "")); } protected HttpResponseMessage BadRequestResponse(string msg = "", object data = null) @@ -37,7 +37,7 @@ protected HttpResponseMessage BadRequestResponse(string msg = "", object data = { msg = Localization.GetString("Prompt_InvalidData", Components.Constants.LocalResourcesFile, true); } - return Request.CreateResponse(HttpStatusCode.BadRequest, new ResponseModel(true, msg, data?.ToString() ?? "")); + return this.Request.CreateResponse(HttpStatusCode.BadRequest, new ResponseModel(true, msg, data?.ToString() ?? "")); } protected HttpResponseMessage ServerErrorResponse(string msg = "", object data = null) @@ -46,7 +46,7 @@ protected HttpResponseMessage ServerErrorResponse(string msg = "", object data = { msg = Localization.GetString("Prompt_ServerError", Components.Constants.LocalResourcesFile, true); } - return Request.CreateResponse(HttpStatusCode.InternalServerError, new ResponseModel(true, msg, data?.ToString() ?? "")); + return this.Request.CreateResponse(HttpStatusCode.InternalServerError, new ResponseModel(true, msg, data?.ToString() ?? "")); } protected HttpResponseMessage NotImplementedResponse(string msg = "", object data = null) @@ -55,7 +55,7 @@ protected HttpResponseMessage NotImplementedResponse(string msg = "", object dat { msg = Localization.GetString("Prompt_NotImplemented", Components.Constants.LocalResourcesFile, true); } - return Request.CreateResponse(HttpStatusCode.NotImplemented, new ResponseModel(true, msg, data?.ToString() ?? "")); + return this.Request.CreateResponse(HttpStatusCode.NotImplemented, new ResponseModel(true, msg, data?.ToString() ?? "")); } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs index 69e336b5bdb..5d72e969cd6 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/AdminLogs/AdminLogsController.cs @@ -31,8 +31,8 @@ private PortalSettings PortalSettings { get { - _portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return _portalSettings; + this._portalSettings = PortalController.Instance.GetCurrentPortalSettings(); + return this._portalSettings; } } @@ -40,15 +40,15 @@ protected Dictionary LogTypeDictionary { get { - _logTypeDictionary = LogController.Instance.GetLogTypeInfoDictionary(); - return _logTypeDictionary; + this._logTypeDictionary = LogController.Instance.GetLogTypeInfoDictionary(); + return this._logTypeDictionary; } } public LogTypeInfo GetMyLogType(string logTypeKey) { LogTypeInfo logType; - LogTypeDictionary.TryGetValue(logTypeKey, out logType); + this.LogTypeDictionary.TryGetValue(logTypeKey, out logType); if (logType == null) { @@ -97,7 +97,7 @@ public void ClearLog() //add entry to log recording it was cleared EventLogController.Instance.AddLog(Localization.GetString("LogCleared", Constants.LocalResourcesFile), Localization.GetString("Username", Constants.LocalResourcesFile) + ":" + UserController.Instance.GetCurrentUserInfo().Username, - PortalSettings, + this.PortalSettings, -1, EventLogController.EventLogType.ADMIN_ALERT); } @@ -212,15 +212,15 @@ public string EmailLogItems(string subject, string fromEmailAddress, string toEm { if (string.IsNullOrEmpty(subject)) { - subject = PortalSettings.PortalName + @" Exceptions"; + subject = this.PortalSettings.PortalName + @" Exceptions"; } string returnMsg; if (Globals.EmailValidatorRegex.IsMatch(fromEmailAddress)) { const string tempFileName = "errorlog.xml"; - var filePath = PortalSettings.HomeDirectoryMapPath + tempFileName; - var xmlDoc = GetExceptions(logItemIds); + var filePath = this.PortalSettings.HomeDirectoryMapPath + tempFileName; + var xmlDoc = this.GetExceptions(logItemIds); xmlDoc.Save(filePath); var attachments = new List(); diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/BusinessController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/BusinessController.cs index 58eb10bf711..0dff98cf8e0 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/BusinessController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/BusinessController.cs @@ -23,11 +23,11 @@ public string UpgradeModule(string version) switch (version) { case "01.04.00": - UpdateMenuController(); + this.UpdateMenuController(); break; case "01.05.00": - if (TelerikAssemblyExists()) + if (this.TelerikAssemblyExists()) { UpdateTelerikEncryptionKey("Telerik.Web.UI.DialogParametersEncryptionKey"); } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/ConfigConsole/ConfigConsoleController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/ConfigConsole/ConfigConsoleController.cs index 82b1b142908..79ae085e502 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/ConfigConsole/ConfigConsoleController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/ConfigConsole/ConfigConsoleController.cs @@ -28,7 +28,7 @@ public IEnumerable GetConfigFilesList() public string GetConfigFile(string configFile) { - ValidateFilePath(configFile); + this.ValidateFilePath(configFile); var configDoc = Config.Load(configFile); using (var txtWriter = new StringWriter()) @@ -44,7 +44,7 @@ public string GetConfigFile(string configFile) public void UpdateConfigFile(string fileName, string fileContent) { - ValidateFilePath(fileName); + this.ValidateFilePath(fileName); var configDoc = new XmlDocument { XmlResolver = null }; configDoc.LoadXml(fileContent); @@ -53,7 +53,7 @@ public void UpdateConfigFile(string fileName, string fileContent) public void MergeConfigFile(string fileContent) { - if (IsValidXmlMergDocument(fileContent)) + if (this.IsValidXmlMergDocument(fileContent)) { var doc = new XmlDocument { XmlResolver = null }; doc.LoadXml(fileContent); diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs index fc9ae10e016..975c5bd91b0 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/CreateModuleController.cs @@ -28,7 +28,7 @@ public class CreateModuleController : ServiceLocator(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } protected override Func GetFactory() @@ -51,13 +51,13 @@ public int CreateModule(CreateModuleDto createModuleDto, out string newPageUrl, switch (createModuleDto.Type) { case CreateModuleType.New: - packageId = CreateNewModule(createModuleDto, out newPageUrl, out errorMessage); + packageId = this.CreateNewModule(createModuleDto, out newPageUrl, out errorMessage); break; case CreateModuleType.Control: - packageId = CreateModuleFromControl(createModuleDto, out newPageUrl, out errorMessage); + packageId = this.CreateModuleFromControl(createModuleDto, out newPageUrl, out errorMessage); break; case CreateModuleType.Manifest: - packageId = CreateModuleFromManifest(createModuleDto, out newPageUrl, out errorMessage); + packageId = this.CreateModuleFromManifest(createModuleDto, out newPageUrl, out errorMessage); break; } @@ -121,11 +121,11 @@ private int CreateNewModule(CreateModuleDto createModuleDto, out string newPageU } //First create the control createModuleDto.FileName = controlSrc; - var message = CreateControl(createModuleDto); + var message = this.CreateControl(createModuleDto); if (string.IsNullOrEmpty(message)) { //Next import the control - return CreateModuleFromControl(createModuleDto, out newPageUrl, out errorMessage); + return this.CreateModuleFromControl(createModuleDto, out newPageUrl, out errorMessage); } return Null.NullInteger; @@ -143,7 +143,7 @@ private int CreateModuleFromControl(CreateModuleDto createModuleDto, out string try { - var folder = PathUtils.Instance.RemoveTrailingSlash(GetSourceFolder(createModuleDto)); + var folder = PathUtils.Instance.RemoveTrailingSlash(this.GetSourceFolder(createModuleDto)); var friendlyName = createModuleDto.ModuleName; var name = createModuleDto.ModuleName; var moduleControl = "DesktopModules/" + folder + "/" + createModuleDto.FileName; @@ -220,7 +220,7 @@ private int CreateModuleFromControl(CreateModuleDto createModuleDto, out string if (createModuleDto.AddPage) { - newPageUrl = CreateNewPage(moduleDefinition); + newPageUrl = this.CreateNewPage(moduleDefinition); } return package.PackageID; @@ -245,7 +245,7 @@ private int CreateModuleFromManifest(CreateModuleDto createModuleDto, out string try { - var folder = PathUtils.Instance.RemoveTrailingSlash(GetSourceFolder(createModuleDto)); + var folder = PathUtils.Instance.RemoveTrailingSlash(this.GetSourceFolder(createModuleDto)); var manifest = Path.Combine(Globals.ApplicationMapPath, "DesktopModules", folder, createModuleDto.Manifest); var installer = new Installer(manifest, Globals.ApplicationMapPath, true); @@ -266,7 +266,7 @@ private int CreateModuleFromManifest(CreateModuleDto createModuleDto, out string { var moduleDefinition = kvp.Value; - newPageUrl = CreateNewPage(moduleDefinition); + newPageUrl = this.CreateNewPage(moduleDefinition); break; } } @@ -326,7 +326,7 @@ private string CreateNewPage(ModuleDefinitionInfo moduleDefinition) objModule.AllTabs = false; ModuleController.Instance.AddModule(objModule); - return NavigationManager.NavigateURL(newTab.TabID); + return this.NavigationManager.NavigateURL(newTab.TabID); } return string.Empty; @@ -340,12 +340,12 @@ private static bool InvalidFilename(string fileName) private string CreateControl(CreateModuleDto createModuleDto) { - var folder = PathUtils.Instance.RemoveTrailingSlash(GetSourceFolder(createModuleDto)); - var className = GetClassName(createModuleDto); + var folder = PathUtils.Instance.RemoveTrailingSlash(this.GetSourceFolder(createModuleDto)); + var className = this.GetClassName(createModuleDto); var moduleControlPath = Path.Combine(Globals.ApplicationMapPath, "DesktopModules/" + folder + "/" + createModuleDto.FileName); var message = Null.NullString; - var source = string.Format(LoadControlTemplate(), createModuleDto.Language, className); + var source = string.Format(this.LoadControlTemplate(), createModuleDto.Language, className); //reset attributes if (File.Exists(moduleControlPath)) diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleControlDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleControlDto.cs index 487b495224e..ac9c8ca1151 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleControlDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleControlDto.cs @@ -56,34 +56,34 @@ public ModuleControlDto() public ModuleControlDto(ModuleControlInfo moduleControl) { - Id = moduleControl.ModuleControlID; - DefinitionId = moduleControl.ModuleDefID; - Key = moduleControl.ControlKey; - Title = moduleControl.ControlTitle; - Source = moduleControl.ControlSrc; - Type = moduleControl.ControlType; - Order = moduleControl.ViewOrder; - Icon = moduleControl.IconFile; - HelpUrl = moduleControl.HelpURL; - SupportPopups = moduleControl.SupportsPopUps; - SupportPartialRendering = moduleControl.SupportsPartialRendering; + this.Id = moduleControl.ModuleControlID; + this.DefinitionId = moduleControl.ModuleDefID; + this.Key = moduleControl.ControlKey; + this.Title = moduleControl.ControlTitle; + this.Source = moduleControl.ControlSrc; + this.Type = moduleControl.ControlType; + this.Order = moduleControl.ViewOrder; + this.Icon = moduleControl.IconFile; + this.HelpUrl = moduleControl.HelpURL; + this.SupportPopups = moduleControl.SupportsPopUps; + this.SupportPartialRendering = moduleControl.SupportsPartialRendering; } public ModuleControlInfo ToModuleControlInfo() { return new ModuleControlInfo { - ModuleControlID = Id, - ModuleDefID = DefinitionId, - ControlKey = Key, - ControlTitle = Title, - ControlSrc = Source, - ControlType = Type, - ViewOrder = Order, - IconFile = Icon, - HelpURL = HelpUrl, - SupportsPartialRendering = SupportPartialRendering, - SupportsPopUps = SupportPopups + ModuleControlID = this.Id, + ModuleDefID = this.DefinitionId, + ControlKey = this.Key, + ControlTitle = this.Title, + ControlSrc = this.Source, + ControlType = this.Type, + ViewOrder = this.Order, + IconFile = this.Icon, + HelpURL = this.HelpUrl, + SupportsPartialRendering = this.SupportPartialRendering, + SupportsPopUps = this.SupportPopups }; } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleDefinitionDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleDefinitionDto.cs index 2e9dd85c13e..5b5f80c9fb5 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleDefinitionDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModuleDefinitionDto.cs @@ -40,15 +40,15 @@ public ModuleDefinitionDto() public ModuleDefinitionDto(ModuleDefinitionInfo definition) { - Id = definition.ModuleDefID; - DesktopModuleId = definition.DesktopModuleID; - Name = definition.DefinitionName; - FriendlyName = definition.FriendlyName; - CacheTime = definition.DefaultCacheTime; + this.Id = definition.ModuleDefID; + this.DesktopModuleId = definition.DesktopModuleID; + this.Name = definition.DefinitionName; + this.FriendlyName = definition.FriendlyName; + this.CacheTime = definition.DefaultCacheTime; foreach (var moduleControlInfo in definition.ModuleControls.Values) { - Controls.Add(new ModuleControlDto(moduleControlInfo)); + this.Controls.Add(new ModuleControlDto(moduleControlInfo)); } } @@ -56,11 +56,11 @@ public ModuleDefinitionInfo ToModuleDefinitionInfo() { return new ModuleDefinitionInfo { - ModuleDefID = Id, - DesktopModuleID = DesktopModuleId, - DefinitionName = Name, - FriendlyName = FriendlyName, - DefaultCacheTime = CacheTime + ModuleDefID = this.Id, + DesktopModuleID = this.DesktopModuleId, + DefinitionName = this.Name, + FriendlyName = this.FriendlyName, + DefaultCacheTime = this.CacheTime }; } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModulePackageDetailDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModulePackageDetailDto.cs index d79afefd239..4a1ef2aaa8d 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModulePackageDetailDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/ModulePackageDetailDto.cs @@ -69,18 +69,18 @@ public ModulePackageDetailDto() public ModulePackageDetailDto(int portalId, PackageInfo package, DesktopModuleInfo desktopModule) : base(portalId, package) { - DesktopModuleId = desktopModule.DesktopModuleID; - ModuleName = desktopModule.ModuleName; - FolderName = desktopModule.FolderName; - BusinessController = desktopModule.BusinessControllerClass; - Category = desktopModule.Category; - Dependencies = desktopModule.Dependencies; - HostPermissions = desktopModule.Permissions; - Portable = desktopModule.IsPortable; - Searchable = desktopModule.IsSearchable; - Upgradeable = desktopModule.IsUpgradeable; - PremiumModule = desktopModule.IsPremium; - Shareable = desktopModule.Shareable; + this.DesktopModuleId = desktopModule.DesktopModuleID; + this.ModuleName = desktopModule.ModuleName; + this.FolderName = desktopModule.FolderName; + this.BusinessController = desktopModule.BusinessControllerClass; + this.Category = desktopModule.Category; + this.Dependencies = desktopModule.Dependencies; + this.HostPermissions = desktopModule.Permissions; + this.Portable = desktopModule.IsPortable; + this.Searchable = desktopModule.IsSearchable; + this.Upgradeable = desktopModule.IsUpgradeable; + this.PremiumModule = desktopModule.IsPremium; + this.Shareable = desktopModule.Shareable; if (!desktopModule.IsAdmin) { @@ -89,21 +89,21 @@ public ModulePackageDetailDto(int portalId, PackageInfo package, DesktopModuleIn foreach (var portalDesktopModuleInfo in portalDesktopModules) { var value = portalDesktopModuleInfo.Value; - AssignedPortals.Add(new ListItemDto { Id = value.PortalID, Name = value.PortalName }); + this.AssignedPortals.Add(new ListItemDto { Id = value.PortalID, Name = value.PortalName }); } - var assignedIds = AssignedPortals.Select(p => p.Id).ToArray(); + var assignedIds = this.AssignedPortals.Select(p => p.Id).ToArray(); var allPortals = PortalController.Instance.GetPortals().OfType().Where(p => !assignedIds.Contains(p.PortalID)); foreach (var portalInfo in allPortals) { - UnassignedPortals.Add(new ListItemDto { Id = portalInfo.PortalID, Name = portalInfo.PortalName }); + this.UnassignedPortals.Add(new ListItemDto { Id = portalInfo.PortalID, Name = portalInfo.PortalName }); } } foreach (var moduleDefinition in desktopModule.ModuleDefinitions.Values) { - ModuleDefinitions.Add(new ModuleDefinitionDto(moduleDefinition)); + this.ModuleDefinitions.Add(new ModuleDefinitionDto(moduleDefinition)); } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/PermissionsDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/PermissionsDto.cs index 3757269814c..387bbb8ec0c 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/PermissionsDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/Editors/PermissionsDto.cs @@ -28,7 +28,7 @@ protected override void LoadPermissionDefinitions() { foreach (PermissionInfo permission in PermissionController.GetPermissionsByPortalDesktopModule()) { - PermissionDefinitions.Add(new Permission() + this.PermissionDefinitions.Add(new Permission() { PermissionId = permission.PermissionID, PermissionName = permission.PermissionName, diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/InstallResultDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/InstallResultDto.cs index 0cb8cd64ab2..4a33d16004e 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/InstallResultDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/InstallResultDto.cs @@ -30,19 +30,19 @@ public class InstallResultDto public void Failed(string message) { - Success = false; - Message = message; + this.Success = false; + this.Message = message; } public void Succeed() { - Success = true; - Message = string.Empty; + this.Success = true; + this.Message = string.Empty; } public void AddLogs(IEnumerable logs) { - Logs = logs?.Select( + this.Logs = logs?.Select( l => new InstallerLogEntry { Type = l.Type.ToString(), diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs index 035f538e7f1..8ea3af57631 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoDto.cs @@ -90,37 +90,37 @@ public PackageInfoDto() public PackageInfoDto(int portalId, PackageInfo package) { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); - - PackageType = package.PackageType; - FriendlyName = package.FriendlyName; - Name = package.Name; - PackageId = package.PackageID; - Description = package.Description; - IsInUse = ExtensionsController.IsPackageInUse(package, portalId); - Version = package.Version.ToString(3); - UpgradeUrl = ExtensionsController.UpgradeRedirect(package.Version, package.PackageType, package.Name); - UpgradeIndicator = ExtensionsController.UpgradeIndicator(package.Version, package.PackageType, package.Name); - PackageIcon = ExtensionsController.GetPackageIcon(package); - License = package.License; - ReleaseNotes = package.ReleaseNotes; - Owner = package.Owner; - Organization = package.Organization; - Url = package.Url; - Email = package.Email; - CanDelete = !package.IsSystemPackage && + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); + + this.PackageType = package.PackageType; + this.FriendlyName = package.FriendlyName; + this.Name = package.Name; + this.PackageId = package.PackageID; + this.Description = package.Description; + this.IsInUse = ExtensionsController.IsPackageInUse(package, portalId); + this.Version = package.Version.ToString(3); + this.UpgradeUrl = ExtensionsController.UpgradeRedirect(package.Version, package.PackageType, package.Name); + this.UpgradeIndicator = ExtensionsController.UpgradeIndicator(package.Version, package.PackageType, package.Name); + this.PackageIcon = ExtensionsController.GetPackageIcon(package); + this.License = package.License; + this.ReleaseNotes = package.ReleaseNotes; + this.Owner = package.Owner; + this.Organization = package.Organization; + this.Url = package.Url; + this.Email = package.Email; + this.CanDelete = !package.IsSystemPackage && package.PackageID > 0 && PackageController.CanDeletePackage(package, PortalSettings.Current); - var authService = AuthenticationController.GetAuthenticationServiceByPackageID(PackageId); - ReadOnly = authService != null && authService.AuthenticationType == Constants.DnnAuthTypeName; + var authService = AuthenticationController.GetAuthenticationServiceByPackageID(this.PackageId); + this.ReadOnly = authService != null && authService.AuthenticationType == Constants.DnnAuthTypeName; var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var tabId = portalSettings.ActiveTab.TabID; - SiteSettingsLink = NavigationManager.NavigateURL(tabId, "EditExtension", + this.SiteSettingsLink = this.NavigationManager.NavigateURL(tabId, "EditExtension", new[] { - $"packageid={PackageId}", + $"packageid={this.PackageId}", "Display=editor", "popUp=true", }); @@ -129,23 +129,23 @@ public PackageInfoDto(int portalId, PackageInfo package) public PackageInfo ToPackageInfo() { System.Version ver; - System.Version.TryParse(Version, out ver); + System.Version.TryParse(this.Version, out ver); return new PackageInfo { - PackageType = PackageType, - FriendlyName = FriendlyName, - Name = Name, - PackageID = PackageId, - Description = Description, + PackageType = this.PackageType, + FriendlyName = this.FriendlyName, + Name = this.Name, + PackageID = this.PackageId, + Description = this.Description, Version = ver, - License = License, - ReleaseNotes = ReleaseNotes, - Owner = Owner, - Organization = Organization, - Url = Url, - Email = Email, - IconFile = PackageIcon, + License = this.License, + ReleaseNotes = this.ReleaseNotes, + Owner = this.Owner, + Organization = this.Organization, + Url = this.Url, + Email = this.Email, + IconFile = this.PackageIcon, }; } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoSlimDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoSlimDto.cs index 845f2d75042..c391e46a227 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoSlimDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/PackageInfoSlimDto.cs @@ -1,7 +1,7 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information - +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information + #region Usings using DotNetNuke.Common.Utilities; @@ -47,6 +47,9 @@ public class PackageInfoSlimDto [JsonProperty("packageIcon")] public string PackageIcon { get; set; } + [JsonProperty("url")] + public string Url { get; set; } + [JsonProperty("canDelete")] public bool CanDelete { get; set; } @@ -60,22 +63,23 @@ public PackageInfoSlimDto() public PackageInfoSlimDto(int portalId, PackageInfo package) { - PackageId = package.PackageID; - FriendlyName = package.FriendlyName; - Name = package.Name; - FileName = package.FileName; - Description = package.Description; - Version = package.Version.ToString(3); - IsInUse = ExtensionsController.IsPackageInUse(package, portalId); - UpgradeUrl = ExtensionsController.UpgradeRedirect(package.Version, package.PackageType, package.Name); - UpgradeIndicator = ExtensionsController.UpgradeIndicator(package.Version, package.PackageType, package.Name); - PackageIcon = ExtensionsController.GetPackageIcon(package); - CanDelete = package.PackageID != Null.NullInteger && !package.IsSystemPackage && PackageController.CanDeletePackage(package, PortalSettings.Current); + this.PackageId = package.PackageID; + this.FriendlyName = package.FriendlyName; + this.Name = package.Name; + this.FileName = package.FileName; + this.Description = package.Description; + this.Version = package.Version.ToString(3); + this.IsInUse = ExtensionsController.IsPackageInUse(package, portalId); + this.UpgradeUrl = ExtensionsController.UpgradeRedirect(package.Version, package.PackageType, package.Name); + this.UpgradeIndicator = ExtensionsController.UpgradeIndicator(package.Version, package.PackageType, package.Name); + this.PackageIcon = ExtensionsController.GetPackageIcon(package); + this.Url = package.Url; + this.CanDelete = package.PackageID != Null.NullInteger && !package.IsSystemPackage && PackageController.CanDeletePackage(package, PortalSettings.Current); if (package.PackageID != Null.NullInteger) { - var authService = AuthenticationController.GetAuthenticationServiceByPackageID(PackageId); - ReadOnly = authService != null && authService.AuthenticationType == Constants.DnnAuthTypeName; + var authService = AuthenticationController.GetAuthenticationServiceByPackageID(this.PackageId); + this.ReadOnly = authService != null && authService.AuthenticationType == Constants.DnnAuthTypeName; } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/ParseResultDto.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/ParseResultDto.cs index 006ad73909f..c6c1f489e36 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/ParseResultDto.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Dto/ParseResultDto.cs @@ -62,44 +62,44 @@ public ParseResultDto(PackageInfo package) : base(Null.NullInteger, package) public void Failed(string message, IList logs = null) { - Success = false; - Message = Localization.GetString(message, Constants.SharedResources) ?? message; - AddLogs(logs); + this.Success = false; + this.Message = Localization.GetString(message, Constants.SharedResources) ?? message; + this.AddLogs(logs); // UI devs asked for these to be non-null empty for moving to next step - Description = Description ?? ""; - Email = Email ?? ""; - FriendlyName = FriendlyName ?? ""; - IsInUse = IsInUse ?? ""; - License = License ?? ""; - Name = Name ?? ""; - Organization = Organization ?? ""; - Owner = Owner ?? ""; - PackageIcon = PackageIcon ?? ""; - PackageType = PackageType ?? ""; - ReleaseNotes = ReleaseNotes ?? ""; - SiteSettingsLink = SiteSettingsLink ?? ""; - UpgradeIndicator = UpgradeIndicator ?? ""; - UpgradeUrl = UpgradeUrl ?? ""; - Url = Url ?? ""; - Version = Version ?? ""; - - LegacyError = LegacyError ?? ""; - Message = Message ?? ""; + this.Description = this.Description ?? ""; + this.Email = this.Email ?? ""; + this.FriendlyName = this.FriendlyName ?? ""; + this.IsInUse = this.IsInUse ?? ""; + this.License = this.License ?? ""; + this.Name = this.Name ?? ""; + this.Organization = this.Organization ?? ""; + this.Owner = this.Owner ?? ""; + this.PackageIcon = this.PackageIcon ?? ""; + this.PackageType = this.PackageType ?? ""; + this.ReleaseNotes = this.ReleaseNotes ?? ""; + this.SiteSettingsLink = this.SiteSettingsLink ?? ""; + this.UpgradeIndicator = this.UpgradeIndicator ?? ""; + this.UpgradeUrl = this.UpgradeUrl ?? ""; + this.Url = this.Url ?? ""; + this.Version = this.Version ?? ""; + + this.LegacyError = this.LegacyError ?? ""; + this.Message = this.Message ?? ""; } public void Succeed(IList logs) { - Success = true; - Message = string.Empty; - AddLogs(logs); + this.Success = true; + this.Message = string.Empty; + this.AddLogs(logs); } public void AddLogs(IEnumerable logs) { if (logs == null) - Logs = new List(); + this.Logs = new List(); else - Logs = logs.Select(l => new InstallerLogEntry { Type = l.Type.ToString(), Description = l.Description }).ToList(); + this.Logs = logs.Select(l => new InstallerLogEntry { Type = l.Type.ToString(), Description = l.Description }).ToList(); } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs index d2693523dec..3dc2a4710d7 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/CoreLanguagePackageEditor.cs @@ -22,7 +22,7 @@ public class CoreLanguagePackageEditor : IPackageEditor protected INavigationManager NavigationManager { get; } public CoreLanguagePackageEditor() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) @@ -34,7 +34,7 @@ public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) { Locales = Utility.GetAllLanguagesList(), LanguageId = languagePack.LanguageID, - EditUrlFormat = NavigationManager.NavigateURL(languagesTab, "", "Locale={0}") + EditUrlFormat = this.NavigationManager.NavigateURL(languagesTab, "", "Locale={0}") }; if (languagePack.PackageType == LanguagePackType.Extension) diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs index f52a18a8e56..ee87988b5b5 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ExtensionLanguagePackageEditor.cs @@ -23,7 +23,7 @@ public class ExtensionLanguagePackageEditor : IPackageEditor public ExtensionLanguagePackageEditor() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) @@ -36,7 +36,7 @@ public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) Locales = Utility.GetAllLanguagesList(), LanguageId = languagePack.LanguageID, DependentPackageId = languagePack.DependentPackageID, - EditUrlFormat = NavigationManager.NavigateURL(languagesTab, "", "Locale={0}") + EditUrlFormat = this.NavigationManager.NavigateURL(languagesTab, "", "Locale={0}") }; if (languagePack.PackageType == LanguagePackType.Extension) diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ModulePackageEditor.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ModulePackageEditor.cs index 8d603ecc76b..b42b5c31ff5 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ModulePackageEditor.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/Editors/ModulePackageEditor.cs @@ -42,7 +42,7 @@ public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package) : new ModulePackagePermissionsDto(portalId, package); detail.DesktopModuleId = desktopModule.DesktopModuleID; - detail.Permissions = GetPermissionsData(portalId, desktopModule.DesktopModuleID); + detail.Permissions = this.GetPermissionsData(portalId, desktopModule.DesktopModuleID); return detail; } @@ -62,7 +62,7 @@ public bool SavePackageSettings(PackageSettingsDto packageSettings, out string e var isHostUser = UserController.Instance.GetCurrentUserInfo().IsSuperUser; - UpdatePermissions(desktopModule, packageSettings); + this.UpdatePermissions(desktopModule, packageSettings); if(isHostUser) { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs index 1267bf806f9..773060a5304 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Extensions/ExtensionsController.cs @@ -35,7 +35,7 @@ public class ExtensionsController protected INavigationManager NavigationManager { get; } public ExtensionsController() { - NavigationManager = Globals.DependencyProvider.GetRequiredService(); + this.NavigationManager = Globals.DependencyProvider.GetRequiredService(); } public IDictionary GetPackageTypes() @@ -124,7 +124,7 @@ public List GetAvailablePackages(string packageType) { var packages = new List(); string packagePath; - if (HasAvailablePackage(packageType, out packagePath)) + if (this.HasAvailablePackage(packageType, out packagePath)) { var validpackages = new Dictionary(); var invalidPackages = new List(); @@ -139,7 +139,7 @@ public List GetAvailablePackages(string packageType) if (packageType.ToLowerInvariant() == "corelanguagepack") { - GetAvaialableLanguagePacks(validpackages); + this.GetAvaialableLanguagePacks(validpackages); } packages.Add(new AvailablePackagesDto() @@ -260,7 +260,7 @@ public string GetFormattedTabLink(int portalId, TabInfo tab) : PortalAliasController.Instance.GetPortalAliasesByPortalId(t.PortalID) .OrderBy(pa => pa.IsPrimary ? 0 : 1) .First(); - var url = NavigationManager.NavigateURL(t.TabID, new PortalSettings(t.PortalID, alias), string.Empty); + var url = this.NavigationManager.NavigateURL(t.TabID, new PortalSettings(t.PortalID, alias), string.Empty); returnValue.AppendFormat("{1}", url, t.LocalizedTabName); } index = index + 1; diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs index 648e016d693..8b6beacf5df 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/BulkPagesController.cs @@ -78,7 +78,7 @@ public BulkPageResponse AddBulkPages(BulkPage page, bool validateOnly) string errorMessage = null; if (oTab.Level == 0) { - oTab.TabID = CreateTabFromParent(portalSettings, rootTab, oTab, parentId, validateOnly, out errorMessage); + oTab.TabID = this.CreateTabFromParent(portalSettings, rootTab, oTab, parentId, validateOnly, out errorMessage); } else if (validateOnly) { @@ -89,7 +89,7 @@ public BulkPageResponse AddBulkPages(BulkPage page, bool validateOnly) var parentTabId = GetParentTabId(tabs, currentIndex, oTab.Level - 1); if (parentTabId != Null.NullInteger) { - oTab.TabID = CreateTabFromParent(portalSettings, rootTab, oTab, parentTabId, validateOnly, out errorMessage); + oTab.TabID = this.CreateTabFromParent(portalSettings, rootTab, oTab, parentTabId, validateOnly, out errorMessage); } } bulkPageItems.Add(ToBulkPageResponseItem(oTab, errorMessage)); @@ -179,7 +179,7 @@ private int CreateTabFromParent(PortalSettings portalSettings, TabInfo objRoot, } //Validate Tab Path - if (!IsValidTabPath(tab, tab.TabPath, out errorMessage)) + if (!this.IsValidTabPath(tab, tab.TabPath, out errorMessage)) { return Null.NullInteger; } @@ -227,7 +227,7 @@ private int CreateTabFromParent(PortalSettings portalSettings, TabInfo objRoot, return -1; tab.TabID = TabController.Instance.AddTab(tab); - ApplyDefaultTabTemplate(tab); + this.ApplyDefaultTabTemplate(tab); //create localized tabs if content localization is enabled if (portalSettings.ContentLocalizationEnabled) diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/BulkPagesException.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/BulkPagesException.cs index 68cd3aaabf5..674eb1df3d2 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/BulkPagesException.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/BulkPagesException.cs @@ -12,7 +12,7 @@ public class BulkPagesException : Exception public BulkPagesException(string field, string message) : base(message) { - Field = field; + this.Field = field; } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/PageValidationException.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/PageValidationException.cs index 4b5ef7bc4aa..34e18f9753a 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/PageValidationException.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Exceptions/PageValidationException.cs @@ -12,7 +12,7 @@ public class PageValidationException : Exception public PageValidationException(string field, string message) : base(message) { - Field = field; + this.Field = field; } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageManagementController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageManagementController.cs index f39592f3f42..821093937d7 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageManagementController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageManagementController.cs @@ -20,7 +20,7 @@ public class PageManagementController : ServiceLocator ", from t in tab.BreadCrumbs.Cast().Take(tab.BreadCrumbs.Count - 1) select t.LocalizedTabName); } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageUrlsController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageUrlsController.cs index ec8f41e684c..2d6c2a95cb9 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageUrlsController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PageUrlsController.cs @@ -27,8 +27,8 @@ public IEnumerable GetPageUrls(TabInfo tab, int portalId) { var locales = new Lazy>(() => LocaleController.Instance.GetLocales(portalId)); - var customUrls = GetSortedUrls(tab, portalId, locales, 1, true, false); - var automaticUrls = GetSortedUrls(tab, portalId, locales, 1, true, true).ToList(); + var customUrls = this.GetSortedUrls(tab, portalId, locales, 1, true, false); + var automaticUrls = this.GetSortedUrls(tab, portalId, locales, 1, true, true).ToList(); automaticUrls.AddRange(customUrls); return automaticUrls.OrderBy(url => url.StatusCode, new KeyValuePairComparer()).ThenBy(url => url.Path); @@ -339,7 +339,7 @@ private IEnumerable GetSortedUrls(TabInfo tab, int portalId, Lazy GetSortedUrls(TabInfo tab, int portalId, Lazy GetSortedUrls(TabInfo tab, int portalId, Lazy GetSortedUrls(TabInfo tab, int portalId, Lazy local.Code == alias.CultureCode); - AddUrlToList(tabs, portalId, url.SeqNum, alias, urlLocale, url.Url, url.QueryString, statusCode, isSystem, friendlyUrlSettings, url.LastModifiedByUserId); + this.AddUrlToList(tabs, portalId, url.SeqNum, alias, urlLocale, url.Url, url.QueryString, statusCode, isSystem, friendlyUrlSettings, url.LastModifiedByUserId); } } else @@ -406,7 +406,7 @@ private IEnumerable GetSortedUrls(TabInfo tab, int portalId, Lazy p.PortalAliasID == url.PortalAliasId); if (alias != null) { - AddUrlToList(tabs, portalId, url.SeqNum, alias, urlLocale, url.Url, url.QueryString, statusCode, isSystem, friendlyUrlSettings, url.LastModifiedByUserId); + this.AddUrlToList(tabs, portalId, url.SeqNum, alias, urlLocale, url.Url, url.QueryString, statusCode, isSystem, friendlyUrlSettings, url.LastModifiedByUserId); } } } @@ -447,11 +447,11 @@ private void AddUrlToList(List tabs, int portalId, int id, PortalAliasInfo Id = id, SiteAlias = new KeyValuePair(alias.KeyID, alias.HTTPAlias), Path = path, - PathWithNoExtension = GetCleanPath(path, friendlyUrlSettings), + PathWithNoExtension = this.GetCleanPath(path, friendlyUrlSettings), QueryString = queryString, Locale = (urlLocale != null) ? new KeyValuePair(urlLocale.KeyID, urlLocale.EnglishName) : new KeyValuePair(-1, ""), - StatusCode = StatusCodes.SingleOrDefault(kv => kv.Key == statusCode), + StatusCode = this.StatusCodes.SingleOrDefault(kv => kv.Key == statusCode), SiteAliasUsage = (int)PortalAliasUsageType.ChildPagesInherit, IsSystem = isSystem, UserName = userName diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs index ccfa2953d63..c8ef2c36879 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/PagesControllerImpl.cs @@ -80,22 +80,22 @@ public PagesControllerImpl( IContentVerifier contentVerifier, IPortalController portalController) { - _tabController = tabController; - _moduleController = moduleController; - _pageUrlsController = pageUrlsController; - _templateController = templateController; - _defaultPortalThemeController = defaultPortalThemeController; - _cloneModuleExecutionContext = cloneModuleExecutionContext; - _urlRewriterUtilsWrapper = urlRewriterUtilsWrapper; - _friendlyUrlWrapper = friendlyUrlWrapper; - _contentVerifier = contentVerifier; - _portalController = portalController; + this._tabController = tabController; + this._moduleController = moduleController; + this._pageUrlsController = pageUrlsController; + this._templateController = templateController; + this._defaultPortalThemeController = defaultPortalThemeController; + this._cloneModuleExecutionContext = cloneModuleExecutionContext; + this._urlRewriterUtilsWrapper = urlRewriterUtilsWrapper; + this._friendlyUrlWrapper = friendlyUrlWrapper; + this._contentVerifier = contentVerifier; + this._portalController = portalController; } public bool IsValidTabPath(TabInfo tab, string newTabPath, string newTabName, out string errorMessage) { - var portalSettings = PortalSettings ?? PortalController.Instance.GetCurrentPortalSettings(); + var portalSettings = this.PortalSettings ?? PortalController.Instance.GetCurrentPortalSettings(); var valid = true; errorMessage = string.Empty; @@ -110,7 +110,7 @@ public bool IsValidTabPath(TabInfo tab, string newTabPath, string newTabName, ou var tabId = TabController.GetTabByTabPath(portalSettings.PortalId, newTabPath, cultureCode); if (tabId != Null.NullInteger && (tab == null || tabId != tab.TabID)) { - var existingTab = _tabController.GetTab(tabId, portalSettings.PortalId, false); + var existingTab = this._tabController.GetTab(tabId, portalSettings.PortalId, false); if (existingTab != null && existingTab.IsDeleted) { errorMessage = Localization.GetString("TabRecycled"); @@ -181,7 +181,7 @@ public TabInfo MovePage(PageMoveRequest request) { string errorMessage; - if (!IsValidTabPath(tab, Globals.GenerateTabPath(request.ParentId, tab.TabName), tab.TabName, out errorMessage)) + if (!this.IsValidTabPath(tab, Globals.GenerateTabPath(request.ParentId, tab.TabName), tab.TabName, out errorMessage)) { throw new PageException(errorMessage); } @@ -195,7 +195,7 @@ public TabInfo MovePage(PageMoveRequest request) } string errorMessage; - if (tab.ParentId != relatedTab.ParentId && !IsValidTabPath(tab, Globals.GenerateTabPath(relatedTab.ParentId, tab.TabName), tab.TabName, out errorMessage)) + if (tab.ParentId != relatedTab.ParentId && !this.IsValidTabPath(tab, Globals.GenerateTabPath(relatedTab.ParentId, tab.TabName), tab.TabName, out errorMessage)) { throw new PageException(errorMessage); } @@ -211,7 +211,7 @@ public TabInfo MovePage(PageMoveRequest request) break; case "parent": //avoid move tab into its child page - if (IsChild(portalSettings.PortalId, tab.TabID, request.ParentId)) + if (this.IsChild(portalSettings.PortalId, tab.TabID, request.ParentId)) { throw new PageException("DragInvalid"); } @@ -226,7 +226,7 @@ public TabInfo MovePage(PageMoveRequest request) public void DeletePage(PageItem page, PortalSettings portalSettings = null) { - DeletePage(page, false, portalSettings); + this.DeletePage(page, false, portalSettings); } public void DeletePage(PageItem page, bool hardDelete, PortalSettings portalSettings = null) @@ -246,7 +246,7 @@ public void DeletePage(PageItem page, bool hardDelete, PortalSettings portalSett } else { - if (_contentVerifier.IsContentExistsForRequestedPortal(tab.PortalID, currentPortal)) + if (this._contentVerifier.IsContentExistsForRequestedPortal(tab.PortalID, currentPortal)) { if (hardDelete) { @@ -290,11 +290,11 @@ public void EditModeForPage(int pageId, int userId) public TabInfo SavePageDetails(PortalSettings settings, PageSettings pageSettings) { - PortalSettings = settings ?? PortalController.Instance.GetCurrentPortalSettings(); + this.PortalSettings = settings ?? PortalController.Instance.GetCurrentPortalSettings(); TabInfo tab = null; if (pageSettings.TabId > 0) { - tab = TabController.Instance.GetTab(pageSettings.TabId, PortalSettings.PortalId); + tab = TabController.Instance.GetTab(pageSettings.TabId, this.PortalSettings.PortalId); if (tab == null) { throw new PageNotFoundException(); @@ -303,16 +303,16 @@ public TabInfo SavePageDetails(PortalSettings settings, PageSettings pageSetting string errorMessage; string field; - if (!ValidatePageSettingsData(PortalSettings, pageSettings, tab, out field, out errorMessage)) + if (!this.ValidatePageSettingsData(this.PortalSettings, pageSettings, tab, out field, out errorMessage)) { throw new PageValidationException(field, errorMessage); } var tabId = pageSettings.TabId <= 0 - ? AddTab(PortalSettings, pageSettings) - : UpdateTab(tab, pageSettings); + ? this.AddTab(this.PortalSettings, pageSettings) + : this.UpdateTab(tab, pageSettings); - return TabController.Instance.GetTab(tabId, PortalSettings.PortalId); + return TabController.Instance.GetTab(tabId, this.PortalSettings.PortalId); } private bool IsChild(int portalId, int tabId, int parentId) @@ -364,7 +364,7 @@ public IEnumerable GetPageList(PortalSettings portalSettings, bool? del { pageIndex = pageIndex <= 0 ? 0 : pageIndex; pageSize = pageSize > 0 && pageSize <= 100 ? pageSize : 10; - var tabs = GetPageList(portalSettings, parentId, searchKey, true, deleted ?? false, includeSubpages); + var tabs = this.GetPageList(portalSettings, parentId, searchKey, true, deleted ?? false, includeSubpages); var finalList = new List(); if (deleted.HasValue) tabs = tabs.Where(tab => tab.IsDeleted == deleted); @@ -468,8 +468,8 @@ public IEnumerable SearchPages(out int totalRecords, string searchKey = private TabInfo GetPageDetails(int pageId) { - var portalSettings = _portalController.GetCurrentPortalSettings(); - var tab = _tabController.GetTab(pageId, portalSettings.PortalId); + var portalSettings = this._portalController.GetCurrentPortalSettings(); + var tab = this._tabController.GetTab(pageId, portalSettings.PortalId); if (tab == null) { throw new PageNotFoundException(); @@ -480,7 +480,7 @@ private TabInfo GetPageDetails(int pageId) public IEnumerable GetModules(int pageId) { - var tabModules = _moduleController.GetTabModules(pageId); + var tabModules = this._moduleController.GetTabModules(pageId); return tabModules.Values.Where(m => !m.IsDeleted); } @@ -512,10 +512,10 @@ protected virtual bool ValidatePageSettingsData(PortalSettings portalSettings, P if (pageSettings.PageType == "template") { - parentId = GetTemplateParentId(tab?.PortalID ?? portalSettings.PortalId); + parentId = this.GetTemplateParentId(tab?.PortalID ?? portalSettings.PortalId); } - isValid = IsValidTabPath(tab, Globals.GenerateTabPath(parentId, pageSettings.Name), pageSettings.Name, out errorMessage); + isValid = this.IsValidTabPath(tab, Globals.GenerateTabPath(parentId, pageSettings.Name), pageSettings.Name, out errorMessage); if (!isValid) { invalidField = pageSettings.PageType == "template" ? "templateName" : "name"; @@ -568,7 +568,7 @@ protected virtual bool ValidatePageSettingsData(PortalSettings portalSettings, P break; } - return ValidatePageUrlSettings(portalSettings, pageSettings, tab, ref invalidField, ref errorMessage); + return this.ValidatePageUrlSettings(portalSettings, pageSettings, tab, ref invalidField, ref errorMessage); } protected virtual int GetTemplateParentId(int portalId) @@ -587,9 +587,9 @@ public bool ValidatePageUrlSettings(PortalSettings portalSettings, PageSettings bool modified; //Clean Url - var options = _urlRewriterUtilsWrapper.GetExtendOptionsForURLs(portalSettings.PortalId); - urlPath = GetLocalPath(urlPath); - urlPath = _friendlyUrlWrapper.CleanNameForUrl(urlPath, options, out modified); + var options = this._urlRewriterUtilsWrapper.GetExtendOptionsForURLs(portalSettings.PortalId); + urlPath = this.GetLocalPath(urlPath); + urlPath = this._friendlyUrlWrapper.CleanNameForUrl(urlPath, options, out modified); if (modified) { errorMessage = Localization.GetString("UrlPathCleaned"); @@ -598,7 +598,7 @@ public bool ValidatePageUrlSettings(PortalSettings portalSettings, PageSettings } //Validate for uniqueness - _friendlyUrlWrapper.ValidateUrl(urlPath, tab?.TabID ?? Null.NullInteger, portalSettings, out modified); + this._friendlyUrlWrapper.ValidateUrl(urlPath, tab?.TabID ?? Null.NullInteger, portalSettings, out modified); if (modified) { errorMessage = Localization.GetString("UrlPathNotUnique"); @@ -614,43 +614,43 @@ public virtual int AddTab(PortalSettings settings, PageSettings pageSettings) var portalSettings = settings ?? PortalController.Instance.GetCurrentPortalSettings(); var portalId = portalSettings.PortalId; var tab = new TabInfo { PortalID = portalId, ParentId = pageSettings.ParentId ?? Null.NullInteger }; - UpdateTabInfoFromPageSettings(tab, pageSettings); + this.UpdateTabInfoFromPageSettings(tab, pageSettings); if (portalSettings.ContentLocalizationEnabled) { tab.CultureCode = portalSettings.CultureCode; } - SavePagePermissions(tab, pageSettings.Permissions); + this.SavePagePermissions(tab, pageSettings.Permissions); - var tabId = _tabController.AddTab(tab); - tab = _tabController.GetTab(tabId, portalId); + var tabId = this._tabController.AddTab(tab); + tab = this._tabController.GetTab(tabId, portalId); - CreateOrUpdateContentItem(tab); + this.CreateOrUpdateContentItem(tab); if (pageSettings.TemplateTabId > 0) { - CopyContentFromSourceTab(tab, pageSettings.TemplateTabId, pageSettings.Modules); + this.CopyContentFromSourceTab(tab, pageSettings.TemplateTabId, pageSettings.Modules); } if (pageSettings.TemplateId > 0) { try { - _templateController.CreatePageFromTemplate(pageSettings.TemplateId, tab, portalId); + this._templateController.CreatePageFromTemplate(pageSettings.TemplateId, tab, portalId); } catch (PageException) { - _tabController.DeleteTab(tab.TabID, portalId); + this._tabController.DeleteTab(tab.TabID, portalId); throw; } } - SaveTabUrl(tab, pageSettings); + this.SaveTabUrl(tab, pageSettings); - MovePageIfNeeded(pageSettings, tab); + this.MovePageIfNeeded(pageSettings, tab); - _tabController.ClearCache(portalId); + this._tabController.ClearCache(portalId); return tab.TabID; } @@ -665,7 +665,7 @@ private void MovePageIfNeeded(PageSettings pageSettings, TabInfo tab) ParentId = pageSettings.ParentId.Value }; - MovePage(request); + this.MovePage(request); } } @@ -674,8 +674,8 @@ protected virtual void UpdateTabInfoFromPageSettings(TabInfo tab, PageSettings p tab.TabName = pageSettings.Name; tab.TabPath = Globals.GenerateTabPath(tab.ParentId, tab.TabName); tab.Title = pageSettings.Title; - tab.Description = GetTabDescription(pageSettings); - tab.KeyWords = GetKeyWords(pageSettings); + tab.Description = this.GetTabDescription(pageSettings); + tab.KeyWords = this.GetKeyWords(pageSettings); tab.IsVisible = pageSettings.IncludeInMenu; tab.DisableLink = pageSettings.DisableLink; @@ -689,7 +689,7 @@ protected virtual void UpdateTabInfoFromPageSettings(TabInfo tab, PageSettings p tab.PageHeadText = pageSettings.PageHeadText; tab.PermanentRedirect = pageSettings.PermanentRedirect; - tab.Url = GetInternalUrl(pageSettings); + tab.Url = this.GetInternalUrl(pageSettings); tab.TabSettings["CacheProvider"] = pageSettings.CacheProvider; if (pageSettings.CacheProvider != null) @@ -726,12 +726,12 @@ protected virtual void UpdateTabInfoFromPageSettings(TabInfo tab, PageSettings p tab.TabSettings["CustomStylesheet"] = pageSettings.PageStyleSheet; // Tab Skin - tab.SkinSrc = GetSkinSrc(pageSettings); - tab.ContainerSrc = GetContainerSrc(pageSettings); + tab.SkinSrc = this.GetSkinSrc(pageSettings); + tab.ContainerSrc = this.GetContainerSrc(pageSettings); if (pageSettings.PageType == "template") { - tab.ParentId = GetTemplateParentId(tab.PortalID); + tab.ParentId = this.GetTemplateParentId(tab.PortalID); tab.IsSystem = true; } @@ -815,7 +815,7 @@ protected virtual void UpdateTabInfoFromPageSettings(TabInfo tab, PageSettings p private string GetContainerSrc(PageSettings pageSettings) { - var defaultContainer = _defaultPortalThemeController.GetDefaultPortalContainer(); + var defaultContainer = this._defaultPortalThemeController.GetDefaultPortalContainer(); if (pageSettings.ContainerSrc != null && pageSettings.ContainerSrc.Equals(defaultContainer, StringComparison.OrdinalIgnoreCase)) @@ -827,7 +827,7 @@ private string GetContainerSrc(PageSettings pageSettings) private string GetSkinSrc(PageSettings pageSettings) { - var defaultSkin = _defaultPortalThemeController.GetDefaultPortalLayout(); + var defaultSkin = this._defaultPortalThemeController.GetDefaultPortalLayout(); if (pageSettings.SkinSrc != null && pageSettings.SkinSrc.Equals(defaultSkin, StringComparison.OrdinalIgnoreCase)) @@ -908,7 +908,7 @@ public void SaveTabUrl(TabInfo tab, PageSettings pageSettings) var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (!String.IsNullOrEmpty(url) && url != "/") { - url = CleanTabUrl(url); + url = this.CleanTabUrl(url); string currentUrl = String.Empty; var friendlyUrlSettings = new FriendlyUrlSettings(portalSettings.PortalId); @@ -947,29 +947,29 @@ public void SaveTabUrl(TabInfo tab, PageSettings pageSettings) IsSystem = true }; //Save url - _tabController.SaveTabUrl(tabUrl, portalSettings.PortalId, true); + this._tabController.SaveTabUrl(tabUrl, portalSettings.PortalId, true); } else { //Change the original 200 url to a redirect tabUrl.HttpStatus = "301"; tabUrl.SeqNum = tab.TabUrls.Max(t => t.SeqNum) + 1; - _tabController.SaveTabUrl(tabUrl, portalSettings.PortalId, true); + this._tabController.SaveTabUrl(tabUrl, portalSettings.PortalId, true); //Add new custom url tabUrl.Url = url; tabUrl.HttpStatus = "200"; tabUrl.SeqNum = 0; - _tabController.SaveTabUrl(tabUrl, portalSettings.PortalId, true); + this._tabController.SaveTabUrl(tabUrl, portalSettings.PortalId, true); } //Delete any redirects to the same url - foreach (var redirecturl in _tabController.GetTabUrls(tab.TabID, tab.PortalID)) + foreach (var redirecturl in this._tabController.GetTabUrls(tab.TabID, tab.PortalID)) { if (redirecturl.Url == url && redirecturl.HttpStatus != "200") { - _tabController.DeleteTabUrl(redirecturl, tab.PortalID, true); + this._tabController.DeleteTabUrl(redirecturl, tab.PortalID, true); } } } @@ -977,7 +977,7 @@ public void SaveTabUrl(TabInfo tab, PageSettings pageSettings) { if (url == "/" && tabUrl != null) { - _tabController.DeleteTabUrl(tabUrl, portalSettings.PortalId, true); + this._tabController.DeleteTabUrl(tabUrl, portalSettings.PortalId, true); } } } @@ -1007,7 +1007,7 @@ public void CopyThemeToDescendantPages(int pageId, Theme theme) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var portalId = portalSettings.PortalId; - var tab = _tabController.GetTab(pageId, portalId, false); + var tab = this._tabController.GetTab(pageId, portalId, false); if (tab == null) { throw new PageNotFoundException(); @@ -1020,7 +1020,7 @@ public void CopyPermissionsToDescendantPages(int pageId) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var portalId = portalSettings.PortalId; - var tab = _tabController.GetTab(pageId, portalId, false); + var tab = this._tabController.GetTab(pageId, portalId, false); if (tab == null) { throw new PageNotFoundException(); @@ -1036,30 +1036,30 @@ public void CopyPermissionsToDescendantPages(int pageId) public IEnumerable GetPageUrls(int tabId) { - var tab = GetPageDetails(tabId); + var tab = this.GetPageDetails(tabId); var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var portalId = portalSettings.PortalId; - return _pageUrlsController.GetPageUrls(tab, portalId); + return this._pageUrlsController.GetPageUrls(tab, portalId); } public PageSettings GetPageSettings(int pageId, PortalSettings requestPortalSettings = null) { - var tab = GetPageDetails(pageId); + var tab = this.GetPageDetails(pageId); - var portalSettings = requestPortalSettings ?? _portalController.GetCurrentPortalSettings(); + var portalSettings = requestPortalSettings ?? this._portalController.GetCurrentPortalSettings(); - if (!_contentVerifier.IsContentExistsForRequestedPortal(tab.PortalID, portalSettings)) + if (!this._contentVerifier.IsContentExistsForRequestedPortal(tab.PortalID, portalSettings)) { throw new PageNotFoundException(); } var page = Converters.ConvertToPageSettings(tab); - page.Modules = GetModules(page.TabId).Select(Converters.ConvertToModuleItem); - page.PageUrls = GetPageUrls(page.TabId); - page.Permissions = GetPermissionsData(pageId); - page.SiteAliases = GetSiteAliases(portalSettings.PortalId); - page.PrimaryAliasId = GetPrimaryAliasId(portalSettings.PortalId, portalSettings.CultureCode); - page.Locales = GetLocales(portalSettings.PortalId); + page.Modules = this.GetModules(page.TabId).Select(Converters.ConvertToModuleItem); + page.PageUrls = this.GetPageUrls(page.TabId); + page.Permissions = this.GetPermissionsData(pageId); + page.SiteAliases = this.GetSiteAliases(portalSettings.PortalId); + page.PrimaryAliasId = this.GetPrimaryAliasId(portalSettings.PortalId, portalSettings.CultureCode); + page.Locales = this.GetLocales(portalSettings.PortalId); page.HasParent = tab.ParentId > -1; // icons @@ -1091,19 +1091,19 @@ public PageSettings GetPageSettings(int pageId, PortalSettings requestPortalSett public PageUrlResult CreateCustomUrl(SeoUrl dto) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return _pageUrlsController.CreateCustomUrl(dto.SaveUrl, _tabController.GetTab(dto.TabId, portalSettings.PortalId, false)); + return this._pageUrlsController.CreateCustomUrl(dto.SaveUrl, this._tabController.GetTab(dto.TabId, portalSettings.PortalId, false)); } public PageUrlResult UpdateCustomUrl(SeoUrl dto) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return _pageUrlsController.UpdateCustomUrl(dto.SaveUrl, _tabController.GetTab(dto.TabId, portalSettings.PortalId, false)); + return this._pageUrlsController.UpdateCustomUrl(dto.SaveUrl, this._tabController.GetTab(dto.TabId, portalSettings.PortalId, false)); } public PageUrlResult DeleteCustomUrl(UrlIdDto dto) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return _pageUrlsController.DeleteCustomUrl(dto.Id, _tabController.GetTab(dto.TabId, portalSettings.PortalId, false)); + return this._pageUrlsController.DeleteCustomUrl(dto.Id, this._tabController.GetTab(dto.TabId, portalSettings.PortalId, false)); } protected IOrderedEnumerable> GetLocales(int portalId) { @@ -1154,16 +1154,16 @@ public void CreateOrUpdateContentItem(TabInfo tab) public int UpdateTab(TabInfo tab, PageSettings pageSettings) { - UpdateTabInfoFromPageSettings(tab, pageSettings); - SavePagePermissions(tab, pageSettings.Permissions); + this.UpdateTabInfoFromPageSettings(tab, pageSettings); + this.SavePagePermissions(tab, pageSettings.Permissions); - _tabController.UpdateTab(tab); + this._tabController.UpdateTab(tab); - CreateOrUpdateContentItem(tab); + this.CreateOrUpdateContentItem(tab); - SaveTabUrl(tab, pageSettings); + this.SaveTabUrl(tab, pageSettings); - MovePageIfNeeded(pageSettings, tab); + this.MovePageIfNeeded(pageSettings, tab); return tab.TabID; } @@ -1258,11 +1258,11 @@ public virtual PageSettings GetDefaultSettings(int pageId = 0) { var pageSettings = new PageSettings { - Templates = _templateController.GetTemplates(), - Permissions = GetPermissionsData(pageId) + Templates = this._templateController.GetTemplates(), + Permissions = this.GetPermissionsData(pageId) }; - pageSettings.TemplateId = _templateController.GetDefaultTemplateId(pageSettings.Templates); + pageSettings.TemplateId = this._templateController.GetDefaultTemplateId(pageSettings.Templates); var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); if (PortalController.GetPortalSettingAsBoolean("SSLEnabled", portalSettings.PortalId, false) && @@ -1310,13 +1310,13 @@ public PagePermissions GetPermissionsData(int pageId) public void DeleteTabModule(int pageId, int moduleId) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - var tab = _tabController.GetTab(pageId, portalSettings.PortalId); + var tab = this._tabController.GetTab(pageId, portalSettings.PortalId); if (tab == null) { throw new PageModuleNotFoundException(); } - var tabModule = _moduleController.GetModule(moduleId, pageId, false); + var tabModule = this._moduleController.GetModule(moduleId, pageId, false); if (tabModule == null) { throw new PageModuleNotFoundException(); @@ -1327,23 +1327,23 @@ public void DeleteTabModule(int pageId, int moduleId) throw new SecurityException("You do not have permission to delete module on this page"); } - _moduleController.DeleteTabModule(pageId, moduleId, true); - _moduleController.ClearCache(pageId); + this._moduleController.DeleteTabModule(pageId, moduleId, true); + this._moduleController.ClearCache(pageId); } public void CopyContentFromSourceTab(TabInfo tab, int sourceTabId, IEnumerable includedModules) { - var sourceTab = _tabController.GetTab(sourceTabId, tab.PortalID); + var sourceTab = this._tabController.GetTab(sourceTabId, tab.PortalID); if (sourceTab == null || sourceTab.IsDeleted) { return; } //Copy Properties - CopySourceTabProperties(tab, sourceTab); + this.CopySourceTabProperties(tab, sourceTab); //Copy Modules - CopyModulesFromSourceTab(tab, sourceTab, includedModules); + this.CopyModulesFromSourceTab(tab, sourceTab, includedModules); } private string GetLocalPath(string url) @@ -1364,14 +1364,14 @@ private void CopySourceTabProperties(TabInfo tab, TabInfo sourceTab) tab.PageHeadText = sourceTab.PageHeadText; tab.RefreshInterval = sourceTab.RefreshInterval; tab.IsSecure = sourceTab.IsSecure; - _tabController.UpdateTab(tab); + this._tabController.UpdateTab(tab); //update need tab settings. foreach (var key in TabSettingKeys) { if (sourceTab.TabSettings.ContainsKey(key)) { - _tabController.UpdateTabSetting(tab.TabID, key, Convert.ToString(sourceTab.TabSettings[key])); + this._tabController.UpdateTabSetting(tab.TabID, key, Convert.ToString(sourceTab.TabSettings[key])); } } } @@ -1434,7 +1434,7 @@ private void CopyModulesFromSourceTab(TabInfo tab, TabInfo sourceTab, IEnumerabl { try { - _cloneModuleExecutionContext.SetCloneModuleContext(true); + this._cloneModuleExecutionContext.SetCloneModuleContext(true); var content = Convert.ToString(o.ExportModule(module.Id)); if (!string.IsNullOrEmpty(content)) { @@ -1443,7 +1443,7 @@ private void CopyModulesFromSourceTab(TabInfo tab, TabInfo sourceTab, IEnumerabl } finally { - _cloneModuleExecutionContext.SetCloneModuleContext(false); + this._cloneModuleExecutionContext.SetCloneModuleContext(false); } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/DeletePage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/DeletePage.cs index 717757a9da1..445df8b8796 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/DeletePage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/DeletePage.cs @@ -33,39 +33,39 @@ public class DeletePage : ConsoleCommandBase public override void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { - PageId = GetFlagValue(FlagId, "Page Id", -1, false, true); - PageName = GetFlagValue(FlagName, "Page Name", string.Empty); - ParentId = GetFlagValue(FlagParentId, "Parent Id", -1); + this.PageId = this.GetFlagValue(FlagId, "Page Id", -1, false, true); + this.PageName = this.GetFlagValue(FlagName, "Page Name", string.Empty); + this.ParentId = this.GetFlagValue(FlagParentId, "Parent Id", -1); - if (PageId == -1 && string.IsNullOrEmpty(PageName)) + if (this.PageId == -1 && string.IsNullOrEmpty(this.PageName)) { - AddMessage(LocalizeString("Prompt_ParameterRequired")); + this.AddMessage(this.LocalizeString("Prompt_ParameterRequired")); } } public override ConsoleResultModel Run() { - PageId = PageId != -1 - ? PageId - : (ParentId > 0 ? TabController.Instance.GetTabByName(PageName, PortalId, ParentId) : TabController.Instance.GetTabByName(PageName, PortalId))?.TabID ?? -1; + this.PageId = this.PageId != -1 + ? this.PageId + : (this.ParentId > 0 ? TabController.Instance.GetTabByName(this.PageName, this.PortalId, this.ParentId) : TabController.Instance.GetTabByName(this.PageName, this.PortalId))?.TabID ?? -1; - if (PageId == -1) + if (this.PageId == -1) { - return new ConsoleErrorResultModel(LocalizeString("Prompt_PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("Prompt_PageNotFound")); } - if (!SecurityService.Instance.CanDeletePage(PageId)) + if (!SecurityService.Instance.CanDeletePage(this.PageId)) { - return new ConsoleErrorResultModel(LocalizeString("MethodPermissionDenied")); + return new ConsoleErrorResultModel(this.LocalizeString("MethodPermissionDenied")); } try { - PagesController.Instance.DeletePage(new PageItem { Id = PageId }, PortalSettings); + PagesController.Instance.DeletePage(new PageItem { Id = this.PageId }, this.PortalSettings); } catch (PageNotFoundException) { - return new ConsoleErrorResultModel(LocalizeString("Prompt_PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("Prompt_PageNotFound")); } - return new ConsoleResultModel(LocalizeString("PageDeletedMessage")) { Records = 1 }; + return new ConsoleResultModel(this.LocalizeString("PageDeletedMessage")) { Records = 1 }; } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GetPage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GetPage.cs index df8c88f28f6..1648a5bac33 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GetPage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GetPage.cs @@ -54,39 +54,39 @@ IContentVerifier contentVerifier public override void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { - PageId = GetFlagValue(FlagId, "Page Id", -1, false, true); - PageName = GetFlagValue(FlagName, "Page Name", string.Empty); - ParentId = GetFlagValue(FlagParentId, "Parent Id", -1); - if (PageId == -1 && string.IsNullOrEmpty(PageName)) + this.PageId = this.GetFlagValue(FlagId, "Page Id", -1, false, true); + this.PageName = this.GetFlagValue(FlagName, "Page Name", string.Empty); + this.ParentId = this.GetFlagValue(FlagParentId, "Parent Id", -1); + if (this.PageId == -1 && string.IsNullOrEmpty(this.PageName)) { - AddMessage(LocalizeString("Prompt_ParameterRequired")); + this.AddMessage(this.LocalizeString("Prompt_ParameterRequired")); } } public override ConsoleResultModel Run() { var lst = new List(); - var tab = PageId != -1 - ? _tabController.GetTab(PageId, PortalId) - : (ParentId > 0 - ? _tabController.GetTabByName(PageName, PortalId, ParentId) - : _tabController.GetTabByName(PageName, PortalId)); + var tab = this.PageId != -1 + ? this._tabController.GetTab(this.PageId, this.PortalId) + : (this.ParentId > 0 + ? this._tabController.GetTabByName(this.PageName, this.PortalId, this.ParentId) + : this._tabController.GetTabByName(this.PageName, this.PortalId)); if (tab != null) { - if (!_securityService.CanManagePage(PageId)) + if (!this._securityService.CanManagePage(this.PageId)) { - return new ConsoleErrorResultModel(LocalizeString("MethodPermissionDenied")); + return new ConsoleErrorResultModel(this.LocalizeString("MethodPermissionDenied")); } - if (_contentVerifier.IsContentExistsForRequestedPortal(tab.PortalID, PortalSettings)) + if (this._contentVerifier.IsContentExistsForRequestedPortal(tab.PortalID, this.PortalSettings)) { lst.Add(new PageModel(tab)); - return new ConsoleResultModel { Data = lst, Records = lst.Count, Output = LocalizeString("Prompt_PageFound") }; + return new ConsoleResultModel { Data = lst, Records = lst.Count, Output = this.LocalizeString("Prompt_PageFound") }; } } - return new ConsoleErrorResultModel(LocalizeString("Prompt_PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("Prompt_PageNotFound")); } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GotoPage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GotoPage.cs index b3ce917e953..35a4646e180 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GotoPage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/GotoPage.cs @@ -30,31 +30,31 @@ public class Goto : ConsoleCommandBase public override void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { - PageId = GetFlagValue(FlagId, "Page Id", -1, false, true); - ParentId = GetFlagValue(FlagParentId, "Parent Id", -1); - PageName = GetFlagValue(FlagName, "Page Name", string.Empty); + this.PageId = this.GetFlagValue(FlagId, "Page Id", -1, false, true); + this.ParentId = this.GetFlagValue(FlagParentId, "Parent Id", -1); + this.PageName = this.GetFlagValue(FlagName, "Page Name", string.Empty); - if (PageId == -1 && string.IsNullOrEmpty(PageName)) + if (this.PageId == -1 && string.IsNullOrEmpty(this.PageName)) { - AddMessage(LocalizeString("Prompt_ParameterRequired")); + this.AddMessage(this.LocalizeString("Prompt_ParameterRequired")); } } public override ConsoleResultModel Run() { - var tab = PageId > 0 - ? TabController.Instance.GetTab(PageId, PortalId) - : (ParentId > 0 - ? TabController.Instance.GetTabByName(PageName, PortalId, ParentId) - : TabController.Instance.GetTabByName(PageName, PortalId)); + var tab = this.PageId > 0 + ? TabController.Instance.GetTab(this.PageId, this.PortalId) + : (this.ParentId > 0 + ? TabController.Instance.GetTabByName(this.PageName, this.PortalId, this.ParentId) + : TabController.Instance.GetTabByName(this.PageName, this.PortalId)); if (tab == null) { - return new ConsoleErrorResultModel(LocalizeString("Prompt_PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("Prompt_PageNotFound")); } - if (!SecurityService.Instance.CanManagePage(PageId)) + if (!SecurityService.Instance.CanManagePage(this.PageId)) { - return new ConsoleErrorResultModel(LocalizeString("MethodPermissionDenied")); + return new ConsoleErrorResultModel(this.LocalizeString("MethodPermissionDenied")); } return new ConsoleResultModel(tab.FullUrl) {MustReload = true}; } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/ListPages.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/ListPages.cs index 3ade6f00b52..2808affc31b 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/ListPages.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/ListPages.cs @@ -58,20 +58,20 @@ public class ListPages : ConsoleCommandBase public override void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { - ParentId = GetFlagValue(FlagParentId, "Parent Id", null, false, true, true); - Deleted = GetFlagValue(FlagDeleted, "Deleted", null); - PageVisible = GetFlagValue(FlagVisible, "Page Visible", null); - PageName = GetFlagValue(FlagName, "Page Name", string.Empty); - PageTitle = GetFlagValue(FlagTitle, "Page Title", string.Empty); - PagePath = GetFlagValue(FlagPath, "Page Path", string.Empty); - PageSkin = GetFlagValue(FlagSkin, "Page Skin", string.Empty); - Page = GetFlagValue(FlagPage, "Page", 1); - Max = GetFlagValue(FlagMax, "Max", 10); + this.ParentId = this.GetFlagValue(FlagParentId, "Parent Id", null, false, true, true); + this.Deleted = this.GetFlagValue(FlagDeleted, "Deleted", null); + this.PageVisible = this.GetFlagValue(FlagVisible, "Page Visible", null); + this.PageName = this.GetFlagValue(FlagName, "Page Name", string.Empty); + this.PageTitle = this.GetFlagValue(FlagTitle, "Page Title", string.Empty); + this.PagePath = this.GetFlagValue(FlagPath, "Page Path", string.Empty); + this.PageSkin = this.GetFlagValue(FlagSkin, "Page Skin", string.Empty); + this.Page = this.GetFlagValue(FlagPage, "Page", 1); + this.Max = this.GetFlagValue(FlagMax, "Max", 10); } public override ConsoleResultModel Run() { - var max = Max <= 0 ? 10 : (Max > 500 ? 500 : Max); + var max = this.Max <= 0 ? 10 : (this.Max > 500 ? 500 : this.Max); var lstOut = new List(); @@ -79,9 +79,9 @@ public override ConsoleResultModel Run() IEnumerable lstTabs; - lstTabs = PagesController.Instance.GetPageList(PortalSettings, Deleted, PageName, PageTitle, PagePath, PageSkin, PageVisible, ParentId ?? -1, out total, string.Empty, Page > 0 ? Page - 1 : 0, max, ParentId == null); + lstTabs = PagesController.Instance.GetPageList(this.PortalSettings, this.Deleted, this.PageName, this.PageTitle, this.PagePath, this.PageSkin, this.PageVisible, this.ParentId ?? -1, out total, string.Empty, this.Page > 0 ? this.Page - 1 : 0, max, this.ParentId == null); var totalPages = total / max + (total % max == 0 ? 0 : 1); - var pageNo = Page > 0 ? Page : 1; + var pageNo = this.Page > 0 ? this.Page : 1; lstOut.AddRange(lstTabs.Select(tab => new PageModelBase(tab))); return new ConsoleResultModel { @@ -93,7 +93,7 @@ public override ConsoleResultModel Run() PageSize = max }, Records = lstOut.Count, - Output = lstOut.Count == 0 ? LocalizeString("Prompt_NoPages") : "", + Output = lstOut.Count == 0 ? this.LocalizeString("Prompt_NoPages") : "", FieldOrder = new[] { "TabId", "ParentId", "Name", "Title", "Skin", "Path", "IncludeInMenu", "IsDeleted" diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/NewPage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/NewPage.cs index c1045912208..02f5226fe09 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/NewPage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/NewPage.cs @@ -52,20 +52,20 @@ public class NewPage : ConsoleCommandBase public override void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { - ParentId = GetFlagValue(FlagParentId, "Parent Id", null, false, false, true); - Title = GetFlagValue(FlagTitle, "Title", string.Empty); - Name = GetFlagValue(FlagName, "Page Name", string.Empty, true, true); - Url = GetFlagValue(FlagUrl, "Url", string.Empty); - Description = GetFlagValue(FlagDescription, "Description", string.Empty); - Keywords = GetFlagValue(FlagKeywords, "Keywords", string.Empty); - Visible = GetFlagValue(FlagVisible, "Visible", true); + this.ParentId = this.GetFlagValue(FlagParentId, "Parent Id", null, false, false, true); + this.Title = this.GetFlagValue(FlagTitle, "Title", string.Empty); + this.Name = this.GetFlagValue(FlagName, "Page Name", string.Empty, true, true); + this.Url = this.GetFlagValue(FlagUrl, "Url", string.Empty); + this.Description = this.GetFlagValue(FlagDescription, "Description", string.Empty); + this.Keywords = this.GetFlagValue(FlagKeywords, "Keywords", string.Empty); + this.Visible = this.GetFlagValue(FlagVisible, "Visible", true); // validate that parent ID is a valid ID, if it has been passed - if (!ParentId.HasValue) return; - var testTab = TabController.Instance.GetTab((int)ParentId, PortalId); + if (!this.ParentId.HasValue) return; + var testTab = TabController.Instance.GetTab((int)this.ParentId, this.PortalId); if (testTab == null) { - AddMessage(string.Format(LocalizeString("Prompt_UnableToFindSpecified"), FlagParentId, ParentId)); + this.AddMessage(string.Format(this.LocalizeString("Prompt_UnableToFindSpecified"), FlagParentId, this.ParentId)); } } @@ -75,15 +75,15 @@ public override ConsoleResultModel Run() try { var pageSettings = PagesController.Instance.GetDefaultSettings(); - pageSettings.Name = !string.IsNullOrEmpty(Name) ? Name : pageSettings.Name; - pageSettings.Title = !string.IsNullOrEmpty(Title) ? Title : pageSettings.Title; - pageSettings.Url = !string.IsNullOrEmpty(Url) ? Url : pageSettings.Url; - pageSettings.Description = !string.IsNullOrEmpty(Description) ? Description : pageSettings.Description; - pageSettings.Keywords = !string.IsNullOrEmpty(Keywords) ? Keywords : pageSettings.Keywords; - pageSettings.ParentId = ParentId.HasValue ? ParentId : pageSettings.ParentId; - pageSettings.HasParent = ParentId.HasValue; - pageSettings.IncludeInMenu = Visible ?? pageSettings.IncludeInMenu; - pageSettings.IncludeInMenu = Visible ?? true; + pageSettings.Name = !string.IsNullOrEmpty(this.Name) ? this.Name : pageSettings.Name; + pageSettings.Title = !string.IsNullOrEmpty(this.Title) ? this.Title : pageSettings.Title; + pageSettings.Url = !string.IsNullOrEmpty(this.Url) ? this.Url : pageSettings.Url; + pageSettings.Description = !string.IsNullOrEmpty(this.Description) ? this.Description : pageSettings.Description; + pageSettings.Keywords = !string.IsNullOrEmpty(this.Keywords) ? this.Keywords : pageSettings.Keywords; + pageSettings.ParentId = this.ParentId.HasValue ? this.ParentId : pageSettings.ParentId; + pageSettings.HasParent = this.ParentId.HasValue; + pageSettings.IncludeInMenu = this.Visible ?? pageSettings.IncludeInMenu; + pageSettings.IncludeInMenu = this.Visible ?? true; if (pageSettings.ParentId != null) { var parentTab = PagesController.Instance.GetPageSettings(pageSettings.ParentId.Value); @@ -95,9 +95,9 @@ public override ConsoleResultModel Run() if (!SecurityService.Instance.CanSavePageDetails(pageSettings)) { - return new ConsoleErrorResultModel(LocalizeString("MethodPermissionDenied")); + return new ConsoleErrorResultModel(this.LocalizeString("MethodPermissionDenied")); } - var newTab = PagesController.Instance.SavePageDetails(PortalSettings, pageSettings); + var newTab = PagesController.Instance.SavePageDetails(this.PortalSettings, pageSettings); // create the tab var lstResults = new List(); @@ -107,14 +107,14 @@ public override ConsoleResultModel Run() } else { - return new ConsoleErrorResultModel(LocalizeString("Prompt_PageCreateFailed")); + return new ConsoleErrorResultModel(this.LocalizeString("Prompt_PageCreateFailed")); } - return new ConsoleResultModel(LocalizeString("Prompt_PageCreated")) { Data = lstResults, Records = lstResults.Count }; + return new ConsoleResultModel(this.LocalizeString("Prompt_PageCreated")) { Data = lstResults, Records = lstResults.Count }; } catch (PageNotFoundException) { - return new ConsoleErrorResultModel(LocalizeString("PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("PageNotFound")); } catch (PageValidationException ex) { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/SetPage.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/SetPage.cs index a1f1d098ec3..c2e6c9a21c7 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/SetPage.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Commands/SetPage.cs @@ -56,17 +56,17 @@ public class SetPage : ConsoleCommandBase public override void Init(string[] args, PortalSettings portalSettings, UserInfo userInfo, int activeTabId) { - PageId = GetFlagValue(FlagId, "Page Id", -1, true, true, true); - ParentId = GetFlagValue(FlagParentId, "Parent Id", null); - Title = GetFlagValue(FlagTitle, "Title", string.Empty); - Name = GetFlagValue(FlagName, "Page Name", string.Empty); - Url = GetFlagValue(FlagUrl, "Url", string.Empty); - Description = GetFlagValue(FlagDescription, "Description", string.Empty); - Keywords = GetFlagValue(FlagKeywords, "Keywords", string.Empty); - Visible = GetFlagValue(FlagVisible, "Visible", null); - if (string.IsNullOrEmpty(Title) && string.IsNullOrEmpty(Name) && string.IsNullOrEmpty(Description) && string.IsNullOrEmpty(Keywords) && string.IsNullOrEmpty(Url) && !ParentId.HasValue && !Visible.HasValue) + this.PageId = this.GetFlagValue(FlagId, "Page Id", -1, true, true, true); + this.ParentId = this.GetFlagValue(FlagParentId, "Parent Id", null); + this.Title = this.GetFlagValue(FlagTitle, "Title", string.Empty); + this.Name = this.GetFlagValue(FlagName, "Page Name", string.Empty); + this.Url = this.GetFlagValue(FlagUrl, "Url", string.Empty); + this.Description = this.GetFlagValue(FlagDescription, "Description", string.Empty); + this.Keywords = this.GetFlagValue(FlagKeywords, "Keywords", string.Empty); + this.Visible = this.GetFlagValue(FlagVisible, "Visible", null); + if (string.IsNullOrEmpty(this.Title) && string.IsNullOrEmpty(this.Name) && string.IsNullOrEmpty(this.Description) && string.IsNullOrEmpty(this.Keywords) && string.IsNullOrEmpty(this.Url) && !this.ParentId.HasValue && !this.Visible.HasValue) { - AddMessage(string.Format(LocalizeString("Prompt_NothingToUpdate"), FlagTitle, FlagDescription, FlagName, FlagVisible)); + this.AddMessage(string.Format(this.LocalizeString("Prompt_NothingToUpdate"), FlagTitle, FlagDescription, FlagName, FlagVisible)); } } @@ -74,30 +74,30 @@ public override ConsoleResultModel Run() { try { - var pageSettings = PagesController.Instance.GetPageSettings(PageId, PortalSettings); + var pageSettings = PagesController.Instance.GetPageSettings(this.PageId, this.PortalSettings); if (pageSettings == null) { - return new ConsoleErrorResultModel(LocalizeString("PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("PageNotFound")); } - pageSettings.Name = !string.IsNullOrEmpty(Name) ? Name : pageSettings.Name; - pageSettings.Title = !string.IsNullOrEmpty(Title) ? Title : pageSettings.Title; - pageSettings.Url = !string.IsNullOrEmpty(Url) ? Url : pageSettings.Url; - pageSettings.Description = !string.IsNullOrEmpty(Description) ? Description : pageSettings.Description; - pageSettings.Keywords = !string.IsNullOrEmpty(Keywords) ? Keywords : pageSettings.Keywords; - pageSettings.ParentId = ParentId.HasValue ? ParentId : pageSettings.ParentId; - pageSettings.IncludeInMenu = Visible ?? pageSettings.IncludeInMenu; + pageSettings.Name = !string.IsNullOrEmpty(this.Name) ? this.Name : pageSettings.Name; + pageSettings.Title = !string.IsNullOrEmpty(this.Title) ? this.Title : pageSettings.Title; + pageSettings.Url = !string.IsNullOrEmpty(this.Url) ? this.Url : pageSettings.Url; + pageSettings.Description = !string.IsNullOrEmpty(this.Description) ? this.Description : pageSettings.Description; + pageSettings.Keywords = !string.IsNullOrEmpty(this.Keywords) ? this.Keywords : pageSettings.Keywords; + pageSettings.ParentId = this.ParentId.HasValue ? this.ParentId : pageSettings.ParentId; + pageSettings.IncludeInMenu = this.Visible ?? pageSettings.IncludeInMenu; if (!SecurityService.Instance.CanSavePageDetails(pageSettings)) { - return new ConsoleErrorResultModel(LocalizeString("MethodPermissionDenied")); + return new ConsoleErrorResultModel(this.LocalizeString("MethodPermissionDenied")); } - var updatedTab = PagesController.Instance.SavePageDetails(PortalSettings, pageSettings); + var updatedTab = PagesController.Instance.SavePageDetails(this.PortalSettings, pageSettings); var lstResults = new List { new PageModel(updatedTab) }; - return new ConsoleResultModel(LocalizeString("PageUpdatedMessage")) { Data = lstResults, Records = lstResults.Count }; + return new ConsoleResultModel(this.LocalizeString("PageUpdatedMessage")) { Data = lstResults, Records = lstResults.Count }; } catch (PageNotFoundException) { - return new ConsoleErrorResultModel(LocalizeString("PageNotFound")); + return new ConsoleErrorResultModel(this.LocalizeString("PageNotFound")); } catch (PageValidationException ex) { diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModel.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModel.cs index 898e55bb7ed..8667fe2e5a5 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModel.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModel.cs @@ -16,10 +16,10 @@ public PageModel() } public PageModel(DotNetNuke.Entities.Tabs.TabInfo tab): base(tab) { - Container = tab.ContainerSrc; - Url = tab.Url; - Keywords = tab.KeyWords; - Description = tab.Description; + this.Container = tab.ContainerSrc; + this.Url = tab.Url; + this.Keywords = tab.KeyWords; + this.Description = tab.Description; } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModelBase.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModelBase.cs index 27d94814110..405739d5bb4 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModelBase.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Prompt/Models/PageModelBase.cs @@ -16,13 +16,13 @@ public class PageModelBase public bool IsDeleted { get; set; } #region Command Links - public string __TabId => $"get-page {TabId}"; + public string __TabId => $"get-page {this.TabId}"; - public string __ParentId => $"list-pages --parentid {ParentId}"; + public string __ParentId => $"list-pages --parentid {this.ParentId}"; - public string __IncludeInMenu => $"list-pages --visible{(IncludeInMenu ? "" : " false")}"; + public string __IncludeInMenu => $"list-pages --visible{(this.IncludeInMenu ? "" : " false")}"; - public string __IsDeleted => $"list-pages --deleted{(IsDeleted ? "" : " false")}"; + public string __IsDeleted => $"list-pages --deleted{(this.IsDeleted ? "" : " false")}"; #endregion @@ -32,14 +32,14 @@ public PageModelBase() } public PageModelBase(DotNetNuke.Entities.Tabs.TabInfo tab) { - Name = tab.TabName; - ParentId = tab.ParentId; - Path = tab.TabPath; - TabId = tab.TabID; - Skin = tab.SkinSrc; - Title = tab.Title; - IncludeInMenu = tab.IsVisible; - IsDeleted = tab.IsDeleted; + this.Name = tab.TabName; + this.ParentId = tab.ParentId; + this.Path = tab.TabPath; + this.TabId = tab.TabID; + this.Skin = tab.SkinSrc; + this.Title = tab.Title; + this.IncludeInMenu = tab.IsVisible; + this.IsDeleted = tab.IsDeleted; } #endregion } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Security/SecurityService.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Security/SecurityService.cs index 6319e873b4d..106264b7f1f 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Security/SecurityService.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/Security/SecurityService.cs @@ -25,7 +25,7 @@ public class SecurityService : ISecurityService public SecurityService() { - _tabController = TabController.Instance; + this._tabController = TabController.Instance; } public static ISecurityService Instance @@ -50,7 +50,7 @@ public virtual bool IsPageAdminUser() public virtual bool IsVisible(MenuItem menuItem) { - return IsPageAdminUser() || CanViewPageList(menuItem.MenuId); + return this.IsPageAdminUser() || this.CanViewPageList(menuItem.MenuId); } private bool IsPageAdmin() @@ -101,38 +101,38 @@ public virtual JObject GetPagePermissions(TabInfo tab) public virtual bool CanAdminPage(int tabId) { - return IsPageAdminUser() || TabPermissionController.CanAdminPage(GetTabById(tabId)); + return this.IsPageAdminUser() || TabPermissionController.CanAdminPage(this.GetTabById(tabId)); } public virtual bool CanManagePage(int tabId) { - return CanAdminPage(tabId) || TabPermissionController.CanManagePage(GetTabById(tabId)); + return this.CanAdminPage(tabId) || TabPermissionController.CanManagePage(this.GetTabById(tabId)); } public virtual bool CanDeletePage(int tabId) { - return CanAdminPage(tabId) || TabPermissionController.CanDeletePage(GetTabById(tabId)); + return this.CanAdminPage(tabId) || TabPermissionController.CanDeletePage(this.GetTabById(tabId)); } public virtual bool CanAddPage(int tabId) { - return CanAdminPage(tabId) || TabPermissionController.CanAddPage(GetTabById(tabId)); + return this.CanAdminPage(tabId) || TabPermissionController.CanAddPage(this.GetTabById(tabId)); } public virtual bool CanCopyPage(int tabId) { - return CanAdminPage(tabId) || TabPermissionController.CanCopyPage(GetTabById(tabId)); + return this.CanAdminPage(tabId) || TabPermissionController.CanCopyPage(this.GetTabById(tabId)); } public virtual bool CanExportPage(int tabId) { - return CanAdminPage(tabId) || TabPermissionController.CanExportPage(GetTabById(tabId)); + return this.CanAdminPage(tabId) || TabPermissionController.CanExportPage(this.GetTabById(tabId)); } public virtual bool CanViewPageList(int menuId) { var permissions = MenuPermissionController.GetMenuPermissions(PortalSettings.Current.PortalId, menuId); - return MenuPermissionController.HasMenuPermission(new MenuPermissionCollection(permissions), "VIEW_PAGE_LIST") || IsPageAdmin(); + return MenuPermissionController.HasMenuPermission(new MenuPermissionCollection(permissions), "VIEW_PAGE_LIST") || this.IsPageAdmin(); } public virtual bool CanSavePageDetails(PageSettings pageSettings) @@ -155,12 +155,12 @@ public virtual bool CanSavePageDetails(PageSettings pageSettings) } return ( - IsPageAdminUser() || - creatingPage && CanAddPage(parentId) && !creatingTemplate || - creatingTemplate && CanExportPage(pageSettings.TemplateTabId) || - updatingPage && CanManagePage(tabId) && !updatingParentPage || - updatingParentPage && CanManagePage(tabId) && CanAddPage(parentId) || - duplicatingPage && CanCopyPage(pageSettings.TemplateTabId) && CanAddPage(parentId) + this.IsPageAdminUser() || + creatingPage && this.CanAddPage(parentId) && !creatingTemplate || + creatingTemplate && this.CanExportPage(pageSettings.TemplateTabId) || + updatingPage && this.CanManagePage(tabId) && !updatingParentPage || + updatingParentPage && this.CanManagePage(tabId) && this.CanAddPage(parentId) || + duplicatingPage && this.CanCopyPage(pageSettings.TemplateTabId) && this.CanAddPage(parentId) ); } @@ -173,7 +173,7 @@ public virtual bool IsAdminHostSystemPage() private TabInfo GetTabById(int pageId) { var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); - return pageId <= 0 ? new TabInfo() : _tabController.GetTab(pageId, portalSettings.PortalId, false); + return pageId <= 0 ? new TabInfo() : this._tabController.GetTab(pageId, portalSettings.PortalId, false); } } } diff --git a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/TemplateController.cs b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/TemplateController.cs index 120bbba083d..e0f5f407bfe 100644 --- a/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/TemplateController.cs +++ b/Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Pages/TemplateController.cs @@ -31,7 +31,7 @@ public class TemplateController : ServiceLocator GetTemplates() var portalSettings = PortalController.Instance.GetCurrentPortalSettings(); var templateFolder = FolderManager.Instance.GetFolder(portalSettings.PortalId, TemplatesFolderPath); - return LoadTemplates(portalSettings.PortalId, templateFolder); + return this.LoadTemplates(portalSettings.PortalId, templateFolder); } private IEnumerable